on ‎2019 Jul 05 3:19 PM
Hi All, we are currently using hybris 6.4 with OCC v2. We are calling the following API to transfer the anonymous cart (with coupon applied) to the registered user:
POST /v2/mysite/users/user@mail.com/carts
Param: oldCartId=c1185754-52b5-4057-9b02-abd24d0db576
The cart entries and promotions get moved to the registered user cart but this is not happening for the coupons.
Any suggestion?
Thanks, Riccardo
Request clarification before answering.
Hi Riccardo,
we had the same issue and solved it by overriding the CartsController/DefaultCartFacade to use this method:
de.hybris.platform.commercefacades.order.impl.DefaultCartFacade.restoreAnonymousCartAndTakeOwnership(String)
It does not clone the given cart, but (really) takes the ownership as the method signature says 😉
Kind regards
Eddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I have the hybris version 6.3 and the restoreAnonymousCartAndMerge method gives me the same problem, how could you solve your problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arvind, we used those APIs for the anonymous cnd they work fine. However they shouldn't be called again when merging the anonymous cart to the user cart. Please see the suggested flow (section Voucher Usage) When the anonymous cart is merged to the user clso coupons should be moved across or not?
I'm afraid I will need to override the current facade logic for the API mentioned at the beginning (/carts) in order to copy over the coupons.
thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try one of the following after moving the cart?
POST /{baseSiteId}/users/{userId}/carts/{cartId}/promotions
POST /{baseSiteId}/users/{userId}/carts/{cartId}/vouchers
Please check https://help.sap.com/doc/0e9065bfffdf4877a5aac1bf4ff9c32c/1811/en-US/ycommercewebservices/index.html for more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.