有什么方法可以防止Woocommerce默认使用一种特定的(本地取件)送货方式? [英] Is there any way to prevent Woocommerce from defaulting to one particular (local pickup) shipping method?

查看:125
本文介绍了有什么方法可以防止Woocommerce默认使用一种特定的(本地取件)送货方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要阻止Woocommerce默认使用本地提货选项

我确实需要为客户提供本地取货服务,但没有默认设置。

I do need the local pickup as and option for customers, but not as a default.

我有遇到我认为是 woocommerce中的错误,并且记录了一种解决方法;但是该解决方案对我而言不起作用,因为(除了破解Woocommerce核心之外),我也不想默认为最昂贵的方法,这就是解决方法的工作方式,因为我有高级方法。

I have encountered what I think is a bug in woocommerce and there is a workaround documented; but the workaround will not work for me because ( apart from hacking the Woocommerce core ) I don't want to default to the most expensive method either, which is how the workaround operates, because I have premium methods.

Woocommerce设置 woocommerce设置>中有一个默认方法设置。运送>运送方式>单选按钮在左侧页面上按下 ...,但它似乎忽略了此操作,默认为最便宜的方法。

There is a setting for default method in the Woocommerce settings woocommerce settings > shipping > shipping methods > radio buttons down the page on the left ... but it appears to be ignoring this and defaulting to the cheapest method. There is also a ( superfluous setting to pick the cheapest option )

还有一个(多余的设置来选择最便宜的选项)。因此,就目前而言,而不是尝试解决此问题,如果我能以某种方式将Woocommerce从默认设置改为本地取件选项(或强加我自己的手动默认设置),那么对我来说这将是一个可用的解决方法。

There is already a bug report with Woocommerce; so for now rather than trying to fix that, if I could somehow just override Woocommerce from defaulting to the local pickup option ( or impose my own manual defaults ) then for me that would be a usable workaround.

编辑::如果同时启用免费送货和本地取件,这似乎会出现-github问题在这里 https://github.com/woothemes/woocommerce/issues/7721

this seems to arise if both free shipping and local pickup are enabled - github issue here https://github.com/woothemes/woocommerce/issues/7721

推荐答案

我刚刚与我的客户打交道。您可以在运送选项中将任何运送服务设置为默认服务。但是,当新客户尚未输入邮政编码时,就会出现问题。没有邮政编码,USPS / UPS /其他运输服务将无法生成报价...这使本地取货成为购物车页面上唯一的现有选项。

I just dealt with this issue with my client. You can set any shipping service as the default in the shipping options. However, a problem occurs when a new customer has yet to enter a zip code. Without a zip code USPS/UPS/other shipping services can't generate quotes... which leaves local pickup as the only existing option on the cart page.

我们最终要做的是配置两个选项:隐藏运输成本,直到输入ZIP,然后在购物车页面上禁用运输计算器。

What we ended up doing for the time being is configuring two options: hiding shipping costs until ZIP is entered and disabling the shipping calculator on the cart page.

由于某种原因,我不确定为什么,我也需要在我的实时网站上使用以下代码段:

For some reason, and I'm not sure why, I also needed this snippet on my live site:

// hide shipping on the cart page
add_filter( 'woocommerce_cart_ready_to_calc_shipping', 'so_28974941_hide_cart_shipping' );
function so_28974941_hide_cart_shipping( $show ){
    if( is_cart() ){
        $show = false;
    }
    return $show;
}

这篇关于有什么方法可以防止Woocommerce默认使用一种特定的(本地取件)送货方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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