Try
....
$loadLayout = $this->loadLayout();
$block = $loadLayout->createBlock(
'checkout/cart_shipping',
'checkout.cart.shipping.ajax'
)->setTemplate('checkout/cart/shipping.phtml');
if($block) {
$response = array();
$response['shipping'] = $block->toHtml();
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
}
....
Looks like your admin route declaration is incorrect. Try this:
<admin>
<routers>
<adminhtml>
<args>
<modules>
<TwilitGrotto_AutoCustomerLookup after="Mage_Adminhtml">TwilitGrotto_AutoCustomerLookup</TwilitGrotto_AutoCustomerLookup>
</modules>
</args>
</adminhtml>
</routers>
</admin>
Here is a good article on the topic: Magento Admin Hello World Revisited
EDIT:
I'm posting a working solution below:
File: TwilitGrotto\AutoCustomerLookup\etc\adminhtml.xml
<?xml version="1.0"?>
<config>
<acl>
<resources>
<admin>
<children>
<sales>
<children>
<twilitgrotto_autocustomerlookup translate="title" module="twilitgrotto_autocustomerlookup">
<title>Auto Customer Lookup</title>
</twilitgrotto_autocustomerlookup>
</children>
</sales>
</children>
</admin>
</resources>
</acl>
</config>
File: TwilitGrotto\AutoCustomerLookup\etc\config.xml
<?xml version="1.0"?>
<config>
<modules>
<TwilitGrotto_AutoCustomerLookup>
<version>1.0.0.0</version>
</TwilitGrotto_AutoCustomerLookup>
</modules>
<global>
<helpers>
<twilitgrotto_autocustomerlookup>
<class>TwilitGrotto_AutoCustomerLookup_Helper</class>
</twilitgrotto_autocustomerlookup>
</helpers>
</global>
<adminhtml>
<layout>
<updates>
<twilitgrotto>
<file>twilitgrotto_autocustomerlookup_layout.xml</file>
</twilitgrotto>
</updates>
</layout>
</adminhtml>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<TwilitGrotto_AutoCustomerLookup after="Mage_Adminhtml">TwilitGrotto_AutoCustomerLookup_Adminhtml</TwilitGrotto_AutoCustomerLookup>
</modules>
</args>
</adminhtml>
</routers>
</admin>
</config>
File: TwilitGrotto\AutoCustomerLookup\controllers\Adminhtml\Autocustomerlookup\AddressController.php
<?php
class TwilitGrotto_AutoCustomerLookup_Adminhtml_Autocustomerlookup_AddressController
extends Mage_Adminhtml_Controller_Action
{
public function checkEmailExistsAction()
{
$emailAddress = $this->getRequest()->getParam('emailAddress');
$result = Mage::helper('twilitgrotto_autocustomerlookup')->checkEmailExists($emailAddress);
$this->getResponse()->setBody($result);
}
protected function _isAllowed()
{
return Mage::getSingleton('admin/session')->isAllowed('sales/twilitgrotto_autocustomerlookup');
}
}
Controller URL: Mage::getUrl('adminhtml/autocustomerlookup_address/checkEmailExists');
Best Answer
You can try following way to create new block inside controller