ProductViewHelper
extends ViewHelper
in package
This is the ProductViewHelper class.
The purpose of this class is to facilitate to Twig the generation of the product'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 | |
bundlesMacro() | This method merges the given arguments, calculates and returns the view parameters for the bundle macro. | : array<string|int, mixed> |
buttonClearProductsFilterMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttonClearProductsFilter. | : array<string|int, mixed> |
buttonDiscountsMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttonDiscounts. | : array<string|int, mixed> |
buttonProductComparisonMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttonProductComparison. | : array<string|int, mixed> |
buttonProductContactMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttonProductContact. | : array<string|int, mixed> |
buttonRecommendMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttonRecommend. | : array<string|int, mixed> |
buttonWishlistMacro() | This method merges the given arguments, calculates and returns the view parameters for the buttonWishlist. | : array<string|int, mixed> |
buyBundleFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyBundleForm. | : array<string|int, mixed> |
buyFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyForm. | : array<string|int, mixed> |
buyFormOptionsMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyFormOptions. | : array<string|int, mixed> |
buyFormProductOffsetMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyFormProductOffset. | : array<string|int, mixed> |
buyFormQuantityMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyFormQuantity. | : array<string|int, mixed> |
buyFormSubmitMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyFormSubmit. | : array<string|int, mixed> |
buyProductFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the buyProductForm. | : array<string|int, mixed> |
commentsFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the commentsForm. | : array<string|int, mixed> |
commentsMacro() | This method merges the given arguments, calculates and returns the view parameters for the comments. | : array<string|int, mixed> |
contactFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the contactForm macro. | : array<string|int, mixed> |
countdownMacro() | This method merges the given arguments, calculates and returns the view parameters for the countdown. | : array<string|int, mixed> |
discountsMacro() | This method merges the given arguments, calculates and returns the view parameters for the discounts macro. | : array<string|int, mixed> |
filterFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the filterForm. | : array<string|int, mixed> |
getApplicationTaxesIncluded() | This method returns the setting of 'show taxes included'. | : bool |
getFiltering() | This method returns true if any of the filters is applied (based on the given parameters: ApplicableFitlers object and productsFilter object (from FiltrableProductListTrait)). | : bool |
getJsonData() | This method returns a json containing the information of the given Product. | : array<string|int, mixed> |
mergeArguments() | This method merges macro arguments with macro associated class properties by reference. | : void |
priceByQuantityMacro() | This method merges the given arguments, calculates and returns the view parameters for the priceByQuantity. | : array<string|int, mixed> |
productComparisonMacro() | This method merges the given arguments, calculates and returns the view parameters for the productComparison macro. | : array<string|int, mixed> |
productComparisonPreviewMacro() | This method merges the given arguments, calculates and returns the view parameters for the productComparisonPreview macro. | : array<string|int, mixed> |
propertyMacro() | This method merges the given arguments, calculates and returns the view parameters for the property. | : array<string|int, mixed> |
rateMacro() | This method merges the given arguments, calculates and returns the view parameters for the rate. | : array<string|int, mixed> |
recommendFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the recommend form macro. | : array<string|int, mixed> |
rewardPointsMacro() | This method merges the given arguments, calculates and returns the view parameters for the rewardPoints form macro. | : array<string|int, mixed> |
richSnippetsMacro() | This method merges the given arguments, calculates and returns the view parameters for the richSnippets. | : array<string|int, mixed> |
stockAlertFormMacro() | This method merges the given arguments, calculates and returns the view parameters for the stockAlertForm macro. | : 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 —bundlesMacro()
This method merges the given arguments, calculates and returns the view parameters for the bundle macro.
public
bundlesMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- productBundles
- showBundleDefinition
- showBundleDefinitionName
- showBundleDefinitionDescription
- showUniqueUnit
- buyFormOptionsArgs
- buyBundleForm
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonClearProductsFilterMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttonClearProductsFilter.
public
buttonClearProductsFilterMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- class
- show
- hrefAllParams
- output
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonDiscountsMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttonDiscounts.
public
buttonDiscountsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- discounts
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonProductComparisonMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttonProductComparison.
public
buttonProductComparisonMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- type
- showLabel
- allowDelete
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonProductContactMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttonProductContact.
public
buttonProductContactMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- id
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonRecommendMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttonRecommend.
public
buttonRecommendMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- id
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buttonWishlistMacro()
This method merges the given arguments, calculates and returns the view parameters for the buttonWishlist.
public
buttonWishlistMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- type
- showLabel
- allowDelete
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyBundleFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyBundleForm.
public
buyBundleFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- class
- showQuantity
- showBundleBuyTitle
- showQuantitySelectableBox
- bundleGroupingContent
- bundleGrouping
- minQuantity
- maxQuantity
- priceWithTaxes
- showTaxText
- showPrice
- showBasePrice
- showSaving
- isAlternativePrice
- taxText
- appliedTaxes
- mainProducts
- quantityPlugin
- bundleId
- showLabel
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyForm.
public
buyFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- class
- style
- content
- sectionId
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyFormOptionsMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyFormOptions.
public
buyFormOptionsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- showShortDescription
- showLongDescription
- showUnavailableLabel
- selectDefaults
- showImageOptions
- showBasePrice
- showRetailPrice
- showOptionsTableFormat
- disallowGrid
- showOptionsUpdatableGrid
- updatableGridMode
- quantityPlugin
- showTitleInLabelUniqueImage
- language
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyFormProductOffsetMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyFormProductOffset.
public
buyFormProductOffsetMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- class
- showOrderBox
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyFormQuantityMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyFormQuantity.
public
buyFormQuantityMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- class
- quantityPlugin
- showSelectableBox
- selectableBoxRows
- manualMinQuantity
- manualMaxQuantity
- minOrderQuantity
- maxOrderQuantity
- multipleOrderQuantity
- multipleActsOver
- minQuantity
- maxQuantity
- forceMinQuantityZero
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyFormSubmitMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyFormSubmit.
public
buyFormSubmitMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- id
- showOrderBox
- class
- showLabel
- formButtonHook
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —buyProductFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the buyProductForm.
public
buyProductFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- class
- style
- content
- sectionId
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —commentsFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the commentsForm.
public
commentsFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- form
- configuration
- output
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —commentsMacro()
This method merges the given arguments, calculates and returns the view parameters for the comments.
public
commentsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- comments
- roundedRating
- roundedIntRating
- worstRating
- bestRating
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —contactFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the contactForm macro.
public
contactFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- form
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —countdownMacro()
This method merges the given arguments, calculates and returns the view parameters for the countdown.
public
countdownMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- eventTime
- callback
- template
- categoryId
- endDate
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —discountsMacro()
This method merges the given arguments, calculates and returns the view parameters for the discounts macro.
public
discountsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- discounts
- productId
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —filterFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the filterForm.
public
filterFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- filters
- applicableFilters
- appliedFilters
- defaultParametersValues
- autosubmit
- helperFilters
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 —getFiltering()
This method returns true if any of the filters is applied (based on the given parameters: ApplicableFitlers object and productsFilter object (from FiltrableProductListTrait)).
public
static getFiltering(ApplicableFilters $applicableFilters, array<string|int, mixed> $appliedFilters) : bool
It returns false otherwise.
Parameters
- $applicableFilters : ApplicableFilters
- $appliedFilters : array<string|int, mixed>
Return values
bool —getJsonData()
This method returns a json containing the information of the given Product.
public
getJsonData([Product $product = null ]) : array<string|int, mixed>
Parameters
- $product : Product = null
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 —priceByQuantityMacro()
This method merges the given arguments, calculates and returns the view parameters for the priceByQuantity.
public
priceByQuantityMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- pricesByQuantity
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —productComparisonMacro()
This method merges the given arguments, calculates and returns the view parameters for the productComparison macro.
public
productComparisonMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- form
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —productComparisonPreviewMacro()
This method merges the given arguments, calculates and returns the view parameters for the productComparisonPreview macro.
public
productComparisonPreviewMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- form
- class
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —propertyMacro()
This method merges the given arguments, calculates and returns the view parameters for the property.
public
propertyMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- product
- property
- showTaxText
- priceWithTaxes
- availabilities
- isAlternativePrice
- taxText
- appliedTaxes
- stockAlertButton
- stockAlertButtonClass
- showStock
- showAvailabilityName
- showStockText
- showAvailabilityImage
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —rateMacro()
This method merges the given arguments, calculates and returns the view parameters for the rate.
public
rateMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- comments
- roundedRating
- roundedIntRating
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —recommendFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the recommend form macro.
public
recommendFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- form
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 form macro.
public
rewardPointsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- rewardPoints
- showHeader
- showRulesHeader
- showRulesCondition
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —richSnippetsMacro()
This method merges the given arguments, calculates and returns the view parameters for the richSnippets.
public
richSnippetsMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- richSnippets
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments
Return values
array<string|int, mixed> —stockAlertFormMacro()
This method merges the given arguments, calculates and returns the view parameters for the stockAlertForm macro.
public
stockAlertFormMacro([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
The array keys of the returned parameters are:
- form
Parameters
- $arguments : array<string|int, mixed> = []
-
Twig macro arguments