Document extends BaseOutput

This is the Document class, a macro class for the document viewHelper.

The purpose of this class is to encapsulate the logic that calculates the view parameters for the document output.

Tags
see
Document::getViewParameters()

Table of Contents

ADDITIONAL_ITEMS_PRESENTATION  = 'additionalItems'
GIFTS_PRESENTATION_INDEPENDENT  = 'independent'
GIFTS_PRESENTATION_PRODUCTS_BLOCK  = 'productsBlock'
MODE_CASH_TICKET  = 'cashTicket'
MODE_DISCLOSURE  = 'disclosure'
SHOW_OPTION_VALUES_NAME_NOT_SHOW  = 'notShow'
SHOW_OPTION_VALUES_NAME_SHOW_DESCRIPTION  = 'showDescription'
SHOW_OPTION_VALUES_NAME_SHOW_NAME  = 'showName'
GIFTS_PRESENTATION_VALUES  = [self::GIFTS_PRESENTATION_PRODUCTS_BLOCK, self::GIFTS_PRESENTATION_INDEPENDENT]
MODE_VALUES  = [self::MODE_DISCLOSURE, self::MODE_CASH_TICKET]
SHOW_OPTION_VALUES_NAME_VALUES  = [self::SHOW_OPTION_VALUES_NAME_NOT_SHOW, self::SHOW_OPTION_VALUES_NAME_SHOW_NAME, self::SHOW_OPTION_VALUES_NAME_SHOW_DESCRIPTION]
TABLE_COLUMNS  = ['info', 'price', 'quantity', 'discounts', 'subtotal']
$additionalItems  : string
$document  : AbstractDocumentBase|null
$giftsPresentation  : string
$linkable  : bool
$mode  : string
$productsBundleItemTemplate  : string|null
$productsBundleTemplate  : string|null
$productSelectableGiftTemplate  : string|null
$productsGiftTemplate  : string|null
$productsTemplate  : string|null
$routeType  : string
$showBrand  : bool
$showCustomTagPositions  : array<string|int, mixed>
$showCustomTags  : bool
$showDevolutionButton  : bool
$showDiscountName  : bool
$showDiscounts  : bool
$showDiscountValue  : bool
$showFooter  : bool
$showFreeTaxMessage  : bool
$showImage  : bool
$showManufacturerSku  : bool
$showOffsets  : bool
$showOptions  : bool
$showOptionValuesName  : string
$showOptionValuesSku  : bool
$showPercentDifference  : bool
$showPreviousPrice  : bool
$showPriceDifference  : bool
$showPrices  : bool
$showProductStockId  : bool
$showSku  : bool
$showTaxDisclosure  : bool
$showTaxesZeroTotalIncrement  : bool
$showTaxIncluded  : bool|null
$showTaxName  : bool|null
$showZeroDiscount  : bool
$showZeroPayment  : bool
$showZeroShipping  : bool
$tableClass  : string
$totalProductDiscounts  : float
$disclosure  : array<string|int, mixed>
$footerRows  : array<string|int, mixed>
$languageSheet  : Language|null
$tableColumns  : int
__construct() Constructor method for Output class.  : mixed
colspanCalculator() Util for calculate colspan value of a tr depending tbody columns, default for extra table tr (row) with 2 td  : int
getTableBodyColumns() Based on the maximum possible columns and the parameters, calculate the maximum columns of the table's body.  : int
getViewParameters() This method returns all calculated arguments and new parameters for BasketViewHelper.php  : array<string|int, mixed>
addCalculatedBundlePrices()  : void
addCalculatedPrices()  : void
getProperties() Return macro use properties  : array<string|int, mixed>
getRowClassName() Get documentRow classes for <tr> html  : string
parametersRestrictions() Depending mode parameter override other parameters  : void
setCalculatedAttributes()  : void
setDisclosure()  : void
setFooter()  : void
setTotalProductDiscounts() Sets the sum of the total discounts of all rows  : void
validateMainParams() This method check that the main params stored in this parent class are OK  : array<string|int, mixed>

Constants

ADDITIONAL_ITEMS_PRESENTATION

public mixed ADDITIONAL_ITEMS_PRESENTATION = 'additionalItems'

GIFTS_PRESENTATION_INDEPENDENT

public mixed GIFTS_PRESENTATION_INDEPENDENT = 'independent'

GIFTS_PRESENTATION_PRODUCTS_BLOCK

public mixed GIFTS_PRESENTATION_PRODUCTS_BLOCK = 'productsBlock'

MODE_CASH_TICKET

public mixed MODE_CASH_TICKET = 'cashTicket'

MODE_DISCLOSURE

public mixed MODE_DISCLOSURE = 'disclosure'

SHOW_OPTION_VALUES_NAME_NOT_SHOW

public mixed SHOW_OPTION_VALUES_NAME_NOT_SHOW = 'notShow'

SHOW_OPTION_VALUES_NAME_SHOW_DESCRIPTION

public mixed SHOW_OPTION_VALUES_NAME_SHOW_DESCRIPTION = 'showDescription'

SHOW_OPTION_VALUES_NAME_SHOW_NAME

public mixed SHOW_OPTION_VALUES_NAME_SHOW_NAME = 'showName'

GIFTS_PRESENTATION_VALUES

protected mixed GIFTS_PRESENTATION_VALUES = [self::GIFTS_PRESENTATION_PRODUCTS_BLOCK, self::GIFTS_PRESENTATION_INDEPENDENT]

MODE_VALUES

protected mixed MODE_VALUES = [self::MODE_DISCLOSURE, self::MODE_CASH_TICKET]

SHOW_OPTION_VALUES_NAME_VALUES

protected mixed SHOW_OPTION_VALUES_NAME_VALUES = [self::SHOW_OPTION_VALUES_NAME_NOT_SHOW, self::SHOW_OPTION_VALUES_NAME_SHOW_NAME, self::SHOW_OPTION_VALUES_NAME_SHOW_DESCRIPTION]

TABLE_COLUMNS

protected mixed TABLE_COLUMNS = ['info', 'price', 'quantity', 'discounts', 'subtotal']

Properties

$additionalItems

public string $additionalItems = self::ADDITIONAL_ITEMS_PRESENTATION

$document

public AbstractDocumentBase|null $document = null

$giftsPresentation

public string $giftsPresentation = self::GIFTS_PRESENTATION_PRODUCTS_BLOCK

$mode

public string $mode = self::MODE_DISCLOSURE

$productsBundleItemTemplate

public string|null $productsBundleItemTemplate = null

$productsBundleTemplate

public string|null $productsBundleTemplate = null

$productSelectableGiftTemplate

public string|null $productSelectableGiftTemplate = null

$productsGiftTemplate

public string|null $productsGiftTemplate = null

$productsTemplate

public string|null $productsTemplate = null

$showCustomTagPositions

public array<string|int, mixed> $showCustomTagPositions = []

$showCustomTags

public bool $showCustomTags = false

$showDevolutionButton

public bool $showDevolutionButton = false

$showDiscountName

public bool $showDiscountName = false

$showDiscounts

public bool $showDiscounts = true

$showDiscountValue

public bool $showDiscountValue = false

$showFreeTaxMessage

public bool $showFreeTaxMessage = false

$showManufacturerSku

public bool $showManufacturerSku = false

$showOptionValuesName

public string $showOptionValuesName = self::SHOW_OPTION_VALUES_NAME_SHOW_NAME

$showOptionValuesSku

public bool $showOptionValuesSku = false

$showPercentDifference

public bool $showPercentDifference = false

$showPreviousPrice

public bool $showPreviousPrice = false

$showPriceDifference

public bool $showPriceDifference = false

$showProductStockId

public bool $showProductStockId = false

$showTaxDisclosure

public bool $showTaxDisclosure = true

$showTaxesZeroTotalIncrement

public bool $showTaxesZeroTotalIncrement = false

$showTaxIncluded

public bool|null $showTaxIncluded = null

$showTaxName

public bool|null $showTaxName = true

$showZeroDiscount

public bool $showZeroDiscount = false

$showZeroPayment

public bool $showZeroPayment = true

$showZeroShipping

public bool $showZeroShipping = false

$totalProductDiscounts

public float $totalProductDiscounts = 0

$disclosure

protected array<string|int, mixed> $disclosure = []

$footerRows

protected array<string|int, mixed> $footerRows = []

Methods

__construct()

Constructor method for Output class.

public __construct(array<string|int, mixed> $arguments, Language $languageSheet) : mixed
Parameters
$arguments : array<string|int, mixed>
$languageSheet : Language
Tags
see
Output
Return values
mixed —

colspanCalculator()

Util for calculate colspan value of a tr depending tbody columns, default for extra table tr (row) with 2 td

public static colspanCalculator(int $tableBodyTdLength[, int $thisRowTdLength = 2 ][, int $tdWithColspanLength = 1 ]) : int
Parameters
$tableBodyTdLength : int

Actual BasketRow total output columns (td)

$thisRowTdLength : int = 2

Total row columns for which we are calculating colspan

$tdWithColspanLength : int = 1

Total row columns with colspan to calculate, for which we are calculating colspan

Return values
int —

getTableBodyColumns()

Based on the maximum possible columns and the parameters, calculate the maximum columns of the table's body.

public getTableBodyColumns() : int
Return values
int —

getViewParameters()

This method returns all calculated arguments and new parameters for BasketViewHelper.php

public getViewParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —

addCalculatedBundlePrices()

protected addCalculatedBundlePrices(DocumentRow $documentRow) : void
Parameters
$documentRow : DocumentRow
Return values
void —

addCalculatedPrices()

protected addCalculatedPrices(DocumentRow $documentRow) : void
Parameters
$documentRow : DocumentRow
Return values
void —

getProperties()

Return macro use properties

protected getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed> —

getRowClassName()

Get documentRow classes for <tr> html

protected getRowClassName( $documentRow) : string
Parameters
$documentRow :
Return values
string —

parametersRestrictions()

Depending mode parameter override other parameters

protected parametersRestrictions() : void
Return values
void —

setCalculatedAttributes()

protected setCalculatedAttributes(mixed $structure) : void
Parameters
$structure : mixed
Return values
void —

setDisclosure()

protected setDisclosure() : void
Return values
void —

setFooter()

protected setFooter() : void
Return values
void —

setTotalProductDiscounts()

Sets the sum of the total discounts of all rows

protected setTotalProductDiscounts() : void
Return values
void —

validateMainParams()

This method check that the main params stored in this parent class are OK

protected validateMainParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —

Search results