We switch our shop live (changed domain, cleared cache) and now ajax requests returns empty blocks.

Problem accrued with the Hardik/Ajaxcart extension. If you add an article to your cart it makes a ajax request and updates some blocks in the view.

Ajax requests is ok and does return data but blocks are missing:


Here the blocks are supposed to load in Hardik_Ajaxcart_Model_Response::addUpdatedBlocks()

    $updated_blocks = unserialize(Mage::getStoreConfig('ajaxcart/general/update_blocks'));

    if ($updated_blocks) {
        $layout = Mage::getSingleton('core/layout');
        $res = array();

        foreach ($updated_blocks['id'] as $index => $block) {
            $value = $layout->getBlock($updated_blocks['xml'][$index]);

Settings are loaded into $updated_blocks but $layout->getBlock() returns nothing.


Could this be apache config or proxy?

Via:1.1 rproxy (squid)
X-Cache:MISS from rproxy

Update 2

Looks like proxy is eating POST parameters...

  • Do you have any clue from hardik ? did you try recompile ? Oct 9, 2014 at 12:32
  • try contacting hardik for the error
    – Dexter
    Oct 9, 2014 at 13:02
  • recompile? what do you mean? The hardik extension works locally just fine (same files, db and url) but not on live server. Oct 9, 2014 at 13:02

1 Answer 1


Turns out there was an additional / in Apache URL rewrites that caused the POST parameters to get lost. Without the POST parameters ajax query did not load the those blocks.

  • Why do the POST parameters matter? the cart gets updated perfectly in a normal page reload. It's just the getBlock doesn't return anything. So that means the POST parameters reached their destination. How do they relate to each other?
    – Milind R
    Feb 5, 2015 at 6:19
  • @MilindR This shop was using the Hardik_Ajaxcart extension to reload the cart dynamically. Feb 5, 2015 at 13:18
  • I am also using the same extension. the getBlock() function is failing (returning bool(false))for any blockname. Can you tell me which line in .htaccess is the URL rewrite you're talking about?
    – Milind R
    Feb 5, 2015 at 14:07
  • the worst part is that the AJAX response doesn't even have the JSON object with the updated block names.
    – Milind R
    Feb 5, 2015 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.