- Posts: 44
- Thank you received: 0
Hide default barcode thumbnails on product page
12 years 11 months ago - 12 years 11 months ago #129853
by denoo
Hide default barcode thumbnails on product page was created by denoo
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5.14
Hi,
is there an option to hide default barcode thumbnail on product page if some image doesn't exist? I use 6 images for every product in CSV, but actually there can be less of them (3,4,5). The only decision which i found is to comment this line "$image_options = array('default' => true);" in show_block_img.php - missing images are not shown as default images, but I don't know if it's correct to do that.
Thank you.
-- Joomla version -- : 2.5.14
Hi,
is there an option to hide default barcode thumbnail on product page if some image doesn't exist? I use 6 images for every product in CSV, but actually there can be less of them (3,4,5). The only decision which i found is to comment this line "$image_options = array('default' => true);" in show_block_img.php - missing images are not shown as default images, but I don't know if it's correct to do that.
Thank you.
Code:
if(empty($this->popup))
$this->popup = hikashop_get('helper.popup');
//$image_options = array('default' => true);
$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
if($img->success) {
$attr = '';
if (!empty ($this->element->images) && count($this->element->images) > 1) {
$attr = 'onclick="return window.localPage.openImage(\'hikashop_main_image\');"';
}
$html = '<img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="" src="'.$img->url.'"/>';
echo $this->popup->image($html, $img->origin_url, null, $attr);
}
Last edit: 12 years 11 months ago by denoo.
Please Log in or Create an account to join the conversation.
12 years 11 months ago #129886
by nicolas
Replied by nicolas on topic Hide default barcode thumbnails on product page
Hi,
Why not simply upload a blank image instead of the barcode default image in the "images" section of the configuration ?
Why not simply upload a blank image instead of the barcode default image in the "images" section of the configuration ?
Please Log in or Create an account to join the conversation.
12 years 11 months ago #129909
by denoo
Replied by denoo on topic Hide default barcode thumbnails on product page
Hmmm... Good idea) Thanks
Please Log in or Create an account to join the conversation.
12 years 10 months ago #131638
by denoo
Replied by denoo on topic Hide default barcode thumbnails on product page
Hi, Nicolas, unfortunately that decision wasn't
entirely right for me. Using blank images there are blank spaces on product page and when i'm pointing my mouse at theese spaces, it causes showing blank image.
Sorry for my English. I can't find wright words to describe my problem.
Thank you for your answer. I appreciate your time.
Denis
entirely right for me. Using blank images there are blank spaces on product page and when i'm pointing my mouse at theese spaces, it causes showing blank image.
Sorry for my English. I can't find wright words to describe my problem.
Thank you for your answer. I appreciate your time.
Denis
Please Log in or Create an account to join the conversation.
12 years 10 months ago #131659
by nicolas
Replied by nicolas on topic Hide default barcode thumbnails on product page
Then remove the blank images and change the line:
$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
to:
if(!empty($image->file_path)) $img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
That way it will only display the thumbnail if there is an image.
$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
to:
if(!empty($image->file_path)) $img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
That way it will only display the thumbnail if there is an image.
Please Log in or Create an account to join the conversation.
12 years 10 months ago #131739
by denoo
Replied by denoo on topic Hide default barcode thumbnails on product page
Thanks. It works.
Please Log in or Create an account to join the conversation.
Time to create page: 0.175 seconds