0

We have just installed our magento site however we are getting ready to start an indegogo campaign to start gain funding. What we would like to do is allow someone to click on a link (eg. Add to cart) and have it send them to our indegogo campaign for the time being.

We are fairly new to Magento CE and using 1.9 currently. So any help would be appreciated.

1

There are two different areas you will need to change:

  1. In listing page:

Go to app/design/frontend/{package}/{theme}/template/catalog/product/list.phtml and 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->__('Your Text') ?>" class="button btn-cart" onclick="setLocation('http://www.exmaple.com')"><span><span><?php echo $this->__('Your Text') ?></span></span></button>
  1. In product view page

app/design/frontend/{package}/{theme}/template/catalog/product/view/addtocart.phtml

Hope this helps

|improve this answer|||||
  • I will try this out first thing in the morning. Thank you for the quick answer. I will post an update as soon as I get in. – WyzrdX May 20 '16 at 3:44
  • I have changed the list.phtml and there were 2 occurrences of the same code. However, in the addtocart.phtml the only reference I could find for the button was <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button> Is this what I need to change in here? – WyzrdX May 20 '16 at 13:19
  • Yes, you can change and see if that helps. – Adarsh Khatri May 20 '16 at 13:21
  • OK When I click on the product and it takes me to the product page the button works as expected. However on the grid page showing all products, I still have the add to cart. – WyzrdX May 20 '16 at 13:37
  • What's your url? – Adarsh Khatri May 20 '16 at 13:37

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.