Prestashop 1.7:如何获取/显示发票上的订单状态

Prestashop 1.7:如何获取/显示发票上的订单状态,prestashop,prestashop-1.7,Prestashop,Prestashop 1.7,我正在尝试获取订单状态,例如“已发货”或“已交付”(甚至是订单状态ID),并将其显示在我的prestashop发票上 这样做的原因是我可以做一个smarty IF语句来检查发票是否已支付。e、 g.如果状态=已发货,则显示发票上已付款 问题是我无法在发票上获取要回显的状态(通过编辑pdf/invoice tpl文件) 我试过: {OrderState::getOrderStates($id_lang)} {$order->current_state} 它不会返回任何东西 如果我执行{Or

我正在尝试获取订单状态,例如“已发货”或“已交付”(甚至是订单状态ID),并将其显示在我的prestashop发票上

这样做的原因是我可以做一个smarty IF语句来检查发票是否已支付。e、 g.如果状态=已发货,则显示发票上已付款

问题是我无法在发票上获取要回显的状态(通过编辑pdf/invoice tpl文件)

我试过:

{OrderState::getOrderStates($id_lang)}
{$order->current_state}
它不会返回任何东西

如果我执行{OrderState::getOrderStates($id_lang)|@var_dump},我将获得转储并可以查看

 { ["id_order_state"]=> NULL
["invoice"]=> string(1) "0" ["send_email"]=> string(1) "1"
["module_name"]=> string(15) "ps_checkpayment" ["color"]=>
string(7) "#4169E1" ["unremovable"]=> string(1) "1"
["hidden"]=> string(1) "0" ["logable"]=> string(1) "0"
["delivery"]=> string(1) "0" ["shipped"]=> string(1) "0"
["paid"]=> string(1) "0" ["pdf_invoice"]=> string(1) "0"
["pdf_delivery"]=> string(1) "0" ["deleted"]=> string(1) "0"
["id_lang"]=> NULL ["name"]=> NULL ["template"]=> NULL }
但是“id\u order\u state”为空

你知道如何检查订单状态或其他检查订单是否已付款的方法吗?

解决了这个问题。它:

$order->current_state
只需从header.tpl文件中取出并在invoice.tpl文件中

尝试以下代码:

{if $order_invoice->isPaid()}

但是你想在哪里这样做呢?它在pdf文件夹的invoice.tpl上。但是解决了它,请参见下面。他为什么要这样做?它做什么?它如何回答问题?@Rob我的答案很清楚。他正在寻找在“invoice.tpl”文件中使用的条件。