Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Justin Tadlock

    (@greenshady)

    Can you link to the prettyPhoto for WooCommerce? I’ve never tested it with Cleaner Gallery but will be happy to add support for it if it’s as simple as adding a class.

    Thread Starter sweman

    (@sweman)

    Thanks for your quick reply! I don’t know if I can link to it, because it’s integrated in the WooCommerce plugin for WordPress. It’s really strange because I tried a lot of different ways and searched the web for quite some time and the final solution doesn’t seem logical. What put me on track was this article about the previous “lightbox” method used in WooCommerce, fancybox, where a the class “zoom” had to be applied: How to Use WooCommerce’s Lightbox
    A comment in the beginning of the article stated that WooCommerce now comes with prettyPhoto instead, linking to a newer article about how to make use of that. However, trying that method didn’t work when I removed the “zoom” class, so it must be some leftover code that the WooCommerce people forgot to remove that is causing trouble, eh?

    Plugin Author Justin Tadlock

    (@greenshady)

    prettyPhoto uses rel="prettyPhoto[gallery_id]" by default rather than class="zoom". It looks like WC is using a custom implementation there.

    I’ll see if there’s a simple way to support both. However, in general, I can’t really support everyone’s custom implementations. I try to stick with the defaults for the lightbox-scripts.

    Thread Starter sweman

    (@sweman)

    Yeah, I know that implementing all sorts of custom implementations is impossible. Just thought that this one might be a good idea since WooCommerce is used by millions of people worldwide. In my fix I just added the class to line 267 in the file “default-filters.php” like so:

    case 'pretty_photo' :
    
    			$class = 'prettyPhoto zoom';
    			$rel   = "prettyPhoto[{$id}]";
    			break;

    Just adding an extra class like this is simple, and it shouldn’t break anything else, right? Well, anyway, I got it working for me so I’ll be content whatever you choose to do (or not to do)! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘prettyPhoto needs fix’ is closed to new replies.