1

I have created a configurable product with subproducts (simple products)- so far so good - I select and price and picture change and I can place the correct product in the basket - but I would like the text, SKU and my related products to change as well.

NB. The related product is assigned to the children (simple products) - I would like to show related depending on selection.

I hope someone can help with this - thanks

Christian

1 Answer 1

0

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

In order to display this elements 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 elements for each simple product.

Switching elements 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 (Visual Swatch, Text Swatch, Dropdown).


I made VCT Product Info Switcher module on Magento Marketplace that solves this problem (including SKU, description and related products switching).

Your Answer

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

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