I am had the following weird situation, and I believe I have to post it here to hear your thought. It seems to be a bug, and as far as I can tell checking existing custom code it is not related to my custom behavior but something core related.
How the problem has been identified
Hey! It seems that there are two products within the same order with the same SKU, that should be merged, but still they are shown in two different rows.
How debugging info is given
Because products are added through AJAX, and in order to identify what happens, I have put here there watchdog requests that printed the status of the order. For this problem, I was printing (print_r) the current order just *before* and immediately *after* the "add to cart request.
Debugging info
00:10 User adds something in the cart (Product 1). Before add to cart: Cart is empty
00:10 User adds something in the cart (Product 1). After add to cart: Order ID 15821 Line item IDs 159808
00:23 User registers and logins
00:25 User logs out
00:26 User adds something in the cart (Product 1). Before add to cart: Cart is empty
00:26 User adds something in the cart (Product 1). After add to cart: Order ID 15822 Line item IDs 159809
00:31 User adds something in the cart (Product 2). Before add to cart: Order ID 15822 Line item IDs 159809
00:31 User adds something in the cart (Product 2). After add to cart: Order ID 15822 Line item IDs 159809, 159810
00:33 User adds something in the cart (Product 3). Before add to cart: Order ID 15822 Line item IDs 159809, 159810
00:33 User adds something in the cart (Product 3). After add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811
00:33 User adds something in the cart (Product 4). Before add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811
00:33 User adds something in the cart (Product 4). After add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811, 159812
00:35 User adds something in the cart (Product 5). Before add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811, 159812
00:35 User adds something in the cart (Product 5). After add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811, 159812, 159813
00:40 User adds something in the cart (Product 6). Before add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811, 159812, 159813
00:40 User adds something in the cart (Product 6). After add to cart: Order ID 15822 Line item IDs 159809, 159810, 159811, 159812, 159813, 159814
00:48 User checks out
Viewing the above log, somebody would assume that this user has bought 6 different products.
However, currently we have the following situation.
Order 15821 does not exist ( /admin/commerce/orders/15821 ), and gives error not found
Order 15822 exists with 7 line items, 6 different products. Line IDs are 159808, 159809, 159810, 159811, 159812, 159813, 159814
Line items 159808 and 159809 refer to the same SKU product. Please note that Line item 159808 was initially created in order 15821 but eventually showed up in order 15822.
Any thoughts are welcome!
Comments
Comment #1
xaris.tsimpouris CreditAttribution: xaris.tsimpouris commentedComment #2
rszrama CreditAttribution: rszrama commentedI'm sorry, this is not core behavior, so you must have some module or Rules configuration working to combine line items into a single order this way. I don't know of any off the top of my head that do that, so you'll have to just research that in your own configuration. Sorry I can't be more help.
Comment #3
vishal.sirsodiya CreditAttribution: vishal.sirsodiya commentedHi
I am facing same problem
anybody please help me ...
Comment #4
vishal.sirsodiya CreditAttribution: vishal.sirsodiya commentedComment #5
rszrama CreditAttribution: rszrama commentedMy comment in #2 still applies.
Comment #6
vishal.sirsodiya CreditAttribution: vishal.sirsodiya commentedI have solved this, by custom code.
First you create a login handler like.
Thankyou :)