Skip to content

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Dec 7, 2025

Description (*)

Remove normalization from Mage_ConfigurableSwatches_Helper_Mediafallback::attachProductChildrenAttributeMapping() for labels. (added in Magento 1.9.3)

Fixed Issues (if relevant)

Questions or comments

@addison74 can you please test with sample data?

  • category: mens shirt
  • product: Plaid Cotton Shirt
  • go to config and set size as swatch-attribute for product listing

Copilot AI review requested due to automatic review settings December 7, 2025 02:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Cypress end-to-end tests to verify the fix for swatch sort order and lowercase labels functionality. The tests validate that configurable product swatches (for attributes like color and size) display with proper capitalization and maintain correct sort order on both product pages and category listing pages.

  • Adds Cypress tests for product and category pages with configurable swatches
  • Sets up test configuration for catalog product and category pages
  • Tests verify swatch attributes display correctly with expected labels and order

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cypress/e2e/openmage/frontend/catalog/product.cy.js Tests for swatch display on product detail pages (color and size attributes)
cypress/e2e/openmage/frontend/catalog/category.cy.js Tests for swatch display on category listing pages (color attribute)
cypress/support/openmage/frontend/catalog/product.js Configuration object for product page tests
cypress/support/openmage/frontend/catalog/catagory.js Configuration object for category page tests (filename has typo)
cypress/support/openmage/_utils/test.js Adds catalog namespace objects to test utility structure
cypress/support/e2e.js Imports new catalog test support files

@github-actions github-actions bot added the Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches label Dec 7, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

@addison74
Copy link
Contributor

addison74 commented Dec 7, 2025

Many thanks for taking care of this issue. I prefer not using the data sample, just OpenMage the latest repository version out of the box.

Here is the visual result with your PR

pr_result

Here is the visual result commenting $optionLabels

comment_result

@addison74
Copy link
Contributor

addison74 commented Dec 7, 2025

Regarding this issue

This is the attribute information page. "Used in Product Listing" is set to "No", but the swatches appear bellow the product image

attribute_page

Doing some tests, the option "Used in Product Listing" from the attribute page indeed it is not used. The only control on the category page is coming from the "Configurable Swatches" section in the configuration page. Just set the "Product Attribute to Use for Swatches in Product Listing" to Size to become visible, or to "-- Please Select --" to hide it

product_listing

@sreichel
Copy link
Contributor Author

sreichel commented Dec 7, 2025

Many thanks for taking care of this issue. I prefer not using the data sample, just OpenMage the latest repository version out of the box.

Here is the visual result with your PR

With sample data it would be easier to repruce and add tests.

In your bug report you said the order is reversed, now you are saying the order is correct?

Please check the positions for the swatch options.

@addison74
Copy link
Contributor

I stated why sample data should not be used for this bug. It is OpenMage from scratch. Just add a configurable attribute size, create 1 product configurable with 1 simple product associated.

I never said that the order is correct. If you look above in my post from 8 hours ago you will see what your change looks like and what the change looks like when that normalization does not exist.

@sreichel
Copy link
Contributor Author

sreichel commented Dec 7, 2025

I stated why sample data should not be used for this bug.

Why? I dont see it.

you will see what your change looks like and what the change looks like when that normalization does not exist.

Wth removing the normalzation the order is still reversed for me.

Tested with plain install, mannually created attributes and products ...

Dont know whats different for you.

@sreichel sreichel closed this Dec 7, 2025
@sreichel sreichel reopened this Dec 8, 2025
@sreichel sreichel marked this pull request as draft December 8, 2025 02:07
@sreichel sreichel marked this pull request as draft December 9, 2025 18:19
@github-actions github-actions bot removed the Component: Core Relates to Mage_Core label Dec 10, 2025
@sreichel sreichel marked this pull request as ready for review December 10, 2025 00:35
@sreichel sreichel requested a review from Copilot December 10, 2025 00:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

@github-actions github-actions bot removed the Component: Catalog Relates to Mage_Catalog label Dec 10, 2025
@sreichel sreichel requested a review from Copilot December 10, 2025 01:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

@sreichel sreichel marked this pull request as draft December 10, 2025 02:01
@sreichel sreichel marked this pull request as ready for review December 10, 2025 02:05
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
19.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sreichel sreichel requested a review from addison74 December 10, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches cypress environment Template : rwd Relates to rwd template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Configurable attribute options order reversed on category page

2 participants