Prestashop获得运营商ID

Lif*_*ort 1 smarty prestashop prestashop-1.5

我正在使用prestashop 1.5.3.1,我希望在订单支付步骤中获得运营商ID.

在prestashop 1.4我使用{$id_carrier}它并且它工作正常,但它在ps 1.5中不起作用

我想根据选定的运营商显示一种付款方式.例如:

{if $id_carrier == 1}
    my content
{/if} 
Run Code Online (Sandbox Code Playgroud)

Bru*_*que 8

在付款页面上,您可以使用以下Smarty变量检索所选的运营商ID:

{$cart->id_carrier}
Run Code Online (Sandbox Code Playgroud)

这将适用于PrestaShop v1.4.x和v1.5.x的前端任何位置.

{if isset($cart->id_carrier) && $cart->id_carrier == 1}
   {* Do some stuff here *}
{/if}
Run Code Online (Sandbox Code Playgroud)