Firstly I am not a PHP programmer and this mod may not be the correct way to do it, but it is how I got it working in Open Cart 1.5.6 using V1.1 Gallery Images.
###### BEGIN EDITS ######
File: catalog\model\catalog\gallimage.php
Comment out or replace the original query with this one.
Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "gallimage_image gi LEFT JOIN " . DB_PREFIX . "gallimage gin ON (gi.gallimage_id = gin.gallimage_id) LEFT JOIN " . DB_PREFIX . "gallimage_image_description gid ON (gi.gallimage_image_id = gid.gallimage_image_id) WHERE gi.gallimage_id = '" . (int)$gallimage_id . "' AND gin.gallimage_id = '" . (int)$gallimage_id . "' AND gid.language_id = '" . (int)$this->config->get('config_language_id') . "'");
File: catalog\controller\module\gallimage.php
Find the foreach loop (about line 20) and replace it with this one
Code: Select all
foreach ($results as $result) {
if (file_exists(DIR_IMAGE . $result['image'])) {
$this->data['gallimages'][] = array(
'title' => $result['title'],
'name' => $result['name'],
'link' => $result['link'],
'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']),
'popup' => $this->model_tool_image->resize($result['image'], 800, 800)
);
}
}
Find the line of code near the top to display the title and replace it with this.
Code: Select all
<div class="box-heading"><?php echo $gallimages[0]['name']; ?></div>
Hope this helps and works for anyone who wants it.
Oh yeah, if you upgrade the module these edits will need to be made again.
If any php guru's know a better way of doing this, please share.
cheers