Post by leandromello » Thu May 21, 2015 10:45 am

Hi,
How to Hide Button buy in Listing and show "Out of Stock"? But not just this...
I sell products with stock "0"... so this products have the stock status like "2-3 days".

I use this code below to do this based on quantity, but i need do this based in stock_status_id...
just because i sell product with stock "0"

Code: Select all

<?php if ($product['quantity'] > 0) { ?>
<div class="cart handpoint" onclick="addToCart('<?php echo $product['product_id']; ?>');"><i class='icon-shopping-cart'></i>&nbsp;&nbsp;<?php echo $button_cart; ?></div>
<?php } ?>   

<?php if ($product['quantity'] < 1) { ?>
<div class="cart handpoint" style="color:#F00; font-weight:bold">Produto Esgotado!</div>
<?php } ?>

New member

Posts

Joined
Fri Oct 28, 2011 3:29 am

Post by Qphoria » Thu May 21, 2015 1:23 pm

Just change
<?php if ($product['quantity'] > 0) { ?>
to
<?php if ($product['order_status_id'] = 3) { ?>

where 3 is the stock status id

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by leandromello » Thu May 21, 2015 7:51 pm

Qphoria,
I already try this.
Did something is missing in the "controller" ?

New member

Posts

Joined
Fri Oct 28, 2011 3:29 am
Who is online

Users browsing this forum: No registered users and 45 guests