Is there a better way to handle it?
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
Will it show "in stock" in the store If I change the status to "out of stock" and keep number of products more than 0?
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
You'll also need to ensure that "Stock Subtract" is set to "Yes" in your settings ("Admin->Configuration->Setting, under the "Option" tab).
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Thanks all!
Vimal.
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
update: Just realized this is down to the 'Status enabled' not being set to 'false'. Can this be achieved automatically?
Thanks.
2. FIND:
Code: Select all
p.status = '1'
Code: Select all
p.status = '1' AND p.quantity > 0
I just add quantity>0 to the next rule in the same page as before.
$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value WHERE product_option_id = '" . (int)$product_option['product_option_id'] . "'and quantity>0 ORDER BY sort_order");
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
This works for me. It removes the add to cart button if the stock is anything different than "In Stock".i2Paq wrote:I think it would be also nice to have the Add to Cart button removed instead of the whole product.
Look in file:
catalog\view\theme\"your_theme"\template\product\product.tpl
Find (around line 100):
Code: Select all
<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px;"><?php echo $text_qty; ?>
<input type="text" name="quantity" size="3" value="1" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span> </a></div>
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</form>
Code: Select all
<?php if($stock == 'In Stock' || $stock > 0){ ?>
Code: Select all
<?php } ?>
Code: Select all
<?php if($stock == 'In Stock' || $stock > 0){ ?>
<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px;"><?php echo $text_qty; ?>
<input type="text" name="quantity" size="3" value="1" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
<?php } ?>
</form>
Thanks in advance!
It needs a little tweak for 1.4.9.3 though. The additions are the same, just the underlying code to be modified is different.
Look for this code:
Code: Select all
<div class="content">
<?php echo $text_qty; ?>
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a>
<?php if ($minimum > 1) { ?><br/><small><?php echo $text_minimum; ?></small><?php } ?>
</div>
<div>
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<input type="hidden" name="redirect" value="<?php echo str_replace('&', '&', $redirect); ?>" />
</div>
</form>
Code: Select all
<?php if($stock == 'In Stock' || $stock > 0){ ?>
Code: Select all
<?php } ?>
Code: Select all
<?php if($stock == 'In Stock' || $stock > 0){ ?>
<div class="content">
<?php echo $text_qty; ?>
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a>
<?php if ($minimum > 1) { ?><br/><small><?php echo $text_minimum; ?></small><?php } ?>
</div>
<div>
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<input type="hidden" name="redirect" value="<?php echo str_replace('&', '&', $redirect); ?>" />
</div>
<?php } ?>
</form>
And how can I put another image over a sold out product? I'd like to create sticker saying "sold out".
Like this website http://www.demo.opencart4u.com/ but here they dont have the option of sold out, only new/best products
It works only on standard englich translation. Bether is to make it in this way:Code: Select all
<?php if($stock == 'In Stock' || $stock > 0){ ?>
Code: Select all
if($stock == $this->language->get('text_instock') || $stock > 0){
Users browsing this forum: No registered users and 17 guests