禁用阿贾克斯结帐WooCommerce [英] Disable AJAX on checkout for WooCommerce

查看:104
本文介绍了禁用阿贾克斯结帐WooCommerce的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问问我怎么会在结帐页面禁用AJAX(您输入发货和账单信息),而不是使用AJAX来更新根据您的位置在车总结说,那就做一个自然的更新刷新。

I'd like to ask how I could disable AJAX at the checkout page (where you enter shipping and billing information) and that instead of using AJAX to update the cart summary based on your location, it would update by doing a natural refresh.

目前的车汇总会自动更新无需重新加载页面,每当用户通过海运的位置开关的位置。我想删除AJAX,只是在页面重新加载与更新的信息。

Currently the cart summary would update itself without reloading the page whenever the user switches their location via shipping location. I'd like to remove that AJAX and just have the page reload with the updated information.

我也不太清楚什么样的codeS或指示我应该指向,但我已经准备好提供一切必要的细节。只要让我知道!谢谢!!

I'm not too sure what sort of codes or direction I should be pointing at but I'm ready to provide whatever details necessary. Just let me know! Thank you!!

推荐答案

所有WooCommerce字符串被正确本地化与 wp_localize_script ,所以我想你可以通过创建正确转换它们相应的.po /的.mo文件,但我承认我没有很多与翻译经验。供参考:所有可用的语言包在Github上,你可能还需要阅读文档

All WooCommerce strings are properly localized with wp_localize_script so I would think you could correctly translate them by creating the appropriate .po/.mo file, but I confess to not having a lot of experience with translations. For reference: all available language packs are at Github and you might also want to read the documentation.

总之,结账脚本都在 checkout.js 。如同任何脚本,您可以通过 wp_dequeue_script出列,它() 只要你知道把手。

Anyway, the checkout scripts are all in checkout.js. Like any script you can dequeue it via wp_dequeue_script() as long as you know the handle.

function so_27023433_disable_checkout_script(){
    wp_dequeue_script( 'wc-checkout' );
}
add_action( 'wp_enqueue_scripts', 'so_27023433_disable_checkout_script' );

这篇关于禁用阿贾克斯结帐WooCommerce的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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