Duplicate shopping carts

Phoca Cart - complex e-commerce extension
NickS
Phoca Member
Phoca Member
Posts: 21
Joined: 25 Mar 2020, 23:54

Duplicate shopping carts

Post by NickS »

I ran into a problem when choosing a shipping method in the shopping cart: the user selects a shipping method, the page is updated and the shipping method is not selected.

Long searches led to the table "phocacart_cart_multiple" in which duplicates of user carts were accumulated. Here is one example of exporting a table:

Code: Select all

INSERT INTO `k3zls9_phocacart_cart_multiple` (`user_id`, `vendor_id`, `ticket_id`, `unit_id`, `section_id`, `loyalty_card_number`, `cart`, `shipping`, `coupon`, `payment`, `reward`, `type`, `date`) VALUES
(8975, 0, 0, 0, 0, '', 'a:1:{s:7:\"13003::\";a:2:{s:5:\"catid\";i:21;s:8:\"quantity\";i:1;}}', 0, 0, 0, 0, 0, '2020-12-05 09:10:49'),
(8975, 0, 0, 0, 0, '', 'a:1:{s:7:\"13003::\";a:2:{s:5:\"catid\";i:21;s:8:\"quantity\";i:1;}}', 0, 0, 0, 0, 0, '2020-12-05 09:10:59'),
(8975, 0, 0, 0, 0, '', 'a:1:{s:7:\"13003::\";a:2:{s:5:\"catid\";i:21;s:8:\"quantity\";i:1;}}', 0, 0, 0, 0, 0, '2020-12-05 09:11:08');
When the user selects a delivery method or payment method, instead of changing the data in the row, a new row is created in the "phocacart_cart_multiple" table. I REPAIRed and OPTIMIZEed the table - for new carts everything was OK, but for those who had duplicates, everything remained the same: every time you choose a delivery method or payment, a duplicate of the record in the table appeared.

As far as i understand, there was some kind of failure on the server or in mysql.

Is there any way to make an automatic check for duplicate records and automatically delete duplicates if they appear?

Thank you!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Duplicate shopping carts

Post by Jan »

Hi, there is no such option. Usually you can empty user cart in administration (in customer list):

Image

Image

So in fact, if there will be more instances of the same cart, it should delete them all (but hard to say if this will work, because testing now, no multiple rows added in the table :idea: )

Jan
If you find Phoca extensions useful, please support the project
Post Reply