Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Variables
website_attribute_sync.php File Reference

Go to the source code of this file.

Variables

 $productId = 333
 
 $objectManager = Bootstrap::getObjectManager()
 
 $websiteResourceModel = $objectManager->get(WebsiteResourceModel::class)
 
 $storeGroupResourceModel = $objectManager->get(GroupResourceModel::class)
 
 $storeResourceModel = $objectManager->get(StoreResourceModel::class)
 
 $productRepository = $objectManager->create(ProductRepositoryInterface::class)
 
 $resourceConnection = $objectManager->get(ResourceConnection::class)
 
 $flagManager = $objectManager->get(\Magento\Framework\FlagManager::class)
 
 $productLinkField
 
 $website = $objectManager->create(Website::class)
 
 $storeGroup = $objectManager->create(Group::class)
 
 $storeOne = $objectManager->create(Store::class)
 
 $storeTwo = $objectManager->create(Store::class)
 
 $stores
 
 $product = $objectManager->create(Product::class)
 
foreach($stores as $store) $connection = $resourceConnection->getConnection()
 

Variable Documentation

◆ $connection

foreach ( $stores as $store) $connection = $resourceConnection->getConnection()

createProductStoreValuesUnSync Product status values

Definition at line 145 of file website_attribute_sync.php.

◆ $flagManager

$flagManager = $objectManager->get(\Magento\Framework\FlagManager::class)

Definition at line 33 of file website_attribute_sync.php.

◆ $objectManager

$objectManager = Bootstrap::getObjectManager()

Definition at line 27 of file website_attribute_sync.php.

◆ $product

$product = $objectManager->create(Product::class)

Definition at line 109 of file website_attribute_sync.php.

◆ $productId

$productId = 333

create whole website->storeGroup->[store1,store2] structure and add product to it with "Status" website attribute values that have different values in the same website (which is wrong behavior) also turns on "Require sync" flag

Definition at line 26 of file website_attribute_sync.php.

◆ $productLinkField

$productLinkField
Initial value:
= $objectManager->get(\Magento\Framework\EntityManager\MetadataPool::class)
->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class)
->getLinkField()

Definition at line 34 of file website_attribute_sync.php.

◆ $productRepository

$productRepository = $objectManager->create(ProductRepositoryInterface::class)

Definition at line 31 of file website_attribute_sync.php.

◆ $resourceConnection

$resourceConnection = $objectManager->get(ResourceConnection::class)

Definition at line 32 of file website_attribute_sync.php.

◆ $storeGroup

Group $storeGroup = $objectManager->create(Group::class)

Create store group

Definition at line 59 of file website_attribute_sync.php.

◆ $storeGroupResourceModel

$storeGroupResourceModel = $objectManager->get(GroupResourceModel::class)

Definition at line 29 of file website_attribute_sync.php.

◆ $storeOne

Store $storeOne = $objectManager->create(Store::class)

Create Stores

Definition at line 75 of file website_attribute_sync.php.

◆ $storeResourceModel

$storeResourceModel = $objectManager->get(StoreResourceModel::class)

Definition at line 30 of file website_attribute_sync.php.

◆ $stores

$stores
Initial value:

Definition at line 95 of file website_attribute_sync.php.

◆ $storeTwo

Store $storeTwo = $objectManager->create(Store::class)

Definition at line 89 of file website_attribute_sync.php.

◆ $website

$website = $objectManager->create(Website::class)

Definition at line 45 of file website_attribute_sync.php.

◆ $websiteResourceModel

$websiteResourceModel = $objectManager->get(WebsiteResourceModel::class)

Definition at line 28 of file website_attribute_sync.php.