Description
Preconditions (*)
Tested in this versions:
- Magento 2.4.7
- Magento Developer branch
Description (*)
When creating configurable product with the multiple options ex -(color, size), and disabled one configurable product option, then that disabled option is still visible on frontend with crossed out, check below screenshots.
Steps to reproduce (*)
- Access magento admin panel
- Install sample data
- Create size and color attribute with the type of text swatch sceenshot-3,4
- Create configurable product by using that attributes
- Disable one configurable product option screenshot-4
- Run indexer and clear cache
- Open that configurable product on frontend and select that disabled option screenshot-4
- Now observe that option is showing as crossed out as it should not show
Expected result (*)
Disabled configurable product swatch option should be not visible
Actual result (*)
Disabled configurable product swatch option is still visible on frontend with the crossed out
Additional information (*)
As I have checked in this file (magento/module-swatches/view/base/web/js/swatch-renderer.js), on line no 959 the disabled class is being added. As it only checks products option is available or not and after checking that condition it adds disabled class. as it should check whether the product option is enabled or out of stock and if product is not enable then that option should be not visible. check below screenshot-5