Search

Page tree
Skip to end of metadata
Go to start of metadata

Templates list:

Default path:

vendor/silversolutions/silver.e-shop/src/Silversolutions/Bundle/
EshopBundle/Resources/views
PathAccepted parametersHow to set the parametersDescription
Catalog/Subrequests/product.html.twig
 
 
  • used on product detail page

defines the parameters for price rendering and includes the product_price.html.twig template

Catalog/listProductNode.html.twig
 

Example: VariantProductNode

  • used on product list page

defines the parameters for price rendering and includes the product_price.html.twig template

Catalog/Subrequests/product_price.html.twig

{# parameters, that will be passed to the
PriceField.html.twig 
template to render the price #} 

'renderParams': renderParams

{# parameters, that will be used to design the label,
e.g. 'List price', 'Your price' #}
 
{# you can decide if you want to display the
label and specify the css class #}

'labelParams'
: labelParams 

{# if set, the source will be displayed #}
'displaySource'
: true

{% set labelParams = {
 'priceRange' : {
 'cssClass': 'right_align block',
 'show': true
},
 'customerPrice': {
 'show': true
},
 'listPrice': {
 'show': true
}
}
%}

common template to render the price, display a label about the price type (e.g. 'list price') and display the price source (e.g. ERP)

includes PriceField.html.twig to render the price

Fieldtypes/PriceField.html.twig
'params' : renderParams

 
{% set renderParams = {
 'outputPrice': {
 'cssClass': 'price price_med',
 'property': priceProperty
},
 'vatLabel': {
 'cssClass': 'price',
 'show': true,
 'text': priceLabel
}
}
%}
renders the given price from catalog element, see ses_render_price

Related custom Twig modifiers/functions/etc/:

Twig filterDescriptionUsage
shipping
gets the list of shipping costs from the basket
{% set shippingCosts = basket|shipping %}
basket_discounts
gets the list of discounts from the basket
{% set discounts = basket|basket_discounts %}
basket_add_costs
gets the list of additional costs from the basket
{% set addCosts = basket|basket_add_costs %}
basket_add_lines
gets the list of additional lines from the basket
{% set addLines = basket|basket_add_lines %}
Twig functionDescriptionUsage
price_format
Formats a price value
{{ priceValue|price_format(currency, locale) }}
ses_render_price
Renders a PriceField from CatalogElement
{{ ses_render_price(catalogElement, minPrice,
{
'outputPrice': {'cssClass': 'price price_med'}
}
) }}

ses_render_price

Following optional render parameters are available for a PriceField:

ParameterDescriptionOptions
outputPriceEnables actions on the output of the price value
ParameterDescriptionDefault
idOptional string of ID to use for price"" (undefined)
cssClassOptional string of CSS class(es) to use for price"" (undefined)
localeTwo digit locale code (e.g.: "en", "us", "de")"en"
currencyThree digit currency code (e.g.: EUR, GBP, USD)price.currency
propertyProperty of price field used for outputted valueprice.price
rawPrice is outputted without any HTML tags, if truefalse (undefined)
vatLabelEnables actions on the optional VAT label
ParameterDescriptionDefault
idOptional string of ID to use for VAT label"" (undefined)
showVAT label is shown, if truefalse (undefined)
cssClassOptional string of CSS class(es) to use for VAT label"" (undefined)
textOverride of the outputted text

Default text depending on price.isVatPrice ("Including VAT" or "Excluding VAT")

rawVAT label is outputted without any HTML tags, if truefalse (undefined)
schemaenables to ouput schema infos

If set then a schema

itemprop="price" 

will be used:

<span itemprop="price" content="1865.00">1.865,00&nbsp;€</span>

Related routes:

  • No labels