Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
product_configurable_not_available_rollback.php
Go to the documentation of this file.
1 <?php
9 
10 $objectManager = Bootstrap::getObjectManager();
11 
13 $registry = $objectManager->get(\Magento\Framework\Registry::class);
14 
15 $registry->unregister('isSecureArea');
16 $registry->register('isSecureArea', true);
17 
19 $productRepository = Bootstrap::getObjectManager()
20  ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
21 
22 $productSkus = ['simple_not_avalilable_1110', 'simple_not_avalilable_1120', 'configurable_not_available'];
24 $searchCriteriaBuilder = Bootstrap::getObjectManager()->get(SearchCriteriaBuilder::class);
25 $searchCriteriaBuilder->addFilter(ProductInterface::SKU, $productSkus, 'in');
27 foreach ($result->getItems() as $product) {
29 }
30 
31 require __DIR__ . '/../../../Magento/Framework/Search/_files/configurable_attribute_rollback.php';
32 
33 $registry->unregister('isSecureArea');
34 $registry->register('isSecureArea', false);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60