2

I want to hide out of stock product price from category but I want to remain the product on same category but only hide price when the product come back to store then it will show price.

Can anyone give me a suggestion?

2
2

You can modify the list.phtml and the view.phtml templates of your theme.
You need use the Template Path Hints feature of Magento to detect these, which you can find here:

Backend > System > Configuration > Advanced section > Developer tab > Debug fieldset

Please pay attention, that it accessible only in a Website and Store View scopes.
For the default theme of the RWD design package you can find these by the following path:

Magento_root/app/design/frontend/rwd/default/template/catalog/product/

For the view.phtml template please wrap the div of the price-info class with if statement:

<?php if ($_product->getIsInStock()): ?>
    <div class="price-info">
        <?php echo $this->getPriceHtml($_product); ?>
        <?php echo $this->getChildHtml('bundle_prices') ?>
        <?php echo $this->getTierPriceHtml() ?>
    </div>
<?php endif; ?>

For the list.phtml you need make wrapping twice (for the List and the Grid modes):
1) List mode:

<?php if ($_product->isSaleable()): ?>
    <div class="product-secondary">
        <?php echo $this->getPriceHtml($_product, true) ?>
    </div>
<?php endif; ?>

2) Grid mode:

<?php if ($_product->isSaleable()): ?>
    <?php echo $this->getPriceHtml($_product, true) ?>
<?php endif; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.