WooCommerce hide fields on product_cat ids not working

Support MB Show Hide WooCommerce hide fields on product_cat ids not workingResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12154
    pw@grafik-designer-hannover.de[email protected]
    Participant

    Hey folks. i try to hide fields only on categories from Woocommerce custom post type category = product_cat - with the code below it is not working. i need to hide only fields not meta boxes.
    The product id of the Woocommerce product_cat equals 18.

    I think something is wrong here, but i can't figure out where. Can you please assist?

    In Woocommerce i also have products assigned to different product_cats and i need to hide some of the fields on one but not the other category - is that possible?

    array (
                    'id' => 'lautstaerke_minimum',
                    'type' => 'text',
                    'name' => 'Lautstärke Minimum',
                    'desc' => 'Beispiel 49 dB (A)',
                    'std' => '49 dB (A)',
                    'tab' => 'geraet',
                    '' => '',
                    'hidden' => 
                    array (
                        'when' => 
                        array (
                            0 => 
                            array (
                                0 => 'product_cat',
                                1 => '=',
                                2 => 18,
                            ),
                        ),
                        'relation' => 'or',
                    ),
                ),
    #12180
    Anh TranAnh Tran
    Keymaster

    Hi,

    I see you're using the syntax for MB Conditional Logic instead of Meta Box Show Hide. This code is created with MB Builder, which only supports Conditional Logic. So to use Show Hide, please modify the syntax to match the rules here.

    If you want to use Conditional Logic, please note that the taxonomy value is an array, so you should use in or contains, like this:

    array( 'tax_input[product_cat]', 'contains', 18 )

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.