Woocommerce:禁用具有交付成本的付款方式 [英] Woocommerce: disable payment method with cost on delivery

查看:29
本文介绍了Woocommerce:禁用具有交付成本的付款方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在选择货到付款作为发货方式时遇到问题:paypal 按钮没有消失,因此用户可以支付两次,这是一种不良行为.

I have a problem when I select cost on delivery as shipment method: the paypal button doesn't disappear, so the user could pay twice and this is a undesirable behaviour.

我附上了一张图片来澄清我的问题,因为我在网上搜索但我没有找到解决方案.

I've attached an image to clarify my problem because I'm searching the web but I don't find the solution.

谢谢

推荐答案

一个很好的方法是通过 jQuery.将以下内容放入您的文档中

A good way how to do this is through jQuery. Put inside the of your document the following

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

然后找到设置结帐页面的文件并输入以下内容:

Then find the file where the checkout page is setup and enter the following:

$(document).ready(function() {
    if ($('input[name=your_radio_name]:checked').val() == "the value when the element should be hidden") {
        $('#id_of_the_element_that_should_be_hidden').hide();
    });
}); 

这篇关于Woocommerce:禁用具有交付成本的付款方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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