Can someone give me the code mods to make to hide it when an item is not in stock? Am using 1.4.8.
Thanks!
http://forum.opencart.com/viewtopic.php ... 3633#p3645
But it's from an older version.
Can anyone help me update it for 1.4.8, with the variable being number in stock = 0 rather than price being $0.0?
Using OC version 1.4.8b
http://catandcaboodle.com/
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.
As I always do, I did do a search for this before I posted it. Care to give us a link? We would certainly appreciate it.
Using OC version 1.4.8b
http://catandcaboodle.com/
find this in your product.tpl file
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>
Code: Select all
<?php if($stock == $this->language->get('text_instock') || $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>
<?php endif; ?>
My bad.Karen wrote:Hi Norman,
As I always do, I did do a search for this before I posted it. Care to give us a link? We would certainly appreciate it.
The topic was hiding under a differend name: [MOD] Out of stock status change automatic?
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.
Is it equivalent to "product.php" ?
I am using opencart_v1.4.9 version.
YES! They are exactly the same, that is why we included both for funYEWEI123SG wrote:Where can i find "product.tpl" ?
Is it equivalent to "product.php" ?
This should help
http://forum.opencart.com/viewtopic.php?f=20&t=4113
I've tried your code in 1.4.9.2 but it does not work.JAY6390 wrote:Have to say I couldn't find this myself, but here's how I would do it
find this in your product.tpl fileand change it to this (the first and last lines are the only additions)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>
That should do itCode: Select all
<?php if($stock == $this->language->get('text_instock') || $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> <?php endif; ?>
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.
new code (and working)
Code: Select all
<?php echo '<!-- STOCK: '.$this->language->get('text_instock').' -->'; ?>
<?php if($stock === $this->language->get('text_instock') || (strlen($stock) == strlen((int)$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>
<?php endif; ?>
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.
SXGuy wrote:in catalog/controller/product/category.php
find
add underneathCode: Select all
'price' => $price,
in catalog/view/theme/default/template/product/category.tplCode: Select all
'quantity' => $result['quantity'],
find
replace withCode: Select all
<a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a>
Code: Select all
<?php if ($products[$j]['quantity'] > 0 ) { ?> <a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a> <?php } ?>
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.
I need (please) this code to work with a fixt amount, lets say -10.
Code: Select all
<?php echo '<!-- STOCK: '.$this->language->get('text_instock').' -->'; ?>
<?php if($stock === $this->language->get('text_instock') || (strlen($stock) == strlen((int)$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>
<?php endif; ?>
Code: Select all
<?php if($stock == -10): ?>
I hope that JAY6390 will stop by and help me out
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.
Users browsing this forum: No registered users and 46 guests