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.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
The ID of the shipping profile |
|
|
public getCurrency():string
Get the currency of the current shopping cart.
public setCurrency($currency):void
Updates the currency. The currency must be specified.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
||
|
||
|
public convertToDefaultCurrency($currency, $amount, $exchangeRatio = 0.0):float
Converts the given value to the default currency from the given currency.
Name |
Type |
Description |
|
||
|
||
|
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.
Name |
Type |
Description |
|
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
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
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.
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.
Name |
Type |
Description |
|
public get($key):void
Name |
Type |
Description |
|
public hasGetMutator($key):bool
Determine if a get mutator exists for an attribute.
Name |
Type |
Description |
|
public setAttributes($attributes):void
Name |
Type |
Description |
|
public setAttribute($key, $value):Plenty\Repositories\Models\DataModel
Return type: DataModel
Set a given attribute on the model.
Name |
Type |
Description |
|
||
|
public hasSetMutator($key):bool
Determine if a set mutator exists for an attribute.
Name |
Type |
Description |
|
public changeValue($key, $callback):void
Name |
Type |
Description |
|
||
|
public offsetExists($offset):bool
Name |
Type |
Description |
|
public offsetGet($offset):void
Name |
Type |
Description |
|
public offsetSet($offset, $value):void
Name |
Type |
Description |
|
||
|
public offsetUnset($offset):void
Name |
Type |
Description |
|
public toArray($translate = false):array
Name |
Type |
Description |
|
Flag indicating if values should be translated. |
public toJson($options):string
Name |
Type |
Description |
|
public jsonSerialize():void
public fill($attributes):Plenty\Repositories\Models\DataModel
Return type: DataModel
Fill the model with an array of attributes.
Name |
Type |
Description |
|
public isFillable($key):bool
Determine if the given attribute may be mass assigned.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
public hasCast($key, $types = null):bool
Determine whether an attribute should be cast to a native type.
Name |
Type |
Description |
|
||
|
public fromJson($value, $asObject = false):void
Decode the given JSON back into an array or object.
Name |
Type |
Description |
|
||
|
LocaleService
frontend service for changing current language
Namespace
Plenty\Modules\Frontend\Services
OrderPropertyFileService
Frontend-service for order property files
Namespace
Plenty\Modules\Frontend\Services
Methods
public uploadFile($fileData):string
Upload an order property file.
Name |
Type |
Description |
|
public getFileURL($key):string
Get the URL for the specified key.
Name |
Type |
Description |
|
public getFile($key):Plenty\Modules\Cloud\Storage\Models\StorageObject
Return type: StorageObject
Get the file for a specified key.
Name |
Type |
Description |
|
public copyBasketFileToOrder($filename, $collectDeletingFiles = false):string
Copy the uploaded file to the order.
Name |
Type |
Description |
|
||
|
public deleteCollectedFiles():void
Delete collected files on s3 temp directory
public deleteFile($filename):void
Delete the specified file.
Name |
Type |
Description |
|
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 = ""):Plenty\Modules\Accounting\Vat\Models\Vat
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
Name |
Type |
Description |
|
The ID of the online store |
|
|
The language of the legal information text as ISO 639-1 code, e.g. e.g. en for English |
|
|
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
Name |
Type |
Description |
|
Array of data for 'plainText' and 'htmlText' |
|
|
The plenty ID of the online store |
|
|
The language of the legal information text as ISO 639-1 code, e.g. en for English |
|
|
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
Name | Type | Description |
---|---|---|
plentyId |
The unique identifier of the plenty client |
|
lang |
The language of the legal information text |
|
type |
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 |
The text value of the legal information text |
|
htmlText |
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 = "de"):array
Lists all payment methods for switch.
Name |
Type |
Description |
|
||
|
||
|
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.
Name |
Type |
Description |
|
The payment method |
|
|
The language |
public getPaymentMethodFee($paymentMethod):float
Gets additional costs for the payment method. Additional costs can be entered in the config.json.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
The payment method |
|
|
The language |
public getPaymentMethodDescription($paymentMethod, $lang):string
Gets the description of the payment method. The description can be entered in the config.json.
Name |
Type |
Description |
|
||
|
public getPaymentMethodSourceUrl($paymentMethod):string
Gets the detail link of the payment method. The detail link can be entered in the config.json.
Name |
Type |
Description |
|
public getIsSwitchableTo($paymentMethod, $orderId = null):bool
Gets the detail link of the payment method. The detail link can be entered in the config.json.
Name |
Type |
Description |
|
||
|
public getIsSwitchableFrom($paymentMethod, $orderId = null):bool
Gets the detail link of the payment method. The detail link can be entered in the config.json.
Name |
Type |
Description |
|
||
|
public getPaymentMethodIsSelectable($paymentMethod):bool
Get true if the payment method can be selected in the payment method list
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
The ID of the payment method |
|
|
The language |
public getPaymentMethodFeeById($paymentMethodId):float
Gets additional costs for the payment method by ID. The ID of the payment method must be specified.
Name |
Type |
Description |
|
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.
Name |
Type |
Description |
|
The ID of the payment method |
|
|
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.
Name |
Type |
Description |
|
The ID of the payment method |
|
|
The language |
public getPaymentMethodSwitchToById($paymentMethodId, $orderId = null):bool
Get all payment methods to which switching is allowed for the current payment method.
Name |
Type |
Description |
|
||
|
public getPaymentMethodSwitchFromById($paymentMethodId, $orderId = null):bool
Get all payment methods from which switching is allowed for the current payment method.
Name |
Type |
Description |
|
||
|
public getPaymentMethodSwitchableToById($paymentMethodId, $orderId = null):bool
Get information if switching to the payment method is allowed.
Name |
Type |
Description |
|
||
|
public getPaymentMethodSwitchableFromById($paymentMethodId, $orderId = null):bool
Get information if switching from the payment method is allowed.
Name |
Type |
Description |
|
||
|
public getAllowedPaymentMethodListForContact():void
Get all allowed payment methods for the current contact.
public getCurrentPaymentMethodById($paymentMethodId):void
Name |
Type |
Description |
|
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
Name | Type | Description |
---|---|---|
deliveryCountryId |
The ID of the country of delivery |
|
showNetPrice |
Flag that indicates if the shown price is the net price |
|
ebaySellerAccount |
The eBay seller account |
|
accountContactSign |
The reference sign specified by the contact |
|
accountContactClassId |
The ID of the contact class |
|
sourceItemWishListAccountContactId |
The ID of the contact that created the wish list |
|
sourceItemWishListAccountAddressId |
The ID of the address that created the wish list |
|
salesAgent |
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
Name | Type | Description |
---|---|---|
currency |
The currency |
|
currencyExchange |
The exchange rate for the currency |
|
language |
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
Name | Type | Description |
---|---|---|
deliveryAddressId |
The ID of the delivery address |
|
invoiceAddressId |
The ID of the invoice address |
|
parcelServiceId |
The ID of the parcel service |
|
parcelServicePresetId |
The preset ID of the parcel service |
|
methodOfPayment |
The payment method |
|
isNet |
Flag that indicates if the shown price is the net price |
|
shippingCosts |
The shipping costs |
|
calculatedWarehouseLocationId |
The calculated location id from the used warehouse for the order |
|
isClearVatCase |
Flag that indicates if the order is an clearVat case |
|
orderAmountVats |
||
promotionalCouponItems |
||
itemOrderParams |
The parameters of the order |
|
trustedShopBuyerProtection |
||
trustedShopApplicationId |
||
coupon |
The coupon code |
|
couponDisplay |
||
couponCodeValidation |
||
activePaymentMethodsList |
A list of active payment methods |
|
referrerId |
The ID of the order referrer |
|
referrerPriceColumn |
The price column for the order referrer |
|
referrerItemId |
The ID of the item referrer |
|
schedulerId |
The ID of the subscription |
|
schedulerIntervalId |
The ID of the interval of a subscription |
|
schedulerOrderExecutionId |
The ID for the execution of the order |
|
schedulerFirstDeliveryDate |
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.
Name |
Type |
Description |
|
||
|
public getValue($key):void
Gets a value for a key. The key must be specified.
Name |
Type |
Description |
|
public unsetKey($key):void
Unsets a key. The key must be specified.
Name |
Type |
Description |
|