1

In both product listings (e.g. the category page) and the product view page, I need to replace the button "Add to Cart" with an "enquire" button which links to the "Contact Us" page.

Please help me to find a solution.

  • These two points are confusing, one way you are saying enquire should work as add to cart and in the second one enquire to redirect to contact us page? – TBI Infotech Aug 4 '14 at 4:33
  • Hi, Thanks a lot for your reply. NO, Enquiry should not work as ADD TO CART. it should link to contact us page. Let me know if you have any queries? hope it's clear now. – Baby in Magento Aug 4 '14 at 4:41
  • Ok, It means no add to cart button just enquir button? – TBI Infotech Aug 4 '14 at 4:58
  • just enquire button, you are right. that enquire button should link to contact us page. – Baby in Magento Aug 4 '14 at 5:01
  • I rewrote your question so it's more clear what you want to do. Please clarify in the comments if I didn't understand you correctly. – Matthias Zeis Aug 4 '14 at 5:32
4

Edit the file app/design/frontend/{package}/{theme}/template/catalog/product/list.phtml.
Change this:

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>

to this

<button type="button" title="<?php echo $this->__('Enquire') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getUrl('contacts') ?>')"><span><span><?php echo $this->__('Enquire') ?></span></span></button>
  • Hi, Thanks a lot , how to link that enquire to contact us page in both catalog and product view page. – Baby in Magento Aug 4 '14 at 5:53
  • I just explained this. See the code. I replaced the url also. – Marius Aug 4 '14 at 5:54
  • Hi, Thanks a lot for your reply. It's worked fine, How to get same result from Product view page.? – Baby in Magento Aug 4 '14 at 6:45
  • Use template path hints and see what file you need to modify: pauldonnelly.net/magento-turning-on-template-path-hints – Marius Aug 4 '14 at 6:46
  • Thanks a lot. I think i have to edit view.phtml or addtocart.phtml but I don't know to what code to edit, can you please help me. Thanks in advance. – Baby in Magento Aug 4 '14 at 6:48

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.