Transform Shopify CSV rows into PhoenixKit Product format.
Handles:
- Basic product fields (title, description, price, etc.)
- Option values and price modifiers in metadata
- Slot-based options with global option mapping
- Category assignment based on title keywords (configurable)
- Image collection
- Auto-creation of missing categories
Extended Transform
Use transform_extended/5 with option_mappings to enable slot-based
options that reference global options. This allows multiple uses of the
same global option in a product (e.g., cup_color and liquid_color both
referencing the "color" global option).
Summary
Functions
Resolves category_id from slug, auto-creating if necessary.
Transform a group of CSV rows (one product) into Product attrs.
Transform with extended options support (Option3..N and slot mappings).
Build an updated categories_map including any auto-created categories.
Functions
Resolves category_id from slug, auto-creating if necessary.
If category doesn't exist, creates it with:
- name: Generated from slug (capitalize, replace hyphens with spaces) - localized map
- status: "active"
- slug: The original slug - localized map
Arguments
- category_slug: The slug string to look up
- categories_map: Map of slug => category_id
- language: Target language for localized fields (default: system default)
Transform a group of CSV rows (one product) into Product attrs.
Arguments
- handle: Product handle (slug)
- rows: List of CSV row maps for this product
- categories_map: Map of slug => category_id
- config: Optional ImportConfig for category rules (nil = legacy defaults)
- opts: Keyword options:
:language- Target language for imported content (default: system default language)
Returns
Map suitable for Shop.create_product/1
Transform with extended options support (Option3..N and slot mappings).
Arguments
- handle: Product handle (slug)
- rows: List of CSV row maps for this product
- categories_map: Map of slug => category_id
- config: Optional ImportConfig for category rules and option mappings
- opts: Keyword options:
:language- Target language for imported content:option_mappings- Explicit option mappings (overrides config)
Returns
Map suitable for Shop.create_product/1 with slot-based metadata if mappings provided.
Build an updated categories_map including any auto-created categories.
Call this after transform() to update the map for subsequent products.