Lost my links in images shown with display(...)

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 6 months ago #190476

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 2.5

I used to have a custom view in which I obtained clickable thumbnails which opened a large image when clicked.

This was the code

echo $this->image->display($image->file_path, false, '', '','', 140, $height);

Now I don't know since how this "clickable feature" is not working anymore even I haven't changed the code at all.

Since it was implemented several minor HikaShop updates have arrived and some general configuration setting may have been changed.

I don't know how to find a "switch" that gives clickability back to my images.

Please could you help me?

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

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 6 months ago #190478

Are the display function parameters explained somewhere?

It could be not about HikaShop upgrades that the function disappeared but because of some code change I made in the parameters of the fuction... but I'm really lost without knowing much about it

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

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 6 months ago #190479

It is ridiculous, it was me that 14 months ago demanded the feature of disabling the link!

I just have to change the "false" parameter with 'hikashop_main_image'


But this brings me to another question:

Can be this 'hikashop_main_image' parameter replaced by another one that leads to open the product URL instead of the single image?

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 6 months ago #190503

Hi,

I don't see any hikashop_main_image parameter anywhere in the code and don't know which view file you're talking about when you say that you added a line to set that parameter to false.
Could you give more information on what you're talking about ?
Is it on a listing, a product page ? Do you have a link maybe so that we can see what you have now ?

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

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 6 months ago #190560

From a template override for show_default.php I make this call:

echo $this->image->display($image->file_path, false, '', '','', 320, $height);

and I see that this helper file: administrator/components/com_hikashop/helpers/image.php

is processing this call with this parameters:
function display($path, $addpopup = true, $title = '', $options = '', $optionslink = '', $width = 0, $height = 0, $alt='') {

looks to me like the $addpopup = true parameter is simply creating a popup link if the parameter is a string, no matter what content the string has although my original parameter was 'hikashop_main_image'

I would like that I could replace this 'hikashop_main_image' for something like hikashop_currentIRL()

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 6 months ago #190609

Hi,

In that case, you should look instead at the code of the show_block_img:

$this->popup = hikashop_get('helper.popup');
$image_options = array('default' => true,'forcesize'=>$this->config->get('image_force_size',true),'scale'=>$this->config->get('image_scale_mode','inside'));
$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
if($img->success) {
$attr = 'title="'.$this->escape(@$image->file_description).'"';
$html = '<img id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';
echo $this->popup->image($html, $img->origin_url, null, $attr);
}
There, you could change the line:
echo $this->popup->image($html, $img->origin_url, null, $attr);

to something like this:
echo $this->popup->display($html, $product_name, $url_of_the_product_page, $unique_id, $width_of_popup, $height_of_popup);

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

Time to create page: 0.060 seconds
Powered by Kunena Forum