Размер изображения товара берется из настроек админки (Система - Настройки - Изображения):
Сейчас у нас размеры берутся из поля, выделенного красным, а мы попытаемся добавить новое поле (выделено зеленым и по умолчанию его нет) и выводить в наш блок.
Идем в файл mydomainwwwadminviewtemplatesettingstore_form.tpl
Находим блок <div id="tab-image"> а в нём поля таблицы:
<tr>
<td><span class="required">*</span> <?php echo $entry_image_related; ?></td>
<td><input type="text" name="config_image_related_width" value="<?php echo $config_image_related_width; ?>" size="3" />
x
<input type="text" name="config_image_related_height" value="<?php echo $config_image_related_height; ?>" size="3" />
<?php if ($error_image_related) { ?>
<span class="error"><?php echo $error_image_related; ?></span>
<?php } ?></td>
</tr>
Копируем, вставляем за ним же и меняем <?php echo $entry_image_related; ?> на <?php echo $entry_image_related2; ?>, а также все config_image_related_width и config_image_related_height на config_image_related_width2 и config_image_related_height2Теперь в файл mydomainwwwadminlanguagerussiansettingsetting.php и добавим строчку
$_['entry_image_related2'] = 'Размер изображения аксессуаров к товару:';
Дальше правим файл mydomainwwwadmincontrollersettingsetting.php
Находим строчку
$this->data['entry_image_related'] = $this->language->get('entry_image_related');
За ней вставляем:
$this->data['entry_image_related2'] = $this->language->get('entry_image_related2');
Так же ищем
if (isset($this->request->post['config_image_related_width'])) {
$this->data['config_image_related_width'] = $this->request->post['config_image_related_width'];
} else {
$this->data['config_image_related_width'] = $this->config->get('config_image_related_width');
}
if (isset($this->request->post['config_image_related_height'])) {
$this->data['config_image_related_height'] = $this->request->post['config_image_related_height'];
} else {
$this->data['config_image_related_height'] = $this->config->get('config_image_related_height');
}
За ним вставляем с добавленными "двоечками"
if (isset($this->request->post['config_image_related_width2'])) {
$this->data['config_image_related_width2'] = $this->request->post['config_image_related_width2'];
} else {
$this->data['config_image_related_width2'] = $this->config->get('config_image_related_width2');
}
if (isset($this->request->post['config_image_related_height2'])) {
$this->data['config_image_related_height2'] = $this->request->post['config_image_related_height2'];
} else {
$this->data['config_image_related_height2'] = $this->config->get('config_image_related_height2');
}
Ищем
if (!$this->request->post['config_image_related_width'] || !$this->request->post['config_image_related_height']) {
$this->error['image_related'] = $this->language->get('error_image_related');
}
За ним вставляем
if (!$this->request->post['config_image_related_width2'] || !$this->request->post['config_image_related_height2']) {
$this->error['image_related'] = $this->language->get('error_image_related');
}
Ну, и наконец возвращаемся к файлу mydomainwwwcatalogcontrollerproductproduct.php
Отыскиваем наш кусок кода и добавляем "2" к config_image_related_width и config_image_related_height
$results = $this->model_catalog_product->getProductRelated2($this->request->get['product_id']);
foreach ($results as $result) {
if ($result['image']) {
$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width2'), $this->config->get('config_image_related_height2'));
} else {
$image = false;
}
Все теперь можно идти пить пиво! :-)
P.S. Firebug + TotalCommander + Notepad++ - пользуйтесь и будет вам счастье!