E-commerce 0.4.0: A reworked Shopify sync page, and German and French
E-commerce 0.4.0 reworks the Shopify sync page around confirmed, field-by-field changes, keeps price checks going when the Shopify key stops working, and translates the storefront into German and French.
Shopify changes grouped by field
The Shopify Sync admin page now groups pending changes into sections: Prices, Titles, Descriptions, HTML texts, Tags, Statuses and Vendors, prices first, 25 rows to a page. Every write asks for confirmation first. Each section can be selected in bulk within the current page, but extreme price changes are left out of every bulk write and must be applied one by one. A changed text shows a word-level difference when you expand its row, and the page shows how many of the shop’s products matched Shopify.
Prices without the Admin API
When Shopify rejects the connection’s credentials, the sync reads prices from the store’s public product list instead of stalling. It reads prices only, never texts. A rate limit, server error or timeout stops the check instead, so the page never reports “no changes” when it could not check. A rejected key now names the missing read_products permission instead of showing a raw error.
German, French and translation fixes
The storefront, cart and checkout are translated into German and French. The Shopify sync page, which showed English in every language, is now translated into German, French, Russian and Estonian. Russian and Estonian no longer print the item count twice, and an empty French cart no longer reads “1 article”. Filter labels an admin typed on the storefront are no longer replaced by an unrelated translation.
Upgrading
No migration and no change in requirements. If your code calls the sync from outside the admin, Shopify.Sync.check/1 is now check/2 and returns a map: check its :source, because a result read from the public store holds price changes only.
Full release notes: E-commerce 0.4.0
0.4.0 · 2 September 2026
Added
- Unified Shopify sync. The Shopify Sync admin page now groups pending changes into field sections (Prices, Titles, Descriptions, HTML texts, Tags, Statuses, Vendors — price first), 25 rows to a page, with a request → confirm modal on every write path and a per-section bulk selection scoped to the current page. Extreme price changes are excluded from every bulk write and must be applied row by row.
Shopify.TextDiff— word-level diff overList.myers_difference/2on whitespace-preserving tokens, so rejoining the fragments reproduces both inputs exactly. No diff dependency added.summary/2returns the small shape (changed-region count, signed length delta) for a collapsed row;words/2the full diff, only for a row an operator expanded.- Keyless price fallback (
Shopify.StorefrontClient). When the Admin API rejects the connection’s credentials, the sync reads prices from the store’s public/products.jsoninstead of stalling. Deliberately narrow —"handle"and"variants"only, never text — with its own 429 andRetry-Afterhandling, a page cap, and a wall-clock deadline. Shopify.Source— a puredecide/2plus an I/Ofetch/2. The storefront fallback fires only on a credential failure (:unauthorized,:forbidden,:missing_credentials); a rate limit, 5xx or timeout aborts instead, because falling back on those would report “no text changes” when the truth is “we could not check”.ProductDiff.diff/4’sopts[:only]— restricts the comparison to a field subset so a narrow source’s absent fields are never reported (or applied) as deletions. Both the option key and every field atom in it are validated; a typo raises rather than silently comparing nothing.ProductDiff.matched_count/3and a catalogue-coverage stat on the sync page (Admin source only — the storefront serves a narrower, not-comparable population).- German and French storefront translations. Complete
deandfrgettext catalogues for the storefront/cart/checkout UI, additive only —en/et/ruand all source msgids are untouched. Formal register (Sie / vous), interpolation tokens preserved.
Changed
Shopify.Sync.check/1is nowcheck/2and returns a map (:changes,:source,:fallback_reason,:total_shopify_products,:matched_local_products) rather than a bare change list. A caller MUST branch on:source: a:storefrontresult carries price changes only.ProductDiff.Changecarriesbase_locale, andSync.apply_change/2writes localized fields back into that locale rather than re-reading the default at apply time — a change diffed against one locale could otherwise be applied into another.AdminClientmaps a 403 to{:error, :forbidden}.
Fixed
- The Shopify Sync page rendered entirely in English on every non-English
install. 84 msgids added under
web/were never run throughmix gettext.extract && mix gettext.merge, so the whole page — and the Shopify provider’s setup instructions — fell back to their msgids, which are the English source strings. Extracted, merged, and translated intode/fr/ru/et, which are back to 0 untranslated.i18n_test.exsnow asserts that property, so an un-run extraction fails the suite. - Section headers and field names ignored the locale entirely. Both
label sets lived as string literals in module attributes, where
mix gettext.extractcannot see them andgettext/1cannot read them back — soPrices,HTML textsand the%{field}noun in every confirm and flash message printed English under every locale. They are now onegettext/1call per field. - A 403 from the Admin API printed a raw atom.
:forbiddenreachedformat_fallback_reason/1but neverformat_error/1, so a rejected-scope token whose storefront fallback also failed renderedCould not reach Shopify: :forbidden— in the exact slot that is meant to carry the operator’s next action. It now names the missingread_productsscope. AdminClientno longer trustsRetry-Afterunclamped. A negative value madeProcess.sleep/1raise out of a function whose spec promises an error tuple; a huge one slept for real. Clamped to 0..60s, matchingStorefrontClient.- The
ruandetcatalogues printed the count twice on theitem/itemsplural ("3 3 позиции","3 3 eset"): the call site renders the count itself, so the msgstr must carry the noun alone — as the newde/frentries correctly do.et’smsgstr[0]also had the hardcoded1this release fixed infr. - Storefront filter labels no longer translate admin-entered text.
CatalogSidebarused to run every filter’s storedlabelthrough Gettext by string alone, so any label an admin typed — or the auto-capitalized labeladd_metadata_filtergenerates from an option key — that happened to collide with an unrelated catalogue msgid (e.g."Cost"→"Kosten") silently rewrote the shopkeeper’s own copy on the storefront, with no warning and no migration; new msgids added in later releases could widen the collision set at any time.translate_label/1now only translates a label that still matches the{key, label}pair shipped bydefault_storefront_filters/0— a renamed built-in or any custom label renders verbatim. Also stops labels containing%{...}from hitting Gettext’s interpolation and loggingmissing Gettext bindingson every render. frrendered “1” for an empty count on 6 plural msgids (1 category/1 product/1 item/1 cart total/1 method configured/1 day), reachable fromcarts.ex,categories.ex,products.ex,shipping_methods.exandproduct_detail.ex— an empty French cart read “1 article” (“1 item”). French’s CLDR plural rule sendsn=0to the singular index (de’s sends it to plural, which is why German was unaffected), and these sixmsgstr[0]entries had the digit1hardcoded instead of%{count}.fr“Vendor” facet translated asFournisseur(supply-chain “supplier”), not the customer-facing sense of the word. NowVendeur, matching the same correction on the product-detail page’sVendor:label.- A pending confirmation modal is now gated on the value it dereferences, and a single row’s apply goes through the same source-visibility guard as the section, selection and everything paths.
E-commerce 0.4.0. Install or update: {:phoenix_kit_ecommerce, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.