Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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.

Posted

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

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...