Auto add all product attributes when adding a new product in Woocommerce(在 Woocommerce 中添加新产品时自动添加所有产品属性)
问题描述
我的一个客户要求根据 Wordpress 的插件 Woocommerce 进行这种奇怪的更改,以便让事情变得更容易"..
A client of mine requested this weird change based on Wordpress' plugin Woocommerce in order to make things "easier"..
是否有可能自动拥有所有产品属性在创建产品时添加?
如果属性中没有输入值,是否可以自动禁用在产品页面上可见"复选框?
Also is it possible to have the "Visible on product page" checkbox automatically disabled if there is no value inputted in the attribute?
非常感谢任何帮助.
编辑(解释):
这就是上面解释的:
推荐答案
这是在创建新产品时自动添加所有现有产品变体 + 术语的方法.
Here is the way to auto add all existing product variations + terms when creating a new product.
代码(评论):
代码位于活动子主题(或活动主题)的 function.php 文件中.经测试有效.
Code goes in function.php file of your active child theme (or active theme). tested and works.
这篇关于在 Woocommerce 中添加新产品时自动添加所有产品属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!