- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018
01:20 PM
07-25-2018
01:20 PM
Re: Hiding price for out of stock products.
Thanks
it's helped me much
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018
11:15 PM
08-13-2018
11:15 PM
Re: Hiding price for out of stock products.
Hello @marknoah3,
Generally price is render by below code:
<?php echo $this->getPriceHtml($_product); ?>
And magento is check in stock by using below code:
$_product->isSaleable().
At list.phtml file add this as condition like :
<?php if($_product->isSaleable()): ?> <?php echo $this->getPriceHtml($_product,true); ?> <?php endif; ?>
At view.phtml and condition like:
<?php if($_product->isSaleable()): ?> <?php echo $this->getPriceHtml($_product); ?> <?php endif; ?>
and
<?php if($_product->isSaleable()): ?> <?php echo $this->getTierPriceHtml() ?> <?php endif; ?>
Also you can do this by css:
add css code at list.phtml and view.phtml file:
<?php if(!$_product->isSaleable()): ?> <style type="text/css"> .price-box {display:none;} </style> <?php endif; ?>
--
If issue is solved, Click "Kudos" & "Accept as Solution"
- « Previous
-
- 1
- 2
- Next »