Plentymarkets interface documentation
Consent
Contracts
ConsentRepositoryContract
Repository to register consents and check for users response.
Namespace
Plenty\Modules\Webshop\Consent\Contracts
Methods
public registerConsentGroup($key, $label, $options = []):void
Register a new group of consents.
Name |
Type |
Description |
|
Unique identifier of the group |
|
|
Displayed label of the group |
|
|
Additional options of the group. Available options are: <ul> <li><b>necessary:boolean</b> True if the group is necessary and could not be declined</li> <li><b>description:string</b> Description of the group.</li> <li><b>position:number</b> The position of the group</li> </ul> Alternatively provide a function which returns all options. This will be resolved if registered consent groups are requested. |
public registerConsent($key, $label, $options = []):void
Register a new consent.
Name |
Type |
Description |
|
Unique identifier of the consent. |
|
|
Displayed label of the consent. |
|
|
Additional options of the consent. Available options are: <ul> <li><b>necessary:boolean</b> True of the consent is necessary and could not be declined</li> <li><b>description:string</b> Description of the consent</li> <li><b>provider:string</b> The provider of the cookie</li> <li><b>lifespan:string</b> Lifespan of the cookie</li> <li><b>policyUrl:string</b> URL to external privacy policy</li> <li><b>group:string</b> Identifier of an consent group</li> <li><b>position:number</b> The position of the consent in the group</li> <li><b>isOptOut:boolean</b> Select the consent by default. The user needs to decline the consent explicitly.</li> <li><b>cookieNames:array</b> Names of cookies which will be set. These cookies will not be blocked after the user confirmed the consent.</li> </ul> Alternatively provide a function which returns all options. This will be resolved if registered consents are requested. |
public getConsentGroups():Illuminate\Support\Collection
Return type: Collection
Get all consent groups including all consents.
public hasResponse():bool
Check if the user has already responded the consents.
public setResponse($key, $isConsented = false):void
Set the response for a consent or a group of consents.
Name |
Type |
Description |
|
The key of the consent group and the consent, e.g. "group.consent" Use "" as consent key to check if all entries of a group has a response, e.g. "group." |
|
|
True if the user has accepted the consent or the group of consents |
public isConsented($key):bool
Check if the user has consented.
Name |
Type |
Description |
|
The key of the consent group and the consent, e.g. "group.consent" Use "" as consent key to check if all entries of a group has a response, e.g. "group." |
ContactForm
Contracts
ContactFormFileRepositoryContract
Repository to upload files from the online store contact form and retrieve them
Namespace
Plenty\Modules\Webshop\ContactForm\Contracts
Methods
public uploadFiles($fileData):array
Name |
Type |
Description |
|
public getFile($fileName):Plenty\Modules\Cloud\Storage\Models\StorageObject
Return type: StorageObject
Name |
Type |
Description |
|
Webshop
Contracts
CheckoutRepositoryContract
Repository to get and set checkout data
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public getCurrency():string
Get the currently used currency.
public setCurrency($currency):void
Set the currency.
Name |
Type |
Description |
|
public getShippingCountryId():int
Get the id of the current shipping country. Default to the configured country id from the webstore configuration.
ContactRepositoryContract
Repository to get and set contact information for the webshop
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public getContactId():int
Get the ID of the logged in contact or 0 for guests
public getContact():Plenty\Modules\Account\Contact\Models\Contact
Return type: Contact
Get the logged in contact
public getContactClassId():int
Get the contact class ID of the logged in contact
public getContactClassData($contactClassId):array
Get the contact class data for the provided contact class ID
Name |
Type |
Description |
|
public getDefaultContactClassId():int
Get the default contact class ID of the webstore
public showNetPrices():bool
Get Information if net prices should be shown
GiftCardRepositoryContract
Repository to get information about gift cards and corresponding order items
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public hasGiftCardPdf($orderId, $orderItemId, $campaignCodeOrderId):bool
Checks if a gift card document has already been created for this order item
Name |
Type |
Description |
|
||
|
||
|
public getGiftCardInformation($orderItemId):array
Get Information about the gift card
Name |
Type |
Description |
|
public isReturnable($orderItemId):bool
Return true if its not a gift card or the codes are not redeemed
Name |
Type |
Description |
|
public getReturnQuantity($orderItemId):int
Returnable quantity for giftCard
Name |
Type |
Description |
|
LocalizationRepositoryContract
Repository for webshop localization information
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public getLanguage():string
Get the currently used language of the webshop visitor
public getLocale():string
Get the current locale
public getLanguageCode($countryCode = null):string
Get a ISO language code by given country code.
Name |
Type |
Description |
|
SessionStorageRepositoryContract
Repository for webshop session information
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public setSessionValue($key, $value):void
Set a value to a given key in the session
Name |
Type |
Description |
|
The key from session |
|
|
The value will set to given key |
public getSessionValue($key):void
Get a value from the session by a given key
Name |
Type |
Description |
|
The key to read from the session |
public getCustomer():Plenty\Modules\Frontend\Session\Storage\Models\Customer
Return type: Customer
Get the customer session model
public getOrder():Plenty\Modules\Frontend\Session\Storage\Models\Order
Return type: Order
Get the order session model
UrlBuilderRepositoryContract
Generate url for items, variations and categories considering all affecting configurations.
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public buildItemUrl($itemId, $lang = null):Plenty\Modules\Webshop\Helpers\UrlQuery
Return type: UrlQuery
Build item url. Generate and write url to item data if not defined yet.
Name |
Type |
Description |
|
Id of the item to generate url for. |
|
|
Language to generate the url in. Defaults to current language from session. |
public buildCategoryUrl($categoryId, $lang = null, $webstoreId = null):Plenty\Modules\Webshop\Helpers\UrlQuery
Return type: UrlQuery
Build category url by recursively prepending url names of parent categories.
Name |
Type |
Description |
|
Id of the category to get url for. |
|
|
Language to generate the url in. Defaults to current language from session. |
|
|
Webstore to get url names for. Defaults to current webstore id. |
public fillItemUrl($itemData):void
Store item data of loaded items to be reused when generating item or variation urls.
Name |
Type |
Description |
|
Item data object returned from search request. |
public buildVariationUrl($itemId, $variationId, $lang = null):Plenty\Modules\Webshop\Helpers\UrlQuery
Return type: UrlQuery
Build variation url. Variation urls equal to item urls with the variation id appended.
Name |
Type |
Description |
|
Id of the item to generate url for. |
|
|
Id of the variation to generate url for. |
|
|
Language to generate the url in. Defaults to current language from session. |
public getSuffix($itemId, $variationId, $withVariationId = true):string
Get the suffix to be appended to item or variation urls.
Name |
Type |
Description |
|
item id to be used in the suffix. |
|
|
variation id to be used in the suffix. Will be ignored when using Callisto urls. |
|
|
Set if the variation id should be included in the suffix. Not considered when using Callisto urls. |
WebstoreConfigurationRepositoryContract
Repository for webstore information
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public getWebstoreConfiguration():Plenty\Modules\System\Models\WebstoreConfiguration
Return type: WebstoreConfiguration
Get the webstore configuration
public getActiveLanguageList():array
Get the activate languages of the webstore
public getDefaultShippingCountryId():int
Get the default shipping-country-Id of the webstore
public setFaviconFromWebspace($plentyId, $faviconUrl):string
Copy a favicon from the frontend webspace to the internal storage to be available at the frontend domain.
Name |
Type |
Description |
|
plentyId of the client to upload the favicon for. |
|
|
Url of the favicon file in the frontend webspace |
Events
Helpers
NumberFormatter
Helper class for number formatting
Namespace
Plenty\Modules\Webshop\Helpers
Methods
public formatDecimal($value, $decimal_places = -1):string
Format the given value to decimal
Name |
Type |
Description |
|
||
|
public formatMonetary($value, $currencyISO):string
Format the given value to currency
Name |
Type |
Description |
|
||
|
PluginConfig
Helper to get plugin configuration values. Provides several methods to read configuration values and cast them into required type.
Namespace
Plenty\Modules\Webshop\Helpers
Methods
public load():void
Initially load configuration values into member variables.
public getPluginName():string
Return the name of the plugin to get the configuration values for.
public getMultiSelectValue($key, $possibleValues = [], $default = []):array
Get values of a multiselect configuration.
Name |
Type |
Description |
|
The key of the configuration to read. |
|
|
List of possible configuration values. Will be returned if the configuration value is "all" |
|
|
A default value to return if the configuration is not set yet. |
public getTextValue($key, $default = "", $transformDefault = ""):string
Get the value of a text configuration.
Name |
Type |
Description |
|
The key of the configuration to read. |
|
|
A default value to return if the configuration is not set yet. |
|
|
A value to be interpreted as a default value. Use this if you have defined a value in your config.json that should be handled as default value. |
public getIntegerValue($key, $default):int
Get the value of an integer configuration.
Name |
Type |
Description |
|
The key of the configuration to read. |
|
|
A default value to return if the configuration is not set yet. |
public getBooleanValue($key, $default = false):bool
Get the value of a boolean configuration.
Name |
Type |
Description |
|
The key of the configuration to read. |
|
|
A default value to return if the configuration is not set yet. |
public getConfigValue($key, $default = null):void
Get a configuration value without any cast.
Name |
Type |
Description |
|
The key of the configuration to read. |
|
|
A default value to return if the configuration is not set yet. |
UnitUtils
Convert plentymarkets unit keys into common unit codes.
Namespace
Plenty\Modules\Webshop\Helpers
Methods
public static getHTML4Unit($unit = "SMM"):string
Return common code for a unit ('m','cm' 'mm').
Name |
Type |
Description |
|
The internal unit key. |
UrlQuery
Helper to generate and manipulate urls to be used in the webshop.
Namespace
Plenty\Modules\Webshop\Helpers
Methods
public static create($path = null, $lang = null):Plenty\Modules\Webshop\Helpers\UrlQuery
Return type: UrlQuery
Create a new instance.
Name |
Type |
Description |
|
The path of the url. |
|
|
The language of the generated url. Will be included automatically if it is different to the default language. |
public static shouldAppendTrailingSlash():bool
Check if a trailing slash should be appended to urls.
public append($suffix):Plenty\Modules\Webshop\Helpers
Return type: Helpers
Append a string to the path the url without checking for slashes.
Name |
Type |
Description |
|
String to append to the path. |
public join($path):Plenty\Modules\Webshop\Helpers
Return type: Helpers
Append a new path to the existing one. Ensure having a slash as glue between existing path and the new segment.
Name |
Type |
Description |
|
The new path to append. |
public toAbsoluteUrl($includeLanguage = false):string
Return the absolute url by prepending the HTTPS domain of the current client.
Name |
Type |
Description |
|
If true it will include the language at the beginning of the path. |
public toRelativeUrl($includeLanguage = false):string
Return the path as a relative url.
Name |
Type |
Description |
|
If true it will include the language at the beginning of the path. |
public getPath($includeLanguage = false):string
Return the path. This equals the relative url without a leading slash.
Name |
Type |
Description |
|
If true it will include the language at the beginning of the path. |
public equals($path):bool
Compare current path to a string independent of a trailing slash.
Name |
Type |
Description |
|
String to compare the current path to. |
Hooks
CheckVatNumber
Hook to execute validation of vat numbers. Can be triggered by emitting ValidateVatNumber while creating new addresses.
Namespace
Plenty\Modules\Webshop\Hooks
Methods
public handle($vatNumberEvent):void
Validate the given vat number
Name |
Type |
Description |
|
Event emitted while creating new addresses. |
ItemSearch
Contracts
FacetExtension
Interface to add custom facets.
Namespace
Plenty\Modules\Webshop\ItemSearch\Contracts
Methods
public getAggregation():Plenty\Modules\Cloud\ElasticSearch\Lib\Search\Aggregation\AggregationInterface
Return type: AggregationInterface
Get the aggregation to apply the facet to the search results.
public mergeIntoFacetsList($result):array
Merge facet data into list of facets.
Name |
Type |
Description |
|
Facet data |
public extractFilterParams($filtersList):void
Extract search filters from filter paramters to be applied to the search request.
Name |
Type |
Description |
|
List of value ids for this facet. Possible values can be set by mergeIntoFacetsList() |
Factories
BaseSearchFactory
Base factory to prepare and build search requests on variation data interface
Namespace
Plenty\Modules\Webshop\ItemSearch\Factories
Methods
public inherit($inheritedProperties = []):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Create a new factory instance based on properties of an existing factory.
Name |
Type |
Description |
|
List of properties to inherit or null to inherit all properties. |
public withMutator($mutator, $excludeDependencies = false, $position = 1000):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a mutator to transform search results.
Name |
Type |
Description |
|
The mutator itself |
|
|
Set to true to remove required data from the results after applying the mutator. Fields will only be removed if they are not requested by the result fields of the search request. |
|
|
Position of the mutator. Mutators are executed in the order of their positions. |
public createFilter($filterClass, $params = []):void
Add a filter. Will create a new instance of the filter class if not already created.
Name |
Type |
Description |
|
||
|
public withFilter($filter):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a filter. Will override existing filter instances.
Name |
Type |
Description |
|
public withResultFields($fields):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set fields to be contained in search result.
Name |
Type |
Description |
|
Reference to a json file to load fields from or a list of field names. |
public getResultFields():array
Get the requested result fields for this search request.
public hasResultField($field):bool
Check if result field is already included in the source of the search.
Name |
Type |
Description |
|
The field to search for in result fields |
public getAdditionalResultFields():array
Get additional result fields required by webshop mutators.
public withExtension($extensionClass, $extensionParams = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add an extension.
Name |
Type |
Description |
|
Extension class to add. |
|
|
Additional parameters to pass to extensions constructor |
public getExtensions():array
Get all registered extensions
public getMutators():array
Get all registered mutators
public withAggregation($aggregation):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add an aggregation
Name |
Type |
Description |
|
public withSuggestion($suggestion):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a suggestion
Name |
Type |
Description |
|
public setPage($page, $itemsPerPage):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set pagination parameters.
Name |
Type |
Description |
|
||
|
public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add sorting parameters
Name |
Type |
Description |
|
The field to order by |
|
|
Direction to order results. Possible values: 'asc' or 'desc' |
public sortByMultiple($sortingList):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add multiple sorting parameters
Name |
Type |
Description |
|
List of sorting parameters. Each entry should have a 'field' and an 'order' property. |
public setOrder($idList):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set the order of the search results by ids.
Name |
Type |
Description |
|
List of variation ids. Search results will be sorted in the same order. |
public groupBy($field, $sortings = []):Plenty\Modules\Webshop\ItemSearch\Factories
FacetSearchFactory
Prepare and build search requests to query facets
Namespace
Plenty\Modules\Webshop\ItemSearch\Factories
Methods
public static create($facets):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Create a factory instance depending on a given set of facet values.
Name |
Type |
Description |
|
List of active facet values. If string is given, it will be exploded by ',' to a list of values. |
public withMinimumCount():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Register extension to filter facets by minimum hit count.
public static default($options = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Get the default configuration of a search factory.
Name |
Type |
Description |
|
Available options <ul> <li><b>quantities</b> Quantities of the variations in the basket. This will be considered while calculating graduated prices</li> <li><b>setPriceOnly</b> Set to true to only consider prices for item sets</li> </ul> |
public setAdminPreview($isAdminPreview):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set preview mode for the search request.
Name |
Type |
Description |
|
Set to true to enable preview. |
public isActive():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter active variations
public isInactive():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter inactive variations
public hasItemId($itemId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variation by a single item id
Name |
Type |
Description |
|
Item id to filter by. |
public hasItemIds($itemIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple item ids
Name |
Type |
Description |
|
List of item ids to filter by. |
public hasVariationId($variationId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variation by a single variation id.
Name |
Type |
Description |
|
The variation id to filter by. |
public hasVariationIds($variationIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple variation ids.
Name |
Type |
Description |
|
List of variation ids to filter by. |
public hasAtLeastOneAvailability($availabilityIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
List of availability ids to filter by. |
public hasSupplier($supplierId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
The supplier id to filter by. |
public hasManufacturer($manufacturerId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter manufacturers by id.
Name |
Type |
Description |
|
To filter by manufacturer |
public hasEachProperty($propertyIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple property ids.
Name |
Type |
Description |
|
The property ids to filter by. |
public isMain():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter only main variations
public isChild():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter only child variations
Return type: Factories
Filter by visibility in category list.
Name |
Type |
Description |
|
Visibility in category list to filter by. |
public isSalable():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by isSalable flag
public isVisibleForClient($clientId = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by visibility for client
Name |
Type |
Description |
|
The client id to filter by. If null, default client id from config will be used. |
public hasNameInLanguage($type = "hasAnyNameInLanguage", $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having texts in a given language.
Name |
Type |
Description |
|
The text field to filter by ('hasAny', 'hasName1', 'hasName2', 'hasName3') |
|
|
The language to filter by. If null, language defined in session will be used. |
public isInCategory($categoryId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations contained in a category.
Name |
Type |
Description |
|
A category id to filter variations by. |
public hasAtLeastOnePrice($priceIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having at least on price.
Name |
Type |
Description |
|
List of price ids to filter variations by |
public hasPriceForCustomer():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having at least one price accessible by current customer.
public hasPriceInRange($priceMin, $priceMax):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
||
|
public hasTag($tagId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public hasAnyTag($tagIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public groupByTemplateConfig():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Group results depending on a config value.
public isCrossSellingItem($itemId, $relation):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having a cross selling relation to a given item.
Name |
Type |
Description |
|
Item id to filter cross selling items for |
|
|
The relation of cross selling items. |
public hasFacets($facetValues, $clientId = null, $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by facets.
Name |
Type |
Description |
|
List of facet values. If string is given, it will be exploded by ';' |
|
|
Client id to filter facets by. If null, default client id from config will be used. |
|
|
Language to filter facets by. If null, active language from session will be used. |
public hasSearchString($query, $lang = null, $a = "", $b = ""):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by given search string.
Name |
Type |
Description |
|
The search string to filter variations by |
|
|
The language to apply search on. If null, default language from session will be used |
|
|
The item search operator should be "or" or "and" |
|
|
public hasNameString($query, $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by searching names
Name |
Type |
Description |
|
The search string |
|
|
Language to apply search on. If null, default language from session will be used. |
public withLanguage($lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Only request given language.
Name |
Type |
Description |
|
Language to get texts for. If null, default language from session will be used. |
public withImages($clientId = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Include images in result
Name |
Type |
Description |
|
The client id to get images for. If null, default client id from config will be used. |
public withVariationAttributeMap($itemId, $initialVariationId, $afterKey = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Includes VariationAttributeMap for variation select
Name |
Type |
Description |
|
||
|
||
|
public withPropertyGroups($displaySettings = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public withOrderPropertySelectionValues():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withVariationProperties():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withUrls():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Append URLs to result.
public withPrices($quantities = [], $setPriceOnly = false):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Append prices to result.
Name |
Type |
Description |
|
||
|
public withCurrentCategory():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set result as current category
public withDefaultImage():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Append default item image if images are requested by result fields and item does not have any image
public withBundleComponents():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add bundle component variations.
public withSetComponents():void
Add set component variations to item set entries.
public withLinkToContent():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withGroupedAttributeValues():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withReducedResults():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withAvailability():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Return type: Factories
public withCategories():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withSuggestions($query = "", $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
||
|
public withDidYouMeanSuggestions($query):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public withSalableVariationCount():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public inherit($inheritedProperties = []):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Create a new factory instance based on properties of an existing factory.
Name |
Type |
Description |
|
List of properties to inherit or null to inherit all properties. |
public withMutator($mutator, $excludeDependencies = false, $position = 1000):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a mutator to transform search results.
Name |
Type |
Description |
|
The mutator itself |
|
|
Set to true to remove required data from the results after applying the mutator. Fields will only be removed if they are not requested by the result fields of the search request. |
|
|
Position of the mutator. Mutators are executed in the order of their positions. |
public createFilter($filterClass, $params = []):void
Add a filter. Will create a new instance of the filter class if not already created.
Name |
Type |
Description |
|
||
|
public withFilter($filter):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a filter. Will override existing filter instances.
Name |
Type |
Description |
|
public withResultFields($fields):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set fields to be contained in search result.
Name |
Type |
Description |
|
Reference to a json file to load fields from or a list of field names. |
public getResultFields():array
Get the requested result fields for this search request.
public hasResultField($field):bool
Check if result field is already included in the source of the search.
Name |
Type |
Description |
|
The field to search for in result fields |
public getAdditionalResultFields():array
Get additional result fields required by webshop mutators.
public withExtension($extensionClass, $extensionParams = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add an extension.
Name |
Type |
Description |
|
Extension class to add. |
|
|
Additional parameters to pass to extensions constructor |
public getExtensions():array
Get all registered extensions
public getMutators():array
Get all registered mutators
public withAggregation($aggregation):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add an aggregation
Name |
Type |
Description |
|
public withSuggestion($suggestion):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a suggestion
Name |
Type |
Description |
|
public setPage($page, $itemsPerPage):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set pagination parameters.
Name |
Type |
Description |
|
||
|
public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add sorting parameters
Name |
Type |
Description |
|
The field to order by |
|
|
Direction to order results. Possible values: 'asc' or 'desc' |
public sortByMultiple($sortingList):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add multiple sorting parameters
Name |
Type |
Description |
|
List of sorting parameters. Each entry should have a 'field' and an 'order' property. |
public setOrder($idList):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set the order of the search results by ids.
Name |
Type |
Description |
|
List of variation ids. Search results will be sorted in the same order. |
public groupBy($field, $sortings = []):Plenty\Modules\Webshop\ItemSearch\Factories
VariationSearchFactory
Prepare and build search requests to query variations
Namespace
Plenty\Modules\Webshop\ItemSearch\Factories
Methods
public static default($options = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Get the default configuration of a search factory.
Name |
Type |
Description |
|
Available options <ul> <li><b>quantities</b> Quantities of the variations in the basket. This will be considered while calculating graduated prices</li> <li><b>setPriceOnly</b> Set to true to only consider prices for item sets</li> </ul> |
public setAdminPreview($isAdminPreview):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set preview mode for the search request.
Name |
Type |
Description |
|
Set to true to enable preview. |
public isActive():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter active variations
public isInactive():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter inactive variations
public hasItemId($itemId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variation by a single item id
Name |
Type |
Description |
|
Item id to filter by. |
public hasItemIds($itemIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple item ids
Name |
Type |
Description |
|
List of item ids to filter by. |
public hasVariationId($variationId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variation by a single variation id.
Name |
Type |
Description |
|
The variation id to filter by. |
public hasVariationIds($variationIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple variation ids.
Name |
Type |
Description |
|
List of variation ids to filter by. |
public hasAtLeastOneAvailability($availabilityIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
List of availability ids to filter by. |
public hasSupplier($supplierId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
The supplier id to filter by. |
public hasManufacturer($manufacturerId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter manufacturers by id.
Name |
Type |
Description |
|
To filter by manufacturer |
public hasEachProperty($propertyIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by multiple property ids.
Name |
Type |
Description |
|
The property ids to filter by. |
public isMain():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter only main variations
public isChild():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter only child variations
Return type: Factories
Filter by visibility in category list.
Name |
Type |
Description |
|
Visibility in category list to filter by. |
public isSalable():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by isSalable flag
public isVisibleForClient($clientId = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by visibility for client
Name |
Type |
Description |
|
The client id to filter by. If null, default client id from config will be used. |
public hasNameInLanguage($type = "hasAnyNameInLanguage", $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having texts in a given language.
Name |
Type |
Description |
|
The text field to filter by ('hasAny', 'hasName1', 'hasName2', 'hasName3') |
|
|
The language to filter by. If null, language defined in session will be used. |
public isInCategory($categoryId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations contained in a category.
Name |
Type |
Description |
|
A category id to filter variations by. |
public hasAtLeastOnePrice($priceIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having at least on price.
Name |
Type |
Description |
|
List of price ids to filter variations by |
public hasPriceForCustomer():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having at least one price accessible by current customer.
public hasPriceInRange($priceMin, $priceMax):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
||
|
public hasTag($tagId):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public hasAnyTag($tagIds):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public groupByTemplateConfig():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Group results depending on a config value.
public isCrossSellingItem($itemId, $relation):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations having a cross selling relation to a given item.
Name |
Type |
Description |
|
Item id to filter cross selling items for |
|
|
The relation of cross selling items. |
public hasFacets($facetValues, $clientId = null, $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by facets.
Name |
Type |
Description |
|
List of facet values. If string is given, it will be exploded by ';' |
|
|
Client id to filter facets by. If null, default client id from config will be used. |
|
|
Language to filter facets by. If null, active language from session will be used. |
public hasSearchString($query, $lang = null, $a = "", $b = ""):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by given search string.
Name |
Type |
Description |
|
The search string to filter variations by |
|
|
The language to apply search on. If null, default language from session will be used |
|
|
The item search operator should be "or" or "and" |
|
|
public hasNameString($query, $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Filter variations by searching names
Name |
Type |
Description |
|
The search string |
|
|
Language to apply search on. If null, default language from session will be used. |
public withLanguage($lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Only request given language.
Name |
Type |
Description |
|
Language to get texts for. If null, default language from session will be used. |
public withImages($clientId = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Include images in result
Name |
Type |
Description |
|
The client id to get images for. If null, default client id from config will be used. |
public withVariationAttributeMap($itemId, $initialVariationId, $afterKey = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Includes VariationAttributeMap for variation select
Name |
Type |
Description |
|
||
|
||
|
public withPropertyGroups($displaySettings = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public withOrderPropertySelectionValues():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withVariationProperties():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withUrls():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Append URLs to result.
public withPrices($quantities = [], $setPriceOnly = false):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Append prices to result.
Name |
Type |
Description |
|
||
|
public withCurrentCategory():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set result as current category
public withDefaultImage():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Append default item image if images are requested by result fields and item does not have any image
public withBundleComponents():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add bundle component variations.
public withSetComponents():void
Add set component variations to item set entries.
public withLinkToContent():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withGroupedAttributeValues():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withReducedResults():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withAvailability():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Return type: Factories
public withCategories():Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
public withSuggestions($query = "", $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
||
|
public withDidYouMeanSuggestions($query):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Name |
Type |
Description |
|
public withSalableVariationCount():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public inherit($inheritedProperties = []):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Create a new factory instance based on properties of an existing factory.
Name |
Type |
Description |
|
List of properties to inherit or null to inherit all properties. |
public withMutator($mutator, $excludeDependencies = false, $position = 1000):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a mutator to transform search results.
Name |
Type |
Description |
|
The mutator itself |
|
|
Set to true to remove required data from the results after applying the mutator. Fields will only be removed if they are not requested by the result fields of the search request. |
|
|
Position of the mutator. Mutators are executed in the order of their positions. |
public createFilter($filterClass, $params = []):void
Add a filter. Will create a new instance of the filter class if not already created.
Name |
Type |
Description |
|
||
|
public withFilter($filter):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a filter. Will override existing filter instances.
Name |
Type |
Description |
|
public withResultFields($fields):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set fields to be contained in search result.
Name |
Type |
Description |
|
Reference to a json file to load fields from or a list of field names. |
public getResultFields():array
Get the requested result fields for this search request.
public hasResultField($field):bool
Check if result field is already included in the source of the search.
Name |
Type |
Description |
|
The field to search for in result fields |
public getAdditionalResultFields():array
Get additional result fields required by webshop mutators.
public withExtension($extensionClass, $extensionParams = []):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add an extension.
Name |
Type |
Description |
|
Extension class to add. |
|
|
Additional parameters to pass to extensions constructor |
public getExtensions():array
Get all registered extensions
public getMutators():array
Get all registered mutators
public withAggregation($aggregation):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add an aggregation
Name |
Type |
Description |
|
public withSuggestion($suggestion):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add a suggestion
Name |
Type |
Description |
|
public setPage($page, $itemsPerPage):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set pagination parameters.
Name |
Type |
Description |
|
||
|
public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add sorting parameters
Name |
Type |
Description |
|
The field to order by |
|
|
Direction to order results. Possible values: 'asc' or 'desc' |
public sortByMultiple($sortingList):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Add multiple sorting parameters
Name |
Type |
Description |
|
List of sorting parameters. Each entry should have a 'field' and an 'order' property. |
public setOrder($idList):Plenty\Modules\Webshop\ItemSearch\Factories
Return type: Factories
Set the order of the search results by ids.
Name |
Type |
Description |
|
List of variation ids. Search results will be sorted in the same order. |
public groupBy($field, $sortings = []):Plenty\Modules\Webshop\ItemSearch\Factories
Helpers
FacetExtensionContainer
Container to collect facet extensions
Namespace
Plenty\Modules\Webshop\ItemSearch\Helpers
Methods
public getFacetExtensions():array
Get all registered facet extensions.
public addFacetExtension($facetExtension):void
Add an extension to provide a custom facet.
Name |
Type |
Description |
|
The extension describing the facet behavior |
ResultFieldTemplate
Collect templates to read required result fields for several views from.
Namespace
Plenty\Modules\Webshop\ItemSearch\Helpers
Methods
public static get($template):string
Get the path to result fields file from a plugin
Name |
Type |
Description |
|
The key of the template to get the path for. |
public static load($template):array
Load result fields from a template file. Result field templates can be registered from a plugin.
Name |
Type |
Description |
|
The key of the template to load file contents for. |
public setTemplate($event, $template, $overwriteExistingData = true):void
Set the path of a template to read result fields from.
Name |
Type |
Description |
|
The event to set the template for. |
|
|
Path to the template to read result fields from. |
|
|
Option to overwrite existing data |
public setTemplates($templateMap, $overwriteExistingData = true):void
Set multiple templates to read result fields from.
Name |
Type |
Description |
|
||
|
public requireFields($event, $field = null):void
Add required fields to variation search requests.
Name |
Type |
Description |
|
A single template event to set required fields for or a map between template events and list of required fields |
|
|
If first parameter describes a single template event this parameter may contain a single result field or a list of field to require. |
SortingHelper
Helper class to convert sorting configuration values into internal sorting paramters used by variation data interface.
Namespace
Plenty\Modules\Webshop\ItemSearch\Helpers
Methods
public getSorting($sortingConfig = null, $isCategory = true):array
Get sorting values from plugin configuration
Name |
Type |
Description |
|
The configuration value from the plugin. Contains a sorting field and a sorting order joined by an '_', e.g. 'item.id_asc'<br> Possible sorting fields: <ul> <li>item.id</li> <li>texts.name1</li> <li>texts.name2</li> <li>texts.name3</li> <li>variation.createdAt</li> <li>variation.updatedAt</li> <li>variation.id</li> <li>variation.number</li> <li>variation.availability.averageDays</li> <li>variation.position</li> <li>item.manufacturer.externalName</li>> <li>item.manufacturer.position</li>> <li>stock.net</li> <li>sorting.price.avg</li> <li>item.random</li> <li>item.feedbackDecimal</li> </ul> |
|
|
Get default sorting configuration for category or for search |
public getCategorySorting($sortingConfig = null):array
Get sorting values for categories from config
Name |
Type |
Description |
|
The configuration value |
public getSearchSorting($sortingConfig = null):array
Get sorting values for searches from config
Name |
Type |
Description |
|
The configuration value |
public getUsedItemName():string
Get the result field for the name to be displayed in the webshop.
public splitPathAndOrder($sorting):array
Explode configuration entries containing the field to sort by and the sorting order joined by an '_'.
Name |
Type |
Description |
|
Sorting configuration value, e.g. text.name_asc |
public mapToInnerSorting($sorting):string
Map (outer) sorting from item list to (inner) sorting to be applied on grouped variations of one item.
Name |
Type |
Description |
|
The sorting of the item list to get the inner sorting value for. |
public static isLanguageSupported($lang):bool
Name |
Type |
Description |
|
public static isLanguageActivated($lang):bool
Name |
Type |
Description |
|
public static getM10lByLanguage($lang, $fallback = "en"):string
Name |
Type |
Description |
|
||
|
public static getLanguageByM10l($lang, $fallback = "english"):string
Name |
Type |
Description |
|
||
|
VariationPropertyConverter
Service for mapping between variation order properties and old properties
Namespace
Plenty\Modules\Webshop\ItemSearch\Helpers
Methods
public convertOrderProperties($document):array
Name |
Type |
Description |
|
public convertVariationPropertyOrderItems($orderItems):void
Name |
Type |
Description |
|
SearchPresets
BasketItems
Query basket items.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>variationIds</b> Ids of basket items to get data for</li> <li><b>quantities</b> Quantity of each item to be considered when searching prices</li> <li><b>language</b> Required items to have a name configured in this language</li> </ul> |
CategoryItems
Query items for a single category
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>categoryId</b> Category id to get variations for</li> <li><b>facets</b> Active facets to filter variations by</li> <li><b>sorting</b> Configuration value from plugin config</li> <li><b>page</b> Current page</li> <li><b>itemsPerPage</b> Number of items per page</li> <li><b>priceMin</b> Minimum price of the variations</li> <li><b>priceMax</b> Maximum price of the variations</li> </ul> |
CrossSellingItems
Query cross selling items related to single item.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>itemId</b> Id of the item to get cross selling items for</li> <li><b>relation</b> The relation to consider when getting cross selling items. Default: 'Similar'</li> <li><b>sorting</b> Sorting of the returned items</li> </ul> |
Facets
Query facets for the item search of the webstore.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\FacetSearchFactory
Return type: FacetSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>facets</b> Values of active facets.</li> <li><b>categoryId</b> Category Id to filter variations by.</li> <li><b>query</b> Search string to get variations by.</li> <li><b>autocomplete</b> Flag indicating if autocomplete search should be used (boolean). Will only be used if 'query' is defined.</li> </ul> |
LiveShoppingItems
Query live shopping items.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>itemId</b> Id of an item to be queried</li> <li><b>itemIds</b> List of item ids to be queried</li> <li><b>sorting</b> Sorting of returned item</li> <li><b>resultFields</b> List of result fields to be used when querying items. Will use ResultField template for list items if not defined.</li> </ul> |
ManufacturerItems
Query items by manufacturer.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>manufacturerId</b> Id of the manufacturer to query items for.</li> <li><b>sorting</b> Sorting of items</li> <li><b>itemsPerPage</b> Number of items per page</li> <li><b>page</b> Current page of results</li> </ul> |
SearchItems
Query items from the item search of the webstore.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>query</b> The search string</li> <li><b>facets</b> Facet values of active facets</li> <li><b>sorting</b> Configuration value from plugin config</li> <li><b>page</b> The current page</li> <li><b>itemsPerPage</b> Number of items per page</li> <li><b>priceMin</b> Minimum price of the variations</li> <li><b>priceMax</b> Maximum price of the variations</li> <li><b>autocomplete</b> Flag indicating if autocompletion should be used</li> </ul> |
SearchPreset
Define a preset of search request parameters to be reused for common search requests. *
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):void
Get the search factory from the preset.
Name |
Type |
Description |
|
SearchSuggestions
Query items to display search suggestions
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>sorting</b> Sorting of items</li> <li><b>query</b> Search query to get suggestions for</li> </ul> |
SingleItem
Get item to be displayed on single item pages
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>itemId</b> Item id to get</li> <li><b>variationId</b> Variation id to get. If not defined, plugin configuration will be considered if main or child variation should be displayed.</li> <li><b>setCategory</b> Flag indicating if item should be set as current item to be displayed in breadcrumbs</li> </ul> |
TagItems
Query items by tag id.
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>tagIds</b> List of tag ids to query items by</li> <li><b>priceMin</b> Minimum price to filter items by</li> <li><b>priceMax</b> Maximum price to filter items by</li> </ul> |
VariationAttributeMap
Append list of all variations for attribute selection in item views
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options <ul> <li><b>itemId</b> Id of the to get variations and attributes for</li> <li><b>variationId</b> Id of a variation that is selected by default. Attribute values for this variation will be included on first page surely.</li> <li><b>afterKey</b> This might be provided from previous search requests to enable pagination of variation entries</li> </ul> |
VariationList
Search for variation lists
Namespace
Plenty\Modules\Webshop\ItemSearch\SearchPresets
Methods
public static getSearchFactory($options):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get preset search factory.
Name |
Type |
Description |
|
Available options: <ul> <li><b>variationIds</b> List of variations to receive</li> <li><b>sorting</b> Configuration value to get sorting for</li> <li><b>sortingField</b> Field to sort items by. Will be appended to sorting list if sorting configuration is defined.</li> <li><b>sortingOrder</b> Order to sort items with ('asc', 'desc')</li> <li><b>page</b> The current page</li> <li><b>itemsPerPage</b> Number of items per page</li> <li><b>excludeFromCache</b> Set to true if results should not be linked to response</li> </ul> |
Services
ItemSearchService
Execute item searches using the variation data interface
Namespace
Plenty\Modules\Webshop\ItemSearch\Services
Methods
public getResults($searches):array
Execute multiple item searches at once. Results will be mapped to the same keys as used in the given associative array of search factories.
Name |
Type |
Description |
|
Associative array of search factories to execute. Result of each search request will be mapped to the key defined in this array. |
public getResult($searchFactory):array
Get result of a single search request.
Name |
Type |
Description |
|
The factory to get results for. |
Order
Contracts
OrderRepositoryContract
Create orders from the webshop
Namespace
Plenty\Modules\Webshop\Order\Contracts
Methods
public placeOrder():Plenty\Modules\Order\Models\Order
Return type: Order
Generate order data from current basket and place the order.
public createReturnOrder($returnOrderData, $orderId = null):Plenty\Modules\Order\Models\Order
Seo
Contracts
RobotsRepositoryContract
Repository to read or write content of the robots.txt
Namespace
Plenty\Modules\Webshop\Seo\Contracts
Methods
public findByWebstoreId($webstoreId):Plenty\Modules\Webshop\Seo\Models\Robots
Return type: Robots
Get the content of the robots.txt for a single webstore.
Name |
Type |
Description |
|
Id of the webstore to get the robots.txt for. |
public updateByWebstoreId($webstoreId, $data):Plenty\Modules\Webshop\Seo\Models\Robots
SitemapConfigurationRepositoryContract
Repository for sitemap configuration
Namespace
Plenty\Modules\Webshop\Seo\Contracts
Methods
public findByWebstoreId($webstoreId):Plenty\Modules\Webshop\Seo\Models\SitemapConfiguration
Return type: SitemapConfiguration
Get the sitemap configuration of a single webstore.
Name |
Type |
Description |
|
Id of the webstore to get sitemap configuration for. |
public updateByWebstoreId($webstoreId, $data = []):Plenty\Modules\Webshop\Seo\Models\SitemapConfiguration
Return type: SitemapConfiguration
Update the sitemap configuration of a single webstore.
Name |
Type |
Description |
|
Id of the webstore to get sitemap configuration for. |
|
|
Sitemap configuration data |
Template
Contracts
TemplateConfigRepositoryContract
Set configuration values from the plugin to be considered in internal functions.
Namespace
Plenty\Modules\Webshop\Template\Contracts
Methods
public registerConfigValue($key, $value):Plenty\Modules\Webshop\Template\Contracts\TemplateConfigRepositoryContract
Return type: TemplateConfigRepositoryContract
Register an internal configuration. Available configuration keys are: <ul> <li><b>currency.format</b> Format to display the currency in monetary values.</li> <li><b>sort.defaultSorting</b> Default item sorting criteria</li> <li><b>sort.defaultSortingSearch</b> Default sorting criteria when searching for items</li> <li><b>sorting.prioritySearch1</b> First sorting criteria when searching for items</li> <li><b>sorting.prioritySearch2</b> Second sorting criteria when searching for items</li> <li><b>sorting.prioritySearch3</b> Third sorting criteria when searching for items</li> <li><b>sorting.priorityCategory1</b> First sorting criteria when searching for items of a category</li> <li><b>sorting.priorityCategory2</b> Second sorting criteria when searching for items of a category</li> <li><b>sorting.priorityCategory3</b> Third sorting criteria when searching for items of a category</li> <li><b>sorting.dynamicInherit</b> Set to true to adopts sorting criteria from item search options to grouping of variations</li> <li><b>sorting.dynamicPrio1</b> First sorting criteria when grouping variations in item search results</li> <li><b>sorting.dynamicPrio2</b> Second sorting criteria when grouping variations in item search results</li> <li><b>item.name</b> Set which item name should be used in the webshop.</li> <li><b>item.displayName</b> Define if the item name, the variation name or both names should be displayed in the webshop.</li> <li><b>global.enableOldUrlPattern</b> Item urls will be served with prefix "a-{itemId}" when enabled</li> <li><b>language.activeLanguages</b> List of languages that are enabled for the webshop</li> </ul>
Name |
Type |
Description |
|
Configuration key to set value for |
|
|
Configuration value to set |
Providers
TemplateServiceProvider
Service provider for template plugins
Namespace
Plenty\Modules\Webshop\Template\Providers
Methods
public overrideTemplate($original, $override):void
Override a twig template. The new template will be used when the overridden template is going to be rendered.
Name |
Type |
Description |
|
||
|
public addTemplateAlias($original, $alias):void
Add an alias for a template. Rendering the template will also check for overrides of the alias template.
Name |
Type |
Description |
|
||
|