[英]how to get payment method in shopify
i want to run Ajax when Cash on Delivery option select, how can i get on step=payment_method shopify 当选择“货到付款”选项时,我想运行Ajax,我如何进入step = payment_method shopify
i try this 我尝试这个
$('input[type=radio][name="checkout[payment_gateway]"]').change(function(e) {
$(".step__footer__continue-btn").on("click", function(e) {
//we got only cod here
var textAppend= $("#payment_gateway_id").val();
var gateway = $.trim($('.section--payment-method [for="checkout_payment_gateway_'+$("#payment_gateway_id").val()+'"]').clone().children().remove().end().text());
console.log('value of radio' + gateway);
if (gateway == "Cash on Delivery (COD)" || gateway == "Cash on Delivery") {
if (window.PClevel !== true) {
//my code
}
}
});
});
I am pretty sure you cannot run your own Javascript during checkout like this. 我很确定您无法在这样的结帐过程中运行自己的Javascript。 I might be wrong of course, but have you verified that that is even possible?
我当然可能错了,但是您是否已经证实这是可能的? How are you adding your JS code to checkout in the first place?
首先如何将JS代码添加到结帐?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.