Skip to content

E-commerce 0.5.15: Products can no longer be carted without their options

E-commerce 0.5.15 fixes products that could go into the cart without the options they are sold in, at the base price instead of the price of the chosen option.

Options that come from the product’s own data, such as catalogue attribute sets and imported options, were never required, and an empty selection skipped the check. A product at 35.52 with every colour at +32.00 went into the cart at 35.52 with no colour. Every option is now required and starts on its first value. The product page’s “Please select” message is now translated too.

Upgrading

If your own code adds products to the cart through the module’s functions, pass the chosen options: a product with option values is now refused without them. Pass skip_spec_validation: true only if you really mean to add a bare line.

Full release notes: E-commerce 0.5.15

0.5.15 · 24 September 2026

Fixed

  • A product could be carted without the options it is sold in (#69). An option that comes from the product’s own metadata (catalogue attribute sets, imported options) was never required, and an empty selection skipped validation. A product at base 35.52, with every liquid colour at +32.00, went into the cart at 35.52 with no colour. Every discovered option is now required and starts on its first value. add_to_cart/4 validates an empty selection too. An admin’s price-neutral option that shares a key with a priced discovered option is required on the picker as well.
  • The product page’s “Please select:” message is translated. It was English in every locale.

Changed

  • add_to_cart/3,4 without :selected_specs refuses products that list option values (#69). The error is {:error, :missing_required_option, key}. This covers every product whose metadata carries _option_values, Legacy CSV imports included. Hosts that cart through the context must pass the options, or skip_spec_validation: true if they really mean to cart a bare line.

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