Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
quote_rollback.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
11 $registry = Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
12 $registry->unregister('isSecureArea');
13 $registry->register('isSecureArea', true);
14 
16 $quoteCollection = Bootstrap::getObjectManager()->create(\Magento\Quote\Model\ResourceModel\Quote\Collection::class);
17 foreach ($quoteCollection as $quote) {
18  $quote->delete();
19 }
20 
21 $registry->unregister('isSecureArea');
22 $registry->register('isSecureArea', false);
$quote
$quoteCollection
$registry