xhr.responsetext returns null or indefined

230 Views Asked by At

In the Magento site we are developping the error - Exception:TypeError:Cannot read property ínnerHTML'of undefined - shows when we use the MDL ajax cart. I found out that the extension Total Slider Manager which uses ajax also influences the issue. When I set the module to false in app/etc/modules, the cart works normally. The extension code is encrypted and the developer had a look but didn't come with a solution.

This is the code which induces the error:

        onComplete: function (xhr)
        {
            var responseHTML = xhr.responseText;
            $('mdl-temp-div').innerHTML = responseHTML;

            var return_message = $('mdl-temp-div').down('.mdl_ajax_message').innerHTML;

            var middle_text = '<div class="mdl-cart-bts">'+$('mdl-temp-div').down('.back-ajax-add').innerHTML+'</div>';

            $('mdl_ajax_confirm').innerHTML = '<div id="mdl_ajax_confirm_wrapper">'+return_message + middle_text + '</div>';

            var link_cart_txt = $('mdl-temp-div').down('.cart_content').innerHTML;

            $$('.top-link-cart').each(function (el){
                el.innerHTML = link_cart_txt;
            });

The responsetext returns Null or undefined. (It is probably set to undefined in the Total Slider Manager module). Is there a way to get the responseText for this function on this page?

1

There are 1 best solutions below

0
On

I had the same problem with a theme from Magestore which uses an ajax cart for the checkout process. Also, I have like you the extension Total Slider Manager.

You have to comment line 9 in mdlajaxcheckout.xml which removes the head of your website :

<!--<remove name="head"/> -->
<remove name="header"/>
<remove name="footer"/>
<remove name="left"/>
<remove name="right"/>
<remove name="before_body_end"/>

Try this, it works very well for me.