如何在.tpl文件prestashop中使用php

如何在.tpl文件prestashop中使用php,php,smarty,prestashop,Php,Smarty,Prestashop,我刚刚在我的prestashop网站上集成了一个web marchant插件,web marchant的一个要求是我在提交订单后显示一条错误或成功消息。因此,如果成功或失败,我可以从url获得操作。根据我在这里读到的,我需要改变 这: require_once(_PS_SMARTY_DIR_.'Smarty.class.php'); global $smarty; $smarty = new Smarty(); 为此: require_once(_PS_SMARTY_DIR_.'Smarty

我刚刚在我的prestashop网站上集成了一个web marchant插件,web marchant的一个要求是我在提交订单后显示一条错误或成功消息。因此,如果成功或失败,我可以从url获得操作。根据我在这里读到的,我需要改变

这:

require_once(_PS_SMARTY_DIR_.'Smarty.class.php');

global $smarty;
$smarty = new Smarty();
为此:

require_once(_PS_SMARTY_DIR_.'SmartyBC.class.php');

global $smarty;
$smarty = new SmartyBC();
我已经这样做了,然后我把它添加到我想显示从$\u get[]变量得到的响应的页面中

{php}
/**
*@authour 
*@return Order response
*4/15/2015
**/
    echo urldecode(base64_decode($_GET['gtpay_error']));
    echo '<br>';
    echo urldecode(base64_decode($_GET['gtpay_tranid']));
{/php}
试试这个:

{$smarty.get.gtpay_error}
$\u GET是Smarty的保留变量,有关详细信息,请查看此链接:
我发现我的答案很简单。我只需要删除{php}{/php}标记,因为页面已经为我处理了这个问题。

我得到了错误解析错误:语法错误,在/home/thelibra/public_html/tools/smarty/SmartyBC.class.php(464):eval()'d代码第2行。请查看我的编辑。您的代码中仍然有$\u get,替换为
{urldecode(base64_decode($smarty.get.gtpay_tranid))};
Parse error: syntax error, unexpected '=' in /home/thelibra/public_html/tools/smarty/SmartyBC.class.php(464) : eval()'d code on line 2
{$smarty.get.gtpay_error}