php - Setting a global attribute to an woocommerce product -
i add globally defined attribute product in woocommerce. tried function
update_post_meta( get_the_id(),'_product_attributes',"pa_myglobalattribute");
that didn't work. tried, attribute terms , assign them globalattribute:
update_post_meta( get_the_id(), 'pa_myglobalattribute',$attribute_array);
the attribute array retrieved over:
json_decode(json_encode(get_terms("pa_myglobalattribute")),true);
that didn't work either.
for me, important assign global attribute product, if different user edits attribute, changes assigned products.
any suggestions?
thank you!
Comments
Post a Comment