The OC version is 2.0.2.0. We are using an import script that downloads product images from an image provider. In case the image is not available from the provider, a placeholder image with a "we are sorry" kind of message is used instead. If the placeholder image is used, it is always the main image. It's not possible to change that in the administration. We would like to be able to override the placeholder image by adding an image in the administration.
The insertion of the placeholder image is called from catalog/controller/product/product.php
The original OC code that we replaced was:
Code: Select all
if ($product_info['image']) {
$data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
} else {
$data['popup'] = '';
}
if ($product_info['image']) {
$data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
} else {
$data['thumb'] = '';
}
Code: Select all
if ($product_info['external_img'] && !in_array($product_info['external_img'], $this->externalImgInternalStrings)) {
$data['popup'] = $product_info['external_img'];
//$data['thumb'] = $this->model_tool_image->resize($product_info['downloaded_img'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
$data['thumb'] = $product_info['external_img'];
} else {
$data['popup'] = $this->model_tool_image->resize('placeholder.jpg', $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
$data['thumb'] = $this->model_tool_image->resize('placeholder.jpg', $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
}
Code: Select all
$data['images'] = array();
$results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
//$results = array();
foreach ($results as $result) {
$data['images'][] = array(
'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
);
}
Thank you very much
Petr Břeň