How to get template from the overrided woocommerce template files

Viewed 43

I have this reference here, that the creates shortcode to woocommerce my account order history.

From this code here wc_get_template( 'myaccount/my-orders.php', array(

how can I get the override template file in this?

I used wc_get_template( '/wp-content/themes/my-theme/woocommerce/myaccount/my-orders.php', array(

also did use the full url then /wp-content/...

But it won't get the override file.. Is there a proper way to do that?

1 Answers

wc_get_template is by default get override template file. So you have still an issue with getting the overridden template file so you need to add the below code in your function.php file by ref.

function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Related