Jump to content
Sign in to follow this  
sosidge

Stock Status in Product Listing

Recommended Posts

Latest version (v1.1) is just being uploaded to contributions section.

 

Please post any problems/findings here.


- osCommerce is fun! -

Share this post


Link to post
Share on other sites
v1.1 can be found here.

Hi David,

 

I have installed the contribution for display product if sold and and also the contribution for add quantity required box in product info. Do you know off the top of your head if this display availability contribution work with these other two contributions?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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?

Share this post


Link to post
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! -

Share this post


Link to post
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.

Share this post


Link to post
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! -

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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~

Share this post


Link to post
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! -

Share this post


Link to post
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:

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Add a style to the code that holds the text, either using an existing one in your stylesheet or adding a new one.


- osCommerce is fun! -

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

You are using the wrong section of the code, that bit is not designed for the products_new.php page.


- osCommerce is fun! -

Share this post


Link to post
Share on other sites

Iknow that, but it could be possible to remove the cart from the first page when the product are not in stok... how we can do this ...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×