0

i have seen various code snipets to add a 'Back Ordered' status to my product page, but it's not working for me.

my file for product display is: ..../public_html/app/design/frontend/default/MYTEMPLATE/template/catalog/product/view/type/default.phtml

existing code

what can i do to the code above to get a 'Back Ordered' Status on the page in place of 'In Stock' when the inventory quantity is 0. having them go to the checkout page to see this is a waste for customers.

2 Answers 2

1

Use allow qty below 0 on the product and add

<?php $product_inventory = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product) ?>
<?php if($product_inventory->getQty() <= 0 && ($product_inventory->getBackorders() == 1 || $product_inventory->getBackorders() == 2)): ?>
<p class="choseyourclass"><?php echo $this->__('Availability:') ?><span><?php echo $this->__('Back Ordered') ?></span></p>

Before the first if and make the first if an elseif.

You could also do it with an attribute and set this on inventory update with the above condition, this would decrease load avoiding the cataloginventory model call. You would have to set the attribute manual at first tough (do a massupdate trough the Products grid or use import/export).

(For example observe cataloginventory_stock_item_save_after (I think there will be more needed))

There might be a typo or something in the example as I just typed it by heart.

1
0

i added your code to the file, but it's still not working. i'm thinking because it's a configurable product with different options.

http://www.nbzjeans.com/nbz-boys-original-jeans-dark-blue.html

all those have a 0 qty and show that after you add them to the cart.

1
  • You did not enable allow qty below 0 on the products... and you should not post this as an answer... Commented Nov 14, 2014 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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