Jump to content

[solved] Empty cart problem 1.6.0.9


Recommended Posts

Hi there,

I've installed new shop a month ago (lacepatterns.eu), imported about 1500 products from old VM store and everything seems fine, except cart function.

Cart works just fine for some customers but for some not; when not working it is impossible to add more than one product. Even with one product, cart is empty at checkout. Occasionally it starts working after some clicks to “Add to cart” button, occasionally not.

No solution known form forum seems to work and I'm a bit desperate.

Is somewhere a list of possible reasons and a solution that works for sure? Since, like somebody already wrote, it does not make sense to have a store where people can’t buy.

Many thanks for any suggestion!

Edited by simon_68 (see edit history)
Link to comment
Share on other sites

Go to 'Modules' and click on the 'Cart Block' module. Select 'NO' for ajax cart.

 

I love ajax cart and would like to use it. If this is a known problem or bug, I'm wondering why developers haven't solved it yet. Or there are special circumstances when ajax cart works and when not?

 

Tried today, cart doesn't work with ajax, switched ajax off, still doesn't work, switched ajax on and reloaded page (Ctrl+F5 in FO), cart starts working after some clicks to "Add to cart".

 

www.lacepatterns.eu 

Edited by simon_68 (see edit history)
Link to comment
Share on other sites

I had similar problem, drove me crazy!...this solution worked for me.

 

using phpmyadmin

find the following tables, and export them (back up)

ps_connections
ps_connections_page
ps_connections_source

 

then using phpmyadmin 'empty the table  (TRUNCATE)

 

do this for each of these tables...

 

I've tried this several times, together with cache clear on both sides and forced compilation, but unfortunately doesn't work for me. Ok, usually cart starts working after this for particular test or customer, but after some time, another customer complains that cart doesn't work.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 months later...

Chris,

 

unfortunately I'm not clever enough to write a script which will solve all the problems with cart. What you have to do is find illegal values in the table and columns I mentioned.

And which values are illegal? This information you can get by comparing the data in some working demo DB or fresh installation DB and your DB with cart problems.

 

Let us know about success!

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

I had the same problem. No "non ajax cart", cookie deleting, cache emptying etc. helped. But the hint with the ps_order table was very helpful:

 

That's what I did: ( it was a 1.4 -> 1.6.0.14 migration project)

 

Check your ps_order table: Look, what is the highest id of your id_cart column.

 

Now you can look into your id_cart table: if the IDs there are lower, than you might have a problem.

 

Easy to fix: check your autoincrement value:

 

SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'YOURDATABASENAME' AND TABLE_NAME = 'ps_cart'

 

add 1 or 10 AND

DO

 

ALTER TABLE ps_cart AUTO_INCREMENT = thenewvalue;

 

 

No guarantee, backup first, just a chance to fix it...

 

Cheers,

Peter

Edited by Pete78 (see edit history)
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

I am facing the empty cart issue after upgrading from 1.4 to 1.6.

 

I've checked both tables and indeed my id_cart values in the ps_order table are higher (around 500) than id_cart in the ps_cart table.

 

Can you explain exactly what should I do? Because

Easy to fix: check your autoincrement value:

SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'YOURDATABASENAME' AND TABLE_NAME = 'ps_cart'

add 1 or 10 AND

DO

ALTER TABLE ps_cart AUTO_INCREMENT = thenewvalue;

isn't exactly clear for me.

 

Thanks!

Link to comment
Share on other sites

First:

Rund this query in phpmyadmin:

 

SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'YOURDATABASENAME' AND TABLE_NAME = 'ps_cart'

 

You will get a value, Take this value and add 1 to it. (lets call the new value "thenewvalue"

 

 

Second: 

 

Run this query:

ALTER TABLE ps_cart AUTO_INCREMENT = thenewvalue;

 

 

 

thats it...

Link to comment
Share on other sites

  • 4 weeks later...

I have just spent two days to solve it and here is what helped me: 

 

  My problem was corrupted database (cart id mismatch or sth), and making one order from backoffice set everything in place.

 

Here are similar solved issues: 

http://forge.prestashop.com/browse/PSCFV-10487
http://forge.prestashop.com/browse/PSCSX-5921

http://forge.prestashop.com/browse/PSCSX-4728
https://www.prestashop.com/forums/topic/392573-solved-empty-cart-problem-1609/

  • Like 2
Link to comment
Share on other sites

  • 11 months later...

First:

Rund this query in phpmyadmin:

 

SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'YOURDATABASENAME' AND TABLE_NAME = 'ps_cart'

 

You will get a value, Take this value and add 1 to it. (lets call the new value "thenewvalue"

 

 

Second: 

 

Run this query:

ALTER TABLE ps_cart AUTO_INCREMENT = thenewvalue;

 

 

 

thats it...

Hi meaby this is simple for you but can you tell me how you create "thenewvalue" im never do that. Any printscreen please this will be very helpfull

 

 

Link to comment
Share on other sites

  • 3 months later...

Hi meaby this is simple for you but can you tell me how you create "thenewvalue" im never do that. Any printscreen please this will be very helpfull

 

 

 

Hey, in phpmyadmin, you should look into ps_orders table, sort it by descending id_cart, write down the value of the biggest cart_id in it (which you can also get in SQL tab by doing "SELECT max(id_cart) as bigid FROM ps_order" if it's simpler for you). Then you add 10 or 100 to this number, and you got your "thenewvalue". The idea here is to make it so ps_cart never gives an ID to a new cart that already exists in ps_orders.

 

----

 

As a side note, this issue has been driving me mad, and I never thought about this reason. I applied the fix and my issues seem solved. Thank you very much for the insight, I encourage anyone having issues with an upgraded shop or a shop where you imported orders from an older shop to look into this.

Link to comment
Share on other sites

  • 6 months later...
×
×
  • Create New...