How to add a custom field in woocommerce product category using meta box plugin

1.8k Views Asked by At

I just want to add a custom field in the product category page in admin using the metabox plugin https://metabox.io/

This is in woocommerce and this is what I have

add_filter( 'rwmb_meta_boxes', 'product_register_meta_boxes' );    
function product_register_meta_boxes( $meta_boxes )
    {
        $prefix = 'product_';

        $meta_boxes[] = array(
            'id'         => 'product_cat_keywords_search',
            'title'      => __( 'Searchable keywords', 'your-prefix' ),
            'post_types' => array( 'product'),
            'taxonomy'   => array( 'product_cat'),
            'context'    => 'normal',
            'priority'   => 'low',
            'fields'     => array(

                array(
                    'name'  => __( 'Product Category Keywords', 'your-prefix' ),
                    'id'    => "{$prefix}pcat_keywords",
                    'desc'  => __( 'Category Keywords', 'your-prefix' ),
                    'type'  => 'text',
                    'std'   => __( '', 'your-prefix' ),
                    'clone' => true,
                    'clone-group' => 'my-clone-group2',
                ),

                )
        );  

        return $meta_boxes;
    } 

This code only appears in product page and not in product category page.

I need to use metabox since I will be using the clone feature, thanks

0

There are 0 best solutions below