Skip to content

Instantly share code, notes, and snippets.

@xadapter
Created August 29, 2018 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xadapter/cd292f5c3995fdc09308ac63b5267731 to your computer and use it in GitHub Desktop.
Save xadapter/cd292f5c3995fdc09308ac63b5267731 to your computer and use it in GitHub Desktop.
Support for YITH Product Bundle with Product Import Export for WooCommerce by Xadapter
add_filter('woocommerce_csv_product_post_columns','woocommerce_csv_product_post_columns',1);
function woocommerce_csv_product_post_columns($default_post_columns=array()){
$default_post_columns['_yith_wcpb_bundle_data'] = 'meta:_yith_wcpb_bundle_data';
return $default_post_columns;
}
add_filter('hf_woocommerce_csv_product_import_allowed_product_types', 'hf_woocommerce_csv_product_import_allowed_product_types', 1);
function hf_woocommerce_csv_product_import_allowed_product_types($allowed_product_types = array()) {
if (class_exists('YITH_WCPB')) {
$yith_bundle = get_term_by('slug', 'yith_bundle', 'product_type');
if ($yith_bundle) {
$allowed_product_types['yith_bundle'] = $yith_bundle->term_id;
}
}
return $allowed_product_types;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment