5

Magento versión: 2.1.7

I have a configurable product with ALL its simple products without stock. I need to show in the configurable product the swatches of size / color (disabled) of their associated simple products.

Is this possible?

I already developed a modification and if at least 1 simple product has stock it shows all the swatches (available and not available).

The problem is if there's no stock of any simple product of configurable.

  • can you please share the code you have changed before? – jafar pinjar Dec 19 '18 at 9:23
3

I've found this workaround:

I've overridden in my custom theme this phtml

vendor/magento/module-catalog/view/frontend/templates/product/view/form.phtml

Around line 35 you find

<?php if ($_product->isSaleable() && $block->hasOptions() && $block->getOptionsContainer() == 'container2'):?>

If you remove the condition $_product->isSaleable() you will get all the swatches visible

  • This doesn't work for me even after removing the condition, all swatches are not getting visible – jafar pinjar Dec 19 '18 at 9:27
  • cool! it's working – Jugal Kishor May 1 '19 at 9:55
  • not working i apply this – Rv Singh Jul 22 '19 at 12:38

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.