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

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.

| improve this answer | |
  • Thanks @dhanus , let me check – Shafeel Sha Aug 23 '19 at 5:04
  • Okay, let me know if you have any queries on this. – dhanus Aug 23 '19 at 5:05
  • Great!! its working Thank you @dhanus – Shafeel Sha Aug 23 '19 at 5:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.