Last active
April 25, 2023 03:49
-
-
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/)
This file contains 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
<?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