Commit a8e3d7d4 authored by Varun Sridharan's avatar Varun Sridharan

Update By Varun

* Changed Support Menu To System Tools Menu
* Added Plugins Screen To WC
* Added Option To Display As Table IN SYSINFO
* Removed Download As Text In Text View
* Fixed Template Load Issue
* Rearranged Template Array
* Added Custom HEADER & FOOTER For Emails
* Added New wcqd_is_donation function to check for the donation
parent 231f3fe8
...@@ -59,12 +59,12 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -59,12 +59,12 @@ class WooCommerce_Quick_Donation_Admin {
'wc_qd_donors', 'wc_qd_donors',
array($this,'donors_listing_page')); array($this,'donors_listing_page'));
$this->donors_list = add_submenu_page('edit.php?post_type=wcqd_project', $this->tools = add_submenu_page('edit.php?post_type=wcqd_project',
__('Support Request',WC_QD_TXT), __('System Tools',WC_QD_TXT),
__('Support Request',WC_QD_TXT), __('System Tools',WC_QD_TXT),
'administrator', 'administrator',
'wc_qd_support', 'wc_qd_tools',
array($this,'support_request')); array($this,'system_tools'));
} }
...@@ -132,11 +132,12 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -132,11 +132,12 @@ class WooCommerce_Quick_Donation_Admin {
donor_render_list_page($args); donor_render_list_page($args);
} }
public function support_request(){ public function system_tools(){
require(WC_QD_ADMIN.'/sysinfo/sysinfo.php'); require(WC_QD_ADMIN.'/views/tools.php');
$sysinfo = new WooCommerce_Quick_Donation_SysInfo; //require(WC_QD_ADMIN.'/sysinfo/sysinfo.php');
$sysinfo->setup(); //$sysinfo = new WooCommerce_Quick_Donation_SysInfo;
$sysinfo->render_info(); //$sysinfo->setup();
//$sysinfo->render_info();
} }
public function donation_orders_page(){ public function donation_orders_page(){
...@@ -181,7 +182,7 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -181,7 +182,7 @@ class WooCommerce_Quick_Donation_Admin {
wp_enqueue_style(WC_QD_SLUG.'_settings_style',WC_QD_CSS.'admin-settings-style.css' , array(), WC_QD()->version, 'all' ); wp_enqueue_style(WC_QD_SLUG.'_settings_style',WC_QD_CSS.'admin-settings-style.css' , array(), WC_QD()->version, 'all' );
} }
if('wcqd_project_page_wc_qd_support' == $this->current_screen()){ if('wcqd_project_page_wc_qd_tools' == $this->current_screen()){
wp_enqueue_style(WC_QD_SLUG.'_sysinfo_style',WC_QD_CSS.'sysinfo.css' , array(), WC_QD()->version, 'all' ); wp_enqueue_style(WC_QD_SLUG.'_sysinfo_style',WC_QD_CSS.'sysinfo.css' , array(), WC_QD()->version, 'all' );
} }
...@@ -198,7 +199,7 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -198,7 +199,7 @@ class WooCommerce_Quick_Donation_Admin {
if(in_array($this->current_screen() , $this->get_screen_ids())) { if(in_array($this->current_screen() , $this->get_screen_ids())) {
wp_enqueue_script(WC_QD_SLUG.'_core_script', WC_QD_JS.'admin-script.js', array('jquery'), WC_QD()->version, false ); wp_enqueue_script(WC_QD_SLUG.'_core_script', WC_QD_JS.'admin-script.js', array('jquery'), WC_QD()->version, false );
} }
if('wcqd_project_page_wc_qd_support' == $this->current_screen()){ if('wcqd_project_page_wc_qd_tools' == $this->current_screen()){
wp_register_script(WC_QD_SLUG.'_sysinfo_script', WC_QD_JS.'sysinfo.js', array( 'jquery' ), WC_QD()->version,false ); wp_register_script(WC_QD_SLUG.'_sysinfo_script', WC_QD_JS.'sysinfo.js', array( 'jquery' ), WC_QD()->version,false );
wp_localize_script(WC_QD_SLUG.'_sysinfo_script', 'systemInfoAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); wp_localize_script(WC_QD_SLUG.'_sysinfo_script', 'systemInfoAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
wp_enqueue_script(WC_QD_SLUG.'_sysinfo_script'); wp_enqueue_script(WC_QD_SLUG.'_sysinfo_script');
...@@ -211,6 +212,8 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -211,6 +212,8 @@ class WooCommerce_Quick_Donation_Admin {
$screen = $screens; $screen = $screens;
$screen[] = 'wcqd_project_page_WC_QD_settings'; $screen[] = 'wcqd_project_page_WC_QD_settings';
$screen[] = $this->order_menu_slug; $screen[] = $this->order_menu_slug;
$screen[] = $this->donors_list;
$screen[] = $this->tools;
return $screen; return $screen;
} }
...@@ -234,6 +237,9 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -234,6 +237,9 @@ class WooCommerce_Quick_Donation_Admin {
$screen_ids[] = WC_QD_PT.'_page_wc_qd_settings'; $screen_ids[] = WC_QD_PT.'_page_wc_qd_settings';
$screen_ids[] = 'wcqd_project_page_WC_QD_settings'; $screen_ids[] = 'wcqd_project_page_WC_QD_settings';
$screen_ids[] = $this->order_menu_slug; $screen_ids[] = $this->order_menu_slug;
$screen_ids[] = $this->order_menu_slug;
$screen_ids[] = $this->donors_list;
$screen_ids[] = $this->tools;
return $screen_ids; return $screen_ids;
} }
......
...@@ -68,7 +68,7 @@ class WooCommerce_Quick_Donation_SysInfo{ ...@@ -68,7 +68,7 @@ class WooCommerce_Quick_Donation_SysInfo{
* *
* @return void * @return void
*/ */
static function display() { static function display($type = 'text') {
$browser = new Browser(); $browser = new Browser();
if ( get_bloginfo( 'version' ) < '3.4' ) { if ( get_bloginfo( 'version' ) < '3.4' ) {
$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
...@@ -102,9 +102,34 @@ class WooCommerce_Quick_Donation_SysInfo{ ...@@ -102,9 +102,34 @@ class WooCommerce_Quick_Donation_SysInfo{
$WP_REMOTE_POST = 'wp_remote_post() does not work' . "\n"; $WP_REMOTE_POST = 'wp_remote_post() does not work' . "\n";
} }
if($type == 'table'){return self::display_output_table( $browser, $theme, $host, $WP_REMOTE_POST );}
return self::display_output( $browser, $theme, $host, $WP_REMOTE_POST ); return self::display_output( $browser, $theme, $host, $WP_REMOTE_POST );
} }
/**
* Render System Status
*
* Based on System Status submenu page in Easy Digital Downloads
* by Pippin Williamson
*
* @since 1.0
*
* @param string Browser information
* @param string Theme Data
* @param string Theme name
* @param string Host
* @param string WP Remote Host
* @return string Output of System Status display
*/
//Render Info Display
static function display_output_table( $browser, $theme, $host, $WP_REMOTE_POST ) {
global $wpdb;
ob_start();
include( WC_QD_SSS_VIEWS_DIR . 'table.php' );
return ob_get_clean();
}
/** /**
* Render System Status * Render System Status
* *
......
...@@ -10,13 +10,11 @@ ...@@ -10,13 +10,11 @@
<input type="hidden" name="action" value="download_simple_system_status" /> <input type="hidden" name="action" value="download_simple_system_status" />
<div> <div>
<textarea readonly="readonly" onclick="this.focus();this.select()" id="sss-textarea" name="simple-system-status-textarea" title="<?php _e( 'To copy the System Status, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'simple-system-status' ); ?>"> <textarea readonly="readonly" onclick="this.focus();this.select()" id="sss-textarea" name="simple-system-status-textarea" title="<?php _e( 'To copy the System Status, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'simple-system-status' ); ?>">
<?php //Non standard indentation needed for plain-text display ?>
<?php echo esc_html( self::display() ) ?> <?php echo esc_html( self::display() ) ?>
</textarea> </textarea>
</div> </div>
<p class="submit">
<input type="submit" class="button-secondary" value="<?php _e( 'Download Sytem Info as Text File', 'simple-system-status' ) ?>" />
</p>
</form> </form>
......
This diff is collapsed.
<?php
require(WC_QD_ADMIN.'/sysinfo/sysinfo.php');
$sysinfo = new WooCommerce_Quick_Donation_SysInfo;
$sysinfo->setup();
echo $sysinfo::display('table');
?>
<table cellspacing="0" id="status" class="wc_status_table widefat">
<thead>
<tr>
<th data-export-label="WordPress Environment" colspan="3">WordPress Environment</th>
</tr>
</thead>
<tbody>
<tr>
<td data-export-label="Home URL">Home URL:</td>
<td class="help"><a class="help_tip" href="#">[?]</a></td>
<td>http://localhost/wpdev</td>
</tr>
<tr>
<td data-export-label="Language">Language:</td>
<td class="help"><a class="help_tip" href="#">[?]</a></td>
<td>en_US</td>
</tr>
</tbody>
</table>
\ No newline at end of file
<div class="wrap woocommerce">
<?php
$active = 'sysinfo';
if(isset($_REQUEST['ntab'])){$active == $_GET['ntab'];}
$pages= array();
$pages['sysinfo'] = __('System Status',WC_QD_TXT);
$pages['tools'] = __('Tools',WC_QD_TXT);
$url = menu_page_url('wc_qd_tools', false );
$links = '';
foreach($pages as $pageid => $page){
$class = 'nav-tab ';
if($active == $pageid){$class .= ' nav-tab-active'; }
$links .= '<a class="'.$class.'" href="'.$url.'&ntba='.$pageid.'">'.$page.'</a>';
}
?>
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper"><?php echo $links; ?></h2>
<?php require(WC_QD_ADMIN.'views/'.$active.'-view.php'); ?>
</div>
\ No newline at end of file
...@@ -501,7 +501,6 @@ if ( ! function_exists( 'wc_qd_notice' ) ) { ...@@ -501,7 +501,6 @@ if ( ! function_exists( 'wc_qd_notice' ) ) {
$message = str_replace('$msgID$',$msgID,$message); $message = str_replace('$msgID$',$msgID,$message);
$notice->setContent($message); $notice->setContent($message);
$notice->setWrapper($wraper); $notice->setWrapper($wraper);
///var_dump($notice->getId());
WP_Admin_Notices::getInstance()->addNotice($notice); WP_Admin_Notices::getInstance()->addNotice($notice);
} }
} }
......
...@@ -30,7 +30,7 @@ class WooCommerce_Quick_Donation_Emails_Functions { ...@@ -30,7 +30,7 @@ class WooCommerce_Quick_Donation_Emails_Functions {
} }
public function wca_onhold(){ public function wca_onhold(){
var_dump(4333);
} }
public function check_order($order_id){ public function check_order($order_id){
......
...@@ -14,9 +14,6 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -14,9 +14,6 @@ class WooCommerce_Quick_Donation_Functions {
'field-select.php' => 'fields/field-select.php', 'field-select.php' => 'fields/field-select.php',
'field-text.php' => 'fields/field-text.php', 'field-text.php' => 'fields/field-text.php',
'myaccount/my-donations.php' => 'myaccount/my-donations.php', 'myaccount/my-donations.php' => 'myaccount/my-donations.php',
'emails/donation-customer-invoice.php' => 'emails/donation-customer-invoice.php',
'emails/plain/donation-customer-invoice.php' => 'emails/plain/donation-customer-invoice.php',
), ),
'is_donation' => array( 'is_donation' => array(
...@@ -25,6 +22,7 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -25,6 +22,7 @@ class WooCommerce_Quick_Donation_Functions {
'cart/cart-totals.php' => 'cart/donation-cart-totals.php', 'cart/cart-totals.php' => 'cart/donation-cart-totals.php',
'cart/cart.php' => 'cart/donation-cart.php', 'cart/cart.php' => 'cart/donation-cart.php',
'cart/proceed-to-checkout-button.php' => 'cart/donation-proceed-to-checkout-button.php', 'cart/proceed-to-checkout-button.php' => 'cart/donation-proceed-to-checkout-button.php',
'checkout/cart-errors.php' => 'checkout/donation-cart-errors.php', 'checkout/cart-errors.php' => 'checkout/donation-cart-errors.php',
'checkout/form-billing.php' => 'checkout/donation-form-billing.php', 'checkout/form-billing.php' => 'checkout/donation-form-billing.php',
'checkout/form-checkout.php' => 'checkout/donation-form-checkout.php', 'checkout/form-checkout.php' => 'checkout/donation-form-checkout.php',
...@@ -38,22 +36,23 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -38,22 +36,23 @@ class WooCommerce_Quick_Donation_Functions {
), ),
'after_order' => array( 'after_order' => array(
'order/order-details.php' => 'order/donation-order-details.php',
'checkout/thankyou.php' => 'checkout/donation-thankyou.php', 'checkout/thankyou.php' => 'checkout/donation-thankyou.php',
'myaccount/view-order.php' => 'myaccount/view-donation.php', 'myaccount/view-order.php' => 'myaccount/view-donation.php',
'order/order-details-item.php' => 'order/order-details-item.php',
'order/order-details-customer.php' => 'order/order-details-customer.php',
'order/order-details.php' => 'order/donation-order-details.php',
'order/order-details-item.php' => 'order/donation-order-details-item.php',
'order/order-details-customer.php' => 'order/donation-order-details-customer.php',
'emails/email-addresses.php' => 'emails/donation-email-addresses.php',
'emails/email-footer.php' => 'emails/donation-email-footer.php',
'emails/email-header.php' => 'emails/donation-email-header.php',
'emails/email-order-items.php' => 'emails/donation-email-order-items.php',
'emails/email-styles.php' => 'emails/donation-email-styles.php', 'emails/email-styles.php' => 'emails/donation-email-styles.php',
'emails/donation-customer-invoice.php' => 'emails/donation-customer-invoice.php',
'emails/email-addresses.php' => 'emails/donation-email-addresses.php',
'emails/donation-email-footer.php' => 'emails/donation-email-footer.php',
'emails/donation-email-header.php' => 'emails/donation-email-header.php',
'emails/email-order-items.php' => 'emails/donation-email-order-items.php',
'emails/plain/email-addresses.php' => 'emails/plain/donation-email-addresses.php', 'emails/plain/email-addresses.php' => 'emails/plain/donation-email-addresses.php',
'emails/plain/email-order-items.php' => 'emails/plain/donation-email-order-items.php', 'emails/plain/email-order-items.php' => 'emails/plain/donation-email-order-items.php',
'emails/plain/donation-customer-invoice.php' => 'emails/plain/donation-customer-invoice.php',
) )
...@@ -219,7 +218,6 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -219,7 +218,6 @@ class WooCommerce_Quick_Donation_Functions {
} }
public function wc_locate_template($template_full_path,$template_name,$template_dir){ public function wc_locate_template($template_full_path,$template_name,$template_dir){
if(file_exists($template_full_path)){ return $template_full_path; } if(file_exists($template_full_path)){ return $template_full_path; }
$template_full_path = $template_full_path; $template_full_path = $template_full_path;
...@@ -227,6 +225,12 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -227,6 +225,12 @@ class WooCommerce_Quick_Donation_Functions {
if(isset(self::$search_template['general'][$template_name])){ if(isset(self::$search_template['general'][$template_name])){
$template_full_path = WC_QD_TEMPLATE.self::$search_template['general'][$template_name]; $template_full_path = WC_QD_TEMPLATE.self::$search_template['general'][$template_name];
} }
if(isset(self::$search_template['is_donation'][$template_name])){
$template_full_path = WC_QD_TEMPLATE.self::$search_template['is_donation'][$template_name];
}
if(isset(self::$search_template['after_order'][$template_name])){
$template_full_path = WC_QD_TEMPLATE.self::$search_template['after_order'][$template_name];
}
return $template_full_path; return $template_full_path;
} }
...@@ -271,19 +275,21 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -271,19 +275,21 @@ class WooCommerce_Quick_Donation_Functions {
} }
public function get_template($located, $template_name, $args, $template_path, $default_path ){ public function get_template($located, $template_name, $args, $template_path, $default_path ){
$file = $located; $file = '';
$order_id = 0; $order_id = 0;
$found = false;
if(isset($args['order_id'])){ $order_id = $args['order_id']; } if(isset($args['order_id'])){ $order_id = $args['order_id']; }
if(isset($args['order']->id)){ $order_id = $args['order']->id; } if(isset($args['order']->id)){ $order_id = $args['order']->id; }
if(isset(self::$search_template['general'][$template_name])){ if(isset(self::$search_template['general'][$template_name])){
$file = WC_QD()->f()->locate_template(self::$search_template['general'][$template_name]); $file = WC_QD()->f()->locate_template(self::$search_template['general'][$template_name]);
$found = true;
} }
if(WC_QD()->check_donation_exists_cart()){ if(WC_QD()->check_donation_exists_cart()){
if(isset(self::$search_template['is_donation'][$template_name])){ if(isset(self::$search_template['is_donation'][$template_name])){
$file = WC_QD()->f()->locate_template(self::$search_template['is_donation'][$template_name]); $file = WC_QD()->f()->locate_template(self::$search_template['is_donation'][$template_name]);
$found = true;
} }
} }
...@@ -291,9 +297,16 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -291,9 +297,16 @@ class WooCommerce_Quick_Donation_Functions {
if(WC_QD()->db()->_is_donation($order_id)){ if(WC_QD()->db()->_is_donation($order_id)){
if(isset(self::$search_template['after_order'][$template_name])){ if(isset(self::$search_template['after_order'][$template_name])){
$file = WC_QD()->f()->locate_template(self::$search_template['after_order'][$template_name]); $file = WC_QD()->f()->locate_template(self::$search_template['after_order'][$template_name]);
$found = true;
} }
} }
if($found){
return $file; return $file;
} else {
$file = wc_locate_template($template_name);
return $file;
}
return $located;
} }
} }
...@@ -48,6 +48,8 @@ class WC_QD_Donation_New_Email extends WC_Email { ...@@ -48,6 +48,8 @@ class WC_QD_Donation_New_Email extends WC_Email {
$this->subject_paid = $this->get_option( 'subject_paid', $this->subject_paid ); $this->subject_paid = $this->get_option( 'subject_paid', $this->subject_paid );
add_filter('woocommerce_template_directory',array($this,'change_dir'),2,1); add_filter('woocommerce_template_directory',array($this,'change_dir'),2,1);
add_action( 'woocommerce_donation_email_header', array( $this, 'email_header' ) );
add_action( 'woocommerce_donation_email_footer', array( $this, 'email_footer' ) );
} }
public function change_dir($dir){ public function change_dir($dir){
...@@ -56,6 +58,22 @@ class WC_QD_Donation_New_Email extends WC_Email { ...@@ -56,6 +58,22 @@ class WC_QD_Donation_New_Email extends WC_Email {
} }
/**
* Get the email header.
*
* @param mixed $email_heading heading for the email
*/
public function email_header( $email_heading ) {
wc_get_template( 'emails/donation-email-header.php', array( 'order' => $this->object, 'email_heading' => $email_heading ) );
}
/**
* Get the email footer.
*/
public function email_footer() {
wc_get_template( 'emails/donation-email-footer.php',array( 'order' => $this->object) );
}
/** /**
* Trigger. * Trigger.
*/ */
...@@ -132,7 +150,6 @@ class WC_QD_Donation_New_Email extends WC_Email { ...@@ -132,7 +150,6 @@ class WC_QD_Donation_New_Email extends WC_Email {
'sent_to_admin' => false, 'sent_to_admin' => false,
'plain_text' => false 'plain_text' => false
) ); ) );
return ob_get_clean(); return ob_get_clean();
} }
...@@ -150,7 +167,9 @@ class WC_QD_Donation_New_Email extends WC_Email { ...@@ -150,7 +167,9 @@ class WC_QD_Donation_New_Email extends WC_Email {
'sent_to_admin' => false, 'sent_to_admin' => false,
'plain_text' => true 'plain_text' => true
) ); ) );
return ob_get_clean(); return ob_get_clean();
} }
/** /**
......
...@@ -7,7 +7,22 @@ if(! function_exists('wcqd_get_message')){ ...@@ -7,7 +7,22 @@ if(! function_exists('wcqd_get_message')){
} }
} }
if(! function_exists('wcqd_is_donation')){
function wcqd_is_donation($order_id = ''){
if(empty($order_id)){return false;}
$is_donation = WC_QD()->db()->_is_donation($order_id);
return $is_donation;
}
}
if(! function_exists('wcqd_project_limit')){ if(! function_exists('wcqd_project_limit')){
/**
* To Get Projects Min & Max Limit
* @param [int] [$project_id = 0] [Post id of the donation project]
* @param [int] [$type = 'min'] [use min / max to get the limit]
* @return [int] [return limit value]
*/
function wcqd_project_limit($project_id = 0, $type = 'min'){ function wcqd_project_limit($project_id = 0, $type = 'min'){
if(empty($project_id)){return false; } if(empty($project_id)){return false; }
if($type !== 'min' && $type !== 'max'){return false;} if($type !== 'min' && $type !== 'max'){return false;}
...@@ -17,8 +32,13 @@ if(! function_exists('wcqd_project_limit')){ ...@@ -17,8 +32,13 @@ if(! function_exists('wcqd_project_limit')){
} }
} }
if(! function_exists('wcqd_get_project')){ if(! function_exists('wcqd_get_project_from_order')){
function wcqd_get_project($order_id = ''){ /**
* Returns Project ID From Order ID
* @param [int] [$order_id = ''] [pass the order id to get the project id]
* @return int / boolean [returns project id if exist or returns false]
*/
function wcqd_get_project_from_order($order_id = ''){
$is_donation = WC_QD()->db()->_is_donation($order_id); $is_donation = WC_QD()->db()->_is_donation($order_id);
if($is_donation){ if($is_donation){
$project = WC_QD()->db()->get_project_id($order_id); $project = WC_QD()->db()->get_project_id($order_id);
...@@ -29,6 +49,11 @@ if(! function_exists('wcqd_get_project')){ ...@@ -29,6 +49,11 @@ if(! function_exists('wcqd_get_project')){
} }
if(! function_exists('wcqd_get_project_name')){ if(! function_exists('wcqd_get_project_name')){
/**
* Returns Project Title From Order ID
* @param [int] [$order_id = ''] [pass the order id to get the project title]
* @return int / boolean [returns project id if exist or returns false]
*/
function wcqd_get_project_name($order_id = '', $default_title = ''){ function wcqd_get_project_name($order_id = '', $default_title = ''){
$project_id = wcqd_get_project($order_id); $project_id = wcqd_get_project($order_id);
$title = get_the_title($project_id); $title = get_the_title($project_id);
......
...@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?> ?>
<?php do_action( 'woocommerce_email_header', $email_heading ); ?> <?php do_action( 'woocommerce_donation_email_header', $email_heading ); ?>
<?php if ( $order->has_status( 'pending' ) ) : ?> <?php if ( $order->has_status( 'pending' ) ) : ?>
...@@ -71,4 +71,4 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -71,4 +71,4 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); ?> <?php do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); ?>
<?php do_action( 'woocommerce_email_footer' ); ?> <?php do_action( 'woocommerce_donation_email_footer' ); ?>
<?php
/**
* Donation Tracking
*
* @author Varun Sridharan
* @package WooCommerce Quick Donation/Templates/order
* @version 0.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
global $post;
?>
<form action="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" method="post" class="track_order">
<p><?php _e( 'To track your order please enter your Order ID in the box below and press the "Track" button. This was given to you on your receipt and in the confirmation email you should have received.', 'woocommerce' ); ?></p>
<p class="form-row form-row-first"><label for="orderid"><?php _e( 'Order ID', 'woocommerce' ); ?></label> <input class="input-text" type="text" name="orderid" id="orderid" placeholder="<?php esc_attr_e( 'Found in your order confirmation email.', 'woocommerce' ); ?>" /></p>
<p class="form-row form-row-last"><label for="order_email"><?php _e( 'Billing Email', 'woocommerce' ); ?></label> <input class="input-text" type="text" name="order_email" id="order_email" placeholder="<?php esc_attr_e( 'Email you used during checkout.', 'woocommerce' ); ?>" /></p>
<div class="clear"></div>
<p class="form-row"><input type="submit" class="button" name="track" value="<?php esc_attr_e( 'Track', 'woocommerce' ); ?>" /></p>
<?php wp_nonce_field( 'woocommerce-order_tracking' ); ?>
</form>
\ No newline at end of file
<?php
/**
* Donate Again
*
* @author Varun Sridharan
* @package WooCommerce Quick Donation/Templates/order
* @version 0.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<p class="order-again">
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'order_again', $order->id ) , 'woocommerce-order_again' ) ); ?>" class="button"><?php _e( 'Order Again', 'woocommerce' ); ?></a>
</p>
<?php
/**
* Donation tracking
*
* @author Varun Sridharan
* @package WooCommerce Quick Donation/Templates/order
* @version 0.1
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
$order_status_text = sprintf( __( 'Order #%s which was made %s has the status &ldquo;%s&rdquo;', 'woocommerce' ), $order->get_order_number(), human_time_diff( strtotime( $order->order_date ), current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) );
if ( $order->has_status( 'completed' ) ) $order_status_text .= ' ' . __( 'and was completed', 'woocommerce' ) . ' ' . human_time_diff( strtotime( $order->completed_date ), current_time( 'timestamp' ) ) . __( ' ago', 'woocommerce' );
$order_status_text .= '.';
echo wpautop( esc_attr( apply_filters( 'woocommerce_order_tracking_status', $order_status_text, $order ) ) );
$notes = $order->get_customer_order_notes();
if ( $notes ) : ?>
<h2><?php _e( 'Order Updates', 'woocommerce' ); ?></h2>
<ol class="commentlist notes">
<?php foreach ( $notes as $note ) : ?>
<li class="comment note">
<div class="comment_container">
<div class="comment-text">
<p class="meta"><?php echo date_i18n( __( 'l jS \o\f F Y, h:ia', 'woocommerce' ), strtotime( $note->comment_date ) ); ?></p>
<div class="description">
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<?php do_action( 'woocommerce_view_order', $order->id ); ?>
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