Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.

Check current state of cart

Avatar

Level 3

Hi,

 

I am working on the usual abandon cart use case. How can I check if their is any item in the cart. For example user can start the checkout and go back to remove the item from the cart, and possibly remove all items and make the cart empty.

 

How can I validate in the journey that there is atleast one item in the cart left before sending the abandon cart push?

 

TIA

5 Replies

Avatar

Level 3

Hi @SatheeskannaK , thank you for your response. Could you please guide me which event should I look for? I looked at the documentation you shared but couldn't find what I was looking for.

 

Currently I have following events configured in AEP, Backofficeorderplaced, productlistadds, productlistviews,purchase,checkout.

 

The problem is if I take cart value in any of these events, the cart value will be of when that event has happened, but even there is a product removal from cart, I will not know what is the current value of that cart.

I know that there is a productlistremoval event, but I am not sure if I can use that for multiple item removals.

Avatar

Employee

You can use collection management functions https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/building-adv... to perform this check to see if there is at least one check out event and no product removals from the cart in the last x hours.

Avatar

Level 3

Hi,

If I use this function, it will check if there nis product list removal event in last x hours. But even if there are product removals, there could still be items present in the cart. How can I tackle that?

Avatar

Employee

I am assuming you are relying on productListItems object array to know the number of items in the cart. If the productListItems count of checkout event is equal to count of productListItems count of the product removals since the checkout was started in the last x hours, that should give an indication there are no items in the cart.

 

Otherwise, you will need to build a custom API to check the state of the cart for a given user and use it as part of custom actions before proceeding further with further orchestration.