PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

Global Smarty Variables used in Prestashop

9 replies to this topic
#1
uddhava

    PrestaShop Addict

  • Members
  • PipPipPip
  • 626 posts
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 ?
Was your post not answered? Don't fret but DO give more info.. Some threads are so unclear that an answer will never come.

For hire for Prestashop customizations and iDeal integration

#2
Damainman

    PrestaShop Newbie

  • Members
  • Pip
  • 12 posts
Thank for for this link :)

#3
brandonc503

    PrestaShop Apprentice

  • Members
  • PipPip
  • 132 posts
could you tell me where $base_dir is set at so that i can change all http: to https:
thanks

#4
uddhava

    PrestaShop Addict

  • Members
  • PipPipPip
  • 626 posts
Most variables get set by the config files in the /config folder
Was your post not answered? Don't fret but DO give more info.. Some threads are so unclear that an answer will never come.

For hire for Prestashop customizations and iDeal integration

#5
tomerg3

    PrestaShop Superstar

  • US Moderators
  • 5753 posts
These are all set in /init.php
Posted Image
For the latest updates discount coupons and new module information follow us on Twitter , Facebook ,and tips on our Blog
Please do not send general questions via PM, that is what the forum is for...

#6
frankblack

    PrestaShop Newbie

  • Members
  • Pip
  • 5 posts
Thx for the info. But the list seems to be a bit outdated. logged is deprecated, is there any substitute for this?

TIA

#7
card_demon

    PrestaShop Newbie

  • Members
  • Pip
  • 1 posts
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?!)

Attached Files



#8
markb

    PrestaShop Apprentice

  • Members
  • PipPip
  • 27 posts

View Postfrankblack, on 14 June 2011 - 03:10 PM, said:

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://forge.prestas...splayingcontent

#9
Rajesh KT

    PrestaShop Newbie

  • Members
  • Pip
  • 10 posts
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.

#10
justweb

    PrestaShop Apprentice

  • Members
  • PipPip
  • 66 posts
Hello,

Can i create a global variable in a module ?
I want to use this variable in every tpl file in my theme.

thx