admin管理员组文章数量:1291117
I need to change the value of all product attributes that have a specific attribute with a specific value.
for example, I have 10 phones with Ram(attribute): 64 GiB (attribute value)
and 5 Phone with Ram(attribute): 64 GB (attribute value)
.
I need to change all products with Ram: 64 GiB
to Ram: 64 GB
, So there will be no 64GiB
anymore, I tried the below code and . but they didn't work
$product_id = 14352; //some product id
$storage = get_the_terms($product_id, 'pa_internal-storage');
$newStorage = '64GB';
update_post_meta($product_id, 'pa_internal-storage', $newStorage);
本文标签: custom taxonomyupdate attribute of specific products in woocommerce
版权声明:本文标题:custom taxonomy - update attribute of specific products in woocommerce 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741517257a2382967.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论