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
Shafeel Sha
1,40516 silver badges34 bronze badges
1 Answer 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.
-
Thanks @dhanus , let me checkShafeel Sha– Shafeel Sha2019年08月23日 05:04:11 +00:00Commented Aug 23, 2019 at 5:04
-
Okay, let me know if you have any queries on this.dhanus– dhanus2019年08月23日 05:05:15 +00:00Commented Aug 23, 2019 at 5:05
-
Great!! its working Thank you @dhanusShafeel Sha– Shafeel Sha2019年08月23日 05:22:16 +00:00Commented Aug 23, 2019 at 5:22
default