Global Smarty Variables used in Prestashop

Today i want to share a useful list of smarty global variables. All of this variables you can use in template files (both modules and theme). Enjoy!


{$base_dir_ssl} URL of your store when SSL certificate is active
{$base_dir} URL of your store
{$cart} Information about cart. Read entries below for more informations
{$cart->id} ID of customer cart
{$cart->id_shop_group} ID of shop group (multistore feature)
{$cart->id_shop} ID of shop (multistore feature)
{$cart->id_address_delivery} ID of customer address delivery (only if order was made)
{$cart->id_address_invoice} ID of customer address invoice (only if order was made)
{$cart->id_currency} ID of cart currency
{$cart->id_customer} ID of customer for which cart belongs (only if customer is logged)
{$cart->id_guest} ID of shop guest
{$cart->id_lang} ID of cart language
{$cart->recycable} Bool value if recycable checked for this cart
{$cart->gift} Bool value if gift checed for this cart
{$cart->gift_message} Gift message
{$cart->mobile_theme} Bool value if cart was created on mobile device
{$cart->date_add} Date of cart creation
{$cart->date_upd} Date of cart update
{$cart->id_carrier} Id of cart carrier (if selected)
{$cart->checkedTos} Bool value if terms of service is checked
{$img_cat_dir} URL for the directory with categories images
{$img_ps_dir} URL for the directory with PrestaShop image
{$img_lang_dir} URL for the directory with languages images
{$img_sup_dir} URL for the directory with suppliers images
{$img_ship_dir} URL for the directory with carriers images
{$img_prod_dir} URL for the directory with products images
{$img_manu_dir} URL for the directory with manufacturers images
{$img_dir} URL for the directory with theme’s images
{$css_dir} URL for the directory with theme’s CSS
{$modules_dir} URL for the directory with modules
{$mail_dir} URL for the directory with mail templates
{$js_dir} URL for the directory with theme’s JavaScript
{$tpl_dir} URL for the directory with current theme’s
{$pic_dir} URL for the directory with uploaded pictures
{$lang_iso} ISO code for the current language
{$cart_qties} Number of products in the cart
{$come_from} URL for the visitor’s origin
{$shop_name} Shop name
{$currency} Currency object (currently used currency).
{$currencies} The various available currencies
{$id_currency_cookie} ID of the current currency
{$cookie} User cookie
{$languages} The various available languages
{$priceDisplay} Price display method (with or without taxes…)
{$roundMode} Rounding method in use
{$logged} Indicates whether the visitor is logged to a customer account
{$page_name} Page name
{$customerName} Client name (if logged in)
{$use_taxes} Indicates whether taxes are enabled or not
[Total: 1    Average: 5/5]

How to create a widget area in wordpress theme

How to enable widget area in wordpress theme

Custom widget area is enabled from function.php that is available in the themes folder.
Add the following code in function.php to enable/register widget area in the wordpress theme:

How to add widget area in wordpress theme

Once you have enabled the function in function.php you can make any area as a widget area within a wordpress theme. Add the following code to the area ( sidebar, footer, header ) where you want the widget to to make a slot and add widget to it later from widgets setting panel:

NOTE: If you want more then one area to be widgetized at the same time, then you have to register sidebar in function.php more then once with different names and id’s

Now that you have enabled the widget area as well as created a slot for the widgets to be placed in, you can go to Appearance -> Widgets in admin panel and add the widgets to the slot you have just created.

[Total: 1    Average: 5/5]

Show Siblings or Children of a WordPress Page

It’s useful for making pages’ sub menu in wordpress.

[Total: 1    Average: 5/5]