Plentymarkets interface documentation

Frontend

Contracts

Checkout

The CheckoutContract is the interface for the checkout repository. This interface allows to set the shipping country ID, the payment method ID, the shipping profile ID and the currency in the checkout.

Namespace

Plenty\Modules\Frontend\Contracts

Methods
public getShippingCountryId():int

Gets the shipping country ID.

public setShippingCountryId($shippingCountryId):void

Updates the ID of the shipping country. The ID must be specified.

Parameters

Name

Type

Description

$shippingCountryId

int

The ID of the shipping country

public getPaymentMethodId():int

Gets the payment method id of the current shopping cart.

public setPaymentMethodId($paymentMethodId):void

Updates the ID of the payment method. The ID must be specified.

Parameters

Name

Type

Description

$paymentMethodId

int

The ID of the payment method

public getShippingProfileId():int

Gets the shipping profile id of the current shopping cart.

public setShippingProfileId($shippingProfileId, $force = false):void

Updates the ID of the shipping profile. The ID must be specified.

Parameters

Name

Type

Description

$shippingProfileId

int

The ID of the shipping profile

$force

bool

public getCurrency():string

Get the currency of the current shopping cart.

public setCurrency($currency):void

Updates the currency. The currency must be specified.

Parameters

Name

Type

Description

$currency

string

The currency

public getBasketReferrerId():float

Get the referrer ID from the current shopping cart.

public setBasketReferrerId($referrerId):void

Updates the ID of the order referrer. The ID must be specified.

Parameters

Name

Type

Description

$referrerId

int

The ID of the order referrer. The <a href="https://www.plentymarkets.co.uk/manual/settings/orders/order-referrer/" target="_blank">order referrer</a> settings can be changed in the plentymarkets back end.

public getCustomerInvoiceAddressId():int

Gets the invoice address id of the current shopping cart.

public setCustomerInvoiceAddressId($invoiceAddressId):void

Sets the invoice address id for the current shopping cart.

Parameters

Name

Type

Description

$invoiceAddressId

int

public getCustomerShippingAddressId():int

Gets the shipping address id of the current shopping cart.

public setCustomerShippingAddressId($shippingAddressId):void

Sets the shipping address id for the current shopping cart.

Parameters

Name

Type

Description

$shippingAddressId

int

public validateCheckout():Plenty\Modules\Frontend\Events\ValidateCheckoutEvent
Return type: ValidateCheckoutEvent

Validate all data of the checkout

CurrencyExchangeRepositoryContract

The CurrencyExchangeRatioRepositoryContract is the interface for the currency exchange repository. This interface allows you to get the default system currency, to get exchange ratios for every currency and to convert an amount from the default currency into a given currency or from a given currency into the default currency.

Namespace

Plenty\Modules\Frontend\Contracts

Methods
public getExchangeRatioByCurrency($currency):float

Get the exchange rate for the given currency

Parameters

Name

Type

Description

$currency

string

public getDefaultCurrency():string

Get the default currency.

public convertFromDefaultCurrency($currency, $amount, $exchangeRatio = 0.0):float

Converts the given value from the default currency to the given currency.

Parameters

Name

Type

Description

$currency

string

$amount

float

$exchangeRatio

float

public convertToDefaultCurrency($currency, $amount, $exchangeRatio = 0.0):float

Converts the given value to the default currency from the given currency.

Parameters

Name

Type

Description

$currency

string

$amount

float

$exchangeRatio

float

Events

FrontendCurrencyChanged

The event is triggered when the currency is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getCurrency():string

Gets the changed currency.

public getCurrencyExchangeRatio():float

Gets the exchange rate used for converting the currency.

FrontendCustomerAddressChanged

The event is triggered when a customer address is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

FrontendLanguageChanged

The event is triggered when the language is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getLanguage():string

Gets the language of the online store.

public isDetectedByBrowserLanguage():bool

Get the flag for detection by browser language.

FrontendPaymentMethodChanged

The event is triggered when the payment method is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getPaymentMethodId():void

Gets the ID of the payment method.

public setPaymentMethodId($paymentMethodId):void

Updates the ID of the payment method. The ID must be specified.

Parameters

Name

Type

Description

$paymentMethodId

FrontendReferrerChanged

The event is triggered when the referrer id is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getReferrerId():void

Get the ID of the changed referrer

public setReferrerId($referrerId):Plenty\Modules\Frontend\Events\FrontendReferrerChanged
Return type: FrontendReferrerChanged

Set the ID of the changed referrer

Parameters

Name

Type

Description

$referrerId

FrontendShippingCountryChanged

The event is triggered when the shipping country is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getShippingCountryId():int

Gets the ID of the shipping country.

public setShippingCountryId($shippingCountryId):Plenty\Modules\Frontend\Events\FrontendShippingCountryChanged
Return type: FrontendShippingCountryChanged

Updates the ID of the shipping country. The ID must be specified.

Parameters

Name

Type

Description

$shippingCountryId

int

The ID of the shipping country

FrontendShippingProfileChanged

The event is triggered when the shipping profile is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getShippingProfileId():void

Gets the ID of the shipping profile.

public setShippingProfileId($shippingProfileId):void

Updates the ID of the shipping profile. The ID must be specified.

Parameters

Name

Type

Description

$shippingProfileId

FrontendUpdateDeliveryAddress

The event is triggered when the delivery address is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getAccountAddressId():int

Gets the ID of the address saved for the account.

FrontendUpdateInvoiceAddress

The event is triggered when the invoice address is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getAccountAddressId():int

Gets the ID of the address saved for the account.

FrontendUpdatePaymentSettings

The event is triggered when the payment method is changed in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getPaymentMethodId():int

Gets the ID of the payment method.

FrontendUpdateShippingSettings

The event is triggered when the shipping method is updated in the online store.

Namespace

Plenty\Modules\Frontend\Events

Methods
public getShippingCosts():float

Gets the shipping costs.

public getParcelServiceId():int

Gets the ID of the shipping service provider.

public getParcelServicePresetId():int

Gets the preset ID of the shipping service provider.

ValidateCheckoutEvent

Event to validate the complete checkout

Namespace

Plenty\Modules\Frontend\Events

Methods
public getErrorKeysList():array

Get a list of error keys.

public addErrorKey($errorKey):Plenty\Modules\Frontend\Events\ValidateCheckoutEvent
Return type: ValidateCheckoutEvent

Add an error key to the list.

Parameters

Name

Type

Description

$errorKey

string

Factories

FrontendFactory

Factory to get information regarding the frontend

Namespace

Plenty\Modules\Frontend\Factories

Methods
public getLocale():Plenty\Modules\Frontend\Services\LocaleService
Return type: LocaleService

Get the locale service.

public getAgent():Plenty\Modules\Frontend\Services\AgentService
Return type: AgentService

Get the agent service.

public getSystem():Plenty\Modules\Frontend\Services\SystemService
Return type: SystemService

Get the system service.

public getAccount():Plenty\Modules\Frontend\Services\AccountService
Return type: AccountService

Get the account service.

public getFile():Plenty\Modules\Frontend\Services\FileService
Return type: FileService

Get the file service.

Models

TotalVat

frontend total vat model

Namespace

Plenty\Modules\Frontend\Models

Properties
Name Type Description

vatId

int

vatAmount

float

vatValue

float

Methods
public toArray()

Returns this model as an array.

Services

AccountService

Frontend-service for customer information

Namespace

Plenty\Modules\Frontend\Services

Methods
public getIsAccountLoggedIn():bool

Get the information if an account is currently logged in.

public getAccountContactId():int

Get the ID of the currently logged in account.

AgentService

Frontend-Service for agent information

Namespace

Plenty\Modules\Frontend\Services

Methods
public getLanguages():array

Get the current language.

public getBrowser():string

Get the current browser.

public getPlatform():string

Get the current platform.

public getDevice():string

Get the current device.

public getIsDesktop():bool

Get information if the device is a desktop.

public getRobotName():string

Get the name of the robot.

public getIsRobot():bool

Get information if the visitor is a robot.

public getHttpHeaders():array

Get the http headers of the agent.

public getIsMobile():bool

Get the information if the device is mobile.

public getIsTablet():bool

Get the information if the device is a tablet.

FileService

Frontend-service for file information

Namespace

Plenty\Modules\Frontend\Services

Methods
public addJsFile($jsFile):void

Add a js file to the list.

Parameters

Name

Type

Description

$jsFile

string

public get($key):void
Parameters

Name

Type

Description

$key

string

public hasGetMutator($key):bool

Determine if a get mutator exists for an attribute.

Parameters

Name

Type

Description

$key

string

public setAttributes($attributes):void
Parameters

Name

Type

Description

$attributes

public setAttribute($key, $value):Plenty\Repositories\Models\DataModel
Return type: DataModel

Set a given attribute on the model.

Parameters

Name

Type

Description

$key

string

$value

public hasSetMutator($key):bool

Determine if a set mutator exists for an attribute.

Parameters

Name

Type

Description

$key

string

public changeValue($key, $callback):void
Parameters

Name

Type

Description

$key

string

$callback

callable

public offsetExists($offset):bool
Parameters

Name

Type

Description

$offset

public offsetGet($offset):void
Parameters

Name

Type

Description

$offset

public offsetSet($offset, $value):void
Parameters

Name

Type

Description

$offset

$value

public offsetUnset($offset):void
Parameters

Name

Type

Description

$offset

public toArray($translate = false):array
Parameters

Name

Type

Description

$translate

bool

Flag indicating if values should be translated.

public toJson($options):string
Parameters

Name

Type

Description

$options

int

public jsonSerialize():void
public fill($attributes):Plenty\Repositories\Models\DataModel
Return type: DataModel

Fill the model with an array of attributes.

Parameters

Name

Type

Description

$attributes

array

public isFillable($key):bool

Determine if the given attribute may be mass assigned.

Parameters

Name

Type

Description

$key

string

public getFillable():array

Get the fillable attributes for the model.

public fillable($fillable):Plenty\Repositories\Models\DataModel
Return type: DataModel

Set the fillable attributes for the model.

Parameters

Name

Type

Description

$fillable

array

public hasCast($key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters

Name

Type

Description

$key

string

$types

public fromJson($value, $asObject = false):void

Decode the given JSON back into an array or object.

Parameters

Name

Type

Description

$value

string

$asObject

bool

LocaleService

frontend service for changing current language

Namespace

Plenty\Modules\Frontend\Services

Methods
public setLanguage($newLanguage, $fireEvents = true):void

Set the current language of the shop.

Parameters

Name

Type

Description

$newLanguage

string

$fireEvents

bool

OrderPropertyFileService

Frontend-service for order property files

Namespace

Plenty\Modules\Frontend\Services

Methods
public uploadFile($fileData):string

Upload an order property file.

Parameters

Name

Type

Description

$fileData

array

public getFileURL($key):string

Get the URL for the specified key.

Parameters

Name

Type

Description

$key

string

public getFile($key):Plenty\Modules\Cloud\Storage\Models\StorageObject
Return type: StorageObject

Get the file for a specified key.

Parameters

Name

Type

Description

$key

string

public copyBasketFileToOrder($filename, $collectDeletingFiles = false):string

Copy the uploaded file to the order.

Parameters

Name

Type

Description

$filename

string

$collectDeletingFiles

string

public deleteCollectedFiles():void

Delete collected files on s3 temp directory

public deleteFile($filename):void

Delete the specified file.

Parameters

Name

Type

Description

$filename

string

SystemService

Frontend-service for system information

Namespace

Plenty\Modules\Frontend\Services

Methods
public getPlentyId():int

Get the plenty ID of the current client.

public getWebstoreId():int

get the webstore ID of the current client.

VatService

Frontend-service for vat information

Namespace

Plenty\Modules\Frontend\Services

Methods
public getCountryVatId():int

Get the VAT ID of the specified country.

public getCurrentTotalVats():array

Get the current total VAT.

public getVat($taxIdNumber = &quot;&quot;):Plenty\Modules\Accounting\Vat\Models\Vat
Return type: Vat

Get VAT for the specified tax ID number

Parameters

Name

Type

Description

$taxIdNumber

string

public getLocationId($countryId = null):int

Get the ID of the location.

Parameters

Name

Type

Description

$countryId

int

LegalInformation

Contracts

LegalInformationRepositoryContract

Repository contract for LegalInformation model.

Namespace

Plenty\Modules\Frontend\LegalInformation\Contracts

Methods
public find($plentyId, $lang, $type):Plenty\Modules\Frontend\LegalInformation\Models\LegalInformation
Return type: LegalInformation

Get legal information of an online store

Parameters

Name

Type

Description

$plentyId

int

The ID of the online store

$lang

string

The language of the legal information text as ISO 639-1 code, e.g. e.g. en for English

$type

string

The type of the legal information text. The types available are: <ul> <li>TermsConditions</li> <li>CancellationRights</li> <li>PrivacyPolicy</li> <li>LegalDisclosure</li> <li>WithdrawalForm</li> </ul>

public save($data, $plentyId, $lang, $type):Plenty\Modules\Frontend\LegalInformation\Models\LegalInformation
Return type: LegalInformation

Save legal information for an online store

Parameters

Name

Type

Description

$data

array

Array of data for 'plainText' and 'htmlText'

$plentyId

int

The plenty ID of the online store

$lang

string

The language of the legal information text as ISO 639-1 code, e.g. en for English

$type

string

The type of the legal information text. The types available are: <ul> <li>TermsConditions</li> <li>CancellationRights</li> <li>PrivacyPolicy</li> <li>LegalDisclosure</li> <li>WithdrawalForm</li> </ul>

Models

LegalInformation

The legal information model.

Namespace

Plenty\Modules\Frontend\LegalInformation\Models

Properties
Name Type Description

plentyId

int

The unique identifier of the plenty client

lang

string

The language of the legal information text

type

string

The type of the legal information text. The types available are: <ul> <li>TermsConditions</li> <li>CancellationRights</li> <li>PrivacyPolicy</li> <li>LegalDisclosure</li> <li>WithdrawalForm</li> </ul>

plainText

string

The text value of the legal information text

htmlText

string

The html value of the legal information text

Methods
public toArray()

Returns this model as an array.

PaymentMethod

Contracts

FrontendPaymentMethodRepositoryContract

The FrontendPaymentMethodRepositoryContract is the interface for the front end payment method repository. Get the payment method information to be displayed in the online store.

Namespace

Plenty\Modules\Frontend\PaymentMethod\Contracts

Methods
public getCurrentPaymentMethodsList():array

Lists all payment methods of the current customer session.

public getCurrentPaymentMethodsListForSwitch($currentPaymentMethodId, $orderId = null, $lang = &quot;de&quot;):array

Lists all payment methods for switch.

Parameters

Name

Type

Description

$currentPaymentMethodId

int

$orderId

int

$lang

string

public getCurrentPaymentMethodsForExpressCheckout():array

Lists all payment methods if express checkout is available

public getPaymentMethodName($paymentMethod, $lang):string

Gets the name of the payment method in the specified language.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

The payment method

$lang

string

The language

public getPaymentMethodFee($paymentMethod):float

Gets additional costs for the payment method. Additional costs can be entered in the config.json.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

The payment method

public getPaymentMethodIcon($paymentMethod, $lang):string

Gets the icon of the payment method. The path of the icon can be entered in the config.json.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

The payment method

$lang

string

The language

public getPaymentMethodDescription($paymentMethod, $lang):string

Gets the description of the payment method. The description can be entered in the config.json.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

$lang

string

public getPaymentMethodSourceUrl($paymentMethod):string

Gets the detail link of the payment method. The detail link can be entered in the config.json.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

public getIsSwitchableTo($paymentMethod, $orderId = null):bool

Gets the detail link of the payment method. The detail link can be entered in the config.json.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

$orderId

int

public getIsSwitchableFrom($paymentMethod, $orderId = null):bool

Gets the detail link of the payment method. The detail link can be entered in the config.json.

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

$orderId

int

public getPaymentMethodIsSelectable($paymentMethod):bool

Get true if the payment method can be selected in the payment method list

Parameters

Name

Type

Description

$paymentMethod

PaymentMethod

public getPaymentMethodNameById($paymentMethodId, $lang):string

Gets the name of the payment method by ID and language. The ID of the payment method and the language must be specified.

Parameters

Name

Type

Description

$paymentMethodId

int

The ID of the payment method

$lang

string

The language

public getPaymentMethodFeeById($paymentMethodId):float

Gets additional costs for the payment method by ID. The ID of the payment method must be specified.

Parameters

Name

Type

Description

$paymentMethodId

int

The ID of the payment method

public getPaymentMethodIconById($paymentMethodId, $lang):string

Gets the icon of the payment method by ID and language. The ID of the payment method and the language must be specified.

Parameters

Name

Type

Description

$paymentMethodId

int

The ID of the payment method

$lang

string

The language

public getPaymentMethodDescriptionById($paymentMethodId, $lang):string

Gets the description of the payment method by ID and language. The ID of the payment method and the language must be specified.

Parameters

Name

Type

Description

$paymentMethodId

int

The ID of the payment method

$lang

string

The language

public getPaymentMethodSwitchToById($paymentMethodId, $orderId = null):bool

Get all payment methods to which switching is allowed for the current payment method.

Parameters

Name

Type

Description

$paymentMethodId

int

$orderId

int

public getPaymentMethodSwitchFromById($paymentMethodId, $orderId = null):bool

Get all payment methods from which switching is allowed for the current payment method.

Parameters

Name

Type

Description

$paymentMethodId

int

$orderId

int

public getPaymentMethodSwitchableToById($paymentMethodId, $orderId = null):bool

Get information if switching to the payment method is allowed.

Parameters

Name

Type

Description

$paymentMethodId

int

$orderId

int

public getPaymentMethodSwitchableFromById($paymentMethodId, $orderId = null):bool

Get information if switching from the payment method is allowed.

Parameters

Name

Type

Description

$paymentMethodId

int

$orderId

int

public getAllowedPaymentMethodListForContact():void

Get all allowed payment methods for the current contact.

public getCurrentPaymentMethodById($paymentMethodId):void
Parameters

Name

Type

Description

$paymentMethodId

int

Session

Events

AfterSessionCreate

The event is triggered after a session is created.

Namespace

Plenty\Modules\Frontend\Session\Events

Storage

Contracts

FrontendSessionStorageFactoryContract

The FrontendSessionStorageFactoryContract is the interface for the front end session storage repository. This interface allows to get information about the locale, the customer, the order, the plugin and the forum from the session.

Namespace

Plenty\Modules\Frontend\Session\Storage\Contracts

Methods
public getLocaleSettings():Plenty\Modules\Frontend\Session\Storage\Models\LocaleSettings
Return type: LocaleSettings

Get the locale settings from the session storage.

public getCustomer():Plenty\Modules\Frontend\Session\Storage\Models\Customer
Return type: Customer

Get the customer data from the session storage.

public getOrder():Plenty\Modules\Frontend\Session\Storage\Models\Order
Return type: Order

Get the order data from the session storage.

public getPlugin():Plenty\Modules\Frontend\Session\Storage\Models\Plugin
Return type: Plugin

Get the plugin data from the session storage.

Models

Customer

The session storage model for customer data.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties
Name Type Description

deliveryCountryId

int

The ID of the country of delivery

showNetPrice

bool

Flag that indicates if the shown price is the net price

ebaySellerAccount

string

The eBay seller account

accountContactSign

string

The reference sign specified by the contact

accountContactClassId

int

The ID of the contact class

sourceItemWishListAccountContactId

int

The ID of the contact that created the wish list

sourceItemWishListAccountAddressId

int

The ID of the address that created the wish list

salesAgent

string

The sales representative

Methods
public toArray()

Returns this model as an array.

Forum

The session storage model for forum data.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Methods
public toArray()

Returns this model as an array.

LocaleSettings

The session storage model for locale settings.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties
Name Type Description

currency

string

The currency

currencyExchange

float

The exchange rate for the currency

language

string

The language

Methods
public toArray()

Returns this model as an array.

Order

The session storage model for order data.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Properties
Name Type Description

deliveryAddressId

int

The ID of the delivery address

invoiceAddressId

int

The ID of the invoice address

parcelServiceId

int

The ID of the parcel service

parcelServicePresetId

int

The preset ID of the parcel service

methodOfPayment

int

The payment method

isNet

bool

Flag that indicates if the shown price is the net price

shippingCosts

int

The shipping costs

calculatedWarehouseLocationId

int

The calculated location id from the used warehouse for the order

isClearVatCase

bool

Flag that indicates if the order is an clearVat case

orderAmountVats

array

promotionalCouponItems

array

itemOrderParams

array

The parameters of the order

trustedShopBuyerProtection

array

trustedShopApplicationId

string

coupon

string

The coupon code

couponDisplay

string

couponCodeValidation

CouponCodeValidation

activePaymentMethodsList

array

A list of active payment methods

referrerId

int

The ID of the order referrer

referrerPriceColumn

int

The price column for the order referrer

referrerItemId

int

The ID of the item referrer

schedulerId

int

The ID of the subscription

schedulerIntervalId

int

The ID of the interval of a subscription

schedulerOrderExecutionId

int

The ID for the execution of the order

schedulerFirstDeliveryDate

int

The date for the first delivery of a subscription

Methods
public toArray()

Returns this model as an array.

Plugin

The session storage model for plugins.

Namespace

Plenty\Modules\Frontend\Session\Storage\Models

Methods
public setValue($key, $value):void

Updates the value of a key. The key and the new value must be specified.

Parameters

Name

Type

Description

$key

string

$value

public getValue($key):void

Gets a value for a key. The key must be specified.

Parameters

Name

Type

Description

$key

string

public unsetKey($key):void

Unsets a key. The key must be specified.

Parameters

Name

Type

Description

$key

string