When i run a script then clear cart items from all PCs which already added a cart item(s).
2
Run the following Query :
Delete FROM quote WHERE is_active=1 AND reserved_order_id IS NULL
quote
Now run following command from Your Magento Root directory :
Truncate persistent_session
try below code.
protected $quoteFactory; public function __construct( ... MagentoQuoteModelQuoteFactory $quoteFactory, .... ) { .... $this->quoteFactory = $quoteFactory; .... } $quoteCollection = $this->quoteFactory->create()->getCollection() ->addFieldToFilter('is_active', 1); foreach ($quoteCollection as $item) { $item->delete(); }
Click here to cancel reply.
2
Answers
Run the following Query :
Now run following command from Your Magento Root directory :
try below code.