wordpress WooCommerce - 禁用可下载购买的运输

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17605900/
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 19:16:37  来源:igfitidea点击:

WooCommerce - Disable shipping for downloadable purchases

wordpresswoocommercecheckoutproductshipping

提问by Alex Holmes

I've just set up a Woocommerce based webstore and I'm very happy with it so far, but I've come across something that isn't necessarily a dealbreaker, though it's annoying for the customer.

我刚刚建立了一个基于 Woocommerce 的网上商店,到目前为止我对它非常满意,但我遇到了一些不一定是破坏交易的事情,尽管这对客户来说很烦人。

Some context: the store is for my band website and sells physical as well as digital media, collecting shipping information for physical media makes a lot of sense of course, however it's unnecessary step if the customer is only buying digital media.

一些背景:商店是为我的乐队网站设计的,出售实体和数字媒体,收集实体媒体的运输信息当然很有意义,但是如果客户只购买数字媒体,则这是不必要的步骤。

I've been searching but not had any luck, is there any way to turn off the shipping if all of the items in the user's cart are digital downloads?

我一直在搜索但没有任何运气,如果用户购物车中的所有项目都是数字下载,有什么办法可以关闭运输吗?

回答by LoicTheAztec

UPDATE For WooCommerce 2.6+ (and 3+)

WooCommerce 2.6+(和 3+)的更新

1) Enabling shipping in WooCommerce (prior)

1) 在 WooCommerce 中启用运输(之前)

You need to go in:

你需要进入:

WooCommerce> Settings> General> Shipping Location(s)(selector), to select a shipping behavior for your e-commerce:

WooCommerce> Settings> General> (selector),为您的电子商务选择运输行为:Shipping Location(s)

enter image description here

在此处输入图片说明

Then save. A new Shipping Tabis going to appear in WooCommerce Settings (in products too).

然后保存。WooCommerce 设置(也在产品中)中将出现一个新的运输选项卡



2) To disable shipping for your downloadable product

2) 禁用可下载产品的运输

You need in your product page edit mode within the Product datametabox to enable:

您需要在产品数据元框中的产品页面编辑模式下启用

  • The downloadable checkbox(as this product is downloadable logically).
  • The virtual checkbox(as this product is not going to be shipped, logically too)
  • 可下载复选框(因为该产品在逻辑上是可下载的)。
  • 虚拟复选框(因为该产品在逻辑上也不会发货)

enter image description here

在此处输入图片说明

When enabling the virtual checkboxthe shipping tab setting will disappear.

启用虚拟复选框后,运输选项卡设置将消失。

enter image description here

在此处输入图片说明

Then updateyour downloadable product.

然后更新您的可下载产品。

Now If you add to cart this downloadable(virtual)productand you go to checkout, there is NOT anymore shipping address or shipping options for this product.

现在,如果您将此可下载(虚拟)产品添加到购物车并去结帐,则该产品不再有送货地址或送货选项。

回答by Ken

Go to WooCommerce => Settings => Shipping => Shipping Destination and uncheck "Collect shipping address even when not required".

转到 WooCommerce => 设置 => 送货 => 送货目的地并取消选中“即使不需要也收集送货地址”。

According to the code, if all items are "virtual" then shipping is not required. If you have the aforementioned box checked, it ignores whether the items are in the cart are physical or virtual and will require the shipping address.

根据代码,如果所有物品都是“虚拟的”,则不需要运输。如果您选中了上述框,它会忽略购物车中的物品是物理的还是虚拟的,并且需要送货地址。

回答by Yahya Hussein

in the new versions of Woocommerce luckily, the tick of a “Downloadable” product type will disable shipping for this product enter image description here

幸运的是,在新版本的 Woocommerce 中,勾选“可下载”产品类型将禁用该产品的运输 在此处输入图片说明