Answer the question
In order to leave comments, you need to log in
How to set 'manage inventory' parameter in woocommerce php?
There is a code for adding a product:
$post_id = wp_insert_post(array(
'post_title' => 'Тест продукт',
'post_type' => 'product',
'post_staus' => 'publish',
'post_content' => 'Большое описание',
'post_excerpt' => 'Краткое описание',
'post_category' => array(0)
));
wp_set_object_terms( $post_id, 'Категория', 'product_cat' );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question