I am developing LWC on a community site of b2b commerce. Is there a way to get the current cartId directly from the LWC or I have to get it from soql?

note: I cannot get it from {!recordId} because the component is not on the cart page.

Edit: Alternatively, which condition I need to add to the query to get the current cart ?

  • Hi Raphael! If the component is attached to Cart Page & Checkout Page you could leverage the {!recordId} to query the cart id. However in my experience, if not, you have to perform soql to retrieve it. You would need the following fields to get the correct cart Webcart.OwnerId Webcart.AccountId Webcart.WebStoreId Webcart.Status = Active
    – malacdon
    Jan 24 at 0:20


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.