-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow getGallery to use different Isotope Galleries #2461
Conversation
We have a Product Reader page where we have multiple galleries being displayed. We wanted the ability to pick a different Isotope Gallery (Store configuration > Galleries) so I've added to getGallery a second parameter which is null by default but can be the ID of which gallery you want. Below that, if the ID is detected it replaces the current on inside $arrConfig. I've tested this and it works perfectly. Feel free to change to any style you'd like, but for a three line change this adds very helpful functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust the coding style. Also, will this work with the $currentGallery
cache?
system/modules/isotope/library/Isotope/Model/Product/Standard.php
Outdated
Show resolved
Hide resolved
system/modules/isotope/library/Isotope/Model/Product/Standard.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Andreas Schempp <[email protected]>
Co-authored-by: Andreas Schempp <[email protected]>
I always tend to add iso to variable names when I am customizing something with Isotope but that doesn't make sense if I'm trying to add to the actual project. I've changed to the naming convention you suggested. I can't say I am entirely sure what $currentGallery cache is, but we have been using this change on two different sites for a week or two now with no noticable issues. |
I think this would only be a problem if you would try to use two different galleries on the same attribute in the same product (e.g. for the main image and for thumbnails). I'll look into this after merging the PR 😊 |
So, another developer here was using my modification here and ran into the issue you predicted. This does not work when using the same image attribute for generateMainImage and generateGallery. Any suggestions on where to look next to adjust this? It looks like the getGallery function is called in ProductCollection.php in the addToTemplate function. Does that sound right? |
I guess the easiest fix would be to remove the |
I know in the grand scheme of things this is basically nothing, but I've never contributed to a piece of software I've used before. Pretty darn cool if you ask me. |
Open Source FTW! ❤️ |
We have a Product Reader page where we have multiple galleries being displayed. We wanted the ability to pick a different Isotope Gallery (Store configuration > Galleries) so I've added to getGallery a second parameter which is null by default but can be the ID of which gallery you want. Below that, if the ID is detected it replaces the current on inside $arrConfig.
I've tested this and it works perfectly. Feel free to change to any style you'd like, but for a three line change this adds very helpful functionality.