Show actual image size in popup

  • Posts: 4
  • Thank you received: 0
10 years 9 months ago #179509

-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.20

Hi,

When the user clicks on an image on the product page, a popup of the image is shown which seems to be scaled based on the size of the browser being used. Is there a way to show the full-sized image that was originally uploaded? I would be ok if it shows the same sized popup, but it would need to have sliders/scroll bars so the user can see the whole image.

I've done some research on this and I believe it requires modifying the show_block_img file for the product view, but I'm not sure what change I need to make for this.

Thanks,
Mike

EDIT: Looks like I posted this in the wrong section - not sure how to move it...

Last edit: 10 years 9 months ago by mmorrison.

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

  • Posts: 84220
  • Thank you received: 13672
  • MODERATOR
10 years 9 months ago #179520

Hi,

That's indeed the case. The system displays the image at the size of the browser window.
There is no option to change that.
What you can do is deactivate the popup so that it displays directly the image on the full page.
So instead of

echo $this->popup->image($html, $img->origin_url, null, $attr);
in the show_block_img view file, you would put
echo '<a href="'.$img->origin_url.'" target="_blank">'.$html.'</a>';

The following user(s) said Thank You: mmorrison

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

  • Posts: 4
  • Thank you received: 0
10 years 9 months ago #179671

Ok, so that brings it up in a separate window/tab that shows the full sized image. I also had to replace

echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image'));
with
echo '<a '.$attr.' href="'.$img->origin_url.'" target="_blank">'.$html.'</a>';
in order to get the same behaviour when clicking on the thumbnails. I'm still having an issue with clicking on the main image though - when I have the second image showing and I click on the main image, it brings up the first one in the new window instead of the currently 'selected' image.

I'm also not sure I want this to come up in a separate window - I assume I would need to install some kind of plugin to get access to a popup that allows the user to view a full-sized image (and perhaps scroll around on it)? If this is the case, any recommendations on a good free one to use?

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

  • Posts: 84220
  • Thank you received: 13672
  • MODERATOR
10 years 9 months ago #179674

There is no such plugin.
If you want to go further and have a popup like you want, you'll have to add some more complex custom code.

The best would be to contact our partners and request a quote for such customization:
www.hikashop.com/home/our-partners.html

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

  • Posts: 4
  • Thank you received: 0
10 years 9 months ago #179763

Ok, I may leave it with the new window then. Any ideas for the issue when clicking on the main image (while the second image is showing)?

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 9 months ago #179783

Hi,

If you have some "old" view override for the product page, it is possible that you do not have the script which change the targeted image when switching the thumbnail.
When you click on the main image, there is some javascript which cancel your click and simulate a click on the selected thumbnail.

These javascript functions are at the bottom of the view "product | show_block_img".
Function names are " window.localPage.changeImage " and " window.localPage.openImage ".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: mmorrison

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

  • Posts: 4
  • Thank you received: 0
10 years 9 months ago #179856

Alright, I decided to update after realizing that my customizations were fairly easy to repeat. That didn't work, however I figured out by accident what I needed to fix this - the first change that nicolas provided actually needed to be removed:

So instead of

echo $this->popup->image($html, $img->origin_url, null, $attr);
in the show_block_img view file, you would put
echo '<a href="'.$img->origin_url.'" target="_blank">'.$html.'</a>';


I did keep the second change I made for the thumbnails, and that seems to have worked. Thank you both for your help!

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

Time to create page: 0.061 seconds
Powered by Kunena Forum