I am looking to generate Custom SKU's for Simple products in configurable products in Magento 2.2.2.

I know we can edit after we create configurations in admin. But I want to slightly change the way SKU is automatically generated.

Right now, it generates 'MAIN_PRODUCT_SKU-attribute_value_name'. But I want to change it as 'attribute_value_name-MAIN_PRODUCT_SKU'.

I dont know the process behind SKU generation and what files are involved.

Any help would be appreciated.


  • I am also looking for a similar thing - not quite the same syntax but does anyone know how to change it? – Simon Apr 25 '18 at 13:29

Sku is generated in js file /vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/summary.js

in js code: sku = productSku + _.reduce(options, function (memo, option) { return memo + '-' + option.label; }, ''); Solution is override it in template or by custom module

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.