I am trying to test displaying a message depending on the product's stock_status_id but just when I do a <?php echo $product['stock_status_id'];?> , it doesn't return a value. How can I have this info shown?
Thanks
My goal is to assign some product options with different stock statuses. Some would be pre-order, others avail in 7-14 days, and I'd let them still order them despite having 0 quantity. Some items that sell out, stay out of stock and wouldn't be order-able.
Then take his suggestion a little further and set up either a switch statement or set up some else if's.
Code: Select all
switch($product['stock']){
case "In Stock":
//place your actions here
break;
case "2-3 Days":
//place your actions here
break;
//so on and so forth.
}
OK I need a little more help
How do I get the $product['stock'] to show me the stock_status name like In Stock or Pre-Order
<?php echo ($product['stock']) ;?> shows a 1
When I tried to use a switch($product['stock']){ with different cases, it defaulted to the first case.
How do I get the $product['stock'] to show me the stock_status name like In Stock or Pre-Order
<?php echo ($product['stock']) ;?> shows a 1
When I tried to use a switch($product['stock']){ with different cases, it defaulted to the first case.
thanks you! How does it get handled on the cart page?
I have DIsplay Stock set to No.
I have DIsplay Stock set to No.
Johnathan wrote:Sorry, I was a little bit off...if you're on the product page, then:
<?php echo $stock; ?>
will get the stock status text if "Display Stock" is set to "No", and will get the product quantity if it's set to "Yes".
You are talking about: http://demo.opencart.com/index.php?route=checkout/cart right?dlew wrote:thanks you! How does it get handled on the cart page?
I have DIsplay Stock set to No.
If so, I'm after this one, too
Using OpenCart v1.5.1.3
On the product page I want products with option value of 0 to show the out of stock message (2-3 days, pre-order, etc) in the pull down
On the cart page I want to show the same messages based on the product's option's out of stock message
On the cart page I want to show the same messages based on the product's option's out of stock message
dimko wrote:You are talking about: http://demo.opencart.com/index.php?route=checkout/cart right?dlew wrote:thanks you! How does it get handled on the cart page?
I have DIsplay Stock set to No.
If so, I'm after this one, too
Who is online
Users browsing this forum: No registered users and 360 guests