Skip to content

Conversation

@tijmenbruggeman
Copy link
Collaborator

Currently the product variation image gallery is not displaying the correct image when selecting it.
WooCommerce uses JavaScript to set a new image when it is selecting a different variation. Unfortunately this targets the root image and not the source of our picture element.

Added

  • WooCommerce compatibility class;
  • Added filter to prevent picture elements to be injected on product pages;

Changed

  • Moved picture filter to latest possible moment to make sure we can check for page types. On init was to early as wordpress was not fully initialized yet. This required the settings to be injected into the picture class as well;

Considerations

  • I had created an additional filter to skip certain DOM elements but the regex on that was a bit to brittle so decided to keep it simple for now and skip the entire product page.
  • Did not add integration tests because of the dependency on WooCommerce. Overall not quite happy with adding Third Party plug-ins to integration tests as it'll slow down things quite considerably.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant