Skip to content

Product Type

First-Pass Node Dossier

This page is an evidence-backed node dossier generated from the domain hierarchy and node questionnaire.

What It Is

ProductType is a first-class catalog taxonomy in Pyle. It groups products, carries translated labels and slugs, participates in search, and feeds downstream behavior such as promotions, shipping eligibility, product groups, and minimum-quantity rules.

Parent hierarchy:

  • Catalog & Merchandising
  • Products
  • Product Type

Primary implementation paths:

  • packages/framework/src/Models/ProductType.php
  • packages/framework/src/Actions/ProductType
  • packages/framework/src/Http/Controllers/Api/Admin/ProductTypesController.php
  • packages/admin/src/Livewire/Admin/Settings/Types

What Users Can Do With It

Direct capabilities

Admin users can:

  • create a product type in Settings > Types
  • edit a product type
  • delete a product type if it has no associated products
  • list and search product types through the admin API

Indirect capabilities

Other workflows use ProductType without making it the primary object being edited:

  • assign a product type to a product
  • use product types in promotion conditions
  • use product types in shipping-service eligibility rules
  • use product types to drive product-group behavior
  • manage product type to product category relationships through Excel import/export

Where It Is Managed

ChannelRoleNotes
Admin Settings UIDirectCreate and edit dialogs live under packages/admin/src/Livewire/Admin/Settings/Types
Admin APIDirectProductTypesController exposes index, store, show, update, destroy
Product admin flowsIndirectProduct create/edit screens select a product type
StorefrontIndirectExposed nested inside product and order-item resources
Excel import/exportDirectproduct_types and product_type_product_category sheets are present
ERP bridgeDirectProduct types can be synced from ERP

Sources:

  • packages/admin/src/Livewire/Admin/Settings/Types/DataTable/CreateDialog.php
  • packages/admin/src/Livewire/Admin/Settings/Types/DataTable/EditDialog.php
  • packages/framework/src/Http/Controllers/Api/Admin/ProductTypesController.php
  • packages/framework/src/Http/Resources/Storefront/ProductResource.php
  • packages/framework/src/Http/Resources/Storefront/OrderItemResource.php
  • packages/framework/src/Actions/Import/Product/Sheets/ImportProductTypeRows.php
  • packages/framework/src/Actions/Import/Product/Sheets/ImportProductTypeProductCategoryRows.php
  • packages/framework/src/Services/ErpBridge/ProductType/ProductTypeErpSyncService.php

Channel-Level Field Coverage

Admin create dialog

The create dialog only exposes:

  • name
  • description

Source:

  • packages/admin/src/Livewire/Admin/Settings/Types/DataTable/CreateDialog.php

Admin edit dialog

The edit dialog exposes:

  • name
  • description
  • slug
  • search_weight

Source:

  • packages/admin/src/Livewire/Admin/Settings/Types/DataTable/EditDialog.php

Admin API

The admin API allows the ProductType resource itself to be listed, created, read, updated, and deleted. The controller's list endpoint only allows these fields in query shaping:

  • id
  • name
  • description
  • slug

The API resource serializer returns the model payload directly through parent::toArray($request).

Source:

  • packages/framework/src/Http/Controllers/Api/Admin/ProductTypesController.php
  • packages/framework/src/Http/Resources/Admin/ProductTypeResource.php

Model fields that exist but are not exposed in the inspected admin UI

The model also contains:

  • code
  • external_id
  • markup
  • minimum_margin
  • key_specs
  • available_for_google_merchant
  • group_name

Source:

  • packages/framework/src/Models/ProductType.php

Storefront field filtering

Storefront resources deliberately remove:

  • markup
  • minimum_margin

Source:

  • packages/framework/src/Http/Resources/Storefront/ProductTypeResource.php

Configuration And Data Model

Key model characteristics:

  • translated: name, description, slug
  • soft-deletable
  • searchable
  • ERP-syncable
  • activity-log aware

Important fields:

FieldPurpose
nametranslated business label
descriptiontranslated description
slugtranslated handle for routing or lookups
search_weightsearch weighting input
markuppricing-related input
minimum_marginused in downstream minimum-quantity recalculation logic
group_namegrouping metadata used in imports/exports
external_idERP matching key
codederived identifier

Creation behavior:

  • requires name.en and name.fr
  • auto-generates translated slugs
  • defaults description to the provided names if omitted
  • derives code from slug, or from external_id + slug

Sources:

  • packages/framework/src/Actions/ProductType/CreateProductType.php
  • packages/framework/src/Actions/ProductType/UpdateProductType.php
  • packages/framework/src/Models/ProductType.php

Relationships

ProductType directly relates to:

  • products()
  • productAttributes()
  • productCategories()

It also participates indirectly in:

  • shipping-service product-type restrictions
  • promotion prerequisite and entitlement conditions
  • product-group selection on storefront product pages

Sources:

  • packages/framework/src/Models/ProductType.php
  • packages/framework/src/Models/ShippingService.php
  • packages/framework/src/Services/Promotion/Conditions
  • packages/framework/src/Http/Resources/Storefront/ProductResource.php

Rules And Downstream Effects

Deletion rule:

  • a product type cannot be deleted while products still reference it

Automatic side effects on update:

  • if search_weight changes, related searchable products are reindexed
  • if minimum_margin changes and pyle.calculate_product_minimum_quantity_from_moq is enabled, related products get queued minimum-quantity recalculation jobs

Trigger path:

  • ProductTypeObserver dispatches ProductType/UpdateRelatedProducts

Sources:

  • packages/framework/src/Actions/ProductType/DeleteProductType.php
  • packages/admin/src/Livewire/Admin/Settings/Types/DataTable/EditDialog.php
  • packages/framework/src/Observers/ProductTypeObserver.php
  • packages/framework/src/Actions/ProductType/UpdateRelatedProducts.php

Integrations And Automation

Excel

The exact product-type Excel surfaces are:

  • product_types
  • product_type_product_category

These support both direct product-type data and product-type/category relationship management.

Sources:

  • packages/framework/src/Actions/Exports/ProductType/Sheets/ProductTypesSheet.php
  • packages/framework/src/Actions/Exports/Product/Sheets/ProductTypeProductCategorySheet.php
  • packages/framework/src/Actions/Import/Product/Sheets/ImportProductTypeRows.php
  • packages/framework/src/Actions/Import/Product/Sheets/ImportProductTypeProductCategoryRows.php

ERP bridge

Product types are synced through the ERP bridge and matched through ERP-oriented fields such as external_id.

Sources:

  • packages/framework/src/Services/ErpBridge/ProductType/ProductTypeErpSyncService.php
  • packages/framework/src/Actions/ErpBridge/ProductType
  • packages/erp-bridge/src/Requests/ProductTypes/GetProductTypesRequest.php

Where It Appears To End Users

ProductType is not a first-class storefront page. It appears as nested data inside product and order-item responses and influences what customers can buy or how combinations are resolved.

Examples:

  • nested in storefront product payloads
  • nested in storefront order-item payloads
  • used when resolving product groups

Sources:

  • packages/framework/src/Http/Resources/Storefront/ProductResource.php
  • packages/framework/src/Http/Resources/Storefront/OrderItemResource.php
  • packages/framework/src/Http/Resources/Storefront/ProductTypeResource.php

Current Documentation Takeaways

The three most important operator-level facts are:

  1. ProductType is broader than a simple label. It drives real pricing, shipping, promotion, and search behavior.
  2. The admin UI only exposes a subset of the model. Some important fields exist only through API, import/export, or sync paths.
  3. Changing a product type can have downstream effects on products, especially search and minimum-quantity behavior.

Open Questions

  • The admin API exposes AllowedFilter::exact('visible') in ProductTypesController, but the inspected model and migration evidence do not clearly explain that field.
  • The generated bindings file that wires observers is not committed in this repo snapshot, so observer registration is inferred from framework boot behavior rather than directly inspected project config.