0

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.

closed as off-topic by SR_Magento, Keyul Shah, Amit Bera, brentwpeterson, Rajeev K Tomy Jun 15 '15 at 1:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: http://sscce.org/" – SR_Magento, Keyul Shah, Amit Bera, brentwpeterson, Rajeev K Tomy
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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/…)" – Mahmood Rehman Oct 25 '13 at 4:28
  • Yeah it's a custom theme, but I was sure it was working before and I haven't changed anything. – anothershrubery Oct 26 '13 at 20:09
  • Check your theme file with basic file for code comparison.I think theme is not fully completed for magento code. – Mahmood Rehman Oct 27 '13 at 5:58
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

app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml

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

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.