Guest Posted October 7, 2006 Posted October 7, 2006 I am not sure if I am posting this in the right section so I apologize before hand if I am. What I am looking to do is hide the ADD TO CART button if stock = 0 but instead show OUT OF STOCK. I really dont like how it adds it to the cart and gives it *** indicating its out. Quote
gray_bale Posted October 11, 2006 Posted October 11, 2006 To show OUT OF STOCK Somewhere near line 205 in product_info.php modify <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> Into <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($product_info['products_quantity'] > 0) { ?> <tr> <td class="main"><b><?php echo TEXT_PRODUCT_IN_STOCK; ?></b>: <?php echo $product_info['products_quantity']; ?></td> </tr> <?php } else { ?> <tr> <td class="main"><font color="#FF0000"><b><?php echo TEXT_PRODCUT_OUT_OF_STOCK; ?></b></font>: (<?php echo $product_info['products_quantity']; ?>)</td> </tr> To hide the ADD TO CART button Somewhere near line 234 in product_info.php modify <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> Into <?php if ($product_info['products_quantity'] > 0) { ?> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <?php } else { ?> <?php } ?> It works for me, but always keep a backup of your original product_info.php Quote
gray_bale Posted October 11, 2006 Posted October 11, 2006 I also tried to remove the 'buy now' button from off the product_listing.php. But I have had no luck. I think I need to be in a different database to find the $product_info['products_quantity'] I am sure somebody can check it out quickly. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.