Skip to main content

link thumbnails to bigger picture instead of page

More
14 years 5 months ago #46848 by pina
I don't need a seperate product page for each item of the shop. Is it possible for me to link the thumbnails to an enlarged picture of the product shown in the thumbnail? Just like when you're on the product page and clicking on one of the pictures, you get to see an enlarged version.

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

More
14 years 5 months ago #46940 by nicolas
You can do that by editing the file "listing_img_title" of the view "product" via the menu Display->Views and changing the code
Code:
<?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?>
by
Code:
echo $this->image->display(@$this->row->file_path,true,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);
The following user(s) said Thank You: pina

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

More
14 years 5 months ago - 14 years 5 months ago #47059 by pina
Hi Nicolas

thank you for your response!

nicolas wrote: You can do that by editing the file "listing_img_title" of the view "product" via the menu Display->Views and changing the code

Code:
<?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?>
by
Code:
echo $this->image->display(@$this->row->file_path,true,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);

Last edit: 14 years 5 months ago by pina.

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

More
13 years 6 months ago #96337 by bootfair
Hi,

Does this solution work with the current version of hikashop starter?

I also wanted to open enlarged images from the product listing intead of having to go to product page and tried this replacement but this does not work on hikashop starter 2.1.1

Any ideas please?

Thank you

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

More
13 years 6 months ago #96340 by bootfair
Small update for those who have similar problems..

I have found out why this would not work;

This did not work because I was editing the image_title.php file but I was using image and description view from the menu module. So editing the relevant listing_img_desc.php file did solve the problem.

However I must also point that the replcament code snippet quoted as a solution is not good enoug for a novice guy without coding expreience. The complete code replacement should have php tags at the beginning and at the end. So, the code for replavement I have use is as below;
Code:
<?php echo $this->image->display(@$this->row->file_path,true,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); ?>
The following user(s) said Thank You: Mohamed Thelji

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

More
13 years 6 months ago #96379 by Mohamed Thelji
Thanks for your feedback :).

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

More
13 years 5 months ago #101257 by alikon1
Just replace
Code:
file_path,false,$this
with
Code:
file_path,true,$this
.

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

More
12 years 3 months ago #159344 by sambob
Hi, I am trying to do this but a bit confused - I think the original file has changed considerably since being written

The code as mentioned here
Code:
<?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?>

Seems to now be (if I understand it correctly) to this:
Code:
<?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } $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(@$this->row->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options); if($img->success) { echo '<img class="hikashop_product_listing_image" title="'.$this->escape(@$this->row->file_description).'" alt="'.$this->escape(@$this->row->file_name).'" src="'.$img->url.'"/>'; } $main_thumb_x = $this->image->main_thumbnail_x; $main_thumb_y = $this->image->main_thumbnail_y; if($this->params->get('display_badges',1)){ $this->classbadge->placeBadges($this->image, $this->row->badges, -10, 0); } $this->image->main_thumbnail_x = $main_thumb_x; $this->image->main_thumbnail_y = $main_thumb_y; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?>

So what needs to be changed to enable image popup from product listing?

Thanks in advance for any help.
Simon

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

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

More
12 years 3 months ago #159486 by Eliot
Hi Simon,

It's actually easier.
You should just replace the first code you post with this line:
Code:
<?php echo $this->image->display(@$this->row->file_path,true,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y); ?>

And it'll do the job!

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

More
12 years 3 months ago #160464 by sambob
Hi Eliot,

Thanks for your reply.

That first set of code I posted does not exist in my file (that is from the original post a couple of years ago)

The second piece of code is what is actually in the latest version of the mentioned file.

Make sense?

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

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

More
12 years 3 months ago - 12 years 3 months ago #160542 by Xavier
Hi,

So in the view "product / listing_img_title" you have to replace the code:
Code:
$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(@$this->row->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options); if($img->success) { echo '<img class="hikashop_product_listing_image" title="'.$this->escape(@$this->row->file_description).'" alt="'.$this->escape(@$this->row->file_name).'" src="'.$img->url.'"/>'; }
By:
Code:
echo $this->image->display(@$this->row->file_path,true,$this->escape($this->row->file_name), '' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);

Thanks to check that you are editing the correct view. If you had already the second part of code that's because you probably already have an override.

It just tested the code on my end and it's working fine.
Last edit: 12 years 3 months ago by Xavier.
The following user(s) said Thank You: sambob

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

More
12 years 3 months ago #160649 by sambob
Hi Xavier,

That works now.

Thanks, appreciate it!

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

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

More
10 years 4 months ago - 10 years 4 months ago #240984 by alikon1
What should I change in 2.6.3 version? There is no Dispaly word at all.

Updated: see answer in previous post :blush:
Last edit: 10 years 4 months ago by alikon1.

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

Time to create page: 0.289 seconds
Powered by Kunena Forum