简体   繁体   中英

Show attribute if product is Out-Of-Stock Magento

I need to know how to Show attribute if product is Out-Of-Stock in magento. If my product is in stock, the attribute is shown, otherwise not.

If i set a product to QTY=0 (Out Of Stock) . Attribute like 'size' is missing. Why? Can anyone explain this please? I already made a research but any good answer.

  • I can't provide any code for this question. Sorry about this.

Navigate to your template's product page, the base directory for the default template is: app/design/frontend/base/default/template/catalog/product/view.phtml

 <?php if($_product->isSaleable()): ?>
        <!-- ... !-->
 <?php endif; ?>

Perhaps your theme only chooses to display certain attributes IF the product is saleable (ie not out of stock)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM