5

I've been trying to fix a problem on an inherited Magento 1.9.1 site - the problem is coming from a custom category page I think.

The template is using the Add to Cart Helper - in what appears to be the same way as the working product list template.

On this page: http://www.trevorsorbie.com/shop/ranges.html, if you click the Add to Cart button on any product nothing is added to cart. If you log in to your account and click that button it does add to cart..

But this is working on this page: http://www.trevorsorbie.com/shop/products.html

On the ranges.html page I've used:

<a class="btn btn-sm add-to-cart-alt" href="<?php echo Mage::helper('checkout/cart')->getAddUrl($_product)?>" title="Add Product to Cart">
    <i class="fa fa-shopping-cart"></i>
    <i class="fa fa-spinner fa-spin"></i>
    <span class="sr-only">Buy</span>
</a>

Any information or pointing me at reading material to fix this will be much appreciated!

  • So, what exactly is your requirement? Do you want trevorsorbie.com/shop/products.html link act like the above one? – Rahul Kumar Das Jun 9 '15 at 10:13
  • Do you want to hide add to cart if customer is not logged in? – Rahul Kumar Das Jun 9 '15 at 10:14
  • If you click the Cart button on any product trevorsorbie.com/shop/ranges.html nothing is added to cart. If you log in to your account and click that button it does add to cart. I'm trying to work out why it is not working on that page. – Conor Cussell Jun 9 '15 at 10:18
  • It's not in helper, it could be in phtml files. Follow the link I given in answer, check the addtocart.phtml file – Rahul Kumar Das Jun 9 '15 at 10:20
  • Its using this add to cart button - not coming from addtocart.phtml I think <a class="btn btn-sm add-to-cart-alt" href="<?php echo Mage::helper('checkout/cart')->getAddUrl($_product)?>" title="Add Product to Cart"> <i class="fa fa-shopping-cart"></i> <i class="fa fa-spinner fa-spin"></i> <span class="sr-only">Buy</span> </a> – Conor Cussell Jun 9 '15 at 10:25
0

If you want to hide Add-to-Cart button for not logged-in customers, then following link might help you:

  • I would like it to show - I just can't work out why it is not adding a product to the cart unless you are logged in. – Conor Cussell Jun 9 '15 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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