Dear padred123padred123 wrote: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):Add this before the DIV tag: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>
Add this before the FORM tag :Code: Select all
<?php if($stock == 'In Stock' || $stock > 0){ ?>
Result: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>
How and Where do i do for V1.5.1.1?
I have search for the file you mentioned but cannot find the location.
thank in advance.
Regards
Shiok Guy