Commit 47e11936 authored by Varun Sridharan's avatar Varun Sridharan

Template Issue fixed

parent be2cf371
...@@ -11,3 +11,4 @@ wp-content/cache/ ...@@ -11,3 +11,4 @@ wp-content/cache/
wp-content/upgrade/ wp-content/upgrade/
wp-content/uploads/ wp-content/uploads/
wp-content/wp-cache-config.php wp-content/wp-cache-config.php
Thumbs.db
...@@ -308,10 +308,11 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -308,10 +308,11 @@ class WooCommerce_Quick_Donation_Functions {
if($found){ if($found){
return $file; return $file;
} else { } /*else {
$file = wc_locate_template($template_name); $file = wc_locate_template($template_name);
return $file; return $file;
} }*/
return $located; return $located;
} }
......
...@@ -35,7 +35,7 @@ class WC_QD_Donation_New_Email extends WC_Email { ...@@ -35,7 +35,7 @@ class WC_QD_Donation_New_Email extends WC_Email {
$this->template_html = 'emails/donation-admin-new.php'; $this->template_html = 'emails/donation-admin-new.php';
$this->template_plain = 'emails/plain/admin-new-order.php'; $this->template_plain = 'emails/plain/admin-new-order.php';
add_filter('woocommerce_template_directory',array($this,'change_dir'),2,1); add_filter('woocommerce_template_directory',array($this,'change_dir'),2,2);
// Call parent constructor // Call parent constructor
parent::__construct(); parent::__construct();
...@@ -47,7 +47,8 @@ class WC_QD_Donation_New_Email extends WC_Email { ...@@ -47,7 +47,8 @@ class WC_QD_Donation_New_Email extends WC_Email {
$this->recipient = get_option( 'admin_email' ); $this->recipient = get_option( 'admin_email' );
} }
public function change_dir($dir){ public function change_dir($dir,$template){
if(! in_array($template,array('emails/donation-completed.php','emails/plain/donation-completed.php'))){return $dir;}
$dir = $dir.'/donation'; $dir = $dir.'/donation';
return $dir; return $dir;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment