Second picture on Woocommerce product page is opening in lightbox

This topic has 5 replies, 3 voices, and was last updated 9 years, 2 months ago ago by TrueBeardsman

  • Avatar: TrueBeardsman
    TrueBeardsman
    Participant
    February 13, 2015 at 23:43

    The Second picture on Woocommerce product page is opening in lightbox when you click on it instead of changing the photo in the product page. This just started. Can you offer any advice on fixing it please?

    Ex: http://www.truebeardsman.com/shop/forest-haven-beard-oil/ click on the 2nd photo under the picture display and it opens in lightbox instead of chaining the photo in the main display. I don’t want it to open in light box. Lightbox is disabled in woo commerce settings. And Im not talking about the open in lightbox of the theme options either. That is not what is causing it.

    4 Answers
    Avatar: TrueBeardsman
    TrueBeardsman
    Participant
    February 14, 2015 at 00:24

    Adding the following seems to have resolved the issue.

    /* Remove WooCommerce styles and scripts. */
    function woo_remove_lightboxes() {
             
            // Styles
            wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
             
            // Scripts
            wp_dequeue_script( 'prettyPhoto' );
            wp_dequeue_script( 'prettyPhoto-init' );
            wp_dequeue_script( 'fancybox' );
            wp_dequeue_script( 'enable-lightbox' );
    }
      
    add_action( 'wp_enqueue_scripts', 'woo_remove_lightboxes', 199 );
    ?>
    
    Avatar: Businessbro
    Businessbro
    Participant
    February 14, 2015 at 16:09

    I am having this issue also. Where exactly do I paste this code to fix issue?

    Avatar: Eva
    Eva Kemp
    Support staff
    February 14, 2015 at 16:20

    Hello @Businessbro,

    You need add this code in functions.php file in the theme directory.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: TrueBeardsman
    TrueBeardsman
    Participant
    February 16, 2015 at 03:40

    @Businessbro

    If you are using a child theme update it in the functions.php of the child theme.
    If you are not using a child theme you would want to update the functions.php in the woofers theme folder, however keep in mind when you update woofers next time the functions.php will be overwritten. It’s better to use a child theme if you are going to be customizing any of the theme files, ie. css, functions.php etc.

  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.