Structurally implements PhoenixKitCatalogue.Extension — the catalogue
item/category form "extension slot" (spec §2 principle 8). phoenix_kit_catalogue
is an optional dependency, so this module does NOT declare @behaviour PhoenixKitCatalogue.Extension; that would force it to be loaded at
compile time. Discovery is duck-typed, the same pattern as
PhoenixKitEcommerce.AITranslatable / ai_translatables/0: catalogue
finds this module via PhoenixKitEcommerce.catalogue_extensions/0 and is
responsible for checking it is actually usable before calling it.
Summary
Functions
Validates and shapes category["ecommerce"] — see CategoryCommerce.cast/2.
Validates and shapes item["ecommerce"] — see ItemCommerce.cast/2.
Same as item_columns/0, for the catalogue category table — categories carry their own shop_status too (CategoryCommerce).
Renders the Shop section inside the catalogue category form.
The shop fields a copied item or category keeps (catalogue's Duplicate,
a whole catalogue's copy included). A copy leaves out what ties the
original to other records: on an item the whole Shopify sub-map (product
id and handle, which the collection and media syncs match items by — two
rows claiming one product would both be synced to it — plus the
image_ids and set_slugs bookkeeping of that sync) and the legacy
product it was migrated from; on a category the Shopify
collection id the collection sync writes. Everything else is the copy's
to keep; a featured item inside the copied rows is re-pointed by the
catalogue itself.
Whether the Shop section should be shown / absorbed.
Extra column for the catalogue item table's Columns modal — surfaces
the shop's own shop_status next to the catalogue's status so the
two stop contradicting each other invisibly. See ShopStatusColumn.
Renders the Shop section inside the catalogue item form.
Namespace under data this extension owns.
Functions
Validates and shapes category["ecommerce"] — see CategoryCommerce.cast/2.
Validates and shapes item["ecommerce"] — see ItemCommerce.cast/2.
@spec category_columns() :: [map()]
Same as item_columns/0, for the catalogue category table — categories carry their own shop_status too (CategoryCommerce).
@spec category_section(map()) :: Phoenix.LiveView.Rendered.t()
Renders the Shop section inside the catalogue category form.
The shop fields a copied item or category keeps (catalogue's Duplicate,
a whole catalogue's copy included). A copy leaves out what ties the
original to other records: on an item the whole Shopify sub-map (product
id and handle, which the collection and media syncs match items by — two
rows claiming one product would both be synced to it — plus the
image_ids and set_slugs bookkeeping of that sync) and the legacy
product it was migrated from; on a category the Shopify
collection id the collection sync writes. Everything else is the copy's
to keep; a featured item inside the copied rows is re-pointed by the
catalogue itself.
@spec enabled?() :: boolean()
Whether the Shop section should be shown / absorbed.
@spec item_columns() :: [map()]
Extra column for the catalogue item table's Columns modal — surfaces
the shop's own shop_status next to the catalogue's status so the
two stop contradicting each other invisibly. See ShopStatusColumn.
@spec item_section(map()) :: Phoenix.LiveView.Rendered.t()
Renders the Shop section inside the catalogue item form.
@spec key() :: String.t()
Namespace under data this extension owns.