en Jump to content
  • 1
uddhava

Global Smarty Variables used in Prestashop

Question

20 answers to this question

Recommended Posts

  • 0

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?!)

49818_VkaCqBNm1feLFD94wTAx_t

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0

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á.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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 by creation-handicap

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites

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

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More