Prestashop and smarty php code
NickName:mirko Ask DateTime:2014-11-26T01:53:02

Prestashop and smarty php code

I want to include in prestashop (smarty) in the folder "/themes/my_template/modules/my_modul" a php file in the tpl.

example:

    <?php
include('/tools/smarty/Smarty.class.php');
$smarty = new Smarty;

$vorname="Horst";
$nachname="Meyer";

$smarty->assign('vorname',$vorname);
$smarty->assign('nachname',$nachname);

// ausgabe
$smarty->display('my_template.tpl');
?>

but the variable {$vorname} is not displayed. what am I doing wrong?

Copyright Notice:Content Author:「mirko」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/27133447/prestashop-and-smarty-php-code

More about “Prestashop and smarty php code” related questions

Prestashop and smarty php code

I want to include in prestashop (smarty) in the folder "/themes/my_template/modules/my_modul" a php file in the tpl. example: &lt;?php include('/tools/smarty/Smarty.class.php'); $smarty = new

Show Detail

Prestashop 1.6 php error in smarty_internal_templatebase

PrestaShop 1.6.1.20 PHP 5.6.37 Hi, I tried to install a new module on my website but i end up with this php error that i don't know how to debug. [29-Nov-2018 15:58:11 Europe/Paris] PHP Notice:

Show Detail

smarty getcwd() variable in prestashop

I have to check for file_exists in smarty (prestashop) but I can't find a way to get base directory of prestashop. Is there any way I can return php's getcwd() with smarty? Another good solution i...

Show Detail

Prestashop with smarty_internal_templatebase

PrestaShop 1.6.1.10 PHP 5.5.7 When I turn on debugging in PrestaShop, appear as errors like this, I would fix it, but I do not understand how to fix it. Notice: Undefined index: br in public...

Show Detail

PrestaShop Smarty fatal error

I am really new to PrestaShop and am facing trouble debugging an error in PrestaShop 1.6.1.3 It was working just fine, until I have changed some localization and delivery settings in admin panel. ...

Show Detail

Prestashop 1.6 Smarty template Error

I have problem with my presta (Prestashop Version 1.6.0.13, php 5.3.29) When access from the mobile device I get: Notice: Trying to get property of non-object in /home/salonsho/public_html/tools/s...

Show Detail

Prestashop and Smarty

i have problem with smarty templating on Prestashop. I want to echo product description with html tags (wysiwyg) but it gives me string with striped html tag or nothing. {$product.description_short|

Show Detail

Access to PRESTASHOP 1.6 PHP classes (i.e Product) from SMARTY templates

I'm a kind of newbye at PRESTASHOP/SMARTY environment, but I need to support some friend in trouble. After several wasted hours I`ve decided to ask you. Are there any particularity or standard pro...

Show Detail

Prestashop smarty is not removing the cache

In prestashop I wanted to customize the default bankwire payment module. I have changed many things there in the payment.php file which is working file, but when I tried to change the smarty file(

Show Detail

Is there a conflict between smarty and google analytics (prestashop 1.4)

I'm trying to add a new google analytics event in a form. So I have something like this : &lt;a href="#" name="button1" onclick="dataLayer.push({'event': 'button1-click'});" &am

Show Detail