magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.37k stars 9.28k forks source link

Disabled configurable product swatch option is still visible on frontend with the crossed out #38899

Open imran9935 opened 2 days ago

imran9935 commented 2 days ago

Preconditions (*)

Tested in this versions:

  1. Magento 2.4.7
  2. 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.

Screenshot 1: image

Screenshot 2: image

Screenshot 3: image

Screenshot 4: image

Steps to reproduce (*)

  1. Access magento admin panel
  2. Install sample data
  3. Create size and color attribute with the type of text swatch sceenshot-3,4
  4. Create configurable product by using that attributes
  5. Disable one configurable product option screenshot-4
  6. Run indexer and clear cache
  7. Open that configurable product on frontend and select that disabled option screenshot-4
  8. 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

Screenshot 5: image

m2-assistant[bot] commented 2 days ago

Hi @imran9935. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 2 days ago

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down: