• Resolved Mihai

    (@crazy_mtx)


    Hi,

    Is it possible to override the templates ? I tried overriding product-images.php, but following the comment at the top of the file didn’t work:

    
    This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-image.php.
    

    I also tried :
    yourtheme/woo-variation-gallery/single-product/product-images.php
    yourtheme/woo-variation-gallery/single-product/templates/product-images.php
    yourtheme/woo-variation-gallery/product-images.php
    yourtheme/woo-variation-gallery/templates/product-images.php

Viewing 1 replies (of 1 total)
  • Hi @crazy_mtx

    Thanks for reaching out to us.
    Please create a folder inside your child theme and name it “template“. Then copy the file product-images.php from woo-variation-gallery/single-product and paste it inside the newly created template folder. Then paste the below code inside your child theme’s functions.php

    function edit_wvg_gallery_template($template, $template_name, $old_template){
    
    	if ( $template_name == 'single-product/product-image.php' ) {
    		$template = get_template_part('template/product', 'images');
    	}
    	return apply_filters( 'wvg_gallery_template_override_location_new', $template, $template_name, $old_template );
    }
    
    add_filter('wvg_gallery_template_override_location', 'edit_wvg_gallery_template', 30, 3);

    Now change whatever you want inside your child theme > template > product-images.php

    If it works for you and found my support helpful, my humble request to you to write your beautiful thought here-

    https://wordpress.org/support/plugin/woo-variation-gallery/reviews/

    Your beautiful thought keeps us inspired.

    Thanks

Viewing 1 replies (of 1 total)

The topic ‘Template override’ is closed to new replies.