Smarty variables in module Html Box Pro
Hi, I need informations about smarty variables in HTML Box Pro Module (that we haven't bought yet). If I create a smarty template inside the module, can I use all smarty's variables that I would have in a "normal" Prestashop tpl? For example, I need total shipping value and product's reference, price_wt and quantity during order process and in order confirmation too. I need to inject javascript in all product pages too, in the module configuration's there isn't a flag for that, so I'll have to use the $page variable in an if. Last question, in the docs of the module you wrote "list of products (hook executed with product ID param)", I didn't understood which hook. Best regards,
Hello,
Smarty template feature included to the module contains these variables.
But please note, that some of these variables are not available everywhere. For exmaple {$product} is available only on product pages etc.
there is also other feature that can be useful in context of your case (not in smarty smarty template, just in the editor that module has).
You can insert into the editor some special variables developed exclusively for this module. For exmaple {
order_total_products_tax_excluded}
If you will insert it directly to the editor, like here: https://i.imgur.com/01cADBc.png - This variable will be replaced with total value of products from order. This does not contain value of paid taxes.
Variable | Description | Appearance rules |
{smartyTemplate:XXX} | This shortcode allows to include .tpl file contents (with smarty code) - where XXX is the name of template file created with smarty templates manager included with this module | Variable is available globally |
{current_url} | This variable will be replaced with full url of currently viewed page | Variable is available globally |
{currency_iso} | This variable will be replaced with currency iso code (for example USD, EUR, PLN, GBP etc.) | Variable is avaialble globally |
{id_customer} | if you will use this variable. module will replace it with an id of customer that is logged to the shop | Variable will be replaced only if customer will be logged to the shop. |
{email_customer} | if you will use this variable, module will replace it with an email of the customer that is logged to the shop | |
{customer_firstname} | If you will use this variable module will replace it with logged customer firstname | |
{customer_lastname} | If you will use this variable module will replace it with logged customer lastname | |
{id_category} | if you will use this variable, module will replace it with an id of category that customer browse | Variable will be replaced only if customer will browse category page in your shop |
{name_category} | if you will use this variable, module will replace it with a category name that customer browse | |
{path_array_category} |
If you will use this variable, module will replace it with an array of parent categories to the category that customer browse, for example:
'home', 'woman', 'dresses', 'casual dresses'
| |
{HOOK:hook_name} |
You can use this shortcode to display hook contents inside the box created with this module. For exmaple: {HOOK:leftColumn}, {HOOK:rightColumn}, {HOOK:footer}. {HOOK:displayTop} etc.
| You can use shortcode to run and display Hook contents anywhere you want |
{HOOK:(1):(2)} |
Feature to run selected module from hook where (1) is a hook name and (2) is a module name to run. For exmaple: {HOOK:displayProductFooter:productcomments}
| You can use it everywhere |
{id_product} |
This variable will be replaced with id of product that is currently browsed (product page)
| Variables are available on product page and on list of products (hook executed with product ID param) |
{id_product_attribute} |
This variable will be replaced with ID of product attribute (if defined)
| |
{product_name} |
This variable will be replaced will full produt name
| |
{product_price_tax_incl} |
Price of the product - tax included
| Variables are available on product page and on list of products (hook executed with product ID param) |
{product_price_tax_incl_no_currency} |
Price of the product - tax included - without currency symbol
| |
{product_price_tax_excl} | Price of the product - tax excluded | |
{product_price_tax_excl_no_currency} | Price of the product - tax excluded - without currency symbol | |
{product_price_tax_incl*X} | Price of the product (tax incl. or tax excl.) multiplied by X (where X is a number like: 1,5,10, 2.5, 0.22 etc.) | |
{product_price_tax_excl*X} | ||
{cart_products_id} |
This variable will be replaced with list of products' id numbers that currently are in cart
| These variables are avaialble globally, but only if you will have products in cart. If cart will be empty - module will not return values. |
{cart_total} |
This variable will be replaced with cart total value (without currency sign - just simple integer value)
| |
{cart_total_with_currency} |
This variable will be replaced with cart total value with currency sign
| |
{order_id} |
This variable will be replaced with placed order ID.
| You can use this shortcode / variable on order confirmation page (while someone places an order and shop confirms that order customer placed properly) |
{order_currency_iso_code} |
This variable will be replaced with ISO code of currency that customer used to place an order
| |
{order_total_paid} |
This variable will be replaced with total order value that customer paid for the order
| |
{order_total_products_tax_included} | This variable will be replaced with total value of products from order. This value contains taxes | |
{order_total_products_tax_excluded} | This variable will be replaced with total value of products from order. This does not contain value of paid taxes | |
{order_products_id} | This variable will be replaced with list of products that customer bought (useful for facebook pixel as content_ids param) |
This list contains variables avaialble in the module in july 2019. If you read this in the future - check list of actual exclusive variables, you can find it on module page here:
https://mypresta.eu/modules/front-office-features/html-box-pro.html
best regards,
milos
Smarty variables in module Html Box Pro
Reviewed by VEKIA
on
Friday, July 05, 2019
Rating:
No comments