- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019
11:32 PM
08-20-2019
11:32 PM
How can i add Add-To-Cart Button on Blog Post page Products?
My blog post contains products :
<div class="thumb col-md-2 col-xs-6" data-target="#carousel" data-slide-to="15"> <a itemprop="name" href="https://abc.com/apple"> <img class="img-responsive" alt="apple" src="https://abc.com/media/catalog/product/cache/1/image/700x700//9/1/111111111111001441-1.jpg" /></a><br /> <p>Apple</p> </div> <div class="thumb col-md-2 col-xs-6" data-target="#carousel" data-slide-to="15"> <a itemprop="name" href="https://abc.com/apple"> <img class="img-responsive" alt="apple" src="https://abc.com/media/catalog/product/cache/1/image/700x700//9/1/111111111111001441-1.jpg" /></a><br /> <p>Apple</p> </div> <div class="thumb col-md-2 col-xs-6" data-target="#carousel" data-slide-to="15"> <a itemprop="name" href="https://abc.com/apple"> <img class="img-responsive" alt="apple" src="https://abc.com/media/catalog/product/cache/1/image/700x700//9/1/111111111111001441-1.jpg" /></a><br /> <p>Apple</p> </div>
How can i add appropriate add-to-cart link of my products
Labels:
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019
09:23 AM
08-21-2019
09:23 AM
Re: How can i add Add-To-Cart Button on Blog Post page Products?
Hello @Aveeva,
Please use below code:
$productId = '168'; // Your Product Id $_product = Mage::getModel('catalog/product')->load($productId); <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo Mage::helper('checkout/cart')->getAddUrl($_product); ?>')"><span><span><img src="<?php echo $this->getSkinUrl('images/buy.jpg') ?>" alt="" /></span></span></button>
I hope it will work. If still you face any issue please let me know.
If it helps you, please accept it as solution and give us kudos.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019
10:39 PM
08-21-2019
10:39 PM
Re: How can i add Add-To-Cart Button on Blog Post page Products?
@Sarvagya Pandey Thank You and sorry to keep track you can i get help regard my previous post, still override/rewrite not working.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019
10:43 PM
08-21-2019
10:43 PM
Re: How can i add Add-To-Cart Button on Blog Post page Products?
If my this post helps you, please accept it as solution.
Regards

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019
11:47 PM
08-21-2019
11:47 PM
Re: How can i add Add-To-Cart Button on Blog Post page Products?
@Sarvagya Pandey How can i add your code into https://snipboard.io/iXhezS.jpg