2

I'm fairly new to Magento and am currently running Magento 2.2.1. I am looking for a way to have the configurable sku change to the corresponding simple product sku when the configurable products attributes have been selected.

1
  • did you ever find a solution for this?
    – Rob
    Commented Jul 24, 2018 at 19:05

1 Answer 1

0

Out of the box, when choosing options, the images and the price will change, but not SKU.

More information about which elements on the page change when options are selected can be found here: Magento\ConfigurableProduct\Block\Product\View\Type\Configurable::getJsonConfig().

In order to display product SKU of the selected product, you can create a Plugin (Interceptor) for Magento\ConfigurableProduct\Block\Product\View\Type\Configurable::getJsonConfig() where you need to add missing SKU for each simple product.

Switching SKU when selecting an option can be implemented in vendor/magento/module-swatches/view/base/web/js/swatch-renderer.js and vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js depending on the type of attribute.


I made free VCT Change SKU Dynamically module that solve this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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