blog

Magento Upsell List Add To Cart

published in

Magento, Web Development

comments

0

By default, Magento’s upsell products do not display an add to cart button, they only allow you to click through to the product. In some instances, because the point of an upsell is to move the user away from the product they are looking at and to a better or more expensive product; we want them to navigate away from what they are currently viewing or even better, to add the upsell product to cart.

To add a Add To Cart button to the upsell products in Enterprise Edition

Locate the file: /app/design/frontend/enterprise/yourtheme/template/targetrule/catalog/product/list/upsell.phtml and add in this code:

// Add to Cart Button
<button type="button" class="form-button add-to-cart" onclick="window.location='<?php echo $this->getAddToCartUrl($_item) ?>';"><span><?php echo $this->__('buy') ?></span></button>

To add a Add To Cart button to the upsell products in Community Edition

Locate the file: /app/design/frontend/enterprise/yourtheme/template/catalog/product/list/upsell.phtml and add in this code:

// Add to Cart Button
<button type="button" class="form-button add-to-cart" onclick="window.location='<?php echo $this->getAddToCartUrl($_link) ?>';"><span><?php echo $this->__('buy') ?></span></button>

Feel free to add the button where ever you need inside this file.

This entry was posted in Magento, Web Development and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>