How to get url of current theme in prestashop's .tpl file&

Dmitry picture Dmitry · Sep 15, 2011 · Viewed 51.1k times · Source

I need to get path of image which is located in www.mysite.com/themes/mytheme/img/image.png

=================================================

I've found the answer here: http://prestalab.ru/wiki/peremennye-v-shablonax.

The path to image in my theme will be: {$tpl_dir}img/myimage.png

Answer

mrbangybang picture mrbangybang · Oct 7, 2013

$tpl_uri will return the current theme's path relative to the web root.

Here are some other global variables PrestaShop makes available which may be helpful:

$img_ps_dir       // the PrestaShop image directory
$img_cat_dir      // current category's images directory
$img_lang_dir     // current language's images directory
$img_prod_dir     // current product's images directory
$img_manu_dir     // current manufacturer's images directory
$img_sup_dir      // current supplier's images directory
$img_ship_dir     // current carrier's (shipping) images directory
$img_dir          // current theme’s images directory
$css_dir          // current theme’s CSS directory
$js_dir           // current theme’s JavaScript directory
$tpl_dir          // current theme’s directory (physical path on machine)
$tpl_uri          // current theme's directory (web-root relative path)
$modules_dir      // modules directory
$mail_dir         // mail templates directory
$pic_dir          // pictures upload directory