英文:
Bulk change the tax status from all products in WooCommerce
问题
我正在更改我的业务类型,这将不允许我收取产品税 - 即,所有产品都必须免税。
因此,有超过1200个产品,我如何将状态从“应税”更改为“不应税”?
我已经看到帖子元数据表保存了每个产品的税收状态 - 它们都设置为“应税”,但我没有找到应该设置为“不应税”的值。
我知道我可以更改网站以不收税(我已经这样做了),但我想清理产品定义以保持一切正确。
我只想在数据库上运行以下命令:
update myshop_postmeta set meta_value = "???" where meta_key = "_tax_status"
在将???
替换为正确的值后。
请问有人可以指导我正确的方向吗?
英文:
I am changing my business type, which will not permit me to collect tax on products - ie, all products must be without tax.
So, with over 1200 products, how can I change the status from 'taxable' to not taxable ?
I have seen that the posts_meta table holds the tax status for each product - they are all set to "taxable", but I have not been able to find what it should be set to for not taxable.
I know that I can change the site to not charge tax (which I have done), but I want to clean up the product definitions to keep everything correct.
I am wanting to simply run the following command on the database :
update myshop_postmeta set meta_value = "???" where meta_key = "_tax_status"
After having replace the ???
with the right value.
Can anyone point me in the right direction, please ?
答案1
得分: 2
将所有WooCommerce产品的税务状态批量设置为"none",数据库中有2个相关的表需要更新(因此有2个SQL查询):
UPDATE wp_postmeta as pm SET pm.meta_value = 'none' WHERE pm.meta_key = '_tax_status';
UPDATE wp_wc_product_meta_lookup as pml SET pml.tax_status = 'none';
您应该首先检查您的数据库表前缀(默认情况下为wp_
)。
在WooCommerce管理产品列表上,您还可以使用"批量操作"来同时编辑多个产品的税务状态。
英文:
To bulk set all WooCommerce products tax status to "none", There are 2 related tables in the database to update (so 2 SQL queries):
<!-- language: lang-sql -->
UPDATE wp_postmeta as pm SET pm.meta_value = 'none' WHERE pm.meta_key = '_tax_status';
UPDATE wp_wc_product_meta_lookup as pml SET pml.tax_status = 'none';
> You should first check your database tables prefix (by default it is wp_
)
This is tested and perfectly works, using for example PhpMyAdmin.
On WooCommerce Admin Products list, you could also use the "Bulk actions" to edit the tax status of multiple products at once.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论