How to create Configurable Product ProgrammaticallyCan't Create Configurable Products with multiple Attributes programmaticallyError when creating configurable product programmatically in multi-storeview siteMagento 2 – Assign Associated Products To Configurable ProductHow to display configurable product swatches when product is Out of stockConfigurable Product Programmatically Configurations is emptyHow to add custom options programmatically for configurable product in Magento 2Magento 2: How to create configurable product ProgrammaticallyMahento 2 : How to associate more simple products with an existing configurable product programatically?magento 1.9 detach simple product associated to a configurable and assign to another configurableShow out of Stock Configurable products magento2

In general, would I need to season a meat when making a sauce?

A Riley Respite

Why does Mjolnir fall down in Age of Ultron but not in Endgame?

Caught 2 students cheating together on the final exam that I proctored

Is the derivative with respect to a fermion field Grassmann-odd?

Where have Brexit voters gone?

Can a person survive on blood in place of water?

Why were helmets and other body armour not commonplace in the 1800s?

Do photons bend spacetime or not?

Where is the logic in castrating fighters?

Why would Ryanair allow me to book this journey through a third party, but not through their own website?

Externally monitoring CPU/SSD activity without software access

Any advice on creating fictional locations in real places when writing historical fiction?

A steel cutting sword?

Why didn't Thanos use the Time Stone to stop the Avengers' plan?

Compaq Portable vs IBM 5155 Portable PC

Does Nitrogen inside commercial airliner wheels prevent blowouts on touchdown?

What to do when you've set the wrong ISO for your film?

Boss wants me to falsify a report. How should I document this unethical demand?

Why does this if-statement combining assignment and an equality check return true?

Is the taxi route omitted in low visibility (LVP)?

Why do most published works in medical imaging try to reduce false positives?

Should breaking down something like a door be adjudicated as an attempt to beat its AC and HP, or as an ability check against a set DC?

Count Even Digits In Number



How to create Configurable Product Programmatically


Can't Create Configurable Products with multiple Attributes programmaticallyError when creating configurable product programmatically in multi-storeview siteMagento 2 – Assign Associated Products To Configurable ProductHow to display configurable product swatches when product is Out of stockConfigurable Product Programmatically Configurations is emptyHow to add custom options programmatically for configurable product in Magento 2Magento 2: How to create configurable product ProgrammaticallyMahento 2 : How to associate more simple products with an existing configurable product programatically?magento 1.9 detach simple product associated to a configurable and assign to another configurableShow out of Stock Configurable products magento2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have found some question same my own but have not found out the answer. I want to create a configurable product. I have create a form to save the product and get the child product details in configurable-matrix:



enter image description here



enter image description here



But when I'm trying to save this product, the error Option values are not specified. appear. Can someone help me to save the product or just release another way to save a configurable product. Thanks!










share|improve this question






























    1















    I have found some question same my own but have not found out the answer. I want to create a configurable product. I have create a form to save the product and get the child product details in configurable-matrix:



    enter image description here



    enter image description here



    But when I'm trying to save this product, the error Option values are not specified. appear. Can someone help me to save the product or just release another way to save a configurable product. Thanks!










    share|improve this question


























      1












      1








      1








      I have found some question same my own but have not found out the answer. I want to create a configurable product. I have create a form to save the product and get the child product details in configurable-matrix:



      enter image description here



      enter image description here



      But when I'm trying to save this product, the error Option values are not specified. appear. Can someone help me to save the product or just release another way to save a configurable product. Thanks!










      share|improve this question
















      I have found some question same my own but have not found out the answer. I want to create a configurable product. I have create a form to save the product and get the child product details in configurable-matrix:



      enter image description here



      enter image description here



      But when I'm trying to save this product, the error Option values are not specified. appear. Can someone help me to save the product or just release another way to save a configurable product. Thanks!







      magento2 configurable-product error programmatically






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 17 '17 at 10:22







      Nero Phung

















      asked Dec 15 '17 at 7:50









      Nero PhungNero Phung

      9071720




      9071720




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You have to set attribute id and its value to it. For example this array of data:



          public function getProductData($data = [])

          $productData = [
          'stock_data' => [
          'min_qty_allowed_in_shopping_cart' => [
          [
          'record_id' => "0",
          'customer_group_id' => "32000",
          'min_sale_qty' => "",
          ]
          ],
          'deferred_stock_update' => "1",
          'use_config_deferred_stock_update' => "1",
          'min_qty' => "0",
          'max_sale_qty' => "10000",
          'notify_stock_qty' => "1",
          'qty_increments' => "1",
          'min_sale_qty' => "1",
          'use_config_manage_stock' => "1",
          'manage_stock' => "1",
          'use_config_min_qty' => "1",
          'use_config_max_sale_qty' => "1",
          'use_config_backorders' => "1",
          'backorders' => "0",
          'use_config_notify_stock_qty' => "1",
          'use_config_enable_qty_inc' => "1",
          'enable_qty_increments' => "0",
          'use_config_qty_increments' => "1",
          'use_config_min_sale_qty' => "1",
          'is_qty_decimal' => "0",
          'is_decimal_divided' => "0",
          ],
          'use_config_is_returnable' => "1",
          'gift_wrapping_available' => "1",
          'use_config_gift_wrapping_available' => "1",
          'gift_message_available' => "0",
          'use_config_gift_message_available' => "1",
          'links_title' => "Links",
          'links_purchased_separately' => "0",
          'samples_title' => "Samples",
          'attribute_set_id' => "4",
          'status' => $this->isParentProductEnable(),
          'affect_product_custom_options' => "1",
          'name' => $data['title'],
          'title_rewrite' => "",
          'price' => "100",
          'weight' => "",
          'url_key' => "",
          'gift_wrapping_price' => "",
          'special_price' => "",
          'cost' => "",
          'msrp' => "",
          'quantity_and_stock_status' => [
          'qty' => "",
          'is_in_stock' => "1"
          ],
          'is_returnable' => "2",
          'website_ids' => [$this->getWebsiteId($data['division'])],
          'tax_class_id' => "2",
          'product_has_weight' => "1",
          'visibility' => "4",
          'color' => "49",
          'size' => "91",
          'options_container' => "container2",
          'weltpixel_exclude_from_sitemap' => "0",
          'msrp_display_actual_price_type' => "0",
          'description' => "",
          'short_description' => "",
          'custom_layout_update' => "",
          'sku' => $data['product_code'],
          'meta_title' => $data['title'],
          'meta_keyword' => $data['title'],
          'meta_description' => "",
          'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'associated_product_ids_serialized' => "[]",
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)
          ];

          return $productData;



          The important part is here:



           'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)


          That would be the data indicating the simple products data.



          Updated: These are methods for building simple products with configurable product:



          private function getConfigurableMatrix($data)

          $jsonOutput = "[";
          // Get pair codes for matrix
          $colors = $data['colors'];
          $sizes = $this->getSizeArray($colors)['sizes'];
          $status = $this->isChildProductEnable();

          foreach ($colors as $color)
          foreach ($sizes as $size)
          $colorParam = [
          'id' => $this->getColorOptionId($color['color_id']),
          'lable' => $color['color_id']
          ];

          $sizeParam = [
          'id' => $this->getSizeOptionId($size['size']),
          'lable' => $size['size']
          ];

          $weight = $size['weight'] ? $size['weight'] : $this->getDefaultWeight();

          $jsonOutput .= $this->getConfigurableMatrixItem($data['title'], $size['sku'], $colorParam, $sizeParam, $size['quantity'], $weight, $size['price'], $status) . ",";



          $jsonOutput = rtrim($jsonOutput, ',');

          $jsonOutput .= "]";
          return $jsonOutput;




          private function getConfigurableMatrixItem($name, $sku, $color = [], $size = [], $qty, $weight, $price, $status = 1)

          $item = [
          "id" => null,
          "product_link" => "",
          "name" => "$name $color['lable'] $size['lable']",
          "sku" => "$sku",
          "status" => $status,
          "price" => "$price",
          "price_currency" => "$",
          "price_string" => "$$price",
          "weight" => "$weight",
          "qty" => "$qty",
          "variationKey" => "$size['id']-$color['id']",
          "configurable_attribute" => ""color":"$color['id']","size":"$size['id']"",
          "thumbnail_image" => "",
          "media_gallery" => [
          "images" => []
          ],
          "image" => [],
          "attributes" => "Color : $color['lable'], Size: $size['lable']",
          "was_changed" => true,
          "canEdit" => 1,
          "newProduct" => 1,
          "record_id" => 0
          ];

          return json_encode($item);



          private function getSizeOptionId($labelSize)

          if ($labelSize == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$lableSize][0] = $lableSize;
          $option['value']['size'][0] = $labelSize;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          $this->insertSwatch($optionId, 0, $labelSize);


          return $optionId;



          private function getColorOptionId($labelColor)

          if ($labelColor == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$labelColor][0] = $labelColor;
          $option['value']['color'][0] = $labelColor;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          $this->insertSwatch($optionId);

          return $optionId;



          private function insertSwatch($optionId, $type = 1, $value = "#ffffff")

          $swatch = $this->createObject('MagentoSwatchesModelSwatch');

          $swatch->setData([
          'option_id' => $optionId,
          'store_id' => 0,
          'type' => $type,
          'value' => $value
          ]);

          $swatch->save();






          share|improve this answer

























          • How can I call the function: $this->getConfigurableMatrix($data)

            – Nero Phung
            Dec 16 '17 at 8:41











          • This is my function to build the json data for simple product. Do you want to see it ?

            – Toàn Tam
            Dec 18 '17 at 2:50











          • Of course yes!!

            – Nero Phung
            Dec 18 '17 at 5:28











          • please, see my updated answer

            – Toàn Tam
            Dec 18 '17 at 6:40











          • Any luck @NeroPhung ?

            – Toàn Tam
            Dec 18 '17 at 9:43












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f205923%2fhow-to-create-configurable-product-programmatically%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You have to set attribute id and its value to it. For example this array of data:



          public function getProductData($data = [])

          $productData = [
          'stock_data' => [
          'min_qty_allowed_in_shopping_cart' => [
          [
          'record_id' => "0",
          'customer_group_id' => "32000",
          'min_sale_qty' => "",
          ]
          ],
          'deferred_stock_update' => "1",
          'use_config_deferred_stock_update' => "1",
          'min_qty' => "0",
          'max_sale_qty' => "10000",
          'notify_stock_qty' => "1",
          'qty_increments' => "1",
          'min_sale_qty' => "1",
          'use_config_manage_stock' => "1",
          'manage_stock' => "1",
          'use_config_min_qty' => "1",
          'use_config_max_sale_qty' => "1",
          'use_config_backorders' => "1",
          'backorders' => "0",
          'use_config_notify_stock_qty' => "1",
          'use_config_enable_qty_inc' => "1",
          'enable_qty_increments' => "0",
          'use_config_qty_increments' => "1",
          'use_config_min_sale_qty' => "1",
          'is_qty_decimal' => "0",
          'is_decimal_divided' => "0",
          ],
          'use_config_is_returnable' => "1",
          'gift_wrapping_available' => "1",
          'use_config_gift_wrapping_available' => "1",
          'gift_message_available' => "0",
          'use_config_gift_message_available' => "1",
          'links_title' => "Links",
          'links_purchased_separately' => "0",
          'samples_title' => "Samples",
          'attribute_set_id' => "4",
          'status' => $this->isParentProductEnable(),
          'affect_product_custom_options' => "1",
          'name' => $data['title'],
          'title_rewrite' => "",
          'price' => "100",
          'weight' => "",
          'url_key' => "",
          'gift_wrapping_price' => "",
          'special_price' => "",
          'cost' => "",
          'msrp' => "",
          'quantity_and_stock_status' => [
          'qty' => "",
          'is_in_stock' => "1"
          ],
          'is_returnable' => "2",
          'website_ids' => [$this->getWebsiteId($data['division'])],
          'tax_class_id' => "2",
          'product_has_weight' => "1",
          'visibility' => "4",
          'color' => "49",
          'size' => "91",
          'options_container' => "container2",
          'weltpixel_exclude_from_sitemap' => "0",
          'msrp_display_actual_price_type' => "0",
          'description' => "",
          'short_description' => "",
          'custom_layout_update' => "",
          'sku' => $data['product_code'],
          'meta_title' => $data['title'],
          'meta_keyword' => $data['title'],
          'meta_description' => "",
          'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'associated_product_ids_serialized' => "[]",
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)
          ];

          return $productData;



          The important part is here:



           'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)


          That would be the data indicating the simple products data.



          Updated: These are methods for building simple products with configurable product:



          private function getConfigurableMatrix($data)

          $jsonOutput = "[";
          // Get pair codes for matrix
          $colors = $data['colors'];
          $sizes = $this->getSizeArray($colors)['sizes'];
          $status = $this->isChildProductEnable();

          foreach ($colors as $color)
          foreach ($sizes as $size)
          $colorParam = [
          'id' => $this->getColorOptionId($color['color_id']),
          'lable' => $color['color_id']
          ];

          $sizeParam = [
          'id' => $this->getSizeOptionId($size['size']),
          'lable' => $size['size']
          ];

          $weight = $size['weight'] ? $size['weight'] : $this->getDefaultWeight();

          $jsonOutput .= $this->getConfigurableMatrixItem($data['title'], $size['sku'], $colorParam, $sizeParam, $size['quantity'], $weight, $size['price'], $status) . ",";



          $jsonOutput = rtrim($jsonOutput, ',');

          $jsonOutput .= "]";
          return $jsonOutput;




          private function getConfigurableMatrixItem($name, $sku, $color = [], $size = [], $qty, $weight, $price, $status = 1)

          $item = [
          "id" => null,
          "product_link" => "",
          "name" => "$name $color['lable'] $size['lable']",
          "sku" => "$sku",
          "status" => $status,
          "price" => "$price",
          "price_currency" => "$",
          "price_string" => "$$price",
          "weight" => "$weight",
          "qty" => "$qty",
          "variationKey" => "$size['id']-$color['id']",
          "configurable_attribute" => ""color":"$color['id']","size":"$size['id']"",
          "thumbnail_image" => "",
          "media_gallery" => [
          "images" => []
          ],
          "image" => [],
          "attributes" => "Color : $color['lable'], Size: $size['lable']",
          "was_changed" => true,
          "canEdit" => 1,
          "newProduct" => 1,
          "record_id" => 0
          ];

          return json_encode($item);



          private function getSizeOptionId($labelSize)

          if ($labelSize == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$lableSize][0] = $lableSize;
          $option['value']['size'][0] = $labelSize;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          $this->insertSwatch($optionId, 0, $labelSize);


          return $optionId;



          private function getColorOptionId($labelColor)

          if ($labelColor == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$labelColor][0] = $labelColor;
          $option['value']['color'][0] = $labelColor;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          $this->insertSwatch($optionId);

          return $optionId;



          private function insertSwatch($optionId, $type = 1, $value = "#ffffff")

          $swatch = $this->createObject('MagentoSwatchesModelSwatch');

          $swatch->setData([
          'option_id' => $optionId,
          'store_id' => 0,
          'type' => $type,
          'value' => $value
          ]);

          $swatch->save();






          share|improve this answer

























          • How can I call the function: $this->getConfigurableMatrix($data)

            – Nero Phung
            Dec 16 '17 at 8:41











          • This is my function to build the json data for simple product. Do you want to see it ?

            – Toàn Tam
            Dec 18 '17 at 2:50











          • Of course yes!!

            – Nero Phung
            Dec 18 '17 at 5:28











          • please, see my updated answer

            – Toàn Tam
            Dec 18 '17 at 6:40











          • Any luck @NeroPhung ?

            – Toàn Tam
            Dec 18 '17 at 9:43
















          0














          You have to set attribute id and its value to it. For example this array of data:



          public function getProductData($data = [])

          $productData = [
          'stock_data' => [
          'min_qty_allowed_in_shopping_cart' => [
          [
          'record_id' => "0",
          'customer_group_id' => "32000",
          'min_sale_qty' => "",
          ]
          ],
          'deferred_stock_update' => "1",
          'use_config_deferred_stock_update' => "1",
          'min_qty' => "0",
          'max_sale_qty' => "10000",
          'notify_stock_qty' => "1",
          'qty_increments' => "1",
          'min_sale_qty' => "1",
          'use_config_manage_stock' => "1",
          'manage_stock' => "1",
          'use_config_min_qty' => "1",
          'use_config_max_sale_qty' => "1",
          'use_config_backorders' => "1",
          'backorders' => "0",
          'use_config_notify_stock_qty' => "1",
          'use_config_enable_qty_inc' => "1",
          'enable_qty_increments' => "0",
          'use_config_qty_increments' => "1",
          'use_config_min_sale_qty' => "1",
          'is_qty_decimal' => "0",
          'is_decimal_divided' => "0",
          ],
          'use_config_is_returnable' => "1",
          'gift_wrapping_available' => "1",
          'use_config_gift_wrapping_available' => "1",
          'gift_message_available' => "0",
          'use_config_gift_message_available' => "1",
          'links_title' => "Links",
          'links_purchased_separately' => "0",
          'samples_title' => "Samples",
          'attribute_set_id' => "4",
          'status' => $this->isParentProductEnable(),
          'affect_product_custom_options' => "1",
          'name' => $data['title'],
          'title_rewrite' => "",
          'price' => "100",
          'weight' => "",
          'url_key' => "",
          'gift_wrapping_price' => "",
          'special_price' => "",
          'cost' => "",
          'msrp' => "",
          'quantity_and_stock_status' => [
          'qty' => "",
          'is_in_stock' => "1"
          ],
          'is_returnable' => "2",
          'website_ids' => [$this->getWebsiteId($data['division'])],
          'tax_class_id' => "2",
          'product_has_weight' => "1",
          'visibility' => "4",
          'color' => "49",
          'size' => "91",
          'options_container' => "container2",
          'weltpixel_exclude_from_sitemap' => "0",
          'msrp_display_actual_price_type' => "0",
          'description' => "",
          'short_description' => "",
          'custom_layout_update' => "",
          'sku' => $data['product_code'],
          'meta_title' => $data['title'],
          'meta_keyword' => $data['title'],
          'meta_description' => "",
          'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'associated_product_ids_serialized' => "[]",
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)
          ];

          return $productData;



          The important part is here:



           'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)


          That would be the data indicating the simple products data.



          Updated: These are methods for building simple products with configurable product:



          private function getConfigurableMatrix($data)

          $jsonOutput = "[";
          // Get pair codes for matrix
          $colors = $data['colors'];
          $sizes = $this->getSizeArray($colors)['sizes'];
          $status = $this->isChildProductEnable();

          foreach ($colors as $color)
          foreach ($sizes as $size)
          $colorParam = [
          'id' => $this->getColorOptionId($color['color_id']),
          'lable' => $color['color_id']
          ];

          $sizeParam = [
          'id' => $this->getSizeOptionId($size['size']),
          'lable' => $size['size']
          ];

          $weight = $size['weight'] ? $size['weight'] : $this->getDefaultWeight();

          $jsonOutput .= $this->getConfigurableMatrixItem($data['title'], $size['sku'], $colorParam, $sizeParam, $size['quantity'], $weight, $size['price'], $status) . ",";



          $jsonOutput = rtrim($jsonOutput, ',');

          $jsonOutput .= "]";
          return $jsonOutput;




          private function getConfigurableMatrixItem($name, $sku, $color = [], $size = [], $qty, $weight, $price, $status = 1)

          $item = [
          "id" => null,
          "product_link" => "",
          "name" => "$name $color['lable'] $size['lable']",
          "sku" => "$sku",
          "status" => $status,
          "price" => "$price",
          "price_currency" => "$",
          "price_string" => "$$price",
          "weight" => "$weight",
          "qty" => "$qty",
          "variationKey" => "$size['id']-$color['id']",
          "configurable_attribute" => ""color":"$color['id']","size":"$size['id']"",
          "thumbnail_image" => "",
          "media_gallery" => [
          "images" => []
          ],
          "image" => [],
          "attributes" => "Color : $color['lable'], Size: $size['lable']",
          "was_changed" => true,
          "canEdit" => 1,
          "newProduct" => 1,
          "record_id" => 0
          ];

          return json_encode($item);



          private function getSizeOptionId($labelSize)

          if ($labelSize == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$lableSize][0] = $lableSize;
          $option['value']['size'][0] = $labelSize;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          $this->insertSwatch($optionId, 0, $labelSize);


          return $optionId;



          private function getColorOptionId($labelColor)

          if ($labelColor == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$labelColor][0] = $labelColor;
          $option['value']['color'][0] = $labelColor;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          $this->insertSwatch($optionId);

          return $optionId;



          private function insertSwatch($optionId, $type = 1, $value = "#ffffff")

          $swatch = $this->createObject('MagentoSwatchesModelSwatch');

          $swatch->setData([
          'option_id' => $optionId,
          'store_id' => 0,
          'type' => $type,
          'value' => $value
          ]);

          $swatch->save();






          share|improve this answer

























          • How can I call the function: $this->getConfigurableMatrix($data)

            – Nero Phung
            Dec 16 '17 at 8:41











          • This is my function to build the json data for simple product. Do you want to see it ?

            – Toàn Tam
            Dec 18 '17 at 2:50











          • Of course yes!!

            – Nero Phung
            Dec 18 '17 at 5:28











          • please, see my updated answer

            – Toàn Tam
            Dec 18 '17 at 6:40











          • Any luck @NeroPhung ?

            – Toàn Tam
            Dec 18 '17 at 9:43














          0












          0








          0







          You have to set attribute id and its value to it. For example this array of data:



          public function getProductData($data = [])

          $productData = [
          'stock_data' => [
          'min_qty_allowed_in_shopping_cart' => [
          [
          'record_id' => "0",
          'customer_group_id' => "32000",
          'min_sale_qty' => "",
          ]
          ],
          'deferred_stock_update' => "1",
          'use_config_deferred_stock_update' => "1",
          'min_qty' => "0",
          'max_sale_qty' => "10000",
          'notify_stock_qty' => "1",
          'qty_increments' => "1",
          'min_sale_qty' => "1",
          'use_config_manage_stock' => "1",
          'manage_stock' => "1",
          'use_config_min_qty' => "1",
          'use_config_max_sale_qty' => "1",
          'use_config_backorders' => "1",
          'backorders' => "0",
          'use_config_notify_stock_qty' => "1",
          'use_config_enable_qty_inc' => "1",
          'enable_qty_increments' => "0",
          'use_config_qty_increments' => "1",
          'use_config_min_sale_qty' => "1",
          'is_qty_decimal' => "0",
          'is_decimal_divided' => "0",
          ],
          'use_config_is_returnable' => "1",
          'gift_wrapping_available' => "1",
          'use_config_gift_wrapping_available' => "1",
          'gift_message_available' => "0",
          'use_config_gift_message_available' => "1",
          'links_title' => "Links",
          'links_purchased_separately' => "0",
          'samples_title' => "Samples",
          'attribute_set_id' => "4",
          'status' => $this->isParentProductEnable(),
          'affect_product_custom_options' => "1",
          'name' => $data['title'],
          'title_rewrite' => "",
          'price' => "100",
          'weight' => "",
          'url_key' => "",
          'gift_wrapping_price' => "",
          'special_price' => "",
          'cost' => "",
          'msrp' => "",
          'quantity_and_stock_status' => [
          'qty' => "",
          'is_in_stock' => "1"
          ],
          'is_returnable' => "2",
          'website_ids' => [$this->getWebsiteId($data['division'])],
          'tax_class_id' => "2",
          'product_has_weight' => "1",
          'visibility' => "4",
          'color' => "49",
          'size' => "91",
          'options_container' => "container2",
          'weltpixel_exclude_from_sitemap' => "0",
          'msrp_display_actual_price_type' => "0",
          'description' => "",
          'short_description' => "",
          'custom_layout_update' => "",
          'sku' => $data['product_code'],
          'meta_title' => $data['title'],
          'meta_keyword' => $data['title'],
          'meta_description' => "",
          'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'associated_product_ids_serialized' => "[]",
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)
          ];

          return $productData;



          The important part is here:



           'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)


          That would be the data indicating the simple products data.



          Updated: These are methods for building simple products with configurable product:



          private function getConfigurableMatrix($data)

          $jsonOutput = "[";
          // Get pair codes for matrix
          $colors = $data['colors'];
          $sizes = $this->getSizeArray($colors)['sizes'];
          $status = $this->isChildProductEnable();

          foreach ($colors as $color)
          foreach ($sizes as $size)
          $colorParam = [
          'id' => $this->getColorOptionId($color['color_id']),
          'lable' => $color['color_id']
          ];

          $sizeParam = [
          'id' => $this->getSizeOptionId($size['size']),
          'lable' => $size['size']
          ];

          $weight = $size['weight'] ? $size['weight'] : $this->getDefaultWeight();

          $jsonOutput .= $this->getConfigurableMatrixItem($data['title'], $size['sku'], $colorParam, $sizeParam, $size['quantity'], $weight, $size['price'], $status) . ",";



          $jsonOutput = rtrim($jsonOutput, ',');

          $jsonOutput .= "]";
          return $jsonOutput;




          private function getConfigurableMatrixItem($name, $sku, $color = [], $size = [], $qty, $weight, $price, $status = 1)

          $item = [
          "id" => null,
          "product_link" => "",
          "name" => "$name $color['lable'] $size['lable']",
          "sku" => "$sku",
          "status" => $status,
          "price" => "$price",
          "price_currency" => "$",
          "price_string" => "$$price",
          "weight" => "$weight",
          "qty" => "$qty",
          "variationKey" => "$size['id']-$color['id']",
          "configurable_attribute" => ""color":"$color['id']","size":"$size['id']"",
          "thumbnail_image" => "",
          "media_gallery" => [
          "images" => []
          ],
          "image" => [],
          "attributes" => "Color : $color['lable'], Size: $size['lable']",
          "was_changed" => true,
          "canEdit" => 1,
          "newProduct" => 1,
          "record_id" => 0
          ];

          return json_encode($item);



          private function getSizeOptionId($labelSize)

          if ($labelSize == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$lableSize][0] = $lableSize;
          $option['value']['size'][0] = $labelSize;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          $this->insertSwatch($optionId, 0, $labelSize);


          return $optionId;



          private function getColorOptionId($labelColor)

          if ($labelColor == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$labelColor][0] = $labelColor;
          $option['value']['color'][0] = $labelColor;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          $this->insertSwatch($optionId);

          return $optionId;



          private function insertSwatch($optionId, $type = 1, $value = "#ffffff")

          $swatch = $this->createObject('MagentoSwatchesModelSwatch');

          $swatch->setData([
          'option_id' => $optionId,
          'store_id' => 0,
          'type' => $type,
          'value' => $value
          ]);

          $swatch->save();






          share|improve this answer















          You have to set attribute id and its value to it. For example this array of data:



          public function getProductData($data = [])

          $productData = [
          'stock_data' => [
          'min_qty_allowed_in_shopping_cart' => [
          [
          'record_id' => "0",
          'customer_group_id' => "32000",
          'min_sale_qty' => "",
          ]
          ],
          'deferred_stock_update' => "1",
          'use_config_deferred_stock_update' => "1",
          'min_qty' => "0",
          'max_sale_qty' => "10000",
          'notify_stock_qty' => "1",
          'qty_increments' => "1",
          'min_sale_qty' => "1",
          'use_config_manage_stock' => "1",
          'manage_stock' => "1",
          'use_config_min_qty' => "1",
          'use_config_max_sale_qty' => "1",
          'use_config_backorders' => "1",
          'backorders' => "0",
          'use_config_notify_stock_qty' => "1",
          'use_config_enable_qty_inc' => "1",
          'enable_qty_increments' => "0",
          'use_config_qty_increments' => "1",
          'use_config_min_sale_qty' => "1",
          'is_qty_decimal' => "0",
          'is_decimal_divided' => "0",
          ],
          'use_config_is_returnable' => "1",
          'gift_wrapping_available' => "1",
          'use_config_gift_wrapping_available' => "1",
          'gift_message_available' => "0",
          'use_config_gift_message_available' => "1",
          'links_title' => "Links",
          'links_purchased_separately' => "0",
          'samples_title' => "Samples",
          'attribute_set_id' => "4",
          'status' => $this->isParentProductEnable(),
          'affect_product_custom_options' => "1",
          'name' => $data['title'],
          'title_rewrite' => "",
          'price' => "100",
          'weight' => "",
          'url_key' => "",
          'gift_wrapping_price' => "",
          'special_price' => "",
          'cost' => "",
          'msrp' => "",
          'quantity_and_stock_status' => [
          'qty' => "",
          'is_in_stock' => "1"
          ],
          'is_returnable' => "2",
          'website_ids' => [$this->getWebsiteId($data['division'])],
          'tax_class_id' => "2",
          'product_has_weight' => "1",
          'visibility' => "4",
          'color' => "49",
          'size' => "91",
          'options_container' => "container2",
          'weltpixel_exclude_from_sitemap' => "0",
          'msrp_display_actual_price_type' => "0",
          'description' => "",
          'short_description' => "",
          'custom_layout_update' => "",
          'sku' => $data['product_code'],
          'meta_title' => $data['title'],
          'meta_keyword' => $data['title'],
          'meta_description' => "",
          'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'associated_product_ids_serialized' => "[]",
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)
          ];

          return $productData;



          The important part is here:



           'configurable_attributes_data' => [
          self::COLOR_ATTRIBUTE_ID => [
          'attribute_id' => self::COLOR_ATTRIBUTE_ID,
          'code' => "color",
          'label' => "Color",
          'position' => "0",
          'values' => $this->getColorValue($data)
          ],
          self::SIZE_ATTRIBUTE_ID => [
          'attribute_id' => self::SIZE_ATTRIBUTE_ID,
          'code' => "size",
          'label' => "Size",
          'position' => "1",
          'values' => $this->getSizeValue($data)
          ]
          ],
          'configurable-matrix-serialized' => $this->getConfigurableMatrix($data)


          That would be the data indicating the simple products data.



          Updated: These are methods for building simple products with configurable product:



          private function getConfigurableMatrix($data)

          $jsonOutput = "[";
          // Get pair codes for matrix
          $colors = $data['colors'];
          $sizes = $this->getSizeArray($colors)['sizes'];
          $status = $this->isChildProductEnable();

          foreach ($colors as $color)
          foreach ($sizes as $size)
          $colorParam = [
          'id' => $this->getColorOptionId($color['color_id']),
          'lable' => $color['color_id']
          ];

          $sizeParam = [
          'id' => $this->getSizeOptionId($size['size']),
          'lable' => $size['size']
          ];

          $weight = $size['weight'] ? $size['weight'] : $this->getDefaultWeight();

          $jsonOutput .= $this->getConfigurableMatrixItem($data['title'], $size['sku'], $colorParam, $sizeParam, $size['quantity'], $weight, $size['price'], $status) . ",";



          $jsonOutput = rtrim($jsonOutput, ',');

          $jsonOutput .= "]";
          return $jsonOutput;




          private function getConfigurableMatrixItem($name, $sku, $color = [], $size = [], $qty, $weight, $price, $status = 1)

          $item = [
          "id" => null,
          "product_link" => "",
          "name" => "$name $color['lable'] $size['lable']",
          "sku" => "$sku",
          "status" => $status,
          "price" => "$price",
          "price_currency" => "$",
          "price_string" => "$$price",
          "weight" => "$weight",
          "qty" => "$qty",
          "variationKey" => "$size['id']-$color['id']",
          "configurable_attribute" => ""color":"$color['id']","size":"$size['id']"",
          "thumbnail_image" => "",
          "media_gallery" => [
          "images" => []
          ],
          "image" => [],
          "attributes" => "Color : $color['lable'], Size: $size['lable']",
          "was_changed" => true,
          "canEdit" => 1,
          "newProduct" => 1,
          "record_id" => 0
          ];

          return json_encode($item);



          private function getSizeOptionId($labelSize)

          if ($labelSize == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$lableSize][0] = $lableSize;
          $option['value']['size'][0] = $labelSize;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'size');

          $optionId = $attribute->getSource()->getOptionId($labelSize);

          $this->insertSwatch($optionId, 0, $labelSize);


          return $optionId;



          private function getColorOptionId($labelColor)

          if ($labelColor == '') return "";
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          if (!$optionId)
          // Create a new Option
          $option['attribute_id'] = $attribute->getId();
          //$option['value'][$labelColor][0] = $labelColor;
          $option['value']['color'][0] = $labelColor;

          $eavSetup = $this->_eavSetupFactory->create();
          $eavSetup->addAttributeOption($option);

          $this->_eavConfig = $this->createObject('MagentoEavModelConfig');
          $attribute = $this->_eavConfig->getAttribute('catalog_product', 'color');

          $optionId = $attribute->getSource()->getOptionId($labelColor);

          $this->insertSwatch($optionId);

          return $optionId;



          private function insertSwatch($optionId, $type = 1, $value = "#ffffff")

          $swatch = $this->createObject('MagentoSwatchesModelSwatch');

          $swatch->setData([
          'option_id' => $optionId,
          'store_id' => 0,
          'type' => $type,
          'value' => $value
          ]);

          $swatch->save();







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 18 '17 at 6:40

























          answered Dec 16 '17 at 2:18









          Toàn TamToàn Tam

          424316




          424316












          • How can I call the function: $this->getConfigurableMatrix($data)

            – Nero Phung
            Dec 16 '17 at 8:41











          • This is my function to build the json data for simple product. Do you want to see it ?

            – Toàn Tam
            Dec 18 '17 at 2:50











          • Of course yes!!

            – Nero Phung
            Dec 18 '17 at 5:28











          • please, see my updated answer

            – Toàn Tam
            Dec 18 '17 at 6:40











          • Any luck @NeroPhung ?

            – Toàn Tam
            Dec 18 '17 at 9:43


















          • How can I call the function: $this->getConfigurableMatrix($data)

            – Nero Phung
            Dec 16 '17 at 8:41











          • This is my function to build the json data for simple product. Do you want to see it ?

            – Toàn Tam
            Dec 18 '17 at 2:50











          • Of course yes!!

            – Nero Phung
            Dec 18 '17 at 5:28











          • please, see my updated answer

            – Toàn Tam
            Dec 18 '17 at 6:40











          • Any luck @NeroPhung ?

            – Toàn Tam
            Dec 18 '17 at 9:43

















          How can I call the function: $this->getConfigurableMatrix($data)

          – Nero Phung
          Dec 16 '17 at 8:41





          How can I call the function: $this->getConfigurableMatrix($data)

          – Nero Phung
          Dec 16 '17 at 8:41













          This is my function to build the json data for simple product. Do you want to see it ?

          – Toàn Tam
          Dec 18 '17 at 2:50





          This is my function to build the json data for simple product. Do you want to see it ?

          – Toàn Tam
          Dec 18 '17 at 2:50













          Of course yes!!

          – Nero Phung
          Dec 18 '17 at 5:28





          Of course yes!!

          – Nero Phung
          Dec 18 '17 at 5:28













          please, see my updated answer

          – Toàn Tam
          Dec 18 '17 at 6:40





          please, see my updated answer

          – Toàn Tam
          Dec 18 '17 at 6:40













          Any luck @NeroPhung ?

          – Toàn Tam
          Dec 18 '17 at 9:43






          Any luck @NeroPhung ?

          – Toàn Tam
          Dec 18 '17 at 9:43


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f205923%2fhow-to-create-configurable-product-programmatically%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form