I create ajaxDeleteProduct function, it's ok, but it not render layout after success, please help me fix it

My function

public function ajaxDeleteAction()
    $id = (int) $this->getRequest()->getParam('id');
    $result = array();
    if ($id) {
        try {

            $result['qty'] = $this->_getCart()->getSummaryQty();

            $result['content'] = $this->getLayout()->getBlock('minicart_content')->toHtml();
            $result['toplink'] = $this->getLayout()->getBlock('top.links')->toHtml();
            $result['success'] = 1;
            Mage::dispatchEvent('ajax_cart_remove_item_success', array('id' => $id));
        } catch (Exception $e) {
            $result['success'] = 0;

    $this->getResponse()->setHeader('Content-type', 'application/json');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.