Page 1 of 1

How to Hide Button buy in Listing

Posted: Thu May 21, 2015 10:45 am
by leandromello
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 } ?>

Re: How to Hide Button buy in Listing

Posted: Thu May 21, 2015 1:23 pm
by Qphoria
Just change
<?php if ($product['quantity'] > 0) { ?>
to
<?php if ($product['order_status_id'] = 3) { ?>

where 3 is the stock status id

Re: How to Hide Button buy in Listing

Posted: Thu May 21, 2015 7:51 pm
by leandromello
Qphoria,
I already try this.
Did something is missing in the "controller" ?