Jump to content

Global Smarty Variables used in Prestashop


Recommended Posts

  • 2 weeks later...
  • 11 months later...
  • 1 month later...

Talking of this subject, what about the order note comment field from checkout?

In the PrestaShop release it cheekily appears as a global Smarty $oldMessage on the page where you enter the note, and then.. it is gone when you click Next!

(On the page after that in checkout the gift wrap message is put into $cart>-gift_message.. But where is the order note?!)


Link to comment
Share on other sites

  • 4 months later...
  • 2 weeks later...
  • 1 year later...

On my search for the GLOBALS Smarty variables in Prestashop i stumbled upon this gem :

( Thx to Matt : http://www.sandfight...shop-uncovered/)


01	 $base_dir { root folder of your shop }
02	$base_dir_ssl { root folder of your shop using HTTPS protocol }
03	$content_dir { root folder of your shop depending on the SSL settings }
04	$img_ps_dir { root folder containing images "/img/" }
05	$img_dir { images folder in your current theme directory }
06	$css_dir { css folder inside the current theme folder }
07	$js_dir { JavaScript inside the theme folder }
08	$tpl_dir { theme root folder }
09	$modules_dir { modules root folder }
10	$mail_dir { mail templates root folder }
11	$lang_iso { current language ISO code }
12	$come_from { previous page address [absolute] }
13	$shop_name { your specified shop name }
14	$cart_qties { total number of products in the cart }
15	$cart { shopping cart contents }
16	$currencies { pulls available currencies }
17	$id_currency_cookie { selected currency id [cookie dependent] }
18	$currency { active currency }
19	$cookie { active cookie }
20	$languages { grabs available languages }
21	$logged { checks whether users is logged in }
22	$page_name { current page's name }
23	$customerName { customer name [session dependent] }
24	$priceDisplay { current price display settings [currency dependent] }


I have no idea if these are all working. I was looking for a global variable that has the

URL of the current page. Anybody knows that ?


Thanks for the list... I have also found out that $module_name works in v1.4.9.0 and im using it in my template to add an active class to the navigation like so...


{if $module_name == 'mymodule'} class="active"{/if}



  • Like 2
Link to comment
Share on other sites

  • 5 months later...

How did Prestashop got the URL for the Media-Server (ccc) ? 

Some Modules seems not to implement the right Smarty-Variable for that.


For example Homeslider & advertising_block & Product-Highlight on startpage still use default-domainname for the images.

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

Thanks Vekia, but that list contains {$base_dir} which does not work under 1.6

I've found this to be the solution:


__PS_BASE_URI__ is a constant defined in prestashop and those can be access through Smarty's {$smarty.const...} tag.

So, use {$smarty.const.__PS_BASE_URI__} en voilá.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...
  • 7 months later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...