Skip to content

E-commerce 0.5.18: Cart option check and import picture matching fixed

E-commerce 0.5.18 closes a gap in the cart’s option check and fixes two false matches in the picture reuse that 0.5.17 added to imports.

Options checked on the current product

Adding to the cart checked the options against the product as the page had loaded it, then priced the line from the current product. A product that gained a required option after the page loaded went into the cart at its base price with nothing chosen, and a removed option value was still accepted. The check now runs on the current product, before any line is written.

Picture matching on import

Two different animations (GIF or WebP) could be taken for the same picture. Animated images are now stored as before and never matched, though identical files are still reused. A picture stretched to other proportions could also match its original; the comparison now keeps each picture’s proportions.

Files that a 0.5.17 import attached because of a false match are not repaired.

Full release notes: E-commerce 0.5.18

0.5.18 · 5 October 2026

Fixed

  • A product read before it gained required options could be carted without them (follow-up to #69). add_to_cart/3,4 validated the caller’s copy of the product, then priced from a freshly locked one. A product that required a colour after the page loaded went into the cart at its base price with none chosen, and a value removed since the read was still accepted. The fresh product is now the one validated, inside the pricing transaction, before any line is written. The error tuples and skip_spec_validation: true are unchanged.
  • Two different animations that open on the same frame were treated as one picture (#71). Multi-frame images (GIF, WebP) are no longer fingerprinted or matched; they are stored as before, and identical bytes are still reused. A static image can no longer resolve to an animation.
  • A picture stretched to other proportions matched its original (#71). The confirming comparison squashed both images into a square, which hid the distortion and recorded the original as the stretched copy’s file. It now fits each image into the square with white padding, keeping its aspect ratio. Fingerprints already stored stay valid.

Notes

  • Aliases and attachments a 0.5.17 import made for a false match are not repaired by this release.
  • mix phoenix_kit_ecommerce.backfill_image_fingerprints now reports each animated image as failed, since it is excluded from matching.

E-commerce 0.5.18. Install or update: {:phoenix_kit_ecommerce, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.