• Resolved danielbmxd

    (@danielbmxd)


    Hello, I am trying to use the Flatsome theme option, which allows me to put % off in the sale badge option, but in single page product this badge is not shown.
    Checking the files, this is possible if I modify the product-images.php file of your plugin by adding “<?php echo woocommerce_show_product_sale_flash(); ?>”, but I wanted to know if you have a hook to help me with this.
    https://prnt.sc/7KLiY4UfP2NP

Viewing 3 replies - 1 through 3 (of 3 total)
  • Copy the product-images.php and keep it inside your current theme’s template folder.

    If you have already a template folder inside your theme, you have no need to create one.

    But, if you have not please create a folder called template. Then add the below code at the current theme’s functions.php

    function edit_wvg_gallery_template($template, $template_name){
       if ( $template_name == 'single-product/product-image.php' ) {
          $template = get_template_part('template/product', 'images');
       }
       return apply_filters( 'woo_variation_gallery_gallery_template_override_location_new', $template, $template_name );
    }
    add_filter('woo_variation_gallery_gallery_template_override_location', 'edit_wvg_gallery_template', 30, 2);

    Then do whatever you want inside your current theme > template > product-images.php file

    Thread Starter danielbmxd

    (@danielbmxd)

    hello, this line “<?php echo woocommerce_show_product_sale_flash(); ” is correct, right? Or is there a better one for what I need?

    I didn’t try the function woocommerce_show_product_sale_flash();

    Please try it yourself.

    I have just given you an idea of how you can insert your custom code using the Additional Variation Images Gallery plugin product-images.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sale Flash Badge’ is closed to new replies.