Skip to content

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

Open
@imran9935

Description

@imran9935

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Admin UIComponent: UiIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReported on 2.4.7Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions