Setting Vendor from Frontend
-
Hi,
I’m trying to create a product by developing a frontEnd Form.
The product is created and I received the mail “Hello! A vendor ( UserTest ) has added a new product awaiting review.”
But when I look the table Products in the WP Admin panel the column “Vendors” is not setted.
$post_information = array( 'post_title' => wp_strip_all_tags( $_POST['postTitle'] ), 'post_type' => 'product', 'post_status' => 'pending' ); $post_id = wp_insert_post( $post_information ); $currentUser = wp_get_current_user(); wp_set_object_terms($post_id , array('Economy'), 'product_cat'); wp_set_object_terms($post_id , array($currentUser), 'taxonomy- wcpv_product_vendors');
The taxonomy product_cat works fine, but with a similar approach the vendors column has not been setted.
I think the problem is that $currentUser is not the right parameter, what should I pass ?
Thanks for your help
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Setting Vendor from Frontend’ is closed to new replies.