Skip to content

Default variant detection breaks on non-English markets #462

Description

@hta218

Description

Detection of Shopify's synthetic single-variant option ("Title" / "Default Title") is hardcoded to the English option name. Shopify translates the option name per market (on /de it renders as "Titel"), so the check fails and the placeholder leaks into the UI: the variant selector renders on single-variant PDPs showing Titel: Default Title, and the placeholder appears in cart and bundle labels.

In the markets observed so far the option name is translated while the value still reads "Default Title" — so requiring both sides with && is what breaks. Note the value and the variant title are translatable resources too, so a fix should not depend on any single one of them staying English.

Affected code

  • app/utils/product.tshasOnlyDefaultVariant() requires option.name === "Title"
  • app/components/cart/cart-line-item.tsxisDefaultVariant = name === "Title" && value === "Default Title"
  • app/components/product/bundled-variants.tsxbundledVariant.title !== "Default Title"

Suggested fix

  • Normalize (trim + lowercase) and match against a shared marker set (title, default title) instead of exact English strings.
  • Accept any side that still carries the untranslated marker (|| instead of &&): option value, option name, or the variant title.
  • For hasOnlyDefaultVariant(), require the structural shape first (exactly one option with exactly one value), then the marker check.
  • Expose shared helpers (e.g. isDefaultTitleOption, isDefaultVariantTitle) so all three call sites use one implementation.

Keep genuine single-value options (Size: One size, Color: Black) rendering — a purely structural check (one option / one value) would hide those too, which is not what we want.

Steps to reproduce

  1. Open a single-variant product PDP on a non-English market (e.g. /de).
  2. Observe the variant selector renders with Titel: Default Title instead of being hidden.
  3. Add the item to cart and observe the placeholder in the cart line options.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions