I'm using Magento 1.9.1 and have the following issue:
I want that the customer can order products, whether they are on stock or not. So I turned the backorder option on. This works fine, the "add to card" button appears, the only problem is that all products are marked with the green text ON STOCK.
-
Is there any way to change that with configuring correctly in the Magento backend ?
-
Or do I need to modify the template ? If so could you tell me where to change the code ? I looked at view.phtml and found the following code:
<?php echo $this->getChildHtml('product_type_availability'); ?>
Is there any way to get the stock quantity amount in here so I could do if/else? Or do you have any other suggestions on that ?
Thanks a lot !
Oliver
Best Answer
You will need to edit the availability template to your theme
app/design/frontend/yourtheme/yourpackage/template/catalog/product/view/type/availability/default.phtml.
You can simply add to the default code and add an extra check to see if the product is out of stock but available for back order.
The above example I have just done editing rwd's default stock template file.
The first PHP check if the product has 0 stock and back orders are set to yes, this will then display the product as out of stock.