Hide default barcode thumbnails on product page

  • Posts: 44
  • Thank you received: 0
11 years 7 months ago #129853

-- 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.

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: 11 years 7 months ago by denoo.

Please Log in or Create an account to join the conversation.

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #129886

Hi,

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.

  • Posts: 44
  • Thank you received: 0
11 years 7 months ago #129909

Hmmm... Good idea) Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 0
11 years 7 months ago #131638

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

Please Log in or Create an account to join the conversation.

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #131659

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.

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 0
11 years 7 months ago #131739

Thanks. It works.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum