Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

red light on products wont go green


tec

Recommended Posts

Posted

hiya again, sick of me yet??? :D

 

i have a client who has well over 2000 products in their cart, it is a collectors site so there is only one of each product.

 

the prob is, is when they have to cancel and order, when they select the option for it to restore the inventory, it does restore it but then the little green light does not come back on, it stays red.

now for them to have to go in manually and change these all the time is obserd.

I was wondering if there was a way to set up the db or something so that i can make all red lights=quantity zero or quantity of 1 makes the light go green

Posted

And Configuration -->Stock looks like this?

 

Check stock level true

Subtract stock true

Allow Checkout false

Mark product out of stock ***

Stock Re-order level 5

 

I would think the the check stock levels would take of this, maybe I'm wrong.. I usually don't let stock get that low.

My Contributions

 

Henry Smith

Posted
And Configuration -->Stock looks like this?

 

Check stock level true

Subtract stock true

Allow Checkout false

Mark product out of stock ***

Stock Re-order level 5

 

I would think the the check stock levels would take of this, maybe I'm wrong.. I usually don't let stock get that low.

i have my settings set as yours, except the reorder level is 0 because once the coin is sold, there is no others to restock it with. They have one of each, so once one is sold, that is it, there are no more

Posted
i have my settings set as yours, except the reorder level is 0 because once the coin is sold, there is no others to restock it with. They have one of each, so once one is sold, that is it, there are no more

 

the reorder level does nothing.

 

in admin/includes/functions/general.php

 

you have this:

 

function tep_remove_order($order_id, $restock = false) {

if ($restock == 'on') {

$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

while ($order = tep_db_fetch_array($order_query)) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");

}

}

 

to restock the quantity.

 

change that to:

 

function tep_remove_order($order_id, $restock = true) {

if ($restock == 'on') {

$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

while ($order = tep_db_fetch_array($order_query)) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status = 1, products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");

}

}

Treasurer MFC

Posted
the reorder level does nothing.

 

in admin/includes/functions/general.php

 

you have this:

 

function tep_remove_order($order_id, $restock = false) {

if ($restock == 'on') {

$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

while ($order = tep_db_fetch_array($order_query)) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");

}

}

 

to restock the quantity.

 

change that to:

 

function tep_remove_order($order_id, $restock = true) {

if ($restock == 'on') {

$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

while ($order = tep_db_fetch_array($order_query)) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status = 1, products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");

}

}

 

i swear, i am the only idiot who cannot view an individual file like you guys, i.e. general.php

 

so the settings from the admin are not being passed then? hmm, ok, no prob, i will go in and edit like you said to

 

thnx

Posted
i swear, i am the only idiot who cannot view an individual file like you guys, i.e. general.php

 

so the settings from the admin are not being passed then? hmm, ok, no prob, i will go in and edit like you said to

 

thnx

 

well, normally, with those admin settings, when a product quantity reaches zero at checkout, the product is disabled (status 0).

 

Restock while deleting an order only restores the product stock but does not re-enable the product.

Treasurer MFC

Posted
Happens to me as well, go to the product lising and click on the green light to re-activate it.

 

sure but the issue is that you do not want to do that, and should not have to, for every product in an order you just deleted with restocking.

Treasurer MFC

Posted
the reorder level does nothing.

 

in admin/includes/functions/general.php

 

..........change that to:

 

function tep_remove_order($order_id, $restock = true) {

if ($restock == 'on') {

$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

while ($order = tep_db_fetch_array($order_query)) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status = 1, products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");

}

}

 

 

IT WORKED!!!!

Thank you

 

 

 

Tanya

Posted

ok, got another question

 

some of the products in the admin are marked as red but have a product in it still, these are the ones that were already there before i did the edit to the file.

 

I would like to set the red to 0 (reason unknown) is there a way to go into phpmyadmin and run something that tells all the red lights with products =1 need to be changed to 0?

Posted

hmm, no thoughts on this eh?

ok, what if i word it differently, is there a way to make all non published products have an inventory of 0 via a querie??

Posted

Make a backup first.

 

update products set products_status = '1' where products_quantity > '0';

 

update products set products_status = '0' where products_quantity <= '0';

Posted
Make a backup first.

 

update products set products_status = '1' where products_quantity > '0';

 

update products set products_status = '0' where products_quantity <= '0';

 

will this reset all of the products, or only the products with the red light on? some of the red lights have products all equal 1 but i want them all to equal 0 . but only the red ones

Archived

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

×
×
  • Create New...