Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
second_product_simple_rollback.php
Go to the documentation of this file.
1 <?php
9 
10 $registry->unregister('isSecureArea');
11 $registry->register('isSecureArea', true);
12 
15 $product->load(6);
16 
17 if ($product->getId()) {
18  $product->delete();
19 }
20 
21 $registry->unregister('isSecureArea');
22 $registry->register('isSecureArea', false);