Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cart loses products seemingly randomly


tim_o_boy

Recommended Posts

Our shop has been happily running for around 13 years without many problems. However, occasionally products disappear from the cart as a customer goes around the site. This can be all the products in the cart or just one or two.

I've had a good search around but can't find anything quite like this. As it's seemingly random I can't reproduce it either. Just looking for any ideas if possible?

Link to comment
Share on other sites

13 years? If you're still using a 2005 vintage osCommerce (probably osC 2.2 MS2), it wouldn't be surprising if your host has upgraded PHP or made some other change that is making an old store unstable. What version are you using, and what is your host's PHP version? The current (and only supported) version of osC is 2.3.4.1BS "Frozen". Note that the official osC 2.3.4.1 release does not work with current PHP releases.

Link to comment
Share on other sites

2 hours ago, tim_o_boy said:

However, occasionally products disappear from the cart as a customer goes around the site. This can be all the products in the cart or just one or two.

Question to be asked is it just customer error! I have had customers complain only to find they have removed the product and forgotten about it! I have also had customers put stuff in the cart and not check out, they come back latter and complain why is stuff in my cart! Well they left it in!

Unless you can replicate the problem you will never be able to pin it down. It could be something as simple as the session running out or it could just be customer error.

 

Link to comment
Share on other sites

Thanks for your replies!

From the start I began customising the system myself, taking all required elements from updates that my Frankenstein version required - mainly security related. Apart from this one strange quirk it works perfectly and processes around 20k orders a year without incident.

So I know some of you will be reluctant to offer any ideas as you have no idea of my code changes. All I can say is the coding of the cart is fundamentally what you work with. My changes are mainly UX related. So really I was just looking for pointers and ideally someone who may have seen the same problem.

The obvious thing is a problem with sessions but I'm not sure where, given the rare occurrence of it.

BTW, my partner who occasionally takes orders over the phone has had this happen to her too, so we can forget user error.

Link to comment
Share on other sites

i think this maybe a customers_id trouble.
shopping cart saved in every time into customers_basket table with logged in. when you find lost cart items it means that somebody delete items directly or data not saved into customers_basket.
it could be happen when customer press delete button directly. althought session is generated automatically there could be messed up protocols with mysql backend.
i think you have something not-well coding in shoppingCart class. there are reset() and cleanup() class functions with delete cart item commands.
i have found notes in shoppingCart class:

Quote

// reset per-session cart contents, but not the database contents

there are more possible way on code side to lose items even if you programming something different by your own way or add_cart() not end up here:

            $this->contents[$products_id_string] = array('qty' => (int)$qty);
// insert into database
            if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')");

you might see that session contens is building before database saving. if datasave is not working then your partner step into the trouble.

if no time to close process on server (mysql server reset?) something not expected could be happen. maybe inno db engine could be more safety for this problem but i am not sure to solve it.
i have seen countless odd cases due to server side problems so this could be one of them.

finaly if your partner not logged in before session time out then the same could be happen.
 

Link to comment
Share on other sites

Yeah, I'd check if current versions use a wider database field for session information than your (old) code does.

If you've been keeping up on changes for new PHP levels and security issues, you can keep running as you are, although the fact that you're having this cart problem suggests that you may be overlooking some changes. It may be time to step back and consider whether this is a good approach, as opposed to moving to the current release and building something resembling a template over it. Let others do the work of keeping up with the basics, while you concentrate on code to make your store stand out and improve the UX. It could well be less work overall to copy your changes to a new release than to constantly patch an old base. For example, did you do a lot for Responsive/Mobile-friendly? That's built right into "Frozen". What you have to keep in mind is that the longer you stay with an old, old base, the less help you can get from this forum and the more you're on your own. You've essentially made your own fork of the product.

Whichever way you choose to go, good luck and best wishes.

Link to comment
Share on other sites

  • 2 weeks later...
On 1/9/2019 at 11:36 AM, tim_o_boy said:

Our shop has been happily running for around 13 years without many problems. However, occasionally products disappear from the cart as a customer goes around the site. This can be all the products in the cart or just one or two.

I've had a good search around but can't find anything quite like this. As it's seemingly random I can't reproduce it either. Just looking for any ideas if possible?

Question to be asked is it just client mistake! I have had clients gripe just to discover they have expelled the item and overlooked it! I have likewise had clients placed stuff in the truck and not look at, they return last mentioned and whine for what reason is stuff in my truck! Well they left it in! 

Except if you can repeat the issue you will never have the capacity to bind it. It could be something as basic as the session running out or it could simply be client mistake.

Link to comment
Share on other sites

On 1/10/2019 at 12:29 PM, tim_o_boy said:

Thanks for your help a123! I'll investigate everything you've suggested

However, occasionally products disappear from the cart as a customer goes around the site. This can be all the products in the cart or just one or two.

I've had a good search around but can't find anything quite like this. As it's seemingly random I can't reproduce it either. Just looking for any ideas if possible?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...