I need a custom wc-template-functions.php file

I am trying to change the layout of my single product page. For this i need to change the file wc-template-functions.php (found in plugins/woocommerce/includes).

I know for changing the template files i have to copy the folder into my theme and rename it to “woocommerce” but how does it work for a file in the folder includes?

Related posts

1 comment

  1. If you take a look at the template for the single product page, specifically content-single.php you will see that the product images are attached to the woocommerce_before_single_product_summary hook.

    To remove them you would need to use remove_action() and then to place them somewhere else you attach them to a different hook via add_action():

    function so_31406339_move_images(){
      remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images ', 20 );
    
      // for example, to move them to the very bottom of the page:
      add_action( 'woocommerce_after_single_product_summary', 'woocommerce_show_product_images ', 30 );
    }
    add_action( 'woocommerce_before_single_product', 'so_31406339_move_images' );
    

Comments are closed.