Images To


anyone has an idea how to extend the product import to have a product name in the import field or

an idea to perform a query to get product image name...description from product names....

thank you in advance

The easiest way is to:

$image_paths = array();
$product_ids = db_get_fields("SELECT product_id FROM ?:products");
foreach(fn_get_image_pairs($product_ids, 'product', 'M', false, true) as $pair_id => $pair_data) {
  if( !empty($pair_data['detailed']['image_path']) )
    $image_paths[$pair_data['object_id']] = $pair_data['image_path'];

This will return you an array of the "Main Pair" paths indexed by the product_id (I.e. the primary image).

You can make it lighter and faster by doing direct queries to the DB with an inner join, but this is by far the easiest method since it calculates the file locations for you based on your MAX_FILES_IN_DIR setting.