Created
August 29, 2018 07:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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