Skip to content

E-commerce 0.3.0: Shopify sync for products the shop already has

E-commerce 0.3.0 adds a Shopify sync: the PhoenixKit shop compares its products with a connected Shopify store and applies the differences you confirm.

What the sync does

The new Shopify Sync page in the shop admin checks the shop’s products against Shopify, matched by handle and slug. It compares the title, the description, the vendor, the tags, the status and the price, which is the lowest current variant price. Nothing is written until you click. Price-only changes under a threefold swing can be applied in bulk; every other change, and any larger price swing, is applied one product at a time with a confirmation that shows what will change. If a price update fails, the product stays in the list so you can try again.

The sync only updates products the shop already has. A Shopify product with no local match is skipped: new products still come in through the CSV import. Categories, images, variants and stock are not synced.

Setting it up

In Shopify, create a custom app with the read_products Admin API scope and copy its access token. In PhoenixKit, add a Shopify connection under Settings, Integrations, with the shop domain and the token; core stores them encrypted. Then open Shopify Sync and press Check for changes. The page uses the existing Run imports permission. The integration page’s connection test does not contact Shopify, so Check for changes is the real test.

Upgrading

No migration and no new configuration. The page appears for users with the Run imports permission.

Full release notes: E-commerce 0.3.0

0.3.0 · 21 August 2026

Added

  • Shopify sync — one-way, human-confirmed catalog sync from a connected Shopify store into this shop’s products. Generalizes a single-store integration (custom-app OAuth, plaintext env credentials, price-only) into something any PhoenixKit app can turn on: credentials live in core’s encrypted PhoenixKit.Integrations store (a Shopify custom-app Admin API access token, entered through the existing Integrations admin UI — no OAuth handshake, no new controller/router, and no per-app env vars), and the diff now covers title, description, vendor, tags, status, and price rather than price alone. Matches Shopify products to local ones by handle/slug; a Shopify product with no local match is skipped — creating new products is still the CSV importer’s job. Nothing is written without an explicit click: price-only, non-extreme changes get a bulk “apply all” button (a >3x price swing still forces individual confirmation, as before), every other field always does. PhoenixKitEcommerce.Shopify.{Provider, AdminClient, ProductDiff, Sync}; admin UI at Shop → Shopify Sync (shop.run_imports permission, reused rather than adding a new one). See the README for setup.
  • PhoenixKitEcommerce.HtmlText.extract_description/2 — the HTML-to-plain-text stripper ProductTransformer already had, pulled out so the Shopify sync’s diff engine can derive the same description from body_html instead of duplicating the logic.

Fixed

  • test/test_helper.exs was missing two support files from its explicit Code.require_file list (notification_assertions.ex, checkout_fixtures.ex) — any DataCase/LiveCase-based test failed to compile with “module … is not loaded and could not be found”. Unrelated to the Shopify work above; found getting a test baseline for it.
  • Post-merge review (dev_docs/pull_requests/2026/23-shopify-sync/CLAUDE_REVIEW.md): the new Shopify Sync LiveView’s route was missing from the test router, so its whole test file 404’d; the bulk “apply all price-only updates” action discarded write failures and reported them as applied — a product whose price update actually failed silently vanished from the review list instead of staying visible for retry (Shopify.Sync.apply_changes/2 now partitions successes from failures, and the LiveView keeps failed changes on screen with a separate error flash); and an admin-client test simulated a network failure with a bare raise, which doesn’t produce the {:error, _} tuple a real transport failure does and failed on its own.

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