wordpress 隐藏或删除“运送到不同地址”?Woocommerce 插件中的复选框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40743883/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 11:15:43  来源:igfitidea点击:

Hiding or Deleting the "Ship to a Different Address?" checkbox in Woocommerce plugin

wordpresswoocommerce

提问by Ehsan

I've been looking for a working solution to either hide or delete the "Ship to a different address?" checkbox in Woocommerce checkout page in Wordpress, but I haven't figured out how to do so, so far. Is there any way to do this?

我一直在寻找一种有效的解决方案来隐藏或删除“运送到其他地址?” Wordpress 中 Woocommerce 结帐页面中的复选框,但到目前为止我还没有想出如何做到这一点。有没有办法做到这一点?

By the way, I use Sahifa theme.

顺便说一下,我使用 Sahifa 主题。

Any help is greatly appreciated.

任何帮助是极大的赞赏。

回答by Stanimir Stoyanov

There is an option that allows you to remove this checkbox along with shipping section. Go to

有一个选项允许您删除此复选框以及运输部分。去

Administration->Woocommerce->Settings->Shipping->Shipping Options

管理->Woocommerce->设置->运输->运输选项

and find Shipping Destination, and make sure that Force shipping to the customer billing addresscheckbox is checked.

并找到Shipping Destination,并确保Force shipping to the customer billing address选中复选框。

回答by Awais Umar

In case someone wants to remove it using code, it is doable by adding this filter to your functions.php

如果有人想使用代码删除它,可以通过将此过滤器添加到您的functions.php

add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false');

Hope this helps.

希望这可以帮助。

回答by Pratik Luther

Simply add this code to functions.phpfile

只需将此代码添加到functions.php文件中

add_filter( 'woocommerce_ship_to_different_address_checked', '__return_false' );