ACSD-51497: Cannot sort catalog page by custom attribute of type Dropdown

The ACSD-51497 patch fixes the issue where a customer cannot sort a catalog page by a custom attribute of the type Dropdown. This patch is available when the Quality Patches Tool (QPT) 1.1.33 is installed. The patch ID is ACSD-51497. Please note that the issue was fixed in Adobe Commerce 2.4.7.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.5

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.3.7 - 2.3.7-p4, 2.4.1 - 2.4.6-p1
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

A customer is unable to sort a catalog page by a custom attribute of the type Dropdown.

Steps to reproduce

  1. Create about six simple products and assign them to a single category.

  2. Create a product attribute in order to add it as a sorting option on the listing pages.

    • Go to Admin > Stores > Attributes > Add New Attribute.

    • In the Properties tab, set the following:

      • Default Label = test

      • Catalog Input Type for Store Owner = Dropdown

      • Options:

        • first
        • second
        • third
        • fourth
    • In the Storefront Properties tab, set the following:

      • Used for sorting in product listing = Yes
      • Leave all the other options as Default.
  3. Assign the test attribute to the Default attribute set in Admin > Stores > Attributes > Attribute Set.

  4. Configure the products to have test attribute values.

    • SKU: s00001, test: fourth
    • SKU: s00002, test: third
    • SKU: s00003, test: second
    • SKU: s00004, test: first
    • SKU: s00005, test: fourth
    • SKU: s00006, test: third
  5. Reindex and clear cache.

  6. Go to the category on the storefront.

  7. Sort by the test attribute.

Expected results:

The products are sorted by the test attribute.

Actual results:

The products are not sorted by the test attribute.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3