Hi wondered if someone could help me i have this code:
if (isset($data['product_image'])) {
foreach ($data['product_image'] as $image) {
$image = $image.".jpg";
$image = str_replace (" ", "", $image);
$filename = '/home/purchase/public_html/fancydresscostumesonline.co.uk/image/'. $image;
if (file_exists($filename)) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_image SET product_id = '" . (int)$product_id . "', image = '" . $this->db->escape($image) . "'");
} else {
$this->db->query("INSERT INTO " . DB_PREFIX . "product_image SET product_id = '" . (int)$product_id . "', image = 'no_image.jpg'");
}
}
}
This part of the code adds a jpg at the end of the product_image additional images so in my csv the 10 columns which have additional numbers for example in my csv it has: say 00532 so this code adds 00532.jpg once imported the the next part which is the else statement no_image.jpg adds a no_image.jpg but instead of it inserting a no_image.jpg for all the blank cells i would like it to SKIP the blank cells for the additional images which is product_image so if no number in the cell it SKIPS it. but have no clue how to do it.
Hope someone can help
Regards,
Aaron