I have been configuring my store for a few days now and everything was going smoothly but for some reason now the default shopping cart button (My Cart) does not actually redirect to the shopping cart (/checkout/cart/), it simply just redirects to “#”. Ie, the actual html behind the button looks like:

<a id="cartHeader" href="#"><span class="title-cart">My Cart</span><strong class="amount">(1</strong>)</a>

I don’t know if it was a setting I changed but I wouldn’t think this would be an issue. Any help would be gratefully received.

  • Are you using custom theme ? normal code for add to cart button have onclick event with code like : onclick="setLocation('localhost/magento/index.php/checkout/cart/add/uenc/…)" Oct 25, 2013 at 4:28
  • Yeah it's a custom theme, but I was sure it was working before and I haven't changed anything. Oct 26, 2013 at 20:09
  • Check your theme file with basic file for code comparison.I think theme is not fully completed for magento code. Oct 27, 2013 at 5:58

2 Answers 2


According to your code, there is no event attached to it.
Look in below mentioned file for default magento code for add to cart button


  • I'll have a look in that file and see if I can spot any issues. Oct 26, 2013 at 20:09

The problem is that your link doesn't call the cart

the href="#" will allow you to click but will not go anywhere.

You should be using:

<?php echo $this->getChildHtml('addtocart') ?>

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