交货选择隐藏/显示付款方式prestashop [英] Prestashop on delivery select hide/show payment method

查看:940
本文介绍了交货选择隐藏/显示付款方式prestashop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何显示在交付方法/隐藏支付方式中进行选择。

I'm trying to figure out how to show/hide payment method on delivery method select.

我trye​​d几个解决方案,但它并没有为我工作。

I tryed couple solutions but it didn't worked for me.

其中之一是这个:

<script>
   $(document).ready(function(){
       toggleFields();

       $('.delivery_option_radio').on('change', function() {
           toggleFields();
       });
   });

   function toggleFields() {
       if ($('#delivery_option_3_0').is(':checked')) {
          alert("Selected")
       } else {
          alert("Not Selected");
       }
   }
</script>

问题是,它工作得2倍。例如:

Problem is that it works just 2 times. Example:

页面加载后,警告框出现,并显示:选择的话,我选择其它单选按钮,显示未选择,然后停止工作

Page loads, alert box appears and shows: Selected, then I select other radio button it shows "Not Selected" and then it stops working.

任何解决方案?我发现这个教程在这里:

Any solutions ? I found this tutorial here:

http://jsfiddle.net/ngaK8

我看,这可能是一些与阿贾克斯..我必须重装我的jQuery,因为交付单选按钮使用AJAX来计算总价。

I read that it could be something with ajax.. that I have to reload my jQuery because delivery radio buttons uses ajax to calculate total price.

推荐答案

没有必要另外code开发的麻烦。使用非常优秀且免费的 船舶支付 模块。工程与1.6 / 1.5,甚至1.4

No need to another code development hassle. Use very good and free Ship to Pay module . Works with 1.6/1.5 and even with 1.4

如何的作品? 你有恩。货到付款送货/付款方式。因此,在接下来的支付步骤您的客户将不会看到任何Bankwire,贝宝,拿起商店选择货到付款COD的方法只有一个现金。

How its works? You have ex. Cash on Delivery shipping/payment method. So in next Payment step Your customer will not see any Bankwire, PayPal, Pick Up in Store options just one Cash on Delivery COD method.

下一个例子。客户希望直接在店里取货订单。他选择交货选项拿起在商店和支付mehtods不会看到交货付款方式或PayPal / Bankwire选择现金。

Next example. Customer want Pick up order directly in store. He choose Delivery option Pick up in Store and in Payment mehtods will not see Cash on Delivery payment method or PayPal/Bankwire options.

这篇关于交货选择隐藏/显示付款方式prestashop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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