Plentymarkets interface documentation
Category
Contracts
CategoryRepositoryContract
Get category data for plentyShop.
Namespace
Plenty\Modules\Webshop\Category\Contracts
Methods
public get($categoryId, $language = null, $webstoreId = null, $additionalFilter = [], $toObject = true):void
Return one category by id.
Name |
Type |
Description |
|
The id of the category. |
|
|
Optional language of category details, fallback is session language. |
|
|
Optional webstore id of category details, fallback is current webstore id. |
|
|
Optional Whether or not to only include categories with given filters, allowed values ['onlySitemaps' ⇒ bool] |
|
|
public getByCategoryUrl($categoryUrl, $language = null, $webstoreId = null):Plenty\Modules\Category\Models\Category
Return type: Category
Return one category by category url.
Name |
Type |
Description |
|
The url of the category. |
|
|
Optional language of category details, fallback is session language. |
|
|
Optional webstore id of category details, fallback is current webstore id. |
public getUrl($categoryId, $language = null, $webstoreId = null, $additionalFilter = []):string
Retrieve the url for a category by id.
Name |
Type |
Description |
|
The id of the category. |
|
|
Optional language of category details, fallback is session language. |
|
|
Optional webstore id of category details, fallback is current webstore id. |
|
|
Optional Whether or not to only include categories with given filters, allowed values ['onlySitemaps' ⇒ bool] |
Return navigation tree for plentyShop LTS only.
Name |
Type |
Description |
|
||
|
||
|
||
|
||
|
||
|
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:
* |
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:
- |
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.
ConfirmationRepositoryContract
Repository to validate a order confirmation
Namespace
Plenty\Modules\Webshop\Contracts
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
CountryRepositoryContract
Repository to get and set country information for the webshop
Namespace
Plenty\Modules\Webshop\Contracts
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
public getHttpReferrerUri():string
Get the url of the document call while running a rest call without query params.
ShippingRepositoryContract
Get information about shipping and parcel presets.
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public hasAnyPostOfficePreset():bool
Check if there is any parcel service preset that allows sending to post offices.
public hasAnyParcelBoxPreset():bool
Check if there is any parcel service preset that allows sending to parcel boxes.
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. |
WebspaceRepositoryContract
Get specific data from webspace objects.
Namespace
Plenty\Modules\Webshop\Contracts
Methods
public getCdnMetadata($url, $key = null, $default = null):void
Get the metadata for a file stored on plentymarkets cdn.
Name |
Type |
Description |
|
Resource URL to get metadata for. |
|
|
Metadata key to get value for (optional). |
|
|
Default value to return if no value is stored in metadata (optional). |
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 getWebstoreConfigurationByWebstoreId($webstoreId):Plenty\Modules\System\Models\WebstoreConfiguration
Return type: WebstoreConfiguration
Get the webstore configuration by webstore id
Name |
Type |
Description |
|
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
AfterBasketItemToOrderItem
Event for receiving or manupulating the order item
Namespace
Plenty\Modules\Webshop\Events
Methods
public getOrderItem():array
Get order item data generated from the basket item.
public getBasketItem():array
Get basket item data used to generate the order item from.
public getIncompleteStatus():bool
Get preview status for current event.
BeforeBasketItemToOrderItem
Event for receiving the basket item before transformed to an order item.
Namespace
Plenty\Modules\Webshop\Events
Methods
public getIncompleteStatus():bool
Get preview status for current event.
public addAdditionalVariationProperties($variationProperties = []):void
Name |
Type |
Description |
|
public getAdditionalVariationProperties():void
public getBasketItem():Plenty\Modules\Basket\Models\BasketItem
Return type: BasketItem
The shopping cart item that has changed.
ValidateVatNumber
Event to trigger validation of a vat number while creating new addresses. Failed validation will throw an exception.
Namespace
Plenty\Modules\Webshop\Events
Methods
public getVatNumber():string
Get the vat number to validate.
public getCountryId():int
Get the country id to validate.
Return fallback status for unavailable service.
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. |
PropertyFileService
Helper class for variation properties of type file.
Namespace
Plenty\Modules\Webshop\Helpers
Methods
public getPropertyFileUrl():string
Get the URL where file properties are stored
PropertyHelper
A helper class that lazyloads a property by the given property id.
Namespace
Plenty\Modules\Webshop\Helpers
Methods
public static getPropertyById($propertyId):void
Name |
Type |
Description |
|
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\UrlQuery
Return type: UrlQuery
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\UrlQuery
Return type: UrlQuery
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
Add a filter. Will override existing filter instances.
Name |
Type |
Description |
|
public withResultFields($fields):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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 getAdditionalFilterParams():void
public withAggregation($aggregation):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Add an aggregation
Name |
Type |
Description |
|
public withSuggestion($suggestion):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Add a suggestion
Name |
Type |
Description |
|
public setPage($page, $itemsPerPage):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Set pagination parameters.
Name |
Type |
Description |
|
||
|
public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
Group results by field
Name |
Type |
Description |
|
The field to group properties by. |
|
|
List of sort criteria. Might contain string |
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\FacetSearchFactory
Return type: FacetSearchFactory
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\FacetSearchFactory
Return type: FacetSearchFactory
Register extension to filter facets by minimum hit count.
public getFacetValues():array
Return selected facet values as array
public static default($options = []):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Get the default configuration of a search factory. This applies the following filters
Name |
Type |
Description |
|
Available options
- |
public setAdminPreview($isAdminPreview):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Set preview mode for the search request.
Name |
Type |
Description |
|
Set to true to enable preview. |
public isActive():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter active variations
public isInactive():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter inactive variations
public hasItemId($itemId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variation by a single item id
Name |
Type |
Description |
|
Item id to filter by. |
public hasItemIds($itemIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple item ids
Name |
Type |
Description |
|
List of item ids to filter by. |
public hasVariationId($variationId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variation by a single variation id.
Name |
Type |
Description |
|
The variation id to filter by. |
public hasVariationIds($variationIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple variation ids.
Name |
Type |
Description |
|
List of variation ids to filter by. |
public hasAtLeastOneAvailability($availabilityIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
List of availability ids to filter by. |
public hasSupplier($supplierId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
The supplier id to filter by. |
public hasManufacturer($manufacturerId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter manufacturers by id.
Name |
Type |
Description |
|
To filter by manufacturer |
public hasEachProperty($propertyIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple property ids.
Name |
Type |
Description |
|
The property ids to filter by. |
public isMain():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter only main variations
public isChild():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter only child variations
Return type: VariationSearchFactory
Filter by visibility in category list.
Name |
Type |
Description |
|
Visibility in category list to filter by. |
public isSalable():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by isSalable flag
public isVisibleForClient($clientId = null):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations contained in a category.
Name |
Type |
Description |
|
A category id to filter variations by. |
public hasAtLeastOnePrice($priceIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations having at least one price accessible by current customer.
public hasPriceInRange($priceMin, $priceMax):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
||
|
public hasTag($tagId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public hasAnyTag($tagIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public groupByTemplateConfig():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Group results depending on a config value.
public isCrossSellingItem($itemId, $relation):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Includes VariationAttributeMap for variation select
Name |
Type |
Description |
|
||
|
||
|
public withPropertyGroups($displaySettings = []):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public withOrderPropertySelectionValues():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withSortedProperties():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withVariationProperties():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withUrls():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Append URLs to result.
public withPrices($quantities = [], $setPriceOnly = false):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Append prices to result.
Name |
Type |
Description |
|
||
|
public withCurrentCategory():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Set result as current category
public withDefaultImage():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Add bundle component variations.
public withSetComponents():void
Add set component variations to item set entries.
public withLinkToContent():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withGroupedAttributeValues():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withReducedResults():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withReducedManufacturerData($manufacturerFields):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public withAvailability():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Return type: VariationSearchFactory
public withCategories():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withSuggestions($query = "", $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
||
|
public withDidYouMeanSuggestions($query):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public withSalableVariationCount():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withVariationPropertySelectionValuesMutator():void
public getMinPrice():float
Return given min price
public getMaxPrice():float
Return given max price
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
Add a filter. Will override existing filter instances.
Name |
Type |
Description |
|
public withResultFields($fields):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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 getAdditionalFilterParams():void
public withAggregation($aggregation):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Add an aggregation
Name |
Type |
Description |
|
public withSuggestion($suggestion):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Add a suggestion
Name |
Type |
Description |
|
public setPage($page, $itemsPerPage):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Set pagination parameters.
Name |
Type |
Description |
|
||
|
public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
Group results by field
Name |
Type |
Description |
|
The field to group properties by. |
|
|
List of sort criteria. Might contain string |
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\VariationSearchFactory
Return type: VariationSearchFactory
Get the default configuration of a search factory. This applies the following filters
Name |
Type |
Description |
|
Available options
- |
public setAdminPreview($isAdminPreview):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Set preview mode for the search request.
Name |
Type |
Description |
|
Set to true to enable preview. |
public isActive():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter active variations
public isInactive():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter inactive variations
public hasItemId($itemId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variation by a single item id
Name |
Type |
Description |
|
Item id to filter by. |
public hasItemIds($itemIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple item ids
Name |
Type |
Description |
|
List of item ids to filter by. |
public hasVariationId($variationId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variation by a single variation id.
Name |
Type |
Description |
|
The variation id to filter by. |
public hasVariationIds($variationIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple variation ids.
Name |
Type |
Description |
|
List of variation ids to filter by. |
public hasAtLeastOneAvailability($availabilityIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
List of availability ids to filter by. |
public hasSupplier($supplierId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple availability ids.
Name |
Type |
Description |
|
The supplier id to filter by. |
public hasManufacturer($manufacturerId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter manufacturers by id.
Name |
Type |
Description |
|
To filter by manufacturer |
public hasEachProperty($propertyIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by multiple property ids.
Name |
Type |
Description |
|
The property ids to filter by. |
public isMain():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter only main variations
public isChild():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter only child variations
Return type: VariationSearchFactory
Filter by visibility in category list.
Name |
Type |
Description |
|
Visibility in category list to filter by. |
public isSalable():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations by isSalable flag
public isVisibleForClient($clientId = null):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations contained in a category.
Name |
Type |
Description |
|
A category id to filter variations by. |
public hasAtLeastOnePrice($priceIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Filter variations having at least one price accessible by current customer.
public hasPriceInRange($priceMin, $priceMax):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
||
|
public hasTag($tagId):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public hasAnyTag($tagIds):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public groupByTemplateConfig():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Group results depending on a config value.
public isCrossSellingItem($itemId, $relation):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Includes VariationAttributeMap for variation select
Name |
Type |
Description |
|
||
|
||
|
public withPropertyGroups($displaySettings = []):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public withOrderPropertySelectionValues():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withSortedProperties():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withVariationProperties():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withUrls():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Append URLs to result.
public withPrices($quantities = [], $setPriceOnly = false):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Append prices to result.
Name |
Type |
Description |
|
||
|
public withCurrentCategory():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Set result as current category
public withDefaultImage():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
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\VariationSearchFactory
Return type: VariationSearchFactory
Add bundle component variations.
public withSetComponents():void
Add set component variations to item set entries.
public withLinkToContent():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withGroupedAttributeValues():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withReducedResults():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withReducedManufacturerData($manufacturerFields):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public withAvailability():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Return type: VariationSearchFactory
public withCategories():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withSuggestions($query = "", $lang = null):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
||
|
public withDidYouMeanSuggestions($query):Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
Name |
Type |
Description |
|
public withSalableVariationCount():Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory
Return type: VariationSearchFactory
public withVariationPropertySelectionValuesMutator():void
public getMinPrice():float
Return given min price
public getMaxPrice():float
Return given max price
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
Add a filter. Will override existing filter instances.
Name |
Type |
Description |
|
public withResultFields($fields):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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 getAdditionalFilterParams():void
public withAggregation($aggregation):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Add an aggregation
Name |
Type |
Description |
|
public withSuggestion($suggestion):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Add a suggestion
Name |
Type |
Description |
|
public setPage($page, $itemsPerPage):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
Set pagination parameters.
Name |
Type |
Description |
|
||
|
public sortBy($field, $order = \Plenty\Modules\Webshop\ItemSearch\Factories\VariationSearchFactory::SORTING_ORDER_DESC):Plenty\Modules\Webshop\ItemSearch\Factories\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
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\BaseSearchFactory
Return type: BaseSearchFactory
Group results by field
Name |
Type |
Description |
|
The field to group properties by. |
|
|
List of sort criteria. Might contain string |
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: - item.id - texts.name1 - texts.name2 - texts.name3 - variation.createdAt - variation.updatedAt - variation.id - variation.number - variation.availability.averageDays - variation.position - item.manufacturer.externalName< - item.manufacturer.position< - stock.net - sorting.price.avg - item.random - item.feedbackDecimal |
|
|
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 |
|
||
|
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: - variationIds Ids of basket items to get data for - quantities Quantity of each item to be considered when searching prices - language Required items to have a name configured in this language |
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: - categoryId Category id to get variations for - facets Active facets to filter variations by - sorting Configuration value from plugin config - page Current page - itemsPerPage Number of items per page - priceMin Minimum price of the variations - priceMax Maximum price of the variations |
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: - itemId Id of the item to get cross selling items for - relation The relation to consider when getting cross selling items. Default: 'Similar' - sorting Sorting of the returned items |
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: - facets Values of active facets. - categoryId Category Id to filter variations by. - query Search string to get variations by. - autocomplete Flag indicating if autocomplete search should be used (boolean). Will only be used if 'query' is defined. |
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: - itemId Id of an item to be queried - itemIds List of item ids to be queried - sorting Sorting of returned item - resultFields List of result fields to be used when querying items. Will use ResultField template for list items if not defined. |
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: - manufacturerId Id of the manufacturer to query items for - sorting Sorting of items - itemsPerPage Number of items per page - page Current page of results |
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: - query The search string - facets Facet values of active facets - sorting Configuration value from plugin config - page The current page - itemsPerPage Number of items per page - priceMin Minimum price of the variations - priceMax Maximum price of the variations - autocomplete Flag indicating if autocompletion should be used |
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: - sorting Sorting of items - query Search query to get suggestions for |
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: - itemId Item id to get - variationId Variation id to get. If not defined, plugin configuration will be considered - setCategory Flag indicating if item should be set as current item to be displayed in breadcrumbs |
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: - tagIds List of tag ids to query items by - priceMin Minimum price to filter items by - priceMax Maximum price to filter items by |
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 - itemId Id of the to get variations and attributes for - variationId Id of a variation that is selected by default. Attribute values for this variation will be included on first page surely. - afterKey This might be provided from previous search requests to enable pagination of variation entries |
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: - variationIds List of variations to receive - sorting Configuration value to get sorting for - sortingField Field to sort items by. Will be appended to sorting list if sorting configuration is defined. - sortingOrder Order to sort items with ('asc', 'desc') - page The current page - itemsPerPage Number of items per page - excludeFromCache Set to true if results should not be linked to response |
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.
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. |
public getResultsWithDownloadLinkForProperties($results):void
Generates an image url for every existent variation property which is passed within $results param.
Name |
Type |
Description |
|
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
Return type: Order
Create a return order for some items of an existing order.
Name |
Type |
Description |
|
Data to create the return order with. |
|
|
Id of the original order |
public switchPaymentMethodForOrder($orderId, $paymentMethodId, $accessKey = ""):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 |
Stock
Contracts
StockReservationRepositoryContract
Repository to get and set contact information for the webshop
Namespace
Plenty\Modules\Webshop\Stock\Contracts
Methods
public reserveBasket():void
Reserves stock for all items in the cart.
public unreserveBasket():void
Unreserve all stock reservations for the basket of the current customer session.
Storefront
Models
ItemWishlist
The item wishlist model.
Namespace
Plenty\Modules\Webshop\Storefront\Models
Name | Type | Description |
---|---|---|
id |
The ID of the wishlist |
|
variationId |
The ID of the variation |
|
contactId |
The ID of the contact |
|
plentyId |
The actual PlentyID |
|
createdAt |
The date when the item wishlist was created |
|
updatedAt |
The date when the item wishlist was updated |
Methods
public toArray()
Returns this model as an array.
Template
Contracts
AssetRepositoryContract
Register required assets for the frontend.
Namespace
Plenty\Modules\Webshop\Template\Contracts
Methods
public addAsset($path, $as = "", $rel = "preload", $additionalParams = []):void
Add a path to an asset that should be pushed to the client using HTTP2 server push
Name |
Type |
Description |
|
The path to the asset to be pushed. |
|
|
The type to be used for the "as"-attribute. If not set, is is determined based on the file extension. |
|
|
The rel attribute to be used. |
|
|
array for additional information ['type', 'crossorigin ⇒ true', 'position'] default position is 1000. |
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.
Name |
Type |
Description |
|
Configuration key to set value for. Available configuration keys are:
|
|
|
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 |
|
||
|