I would like to export all my products in a CSV, which includes the product code and the image URL.
In the export product page, I have the following fields set to export:
- Product code
- Image URL
- Detailed image
Unfortunately, the above files export the following:
- 10111 (the product code, which is correct)
- (empty cell)
- /home/user/public_html/images/backup/detailed/IMAGE.jpg… (at the end of the file is something like a PHP array)
In other words, none of the available CSV export options gives me a proper URL to the product image.
I did some research and I found out that this is a bug in the program, because the “Image URL” field is actually the THUMBNAIL !!! and the “Detailed image” is something unknown that nobody understands, since the path is wrong (it shows “backup” instead of “original”).
I have concluded that it is not possible to use the Export function to export the real image URL.
Any help would be appreciated.
Thank you.
Problem solved, the bug is in the “exim.php” file and can be fixed easily.
The following patch fixes the “Image URL” CSV export field, so that it returns the main image (full size) of the product.
```php
— exim.php.orig 2011-03-14 16:43:34.000000000 +0200
+++ exim.php 2011-03-14 17:56:42.000000000 +0200
@@ -1167,9 +1167,16 @@
// @object_type - type of image object
function fn_exim_get_image_url($product_id, $object_type, $pair_type, $get_icon, $get_detailed, $lang_code)
{
-
$get_detailed = true;
$image_data = fn_get_image_pairs($product_id, $object_type, $pair_type, $get_icon, $get_detailed, $lang_code);
if (isset($image_data['icon']['absolute_path']) && is_file($image_data['icon']['absolute_path'])) {
return 'http://' . Registry::get('config.http_host') . $image_data['icon']['http_image_path'];
-
} elseif (isset($image_data['detailed']['absolute_path']) && is_file($image_data['detailed']['absolute_path'])) {
-
return 'http://' . Registry::get('config.http_host') . $image_data['detailed']['http_image_path'];
-
} elseif(is_array($image_data) && sizeof($image_data)>0) {
-
foreach ($image_data as $image) { break; }
-
if(isset($image['detailed']['http_image_path']))
-
return 'http://' . Registry::get('config.http_host') . $image['detailed']['http_image_path'];
}
return false;
```