Prestashop 模板 - 带有下划线字符的聪明人不起作用

Prestashop template - smarty with underscore character do not work

我需要在 order-confirmation.tpl 模板中添加转换代码。 但是,如果变量名中有下划线(也许我只尝试了几个)字符,则输出为空 array()。 例如:

{$order.details.payment} <- this works
{$order.details.id_customer} <- this do NOT works
{$order.details.total_paid_tax_incl} <- this do NOT works also

我的目标是将产品的总价输出到 template($order.details.total_paid_tax_incl} 有什么建议么?对这个问题有经验吗?

我尝试打印 {$order.details} 的输出,所以所有数据都应该在这里。 输出:

 PrestaShop\PrestaShop\Adapter\Presenter\Order\OrderDetailLazyArray Object
(
    [order:PrestaShop\PrestaShop\Adapter\Presenter\Order\OrderDetailLazyArray:private] =&gt; Order Object
        (
            [id_address_delivery] =&gt; 21013
            [id_address_invoice] =&gt; 21013
            [id_shop_group] =&gt; 1
            [id_shop] =&gt; 1
            [id_cart] =&gt; 1189
            [id_currency] =&gt; 1
            [id_lang] =&gt; 1
            [id_customer] =&gt; 8673
            [id_carrier] =&gt; 43
            [current_state] =&gt; 10
            [secure_key] =&gt; a69d00482b1df2d13bd9a424c3a71f08
            [payment] =&gt; Platba bankovním převodem
            [module] =&gt; ps_wirepayment
            [conversion_rate] =&gt; 1.000000
            [recyclable] =&gt; 0
            [gift] =&gt; 0
            [gift_message] =&gt; 
            [mobile_theme] =&gt; 0
            [shipping_number] =&gt; 
            [total_discounts] =&gt; 0.000000
            [total_discounts_tax_incl] =&gt; 0.000000
            [total_discounts_tax_excl] =&gt; 0.000000
            [total_paid] =&gt; 312.000000
            [total_paid_tax_incl] =&gt; 312.000000
            [total_paid_tax_excl] =&gt; 274.000000
            [total_paid_real] =&gt; 0.000000
            [total_products] =&gt; 179.000000
            [total_products_wt] =&gt; 217.000000
            [total_shipping] =&gt; 95.000000
            [total_shipping_tax_incl] =&gt; 95.000000
            [total_shipping_tax_excl] =&gt; 95.000000
            [carrier_tax_rate] =&gt; 0.000
            [total_wrapping] =&gt; 0.000000
            [total_wrapping_tax_incl] =&gt; 0.000000
            [total_wrapping_tax_excl] =&gt; 0.000000
            [invoice_number] =&gt; 0
            [delivery_number] =&gt; 0
            [invoice_date] =&gt; 0000-00-00 00:00:00
            [delivery_date] =&gt; 0000-00-00 00:00:00
            [valid] =&gt; 0
            [date_add] =&gt; 2019-04-25 08:00:32
            [date_upd] =&gt; 2019-04-25 08:00:33
            [reference] =&gt; 427-2019
            [round_mode] =&gt; 2
            [round_type] =&gt; 3
            [webserviceParameters:protected] =&gt; Array

尝试:{$order.totals.total.value}

此致

您似乎试图从对象中获取数据,但使用的是数组语法。尝试 $order->id_customer$order->id_carrier