I’m using the Magento Shopper Theme (http://shopper.queldorei.com/).
When I add a product to my shops cart, it adds multiple elemtns of
<div class="cart-top-title">
<a href="https://droppinstudio.dk/horsepony/index.php/checkout/cart/" class="clearfix">
<span class="icon"></span>Cart</a></div>
I’ve figured out that it is the jQuery that makes the mistake here:
function setLocationAjax(url, id)
{
...
if (data.status != 'ERROR' && $('.cart-top-container').length) {
$('.cart-top-container').replaceWith(data.cart_top);
}
...
}
Does anybody have a good idea of what to do to fix this?
Thank you Erwin, that helped me figure out what is wrong.
The CartController is located in app/code/local/Excellence/Ajax/controllers/ and is actually named IndexController.php.
Line 52-54 sets the data.cart_top response:
A fix could be to change the way the cart_top block is designed, and remove the ‘cart-top-title’ from cart_top.phtml and put it in a file of its own and include it in header.phtml.
Turns out the acutal replacement happens in line 85 of ajaxcart.js (function setLocationAjax).
A quick fix for me was to delete the div with jQuery like so:
js file here: skin/frontend/default/shopper/js/ajaxcart/ajaxcart.js
cart_top.phtml here: app/design/frontend/default/shopper/template/checkout/cart/cart-top.phtml
header.phtml here: app/design/frontend/default/shopper/template/page/html/header.phtml