I have spend all day yesterday trying to display the stock quantity for each item in the Shopping cart page (basket).
Basically, instead of only the *** showing when a customer wants to order more than the store has in stock, I want to show *** and the number of stock that is available. I will then allow the customers to order even if the stock is not there, but the customer will know how many can ship straight away, and how many remaining will ship when stock comes in (up to 2 weeks).
So basically I am trying to put some code in the Cart.tpl page (catalog/view/theme/default/template/checkout/ in this section that will show the current stock quantity for that product (line by line), and then show how many will be on back-order.
Current:
Code: Select all
<?php if (!$product['stock']) { ?>
<span style="color: #FF0000; font-weight: bold;">***</span>
<?php } ?>
Code: Select all
<?php if (!$product['stock']) { ?>
<span style="color: #FF0000; font-weight: bold;">***</span>(<?php echo $product['stock']; ?> in stock, <?php $remainder = $product['stock'] - $product['quantity']; echo $remainder; ; ?> will be on back-order and delivered within 2 weeks)<?php } ?>
I have searched all threads on this forum, and tried various methods, most of which are made for the category/product pages, and dont work on the cart page. I also tried this method, but is not working for 1.3.4 anyway http://www.aleixcortadellas.com/main/2009/09/09/742/
Any help would be greatly appreciated. Thanks in advance!
OC Version: 1.3.4