Skip to content

Commit

Permalink
[-] BO : FIxBug Correct image language in product
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Nadaud committed Jul 19, 2013
1 parent 3389cf8 commit 5646e68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Expand Up @@ -78,7 +78,7 @@
<tr id="image_id">
<td style="padding: 4px;">
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small_default.jpg" alt="image_id" title="image_id" />
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-small_default.jpg" alt="image_id" title="image_id" />
</a>
</td>
<td id="td_image_id" class="pointer dragHandle center positionImage">
Expand Down Expand Up @@ -313,21 +313,24 @@
{
line = $("#lineType").html();
line = line.replace(/image_id/g, id);
line = line.replace(/en-default/g, path);
line = line.replace(/image_path/g, path);
line = line.replace(/[a-z]{2}-default/g, path);
line = line.replace(/image_path/g, path);
line = line.replace(/image_position/g, position);
line = line.replace(/blank/g, cover);
line = line.replace(/<tbody>/gi, "");
line = line.replace(/<\/tbody>/gi, "");
if (shops != false)
{
$.each(shops, function(key, value){
if (value == 1)
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
});
}
$("#imageList").append(line);
}
$('.fancybox').fancybox();
});
{/literal}
Expand Down
3 changes: 3 additions & 0 deletions controllers/admin/AdminProductsController.php
Expand Up @@ -3659,12 +3659,15 @@ public function initFormImages($obj)
$current_shop_id = (int)$this->context->shop->id;
else
$current_shop_id = 0;

$languages = Language::getLanguages(true);

$data->assign(array(
'countImages' => $count_images,
'id_product' => (int)Tools::getValue('id_product'),
'id_category_default' => (int)$this->_category->id,
'images' => $images,
'iso_lang' => $languages[0]['iso_code'],
'token' => $this->token,
'table' => $this->table,
'max_image_size' => $this->max_image_size / 1024 / 1024,
Expand Down

0 comments on commit 5646e68

Please sign in to comment.