BasketViewHelper
extends ViewHelper
in package
This is the BasketViewHelper class.
The purpose of this class is to facilitate to Twig the generation of the basket's view output (providing some useful methods).
This class extends ViewHelper, see this class.
Tags
Table of Contents
$languageSheet | : Language|null | |
---|---|---|
$session | : Session|null | |
$theme | : Theme|null | |
__construct() | : mixed | |
asyncOrderMacro() | This method merges the given arguments, calculates and returns the view parameters for the async order. | : array<string|int, mixed> |
basketContentMacro() | This method merges the given arguments and calculates and returns the view parameters for the output. | : array<string|int, mixed> |
basketFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the form. | : array<string|int, mixed> |
buttonsMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttons. | : array<string|int, mixed> |
commentMacro() | This method merges the given arguments, calculates and returns the view parameters for the comment. | : array<string|int, mixed> |
customTagsMacro() | This method merges the given arguments, calculates and returns the view parameters for the customTags. | : array<string|int, mixed> |
deleteDiscountCodesMacro() | This method merges the given arguments, calculates and returns the view parameters for the deleteDiscountCodes. | : array<string|int, mixed> |
deliveriesMacro() | This method merges the given arguments, calculates and returns the view parameters for the deliveries. | : array<string|int, mixed> |
deniedOrderMessageMacro() | This method merges the given arguments, calculates and returns the view parameters for the deniedOrderMessage. | : array<string|int, mixed> |
endOrderMacro() | This method merges the given arguments, calculates and returns the view parameters for the end order. | : array<string|int, mixed> |
getApplicationTaxesIncluded() | This method returns the setting of 'show taxes included'. | : bool |
groupBasketWarnings() | This method groups BasketWarning array into BasketWarningSeverity groups, and returns an array with these keys, each one containing the corresponding warnings: <ul> <li>BasketWarningSeverity::ERROR</li> <li>BasketWarningSeverity::WARNING</li> <li>BasketWarningSeverity::INFO</li> </ul> | : array<string|int, mixed> |
mergeArguments() | This method merges macro arguments with macro associated class properties by reference. | : void |
miniBasketContentMacro() | This method merges the given arguments, calculates and returns the view parameters for the miniBasketOutput. | : array<string|int, mixed> |
miniBasketWrapMacro() | This method merges the given arguments, calculates and returns the view parameters for the miniBasketWrap. | : array<string|int, mixed> |
oscFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the OSC form. | : array<string|int, mixed> |
oscModuleMacro() | This method merges the given arguments, calculates and returns the view parameters for the OSC module. | : array<string|int, mixed> |
paymentSystemsMacro() | This method merges the given arguments, calculates and returns the view parameters for the paymentSystems. | : array<string|int, mixed> |
redeemRewardPointsMacro() | This method merges the given arguments, calculates and returns the view parameters for the redeemRewardPoints. | : array<string|int, mixed> |
rewardPointsMacro() | This method merges the given arguments, calculates and returns the view parameters for the rewardPoints. | : array<string|int, mixed> |
setBasketWarningMessage() | This method adds to BasketWarning object a formatted output message from languageSheet, and replace wildcards. | : BasketWarning |
stepsMacro() | This method merges the given arguments, calculates and returns the view parameters for the steps. | : array<string|int, mixed> |
voucherFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the voucherForm. | : array<string|int, mixed> |
Properties
$languageSheet
protected
Language|null
$languageSheet
= null
$session
protected
Session|null
$session
= null
$theme
protected
Theme|null
$theme
= null
Methods
__construct()
public
__construct(Language $languageSheet, Theme $theme, Session|null $session) : mixed
Parameters
Return values
mixed —asyncOrderMacro()
This method merges the given arguments, calculates and returns the view parameters for the async order.
public
asyncOrderMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- validationResponse
- postParameters
- getParameters
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —basketContentMacro()
This method merges the given arguments and calculates and returns the view parameters for the output.
public
basketContentMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- mode
- editable
- editableGifts
- linkable
- showOptionValuesName
- showOptionValuesSku
- showDiscountValue
- showZeroDiscount
- giftsPresentation
- showTaxDisclosure
- showTaxName
- showTaxIncluded
- quantityPlugin
- tableClass
- showWarningsBlock
- errorWarningPosition
- warningWarningPosition
- infoWarningPosition
- warningsBlockItems
- showPrices
- showImage
- showSku
- showManufacturerSku
- showOffsets
- showShippingSection
- showCustomTags
- showCustomTagPositions
- showDiscounts
- showDiscountName
- showZeroShipping
- showZeroPayment
- showFreeTaxMessage
- showPreviousPrice
- showPercentDifference
- showPriceDifference
- showProductStockId
- showFooter
- showBrand
- showSelectableBox
- tableColumns
- footerRows
- disclosure
- totalProductDiscounts
- productsBundleTemplate
- productsBundleItemTemplate
- productsGiftTemplate
- productSelectableGiftTemplate
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —basketFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the form.
public
basketFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- content
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonsMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttons.
public
buttonsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- showRecalculate
- showContinue
- showClear
- submitAction
- classList
- backLocation
- forceDisabled
- routeType
- validOutput
- productsAreValid
- basketNeedsShipping
- basketNeedsPayment
- basketAddressError
- errorCode
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —commentMacro()
This method merges the given arguments, calculates and returns the view parameters for the comment.
public
commentMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- forceOutput
- showPlaceholder
- basketItems
- commentValue
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —customTagsMacro()
This method merges the given arguments, calculates and returns the view parameters for the customTags.
public
customTagsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- customTags
- showPositions
- useCalendar
- showFormFields
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —deleteDiscountCodesMacro()
This method merges the given arguments, calculates and returns the view parameters for the deleteDiscountCodes.
public
deleteDiscountCodesMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —deliveriesMacro()
This method merges the given arguments, calculates and returns the view parameters for the deliveries.
public
deliveriesMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- deliveries
- physicalLocations
- showTitle
- showLogo
- showTaxIncluded
- showDescription
- showPickup
- showProducts
- empty
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —deniedOrderMessageMacro()
This method merges the given arguments, calculates and returns the view parameters for the deniedOrderMessage.
public
deniedOrderMessageMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- errorCode
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —endOrderMacro()
This method merges the given arguments, calculates and returns the view parameters for the end order.
public
endOrderMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- payResponse
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —getApplicationTaxesIncluded()
This method returns the setting of 'show taxes included'.
public
static getApplicationTaxesIncluded() : bool
Return values
bool —groupBasketWarnings()
This method groups BasketWarning array into BasketWarningSeverity groups, and returns an array with these keys, each one containing the corresponding warnings: <ul> <li>BasketWarningSeverity::ERROR</li> <li>BasketWarningSeverity::WARNING</li> <li>BasketWarningSeverity::INFO</li> </ul>
public
static groupBasketWarnings([array<string|int, mixed> $basketWarnings = [] ]) : array<string|int, mixed>
Parameters
- $basketWarnings : array<string|int, mixed> = []
-
Array of BasketWarning
Return values
array<string|int, mixed> —mergeArguments()
This method merges macro arguments with macro associated class properties by reference.
public
static mergeArguments(mixed &$classObject[, array<string|int, mixed> $arguments = [] ]) : void
Parameters
- $classObject : mixed
- $arguments : array<string|int, mixed> = []
Return values
void —miniBasketContentMacro()
This method merges the given arguments, calculates and returns the view parameters for the miniBasketOutput.
public
miniBasketContentMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- class
- editable
- linkable
- quantityPlugin
- selectableBoxRows
- showCustomTagPositions
- showCustomTags
- showDeleteItem
- showZeroDiscount
- showFooter
- showHeader
- showImage
- showItemNameDiscounts
- showItemValueDiscounts
- showOptions
- showOptionValuesName
- showPaymentSystem
- showSelectableBox
- showShipping
- showSku
- showTaxIncluded
- showTotal
- showTotalDiscounts
- showTotalVouchers
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —miniBasketWrapMacro()
This method merges the given arguments, calculates and returns the view parameters for the miniBasketWrap.
public
miniBasketWrapMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- content
- showPaymentSystem
- showShipping
- showTaxIncluded
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —oscFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the OSC form.
public
oscFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- content
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —oscModuleMacro()
This method merges the given arguments, calculates and returns the view parameters for the OSC module.
public
oscModuleMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- content
- class
- type
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —paymentSystemsMacro()
This method merges the given arguments, calculates and returns the view parameters for the paymentSystems.
public
paymentSystemsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- paymentSystems
- showTaxIncluded
- showTitle
- showZeroPrice
- showImage
- showDescription
- basketNeedsPayment
- tokens
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —redeemRewardPointsMacro()
This method merges the given arguments, calculates and returns the view parameters for the redeemRewardPoints.
public
redeemRewardPointsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- rewardPoints
- showSelectableBox
- class
- quantityPlugin
- showRewardPointsHeader
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —rewardPointsMacro()
This method merges the given arguments, calculates and returns the view parameters for the rewardPoints.
public
rewardPointsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- basket
- class
- showHeader
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —setBasketWarningMessage()
This method adds to BasketWarning object a formatted output message from languageSheet, and replace wildcards.
public
static setBasketWarningMessage(BasketWarning $basketWarning, Basket $basket[, string $prefix = 'WARNING_' ][, bool $itemBasketWarning = false ]) : BasketWarning
Parameters
- $basketWarning : BasketWarning
- $basket : Basket
- $prefix : string = 'WARNING_'
- $itemBasketWarning : bool = false
Return values
BasketWarning —stepsMacro()
This method merges the given arguments, calculates and returns the view parameters for the steps.
public
stepsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- stepsData
- showNumbers
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —voucherFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the voucherForm.
public
voucherFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- forceOutput
- basketItems
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments