[Resolved] Stop slide effect for woocommerce product gallery image on product page

Home Forums Support [Resolved] Stop slide effect for woocommerce product gallery image on product page

Home Forums Support Stop slide effect for woocommerce product gallery image on product page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #385604
    Peter

    Hi,

    how do I disable the slider effect on woocommerce product pages. Since I have only 1 image for every product its just distracting that user can drag image back and forth with no function. It also makes it more difficult and confusing to scroll page (and get to the order button ;))

    Ive tried something like:


    @media
    (max-width: 768px) {
    .woocommerce-product-gallery__wrapper {
    pointer-events: none;
    cursor: default;
    }
    }

    but there are so many classes, i cant find the right one, and Im terrible at css.

    Thanks for your assistance.

    #385647
    Leo
    Staff
    Customer Support

    Hi

    Try this:

    If so try this PHP:

    add_action( 'wp', 'lh_disable_wc_slider', 50 );
    function lh_disable_wc_slider() {
        remove_theme_support( 'wc-product-gallery-slider' );
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #385999
    Peter

    Can we qulify this with something like :

    if($images_count<=1) {

    … disable slider …

    }

    #386296
    Tom
    Lead Developer
    Lead Developer

    That might be something you need to ask WooCommerce support – they’ll have a better idea than me.

    #386306
    Peter

    Ok thanks Tom. My initial question is resolved.

    #386354
    Tom
    Lead Developer
    Lead Developer

    No problem – let me know if you end up needing more help with the second question 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.