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

Popular posts from this blog

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

android - Linear layout children not scrolling -

javascript - Create websocket without connecting -