Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stock


Rogaondeweb

Recommended Posts

Hi

 

Yes you edit your prefs. in Admin> Configuration >Stock

 

Thanks...but i tried and all i could do is that the customer can see "***" (or what i want) when items are out of stock.

I would want that he could not order (not only checkout) when there is not stock: e.g when stock is 2 order could be maximum 2.

I would want that if stock is 0 the item would not be in the catalog (or be widt "Sold Out" and without possibility to order.

 

Thanks

 

Fulvio

Link to comment
Share on other sites

Thanks...but i tried and all i could do is that the customer can see "***" (or what i want) when items are out of stock.

I would want that he could not order (not only checkout) when there is not stock: e.g when stock is 2 order could be maximum 2.

I would want that if stock is 0 the item would not be in the catalog (or be widt "Sold Out" and without possibility to order.

 

Thanks

 

Fulvio

 

I did it on myself changing the code.

If this could be useful i changed:

 

1) index.php

 

In all the lines with a SELECT on TABLE_PRODUCTS i changed the WHERE clause from "where p.products_status = '1'....." to "where p.products_quantity>0 and p.products_status = '1' ..."

 

I changed the line

 

$categories_products_query = tep_db_query("select count(*) as total from .....

 

into

 

$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " c left join " . TABLE_PRODUCTS . " p on p.products_id = c.products_id " . " where p.products_quantity>0 and categories_id = '" . (int)$current_category_id . "'");

 

2) functions/general.php i changed the function tep_count_products_in_category adding to the WHERE CLAUSE of the 2 $products_query into

where p.products_quantity>0 and p.products_id....

 

Hope this helps to someone.

 

I am working now on the code to let people order only quantities not over the stock. Then I will post a contribution.

 

Fulvio

Link to comment
Share on other sites

In admin configuration stock set

check stock level true

subtract stock true

allow checkout false

 

When sutracting the stock level gets to zero, the product status should be marked out of stock or 1 like it is your above query.

where p.products_status = '1'

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...