Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.