Hi all,
Was wondering if there was a way to remove the 'Add to Cart' button if the product matched a certain type of Availability status?
I know that the visitor won't be able to proceed to the checkout if the product is out of stock; just wondered if there was a way to achieve the above question.
Thanks,
Darren
1. EDIT: catalog/view/theme/YOURTHEME/template/product/product.tpl
2. FIND:
3. REPLACE WITH:
2. FIND:
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>
3. REPLACE WITH:
Code: Select all
<?php if ($stock != "Out Of Stock") {?>
<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>
<?php } ?>
It would have to be "broke" to be fixed. The actual stock check is done at the cart page, which is the most secure. Technically I could just hack the source with FF and add an add to cart button if i really wanted. But the cart page checks if it is in stock or not before going to checkout.
Just wondering if there was an update for this code for Version 1.4.4? I would like to still have the product show but an "Out of Stock" status for the add to cart button or something similiar to that. I tried the above code but got no results. Any Ideas?
Opencart 1.4.9.1
Global Options Mod
Who is online
Users browsing this forum: No registered users and 51 guests