I am trying to disable the modal displayed when you click on the detail page image, I just need to remove that function completly, I found the jquery.image-gallery.js which handle that funcionality onclick event.
So my question if there’s a way to disable it? is there an option for the onclick event to pass and deactivate it? or should I just remove that piece of code? by CSS display: none is an option but is the best?
Thanks in advance.
/**
* Will be called when the detail page image slider was clicked..
* Opens the lightbox with an image slider clone in it.
*
* @event onClick
*/
onClick: function (event) {
var me = this,
imageSlider = me.$el.data('plugin_swImageSlider');
$.modal.open(me.$template || (me.$template = me.createTemplate()), {
width: '100%',
height: '100%',
animationSpeed: 350,
additionalClass: 'image-gallery--modal no--border-radius',
onClose: me.onCloseModal.bind(me)
});
me._on(me.$zoomInBtn, 'click touchstart', $.proxy(me.onZoomIn, me));
me._on(me.$zoomOutBtn, 'click touchstart', $.proxy(me.onZoomOut, me));
me._on(me.$zoomResetBtn, 'click touchstart', $.proxy(me.onResetZoom, me));
picturefill();
me.$template.swImageSlider({
dotNavigation: false,
swipeToSlide: true,
pinchToZoom: true,
doubleTap: true,
maxZoom: me.opts.maxZoom,
startIndex: imageSlider ? imageSlider.getIndex() : 0,
preventScrolling: true
});
me.toggleButtons(me.getImageSlider());
$.publish('plugin/swImageGallery/onClick', [me, event]);
}
Hi Daniel,
you could just remove the swImageGallery plugin entirely from the product detail page:
window.StateManager.removePlugin(’*[data-image-gallery=„true“]’, ‚swImageGallery‘)
Hi Daniel,
you could just remove the swImageGallery plugin entirely from the product detail page:
window.StateManager.removePlugin(‚*[data-image-gallery=„true“]‘, ‚swImageGallery‘)
do not modify any Shopware files. That is bad practice and you’ll loose your changes after an update
do not copy any Shopware files 1:1 into your theme/plugin. That’s also bad practice. You should only add modifications into your theme/plugin. When a Shopware update is released the original files could be changed. If you copy them 1:1 into your theme/plugin the updated original files will be overriden with the old ones by your plugin. This can lead to sideeffects.
1 - What I did first was to add the line of code you said just right below the code to register a method so the code looks like this so far:
Undo that. That’s not the way I told you. Please reread my post. You should just call this function in an empty js file which will be registered in your plugin /theme.
Maybe you can send a link to your shop and provide some details about your setup (theme/plugins).