Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Problems with AEM 6.1 / Hybris 5.4 integration

Avatar

Level 1

After several days I was able to get the integration of AEM 6.1 and hybris 5.4 running with the geometrixx-outdoors example. However, I had to change some things in the handling of promotions. AEM does not seem to cleanly distinguish between promotions that are handled by hybris (such as the perfect partner promotion) and those that are triggered through AEM (such as the DavosTrekGift).

Nevertheless, I am still running into concurrency issues when updating the cart. An entry added to the shopping cart very often disappears immediately (presumably because of multiple calls to contexthub.cart.json which resets the cart to its old state). Has anybody experienced the same issue?

6 Replies

Avatar

Level 10

AFAIK FP for commerce integration with AEM 6.1 not released yet and is still in beta though we have latest stable copy..  Request you to please engage through support channel by mentioning which hybris package you are using.

Avatar

Level 9

@MatzeT ,

Are you sure it is a concurrency issue?. Are you using AEM OOTB component?.

In an ideal situation, you use some persistent mechanism (session/cookie) maintain cart, if added item disappears from the cart, I would request you to re-verify your logic. There might be a bug where you clear the persist data.

--

Jitendra

Avatar

Level 1

Hi Jitendra,

 

Yes, I it's all OOTB. And I am pretty sure, that it its a concurrency issue since I can see that this happens when two requests to "contexthub.commerce.cart.json" overlap, the second one posting the old cart which is updated after the first response arrives:

Setting a suitable breakpoint helps, but is clearly no solution to this issue.

 

Matthias

Avatar

Level 1

Ok, I will contact support.

FYI: I am using adobe/cq610:cq-hybris-content:6.0.58 and day/cq610:cq-geometrixx-hybris-content:6.0.58 which look to me like a 6.1 version or is "cq610" just misleading?

Avatar

Level 9

@MatzeT,

If I do consider that this is concurrency issue, Did we try to find out why there are multiple calls to update cart?. It is supposed to be one at a time.

Jitendra

MatzeT wrote...

Hi Jitendra,

 

Yes, I it's all OOTB. And I am pretty sure, that it its a concurrency issue since I can see that this happens when two requests to "contexthub.commerce.cart.json" overlap, the second one posting the old cart which is updated after the first response arrives:

Setting a suitable breakpoint helps, but is clearly no solution to this issue.

 

Matthias

 

Avatar

Level 1

Jitendra S.Tomar wrote...

@MatzeT,

If I do consider that this is concurrency issue, Did we try to find out why there are multiple calls to update cart?. It is supposed to be one at a time.

Jitendra

 

As far as I understand this is caused by the ContextHub CartStore (which also handles promotions). On cart update, it checks for user's segments and determines the promotions that should be applied to the cart (e.g., if cart value crosses the $ 200 mark, the DavosTrekGift promotion will be added to the cart). After the check, the whole shopping cart is sent back to the server - unfortunately the CartStore is not yet updated at this point in time, only the visible page content already reflects the new cart. The update arrives too late and is being overwritten by the "promotion" update which is already ongoing.