Okay
  Public Ticket #1355298
Desactive the Gallery of product from theme to use Woocomerce Gallery
Closed

Comments

  •  1
    gualde started the conversation

    Hello,

    I have a problems with the gallery that theme has. I would like deactivate to use the Woocommerce Gallery has by default. Before last update I had this, but with last update this dissapear, can you help me?

    regards

  •  1,560
    Laborator replied

    Hi gualde,

    It is not possible to disable our gallery and use the WooCommerce gallery instead as it needs custom coding, and it is not a simple on/off button.

    If you're looking for professional help in this matter, there's always someone available for such tasks on WP Kraken. Pricing and timeline are always straightforward there and that's the main reason for recommending those services.

    If your changes are lost, we recommend using child theme to add custom code instead of the main theme, here is a great article about that, even though it's assigned to another theme, the options and explanation is the same.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  1
    gualde replied

    In the previous version (4.5) I have this function with a code at my child theme in functions.php but whit update this isn't work. 

    I want this function because I use a plugin of videos and this doesn't work with the gallery of theme but functions with the Gallery of Woocommerce:

    https://yithemes.com/themes/plugins/yith-woocommerce-featured-audio-video-content/ 

    https://fiesta4u.com/producto/palillos-pompon/

    //Function to see the woocommerce gallery
    add_action( 'after_setup_theme', 'my_woocommerce_support' );
    function my_woocommerce_support() {   
    add_theme_support( 'wc-product-gallery-zoom' );   
    add_theme_support( 'wc-product-gallery-lightbox' );   
    add_theme_support( 'wc-product-gallery-slider' );
    }
    
  •  1
    gualde replied

    Well I just solved these, in case someone is interested. 


    Only comment the lines 1096 to 1111 in oxygen/inc/laborator_woocommerce.php


    /*
    // Use Oxygens's default product gallery layout
    function oxygen_woocommerce_use_custom_product_image_gallery_layout() {   return apply_filters( 'oxygen_woocommerce_use_custom_product_image_gallery_layout', true );
    }
    // Oxygens's built in image gallery
    function oxygen_woocommerce_show_product_images() {   get_template_part( 'tpls/woocommerce-product-images' );
    }
    // Replace product image gallery
    if ( oxygen_woocommerce_use_custom_product_image_gallery_layout() ) {   remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );   add_action( 'woocommerce_before_single_product_summary', 'oxygen_woocommerce_show_product_images', 25 );
    }*/

  • [deleted] replied

    Hi gualde,

    Here is a better approach on your solution, simply add this code in functions.php:

    add_filter( 'oxygen_woocommerce_use_custom_product_image_gallery_layout', '__return_false' );

    So you don't need to change theme files, because after you update the theme, your changes will be lost.

  •  1
    gualde replied

    Perfect, better solution

    Thanks & Bes regards

  • [deleted] replied

    Hi gualde,

    Glad to hear that

    P.S: If you like our theme, it would help us a lot if you could give us a five-star rating on Themeforest from your Downloads tab.

    A huge thank you from Laborator in advance and have a great day!