- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2017
04:15 PM
05-19-2017
04:15 PM
Configurable products not changing sku
I am using Magento 2 CE 2.1.3.
SKU not changing dynamically in configurable product view page.
How can I fix it?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018
09:02 PM
12-19-2018
09:02 PM
Re: Configurable products not changing sku
Hello,
I tried this solution and it work finally !!
https://codecanyon.net/item/magento-2-dynamic-configurable-product/22813380?s_rank=5
Regards,
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2019
06:10 AM
03-19-2019
06:10 AM
Re: Configurable products not changing sku
Hello @SultanRana ,
ts default behavior of the Magento. but We can achieve it by coding.
I hope that you have basic knowledge of Magento.
- 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
--
If my answer is useful, please Accept as Solution & give Kudos
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2020
03:13 AM
01-14-2020
03:13 AM
Re: Configurable products not changing sku
The Js you edit is for adminhtml. But what if i want to change sku in front-end when a different variant is clicked? I tried changing the same file in the frontend file but no result sadly.