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