X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   How to change order item identity in cart (https://forum.x-cart.com/showthread.php?t=76496)

go2ready 08-29-2018 12:35 AM

How to change order item identity in cart
 
Hello there,

We have added some another ID to the order item, lets call it otherID. Now each order item have a productID that put the same order item into the same cart entry, so if I added two order item which have productID=5, otherID=1 and 2 respectively, they will be put into one entry in cart and there is no way to distinguish them.

Can anyone shred any light on me about how to change it? Do I need to make otherID part of order item's composite key?

With thanks,
Richard

qualiteam 08-29-2018 04:01 AM

Re: How to change order item identity in cart
 
Could you possibly provide a screenshot with an example?
As I can see when I put two identical items into the cart, the minicart displays the multiplier, like 2x items in the cart.

go2ready 08-29-2018 04:18 AM

Re: How to change order item identity in cart
 
Hey Alex, Thanks for responding. But the behaviour you described is the one I am aiming to change. Our system requires order to be added from 3rd party website, lets say it is from Reddit.com, the orderitem from that site is stamped with a ID saying that it is from which external source.

Our problem is that such ID is not a attribute value, so the cart will make no distinguish between the item added from external site and the item that is added in xcart.

We seems to found the solution is to change the getKey() implementation of OrderItem, so the key should contain the ID from external site. It should work in theory but we haven't tested it yet, thank you very much and any comment is appreciated :)

Thanks


All times are GMT -8. The time now is 08:24 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.