PrestaShop - 如何在结账过程中在 Smarty 中检索运营商 ID [英] PrestaShop - How to retrieve Carrier ID in Smarty during the checkout process

查看:48
本文介绍了PrestaShop - 如何在结账过程中在 Smarty 中检索运营商 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 PrestaShop 1.5.3.1,我想在结帐流程的付款步骤中检索运营商 ID.

I am using PrestaShop 1.5.3.1 and I want to retrieve the Carrier ID during the Payment step in the checkout process.

在 PrestaShop 1.4 中我使用了 {$id_carrier} 并且它工作得很好,但它在 PrestaShop 1.5.x 中不起作用

In PrestaShop 1.4 I was using {$id_carrier} and it was working just fine, but it is not working in PrestaShop 1.5.x

我想根据所选的运营商显示一种付款方式.

I want to show one payment method depending on selected carrier.

例如:

{if $id_carrier == 1}
    my content
{/if} 

推荐答案

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

On the payment page, you can retrieve the selected Carrier ID using the following Smarty variable:

{$cart->id_carrier}

这适用于前端的任何地方,包括 PrestaShop v1.4.x 和 v1.5.x.

This will work anywhere in the Front-end, both on PrestaShop v1.4.x and v1.5.x.

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

这篇关于PrestaShop - 如何在结账过程中在 Smarty 中检索运营商 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆