Jump to content

Product added to shopping cart - there is 0 item in your cart


Creativeartsupplies

Recommended Posts

Prestashop version 1.7.6.5 - also appeared in 1.7.3

I have scoured the forums and google looking at related posts with no solution.

Description.

When visiting a product page and adding the product to the cart the popup appears but no product is added. 

Useful url for you to quickly test: https://www.creative-art-supplies.co.uk/colour/artist-ink/acrylic-ink/daler-rowney-fw-acrylic-artist-ink-180ml.html

 

What have I done to fix with no solution

I have disabled almost every module stripped prestashop right down to basic modules.

I have cleared cache, wiped cookies from browser, ran in incognito.

Truncated the connections tables in database.

Wiped the theme (using default classic) and re installed the theme with default files using ftp.

Checked all browsers. Problem occurs in every one.

Ran debug mode to check for errors - none showing

 

So what could have triggered the issue?

New modules installed (possible but these have all been disabled)

Database problem with carts and orders (likely) I do have another module (fastbay) which is returning unknow error on importing orders. I think the 2 problems are linked

 

I am happy to pay for someone to fix this problem. 

image.thumb.png.f8e361bdfe215f480e1179624e81a91f.png

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

*** SOLVED ***

After looking at my orders I noticed there were issues with order IDs and Cart IDs. For instance a completed order had a linked Cart ID that had nothing to do with the order. 

I backed up all my orders, then emptied the cart and orders database items. After this both my issues were sorted.

I think perhaps there would have been a better way of doing this without losing all the data in orders but it was all i could do after seeing such slow responses on similar posts.

  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...
On 12/2/2021 at 10:02 PM, pattila01 said:

Please let me know if you have any questions, I can help, I found a solution for this problem.

It would be really nice if you could explain how to solve this issue. I have the exact same problem as op. What are order and cart ID's, @Creativeartsupplies is taking about? I've been using Prestashop for a month and i dont know everything very well. Hope you can help :)

One weird difference i have is that add to cart doesnt work through Chrome and Edge, but works perfectly through Firefox. And yes, cash and cookies are cleared.

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

I am having a similar issue as for some customers they get an error like:

 

"exception":"[object] (PrestaShop\\Module\\PrestashopCheckout\\Exception\\PsCheckoutException(code: 2): No PrestaShop Order associated to this PayPal Order at this time. at /home/craftyfl/public_html/modules/ps_checkout/src/Dispatcher/OrderDispatcher.php:62)"}

Have raised this with the developers and heard nothing back

Link to comment
Share on other sites

  • 9 months later...
On 12/7/2021 at 9:48 PM, pattila01 said:

Please contact me privately. Not because the money, but this thing is very complicated, I have to see your database and your server configuration.

Could you please post the solution? I am facing the same problem

Link to comment
Share on other sites

On 5/15/2020 at 12:12 PM, Creativeartsupplies said:

*** SOLVED ***

After looking at my orders I noticed there were issues with order IDs and Cart IDs. For instance a completed order had a linked Cart ID that had nothing to do with the order. 

I backed up all my orders, then emptied the cart and orders database items. After this both my issues were sorted.

I think perhaps there would have been a better way of doing this without losing all the data in orders but it was all i could do after seeing such slow responses on similar posts.

If you ever need a solution for this issue, here it is:

I have noticed that I had a wierd Log (Advanced Parameters -> Logs) being generated for the carts that were being attached to the old order IDs. The log was the following:

Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart

I instantly thought this could be a unsynchronization of the tables in DB of the tables - ps_cart and ps_orders

Looked up online and found the solution to my problem on Stackoverflow thanks to Dmitry Sheiko:

Quote

In your case "Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart" most likely triggered because the condition in PaymentModule::validateOrder is false. It can as well happen in the FrontController.

Anyways it comes from Cart::orderExists method. The reason cart is considered as existing can be unsynchronization of ps_cart and ps_orders tables. Try the following: run in mysql the following queries:

SELECT id_cart FROM ps_cart ORDER by id_cart DESC LIMIT 1; SELECT id_cart FROM ps_orders ORDER by id_cart DESC LIMIT 1;

To me the first was giving 345 while the second 1891, meaning AUTOINCREMENT value for ps_cart was set less then existing id_cart values in ps_orders. What makes a newly created cart quite a candidate to exist already in ps_orders.

So I simply increased the value of AUTOINCREMENT:

ALTER TABLE ps_cart AUTO_INCREMENT = 2000;

and it fixed the issue to me.

In my case I had 286 on the first query and 23758 on the second query so I changed the AUTO_INCREMENT to 30000 instead of 2000 and fixed the issue!

Link to comment
Share on other sites

  • 2 years later...
On 9/12/2022 at 9:31 AM, stennnn said:

If you ever need a solution for this issue, here it is:

I have noticed that I had a wierd Log (Advanced Parameters -> Logs) being generated for the carts that were being attached to the old order IDs. The log was the following:

Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart

I instantly thought this could be a unsynchronization of the tables in DB of the tables - ps_cart and ps_orders

Looked up online and found the solution to my problem on Stackoverflow thanks to Dmitry Sheiko:

In my case I had 286 on the first query and 23758 on the second query so I changed the AUTO_INCREMENT to 30000 instead of 2000 and fixed the issue!

What if I have this?:

SELECT id_cart FROM ps_cart ORDER by id_cart DESC LIMIT 1;

305734

 

And :

 

SELECT id_cart FROM ps_orders ORDER by id_cart DESC LIMIT 1;

305730

 

I have that problem and also that when adding products to the cart a cart of value 0 is generated.

 

Thanks in advance.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...