I have a website, sell a products with and without installation service. I want two add to cart buttons, one with and one without installation on a product page. The price for installation is variable for each product.
I write the code below in {theme}/template/ajaxcart/catalog/product/view/addtocart.phtml near Add to Cart button. The price that is displayed add the button is € 0,00 it should be € 350,00 and when you use this button the totaal page refresh.
<?php
if($_product->getSampleProductId()):
$_price = Mage::getResourceModel('catalog/product')->getAttributeRawValue($_product->getSampleProductId(), 'price', Mage::app()->getStore());
$_formattedPrice = Mage::helper('core')->currency($_price, true, false);
$_buttonTitle = "Order Sample @".$_formattedPrice;?>
<button type="button" title="<?php echo $_buttonTitle ?>" class="button btn-cart" onclick="setLocation('<?php echo Mage::getUrl('checkout/cart/add/product/'.$_product->getSampleProductId()) ?>')"><span><span><?php echo $_buttonTitle ?></span></span></button><?php endif; ?>
How can I make this extra add to cart button to work? Thanks
installation_price
to store installation price