Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
If WC tries to load existing parent template, still apply our logic (#28
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kingkero authored Oct 27, 2021
1 parent def4d3d commit f4e790b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
*/
function wc_template_loader(String $template)
{
if (strpos($template, get_template_directory()) !== false) {
return locate_template(WC()->template_path() . str_replace(get_template_directory() . '/woocommerce/', '', $template)) ? : $template;
}

return strpos($template, WC_ABSPATH) === -1
? $template
: (locate_template(WC()->template_path() . str_replace(WC_ABSPATH . 'templates/', '', $template)) ? : $template);
Expand Down

0 comments on commit f4e790b

Please sign in to comment.