Programatically adding product variations?
-
Hello,
Is there a way to programatically insert a variation on a product? Since they’re just the custom post type “product_variation” then I could just use wp_insert_post right? The problem is, attaching that post as metadata to a product.
What would I put in add_post_meta on product to add. Something like:
update_post_meta(product_id, variation_meta_key, array(wp_insert_post))IDK what woocommerce uses as the meta key for the variations, nor how in what format the variations are stored there. Is there a way faster way to do this??
Thank you!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Programatically adding product variations?’ is closed to new replies.