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
To install a new PrestaShop theme, you have to download it locally and to extract the archive at your computer. Then, go to your website's admin dashboard and click on Design > Theme and Logo. You will be redirected to the Theme management page where you should click on Upload a theme.
To override a module tpl you have to copy the folder structure and the file you want to override into your theme. Note that the folders may vary but you have to keep the structure. Save this answer.
PrestaShop templates are ready-made designs for online stores running on PrestaShop eCommerce engine. A PrestaShop template package provides the files, images, modules and documentation to help you create a full-fledged e-store.
$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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With