Commit e42b0148 authored by Varun Sridharan's avatar Varun Sridharan

Issue Fixed And Tweaks Done

* Fixed #30
* Fixed #43
* Auto Config Default Settings When Installing
* Changed woocommerce text domain ref to woocommerce-quick-donation
parent 55b7d2de
This diff is collapsed.
...@@ -244,7 +244,7 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -244,7 +244,7 @@ class WooCommerce_Quick_Donation_Admin {
public function set_wc_screen_ids($screens){ public function set_wc_screen_ids($screens){
$screen = $screens; $screen = $screens;
$screen[] = 'wcqd_project_page_WC_QD_settings'; $screen[] = WC_QD_PT.'_page_wc_qd_settings';
$screen[] = $this->order_menu_slug; $screen[] = $this->order_menu_slug;
$screen[] = $this->donors_list; $screen[] = $this->donors_list;
$screen[] = $this->sys_info; $screen[] = $this->sys_info;
...@@ -269,8 +269,7 @@ class WooCommerce_Quick_Donation_Admin { ...@@ -269,8 +269,7 @@ class WooCommerce_Quick_Donation_Admin {
$screen_ids = array(); $screen_ids = array();
$screen_ids[] = 'edit-product'; $screen_ids[] = 'edit-product';
$screen_ids[] = 'product'; $screen_ids[] = 'product';
$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[] = $this->order_menu_slug; $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->donors_list;
......
...@@ -65,7 +65,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions { ...@@ -65,7 +65,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions {
$link = get_permalink($project_ID); $link = get_permalink($project_ID);
printf('<a href="%s"> %s </a> ',$link,$title); printf('<a href="%s"> %s </a> ',$link,$title);
} else if('order_id' == $column){ } else if('order_id' == $column){
printf( _x( '%s ', 'Order number by X', 'woocommerce' ), '<a href="' . admin_url( 'post.php?post=' . absint( $post->ID ) . '&action=edit' ) . '" class="row-title"><strong>#' . esc_attr( $the_order->get_order_number() ) . '</strong></a>' ); printf( _x( '%s ', 'Order number by X', WC_QD_TXT ), '<a href="' . admin_url( 'post.php?post=' . absint( $post->ID ) . '&action=edit' ) . '" class="row-title"><strong>#' . esc_attr( $the_order->get_order_number() ) . '</strong></a>' );
} else if ('by_user' == $column){ } else if ('by_user' == $column){
if ( $the_order->user_id ) { if ( $the_order->user_id ) {
$user_info = get_userdata( $the_order->user_id ); $user_info = get_userdata( $the_order->user_id );
...@@ -87,7 +87,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions { ...@@ -87,7 +87,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions {
if ( $the_order->billing_first_name || $the_order->billing_last_name ) { if ( $the_order->billing_first_name || $the_order->billing_last_name ) {
$username = trim( $the_order->billing_first_name . ' ' . $the_order->billing_last_name ); $username = trim( $the_order->billing_first_name . ' ' . $the_order->billing_last_name );
} else { } else {
$username = __( 'Guest', 'woocommerce' ); $username = __( 'Guest', WC_QD_TXT );
} }
} }
...@@ -101,7 +101,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions { ...@@ -101,7 +101,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions {
remove_meta_box('woocommerce-order-items','shop_order','normal'); remove_meta_box('woocommerce-order-items','shop_order','normal');
remove_meta_box('woocommerce-order-downloads','shop_order','normal'); remove_meta_box('woocommerce-order-downloads','shop_order','normal');
remove_meta_box('woocommerce-order-data','shop_order','normal'); remove_meta_box('woocommerce-order-data','shop_order','normal');
add_meta_box( 'woocommerce-quick-donation-order-data', sprintf( __( '%s Data', 'woocommerce' ), 'Donation' ), 'WC_Quick_Donation_Meta_Box_Order_Data::output', 'shop_order', 'normal', 'high' ); add_meta_box( 'woocommerce-quick-donation-order-data', sprintf( __( '%s Data', WC_QD_TXT ), 'Donation' ), 'WC_Quick_Donation_Meta_Box_Order_Data::output', 'shop_order', 'normal', 'high' );
remove_action( 'woocommerce_process_shop_order_meta', 'WC_Meta_Box_Order_Data::save', 40); remove_action( 'woocommerce_process_shop_order_meta', 'WC_Meta_Box_Order_Data::save', 40);
} }
......
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
<div class="order_data_column" style="display:none; visibility: hidden;"> <div class="order_data_column" style="display:none; visibility: hidden;">
<?php <?php
echo '<div class="address">'; echo '<div class="address">';
if ( $order->get_formatted_shipping_address() ) { echo '<p><strong>' . __( 'Address', 'woocommerce' ) . ':</strong>' . wp_kses( $order->get_formatted_shipping_address(), array( 'br' => array() ) ) . '</p>'; } else { echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No shipping address set.', 'woocommerce' ) . '</p>'; } if ( $order->get_formatted_shipping_address() ) { echo '<p><strong>' . __( 'Address', WC_QD_TXT ) . ':</strong>' . wp_kses( $order->get_formatted_shipping_address(), array( 'br' => array() ) ) . '</p>'; } else { echo '<p class="none_set"><strong>' . __( 'Address', WC_QD_TXT ) . ':</strong> ' . __( 'No shipping address set.', WC_QD_TXT ) . '</p>'; }
if ( ! empty( self::$shipping_fields ) ) { foreach ( self::$shipping_fields as $key => $field ) { if ( isset( $field['show'] ) && false === $field['show'] ) { continue; } $field_name = 'shipping_' . $key; if ( ! empty( $order->$field_name ) ) { echo '<p><strong>' . esc_html( $field['label'] ) . ':</strong> ' . make_clickable( esc_html( $order->$field_name ) ) . '</p>'; } } } if ( ! empty( self::$shipping_fields ) ) { foreach ( self::$shipping_fields as $key => $field ) { if ( isset( $field['show'] ) && false === $field['show'] ) { continue; } $field_name = 'shipping_' . $key; if ( ! empty( $order->$field_name ) ) { echo '<p><strong>' . esc_html( $field['label'] ) . ':</strong> ' . make_clickable( esc_html( $order->$field_name ) ) . '</p>'; } } }
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' == get_option( 'woocommerce_enable_order_comments', 'yes' ) ) && $post->post_excerpt ) { echo '<p><strong>' . __( 'Customer Provided Note', 'woocommerce' ) . ':</strong> ' . nl2br( esc_html( $post->post_excerpt ) ) . '</p>'; } if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' == get_option( 'woocommerce_enable_order_comments', 'yes' ) ) && $post->post_excerpt ) { echo '<p><strong>' . __( 'Customer Provided Note', WC_QD_TXT ) . ':</strong> ' . nl2br( esc_html( $post->post_excerpt ) ) . '</p>'; }
echo '</div>'; echo '</div>';
echo '<div class="edit_address">'; echo '<div class="edit_address">';
if ( ! empty( self::$shipping_fields ) ) { foreach ( self::$shipping_fields as $key => $field ) { if ( ! isset( $field['type'] ) ) { $field['type'] = 'hidden'; } if ( ! isset( $field['id'] ) ){ $field['id'] = '_shipping_' . $key; } if ( ! empty( self::$shipping_fields ) ) { foreach ( self::$shipping_fields as $key => $field ) { if ( ! isset( $field['type'] ) ) { $field['type'] = 'hidden'; } if ( ! isset( $field['id'] ) ){ $field['id'] = '_shipping_' . $key; }
...@@ -75,8 +75,8 @@ break; ...@@ -75,8 +75,8 @@ break;
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' == get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) { if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' == get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) {
?> ?>
<p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer Provided Note', 'woocommerce' ) ?>:</label> <p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer Provided Note', WC_QD_TXT ) ?>:</label>
<textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php esc_attr_e( 'Customer\'s notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p> <textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php esc_attr_e( 'Customer\'s notes about the order', WC_QD_TXT ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
<?php <?php
} }
......
...@@ -8,7 +8,7 @@ $fields['settings_general']['general'][] = array( ...@@ -8,7 +8,7 @@ $fields['settings_general']['general'][] = array(
'label' => __( 'Redirect User To', WC_QD_TXT), 'label' => __( 'Redirect User To', WC_QD_TXT),
'desc' => __( 'After Donation Added To Cart',WC_QD_TXT), 'desc' => __( 'After Donation Added To Cart',WC_QD_TXT),
'size ' => 'small', 'size ' => 'small',
'options' => array('cart' => 'Cart Page' , 'checkout' => 'Checkout Page'), 'options' => array('cart' => __('Cart Page',WC_QD_TXT) , 'checkout' => __('Checkout Page',WC_QD_TXT)),
'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;') 'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;')
); );
...@@ -19,7 +19,7 @@ $fields['settings_general']['general'][] = array( ...@@ -19,7 +19,7 @@ $fields['settings_general']['general'][] = array(
'label' => __( 'Donation Exist Redirect', WC_QD_TXT), 'label' => __( 'Donation Exist Redirect', WC_QD_TXT),
'desc' => __( 'Redirect User When Donation Already Exist In Cart',WC_QD_TXT), 'desc' => __( 'Redirect User When Donation Already Exist In Cart',WC_QD_TXT),
'size ' => 'small', 'size ' => 'small',
'options' => array('' => 'None', 'cart' => 'Cart Page' , 'checkout' => 'Checkout Page'), 'options' => array('cart' => __('Cart Page',WC_QD_TXT) , 'checkout' => __('Checkout Page',WC_QD_TXT)),
'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;') 'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;')
); );
...@@ -34,15 +34,12 @@ $fields['settings_general']['general'][] = array( ...@@ -34,15 +34,12 @@ $fields['settings_general']['general'][] = array(
); );
/** Message Settings **/ /** Message Settings **/
$fields['settings_message']['message'][] = array( $fields['settings_message']['message'][] = array(
'desc' => __( '<div class="decs"> <span> Add <code>{donation_amount}</code> To Get Ented Amount By User. </span> 'desc' => sprintf(__( '<span> Add <code>%s</code> To Get Ented Amount By User.</span> <br/>
<span> Add <code>{min_amount}</code> To Get Minimum Required Amount From Selected Project </span> <span> Add <code>%s</code> To Get Minimum Required Amount From Selected Project </span> <br/>
<span> Add <code>{max_amount}</code> To Get Minimum Required Amount From Selected Project </span> </div>',WC_QD_TXT), <span> Add <code>%s</code> To Get Minimum Required Amount From Selected Project </span>',WC_QD_TXT),'{donation_amount}','{min_amount}','{max_amount}'),
'id' => WC_QD_DB.'empty_donation_msg_1', 'id' => WC_QD_DB.'empty_donation_msg_1',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'content' 'type' => 'content'
); );
...@@ -51,7 +48,7 @@ $fields['settings_message']['message'][] = array( ...@@ -51,7 +48,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Donation Conflict', WC_QD_TXT), 'label' => __( 'Donation Conflict', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When User Trying To Add Donation With Other Products',WC_QD_TXT), 'desc' => __( 'Custom Message To Show When User Trying To Add Donation With Other Products',WC_QD_TXT),
'id' => WC_QD_DB.'donation_with_other_products', 'id' => WC_QD_DB.'donation_with_other_products',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea' 'type' => 'textarea'
); );
...@@ -59,7 +56,7 @@ $fields['settings_message']['message'][] = array( ...@@ -59,7 +56,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Empty Donation Amount', WC_QD_TXT), 'label' => __( 'Empty Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Empty Donation Entered',WC_QD_TXT), 'desc' => __( 'Custom Message To Show When Empty Donation Entered',WC_QD_TXT),
'id' => WC_QD_DB.'empty_donation_msg', 'id' => WC_QD_DB.'empty_donation_msg',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea' 'type' => 'textarea'
); );
...@@ -67,7 +64,7 @@ $fields['settings_message']['message'][] = array( ...@@ -67,7 +64,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Donation Already Exist', WC_QD_TXT), 'label' => __( 'Donation Already Exist', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When User Trying To Add Another Donation To Cart',WC_QD_TXT), 'desc' => __( 'Custom Message To Show When User Trying To Add Another Donation To Cart',WC_QD_TXT),
'id' => WC_QD_DB.'donation_already_exist', 'id' => WC_QD_DB.'donation_already_exist',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea', 'type' => 'textarea',
); );
...@@ -76,7 +73,7 @@ $fields['settings_message']['message'][] = array( ...@@ -76,7 +73,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Invalid Donation Amount', WC_QD_TXT), 'label' => __( 'Invalid Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Invalid Donation Entered',WC_QD_TXT), 'desc' => __( 'Custom Message To Show When Invalid Donation Entered',WC_QD_TXT),
'id' => WC_QD_DB.'invalid_donation_msg', 'id' => WC_QD_DB.'invalid_donation_msg',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea' 'type' => 'textarea'
); );
...@@ -84,7 +81,7 @@ $fields['settings_message']['message'][] = array( ...@@ -84,7 +81,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Minimum Required Donation Amount', WC_QD_TXT), 'label' => __( 'Minimum Required Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Minimum Required Donation Not Entered',WC_QD_TXT), 'desc' => __( 'Custom Message To Show When Minimum Required Donation Not Entered',WC_QD_TXT),
'id' => WC_QD_DB.'min_rda_msg', 'id' => WC_QD_DB.'min_rda_msg',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea' 'type' => 'textarea'
); );
...@@ -92,6 +89,43 @@ $fields['settings_message']['message'][] = array( ...@@ -92,6 +89,43 @@ $fields['settings_message']['message'][] = array(
'label' =>__( 'Maximum Required Donation Amount', WC_QD_TXT), 'label' =>__( 'Maximum Required Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Maximum Required Donation Not Entered ',WC_QD_TXT), 'desc' => __( 'Custom Message To Show When Maximum Required Donation Not Entered ',WC_QD_TXT),
'id' => WC_QD_DB.'max_rda_msg', 'id' => WC_QD_DB.'max_rda_msg',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'), 'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea' 'type' => 'textarea'
); );
\ No newline at end of file
/** Shortcode Settings **/
$fields['settings_shortcode']['shortcode'][] = array(
'id' => WC_QD_DB.'default_render_type',
'type' => 'select',
'label' => __( 'Pre Selected Project Name', WC_QD_TXT),
'desc' => __( 'default project render type',WC_QD_TXT),
'size ' => 'small',
'options' => array('select' => __('Select Box',WC_QD_TXT), 'radio' => __('Radio Button',WC_QD_TXT)),
'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;')
);
$fields['settings_shortcode']['shortcode'][] = array(
'id' => WC_QD_DB.'shortcode_show_errors',
'type' => 'select',
'label' => __( 'Show Errors', WC_QD_TXT),
'desc' => __( 'Set to hide errors when <code> wc_print_notice</code> called before loading dontion form',WC_QD_TXT),
'size ' => 'small',
'options' => array('true' => __('Show Errors',WC_QD_TXT), 'false' => __('Hide Errors',WC_QD_TXT)),
'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;')
);
$fields['settings_shortcode']['shortcode'][] = array(
'id' => WC_QD_DB.'pre_selected_project',
'type' => 'select',
'label' => __( 'Pre Selected Project Name', WC_QD_TXT),
'desc' => __( 'this value will be selected in donation project box',WC_QD_TXT),
'size ' => 'small',
'options' => WC_QD()->f()->get_porject_list(),
'attr' => array('class' => 'wc-enhanced-select','style' => 'width:auto;max-width:35%;')
);
//WC_QD()->f()->get_porject_list()
?>
<?php <?php
global $pages; global $pages;
$pages[] = array('id'=>'settings_general','slug'=>'general','title'=>'General'); $pages[] = array('id'=>'settings_general','slug'=>'general','title'=>__('General',WC_QD_TXT));
$pages[] = array('id'=>'settings_message','slug'=>'message','title'=>'Message'); $pages[] = array('id'=>'settings_message','slug'=>'message','title'=>__('Message',WC_QD_TXT));
$pages[] = array('id'=>'settings_shortcode','slug'=>'shortcode','title'=>__('ShortCode',WC_QD_TXT));
?> ?>
\ No newline at end of file
<?php <?php
global $section; global $section;
$section['settings_general'][] = array('id'=>'general','title'=>'', 'validate_callback' =>array( $this, 'validate_section' )); $section['settings_general'][] = array(
'id'=>'general',
'title'=>'',
'validate_callback' =>array( $this, 'validate_section' )
);
$section['settings_message'][] = array( $section['settings_message'][] = array(
'id'=>'message', 'id'=>'message',
...@@ -9,3 +13,11 @@ $section['settings_message'][] = array( ...@@ -9,3 +13,11 @@ $section['settings_message'][] = array(
'desc' => '', 'desc' => '',
'validate_callback'=>array( $this, 'validate_section' ), 'validate_callback'=>array( $this, 'validate_section' ),
); );
$section['settings_shortcode'][] = array(
'id'=>'shortcode',
'title'=>'',
'desc' => '',
'validate_callback'=>array( $this, 'validate_section' ),
);
\ No newline at end of file
<?php <?php
class WooCommerce_Quick_Donation_Settings { class WooCommerce_Quick_Donation_Settings {
private $page_hook = ''; private $page_hook = '';
public $settings; public $settings;
...@@ -9,6 +8,7 @@ class WooCommerce_Quick_Donation_Settings { ...@@ -9,6 +8,7 @@ class WooCommerce_Quick_Donation_Settings {
private $create_function; private $create_function;
private $settings_key; private $settings_key;
private $settings_values; private $settings_values;
function __construct($page_hook = '') { function __construct($page_hook = '') {
$this->settings_section = array(); $this->settings_section = array();
$this->settings_fields = array(); $this->settings_fields = array();
...@@ -18,22 +18,25 @@ class WooCommerce_Quick_Donation_Settings { ...@@ -18,22 +18,25 @@ class WooCommerce_Quick_Donation_Settings {
$this->get_settings(); $this->get_settings();
$this->add_settings_section(); $this->add_settings_section();
$this->create_callback_function(); $this->create_callback_function();
$this->page_hook = $page_hook;
$this->page_hook = $page_hook;
$this->settings = new WC_Quick_Donation_Settings();
if(empty($page_hook)) { if(empty($page_hook)) {
add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'admin_menu', array( $this, 'admin_menu' ) );
} }
add_action( 'current_screen', array( $this, 'admin_screen' ));
add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'admin_init', array( $this, 'admin_init' ) );
} }
function admin_menu() { function admin_menu() {
$this->page_hook = add_submenu_page('edit.php?post_type=wcqd_project','Settings Page','Settings Page','administrator','WC_QD_settings', array( $this, 'admin_page' ) ); $this->page_hook = add_submenu_page('edit.php?post_type='.WC_QD_PT,
$this->page_hook = 'wc_qd'; __('Settings Page',WC_QD_TXT),
__('Settings Page',WC_QD_TXT),
'administrator','wc_qd_settings', array( $this, 'admin_page' ) );
//$this->page_hook = 'wc_qd';
} }
...@@ -81,8 +84,14 @@ class WooCommerce_Quick_Donation_Settings { ...@@ -81,8 +84,14 @@ class WooCommerce_Quick_Donation_Settings {
$this->settings_field = $fields; $this->settings_field = $fields;
} }
function admin_screen($hook){
if($this->page_hook == $hook->id){
//$this->settings->init( $this->pages, WC_QD_DB_SETTINGS );
}
}
function admin_init(){ function admin_init(){
$this->settings = new WC_Quick_Donation_Settings();
$this->add_settings_fields(); $this->add_settings_fields();
$this->settings->add_pages($this->settings_page); $this->settings->add_pages($this->settings_page);
$sections = $this->settings_section; $sections = $this->settings_section;
...@@ -105,8 +114,8 @@ class WooCommerce_Quick_Donation_Settings { ...@@ -105,8 +114,8 @@ class WooCommerce_Quick_Donation_Settings {
} }
} }
$this->settings->init( $pages, $this->page_hook ); $this->settings->init($pages, WC_QD_DB_SETTINGS );
} }
...@@ -115,20 +124,10 @@ class WooCommerce_Quick_Donation_Settings { ...@@ -115,20 +124,10 @@ class WooCommerce_Quick_Donation_Settings {
settings_errors(); settings_errors();
$this->settings->render_header(); $this->settings->render_header();
echo $this->settings->debug; echo $this->settings->debug;
$this->settings->render_form(); $this->settings->render_form();
echo '</div>'; echo '</div>';
} }
//function validate_section( $fields ) {
// global $send_fields;
// $send_fields = $fields;
// include(WC_QD_ADMIN.'settings/validate.php');
// return $fields;
//}
function get_option($id = ''){ function get_option($id = ''){
if( ! empty($this->settings_values) && ! empty($id)){ if( ! empty($this->settings_values) && ! empty($id)){
if(isset($this->settings_values[$id])){ if(isset($this->settings_values[$id])){
...@@ -155,6 +154,4 @@ class WooCommerce_Quick_Donation_Settings { ...@@ -155,6 +154,4 @@ class WooCommerce_Quick_Donation_Settings {
} }
} }
?> ?>
\ No newline at end of file
...@@ -11,13 +11,17 @@ class WC_QD_INSTALL{ ...@@ -11,13 +11,17 @@ class WC_QD_INSTALL{
self::post_register(); self::post_register();
self::wc_qd_table_install(); self::wc_qd_table_install();
self::check_template_files(); self::check_template_files();
self::add_options();
if(! $donation_exist){ if(! $donation_exist){
$post_id = self::create_simple_donation(); $post_id = self::create_simple_donation();
update_option(WC_QD_DB.'product_id',$post_id); update_option(WC_QD_DB.'product_id',$post_id);
} }
} }
/**
* Registers Custom Post, Custom Taxonomy
*/
public static function post_register(){ public static function post_register(){
WC_QD_Post_Types::register_donation_posttype(); WC_QD_Post_Types::register_donation_posttype();
WC_QD_Post_Types::register_donation_category(); WC_QD_Post_Types::register_donation_category();
...@@ -66,6 +70,49 @@ class WC_QD_INSTALL{ ...@@ -66,6 +70,49 @@ class WC_QD_INSTALL{
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql ); dbDelta( $sql );
} }
public static function add_options(){
$general_settings = self::general_section_settings();
$message_settings = self::message_section_settings();
$shortcode_settings = self::shortcode_section_settings();
add_option( 'wc_qd_general', $general_settings);
add_option('wc_qd_message', $message_settings);
add_option('wc_qd_shortcode',$shortcode_settings);
add_option('wc_qd_anh_notices', '');
}
private static function general_section_settings(){
$s = array();
$s['section_id'] = 'general';
$s[WC_QD_DB_SETTINGS.'_redirect_user'] = 'checkout';
$s[WC_QD_DB_SETTINGS.'_already_exist_redirect_user'] = 'cart';
return $s;
}
private static function message_section_settings(){
$s = array();
$s['section_id'] = 'message';
$s[WC_QD_DB_SETTINGS.'_donation_with_other_products'] = 'Unable To Process Donation. Kindly Complete The Exist Order ';
$s[WC_QD_DB_SETTINGS.'_empty_donation_msg'] = 'Please Enter A Donation Amount';
$s[WC_QD_DB_SETTINGS.'_donation_already_exist'] = 'Donation Already Exist In Cart. Kindly Complete The Existing';
$s[WC_QD_DB_SETTINGS.'_invalid_donation_msg'] = 'Invalid Donation Amount Entered [{donation_amount}]';
$s[WC_QD_DB_SETTINGS.'_min_rda_msg'] = 'Please Enter Minimum of {min_amount}.';
$s[WC_QD_DB_SETTINGS.'_max_rda_msg'] = 'Please Enter Maximum of {max_amount}.';
return $s;
}
private static function shortcode_section_settings(){
$s['section_id'] = 'shortcode';
$s[WC_QD_DB_SETTINGS.'_default_render_type'] = 'select';
$s[WC_QD_DB_SETTINGS.'_shortcode_show_errors'] = 'true';
$s[WC_QD_DB_SETTINGS.'_pre_selected_project'] = '';
return $s;
}
/** /**
* Create Donation Product In WooCommerce * Create Donation Product In WooCommerce
...@@ -96,14 +143,18 @@ class WC_QD_INSTALL{ ...@@ -96,14 +143,18 @@ class WC_QD_INSTALL{
update_post_meta($post_id, '_sku', 'checkout-donation'); update_post_meta($post_id, '_sku', 'checkout-donation');
return $post_id; return $post_id;
} }
/**
* Gets ALl Core Templates
*/
public static function get_template_list(){ public static function get_template_list(){
$core_tempalte_list = WC_Admin_Status::scan_template_files( WC_QD_TEMPLATE ); $core_tempalte_list = WC_Admin_Status::scan_template_files( WC_QD_TEMPLATE );
return $core_tempalte_list; return $core_tempalte_list;
} }
/**
* Checks For Template Version
*/
public static function check_template_files(){ public static function check_template_files(){
$template_files = self::get_template_list(); $template_files = self::get_template_list();
$outdated = false; $outdated = false;
...@@ -137,7 +188,7 @@ class WC_QD_INSTALL{ ...@@ -137,7 +188,7 @@ class WC_QD_INSTALL{
$theme = wp_get_theme(); $theme = wp_get_theme();
$message = sprintf( $message = sprintf(
__( '<p> <strong>Your theme (%s) contains outdated copies of some WooCommerce Quick Donation template files.</strong> These files may need updating to ensure they are compatible with the current version of WooCommerce Quick Donation. You can see which files are affected from the %ssystem status page%s. If in doubt, check with the author of the theme. </p> <p class="submit">%sLear More About Templates%s %s</p>', __( '<p> <strong>Your theme (%s) contains outdated copies of some WooCommerce Quick Donation template files.</strong> These files may need updating to ensure they are compatible with the current version of WooCommerce Quick Donation. You can see which files are affected from the %ssystem status page%s. If in doubt, check with the author of the theme. </p> <p class="submit">%sLear More About Templates%s %s</p>',
'woocommerce' ), WC_QD_TXT),
esc_html( $theme['Name'] ), esc_html( $theme['Name'] ),
'<a href="' . admin_url( 'admin.php?page=wc-status' ) . '">','</a>', '<a href="' . admin_url( 'admin.php?page=wc-status' ) . '">','</a>',
'<a target="_blank" href="" class="button-primary" href="">','</a>', '<a target="_blank" href="" class="button-primary" href="">','</a>',
......
...@@ -17,11 +17,8 @@ class WooCommerce_Quick_Donation_Emails_Functions { ...@@ -17,11 +17,8 @@ class WooCommerce_Quick_Donation_Emails_Functions {
add_action('woocommerce_order_status_failed',array($this,'check_order'),1); add_action('woocommerce_order_status_failed',array($this,'check_order'),1);
add_action( 'woocommerce_email',array($this,'remove_email_actions'),1); add_action( 'woocommerce_email',array($this,'remove_email_actions'),1);
// Triggers for this email
add_action( 'woocommerce_donation_email_header', array( $this, 'email_header' ) ); add_action( 'woocommerce_donation_email_header', array( $this, 'email_header' ) );
add_action( 'woocommerce_donation_email_footer', array( $this, 'email_footer' ) ); add_action( 'woocommerce_donation_email_footer', array( $this, 'email_footer' ) );
//add_filter( 'woocommerce_template_directory', array( $this, 'change_dir'),2,2); //add_filter( 'woocommerce_template_directory', array( $this, 'change_dir'),2,2);
} }
......
...@@ -155,16 +155,17 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -155,16 +155,17 @@ class WooCommerce_Quick_Donation_Functions {
} }
public function generate_donation_selbox($grouped = false,$type = 'select'){ public function generate_donation_selbox($grouped = false,$type = 'select',$selected=''){
global $id, $name, $class, $field_output, $is_grouped, $project_list,$attributes; global $id, $name, $class, $field_output, $is_grouped, $project_list,$attributes;
$field_output = ''; $field_output = '';
$id = 'donation_project'; $id = 'donation_project';
$name = 'wc_qd_donate_project_name'; $name = 'wc_qd_donate_project_name';
$class = apply_filters('wcqd_project_name_'.$type.'_class',array(),$type); $class = apply_filters('wcqd_project_name_'.$type.'_class',array(),$type);
$custom_attributes = apply_filters('wcqd_project_name_'.$type.'_attribute',array(),$type); $custom_attributes = apply_filters('wcqd_project_name_'.$type.'_attribute',array(),$type);
$is_grouped = $grouped; $is_grouped = $grouped;
$project_list = $this->get_porject_list($grouped); $project_list = $this->get_porject_list($grouped);
$class = implode(' ',$class); $class = implode(' ',$class);
$attributes = ''; $attributes = '';
foreach($custom_attributes as $attr_key => $attr_val) { foreach($custom_attributes as $attr_key => $attr_val) {
...@@ -177,6 +178,7 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -177,6 +178,7 @@ class WooCommerce_Quick_Donation_Functions {
'field_output' => $field_output, 'field_output' => $field_output,
'is_grouped' => $is_grouped, 'is_grouped' => $is_grouped,
'project_list' => $project_list, 'project_list' => $project_list,
'pre_selected' => $selected,
'attributes' => $attributes)); 'attributes' => $attributes));
return $field_output; return $field_output;
} }
......
...@@ -23,19 +23,21 @@ class WooCommerce_Quick_Donation_Shortcode { ...@@ -23,19 +23,21 @@ class WooCommerce_Quick_Donation_Shortcode {
public function shortcode_handler($settings){ public function shortcode_handler($settings){
global $donation_box,$donation_price,$currency; global $donation_box,$donation_price,$currency;
$settings = shortcode_atts( array( $settings = shortcode_atts( array(
'type' => 'select', 'type' => wcqd_get_option(WC_QD_DB.'default_render_type'),
'grouped' => false, 'grouped' => false,
'show_erros' => true, 'show_errors' => wcqd_get_option(WC_QD_DB.'shortcode_show_errors'),
'selected_value' => wcqd_get_option(WC_QD_DB.'pre_selected_project'),
), $settings ); ), $settings );
$donation_box = WC_QD()->f()->generate_donation_selbox($settings['grouped'],$settings['type']); $donation_box = WC_QD()->f()->generate_donation_selbox($settings['grouped'],$settings['type'],$settings['selected_value']);
$donation_price = WC_QD()->f()->generate_price_box(); $donation_price = WC_QD()->f()->generate_price_box();
$currency = get_woocommerce_currency_symbol(); $currency = get_woocommerce_currency_symbol();
$return_value = ''; $return_value = '';
$messages = ''; $messages = '';
if($settings['show_erros']){ if($settings['show_errors']){
ob_start(); ob_start();
wc_print_notices(); wc_print_notices();
$messages .= ob_get_clean(); $messages .= ob_get_clean();
......
...@@ -26,10 +26,10 @@ class WC_QD_donation_completed_email extends WC_Email { ...@@ -26,10 +26,10 @@ class WC_QD_donation_completed_email extends WC_Email {
$this->id = WC_QD_DB.'donation_completed_email'; $this->id = WC_QD_DB.'donation_completed_email';
$this->title = __( 'Completed Donation', WC_QD_TXT); $this->title = __( 'Completed Donation', WC_QD_TXT);
$this->description = __( 'Order complete emails are sent to customers when their orders are marked completed and usually indicate that their orders have been shipped.', 'woocommerce' ); $this->description = __( 'Order complete emails are sent to customers when their orders are marked completed and usually indicate that their orders have been shipped.', WC_QD_TXT );
$this->heading = __( 'Your Donation for {project_name} is complete', WC_QD_TXT); $this->heading = __( 'Your Donation for {project_name} is complete', WC_QD_TXT);
$this->subject = __( 'Your {site_title} donation from {order_date} is complete', 'woocommerce' ); $this->subject = __( 'Your {site_title} donation from {order_date} is complete', WC_QD_TXT );
$this->template_html = 'emails/donation-completed.php'; $this->template_html = 'emails/donation-completed.php';
$this->template_plain = 'emails/plain/donation-completed.php'; $this->template_plain = 'emails/plain/donation-completed.php';
...@@ -135,30 +135,30 @@ class WC_QD_donation_completed_email extends WC_Email { ...@@ -135,30 +135,30 @@ class WC_QD_donation_completed_email extends WC_Email {
function init_form_fields() { function init_form_fields() {
$this->form_fields = array( $this->form_fields = array(
'enabled' => array( 'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ), 'title' => __( 'Enable/Disable', WC_QD_TXT ),
'type' => 'checkbox', 'type' => 'checkbox',
'label' => __( 'Enable this email notification', 'woocommerce' ), 'label' => __( 'Enable this email notification', WC_QD_TXT ),
'default' => 'yes' 'default' => 'yes'
), ),
'subject' => array( 'subject' => array(
'title' => __( 'Subject', 'woocommerce' ), 'title' => __( 'Subject', WC_QD_TXT ),
'type' => 'text', 'type' => 'text',
'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->subject ), 'description' => sprintf( __( 'Defaults to <code>%s</code>', WC_QD_TXT ), $this->subject ),
'placeholder' => '', 'placeholder' => '',
'default' => '' 'default' => ''
), ),
'heading' => array( 'heading' => array(
'title' => __( 'Email Heading', 'woocommerce' ), 'title' => __( 'Email Heading', WC_QD_TXT ),
'type' => 'text', 'type' => 'text',
'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->heading ), 'description' => sprintf( __( 'Defaults to <code>%s</code>', WC_QD_TXT ), $this->heading ),
'placeholder' => '', 'placeholder' => '',
'default' => '' 'default' => ''
), ),
'email_type' => array( 'email_type' => array(
'title' => __( 'Email type', 'woocommerce' ), 'title' => __( 'Email type', WC_QD_TXT ),
'type' => 'select', 'type' => 'select',
'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'description' => __( 'Choose which format of email to send.', WC_QD_TXT ),
'default' => 'html', 'default' => 'html',
'class' => 'email_type wc-enhanced-select', 'class' => 'email_type wc-enhanced-select',
'options' => $this->get_email_type_options() 'options' => $this->get_email_type_options()
......
...@@ -29,7 +29,7 @@ class WC_QD_Processing_donation extends WC_Email { ...@@ -29,7 +29,7 @@ class WC_QD_Processing_donation extends WC_Email {
$this->description = __( 'This is an order notification sent to customers containing their donation details after payment.', WC_QD_TXT); $this->description = __( 'This is an order notification sent to customers containing their donation details after payment.', WC_QD_TXT);
$this->heading = __( 'Reg : Your {site_title} donation receipt from {order_date}', WC_QD_TXT); $this->heading = __( 'Reg : Your {site_title} donation receipt from {order_date}', WC_QD_TXT);
$this->subject = __( 'Thanks for donation', 'woocommerce' ); $this->subject = __( 'Thanks for donation', WC_QD_TXT );
$this->template_html = 'emails/donation-processing.php'; $this->template_html = 'emails/donation-processing.php';
$this->template_plain = 'emails/plain/donation-processing.php'; $this->template_plain = 'emails/plain/donation-processing.php';
......
...@@ -63,10 +63,28 @@ if(! function_exists('wcqd_get_project_name')){ ...@@ -63,10 +63,28 @@ if(! function_exists('wcqd_get_project_name')){
} }
if(! function_exists('wcqd_delete_donation_entry')){ if(! function_exists('wcqd_delete_donation_entry')){
/**
* Delets An Entry From WP_WC_quick_donation
* @param [[Type]] $id [[Description]]
* @return [[Type]] [[Description]]
*/
function wcqd_delete_donation_entry($id){ function wcqd_delete_donation_entry($id){
return WC_QD()->db()->delete_donation_entry($id); return WC_QD()->db()->delete_donation_entry($id);
} }
} }
if(! function_exists('wcqd_get_option')){
/**
* gets value for the setting id
* @param id of settings
* @return String / Array
*/
function wcqd_get_option($id){
return WC_QD()->settings()->get_option($id);
}
}
?> ?>
\ No newline at end of file
...@@ -15,9 +15,9 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -15,9 +15,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<tr class="shipping"> <tr class="shipping">
<th><?php <th><?php
if ( $show_package_details ) { if ( $show_package_details ) {
printf( __( 'Shipping #%d', 'woocommerce' ), $index + 1 ); printf( __( 'Shipping #%d', WC_QD_TXT ), $index + 1 );
} else { } else {
_e( 'Shipping', 'woocommerce' ); _e( 'Shipping', WC_QD_TXT);
} }
?></th> ?></th>
<td> <td>
...@@ -54,15 +54,15 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -54,15 +54,15 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( is_cart() && get_option( 'woocommerce_enable_shipping_calc' ) === 'yes' ) : ?> <?php if ( is_cart() && get_option( 'woocommerce_enable_shipping_calc' ) === 'yes' ) : ?>
<p><?php _e( 'Please use the shipping calculator to see available shipping methods.', 'woocommerce' ); ?></p> <p><?php _e( 'Please use the shipping calculator to see available shipping methods.', WC_QD_TXT ); ?></p>
<?php elseif ( is_cart() ) : ?> <?php elseif ( is_cart() ) : ?>
<p><?php _e( 'Please continue to the checkout and enter your full address to see if there are any available shipping methods.', 'woocommerce' ); ?></p> <p><?php _e( 'Please continue to the checkout and enter your full address to see if there are any available shipping methods.', WC_QD_TXT ); ?></p>
<?php else : ?> <?php else : ?>
<p><?php _e( 'Please fill in your details to see available shipping methods.', 'woocommerce' ); ?></p> <p><?php _e( 'Please fill in your details to see available shipping methods.', WC_QD_TXT ); ?></p>
<?php endif; ?> <?php endif; ?>
...@@ -71,13 +71,13 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -71,13 +71,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( is_cart() ) : ?> <?php if ( is_cart() ) : ?>
<?php echo apply_filters( 'woocommerce_cart_no_shipping_available_html', <?php echo apply_filters( 'woocommerce_cart_no_shipping_available_html',
'<p>' . __( 'There are no shipping methods available. Please double check your address, or contact us if you need any help.', 'woocommerce' ) . '</p>' '<p>' . __( 'There are no shipping methods available. Please double check your address, or contact us if you need any help.', WC_QD_TXT ) . '</p>'
); ?> ); ?>
<?php else : ?> <?php else : ?>
<?php echo apply_filters( 'woocommerce_no_shipping_available_html', <?php echo apply_filters( 'woocommerce_no_shipping_available_html',
'<p>' . __( 'There are no shipping methods available. Please double check your address, or contact us if you need any help.', 'woocommerce' ) . '</p>' '<p>' . __( 'There are no shipping methods available. Please double check your address, or contact us if you need any help.', WC_QD_TXT ) . '</p>'
); ?> ); ?>
<?php endif; ?> <?php endif; ?>
...@@ -92,7 +92,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -92,7 +92,7 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
} }
echo '<p class="woocommerce-shipping-contents"><small>' . __( 'Shipping', 'woocommerce' ) . ': ' . implode( ', ', $product_names ) . '</small></p>'; echo '<p class="woocommerce-shipping-contents"><small>' . __( 'Shipping', WC_QD_TXT ) . ': ' . implode( ', ', $product_names ) . '</small></p>';
?> ?>
<?php endif; ?> <?php endif; ?>
......
...@@ -25,7 +25,7 @@ do_action( 'woocommerce_before_cart' ); ?> ...@@ -25,7 +25,7 @@ do_action( 'woocommerce_before_cart' ); ?>
<th class="product-remove" style="width:10%;">&nbsp;</th> <th class="product-remove" style="width:10%;">&nbsp;</th>
<th class="product-thumbnail" style="width:20%;">&nbsp;</th> <th class="product-thumbnail" style="width:20%;">&nbsp;</th>
<th class="product-name"><?php _e( 'Project', WC_QD_TXT ); ?></th> <th class="product-name"><?php _e( 'Project', WC_QD_TXT ); ?></th>
<th class="product-price"><?php _e( 'Amount', 'woocommerce' ); ?></th> <th class="product-price"><?php _e( 'Amount', WC_QD_TXT ); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -45,7 +45,7 @@ do_action( 'woocommerce_before_cart' ); ?> ...@@ -45,7 +45,7 @@ do_action( 'woocommerce_before_cart' ); ?>
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
'<a href="%s" class="remove" title="%s" data-product_id="%s" data-product_sku="%s">&times;</a>', '<a href="%s" class="remove" title="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
__( 'Remove this item', 'woocommerce' ), __( 'Remove this item', WC_QD_TXT ),
esc_attr( $product_id ), esc_attr( $product_id ),
esc_attr( $_product->get_sku() ) esc_attr( $_product->get_sku() )
), $cart_item_key ); ), $cart_item_key );
......
...@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf( echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
'<a href="%s" class="remove" title="%s" data-product_id="%s" data-product_sku="%s">&times;</a>', '<a href="%s" class="remove" title="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
__( 'Remove this item', 'woocommerce' ), __( 'Remove this item', WC_QD_TXT ),
esc_attr( $product_id ), esc_attr( $product_id ),
esc_attr( $_product->get_sku() ) esc_attr( $_product->get_sku() )
), $cart_item_key ); ), $cart_item_key );
...@@ -58,7 +58,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -58,7 +58,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php else : ?> <?php else : ?>
<li class="empty"><?php _e( 'No products in the cart.', 'woocommerce' ); ?></li> <li class="empty"><?php _e( 'No products in the cart.', WC_QD_TXT ); ?></li>
<?php endif; ?> <?php endif; ?>
...@@ -66,13 +66,13 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -66,13 +66,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( ! WC()->cart->is_empty() ) : ?> <?php if ( ! WC()->cart->is_empty() ) : ?>
<p class="total"><strong><?php _e( 'Subtotal', 'woocommerce' ); ?>:</strong> <?php echo WC()->cart->get_cart_subtotal(); ?></p> <p class="total"><strong><?php _e( 'Subtotal', WC_QD_TXT ); ?>:</strong> <?php echo WC()->cart->get_cart_subtotal(); ?></p>
<?php do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); ?> <?php do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); ?>
<p class="buttons"> <p class="buttons">
<a href="<?php echo WC()->cart->get_cart_url(); ?>" class="button wc-forward"><?php _e( 'View Cart', 'woocommerce' ); ?></a> <a href="<?php echo WC()->cart->get_cart_url(); ?>" class="button wc-forward"><?php _e( 'View Cart', WC_QD_TXT ); ?></a>
<a href="<?php echo WC()->cart->get_checkout_url(); ?>" class="button checkout wc-forward"><?php _e( 'Checkout', 'woocommerce' ); ?></a> <a href="<?php echo WC()->cart->get_checkout_url(); ?>" class="button checkout wc-forward"><?php _e( 'Checkout', WC_QD_TXT ); ?></a>
</p> </p>
<?php endif; ?> <?php endif; ?>
......
...@@ -15,8 +15,8 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -15,8 +15,8 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php wc_print_notices(); ?> <?php wc_print_notices(); ?>
<p><?php _e( 'There are some issues with the items in your cart (shown above). Please go back to the cart page and resolve these issues before checking out.', 'woocommerce' ) ?></p> <p><?php _e( 'There are some issues with the items in your cart (shown above). Please go back to the cart page and resolve these issues before checking out.', WC_QD_TXT ) ?></p>
<?php do_action( 'woocommerce_cart_has_errors' ); ?> <?php do_action( 'woocommerce_cart_has_errors' ); ?>
<p><a class="button wc-backward" href="<?php echo esc_url( wc_get_page_permalink( 'cart' ) ); ?>"><?php _e( 'Return To Cart', 'woocommerce' ) ?></a></p> <p><a class="button wc-backward" href="<?php echo esc_url( wc_get_page_permalink( 'cart' ) ); ?>"><?php _e( 'Return To Cart', WC_QD_TXT ) ?></a></p>
...@@ -16,11 +16,11 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -16,11 +16,11 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="woocommerce-billing-fields"> <div class="woocommerce-billing-fields">
<?php if ( WC()->cart->ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?> <?php if ( WC()->cart->ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
<h3><?php _e( 'Billing &amp; Shipping', 'woocommerce' ); ?></h3> <h3><?php _e( 'Billing &amp; Shipping', WC_QD_TXT ); ?></h3>
<?php else : ?> <?php else : ?>
<h3><?php _e( 'Donor Details', 'woocommerce' ); ?></h3> <h3><?php _e( 'Donor Details', WC_QD_TXT ); ?></h3>
<?php endif; ?> <?php endif; ?>
...@@ -39,7 +39,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -39,7 +39,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $checkout->enable_guest_checkout ) : ?> <?php if ( $checkout->enable_guest_checkout ) : ?>
<p class="form-row form-row-wide create-account"> <p class="form-row form-row-wide create-account">
<input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', 'woocommerce' ); ?></label> <input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', WC_QD_TXT ); ?></label>
</p> </p>
<?php endif; ?> <?php endif; ?>
...@@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="create-account"> <div class="create-account">
<p><?php _e( 'Create an account by entering the information below. If you are a returning customer please login at the top of the page.', 'woocommerce' ); ?></p> <p><?php _e( 'Create an account by entering the information below. If you are a returning customer please login at the top of the page.', WC_QD_TXT ); ?></p>
<?php foreach ( $checkout->checkout_fields['account'] as $key => $field ) : ?> <?php foreach ( $checkout->checkout_fields['account'] as $key => $field ) : ?>
......
...@@ -17,7 +17,7 @@ do_action( 'woocommerce_before_checkout_form', $checkout ); ...@@ -17,7 +17,7 @@ do_action( 'woocommerce_before_checkout_form', $checkout );
// If checkout registration is disabled and not logged in, the user cannot checkout // If checkout registration is disabled and not logged in, the user cannot checkout
if ( ! $checkout->enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) { if ( ! $checkout->enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) {
echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ); echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', WC_QD_TXT ) );
return; return;
} }
...@@ -36,7 +36,7 @@ $get_checkout_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->g ...@@ -36,7 +36,7 @@ $get_checkout_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->g
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?> <?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<h3 id="order_review_heading"><?php _e( 'Your Donation', 'woocommerce' ); ?></h3> <h3 id="order_review_heading"><?php _e( 'Your Donation', WC_QD_TXT ); ?></h3>
<?php endif; ?> <?php endif; ?>
......
...@@ -15,15 +15,15 @@ if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_lo ...@@ -15,15 +15,15 @@ if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_lo
return; return;
} }
$info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'Returning customer?', 'woocommerce' ) ); $info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'Returning customer?', WC_QD_TXT ) );
$info_message .= ' <a href="#" class="showlogin">' . __( 'Click here to login', 'woocommerce' ) . '</a>'; $info_message .= ' <a href="#" class="showlogin">' . __( 'Click here to login', WC_QD_TXT ) . '</a>';
wc_print_notice( $info_message, 'notice' ); wc_print_notice( $info_message, 'notice' );
?> ?>
<?php <?php
woocommerce_login_form( woocommerce_login_form(
array( array(
'message' => __( 'If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing &amp; Shipping section.', 'woocommerce' ), 'message' => __( 'If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing &amp; Shipping section.', WC_QD_TXT ),
'redirect' => wc_get_page_permalink( 'checkout' ), 'redirect' => wc_get_page_permalink( 'checkout' ),
'hidden' => true 'hidden' => true
) )
......
...@@ -17,9 +17,9 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -17,9 +17,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<table class="shop_table"> <table class="shop_table">
<thead> <thead>
<tr> <tr>
<th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th> <th class="product-name"><?php _e( 'Product', WC_QD_TXT ); ?></th>
<th class="product-quantity"><?php _e( 'Qty', 'woocommerce' ); ?></th> <th class="product-quantity"><?php _e( 'Qty', WC_QD_TXT ); ?></th>
<th class="product-total"><?php _e( 'Totals', 'woocommerce' ); ?></th> <th class="product-total"><?php _e( 'Totals', WC_QD_TXT ); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -52,7 +52,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -52,7 +52,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div id="payment"> <div id="payment">
<?php if ( $order->needs_payment() ) : ?> <?php if ( $order->needs_payment() ) : ?>
<h3><?php _e( 'Payment', 'woocommerce' ); ?></h3> <h3><?php _e( 'Payment', WC_QD_TXT ); ?></h3>
<ul class="payment_methods methods"> <ul class="payment_methods methods">
<?php <?php
if ( $available_gateways = WC()->payment_gateways->get_available_payment_gateways() ) { if ( $available_gateways = WC()->payment_gateways->get_available_payment_gateways() ) {
...@@ -77,7 +77,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -77,7 +77,7 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
} else { } else {
echo '<p>' . __( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) . '</p>'; echo '<p>' . __( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', WC_QD_TXT ) . '</p>';
} }
?> ?>
...@@ -87,7 +87,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -87,7 +87,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="form-row"> <div class="form-row">
<?php wp_nonce_field( 'woocommerce-pay' ); ?> <?php wp_nonce_field( 'woocommerce-pay' ); ?>
<?php <?php
$pay_order_button_text = apply_filters( 'woocommerce_pay_order_button_text', __( 'Pay for order', 'woocommerce' ) ); $pay_order_button_text = apply_filters( 'woocommerce_pay_order_button_text', __( 'Pay for order', WC_QD_TXT ) );
echo apply_filters( 'woocommerce_pay_order_button_html', '<input type="submit" class="button alt" id="place_order" value="' . esc_attr( $pay_order_button_text ) . '" data-value="' . esc_attr( $pay_order_button_text ) . '" />' ); echo apply_filters( 'woocommerce_pay_order_button_html', '<input type="submit" class="button alt" id="place_order" value="' . esc_attr( $pay_order_button_text ) . '" data-value="' . esc_attr( $pay_order_button_text ) . '" />' );
?> ?>
......
...@@ -29,7 +29,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -29,7 +29,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?> ?>
<h3 id="ship-to-different-address"> <h3 id="ship-to-different-address">
<label for="ship-to-different-address-checkbox" class="checkbox"><?php _e( 'Ship to a different address?', 'woocommerce' ); ?></label> <label for="ship-to-different-address-checkbox" class="checkbox"><?php _e( 'Ship to a different address?', WC_QD_TXT ); ?></label>
<input id="ship-to-different-address-checkbox" class="input-checkbox" <?php checked( $ship_to_different_address, 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <input id="ship-to-different-address-checkbox" class="input-checkbox" <?php checked( $ship_to_different_address, 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" />
</h3> </h3>
...@@ -55,7 +55,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -55,7 +55,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( ! WC()->cart->needs_shipping() || WC()->cart->ship_to_billing_address_only() ) : ?> <?php if ( ! WC()->cart->needs_shipping() || WC()->cart->ship_to_billing_address_only() ) : ?>
<h3><?php _e( 'Additional Information', 'woocommerce' ); ?></h3> <h3><?php _e( 'Additional Information', WC_QD_TXT ); ?></h3>
<?php endif; ?> <?php endif; ?>
......
...@@ -27,9 +27,9 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -27,9 +27,9 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
} else { } else {
if ( ! WC()->customer->get_country() ) { if ( ! WC()->customer->get_country() ) {
$no_gateways_message = __( 'Please fill in your details above to see available payment methods.', 'woocommerce' ); $no_gateways_message = __( 'Please fill in your details above to see available payment methods.', WC_QD_TXT );
} else { } else {
$no_gateways_message = __( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ); $no_gateways_message = __( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', WC_QD_TXT );
} }
echo '<li>' . apply_filters( 'woocommerce_no_available_payment_methods_message', $no_gateways_message ) . '</li>'; echo '<li>' . apply_filters( 'woocommerce_no_available_payment_methods_message', $no_gateways_message ) . '</li>';
...@@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="form-row place-order"> <div class="form-row place-order">
<noscript><?php _e( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'woocommerce' ); ?><br/><input type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'woocommerce' ); ?>" /></noscript> <noscript><?php _e( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', WC_QD_TXT ); ?><br/><input type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', WC_QD_TXT ); ?>" /></noscript>
<?php wp_nonce_field( 'woocommerce-process_checkout' ); ?> <?php wp_nonce_field( 'woocommerce-process_checkout' ); ?>
...@@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) : ?> <?php if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) : ?>
<p class="form-row terms"> <p class="form-row terms">
<label for="terms" class="checkbox"><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?></label> <label for="terms" class="checkbox"><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', WC_QD_TXT ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?></label>
<input type="checkbox" class="input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" /> <input type="checkbox" class="input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" />
</p> </p>
<?php endif; ?> <?php endif; ?>
......
...@@ -14,8 +14,8 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -14,8 +14,8 @@ if ( ! defined( 'ABSPATH' ) ) {
<table class="shop_table woocommerce-checkout-review-order-table"> <table class="shop_table woocommerce-checkout-review-order-table">
<thead> <thead>
<tr> <tr>
<th class="product-name"><?php _e( 'Donation for', 'woocommerce' ); ?></th> <th class="product-name"><?php _e( 'Donation for', WC_QD_TXT ); ?></th>
<th class="product-total"><?php _e( 'Amount', 'woocommerce' ); ?></th> <th class="product-total"><?php _e( 'Amount', WC_QD_TXT ); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -14,19 +14,19 @@ if ( $order ) : ?> ...@@ -14,19 +14,19 @@ if ( $order ) : ?>
<?php if ( $order->has_status( 'failed' ) ) : ?> <?php if ( $order->has_status( 'failed' ) ) : ?>
<p><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction.', 'woocommerce' ); ?></p> <p><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction.', WC_QD_TXT ); ?></p>
<p><?php <p><?php
if ( is_user_logged_in() ) if ( is_user_logged_in() )
_e( 'Please attempt your purchase again or go to your account page.', 'woocommerce' ); _e( 'Please attempt your purchase again or go to your account page.', WC_QD_TXT );
else else
_e( 'Please attempt your purchase again.', 'woocommerce' ); _e( 'Please attempt your purchase again.', WC_QD_TXT );
?></p> ?></p>
<p> <p>
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a> <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', WC_QD_TXT ) ?></a>
<?php if ( is_user_logged_in() ) : ?> <?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My Account', 'woocommerce' ); ?></a> <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My Account', WC_QD_TXT ); ?></a>
<?php endif; ?> <?php endif; ?>
</p> </p>
...@@ -36,17 +36,17 @@ if ( $order ) : ?> ...@@ -36,17 +36,17 @@ if ( $order ) : ?>
<ul class="order_details"> <ul class="order_details">
<li class="order"> <li class="order">
<?php _e( 'Reference Number :', 'woocommerce' ); ?> <?php _e( 'Reference Number :', WC_QD_TXT ); ?>
<strong><?php echo $order->get_order_number(); ?></strong> <strong><?php echo $order->get_order_number(); ?></strong>
</li> </li>
<li class="date"> <li class="date">
<?php _e( 'Date:', 'woocommerce' ); ?> <?php _e( 'Date:', WC_QD_TXT ); ?>
<strong><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></strong> <strong><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></strong>
</li> </li>
<?php if ( $order->payment_method_title ) : ?> <?php if ( $order->payment_method_title ) : ?>
<li class="method"> <li class="method">
<?php _e( 'Payment Method:', 'woocommerce' ); ?> <?php _e( 'Payment Method:', WC_QD_TXT ); ?>
<strong><?php echo $order->payment_method_title; ?></strong> <strong><?php echo $order->payment_method_title; ?></strong>
</li> </li>
<?php endif; ?> <?php endif; ?>
...@@ -60,6 +60,6 @@ if ( $order ) : ?> ...@@ -60,6 +60,6 @@ if ( $order ) : ?>
<?php else : ?> <?php else : ?>
<p><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), null ); ?></p> <p><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', WC_QD_TXT ), null ); ?></p>
<?php endif; ?> <?php endif; ?>
...@@ -17,19 +17,19 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -17,19 +17,19 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $order->has_status( 'pending' ) ) : ?> <?php if ( $order->has_status( 'pending' ) ) : ?>
<p><?php printf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name', 'display' ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . __( 'pay', 'woocommerce' ) . '</a>' ); ?></p> <p><?php printf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', WC_QD_TXT ), get_bloginfo( 'name', 'display' ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . __( 'pay', WC_QD_TXT ) . '</a>' ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?> <?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php printf( __( 'Donation ID #%s', 'woocommerce' ), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2> <h2><?php printf( __( 'Donation ID #%s', WC_QD_TXT ), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1"> <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
<thead> <thead>
<tr> <tr>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Project', WC_QD_TXT ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Project', WC_QD_TXT ); ?></th>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', WC_QD_TXT ); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -15,18 +15,18 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -15,18 +15,18 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_donation_email_header', $email_heading ); ?> <?php do_action( 'woocommerce_donation_email_header', $email_heading ); ?>
<p><?php printf( __( "Hi there. Your recent order on %s has been completed. Your order details are shown below for your reference:", 'woocommerce' ), get_option( 'blogname' ) ); ?></p> <p><?php printf( __( "Hi there. Your recent order on %s has been completed. Your order details are shown below for your reference:", WC_QD_TXT ), get_option( 'blogname' ) ); ?></p>
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?> <?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2> <h2><?php printf( __( 'Order #%s', WC_QD_TXT ), $order->get_order_number() ); ?></h2>
<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1"> <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
<thead> <thead>
<tr> <tr>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Product', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Product', WC_QD_TXT ); ?></th>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Quantity', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Quantity', WC_QD_TXT ); ?></th>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', WC_QD_TXT ); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<td class="td" style="text-align:left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" valign="top" width="50%"> <td class="td" style="text-align:left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" valign="top" width="50%">
<h3><?php _e( 'Billing address', 'woocommerce' ); ?></h3> <h3><?php _e( 'Billing address', WC_QD_TXT ); ?></h3>
<p class="text"><?php echo $order->get_formatted_billing_address(); ?></p> <p class="text"><?php echo $order->get_formatted_billing_address(); ?></p>
...@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<td class="td" style="text-align:left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" valign="top" width="50%"> <td class="td" style="text-align:left; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" valign="top" width="50%">
<h3><?php _e( 'Shipping address', 'woocommerce' ); ?></h3> <h3><?php _e( 'Shipping address', WC_QD_TXT ); ?></h3>
<p class="text"><?php echo $shipping; ?></p> <p class="text"><?php echo $shipping; ?></p>
......
...@@ -26,7 +26,7 @@ foreach ( $items as $item_id => $item ) : ...@@ -26,7 +26,7 @@ foreach ( $items as $item_id => $item ) :
// Show title/image etc // Show title/image etc
if ( $show_image ) { if ( $show_image ) {
echo apply_filters( 'woocommerce_order_item_thumbnail', '<div style="margin-bottom: 5px"><img src="' . ( $_product->get_image_id() ? current( wp_get_attachment_image_src( $_product->get_image_id(), 'thumbnail') ) : wc_placeholder_img_src() ) .'" alt="' . esc_attr__( 'Product Image', 'woocommerce' ) . '" height="' . esc_attr( $image_size[1] ) . '" width="' . esc_attr( $image_size[0] ) . '" style="vertical-align:middle; margin-right: 10px;" /></div>', $item ); echo apply_filters( 'woocommerce_order_item_thumbnail', '<div style="margin-bottom: 5px"><img src="' . ( $_product->get_image_id() ? current( wp_get_attachment_image_src( $_product->get_image_id(), 'thumbnail') ) : wc_placeholder_img_src() ) .'" alt="' . esc_attr__( 'Product Image', WC_QD_TXT ) . '" height="' . esc_attr( $image_size[1] ) . '" width="' . esc_attr( $image_size[0] ) . '" style="vertical-align:middle; margin-right: 10px;" /></div>', $item );
} }
// Product name // Product name
......
...@@ -19,13 +19,13 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -19,13 +19,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?> <?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php printf( __( 'Donation #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2> <h2><?php printf( __( 'Donation #%s', WC_QD_TXT ), $order->get_order_number() ); ?></h2>
<table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1"> <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1">
<thead> <thead>
<tr> <tr>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Project', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Project', WC_QD_TXT ); ?></th>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', 'woocommerce' ); ?></th> <th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', WC_QD_TXT ); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -14,14 +14,14 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -14,14 +14,14 @@ if ( ! defined( 'ABSPATH' ) ) {
echo "= " . $email_heading . " =\n\n"; echo "= " . $email_heading . " =\n\n";
if ( $order->has_status( 'pending' ) ) if ( $order->has_status( 'pending' ) )
echo sprintf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name', 'display' ), $order->get_checkout_payment_url() ) . "\n\n"; echo sprintf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', WC_QD_TXT ), get_bloginfo( 'name', 'display' ), $order->get_checkout_payment_url() ) . "\n\n";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text );
echo strtoupper( sprintf( __( 'Order number: %s', 'woocommerce' ), $order->get_order_number() ) ) . "\n"; echo strtoupper( sprintf( __( 'Order number: %s', WC_QD_TXT ), $order->get_order_number() ) ) . "\n";
echo date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n"; echo date_i18n( __( 'jS F Y', WC_QD_TXT ), strtotime( $order->order_date ) ) . "\n";
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text );
......
...@@ -13,14 +13,14 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -13,14 +13,14 @@ if ( ! defined( 'ABSPATH' ) ) {
echo "= " . $email_heading . " =\n\n"; echo "= " . $email_heading . " =\n\n";
echo sprintf( __( "Hi there. Your recent order on %s has been completed. Your order details are shown below for your reference:", 'woocommerce' ), get_option( 'blogname' ) ) . "\n\n"; echo sprintf( __( "Hi there. Your recent order on %s has been completed. Your order details are shown below for your reference:", WC_QD_TXT ), get_option( 'blogname' ) ) . "\n\n";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text );
echo strtoupper( sprintf( __( 'Order number: %s', 'woocommerce' ), $order->get_order_number() ) ) . "\n"; echo strtoupper( sprintf( __( 'Order number: %s', WC_QD_TXT ), $order->get_order_number() ) ) . "\n";
echo date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n"; echo date_i18n( __( 'jS F Y', WC_QD_TXT ), strtotime( $order->order_date ) ) . "\n";
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text );
......
...@@ -11,10 +11,10 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -11,10 +11,10 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; exit;
} }
echo "\n" . strtoupper( __( 'Billing address', 'woocommerce' ) ) . "\n\n"; echo "\n" . strtoupper( __( 'Billing address', WC_QD_TXT ) ) . "\n\n";
echo preg_replace( '#<br\s*/?>#i', "\n", $order->get_formatted_billing_address() ) . "\n"; echo preg_replace( '#<br\s*/?>#i', "\n", $order->get_formatted_billing_address() ) . "\n";
if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && ( $shipping = $order->get_formatted_shipping_address() ) ) { if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && ( $shipping = $order->get_formatted_shipping_address() ) ) {
echo "\n" . strtoupper( __( 'Shipping address', 'woocommerce' ) ) . "\n\n"; echo "\n" . strtoupper( __( 'Shipping address', WC_QD_TXT ) ) . "\n\n";
echo preg_replace( '#<br\s*/?>#i', "\n\t", $shipping ) . "\n"; echo preg_replace( '#<br\s*/?>#i', "\n\t", $shipping ) . "\n";
} }
...@@ -32,10 +32,10 @@ foreach ( $items as $item_id => $item ) : ...@@ -32,10 +32,10 @@ foreach ( $items as $item_id => $item ) :
echo ( $item_meta_content = $item_meta->display( true, true ) ) ? "\n" . $item_meta_content : ''; echo ( $item_meta_content = $item_meta->display( true, true ) ) ? "\n" . $item_meta_content : '';
// Quantity // Quantity
echo "\n" . sprintf( __( 'Quantity: %s', 'woocommerce' ), apply_filters( 'woocommerce_email_order_item_quantity', $item['qty'], $item ) ); echo "\n" . sprintf( __( 'Quantity: %s', WC_QD_TXT ), apply_filters( 'woocommerce_email_order_item_quantity', $item['qty'], $item ) );
// Cost // Cost
echo "\n" . sprintf( __( 'Cost: %s', 'woocommerce' ), $order->get_formatted_line_subtotal( $item ) ); echo "\n" . sprintf( __( 'Cost: %s', WC_QD_TXT ), $order->get_formatted_line_subtotal( $item ) );
// Download URLs // Download URLs
if ( $show_download_links && $_product->exists() && $_product->is_downloadable() ) { if ( $show_download_links && $_product->exists() && $_product->is_downloadable() ) {
...@@ -46,9 +46,9 @@ foreach ( $items as $item_id => $item ) : ...@@ -46,9 +46,9 @@ foreach ( $items as $item_id => $item ) :
$i++; $i++;
if ( count( $download_files ) > 1 ) { if ( count( $download_files ) > 1 ) {
$prefix = sprintf( __( 'Download %d', 'woocommerce' ), $i ); $prefix = sprintf( __( 'Download %d', WC_QD_TXT ), $i );
} elseif ( $i == 1 ) { } elseif ( $i == 1 ) {
$prefix = __( 'Download', 'woocommerce' ); $prefix = __( 'Download', WC_QD_TXT );
} }
echo "\n" . $prefix . '(' . esc_html( $file['name'] ) . '): ' . esc_url( $file['download_url'] ); echo "\n" . $prefix . '(' . esc_html( $file['name'] ) . '): ' . esc_url( $file['download_url'] );
......
...@@ -13,14 +13,14 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -13,14 +13,14 @@ if ( ! defined( 'ABSPATH' ) ) {
echo "= " . $email_heading . " =\n\n"; echo "= " . $email_heading . " =\n\n";
echo __( "Your order has been received and is now being processed. Your order details are shown below for your reference:", 'woocommerce' ) . "\n\n"; echo __( "Your order has been received and is now being processed. Your order details are shown below for your reference:", WC_QD_TXT ) . "\n\n";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text );
echo strtoupper( sprintf( __( 'Order number: %s', 'woocommerce' ), $order->get_order_number() ) ) . "\n"; echo strtoupper( sprintf( __( 'Order number: %s', WC_QD_TXT ), $order->get_order_number() ) ) . "\n";
echo date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n"; echo date_i18n( __( 'jS F Y', WC_QD_TXT ), strtotime( $order->order_date ) ) . "\n";
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text ); do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text );
......
...@@ -4,19 +4,24 @@ ...@@ -4,19 +4,24 @@
* *
* @author Varun Sridharan * @author Varun Sridharan
* @package WooCommerce Quick Donation/Templates/fields * @package WooCommerce Quick Donation/Templates/fields
* @version 0.1 * @version 0.2
*/ */
foreach($project_list as $id => $val){ foreach($project_list as $id => $val){
if(is_array($val)){ if(is_array($val)){
$field_output .= ' <fieldset> <legend>'.$id.'</legend>'; $field_output .= ' <fieldset> <legend>'.$id.'</legend>';
foreach($val as $k =>$v){ foreach($val as $k =>$v){
$field_output .= $v.' : <input type="radio" name="'.$name.'" value="'.$k.'" >'; $attr = '';
if($pre_selected == $k){$attr = 'checked';}
$field_output .= $v.' : <input type="radio" name="'.$name.'" value="'.$k.'" '.$attr.'>';
} }
$field_output .= '</fieldset>'; $field_output .= '</fieldset>';
} else { } else {
$field_output .= $val.' : <input type="radio" name="'.$name.'" value="'.$id.'" >'; $attr = '';
if($pre_selected == $id){$attr = 'checked';}
$field_output .= $val.' : <input type="radio" name="'.$name.'" value="'.$id.'" '.$attr.'>';
} }
} }
......
...@@ -4,22 +4,26 @@ ...@@ -4,22 +4,26 @@
* *
* @author Varun Sridharan * @author Varun Sridharan
* @package WooCommerce Quick Donation/Templates/fields * @package WooCommerce Quick Donation/Templates/fields
* @version 0.1 * @version 0.2
*/ */
?> ?>
<select id="<?php echo $id; ?>" name="<?php echo $name; ?>" class="<?php echo $class.' '.$attributes;?>"> <select id="<?php echo $id; ?>" name="<?php echo $name; ?>" class="<?php echo $class.' '.$attributes;?>">
<?php <?php
foreach($project_list as $id => $val){ foreach($project_list as $id => $val){
$attr = '';
if(is_array($val)){ if(is_array($val)){
$field_output .= ' <optgroup label="'.$id.'">'; $field_output .= ' <optgroup label="'.$id.'">';
foreach($val as $k =>$v){ foreach($val as $k =>$v){
$field_output .= '<option value="'.$k.'">'.$v.'</option>'; $attr = '';
if($pre_selected == $k){$attr = 'selected';}
$field_output .= '<option value="'.$k.'" '.$attr.'>'.$v.'</option>';
} }
$field_output .= ' </optgroup>'; $field_output .= ' </optgroup>';
} else { } else {
$field_output .= '<option value="'.$id.'">'.$val.'</option>'; if($pre_selected == $k){$attr = 'selected';}
$field_output .= '<option value="'.$id.'" '.$attr.'>'.$val.'</option>';
} }
} }
......
...@@ -45,26 +45,26 @@ if ( $customer_orders ) : ?> ...@@ -45,26 +45,26 @@ if ( $customer_orders ) : ?>
$item_count = $order->get_item_count(); $item_count = $order->get_item_count();
?><tr class="order"> ?><tr class="order">
<td class="order-number" data-title="<?php esc_attr_e( 'Order Number', 'woocommerce' ); ?>"> <td class="order-number" data-title="<?php esc_attr_e( 'Order Number', WC_QD_TXT ); ?>">
<a href="<?php echo esc_url( $order->get_view_order_url() ); ?>"> <a href="<?php echo esc_url( $order->get_view_order_url() ); ?>">
<?php echo _x( '#', 'hash before order number', 'woocommerce' ) . $order->get_order_number(); ?> <?php echo _x( '#', 'hash before order number', WC_QD_TXT ) . $order->get_order_number(); ?>
</a> </a>
</td> </td>
<td class="order-number" data-title="<?php esc_attr_e( 'Project', 'woocommerce' ); ?>"> <td class="order-number" data-title="<?php esc_attr_e( 'Project', WC_QD_TXT ); ?>">
<?php $project_id = WC_QD()->db()->get_project_id($order->id);?> <?php $project_id = WC_QD()->db()->get_project_id($order->id);?>
<a href="<?php echo get_permalink($project_id); ?>"> <a href="<?php echo get_permalink($project_id); ?>">
<?php echo get_the_title($project_id); ?> <?php echo get_the_title($project_id); ?>
</a> </a>
</td> </td>
<td class="order-date" data-title="<?php esc_attr_e( 'Date', 'woocommerce' ); ?>"> <td class="order-date" data-title="<?php esc_attr_e( 'Date', WC_QD_TXT ); ?>">
<time datetime="<?php echo date( 'Y-m-d', strtotime( $order->order_date ) ); ?>" title="<?php echo esc_attr( strtotime( $order->order_date ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></time> <time datetime="<?php echo date( 'Y-m-d', strtotime( $order->order_date ) ); ?>" title="<?php echo esc_attr( strtotime( $order->order_date ) ); ?>"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></time>
</td> </td>
<td class="order-status" data-title="<?php esc_attr_e( 'Status', 'woocommerce' ); ?>" style="text-align:left; white-space:nowrap;"> <td class="order-status" data-title="<?php esc_attr_e( 'Status', WC_QD_TXT ); ?>" style="text-align:left; white-space:nowrap;">
<?php echo wc_get_order_status_name( $order->get_status() ); ?> <?php echo wc_get_order_status_name( $order->get_status() ); ?>
</td> </td>
<td class="order-total" data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"> <td class="order-total" data-title="<?php esc_attr_e( 'Total', WC_QD_TXT ); ?>">
<?php echo sprintf( _n( '%s for %s item', '%s for %s items', $item_count, 'woocommerce' ), $order->get_formatted_order_total(), $item_count ); ?> <?php echo sprintf( _n( '%s for %s item', '%s for %s items', $item_count, WC_QD_TXT ), $order->get_formatted_order_total(), $item_count ); ?>
</td> </td>
<td class="order-actions"> <td class="order-actions">
<?php <?php
...@@ -73,20 +73,20 @@ if ( $customer_orders ) : ?> ...@@ -73,20 +73,20 @@ if ( $customer_orders ) : ?>
if ( $order->needs_payment() ) { if ( $order->needs_payment() ) {
$actions['pay'] = array( $actions['pay'] = array(
'url' => $order->get_checkout_payment_url(), 'url' => $order->get_checkout_payment_url(),
'name' => __( 'Pay', 'woocommerce' ) 'name' => __( 'Pay', WC_QD_TXT )
); );
} }
if ( in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_cancel', array( 'pending', 'failed' ), $order ) ) ) { if ( in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_cancel', array( 'pending', 'failed' ), $order ) ) ) {
$actions['cancel'] = array( $actions['cancel'] = array(
'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ), 'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ),
'name' => __( 'Cancel', 'woocommerce' ) 'name' => __( 'Cancel', WC_QD_TXT )
); );
} }
$actions['view'] = array( $actions['view'] = array(
'url' => $order->get_view_order_url(), 'url' => $order->get_view_order_url(),
'name' => __( 'View', 'woocommerce' ) 'name' => __( 'View', WC_QD_TXT )
); );
$actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order ); $actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order );
......
...@@ -19,13 +19,13 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -19,13 +19,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $notes = $order->get_customer_order_notes() ) : <?php if ( $notes = $order->get_customer_order_notes() ) :
?> ?>
<h2><?php _e( 'Order Updates', 'woocommerce' ); ?></h2> <h2><?php _e( 'Order Updates', WC_QD_TXT ); ?></h2>
<ol class="commentlist notes"> <ol class="commentlist notes">
<?php foreach ( $notes as $note ) : ?> <?php foreach ( $notes as $note ) : ?>
<li class="comment note"> <li class="comment note">
<div class="comment_container"> <div class="comment_container">
<div class="comment-text"> <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> <p class="meta"><?php echo date_i18n( __( 'l jS \o\f F Y, h:ia', WC_QD_TXT ), strtotime( $note->comment_date ) ); ?></p>
<div class="description"> <div class="description">
<?php echo wpautop( wptexturize( $note->comment_content ) ); ?> <?php echo wpautop( wptexturize( $note->comment_content ) ); ?>
</div> </div>
......
...@@ -17,13 +17,13 @@ global $post; ...@@ -17,13 +17,13 @@ global $post;
<form action="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" method="post" class="track_order"> <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><?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.', WC_QD_TXT ); ?></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-first"><label for="orderid"><?php _e( 'Order ID', WC_QD_TXT ); ?></label> <input class="input-text" type="text" name="orderid" id="orderid" placeholder="<?php esc_attr_e( 'Found in your order confirmation email.', WC_QD_TXT ); ?>" /></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> <p class="form-row form-row-last"><label for="order_email"><?php _e( 'Billing Email', WC_QD_TXT ); ?></label> <input class="input-text" type="text" name="order_email" id="order_email" placeholder="<?php esc_attr_e( 'Email you used during checkout.', WC_QD_TXT ); ?>" /></p>
<div class="clear"></div> <div class="clear"></div>
<p class="form-row"><input type="submit" class="button" name="track" value="<?php esc_attr_e( 'Track', 'woocommerce' ); ?>" /></p> <p class="form-row"><input type="submit" class="button" name="track" value="<?php esc_attr_e( 'Track', WC_QD_TXT ); ?>" /></p>
<?php wp_nonce_field( 'woocommerce-order_tracking' ); ?> <?php wp_nonce_field( 'woocommerce-order_tracking' ); ?>
</form> </form>
\ No newline at end of file
...@@ -13,5 +13,5 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -13,5 +13,5 @@ if ( ! defined( 'ABSPATH' ) ) {
?> ?>
<p class="order-again"> <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> <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', WC_QD_TXT ); ?></a>
</p> </p>
...@@ -13,13 +13,13 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -13,13 +13,13 @@ if ( ! defined( 'ABSPATH' ) ) {
?> ?>
<div class="col1-set addresses"> <div class="col1-set addresses">
<div class="col-1"> <div class="col-1">
<header class="title"> <h3><?php _e( 'Billing Address', 'woocommerce' ); ?></h3> </header> <header class="title"> <h3><?php _e( 'Billing Address', WC_QD_TXT ); ?></h3> </header>
<address style="margin-bottom: 10px;"> <address style="margin-bottom: 10px;">
<?php echo ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', 'woocommerce' ); ?> <?php echo ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', WC_QD_TXT ); ?>
</address> </address>
<?php if ( $order->customer_note ) : ?> <?php if ( $order->customer_note ) : ?>
<p style="margin-bottom: 10px;"><strong><?php _e( 'Note:', 'woocommerce' ); ?></strong> <?php echo wptexturize( $order->customer_note ); ?></p> <p style="margin-bottom: 10px;"><strong><?php _e( 'Note:', WC_QD_TXT ); ?></strong> <?php echo wptexturize( $order->customer_note ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ( $order->billing_email ) : ?> <?php if ( $order->billing_email ) : ?>
<p style="margin-bottom: 10px;"><strong><?php _e( 'Email:', WC_QD_TXT ); ?></strong> <?php echo esc_html( $order->billing_email ); ?></p> <p style="margin-bottom: 10px;"><strong><?php _e( 'Email:', WC_QD_TXT ); ?></strong> <?php echo esc_html( $order->billing_email ); ?></p>
......
...@@ -11,9 +11,9 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -11,9 +11,9 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly 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() ) ); $order_status_text = sprintf( __( 'Order #%s which was made %s has the status &ldquo;%s&rdquo;', WC_QD_TXT ), $order->get_order_number(), human_time_diff( strtotime( $order->order_date ), current_time( 'timestamp' ) ) . ' ' . __( 'ago', WC_QD_TXT ), 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' ); if ( $order->has_status( 'completed' ) ) $order_status_text .= ' ' . __( 'and was completed', WC_QD_TXT ) . ' ' . human_time_diff( strtotime( $order->completed_date ), current_time( 'timestamp' ) ) . __( ' ago', WC_QD_TXT );
$order_status_text .= '.'; $order_status_text .= '.';
...@@ -22,13 +22,13 @@ echo wpautop( esc_attr( apply_filters( 'woocommerce_order_tracking_status', $ord ...@@ -22,13 +22,13 @@ echo wpautop( esc_attr( apply_filters( 'woocommerce_order_tracking_status', $ord
$notes = $order->get_customer_order_notes(); $notes = $order->get_customer_order_notes();
if ( $notes ) : ?> if ( $notes ) : ?>
<h2><?php _e( 'Order Updates', 'woocommerce' ); ?></h2> <h2><?php _e( 'Order Updates', WC_QD_TXT ); ?></h2>
<ol class="commentlist notes"> <ol class="commentlist notes">
<?php foreach ( $notes as $note ) : ?> <?php foreach ( $notes as $note ) : ?>
<li class="comment note"> <li class="comment note">
<div class="comment_container"> <div class="comment_container">
<div class="comment-text"> <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> <p class="meta"><?php echo date_i18n( __( 'l jS \o\f F Y, h:ia', WC_QD_TXT ), strtotime( $note->comment_date ) ); ?></p>
<div class="description"> <div class="description">
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?> <?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
</div> </div>
......
...@@ -248,6 +248,7 @@ class WooCommerce_Quick_Donation { ...@@ -248,6 +248,7 @@ class WooCommerce_Quick_Donation {
$this->define('WC_QD_TB',$wpdb->prefix . 'wc_quick_donation'); $this->define('WC_QD_TB',$wpdb->prefix . 'wc_quick_donation');
$this->define('WC_QD_DB','wc_qd_'); $this->define('WC_QD_DB','wc_qd_');
$this->define('WC_QD_DB_SETTINGS','wc_qd');
$this->define('WC_QD_PT','wcqd_project'); $this->define('WC_QD_PT','wcqd_project');
$this->define('WC_QD_CAT','wcqd_category'); $this->define('WC_QD_CAT','wcqd_category');
$this->define('WC_QD_TAG','wcqd_tags'); $this->define('WC_QD_TAG','wcqd_tags');
......
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