Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to eliminate products that are out if stock ?


babak83

Recommended Posts

hello every one

 

I'd like to oscommerce act in away that automatically eliminate products which are out of stock (of cource in user end) in other words "does not show products that have quantity of 0 ,for customers" But they should be visible in admin panel for later updates .

 

Please Reply :)

 

Thank you .

Link to comment
Share on other sites

hello every one

 

I'd like to oscommerce act in away that automatically eliminate products which are out of stock (of cource in user end) in other words "does not show products that have quantity of 0 ,for customers" But they should be visible in admin panel for later updates .

 

Please Reply :)

 

Thank you .

 

In Administration, you can toggle the Status from Green to Red in your Catalog to turn off or back on products.

B)

Link to comment
Share on other sites

I had expected the oscommerce forum to be a little better at searching for stuff - I had problems finding my own postings!

 

I think this is what you are looking for. Customer doens't see out of stock product, admin does. There are other ways of being more thorough about it but what the hell.

 

http://www.oscommerce.com/forums/index.php?showtopic=193297&hl=

 

-------------original posting------------------------------

 

quick and easy workaround:

 

in index.php replace string

 

where p.products_status = '1'

 

with

 

where p.products_status = '1' and p.products_quantity > 0

 

and the out of stock products will not show up at all

 

the category counts function (if activated) -function tep_count_products_in_category- should be tweaked as well to reflect the actual amount of products available

 

t

Link to comment
Share on other sites

I had expected the oscommerce forum to be a little better at searching for stuff - I had problems finding my own postings!

 

I think this is what you are looking for. Customer doens't see out of stock product, admin does. There are other ways of being more thorough about it but what the hell.

 

http://www.oscommerce.com/forums/index.php?showtopic=193297&hl=

 

-------------original posting------------------------------

 

quick and easy workaround:

 

in index.php replace string

 

where p.products_status = '1'

 

with

 

where p.products_status = '1' and p.products_quantity > 0

 

and the out of stock products will not show up at all

 

the category counts function (if activated) -function tep_count_products_in_category- should be tweaked as well to reflect the actual amount of products available

 

t

 

why would you do all that when the stock settings are sufficient and meant to handle this kind of things ?

Link to comment
Share on other sites

why would you do all that when the stock settings are sufficient and meant to handle this kind of things ?

 

When an item is out of stock and not flagged as such in the admin section then it still appears in the shop front. This way as soon as stock reaches zero the product is not shown. The stock settings are not sufficient if you do not want to display the product that is out of stock. That is why.

 

T

Link to comment
Share on other sites

When an item is out of stock and not flagged as such in the admin section then it still appears in the shop front. This way as soon as stock reaches zero the product is not shown. The stock settings are not sufficient if you do not want to display the product that is out of stock. That is why.

 

T

 

When set correctly the stock settings do exactly that; making zero stock invisible for the customer.

Check stock level true

Subtract stock true

Allow Checkout false

Link to comment
Share on other sites

But an other one apeared :(

 

What should I do if I want to out of stock products be shown but in different color[/

color] ? :D

 

 

A lot of the postees here are completely missing the point. "Allow checkout - false" still displays the product that is not in stock anymore it just doesn't allow checking out and if they had bothered to read your original question and understood it for one thing then I could have saved some time!

 

To display the out of stock product in a different colour then run an "if stock < 1 then font=red else font=black" query. Please find the place it should be run in yourself.
Link to comment
Share on other sites

A lot of the postees here are completely missing the point. "Allow checkout - false" still displays the product that is not in stock anymore it just doesn't allow checking out and if they had bothered to read your original question and understood it for one thing then I could have saved some time!

 

To display the out of stock product in a different colour then run an "if stock < 1 then font=red else font=black" query. Please find the place it should be run in yourself.

 

Those settings as stated above are not missing the point as they are correct.

They will automatically disable the product once it reaches the quantity zero level at checkout and as such

render the product invisible for customers.

Treasurer MFC

Link to comment
Share on other sites

Those settings as stated above are not missing the point as they are correct.

They will automatically disable the product once it reaches the quantity zero level at checkout and as such

render the product invisible for customers.

apologies

Link to comment
Share on other sites

To display the out of stock product in a different colour then run an "if stock < 1 then font=red else font=black" query. Please find the place it should be run in yourself.

 

If there was any help I would be so happy :rolleyes:

Link to comment
Share on other sites

A lot of the postees here are completely missing the point. "Allow checkout - false" still displays the product that is not in stock anymore it just doesn't allow checking out and if they had bothered to read your original question and understood it for one thing then I could have saved some time!

 

To display the out of stock product in a different colour then run an "if stock < 1 then font=red else font=black" query. Please find the place it should be run in yourself.

 

I tried but I could not find out a way to do taht ,So Please help

I have started learning php nowdays :rolleyes:

Link to comment
Share on other sites

I tried but I could not find out a way to do taht ,So Please help

I have started learning php nowdays :rolleyes:

 

well, you have to decide what you do want to allow for out of stock products.

 

in any case, make sure you always select products_quantity from the table as that is only done if also displayed in the default install.

 

then with that field you can change colors, not show add buttons etc.

 

but I believe that there are several contributions that do this already like this one:

 

http://www.oscommerce.com/community/contri...ch,stock+button

 

and several others.

Treasurer MFC

Link to comment
Share on other sites

well, you have to decide what you do want to allow for out of stock products.

 

in any case, make sure you always select products_quantity from the table as that is only done if also displayed in the default install.

 

then with that field you can change colors, not show add buttons etc.

 

but I believe that there are several contributions that do this already like this one:

 

http://www.oscommerce.com/community/contri...ch,stock+button

 

and several others.

 

That contribution is not What I need .

 

I need out of stock products be shown in differnt color (automatically when the quantity reaches 0) I want all buttons stay the same in order customers click on them to see the specificatins and the date when it will be available for them to buy it .

Link to comment
Share on other sites

That contribution is not What I need .

 

I need out of stock products be shown in differnt color (automatically when the quantity reaches 0) I want all buttons stay the same in order customers click on them to see the specificatins and the date when it will be available for them to buy it .

 

yes, that it does not do, but I have the feeling that you want something different every post.

Treasurer MFC

Link to comment
Share on other sites

e.g. product_info.php. This should do it. Make a new css class. Insert where ever you want it.

 

// If Item out of stock then change the css class name

function tep_check_stock($products_id, $products_quantity) {

$stock_left = tep_get_products_stock($products_id) - $products_quantity;

$stock_check = '';

 

if ($stock_left < 0) {

$stock_check = 'outofstock';

} else {

$stock_check = 'pageHeading';

}

}

 

<td class="<?php echo $stock_left; ?>" valign="top"><?php echo $products_name; ?></td>

 

original line approx. 107

 

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

Link to comment
Share on other sites

e.g. product_info.php. This should do it. Make a new css class. Insert where ever you want it.

 

// If Item out of stock then change the css class name

function tep_check_stock($products_id, $products_quantity) {

$stock_left = tep_get_products_stock($products_id) - $products_quantity;

$stock_check = '';

 

if ($stock_left < 0) {

$stock_check = 'outofstock';

} else {

$stock_check = 'pageHeading';

}

}

 

<td class="<?php echo $stock_left; ?>" valign="top"><?php echo $products_name; ?></td>

 

original line approx. 107

 

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

 

 

Thanks for your Reply .I will chek it as soon as possible .

Link to comment
Share on other sites

Can you Clearly Tell me what I should do . If so I will be realy THANKFUL ;)

 

Well for one thing this line should read:

 

td class="<?php echo $stock_check; ?>" valign="top"><?php echo $products_name; ?></td>

 

rather than

 

td class="<?php echo $stock_left; ?>" valign="top"><?php echo $products_name; ?></td>

 

sorry.

 

On another note you might be out of your depth a bit here...

 

You haven't actually said exactly what you want to change. Maybe you should make up a screenshot of how you would like the page to look and then the troups can move in and help. There is no such thing as too much information!

 

T

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...