Hello! I added 2 metaboxes to the product category of woocommerce.
Sample code
add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
$meta_boxes[] = array(
'title' => __( 'Box 1', 'lang' ),
'taxonomies' => 'product_cat',
'fields' => array(
[
'type' => 'taxonomy',
'name' => esc_html__( 'Category', 'lang' ),
'id' => 'field_1',
'taxonomy' => 'product_cat',
'field_type' => 'select_advanced',
],
),
);
$meta_boxes[] = array(
'title' => __( 'Box 2', 'lang' ),
'taxonomies' => 'product_cat',
'fields' => array(
[
'type' => 'taxonomy',
'name' => esc_html__( 'Category', 'lang' ),
'id' => 'field_2',
'taxonomy' => 'product_cat',
'field_type' => 'select_advanced',
],
),
);
return $meta_boxes;
} );
If I select a category only in box 1 and save, the empty value is saved.
If, however, I select a category in box 2 and save, both selects show the value I entered in box 2 even if the 2 fields have different IDs.
So it always seems to save the value of the last taxonomy field.
The problem only occurs if the 2 taxonomy fields have the same configuration for the taxonomy attribute ('taxonomy' => 'product_cat').
Woocommerce version 8.0.3
WP version 6.3.1
Metabox version 5.7.5
Meta Box AIO version 1.23.0