Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product - sold out?


sabaina

Recommended Posts

hi,

 

i have a client who'd like to show her products even though they've been sold out. but of course, the customers won't be able to add them to the cart.

 

thing is, when a product is sold out, the product status changes to 0 (out of stock) automatically. the product listings only show products with a status of 1. (right?)

 

i did find a contribution but it only changes the products_info.php file. how will the customer even reach the product info page if he cannot see a listing anywhere?

http://www.oscommerce.com/community/contributions,3076 -- SoldOut (but displayed) - v0.1

 

do i need to change the query to not check for product status when pulling up the products from the database? or is there a configuration that i can set which would at least show out of stock products.

 

thanks in advance.

Link to comment
Share on other sites

hi,

 

i have a client who'd like to show her products even though they've been sold out. but of course, the customers won't be able to add them to the cart.

 

thing is, when a product is sold out, the product status changes to 0 (out of stock) automatically. the product listings only show products with a status of 1. (right?)

 

i did find a contribution but it only changes the products_info.php file. how will the customer even reach the product info page if he cannot see a listing anywhere?

http://www.oscommerce.com/community/contributions,3076 -- SoldOut (but displayed) - v0.1

 

do i need to change the query to not check for product status when pulling up the products from the database? or is there a configuration that i can set which would at least show out of stock products.

 

thanks in advance.

 

 

 

 

have you tried the admin panel?

 

go to config>my store> stock

 

hope it works for you.

Link to comment
Share on other sites

setting configuration->stock->Check stock level to false also doesn't show the sold out stock.

 

this is the situation i have:

 

product A -- quantity 1

customer buys 1 unit

product A ==> quantity: 0 AND status: out of stock

 

i'll have to set configuration->stock->substract stock to false i guess? but i don't want to do that.

Link to comment
Share on other sites

try the following

 

Check stock level true

Subtract stock true Info

Allow Checkout false Info

Mark product out of stock SORRY THIS ITEM HAS SOLD OUT Info

Stock Re-order level 1

Link to comment
Share on other sites

  • 3 months later...
i just wrote a contribution for it. the above values didn't solve my problem.

 

http://www.oscommerce.com/community/contributions,4884

 

Hello All, I have installed the above contribution, and have a few problems.

 

Firstly I have SPPC installed, and I think it clashes.

 

All products on the main listing pages - show sold out. Even when quantaties are greater than 0.

 

I believe the the file product_listing is the culprit, but dont know how to fix it.

 

The instructions on that file donot match my file.

 

Has anyone that has SPPC installed, been able to successfully install the above package.

 

Thanks in advance.

Link to comment
Share on other sites

  • 7 months later...
Hello All, I have installed the above contribution, and have a few problems.

 

Firstly I have SPPC installed, and I think it clashes.

 

All products on the main listing pages - show sold out. Even when quantaties are greater than 0.

 

I believe the the file product_listing is the culprit, but dont know how to fix it.

 

The instructions on that file donot match my file.

 

Has anyone that has SPPC installed, been able to successfully install the above package.

 

Thanks in advance.

 

 

 

Hi Robert

 

did you find out the bug with SPPC ? I have the same problem here, please let me know

 

 

Robin

 

 

www.belladonna.de

Link to comment
Share on other sites

  • 1 month later...

In your product_info.php file,

 

 

Change the if else statement for the sold out button and the submit button to this:

 

 

<!--Begin Sold Out-->

<?php

If ($product_info['products_quantity']>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-->

 

 

I salvaged this from the other contrib. It would now show the proper button, in accordance to the quantities.

 

 

I have encountered one problem though, which is separate from this... The product is available for viewing if it is out of stock. But there are no details to view. I still need to activate it manually from admin to allow it to show its details.

 

Does anyone have a solution to this?

Link to comment
Share on other sites

Hi,

your fix worked great.

In order to get the image, product description and a stock count of 0 (in addition to the Sold Out button) on my product info page I did this to her step 9

 

/** show-soldout-v1.0 **/ $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '0' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

Link to comment
Share on other sites

ahh it was too good to be true. the above fixed the sold out product image and description but made all other products with stock display the sold out button lol

Link to comment
Share on other sites

okay this is what I have done now and it seems to work allowing me to see sold out product description and instock products too ... since I really have no idea what I am doing and really a hit and miss at this please backup your file before you adjust. Here is the code i used in step 9

 

/** show-soldout-v1.0 **/ $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where/* p.products_status = '0' and */ p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status >= '0' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

hope it works and causes no problems.

Link to comment
Share on other sites

An alternative contribution is Limited Stock by Article, allowing you to select if you want to keep on showing certain products, has QTpro instructions too.

http://www.oscommerce.com/community/contributions,4184

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...