0

I've noticed that invoking CommerceCart.deleteCart method does not cascade the deletion on its Cart Items.
Am I doing something wrong, or is it a correct behavior?
The description of this method in the documentation is very brief and does not contain any information.

Update I've investigated it more deeply, and it seems that after the deleteCart method is invoked the status of cart changes to PendingDelete, so the deletion job is queued. However I want that job to be fired right after I invoke the deleteCart.

3
  • Hello Rechu, may I ask what is the requirement for the job to be kicked out immediately? I'm asking because the cart under Pending Delete status are not visible anymore. Oct 29 '21 at 10:19
  • I have a Trigger on CartItem delete, that makes some important logic for me.
    – Rechu
    Oct 29 '21 at 11:13
  • But I've already resolved my issue, by just running a DML delete on CartItems, and I left Cart to be deleted via CommerceCart api.
    – Rechu
    Oct 29 '21 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.