3

In order to show add to cart button in up sell products i have added an upsell.phtml file inside app/design/frontend/your_package/your_theme/template/catalog/product/list/

my code for upsell.phtml file is

<form action="<?php echo $this->getAddToCartUrl($_link) ?>" method="post" 
id="product_addtocart_form_<?php echo $_link->getId()?>"<?php if($_link-
>getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

<?php if(!$_link->isGrouped()): ?>
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo 
($this->getMinimalQty($_link)?$this->getMinimalQty($_link):1) ?>" />
<label for="qty"><?php echo $this->__('Qty') ?>:</label>
<?php endif; ?>
<button type="button" onclick="this.form.submit()"><span><span><span><?php echo $this->__('Add to Cart') ?></span></span></span></button>

Unfortunately add to cart button is not showing up in upsell.phtml file. Please help me achieve this, thanks

2

find the items.phtml file in module catalog using template path hints ,here you can configure each products type (related,cross cell and up sell) inside switch case statements.select the product type and change:

$showCart = true;.

I recommend to extend the module in custom theme directory.This worked for me perfectly in product view page.

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.