I am using Dokan to develop a multi Vendor store for a client, I have added two custom product fields but on will not save values (the product info) Screen shot.
''' add_action( 'dokan_new_product_added','save_add_product_meta', 10, 2 ); add_action( 'dokan_product_updated', 'save_add_product_meta', 10, 2 );
function save_add_product_meta($product_id, $postdata){
if ( ! dokan_is_user_seller( get_current_user_id() ) ) {
return;
}
if ( ! empty( $postdata['new_field'] ) ) {
update_post_meta( $product_id, 'new_field', $postdata['new_field'] );
}
if ( ! empty( $postdata['new_field_1'] ) ) {
update_post_meta( $product_id, 'new_field_1', $postdata['new_field_1'] );
}
} '''