- Posts: 4
- Thank you received: 0
Show actual image size in popup
11 years 10 months ago - 11 years 10 months ago #179509
by mmorrison
Show actual image size in popup was created by mmorrison
-- 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...
-- 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: 11 years 10 months ago by mmorrison.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #179520
by nicolas
Replied by nicolas on topic Show actual image size in popup
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
in the show_block_img view file, you would put
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
Code:
echo $this->popup->image($html, $img->origin_url, null, $attr);
Code:
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.
11 years 10 months ago #179671
by mmorrison
Replied by mmorrison on topic Show actual image size in popup
Ok, so that brings it up in a separate window/tab that shows the full sized image. I also had to replace
with
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?
Code:
echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image'));
Code:
echo '<a '.$attr.' href="'.$img->origin_url.'" target="_blank">'.$html.'</a>';
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.
11 years 10 months ago #179674
by nicolas
Replied by nicolas on topic Show actual image size in popup
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
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.
11 years 10 months ago #179763
by mmorrison
Replied by mmorrison on topic Show actual image size in popup
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.
11 years 10 months ago #179783
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Show actual image size in popup
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,
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.
The following user(s) said Thank You: mmorrison
Please Log in or Create an account to join the conversation.
11 years 10 months ago #179856
by mmorrison
Replied by mmorrison on topic Show actual image size in popup
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:
I did keep the second change I made for the thumbnails, and that seems to have worked. Thank you both for your help!
So instead of
in the show_block_img view file, you would putCode:echo $this->popup->image($html, $img->origin_url, null, $attr);Code: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.194 seconds