CoolCMS API

OrderItemPickerTrait

Product set picker for a row of the order items multiplier, like {@see GiftOfferSetPickerTrait::giftOfferSetMultiPicker()}.

Price, VAT and stock breakdown are not filled here (the picker only selects productSetId and the label); the server computes them on recalculation and save (api/eshop/order/build, OrderSnapshotBuilder). Requires $this->productSetManager.

With submitButton: 'itemsPrefill' the picker JS clicks a shared hidden button after a choice (as in InvoicerPickerRefreshTrait), which force-submits the whole form via AJAX; OrderFormTrait::prefillOrderItemRows() then fills code, unit, VAT and price from the catalog into the row just selected, only when it has no price yet.

Table of Contents

Methods

orderItemProductSetPicker()  : PickerConfig
orderItemProductSetName()  : string
Returns the set name in the current language (falls back to the first non-empty one).
resolveOrderItemProductSetLabel()  : string|null
suggestOrderItemProductSets()  : array<int, array{id: int, label: string}>

Methods

orderItemProductSetPicker()

protected orderItemProductSetPicker([string $container = 'items' ][, string $targetField = 'productSetId' ][, string $displayField = 'productSetName' ][, string $formName = 'editForm' ]) : PickerConfig
Parameters
$container : string = 'items'
$targetField : string = 'productSetId'
$displayField : string = 'productSetName'
$formName : string = 'editForm'
Return values
PickerConfig

orderItemProductSetName()

Returns the set name in the current language (falls back to the first non-empty one).

private orderItemProductSetName(ProductSet $set) : string
Parameters
$set : ProductSet
Return values
string

resolveOrderItemProductSetLabel()

private resolveOrderItemProductSetLabel(int $id) : string|null
Parameters
$id : int
Return values
string|null

suggestOrderItemProductSets()

private suggestOrderItemProductSets(string $query) : array<int, array{id: int, label: string}>
Parameters
$query : string
Return values
array<int, array{id: int, label: string}>
On this page

Search results