Hi there,
I am using the Metabox builder to create Metaboxes.
I would like to add a textarea field to the woocommerce product_category taxonomy. The theme that I'm using is Astra.
I have added this code to my functions.php file:
//custom Metabox test JP
add_filter( 'rwmb_meta_boxes', 'prefix_register_meta_boxes' );
function prefix_register_meta_boxes( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => esc_html__( 'Product categorie text', 'text-domain' ),
'id' => 'product-categorie-text',
'fields' => [
[
'id' => $prefix . 'textarea_1jtphdq0vy',
'type' => 'textarea',
'name' => esc_html__( 'Textarea Field', 'text-domain' ),
],
],
'taxonomies' => ['product_cat'],
];
return $meta_boxes;
}
//Function to dispay the field on the product-category page
add_action( 'woocommerce_after_shop_loop', 'product_category_intro', 13, 3 );
function product_category_intro() {
$value = rwmb_meta( 'textarea_1jtphdq0vy' );
echo $value;
}
The metabox is displaying correctly. But the field is not visible on the product category page. What am I doning wring here?
This is the product category page that I tested: https://bloemenbezorgenhaarlem.com/product-categorie/rozen/