• Resolved DiZzYZA

    (@dizzyza)


    Hey there

    Quick question. Is it possible to show the meta boxes only on the grouped product pages and not on the simple product pages?

    Keep up the good work!

    $cmb = new_cmb2_box( array(
    ‘id’ => ‘general_product_metabox’,
    ‘title’ => __( ‘General Metabox’, ‘cmb2’ ),
    ‘object_types’ => array( ‘product’ ), // Post type
    // ‘show_on_cb’ => ‘yourprefix_show_if_front_page’, // function should return a bool value
    // ‘context’ => ‘normal’,
    // ‘priority’ => ‘high’,
    // ‘show_names’ => true, // Show field names on the left
    // ‘cmb_styles’ => false, // false to disable the CMB stylesheet
    // ‘closed’ => true, // true to keep the metabox closed by default
    ) );

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Tentatively saying yes. Really all a matter of figuring out a way to determine if currently showing a grouped product or not, for returning true or false in a show_on_cb callback. I assume this is for WooCommerce. Other details that may need to be considered is how easy it may be to switch between product page type. Doesn’t WooCommerce offer simply a checkbox to change that detail?

Viewing 1 replies (of 1 total)
  • The topic ‘CMB2 For Grouped Products’ is closed to new replies.