OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Not sure if it is a bug or a feature
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
ruboo
I had a problem with order, when customer added some product to his shopping cart, then comes back later, checks out, and if you meanwhile disabled the product from your catalog (set inactive), the customer was still able to purchase it, and later I had problems asking him to choose replacment, or arrange refund, a lot of headache
so you can change in includes/classes/shopping_cart.php


// products price
$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

to
// products price
$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "' and products_status = '1'");

and
------------------------------
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

to

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'");

hope that helps someone:)
wheeloftime
QUOTE (ruboo @ Jan 15 2007, 09:56 AM) *
I had a problem with order, when customer added some product to his shopping cart, then comes back later, checks out, and if you meanwhile disabled the product from your catalog (set inactive), the customer was still able to purchase it, and later I had problems asking him to choose replacment, or arrange refund, a lot of headache
so you can change in includes/classes/shopping_cart.php

Hello Arman,

Though the solution might work it is not the correct way to go! If you want to make sure someone can not checkout with a product which has been disabled/got 0 stock you can set your admin->configuration->stock->allow checkout to false. Of course the option Check Stock Level should be set to true.

regards,
Howard
ruboo
QUOTE (wheeloftime @ Jan 15 2007, 09:27 AM) *
Hello Arman,

Though the solution might work it is not the correct way to go! If you want to make sure someone can not checkout with a product which has been disabled/got 0 stock you can set your admin->configuration->stock->allow checkout to false. Of course the option Check Stock Level should be set to true.

regards,
Howard


Hi Howard,

It is set to false, but still customer is able to check out, it does not check inactive status, only if set to 0. Can you please check
wheeloftime
QUOTE (ruboo @ Jan 15 2007, 11:07 AM) *
Hi Howard,

It is set to false, but still customer is able to check out, it does not check inactive status, only if set to 0. Can you please check

Hi Arman,

I don't have to check as it is true what you say. I thought it was about stock but I understand now it is a product once available but temporarily not while stock stays larger then zero.
I guess it is a feature when you use a direct link to inactive products for special customers but normally your applied changes would be a sound thing to do !
I'll pass this through to the development team members and if there is going to be another update for MS2.2 they might include these fixes...

Thanks,
Howard
gregy
is there any idea for temporarily fix?
wheeloftime
QUOTE (gregy @ Jan 31 2007, 10:13 AM) *
is there any idea for temporarily fix?

Sorry ? The fix is right on top of this thread. Apply it and you'll be fine.
gregy
hmm .. sorry didn't try it because in next thread (second) you gave us advice about settings but didn't worked for me ..

i'm going to implement it now!

thanx for support!
satish
A simple cron script that should check a baskets and the product table.
It runs once a day or can be execued on product delete.


Regards,
Satish
wheeloftime
QUOTE (gregy @ Jan 31 2007, 12:16 PM) *
hmm .. sorry didn't try it because in next thread (second) you gave us advice about settings but didn't worked for me ..

i'm going to implement it now!

thanx for support!

I gave you advice about settings and this thread in case you meant what was described here.
gregy
back again smile.gif

This fix above works, except, customer can continue shopping.. but without product smile.gif

I finished my purchase with shipping costs added to nothing smile.gif

anyway .. this is better as before when they were able to purchase

thanx
gregy
QUOTE (satish @ Jan 31 2007, 12:40 PM) *
A simple cron script that should check a baskets and the product table.
It runs once a day or can be execued on product delete.
Regards,
Satish


sounds good .. any sentance for cron to insert to?
gregy
Hi

I didn't had this problem again in this time, but it came back. Yesterday we have had about 1600 customers at once. Half of them were trying to buy tickets. And the result? Stock went to negative -1 and bunch of emails confirmations with empty products (with zero's)

Is there a way that OSC can check stock on every step .. even on final ... to put all orders in row, to check for stock one by one. Dunno what to do ..

thanx
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.