cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding price for out of stock products.

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Re: Hiding price for out of stock products.

Thanks
it's helped me much

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"