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.

7ochem
  • 7,532
  • 14
  • 51
  • 80
Baby in Magento
  • 3,167
  • 16
  • 83
  • 221

1 Answers1

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>
Marius
  • 197,939
  • 53
  • 422
  • 830
  • Hi, Thanks a lot , how to link that enquire to contact us page in both catalog and product view page. – Baby in Magento Aug 04 '14 at 05:53
  • I just explained this. See the code. I replaced the url also. – Marius Aug 04 '14 at 05: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 04 '14 at 06:45
  • Use template path hints and see what file you need to modify: http://www.pauldonnelly.net/magento-turning-on-template-path-hints/ – Marius Aug 04 '14 at 06: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 04 '14 at 06:48
  • You need to remove the qty box and replace the onlick event on the button with setLocation('<?php echo $this->getUrl('contacts') ?>') – Marius Aug 04 '14 at 06:50
  • This is what i did in addtocart.phtml , but it's not working. <button type="button" title="" class="button btn-cart" setLocation('getUrl('contacts') ?>')> – Baby in Magento Aug 04 '14 at 06:53
  • Can you please help me, where i have to replace the code setLocation('getUrl('contacts') ?>') to get same result in product view page also. – Baby in Magento Aug 04 '14 at 07:26
  • Instead of productAddToCartForm.submit(this) in addtocart.phtml – Marius Aug 04 '14 at 07:33