Product Image Zoom

Open to all! Ask other shopowners for help.
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Product Image Zoom

Post by zipurman »

This hook will get your product images to zoom on mouse over.

https://phoenixaddons.com/knowledgebase ... mage-zoom/
zipurman
-----------

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
zeeshop
Member
Posts: 71
Joined: Sun Jan 10, 2021 11:30 pm
Phoenix Version:
Has thanked: 15 times
Been thanked: 2 times

Re: Product Image Zoom

Post by zeeshop »

@zipurman Thanks for providing this addon.

I am wondering if it is possible to make it to work with multiple images on existing popup image system. Thanks
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: Product Image Zoom

Post by zipurman »

@zeeshop You could add another target to the javascript, you would just need to look at the source code of your existing site.

For example, you could change:

Code: Select all

$('.pi-gallery a')
to

Code: Select all

$('.pi-gallery a, a img, .another-class img, .something-else')
zipurman
-----------
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Product Image Zoom

Post by radhavallabh »

Hi dear;
Thank you for the beautiful addon..
Is it possible to zoom the image we hover--- in a different box that would appear on the right only when we hover. A concept like drift zoom....;
That would make it more cool I guess...
Regds./
radhavallabh
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: Product Image Zoom

Post by zipurman »

Anything is possible. The addon was built around https://www.jacklmoore.com/zoom/. You'd have to create a div, and then upon hovering the image, the div would get the image x,y x magnification and the image would have to be set to the background image for the target div. All doable ... but it's a totally different addon/solution.
zipurman
-----------
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 2 times

Re: Product Image Zoom

Post by gsmiley007 »

nice add-on for zoom, just I noticed that if you have more than 1 picture, the additional picture, does not open in a new popup anymore. It just zooms in on the smaller picture
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: Product Image Zoom

Post by zipurman »

gsmiley007 wrote: Sun Mar 28, 2021 1:23 am just I noticed that if you have more than 1 picture, the additional picture, does not open in a new popup anymore. It just zooms in on the smaller picture
If using with multiple images, or with other mods, it may require adjusting the javascript to match the layout of your image library. I'd have to see the site's product page to suggest any edits.
zipurman
-----------
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 2 times

Re: Product Image Zoom

Post by gsmiley007 »

No other mods standard osc and adding more than one image to the store
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: Product Image Zoom

Post by zipurman »

You can change the mod to be as follows:

Code: Select all

    class hook_shop_product_info_imageZoom {
        function listen_injectBodyEnd() {
            $magnify = 3;
            $sitepath = DIR_WS_CATALOG;
            $script = <<<script
<script src="{$sitepath}ext/zoom/jquery.zoom.js"></script>
<script>
$(document).ready(function(){
  $('.pi-gallery > a')
    .wrap('<span style="display:inline-block"></span>')
    .css('display', 'block')
    .parent()
    .zoom({magnify: {$magnify}});
  }); 
</script>

script;
            return $script;
        }
    }
That will restore the pop-up, but zooming additional images would require some extra work.
zipurman
-----------
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 2 times

Re: Product Image Zoom

Post by gsmiley007 »

From what I can see in the code change from the original and what you suggested now is that I remove
});

The popup came back, but the zoom does not work for the main picture.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply