To merge loggedin and annoymous user's cart for same session.
User (username:jone) adds something in the cart (Product 1). Before add to cart: Cart is empty User adds something in the cart (Product 1). After add to cart: Order ID 15821 Line item IDs 159808
User registers and logins User logs out
Annoymous User adds something in the cart (Product 1). Before add to cart: Cart is empty Annoymous User adds something in the cart (Product 1). After add to cart: Order ID 15822 Line item IDs 159809
Annoymous User adds something in the cart (Product 2). Before add to cart: Order ID 15822 Line item IDs 159809 Annoymous User adds something in the cart (Product 2). After add to cart: Order ID 15822 Line item IDs 159809, 159810
Viewing the above log, somebody would assume that this user has bought 2 different products.
Now User checks out and login with username : jone
we want to after the login show/add last order product (159808)
However, currently we have the following situation.
Order 15821 Line item IDs 159808 are exist in database in checkout_checkout mode(status). Order 15822 exists with 2 line items, 2 different products. Line IDs are 159809, 159810.
I want to be displaying all line items 159808, 159809, 159810. but line item 159808 are not display
please suggest any solution.