Post by jainyuvraj_opencart » Sun Nov 24, 2019 9:11 pm

Hey!

I am facing a wired issue on orders, I can see some of my orders have duplicated line items, I asked customer and found that they only want one and the other is added by system and users did not noticed about that, though credit card are charged for double already i.e. for all quantity in cart.

I did a lot of research on that and still I am not sure how this happens and what is the fixes for this.

I am attaching some images so you will understand the issue.

See how it looks on order panel.
https://prnt.sc/q1b8u1

When I check my oc_cart I can see there are few customers with same product_id on database, see attached image.
https://prnt.sc/q1b5tm

This is how oc_order_product look
https://prnt.sc/q1b9t1

I am not sure why this duplicate line items on my store and how can I remove or prevent this.

How it can be possible? I am using latest version of OC Version 3.0.2.0

This make us a lot of troubles , I need to fix it ASAP.

Thank you in advance.


Posts

Joined
Sun Nov 24, 2019 8:32 pm

Post by opencartmart » Mon Nov 25, 2019 3:47 am

Regarding cart product duplicity, i.e. https://prnt.sc/q1b5tm
It is not possible according to default behavior. It appears your other modules is causing it. What other extensions you are using related to cart products.

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by letxobnav » Mon Nov 25, 2019 6:53 am

This is possible with default behaviour when customer and guest carts are merged, that logic is not stable.
Problem has been reported before, I had it myself.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by jainyuvraj_opencart » Mon Nov 25, 2019 3:13 pm

letxobnav wrote:
Mon Nov 25, 2019 6:53 am
This is possible with default behaviour when customer and guest carts are merged, that logic is not stable.
Problem has been reported before, I had it myself.
What is solution to fix this issue, what you did on your store to get rid of this issue?


Posts

Joined
Sun Nov 24, 2019 8:32 pm

Post by jainyuvraj_opencart » Mon Nov 25, 2019 3:16 pm

opencartmart wrote:
Mon Nov 25, 2019 3:47 am
Regarding cart product duplicity, i.e. https://prnt.sc/q1b5tm
It is not possible according to default behavior. It appears your other modules is causing it. What other extensions you are using related to cart products.
There is no other modules except default ones, I cleared cache, session tables etc. though this issue comes again, not sure when and how this possible.. I need to fix this.

Thanks.


Posts

Joined
Sun Nov 24, 2019 8:32 pm

Post by opencartmart » Mon Nov 25, 2019 3:55 pm

@letxobnav I just tried your mentioned case in OC v3.0.2.0, and it merged quantity correctly for me instead of creating duplicity though the scenario was very straight forward. Maybe I did not follow the case you are referring to.

@jainyuvraj_opencart as letxobnav said it is possible. Maybe there is a case, I don't know about it. Perhaps that special case is occurring to you as you don't have any other extensions. I will try spending some more time and let you know if I get anything.

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by letxobnav » Mon Nov 25, 2019 4:07 pm

The problem is that the merging of the carts is coded in the construct of the cart class and is also executed with ajax calls which can collide with normal processing resulting in duplicates also enabled by the fact that there are no meaningful primary keys defined.
Placing that merging code in the construct is not only a waste (executed on every page load) but also causes these issues.

Solution is to move that code to a function and only call that when a customer logs in (merging guest and existing customer cart) or signs up (assign customer id to the guest cart).

I will try to find my post on that a little later.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by jainyuvraj_opencart » Tue Dec 10, 2019 7:30 pm

letxobnav wrote:
Mon Nov 25, 2019 4:07 pm
The problem is that the merging of the carts is coded in the construct of the cart class and is also executed with ajax calls which can collide with normal processing resulting in duplicates also enabled by the fact that there are no meaningful primary keys defined.
Placing that merging code in the construct is not only a waste (executed on every page load) but also causes these issues.

Solution is to move that code to a function and only call that when a customer logs in (merging guest and existing customer cart) or signs up (assign customer id to the guest cart).

I will try to find my post on that a little later.
Did you find you post link? I need to know how I can move that code?


Posts

Joined
Sun Nov 24, 2019 8:32 pm

Post by letxobnav » Tue Dec 10, 2019 11:06 pm

sorry, late reply, searching here is a pain.

viewtopic.php?f=201&t=211273&p=760539#p760539

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by jainyuvraj_opencart » Fri Dec 13, 2019 6:20 pm

sorry, late reply, searching here is a pain.

viewtopic.php?f=201&t=211273&p=760539#p760539
Thank you buddy, let me implement this on my store.


Posts

Joined
Sun Nov 24, 2019 8:32 pm
Who is online

Users browsing this forum: Semrush [Bot] and 65 guests