Magento – custom button on product page/product listing in magento

magento-1.9productproduct-listproducts

I want to show a custom button on product detail page as well as on product listing.

this button will be visible based on an attribute.(if I select an attribute to yes while creating product, only then this button should be visible.)
and I want to show a block on hover on button.
i am very new to magento so detailed instruction will be better.

enter image description here

Best Answer

Creating a custom attribute eg.(mybutton) and it's Input Type will be yes or no now finally write below code in {theme}/template/catalog/product/view/addtocart.phtml near Add to Cart button.

<?php 
    if($_product->getMybutton()){

?>
    <button type="button">Special order  </button>
<?php } ?>

Hope it will help you.

Related Topic