1

Cart items clear before payment success if the payment is failed then cart products are cleared in API. Actually I need if payment is failed the product no need to remove from carts this case working in web but not in API !!. how can i solve this problem in Magento 2.3

Thanks

asked Aug 23, 2019 at 4:47

1 Answer 1

1

You can reset your cart using the following code.

$quotefactory = $objectManager->get('Magento\Quote\Model\QuoteFactory');
$quote = $quotefactory->create()->load('your_quote_id');
$quote->setIsActive(true);
$quote->save();

NB: I used object manager as a reference. Do not use object manager in your code.

answered Aug 23, 2019 at 5:03
3
  • Thanks @dhanus , let me check Commented Aug 23, 2019 at 5:04
  • Okay, let me know if you have any queries on this. Commented Aug 23, 2019 at 5:05
  • Great!! its working Thank you @dhanus Commented Aug 23, 2019 at 5:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.