WooCommerce add custom product_type_option

Question

I added custom product_type_option like this

enter image description here

by filter product_type_option hook like this

function rpf_add_wild_card_product_type_option($type_options) {
    $checked = 'no';
    $type_options['wild_card'] = array(
        'id'            => '_wild_card',
        'wrapper_class' => 'show_if_simple',
        'label'         => __('Wild Card', 'woocommerce'),
        'description'   => __('Please check if this product is wild card', 'woocommerce'),
        'default'           => $checked,
    );
    return $type_options;
}
add_filter('product_type_option', 'rpf_add_wild_card_product_type_option', 100, 1);

But, WooCommerce never save Wild Card Field!

I want WooCommerce treat my wild card product type option like Virtual,Downloadable Field.

What should I do in this case?

0
Byeongin Yoon 3 months 0 Answers 10 views 0

Leave an answer