How can I save a custom field of an attribute in Woocommerce?

后端 未结 4 1981
野趣味
野趣味 2021-01-26 07:21

Old

I am trying to create a custom field in the product attributes in Woocommerce. This to be able to select if an attribute is highlighted or not. For example:

4条回答
  •  旧巷少年郎
    2021-01-26 07:45

    perfect code but change the hook

    add_action('wp_ajax_woocommerce_save_attributes', 'wcb_ajax_woocommerce_save_attributes', 10);
    

    to

    add_action('wp_ajax_woocommerce_save_attributes', 'wcb_ajax_woocommerce_save_attributes', 0);
    

提交回复
热议问题