Skillnad mellan versioner av "Templating:Printed orders"

Från Vendre Help
Hoppa till: navigering, sök
(New variables)
(Old variables)
Rad 19: Rad 19:
  
 
===Old variables===
 
===Old variables===
There are many, prefer adding new variables instead of using them.
+
Prefer adding new variables instead of using them.
 +
 
 +
{|class="wikitable"
 +
!variable
 +
!description
 +
|-
 +
|title
 +
|
 +
|-
 +
|type
 +
|
 +
|-
 +
|customer_id
 +
|
 +
|-
 +
|order_id
 +
|
 +
|-
 +
|logo_url
 +
|
 +
|-
 +
|charset
 +
|
 +
|-
 +
|store_name
 +
|
 +
|-
 +
|store_owner
 +
|
 +
|-
 +
|date
 +
|
 +
|-
 +
|shipping_name
 +
|
 +
|-
 +
|dynamic_shipping_name
 +
|
 +
|-
 +
|shipping_company
 +
|
 +
|-
 +
|shipping_street
 +
|
 +
|-
 +
|shipping_street2
 +
|
 +
|-
 +
|shipping_street2_top
 +
|
 +
|-
 +
|shipping_area
 +
|
 +
|-
 +
|shipping_postcode
 +
|
 +
|-
 +
|shipping_country
 +
|
 +
|-
 +
|billing_name
 +
|
 +
|-
 +
|dynamic_billing_name
 +
|
 +
|-
 +
|billing_company
 +
|
 +
|-
 +
|billing_street
 +
|
 +
|-
 +
|billing_street2
 +
|
 +
|-
 +
|billing_street2_top
 +
|
 +
|-
 +
|billing_area
 +
|
 +
|-
 +
|billing_postcode
 +
|
 +
|-
 +
|billing_country
 +
|
 +
|-
 +
|your_reference
 +
|
 +
|-
 +
|personnummer
 +
|
 +
|-
 +
|email_address
 +
|
 +
|-
 +
|order_comment
 +
|
 +
|-
 +
|dynamic_order_text
 +
|
 +
|-
 +
|customer_phone
 +
|
 +
|-
 +
|customer_mobile
 +
|
 +
|-
 +
|our_reference
 +
|
 +
|-
 +
|payment_method
 +
|
 +
|-
 +
|payment_terms
 +
|
 +
|-
 +
|shipping_method
 +
|
 +
|-
 +
|shipping_terms
 +
|
 +
|-
 +
|due_date
 +
|
 +
|-
 +
|penalty_interest
 +
|
 +
|-
 +
|organization_id
 +
|
 +
|-
 +
|vat_id
 +
|
 +
|-
 +
|f_skatt
 +
|
 +
|-
 +
|plusgiro
 +
|
 +
|-
 +
|bankgiro
 +
|
 +
|-
 +
|iban
 +
|
 +
|-
 +
|bic
 +
|
 +
|-
 +
|store_street
 +
|
 +
|-
 +
|store_area
 +
|
 +
|-
 +
|store_country
 +
|
 +
|-
 +
|phone
 +
|
 +
|-
 +
|fax
 +
|
 +
|-
 +
|website_url
 +
|
 +
|-
 +
|website
 +
|
 +
|-
 +
|email
 +
|
 +
|-
 +
|message
 +
|
 +
|-
 +
|currency
 +
|
 +
|-
 +
|stylesheets
 +
|
 +
|-
 +
|header
 +
|
 +
|-
 +
|totals
 +
|
 +
|-
 +
|admin
 +
|
 +
|-
 +
|order
 +
|
 +
|}
  
 
===New variables===
 
===New variables===

Versionen från 31 oktober 2018 kl. 11.51

This page documents the Twig template variables and extensions available in printed orders.

Twig variables

Special variables

variable description
stylesheets A list of CSS files that should be included for proper rendering. The files differ depending on what rendering method is being used.
header A block of HTML containing the administration elements.
header A block of HTML containing the administration elements.

Old variables

Prefer adding new variables instead of using them.

variable description
title
type
customer_id
order_id
logo_url
charset
store_name
store_owner
date
shipping_name
dynamic_shipping_name
shipping_company
shipping_street
shipping_street2
shipping_street2_top
shipping_area
shipping_postcode
shipping_country
billing_name
dynamic_billing_name
billing_company
billing_street
billing_street2
billing_street2_top
billing_area
billing_postcode
billing_country
your_reference
personnummer
email_address
order_comment
dynamic_order_text
customer_phone
customer_mobile
our_reference
payment_method
payment_terms
shipping_method
shipping_terms
due_date
penalty_interest
organization_id
vat_id
f_skatt
plusgiro
bankgiro
iban
bic
store_street
store_area
store_country
phone
fax
website_url
website
email
message
currency
stylesheets
header
totals
admin
order

New variables

These variables are available under the variables admin and order, the variables under admin use the administration's language and the variables under order use the order's language. These variables are not available when printing pickinglists.

variable description
products The products on the order as an array. The products are sorted according the the store's configuration.
products[].id Product id.
products[].quantity Number of products ordered.
products[].price Price used.
products[].tax Tax rate used.
products[].model Product model.
products[].name Product name used.
products[].package_content Package content for units.
products[].specifications Product specifications as an array.
products[].specifications[].id Specification id.
products[].specifications[].name Specification value.
products[].specifications[].type Either value or text.
products[].specifications[].value Specification value
products[].specifications[].unit Unit information. Note that the correct language might not be used.
products[].specifications[].unit.id Unit id.
products[].specifications[].unit.abbr Unit abbreviation.
products[].specifications[].unit.relation_id Unit relation id.
products[].specifications[].unit.calculation_value Unit calculation value.
products[].specifications[].short_value The short value, only when type is text.
products[].attributes Selected attributes, as an array.
products[].attributes[].option Attribute name.
products[].attributes[].value Attribute value.
products[].attributes[].price Attribute cost.

Twig extensions

admin_langstr, order_langstr

admin_langstr and order_langstr are functions that take a language string and return its value for either the administration's language or the order's language. Language strings are loaded from the global namespace.

order_langstr is not available when printing pickinglists.

Example:

{{ admin_langstr('TEXT_HEADER_DEFAULT') }}

admin_currency_format, order_currency_format

admin_currency_format and order_currency_format are filters that take a currency value and format it according to the administration's default currency or the order's currency.

order_currency_format is not available when printing pickinglists.

Example:

{{ 12.345 | admin_currency_format }}