7 use \Magento\Store\Model\Website;
9 use \Magento\Store\Model\Group;
13 use \Magento\Catalog\Api\ProductRepositoryInterface;
14 use \Magento\Framework\App\ResourceConnection;
15 use \Magento\Catalog\Model\Product\Attribute\Source\Status as AttributeStatus;
16 use \Magento\Catalog\Model\Product;
18 use \Magento\TestFramework\Helper\Bootstrap;
35 ->getMetadata(\
Magento\Catalog\Api\Data\ProductInterface::class)
46 $website->setName(
'custom website for av test')
47 ->setCode(
'customwebsite1');
61 ->setName(
'custom store group for av test')
76 $storeOne->setName(
'custom store for av test')
77 ->setCode(
'customstoreview1')
90 $storeTwo->setName(
'custom store for av test 2')
91 ->setCode(
'customstoreview2')
101 ->create(\
Magento\CatalogSearch\Model\Indexer\
Fulltext\Processor::class)
113 ->setAttributeSetId(4)
114 ->setName(
'Simple Product custom')
115 ->setSku(
'simplecustomproduct')
116 ->setTaxClassId(
'none')
117 ->setDescription(
'description')
118 ->setShortDescription(
'short description')
119 ->setOptionsContainer(
'container1')
120 ->setMsrpDisplayActualPriceType(\
Magento\Msrp\Model\
Product\Attribute\Source\Type::TYPE_IN_CART)
123 ->setMetaTitle(
'meta title')
124 ->setMetaKeyword(
'meta keyword')
125 ->setMetaDescription(
'meta description')
126 ->setVisibility(\
Magento\Catalog\Model\
Product\Visibility::VISIBILITY_BOTH)
127 ->setStatus(AttributeStatus::STATUS_ENABLED)
128 ->setWebsiteIds([
$website->getId()])
130 ->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1]);
139 $product->addAttributeUpdate(
'status', AttributeStatus::STATUS_ENABLED,
$store->getId());
148 'UPDATE %s SET `value` = %d ' .
150 'AND `store_id`= %d ' .
151 'AND `attribute_id` = ' .
152 '(SELECT `ea`.`attribute_id` FROM %s ea WHERE `ea`.`attribute_code` = "status" LIMIT 1)',
154 AttributeStatus::STATUS_DISABLED,
166 WebsiteAttributesSynchronizer::FLAG_NAME,
167 WebsiteAttributesSynchronizer::FLAG_REQUIRES_SYNCHRONIZATION
foreach($stores as $store) $connection