Popular Post uddhava Posted June 1, 2010 Popular Post Share Posted June 1, 2010 On my search for the GLOBALS Smarty variables in Prestashop i stumbled upon this gem : 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 theURL of the current page. Anybody knows that ? 34 Link to comment Share on other sites More sharing options...
Damainman Posted June 2, 2010 Share Posted June 2, 2010 Thank for for this link Link to comment Share on other sites More sharing options...
brandonc503 Posted June 16, 2010 Share Posted June 16, 2010 could you tell me where $base_dir is set at so that i can change all http: to https:thanks Link to comment Share on other sites More sharing options...
uddhava Posted June 16, 2010 Author Share Posted June 16, 2010 Most variables get set by the config files in the /config folder Link to comment Share on other sites More sharing options...
tomerg3 Posted June 16, 2010 Share Posted June 16, 2010 These are all set in /init.php Link to comment Share on other sites More sharing options...
frankblack Posted June 14, 2011 Share Posted June 14, 2011 Thx for the info. But the list seems to be a bit outdated. logged is deprecated, is there any substitute for this?TIA Link to comment Share on other sites More sharing options...
card_demon Posted July 20, 2011 Share Posted July 20, 2011 Talking of this subject, what about the order note comment field from checkout?In the PrestaShop 1.4.2.5 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 More sharing options...
markb Posted November 22, 2011 Share Posted November 22, 2011 (edited) Thx for the info. But the list seems to be a bit outdated. logged is deprecated, is there any substitute for this? TIA Up to date globals are listed on: http://doc.prestashop.com/display/PS14/Creating+a+PrestaShop+module Edited July 14, 2012 by markb (see edit history) Link to comment Share on other sites More sharing options...
Rajesh KT Posted December 1, 2011 Share Posted December 1, 2011 Hi, I have a solution to find the current page. {assign var='pageName' value=$smarty.server.PHP_SELF} {$pageName} the variable 'pageName' print its name with absolute path. then you need to subtr it. Link to comment Share on other sites More sharing options...
justweb Posted December 8, 2011 Share Posted December 8, 2011 Hello, Can i create a global variable in a module ? I want to use this variable in every tpl file in my theme. thx Link to comment Share on other sites More sharing options...
MyWebsiteSpot Posted July 12, 2013 Share Posted July 12, 2013 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} @MyWebsiteSpot 2 Link to comment Share on other sites More sharing options...
vekia Posted July 13, 2013 Share Posted July 13, 2013 well, it's a bit old thread with not all global variables used in 1.5.x version Link to comment Share on other sites More sharing options...
rethus Posted December 27, 2013 Share Posted December 27, 2013 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 More sharing options...
peorthyr Posted May 9, 2014 Share Posted May 9, 2014 well, it's a bit old thread with not all global variables used in 1.5.x version And is there a place to find all the current global variables used in 1.5 but mostly important in 1.6? Link to comment Share on other sites More sharing options...
vekia Posted May 9, 2014 Share Posted May 9, 2014 year ago i create smarty global variable list for prestashop 1.5 you can use all of them in prestashop 1.6 3 Link to comment Share on other sites More sharing options...
Appwards Posted June 6, 2015 Share Posted June 6, 2015 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á. 1 Link to comment Share on other sites More sharing options...
GoFenice Posted October 25, 2015 Share Posted October 25, 2015 (edited) please go through http://blog.gofenice.com/prestashop/global-smarty-variables-used-in-prestashop/ for a list available smarty variables in prestashop. Thanks, Edited October 25, 2015 by GoFenice (see edit history) Link to comment Share on other sites More sharing options...
obewanz Posted February 18, 2016 Share Posted February 18, 2016 could you tell me where $base_dir is set at so that i can change all http: to https: thanks you should be able to accomplish your task/goal by going to backoffice preferences/general and setting "Force the SSL on all pages" to YES Link to comment Share on other sites More sharing options...
creation-handicap Posted October 17, 2016 Share Posted October 17, 2016 (edited) is there a way i can get the search value? as in http://www.creation-handicap.ch/shop/suche?tag=Weihnachtskarten i want to get the value "weihnachten" Update: i got it! it's $search_tag for searching for tags and $search_query for default searching Edited October 17, 2016 by creation-handicap (see edit history) Link to comment Share on other sites More sharing options...
obewanz Posted October 20, 2016 Share Posted October 20, 2016 Up to date globals are listed on: http://doc.prestashop.com/display/PS14/Creating+a+PrestaShop+module Well... I sure cannot find global smarty variables at that link - am I missing something? Link to comment Share on other sites More sharing options...
rocky Posted October 22, 2016 Share Posted October 22, 2016 Look for the following at about line 429 of classes/controller/FrontController.php and you'll find the global variables listed after it: // Useful for layout.tpl 1 Link to comment Share on other sites More sharing options...
[email protected] Posted May 7, 2019 Share Posted May 7, 2019 On 4/25/2019 at 9:36 AM, [email protected] said: Can any one can say how can i active link on top horizontal menu in internal pages. Suppose about us in there are two cms pages but i want about us remain active when click on internal pages of about. please give any solution. Thanks Sumant kumar solved Link to comment Share on other sites More sharing options...
[email protected] Posted May 7, 2019 Share Posted May 7, 2019 how can i get url of -Road to the category Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now