magento 1.9 – AjaxcartPro keeps redirect instead of showing form confirmation

First im sorry for my english !

I was struggling with ajaxcartPro for the past few weeks , and cannot find anything related to in my research. After debugging all the features , i managed to find a quick (and i think clean) fix , hope it can save you some hours of work

The problem was as follows,

when adding a product to the cart, ajaxCartPro takes care of adding it and returns a confirmation popup , but in my case , the popup doesnt showed up , and instead , i got redirected to the product page

Ajax cart pro need 2 calls in ajax to work :

The first one add to cart :

enter image description here

Response :

enter image description here

The second one is for retrieving the confirmation popup html code :

enter image description here

Response :

enter image description here

But in my case , the second return was this :

enter image description here

The report in ajax response :

a:5:{i:0;s:110:”Cannot send headers; headers already sent in /var/www/html/lib/Zend/Controller/Response/Abstract.php, line 588″;i:1;s:939:”#0 /var/www/html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /var/www/html/app/code/core/Mage/Cms/controllers/IndexController.php(71): Zend_Controller_Response_Abstract->setHeader(‘HTTP/1.1’, ‘404 Not Found’)
#2 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->noRouteAction()
#3 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch(‘noRoute’)
#4 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /var/www/html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#6 /var/www/html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /var/www/html/index.php(83): Mage::run(”, ‘store’)
#8 {main}”;s:3:”url”;s:344:”/cloches-anterieures-lisses-42637.html?actionData=%7B%22added_product%22%3A%2239151%22%2C%22parent_product%22%3A%2242637%22%7D&block%5B%5D=cart&block%5B%5D=sidebar&block%5B%5D=topLinks&block%5B%5D=skipLinks&block%5B%5D=wishlist&block%5B%5D=miniWishlist&block%5B%5D=addProductConfirmation&block%5B%5D=removeProductConfirmation&awacp=1&no_cache=1″;s:11:”script_name”;s:10:”/index.php”;s:4:”skin”;s:2:”fr”;}

The quick fix is located in ajaxcartpro.js

In the sendRequest function (l.205)

enter image description here

In the case of adding a product , the url was the product view html page url = '/product-page.html' , wich seems to lead to this report because no controller in view can handle thoses parameters , and lead to an 401 not found
I simply added a few lines who force url to ping checkout controller and now its works

enter image description here

if(url.startsWith('/')) {
        url = location.origin + '/checkout/cart' + url;
    }

Ps : i checked at first the back config and changing the redirect to cart or product page seems to do nothing in my case.

Hope it helped you , and im open to discuss other solutions , but for now thats the only one i finded !