Skip to content

Instantly share code, notes, and snippets.

@leopic
Created June 27, 2013 17:56
Show Gist options
  • Select an option

  • Save leopic/5878724 to your computer and use it in GitHub Desktop.

Select an option

Save leopic/5878724 to your computer and use it in GitHub Desktop.

US8187

[DEFECT] PDP Discontinued colors don't swap the main image when using the

unified dropdown

What?

When selecting a variant on either version of the unified dropdown that was marked as "Discontinued" the main product image wouldn't update.

Who?

Any product that used either version of the unified dropdown and had at least one color that was marked as "Discontinued".

What caused it?

Two things:

  • On mid-May we fixed a similar issue, when two or more products shared the prefix of their name, think "Red" and "Red/Blue", the "Red/Blue" image was being displayed, as it does indeed starts with "Red", however this fix broke colors marked as "Discontinued".
  • The swatch title (used to match the selected color and the main image) wasn't appending "Discontinued" to such colors, so the JS was expecting to find a color such as "Red (*Discontinued)" but the color was named "Red" only and a match was never made.

The fix

Updated JSP to append "(*Discontinued)" to such colors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment