问题描述
我使用以下代码为产品添加产品属性:
$i = 0;
foreach ($_attributes as $name => $value) {
wp_set_object_terms($post_id,$value,$name,true);
$product_attributes[$i] = array (
'name' => $name,'value' => $value,'is_visible' => 0,'is_variation' => 1,'is_taxonomy' => 1
);
$i++;
}
update_post_meta($post_id,'_product_attributes',$product_attributes );
,但会删除所有以前的产品属性。如何在上一个商品属性之后添加新商品属性?我必须使用update_post_meta()。
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)