Shopping Cart
- Administrator
- News
- 9 likes
- 1243 views
- 2 comments
In Smarty templates in PrestaShop, a rich set of environment variables is available, reflecting the current context of the store's operation. They provide easy access to information about the current language, currency, country, customer, cart, as well as the store itself and its configuration – without the need to use PHP code.
Thanks to them, you can dynamically adjust the appearance and behavior of the front-end to regional settings, user preferences, or cart contents. These variables are automatically passed to templates by the PrestaShop engine and form the basis for building flexible, multilingual, and multi-currency themes and modules.
Store {$shop} store information |
|
{$shop.name} |
Store name (PS_SHOP_NAME) |
{$shop.email} |
Store email address (PS_SHOP_EMAIL) |
{$shop.id} |
ID of the current store |
{$shop.group_id} |
ID of the current store group |
{$shop.registration_number} |
Store registration number (PS_SHOP_DETAILS) |
{$shop.phone} |
Store phone number (PS_SHOP_PHONE) |
{$shop.fax} |
Store fax number (PS_SHOP_FAX) |
{$shop.long} |
Store longitude |
{$shop.lat} |
Store latitude |
{$shop.logo} |
Link to the store logo |
{$shop.logo_details} |
Store logo details (dimensions and src) |
{$shop.stores_icon} |
Icon of the given store (PS_STORES_ICON) |
{$shop.favicon} |
Store favicon (PS_FAVICON) |
{$shop.favicon_update_time} |
Store favicon - update date (PS_IMG_UPDATE_TIME) |
{$shop.address.address1} |
Store address 1 |
{$shop.address.address2} |
Store address 2 |
{$shop.address.postcode} |
Store postal code |
{$shop.address.city} |
Store city |
{$shop.address.state} |
Store state |
{$shop.address.country} |
Store country |
{$shop.address.formatted} |
Formatted full store address |
Store language {$language} - object of the current language used in the store |
|
{$language.name} |
Name of the current store language |
{$language.iso_code} |
ISO code of the current store language (5 characters) |
{$language.language_code} |
Code of the current store language |
{$language.is_rtl} |
Language written from right to left, 0 - left 1 - right |
{$language.id} |
ID of the current store language |
{$language.locale} |
ISO code of the current store language (5 characters) |
{$language.date_format_lite} |
Short date format for the current store language ('Y‑m‑d') |
{$language.date_format_full} |
Full format for the current store language ('Y‑m‑d H:i:s') |
Store currency {$currency} - object of the current currency used in the store |
|
{$currency.name} |
Name of the current store currency |
{$currency.numeric_iso_code} |
ISO code of the current store currency (3 letters) |
{$currency.precision} |
Precision of the current store currency (how many decimal places are displayed for the currency) |
{$currency.conversion_rate} |
Conversion rate of the current store currency |
{$currency.symbol} |
Symbol for the current store currency (e.g.: zł, €, $) |
Cart {$cart} - object representing the current cart in the store |
|
{$cart.id} |
ID of the current store cart object |
{$cart.id_address_delivery} |
Delivery address ID of the current store cart |
{$cart.id_address_invoice} |
Invoice address ID of the current store cart |
{$cart.is_virtual} |
Whether the current store cart is a cart with virtual products |
{$cart.minimalPurchase} |
Minimum amount that allows placing an order without currency, given as a net amount |
{$cart.minimalPurchaseRequired} |
Text message about the minimum order amount along with information about the missing amount |
{$cart.summary_string} |
Text message about the number of products in the cart (1 product, n products) |
{$cart.products} |
Array with products in the current store cart |
{$cart.vouchers} |
Array with discount vouchers in the current store cart |
{$cart.labels.tax_short} |
Short tax label of the current cart (net) |
{$cart.labels.tax_long} |
Long tax label of the current cart (excluding VAT) |
{$cart.totals.total.amount} |
Total amount of the current cart without currency (e.g. 45.00) |
{$cart.totals.total.value} |
Total amount of the current cart with currency (e.g. 45.00 zł) |
{$cart.totals.total.label} |
Text label of the total amount of the current cart |
{$cart.totals.total_including_tax.amount} |
Total amount of the current cart without currency and including tax (e.g. 45.00) |
{$cart.totals.total_including_tax.value} |
Total amount of the current cart with currency and tax (e.g. 45.00 zł) |
{$cart.totals.total_including_tax.label} |
Text label of the total amount of the current cart including tax |
{$cart.totals.total_excluding_tax.amount} |
Total amount of the current cart without currency and excluding tax (e.g. 45.00) |
{$cart.totals.total_excluding_tax.value} |
Total amount of the current cart with currency and excluding tax (e.g. 45.00) |
{$cart.totals.total_excluding_tax.label} |
Text label of the total amount of the current cart excluding tax |
{$cart.subtotals.products.amount} |
Number of products in the current store cart |
{$cart.subtotals.products.value} |
Total amount of products in the cart without currency |
{$cart.subtotals.products.label} |
Text label of the total amount of products in the cart |
{$cart.subtotals.shipping.amount} |
Shipping cost in the cart without currency |
{$cart.subtotals.shipping.value} |
Shipping cost in the cart with currency |
{$cart.subtotals.shipping.label} |
Text label of the shipping cost in the cart/td> |
{$cart.subtotals.discounts.amount} |
Total discounts in the current store cart without currency |
{$cart.subtotals.discounts.value} |
Total discounts in the current store cart with currency |
{$cart.subtotals.discounts.label} |
Text label of the total discounts in the current store cart |
{$cart.subtotals.gift_wrapping.amount} |
Total gift wrapping amount without currency in the store cart |
{$cart.subtotals.gift_wrapping.value} |
Total gift wrapping amount with currency in the store cart |
{$cart.subtotals.gift_wrapping.label} |
Text label of the total gift wrapping amount in the current store cart |
{$cart.subtotals.tax.amount} |
Total taxes without currency in the store cart |
{$cart.subtotals.tax.value} |
Total taxes with currency in the store cart |
{$cart.subtotals.tax.label} |
Text label of the total taxes in the current store cart |
Page {$page} - object representing the data of the current page displayed on the store front office |
|
{$page.page_name} |
Title of the current page displayed on the store front office |
{$page.canonical} |
Canonical link / URL of the current page displayed on the store front office |
{$page.body_classes} |
Title of the current page displayed on the store front office |
{$page.meta.title} |
Meta title of the current page displayed on the store front office |
{$page.meta.description} |
Meta description of the current page displayed on the store front office |
{$page.meta.keywords} |
Meta keywords of the current page displayed on the store front office |
{$page.robots} |
Meta robots tag of the current page displayed on the store front office |
Links {$urls} - to various page components (images, css, js, ) and the store pages themselves |
|
{$urls.base_url} |
Base store address (e.g.: https://prestadev.pl) |
{$urls.current_url} |
Current page address being viewed (e.g.: https://prestadev.pl/category_name/product_name_abc) |
{$urls.shop_domain_url} |
Base + virtual store address (e.g.: https://prestadev.pl/store_abc/) |
{$urls.img_ps_url} |
URL address of the store images root directory (/img/) |
{$urls.img_cat_url} |
URL address of the store category images directory (/img/c/) |
{$urls.img_lang_url} |
URL address of the store language images directory (/img/l/) |
{$urls.img_prod_url} |
URL address of the store product images directory (/img/p/) |
{$urls.img_sup_url} |
URL address of the store supplier product images directory (/img/su/) |
{$urls.img_manu_url} |
URL address of the store manufacturer product images directory (/img/m/) |
{$urls.img_ship_url} |
URL address of the store carrier images directory (/img/s/) |
{$urls.img_store_url} |
URL address of the physical store images directory |
{$urls.img_url} |
URL address of the store template images directory (/themes/template_name/assets/img/) |
{$urls.css_url} |
URL address of the store template CSS files directory (/themes/template_name/assets/css/) |
{$urls.js_url} |
URL address of the store template JS files directory (/themes/template_name/assets/css/) |
{$urls.pic_url} |
URL address of the directory to which the file was uploaded (/upload/) |
{$urls.pages.address} |
URL address of the customer address page in the store front office |
{$urls.pages.addresses} |
URL address of the customer addresses page in the store front office |
{$urls.pages.authentication} |
URL address of the customer login page in the store front office |
{$urls.pages.cart} |
URL address of the cart preview page in the store front office |
{$urls.pages.category} |
URL address of the category page in the store front office |
{$urls.pages.cms} |
URL address of the CMS page in the store front office |
{$urls.pages.contact} |
URL address of the contact page in the store front office |
{$urls.pages.discount} |
URL address of the customer's discount vouchers page in the store front office |
{$urls.pages.guest_tracking} |
URL address of the order tracking page as a guest (without customer registration) in the store front office |
{$urls.pages.history} |
URL address of the customer's order history page in the store front office |
{$urls.pages.identity} |
URL address of the customer's personal data page in the store front office |
{$urls.pages.index} |
URL address of the store homepage |
{$urls.pages.my_account} |
URL address of the my account page (customer account management) in the store front office |
{$urls.pages.order_confirmation} |
URL address of the order confirmation page in the store front office |
{$urls.pages.order_follow} |
URL address of the order delivery tracking page (registered customers only) |
{$urls.pages.order} |
URL address of the order page (placing an order) in the store front office |
{$urls.pages.order_return} |
URL address of the product returns page in the store front office (only after the customer logs in) |
{$urls.pages.order_slip} |
URL address of the credit slips page in the store front office (only after the customer logs in) |
{$urls.pages.pagenotfound} |
URL address of the 404 not found page in the store front office |
{$urls.pages.password} |
URL address of the customer password recovery page in the store front office |
{$urls.pages.pdf_invoice} |
URL address of the page with the option to download PDF invoices for an order |
{$urls.pages.pdf_order_return} |
URL address of the page with the option to download PDF product returns for orders in the store front office |
{$urls.pages.pdf_order_slip} |
URL address of the page with the option to download credit slips for an order in the store front office |
{$urls.pages.prices_drop} |
URL address of the product promotions page in the store front office |
{$urls.pages.product} |
URL address of the product page in the store front office |
{$urls.pages.search} |
URL address of the search page in the store front office |
{$urls.pages.sitemap} |
URL address of the sitemap page in the store front office |
{$urls.pages.stores} |
URL address of the physical stores page in the store front office |
{$urls.pages.supplier} |
URL address of the product suppliers page in the store front office |
{$urls.pages.register} |
URL address of the customer registration page in the store front office |
{$urls.theme_assets} |
URL address with template assets (/assets/) |
{$urls.actions.logout} |
URL address of the customer logout page in the store front office |
Customer {$customer} - object representing the data of the logged-in store customer |
|
{$customer.lastname} |
Store customer last name |
{$customer.firstname} |
Store customer first name |
{$customer.email} |
Store customer email address |
{$customer.birthday} |
Store customer date of birth |
{$customer.newsletter} |
Whether the customer subscribed to the store newsletter |
{$customer.newsletter_date_add} |
Date the store customer subscribed to the newsletter |
{$customer.ip_registration_newsletter} |
Customer IP address when subscribing to the store newsletter |
{$customer.optin} |
Whether the customer will use partner offer subscriptions |
{$customer.date_add} |
Store customer registration date |
{$customer.date_upd} |
Store customer data update date |
{$customer.id} |
Store customer ID |
{$customer.id_default_group} |
Default group of the store customer |
{$customer.is_logged} |
Whether the customer is logged in |
{$customer.gender.name[$customer.gender.id]} |
Store customer gender |
{$customer.addresses[id_address].city} |
Customer address city name |
{$customer.addresses[id_address].alias} |
Customer address alias |
{$customer.addresses[id_address].firstname} |
Customer address first name |
{$customer.addresses[id_address].lastname} |
Customer address last name |
{$customer.addresses[id_address].company} |
Customer address company name |
{$customer.addresses[id_address].address1} |
Address field 1 (street and number) of the customer address |
{$customer.addresses[id_address].address2} |
Address field 2 (apartment number, floor, etc.) of the customer address |
{$customer.addresses[id_address].postcode} |
Customer address postal code |
{$customer.addresses[id_address].id_state} |
Customer address state ID |
{$customer.addresses[id_address].state} |
Customer address state |
{$customer.addresses[id_address].state_iso} |
Customer address state ISO code |
{$customer.addresses[id_address].id_country} |
Customer address country ID |
{$customer.addresses[id_address].country} |
Customer address country name |
{$customer.addresses[id_address].country_iso} |
Customer address country ISO code |
{$customer.addresses[id_address].phone} |
Customer address phone number |
{$customer.addresses[id_address].phone_mobile} |
Customer address mobile phone number |
{$customer.addresses[id_address].dni} |
Customer address DNI number |
{$customer.addresses[id_address].vat_number} |
Customer address Tax ID / VAT number |
{$customer.addresses[id_address].formatted} |
Entire customer address formatted and ready for display on the front office |
Comments (2)