Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function modifyData(array $data)
 {
     /** @var \Magento\Catalog\Api\Data\ProductInterface $model */
     $model = $this->locator->getProduct();
     $productTypeId = $model->getTypeId();
     if ($this->allowedProductTypes->isAllowedProductType($this->locator->getProduct())) {
         $productId = $model->getId();
         $data[$productId]['affect_configurable_product_attributes'] = '1';
         if ($productTypeId === ConfigurableType::TYPE_CODE) {
             $data[$productId]['configurable-matrix'] = $this->associatedProducts->getProductMatrix();
             $data[$productId]['attributes'] = $this->associatedProducts->getProductAttributesIds();
             $data[$productId]['attribute_codes'] = $this->associatedProducts->getProductAttributesCodes();
             $data[$productId]['product']['configurable_attributes_data'] = $this->associatedProducts->getConfigurableAttributesData();
         }
     }
     return $data;
 }