How to add product in woocommerce with php code [closed]
The method below is now out of date as WooCommerce have added the wc_product_meta_lookup table which also needs to be updated with some of the meta values. Woo have now provided a CRUD interface so use that instead. $post_id = wp_insert_post( array( ‘post_title’ => $title, ‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘post_content’ => $body, )); … Read more