# `PhoenixKit.Modules.Shop.Import.ProductTransformer`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/modules/shop/import/product_transformer.ex#L1)

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).

# `resolve_category_uuid`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/modules/shop/import/product_transformer.ex#L116)

Resolves category UUID 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_uuid
- language: Target language for localized fields (default: system default)

# `transform`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/modules/shop/import/product_transformer.ex#L44)

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_uuid
- 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_extended`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/modules/shop/import/product_transformer.ex#L223)

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_uuid
- 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.

# `update_categories_map`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.63/lib/modules/shop/import/product_transformer.ex#L193)

Build an updated categories_map including any auto-created categories.

Call this after transform() to update the map for subsequent products.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
