Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sold Out (but displayed) Contrib


Rachael w.

Recommended Posts

Here's the very simple install of this contrib, however, for some reason on my new server it doesnt work. It displays every item with the sold out button.

 

In catalog/products_info.php - Find:

			<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>

Replace with:

<!--Begin Sold Out-->
<?php
 $products_sold_out = '';
$stock_left = tep_get_products_stock($products_id) - $products_quantity;
$products_sold_out = stock_left;
if ($stock_left > 0) {
$submit_button = tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
} else { 
$submit_button = tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/button_sold_out.gif', 'Sold Out', IMAGE_BUTTON_SOLD_OUT);
 }
?>
			<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . $submit_button; ?></td>
<!--End Sold Out-->

 

The only thing I've had to change so far to get osc to work on the new server is the Register Globals contrib. I've gone back to the original button code for now, but I'd really like this contrib to work. Does anyone have any suggestions as to why it wasnt working?

Link to comment
Share on other sites

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...