Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Status stay active


sodiumhalogen

Recommended Posts

Posted

I have a store that sells custom pottery. So there is typically only 1 of each item. When someone buy an item, it makes the status of the item "inactive."I want the status of the item to stay active even when the item is "out of stock."

 

I have added the contribution that shows the item in the store as "out of stock" and removes the "buy now button," but if someone buys an item, then it changes the status of item to "inactive." This means that visitors can no longer view the item at all.

 

Is there a way to fix this? I have looked through the contributions and searched the forums, but havn't found an answer yet. I will keep searching the forum, but I figured i would go ahead and post this question. maybe its such a simple solution, that i am missing it ? :)

 

Thanks in advace,

 

William Donnell

william donnell

Posted
I have a store that sells custom pottery.  So there is typically only 1 of each item.  When someone buy an item, it makes the status of the item "inactive."I want the status of the item to stay active even when the item is "out of stock."

 

I have added the contribution that shows the item in the store as "out of stock" and removes the "buy now button," but if someone buys an item, then it changes the status of item to "inactive."  This means that visitors can no longer view the item at all.

 

Is there a way to fix this? I have looked through the contributions and searched the forums, but havn't found an answer yet.  I will keep searching the forum, but I figured i would go ahead and post this question.  maybe its such a simple solution, that i am missing it ?  :)

 

Thanks in advace,

 

William Donnell

 

 

well, it depends a little on the contribution you installed.

however, the de-activation of the product is done in checkout_process.php

 

this code :

 

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

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']) . "'");

}

 

will set the status of the product to 0 of the stock left is smaller than 1

Treasurer MFC

Posted

---

So, if i set the 0 to 1 like this

 

....TABLE_PRODUCTS . " set products_status = '1' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

 

 

then it will keep the product active? is that right?

 

William

william donnell

Posted
---

So, if i set the 0 to 1 like this

 

....TABLE_PRODUCTS . " set products_status = '1' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

then it will keep the product active?  is that right?

 

William

 

well, you don't have to, it should already be 1, just prevent it from setting it to 0.

so just comment-out the update statement or by all means update it with 1

Treasurer MFC

Posted
well, you don't have to, it should already be 1, just prevent it from setting it to 0.

so just comment-out the update statement or by all means update it with 1

 

 

You could also set allow checkout without stock to true in admin which will also prevent the status to become 0 .

this depends on whether you just want the product to show up or also allow people to buy it.

Treasurer MFC

Posted
You could also set allow checkout without stock to true in admin which will also prevent the status to become 0 .

this depends on whether you just want the product to show up or also allow people to buy it.

 

yeah, i want people to see the products, but not purchase them. This way it shows off the work the does/can do...even if that piece is not available at the moment.

 

William

william donnell

  • 5 months later...
Posted

If you add the osCommerce supported PayPal IPN you need to go into the module directory and edit the paypal_ipn.php file and comment the same section of code. If you don't then when they pay with PayPal it will set the product to inactive.

 

Dave.

Archived

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

×
×
  • Create New...