Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stock Status in Product Listing


sosidge

Recommended Posts

Hi, could you give a link to those contributions so I can see exactly what they do? I can't find them!

 

Either way, this contribution is pretty simple to install or uninstall. If you have problems let me know and I'll see if I can straighten it out for you.

- osCommerce is fun! -
Link to comment
Share on other sites

Hi David,

 

Here are the links you requested.

 

Quantity in product info: http://www.oscommerce.com/community/contri.../search,qty+box

 

Display sold out: http://www.oscommerce.com/community/contri...isplay+sold+out

 

Do you think your contribution would work well with these two?

Link to comment
Share on other sites

Hi,

 

Seems to me that the first contribution "easy way add Qty box in your product_info.php" won't clash with my contribution.

 

The second contribution "SoldOut (but displayed)" does clash with one part of my contribution (Part 3 in the readme, the part that disables the add to cart button). But I think you can safely use it if you don't install Part 3 (each part of my contribution readme can be installed independently).

 

HTH

 

Dave

- osCommerce is fun! -
Link to comment
Share on other sites

Hi,

 

Seems to me that the first contribution "easy way add Qty box in your product_info.php" won't clash with my contribution.

 

The second contribution "SoldOut (but displayed)" does clash with one part of my contribution (Part 3 in the readme, the part that disables the add to cart button). But I think you can safely use it if you don't install Part 3 (each part of my contribution readme can be installed independently).

 

HTH

 

Dave

Exellent, just installed the first part - just what I needed - many thanks for your work.

Link to comment
Share on other sites

Good to hear it's working for you so far.

 

Also, I've added two more "parts", that will enable a stock announcement in specials.php, and allow you to disable the "Add to Cart" button in product_reviews_xxx.php, if you so choose.

 

v1.22 is here

- osCommerce is fun! -
Link to comment
Share on other sites

  • 1 month later...

I'm having trouble with the "out of stock" products displaying. They don't appear at all.

 

I only installed the parts of v1.2.1 associated with the stock status display - i didn't install any of the sections that remove the button from the cart.

 

Any ideas out there.

 

Thanks,

mike

Link to comment
Share on other sites

Hello there,

Using this contribution for "OUT OF STOCK" and it shows up fine when you are viewing the item description however, when you are on the category page you still have the option to "BUY IT NOW" and it WILL BE PUT IN THE SHOPPING CART EVEN THOUGH IT IS OUT OF STOCK.

 

Can anyone offer help in this matter. If you wish to see it in action here is an example. http://www.scents4healing.com/catalog/inde...c8af024c2e6af2c

 

That diffuser is out of stock and if you click on the description it will have the "OUT OF STOCK BUTTON" on that page. But if you view it in the link you can click "BUY IT NOW" and it will be placed in the shopping cart.

 

Thanks for any input!

 

Ciao for now~

Link to comment
Share on other sites

renix - Sounds to me like you have not removed the part of code in osCommerce that removes a product from the listing if the stock reaches 0. This is "Part 1" of the v1.21 and later contribution

 

One change that I highly recommend is to disable the function in osCommerce that removes a product from the catalogue when it's stock level reaches 0.

 

To do this, find the following code around line 151 of checkout_process.php...

 

if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {

  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

}

 

And either comment it out (put a /* directly before and a */ directly after) or delete it entirely.

 

jchrinko - Seems to me that you have not made the suggested changes to product_listing.php. This is "Part 5" of the v1.21 and later contribution.

 

To disable the "Buy Now" button for products that are out of stock, find the following code around line 131 of includes/modules/product_listing.php...

 

case 'PRODUCT_LIST_BUY_NOW':

  $lc_align = 'center';

  $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

  break;

 

And replace it with...

 

//bof stock announcement

case 'PRODUCT_LIST_BUY_NOW':

  $lc_align = 'center';

  if ((STOCK_CHECK == 'true')&&($listing['products_quantity'] < 1)) {

    $lc_text = ' ';

  } else {

    $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

  }

  break;

//eof stock announcement

 

Hope this helps.

- osCommerce is fun! -
Link to comment
Share on other sites

renix - Sounds to me like you have not removed the part of code in osCommerce that removes a product from the listing if the stock reaches 0. This is "Part 1" of the v1.21 and later contribution

jchrinko - Seems to me that you have not made the suggested changes to product_listing.php. This is "Part 5" of the v1.21 and later contribution.

Hope this helps.

 

You ROCK AND ROLL!!! I didn't see that code in the install that I made I must have downloaded an earlier version. Anyway, it's working like a gem!!!!

 

Thanks for this contribution!!!

:thumbsup:

Link to comment
Share on other sites

Whoops... posted too soon. Now all my items in the shop don't have the "Buy it Now" button. I have stock on all other items but they don't show up with the Buy it Now button.

 

Any suggestions? All I did was replace the suggested code:

 

To disable the "Buy Now" button for products that are out of stock, find the following code around line 131 of includes/modules/product_listing.php...

 

case 'PRODUCT_LIST_BUY_NOW':

  $lc_align = 'center';

  $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

  break;

 

And replace it with...

 

//bof stock announcement

case 'PRODUCT_LIST_BUY_NOW':

  $lc_align = 'center';

  if ((STOCK_CHECK == 'true')&&($listing['products_quantity'] < 1)) {

    $lc_text = ' ';

  } else {

    $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

  }

  break;

//eof stock announcement

Link to comment
Share on other sites

Whoops... posted too soon.  Now all my items in the shop don't have the "Buy it Now" button.  I have stock on all other items but they don't show up with the Buy it Now button. 

 

Any suggestions?  All I did was replace the suggested code:

 

Preparation

 

For this contribution to work, you need to confirm a couple of settings in the Admin tool.

 

The first setting is Configuration >> Product Listing >> Display Product Quantity. This needs to be activated by giving it a sort order greater than 0.

 

The other setting is Configuration >> Stock >> Check Stock Level. This needs to be set to "True". If it is set to "False", the stock announcements will disappear, but should not generate any errors or strange formatting.

Link to comment
Share on other sites

  • 2 months later...

:D David,

 

An absolutely great TOP QUALITY contribution!!! Everything works as advertised if you FOLLOW THE INSTRUCTIONS, LETTER by LETTER!

 

The only problem I encountered was that I forgot to comment out some of the program to be deleted.

 

THANKS,

Dennis :rolleyes:

Link to comment
Share on other sites

  • 1 month later...

Hi thanks for a great contribution - I have a question I would love it to work with mywishlist v 1.3 - so that the 'move to cart' option in My Wishlist also dissapears and reappears with stock changes - at this stage if you add an item that is out of stock - with no 'buy now' button showing to my wishlist - it still has the 'move to cart' option that allows a customer to move it to their cart and check it out even though there is no stock.

 

That would give my customers the option to add items to their cart once they are notified that the item is back in stock and could see at a glance in their wishlist the ones that are now available as these would have the 'move to cart' button and the out of stock items wouldn't.

 

Any suggestions would be greatly appreciated.

 

cheers

Maria

www.scrapboxx.com.au

Edited by scrapart
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Hi... how can i take off the add to cart from new.products.php???

 

I try to replace this

 

<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image_button('small_view.gif', IMAGE_BUTTON_BUY_NOW) . '</a> <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a>

 

with this

 

//bof remove add to cart button
$stock_level = tep_get_products_stock($product_info['products_id']);
if (((STOCK_CHECK == "true")&&($stock_level > 0)) or (STOCK_CHECK == "false")) {
 echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
} else {
 echo '<p>' . tep_draw_separator('pixel_trans.gif', '1', '22') . '</p>';
}
//eof remove add to cart button

 

but something is missing on sintaxe for taht function...could u plz helpme....

 

tks a lot

Link to comment
Share on other sites

  • 1 month later...

Hi there.. I have just installed this contrib and *think* I installed it correctly... Only one prob:

On the page that lists everything in the category

 

Product Name+ | Price | Buy Now | Quantity

Beloved | $60.49 | | Out of Stock

Courage Under Fire |$32.99 | | Out of Stock

Red Corner | $35.20 | | Out of Stock

 

it is listing everything as 'out of stock' (which is not the case, each product has a stock>0). However, when I click on a praticular item and look at it's details, it is definetly in stock, and is able to be brought.

 

Any ideas?

 

Thanks, Barbara

Edited by bobsi18
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.

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