Sidebar and Default Category
-
hi,
2 questions:
1- I can not disable sidebar, i tryed from backoffice to uncheck, but does not work.
2- Is it possible to set a default category when a vendor upload a new product?
I used this code to auto create a product when a vendor create an account, and it is working, but no category is assegned to the product:add_action( ‘wcfmmp_new_store_created’, function( $member_id, $wcfmmp_settings ) {
$product_args = array(
‘post_title’ => ‘Donacion’,
‘post_status’ => ‘publish’,
‘post_type’ => ‘product’,
‘post_author’ => $member_id,
‘post_name’ => sanitize_title(‘Donacion’)
);
$new_product_id = wp_insert_post( $product_args, true );
update_post_meta( $new_product_id, ‘_wcfm_product_author’, $member_id );// Set Product Type
wp_set_object_terms( $new_product_id, ‘simple’, ‘product_type’ );// Set Price
update_post_meta( $new_product_id, ‘_regular_price’, ’10’ );
update_post_meta( $new_product_id, ‘_price’, ’10’ );
}, 50, 2 );Thanks a lot your plugin Rock !!!
The page I need help with: [log in to see the link]
- The topic ‘Sidebar and Default Category’ is closed to new replies.