SalesPriceService

This service class contains functions related to sales prices.
All public functions are available in the Twig template renderer.

Namespace

IO\Services

Properties
Type Name Description

``

$app

``

$salesPriceSearchRepo

ContactRepositoryContract

$contactRepository

CheckoutRepositoryContract

$checkoutRepository

``

$basketService

``

$classId

``

$singleAccess

``

$currency

``

$plentyId

``

$shippingCountryId

``

$referrerId

Methods
public __construct($app, $salesPriceSearchRepo, $contactRepository, $checkoutRepository, $basketService)

SalesPriceService constructor.

Parameters

Type

Name

Description

Application

$app

SalesPriceSearchRepositoryContract

$salesPriceSearchRepo

ContactRepositoryContract

$contactRepository

CheckoutRepositoryContract

$checkoutRepository

BasketService

$basketService

public setClassId($classId):Services

Set the contact class id used for calculations

Parameters

Type

Name

Description

int

$classId

public setCurrency($currency):Services

Set the currency used for calculations

Parameters

Type

Name

Description

string

$currency

public setShippingCountryId($shippingCountryId):Services

Set the id for the shipping country used for calculations

Parameters

Type

Name

Description

int

$shippingCountryId

public getSalesPriceForVariation($variationId, $type = "default", $quantity = 1):SalesPriceSearchResponse

Get a sales price for a specific variation

Parameters

Type

Name

Description

int

$variationId

A variation id to get sales price for

string

$type

Optional: What type of sales price to get (Default: 'default')

int

$quantity

Optional: Quantity of the variation. Used for graduated prices.

public getAllSalesPricesForVariation($variationId, $type = "default"):array

Get all sales prices of a single type for a specific variation

Parameters

Type

Name

Description

int

$variationId

The variation to find sales prices for

string

$type

The type of sales prices to find

public applyCurrencyConversion($salesPrice):SalesPriceSearchResponse

Apply currency conversions to the prices of a sales price

Parameters

Type

Name

Description

SalesPriceSearchResponse

$salesPrice

A sales price