Hello,

I have a Drupal Commerce website, with products, and whenever I change size or color of my product cloud zoom stops working is there any idea how to do that ?

Also is there a way to integreate lightbox with on-click action ? using Lightbox2 or fency box for example ? I know there is a lightbox1 version already somewhere in issues :)

Is there any way to fix this first problem ?:(

Comments

sleepingmonk’s picture

I'm experiencing the same issue. I believe it may be because changing attributes on the product dynamically loads the new product data with ajax, and cloud zoom is only triggered on the page load. So to fix you'd have to have a way to trigger cloud zoom on selection change, the same way commerce triggers the product load.

Someone more ajaxy than me will have to assist with this. I'll see what I can figure out though.

sleepingmonk’s picture

Got this to work by including the following in my product display template. I don't know if it's "proper" but it's working for me. Feedback is welcome. Hope it helps other people who are trying to trigger javascript after a Drupal Commerce product updates via ajax.

drupal_add_js('jQuery(document).ajaxComplete(function(){       
            // the code to be fired after the AJAX is completed
            jQuery(".cloud-zoom, .cloud-zoom-gallery").CloudZoom();                                                                                     
        });', 'inline');
gonssal’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (fixed)

This seems fixed with current code. Reopen if it isn't.