cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 create configurable products product name and sku get undefined

Magento 2 create configurable products product name and sku get undefined

New product creating configurable product
step 1: Select Attributes - selected color then, Step 2: Attribute Values - selected 2 colors then. Step 3: Selected Skip image uploading at this time Step 4: Summary - SKUis undefined-attribute value (undefined-grey) after generating product, grid format below can check product name is undefined-grey also SKU

5 REPLIES 5

Re: Magento 2 create configurable products product name and sku get undefined

Hi @akshaykamba454 

 

Write a Plugin for

Magento\ConfigurableProduct\Block\Product\View\Type\Configurable::getJsonConfig() and add the SKUs to the result:

$config['skus'] = [];
foreach ($subject->getAllowProducts() as $simpleProduct) {    $config['skus'][$simpleProduct->getId()] = $simpleProduct->getSku();
}

* Extend Product.Config from app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/configurable.js using RequireJS. A good place to add the code to change the displayed SKU is reloadPrice(). You will have access to the SKUs via this.config.skus.

 

It may help you.
Problem Solved? Please click on 'Kudos' & Accept as Solution!

 

Re: Magento 2 create configurable products product name and sku get undefined

@Bhanu Periwal  Thanks for your reply

I am getting this on edit configurations  selected some more attributes
product name get undefined (undefined+attribute) 

can you please check this link -

https://magento.stackexchange.com/questions/317012/Magento-2-edit-configurable-products-sku-and-prod...

Re: Magento 2 create configurable products product name and sku get undefined

Hi @akshaykamba454 ,

 

Can you please confirm, did you have any customization on the SKU or name field of the product (disabling the field so that admin will not be able the change the value). If yes, can you please try disabling those customizations because Vanilla Magento doesn't have this issue.

 

Hope this helps you!

Problem SOlved! Click Kudos & Accept as Solution!

Re: Magento 2 create configurable products product name and sku get undefined

@Nishu Jindal thanks for reply

Configuration products on creating new it gets SKU - name + attributes correctly

but edit configuration when selected more attributes on step 4 summary   SKU show undefined+ attributes (undefined + grey )

how can we get parent name from child product id or parent name from parent id from  in summary.js

Re: Magento 2 create configurable products product name and sku get undefined

I have this issue on Magento2.3.5 using both imported data and a completely blank database with no edits to the SKU attribute. It happens on ALL configurations, all the time.

 

https://community.magento.com/t5/Magento-2-x-Technical-Issues/Multiple-Configurable-product-issues/m...