Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active April 25, 2023 03:49
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 webtoffee-git/c97c4fbbd685b9b700d999a2fc715ae9 to your computer and use it in GitHub Desktop.
Save webtoffee-git/c97c4fbbd685b9b700d999a2fc715ae9 to your computer and use it in GitHub Desktop.
To import images containing comma in image URL - Product Import Export for WooCommerce By WebToffee (https://wordpress.org/plugins/product-import-export-for-woo/)
<?php // do not copy this line
add_filter('wt_woocommerce_product_importer_pre_parse_data', 'wt_alter_image_url');
function wt_alter_image_url($value){
$value = str_replace(" ","",$value);
$image_urls = str_replace(',https', '|https', $value);
return $image_urls;
}
add_filter('wt_woocommerce_product_import_image_separator', 'wt_default_separator');
function wt_default_separator($default_separator){
return '|';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment