Skip to content

[BUG] Swatches malfunction when "-- Please Select --" is explicitly chosen for listing attribute #5186

@addison74

Description

@addison74

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Prerequisites

When "Product Attribute to Use for Swatches in Product Listing" is explicitly set to "-- Please Select --" (empty selection), swatches display on the product detail page but don't function when clicked. The hidden select value doesn't update, causing "Please specify the product's option(s)" error on add to cart.

Expected Behavior

The explicit selection of "-- Please Select --" should behave the same as having no listing attribute configured. Product detail swatches should function independently.

Steps To Reproduce

  1. Enable Configurable Swatches
  2. Set "Product Attributes to Show as Swatches in Product Detail" to an attribute (e.g., Size)
  3. Explicitly set "Product Attribute to Use for Swatches in Product Listing" to "-- Please Select --"
  4. View configurable product page
  5. Click a swatch option
  6. Click "Add to Cart"
  7. Error: "Please specify the product's option(s)"

Environment

- OpenMage: latest
- php: 8.4

Anything else?

Workaround

Select any attribute (even unused) in the listing field instead of "-- Please Select --".

Technical Notes

The issue is specific to the empty string value when "-- Please Select --" is chosen, versus null/undefined when the field is left unconfigured. Related to getSwatchAttributeId() handling in Helper/Productlist.php.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions