ResultFieldTemplate

Emit events to request templates to be used for result fields.

Namespace

IO\Services\ItemSearch\Helper

Constants
Type Name Value Description

string

TEMPLATE_LIST_ITEM

'IO.ResultFields.ListItem'

string

TEMPLATE_SINGLE_ITEM

'IO.ResultFields.SingleItem'

string

TEMPLATE_BASKET_ITEM

'IO.ResultFields.BasketItem'

string

TEMPLATE_AUTOCOMPLETE_ITEM_LIST

'IO.ResultFields.AutoCompleteListItem'

string

TEMPLATE_CATEGORY_TREE

'IO.ResultFields.CategoryTree'

string

TEMPLATE_VARIATION_ATTRIBUTE_MAP

'IO.ResultFields.VariationAttributeMap'

Properties
Type Name Description

``

$templates

``

$requiredFields

Methods
public static get($template):string

Get the path to result fields file from template/ theme

Parameters

Type

Name

Description

string

$template

Event to be emitted to templates/ themes

public static load($template)
Parameters

Type

Name

Description

``

$template

public setTemplate($event, $template)

Set the path of a template to read result fields from.

Parameters

Type

Name

Description

string

$event

The event to set the template for.

string

$template

Path to the template to read result fields from.

public requireFields($event, $field = [])

Add required fields to variation search requests.

Parameters

Type

Name

Description

string | array

$event

A single template event to set required fields for or a map between template events and list of required fields

string | array

$field

If first parameter describes a single template event this parameter may contain a single result field or a list of field to require.