订单确认页面Prestashop中的订单id

订单确认页面Prestashop中的订单id,prestashop,prestashop-1.6,Prestashop,Prestashop 1.6,我正在尝试获取订单id以确认订单。我正在使用cashondelivery模块,我搜索了.php文件,但不知道如何声明它。有什么想法吗? 谢谢试试: {$smarty.get.id_order} 关于文件“cashondelivery.php”中的,您应该编辑或覆盖函数“hookPaymentReturn”,如下所示: public function hookPaymentReturn($params){ if (!$this->active) return ;

我正在尝试获取订单id以确认订单。我正在使用cashondelivery模块,我搜索了.php文件,但不知道如何声明它。有什么想法吗? 谢谢

试试:

{$smarty.get.id_order}
关于文件“cashondelivery.php”中的

,您应该编辑或覆盖函数“hookPaymentReturn”,如下所示:

public function hookPaymentReturn($params){
    if (!$this->active)
        return ;
    $this->smarty->assign(array(
        'id_order' => $params['objOrder']->id
    ));
    return $this->display(__FILE__, 'confirmation.tpl');
}

现在,您应该能够在confirmation.tpl中使用{$id_order}变量,它可以在.php中添加smarrty,只需声明为global:global$smarty;谢谢是的,你说得对,我忘了“全球$smarty;”。。。如果我的评论对您有帮助,请接受我的回答:)。请不要回答低质量的问题。尽管您的代码片段可能是属于“任何想法”的众多想法之一,但问题本身并不符合这些想法。