• Resolved ADvi

    (@advi)


    Hi.
    Is it possible to enable zoom only for 2 products? Not for all of them?
    How can I do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Diana Burduja

    (@diana_burduja)

    Hello,

    the following PHP code added to your child theme’s functions.php file:

    add_action('wp_enqueue_scripts','remove_zoom_on_some_categories', 100);
    function remove_zoom_on_some_categories(){
        if ( ! strstr( $_SERVER['REQUEST_URI'], '/shop/product/product1/' ) && ! strstr( $_SERVER['REQUEST_URI'], '/shop/product/product2/' ) ) {
            wp_dequeue_script('image_zoooom-init');
        }
    }

    will enable the zoom only on the https://example/shop/product/product1/ and on the https://example/shop/product/product2/ products. Replace the URLs with the ones of the 2 products where you want the zoom to be enabled.

    Thread Starter ADvi

    (@advi)

    What settings should be enabled to achive this?
    I should disable Woo integration, right?
    And with your code it will be enabled?

    Plugin Author Diana Burduja

    (@diana_burduja)

    You should have the “Enable the zoom on WooCommerce products” checked in order for it to work.

    But feel free to experiment around with the settings in order to achieve what you want.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Zoom for a few products’ is closed to new replies.