Skip to content

E-commerce 0.2.2: Products with non-Latin names get working addresses

E-commerce 0.2.2 fixes shop addresses for products, categories and shipping methods whose names cannot be turned into Latin letters, such as Chinese, Arabic or emoji.

Such a name produced an empty slug. The first one took the empty value in the unique index, so the next one could not be saved, and the product had no address to link to. Now the empty slug is never written. Instead the record gets a stable fallback slug starting with item-, and an old empty one is replaced on its next save. Renaming a shipping method no longer changes its slug, and a Cyrillic name no longer locks out later ones. A slug clash shows as a form error instead of a crash. Admin form labels no longer show faded under daisyUI 5.

Upgrading

The module now needs PhoenixKit core 2.6 or later.

Full release notes: E-commerce 0.2.2

0.2.2 · 14 August 2026

PR #21 plus the post-merge review in dev_docs/pull_requests/2026/21-stop-empty-slugs/GROK_REVIEW.md.

⚠️ Requires phoenix_kit ~> 2.6. Shipping-method slugs call Slug.put_slug/3 (core 2.4.0) and product/category unique constraints name V171’s projection primary keys (core 2.6.0). A host still on 2.0–2.5 will not resolve this release.

Fixed

  • Empty slugs no longer lock a shop out of its own unique index. Slug.slugify/2 returns "" for scripts it cannot romanize (CJK, Arabic, emoji). The old extract_primary_slug index was partial only on IS NOT NULL, so the first unromanizable title took the "" key and the second could not be inserted. The generator never writes an empty result.
  • Unromanizable titles now get a storefront URL. Skipping the empty key fixed the lockout but left CJK-only products as /shop/product/ — a catalog card with nowhere to go. They now receive a stable item-<hash> fallback, shared by Product and Category via PhoenixKitEcommerce.LocalizedSlug. A leftover {"en": ""} row self-heals into that fallback on its next save.
  • Slug resolution skips stored empty strings. "" is truthy, so SlugResolver.product_slug/2 used to emit it into product_url/2 for a legacy CJK row and produce /shop/product/ even when another language had a real slug.
  • Renaming a shipping method no longer moves its slug, and a Cyrillic name no longer writes "" (which locked every later Cyrillic-named method out via phoenix_kit_shop_shipping_methods_slug_unique). Shipping methods now use core’s Slug.put_slug/3.
  • A CJK/Arabic/emoji shipping-method name can be saved. slug is NOT NULL, and put_slug/3 leaves it blank when slugify returns "", which was a failed insert. The same item-<hash> fallback now fills it, suffixing -2 on collision.
  • Product and category slug collisions are changeset errors on :slug, not raw Postgrex.Error. The unique_constraint names follow V171’s projection primary keys.
  • Admin form labels were rendering at 60% opacity under daisyUI 5. form-control / label-text / *-bordered / tabs-bordered match nothing in v5; the leftover .label rule is color-mix(..., 60%). Class remaps only.

Changed

  • :phoenix_kit floor raised ~> 2.0 → ~> 2.6 (two-segment, so later 2.x still resolve). The previous floor admitted cores without put_slug/3 and without V171.

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