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
......@@ -38,107 +38,107 @@ class WooCommerce_Quick_Donation_Admin_Help {
$video_map = array(
'wc-settings' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'title' => __( 'General Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'
),
'wc-settings-general' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'title' => __( 'General Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'
),
'wc-settings-products' => array(
'title' => __( 'Product Settings', 'woocommerce' ),
'title' => __( 'Product Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true'
),
'wc-settings-tax' => array(
'title' => __( 'Tax Settings', 'woocommerce' ),
'title' => __( 'Tax Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true'
),
'wc-settings-checkout' => array(
'title' => __( 'Checkout Settings', 'woocommerce' ),
'title' => __( 'Checkout Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true'
),
'wc-settings-shipping' => array(
'title' => __( 'Shipping Settings', 'woocommerce' ),
'title' => __( 'Shipping Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true'
),
'wc-settings-account' => array(
'title' => __( 'Account Settings', 'woocommerce' ),
'title' => __( 'Account Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true'
),
'wc-settings-email' => array(
'title' => __( 'Email Settings', 'woocommerce' ),
'title' => __( 'Email Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true'
),
'wc-settings-api' => array(
'title' => __( 'Webhook Settings', 'woocommerce' ),
'title' => __( 'Webhook Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true'
),
'wc-settings-checkout-wc_gateway_paypal' => array(
'title' => __( 'PayPal Standard', 'woocommerce' ),
'title' => __( 'PayPal Standard', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true'
),
'wc-settings-checkout-wc_gateway_simplify_commerce' => array(
'title' => __( 'Simplify Commerce', 'woocommerce' ),
'title' => __( 'Simplify Commerce', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true'
),
'wc-settings-shipping' => array(
'title' => __( 'Shipping Settings', 'woocommerce' ),
'title' => __( 'Shipping Settings', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true'
),
'wc-settings-shipping-wc_shipping_free_shipping' => array(
'title' => __( 'Free Shipping', 'woocommerce' ),
'title' => __( 'Free Shipping', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/po191fmvy9?videoFoam=true'
),
'wc-settings-shipping-wc_shipping_local_delivery' => array(
'title' => __( 'Local Delivery', 'woocommerce' ),
'title' => __( 'Local Delivery', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/5qjepx9ozj?videoFoam=true'
),
'wc-settings-shipping-wc_shipping_local_pickup' => array(
'title' => __( 'Local Pickup', 'woocommerce' ),
'title' => __( 'Local Pickup', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/pe95ph0apb?videoFoam=true'
),
'edit-product_cat' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce' ),
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
),
'edit-product_tag' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce' ),
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
),
'edit-product_shipping_class' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce' ),
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
),
'product_attributes' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce' ),
'title' => __( 'Product Categories, Tags, Shipping Classes, & Attributes', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
),
'product' => array(
'title' => __( 'Simple Products', 'woocommerce' ),
'title' => __( 'Simple Products', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true'
),
'wc-status' => array(
'title' => __( 'System Status', 'woocommerce' ),
'title' => __( 'System Status', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true'
),
'wc-reports' => array(
'title' => __( 'Reports', 'woocommerce' ),
'title' => __( 'Reports', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true'
),
'edit-shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'title' => __( 'Coupons', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'
),
'shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'title' => __( 'Coupons', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'
),
'edit-shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'title' => __( 'Managing Orders', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'
),
'shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'title' => __( 'Managing Orders', WC_QD_TXT ),
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'
)
);
......@@ -161,59 +161,59 @@ class WooCommerce_Quick_Donation_Admin_Help {
if ( isset( $video_map[ $video_key ] ) ) {
$screen->add_help_tab( array(
'id' => 'woocommerce_101_tab',
'title' => __( 'WooCommerce 101', 'woocommerce' ),
'title' => __( 'WooCommerce 101', WC_QD_TXT ),
'content' =>
'<h2><a href="http://docs.woothemes.com/document/woocommerce-101-video-series/?utm_source=WooCommerce&utm_medium=Wizard&utm_content=Videos&utm_campaign=Onboarding">' . __( 'WooCommerce 101', 'woocommerce' ) . '</a> &ndash; ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' .
'<h2><a href="http://docs.woothemes.com/document/woocommerce-101-video-series/?utm_source=WooCommerce&utm_medium=Wizard&utm_content=Videos&utm_campaign=Onboarding">' . __( 'WooCommerce 101', WC_QD_TXT ) . '</a> &ndash; ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' .
'<iframe src="' . esc_url( $video_map[ $video_key ]['url'] ) . '" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>'
) );
}
$screen->add_help_tab( array(
'id' => 'woocommerce_docs_tab',
'title' => __( 'Documentation', 'woocommerce' ),
'title' => __( 'Documentation', WC_QD_TXT ),
'content' =>
'<h2>' . __( 'Documentation', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'Should you need help understanding, using, or extending WooCommerce, please read our documentation. You will find all kinds of resources including snippets, tutorials and much more.' , 'woocommerce' ) . '</p>' .
'<p><a href="' . 'http://docs.woothemes.com/documentation/plugins/woocommerce/' . '" class="button button-primary">' . __( 'WooCommerce Documentation', 'woocommerce' ) . '</a> <a href="' . 'http://docs.woothemes.com/wc-apidocs/' . '" class="button">' . __( 'Developer API Docs', 'woocommerce' ) . '</a></p>'
'<h2>' . __( 'Documentation', WC_QD_TXT ) . '</h2>' .
'<p>' . __( 'Should you need help understanding, using, or extending WooCommerce, please read our documentation. You will find all kinds of resources including snippets, tutorials and much more.' , WC_QD_TXT ) . '</p>' .
'<p><a href="' . 'http://docs.woothemes.com/documentation/plugins/woocommerce/' . '" class="button button-primary">' . __( 'WooCommerce Documentation', WC_QD_TXT ) . '</a> <a href="' . 'http://docs.woothemes.com/wc-apidocs/' . '" class="button">' . __( 'Developer API Docs', WC_QD_TXT ) . '</a></p>'
) );
$screen->add_help_tab( array(
'id' => 'woocommerce_support_tab',
'title' => __( 'Support', 'woocommerce' ),
'title' => __( 'Support', WC_QD_TXT ),
'content' =>
'<h2>' . __( 'Support', 'woocommerce' ) . '</h2>' .
'<p>' . sprintf( __( 'After %sreading the documentation%s, for further assistance you can use the %scommunity forums%s on WordPress.org to talk with other users. If however you are a WooThemes customer, or need help with premium add-ons sold by WooThemes, please %suse our helpdesk%s.', 'woocommerce' ), '<a href="http://docs.woothemes.com/documentation/plugins/woocommerce/">', '</a>', '<a href="https://wordpress.org/support/plugin/woocommerce">', '</a>', '<a href="http://support.woothemes.com">', '</a>' ) . '</p>' .
'<p>' . __( 'Before asking for help we recommend checking the system status page to identify any problems with your configuration.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'WordPress.org Forums', 'woocommerce' ) . '</a> <a href="' . 'http://support.woothemes.com' . '" class="button">' . __( 'WooThemes Customer Support', 'woocommerce' ) . '</a></p>'
'<h2>' . __( 'Support', WC_QD_TXT ) . '</h2>' .
'<p>' . sprintf( __( 'After %sreading the documentation%s, for further assistance you can use the %scommunity forums%s on WordPress.org to talk with other users. If however you are a WooThemes customer, or need help with premium add-ons sold by WooThemes, please %suse our helpdesk%s.', WC_QD_TXT ), '<a href="http://docs.woothemes.com/documentation/plugins/woocommerce/">', '</a>', '<a href="https://wordpress.org/support/plugin/woocommerce">', '</a>', '<a href="http://support.woothemes.com">', '</a>' ) . '</p>' .
'<p>' . __( 'Before asking for help we recommend checking the system status page to identify any problems with your configuration.', WC_QD_TXT ) . '</p>' .
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System Status', WC_QD_TXT ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'WordPress.org Forums', WC_QD_TXT ) . '</a> <a href="' . 'http://support.woothemes.com' . '" class="button">' . __( 'WooThemes Customer Support', WC_QD_TXT ) . '</a></p>'
) );
$screen->add_help_tab( array(
'id' => 'woocommerce_education_tab',
'title' => __( 'Education', 'woocommerce' ),
'title' => __( 'Education', WC_QD_TXT ),
'content' =>
'<h2>' . __( 'Education', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you would like to learn about using WooCommerce from an expert, consider following a WooCommerce course ran by one of our educational partners.', 'woocommerce' ) . '</p>' .
'<p><a href="' . 'http://www.woothemes.com/educational-partners/?utm_source=WooCommerce&utm_medium=Wizard&utm_content=Partners&utm_campaign=Onboarding' . '" class="button button-primary">' . __( 'View Education Partners', 'woocommerce' ) . '</a></p>'
'<h2>' . __( 'Education', WC_QD_TXT ) . '</h2>' .
'<p>' . __( 'If you would like to learn about using WooCommerce from an expert, consider following a WooCommerce course ran by one of our educational partners.', WC_QD_TXT ) . '</p>' .
'<p><a href="' . 'http://www.woothemes.com/educational-partners/?utm_source=WooCommerce&utm_medium=Wizard&utm_content=Partners&utm_campaign=Onboarding' . '" class="button button-primary">' . __( 'View Education Partners', WC_QD_TXT ) . '</a></p>'
) );
$screen->add_help_tab( array(
'id' => 'woocommerce_bugs_tab',
'title' => __( 'Found a bug?', 'woocommerce' ),
'title' => __( 'Found a bug?', WC_QD_TXT ),
'content' =>
'<h2>' . __( 'Found a bug?', 'woocommerce' ) . '</h2>' .
'<p>' . sprintf( __( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%s">system status report</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
'<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url('admin.php?page=wc-status') . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>'
'<h2>' . __( 'Found a bug?', WC_QD_TXT ) . '</h2>' .
'<p>' . sprintf( __( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%s">system status report</a>.', WC_QD_TXT ), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
'<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', WC_QD_TXT ) . '</a> <a href="' . admin_url('admin.php?page=wc-status') . '" class="button">' . __( 'System Status', WC_QD_TXT ) . '</a></p>'
) );
$screen->set_help_sidebar(
'<p><strong>' . __( 'For more information:', 'woocommerce' ) . '</strong></p>' .
'<p><a href="' . 'http://www.woothemes.com/woocommerce/' . '" target="_blank">' . __( 'About WooCommerce', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'http://wordpress.org/extend/plugins/woocommerce/' . '" target="_blank">' . __( 'WordPress.org Project', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'https://github.com/woothemes/woocommerce' . '" target="_blank">' . __( 'Github Project', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'http://www.woothemes.com/product-category/themes/woocommerce/' . '" target="_blank">' . __( 'Official Themes', 'woocommerce' ) . '</a></p>' .
'<p><a href="' . 'http://www.woothemes.com/product-category/woocommerce-extensions/' . '" target="_blank">' . __( 'Official Extensions', 'woocommerce' ) . '</a></p>'
'<p><strong>' . __( 'For more information:', WC_QD_TXT ) . '</strong></p>' .
'<p><a href="' . 'http://www.woothemes.com/woocommerce/' . '" target="_blank">' . __( 'About WooCommerce', WC_QD_TXT ) . '</a></p>' .
'<p><a href="' . 'http://wordpress.org/extend/plugins/woocommerce/' . '" target="_blank">' . __( 'WordPress.org Project', WC_QD_TXT ) . '</a></p>' .
'<p><a href="' . 'https://github.com/woothemes/woocommerce' . '" target="_blank">' . __( 'Github Project', WC_QD_TXT ) . '</a></p>' .
'<p><a href="' . 'http://www.woothemes.com/product-category/themes/woocommerce/' . '" target="_blank">' . __( 'Official Themes', WC_QD_TXT ) . '</a></p>' .
'<p><a href="' . 'http://www.woothemes.com/product-category/woocommerce-extensions/' . '" target="_blank">' . __( 'Official Extensions', WC_QD_TXT ) . '</a></p>'
);
}
......
......@@ -244,7 +244,7 @@ class WooCommerce_Quick_Donation_Admin {
public function set_wc_screen_ids($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->donors_list;
$screen[] = $this->sys_info;
......@@ -270,7 +270,6 @@ class WooCommerce_Quick_Donation_Admin {
$screen_ids[] = 'edit-product';
$screen_ids[] = 'product';
$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->donors_list;
......
......@@ -65,7 +65,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions {
$link = get_permalink($project_ID);
printf('<a href="%s"> %s </a> ',$link,$title);
} 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){
if ( $the_order->user_id ) {
$user_info = get_userdata( $the_order->user_id );
......@@ -87,7 +87,7 @@ class WooCommerce_Quick_Donation_Admin_Order_Page_Functions {
if ( $the_order->billing_first_name || $the_order->billing_last_name ) {
$username = trim( $the_order->billing_first_name . ' ' . $the_order->billing_last_name );
} else {
$username = __( 'Guest', 'woocommerce' );
$username = __( 'Guest', WC_QD_TXT );
}
}
......@@ -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-downloads','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);
}
......
......@@ -40,91 +40,91 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
self::$billing_fields = apply_filters( 'woocommerce_admin_billing_fields', array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'label' => __( 'First Name', WC_QD_TXT ),
'show' => false
),
'last_name' => array(
'label' => __( 'Last Name', 'woocommerce' ),
'label' => __( 'Last Name', WC_QD_TXT ),
'show' => false
),
'company' => array(
'label' => __( 'Company', 'woocommerce' ),
'label' => __( 'Company', WC_QD_TXT ),
'show' => false
),
'address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'label' => __( 'Address 1', WC_QD_TXT ),
'show' => false
),
'address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'label' => __( 'Address 2', WC_QD_TXT ),
'show' => false
),
'city' => array(
'label' => __( 'City', 'woocommerce' ),
'label' => __( 'City', WC_QD_TXT ),
'show' => false
),
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'label' => __( 'Postcode', WC_QD_TXT ),
'show' => false
),
'country' => array(
'label' => __( 'Country', 'woocommerce' ),
'label' => __( 'Country', WC_QD_TXT ),
'show' => false,
'class' => 'js_field-country select short',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', WC_QD_TXT ) ) + WC()->countries->get_allowed_countries()
),
'state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'label' => __( 'State/County', WC_QD_TXT ),
'class' => 'js_field-state select short',
'show' => false
),
'email' => array(
'label' => __( 'Email', 'woocommerce' ),
'label' => __( 'Email', WC_QD_TXT ),
),
'phone' => array(
'label' => __( 'Phone', 'woocommerce' ),
'label' => __( 'Phone', WC_QD_TXT ),
),
) );
self::$shipping_fields = apply_filters( 'woocommerce_admin_shipping_fields', array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'label' => __( 'First Name', WC_QD_TXT ),
'show' => false
),
'last_name' => array(
'label' => __( 'Last Name', 'woocommerce' ),
'label' => __( 'Last Name', WC_QD_TXT ),
'show' => false
),
'company' => array(
'label' => __( 'Company', 'woocommerce' ),
'label' => __( 'Company', WC_QD_TXT ),
'show' => false
),
'address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'label' => __( 'Address 1', WC_QD_TXT ),
'show' => false
),
'address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'label' => __( 'Address 2', WC_QD_TXT ),
'show' => false
),
'city' => array(
'label' => __( 'City', 'woocommerce' ),
'label' => __( 'City', WC_QD_TXT ),
'show' => false
),
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'label' => __( 'Postcode', WC_QD_TXT ),
'show' => false
),
'country' => array(
'label' => __( 'Country', 'woocommerce' ),
'label' => __( 'Country', WC_QD_TXT ),
'show' => false,
'type' => 'select',
'class' => 'js_field-country select short',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_shipping_countries()
'options' => array( '' => __( 'Select a country&hellip;', WC_QD_TXT ) ) + WC()->countries->get_shipping_countries()
),
'state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'label' => __( 'State/County', WC_QD_TXT ),
'class' => 'js_field-state select short',
'show' => false
),
......@@ -162,15 +162,15 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
#post-body-content, #titlediv { display:none }
</style>
<div class="panel-wrap woocommerce">
<input name="post_title" type="hidden" value="<?php echo empty( $post->post_title ) ? __( 'Order', 'woocommerce' ) : esc_attr( $post->post_title ); ?>" />
<input name="post_title" type="hidden" value="<?php echo empty( $post->post_title ) ? __( 'Order', WC_QD_TXT ) : esc_attr( $post->post_title ); ?>" />
<input name="post_status" type="hidden" value="<?php echo esc_attr( $post->post_status ); ?>" />
<div id="order_data" class="panel">
<h2><?php echo esc_html( sprintf( __( '%s %s details', 'woocommerce' ), $donation_type_object->labels->menu_name, $order->get_order_number() ) ); ?></h2>
<h2><?php echo esc_html( sprintf( __( '%s %s details', WC_QD_TXT ), $donation_type_object->labels->menu_name, $order->get_order_number() ) ); ?></h2>
<p class="order_number"><?php
if ( $payment_method ) {
printf( __( 'Payment via %s', 'woocommerce' ), ( isset( $payment_gateways[ $payment_method ] ) ? esc_html( $payment_gateways[ $payment_method ]->get_title() ) : esc_html( $payment_method ) ) );
printf( __( 'Payment via %s', WC_QD_TXT ), ( isset( $payment_gateways[ $payment_method ] ) ? esc_html( $payment_gateways[ $payment_method ]->get_title() ) : esc_html( $payment_method ) ) );
if ( $transaction_id = $order->get_transaction_id() ) {
if ( isset( $payment_gateways[ $payment_method ] ) && ( $url = $payment_gateways[ $payment_method ]->get_transaction_url( $order ) ) ) {
......@@ -183,7 +183,7 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
}
if ( $ip_address = get_post_meta( $post->ID, '_customer_ip_address', true ) ) {
echo __( 'Customer IP', 'woocommerce' ) . ': ' . esc_html( $ip_address );
echo __( 'Customer IP', WC_QD_TXT ) . ': ' . esc_html( $ip_address );
}
?></p>
......@@ -193,7 +193,7 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
<p class="form-field form-field-wide"><label for="order_date"><?php _e( 'Donation date:', WC_QD_TXT ) ?></label>
<input type="hidden" name="post_is_donation" value="TRUE"/>
<input type="text" class="date-picker" name="order_date" id="order_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $post->post_date ) ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="text" class="hour" placeholder="<?php esc_attr_e( 'h', 'woocommerce' ) ?>" name="order_date_hour" id="order_date_hour" maxlength="2" size="2" value="<?php echo date_i18n( 'H', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />:<input type="text" class="minute" placeholder="<?php esc_attr_e( 'm', 'woocommerce' ) ?>" name="order_date_minute" id="order_date_minute" maxlength="2" size="2" value="<?php echo date_i18n( 'i', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />
<input type="text" class="date-picker" name="order_date" id="order_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $post->post_date ) ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />@<input type="text" class="hour" placeholder="<?php esc_attr_e( 'h', WC_QD_TXT ) ?>" name="order_date_hour" id="order_date_hour" maxlength="2" size="2" value="<?php echo date_i18n( 'H', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />:<input type="text" class="minute" placeholder="<?php esc_attr_e( 'm', WC_QD_TXT ) ?>" name="order_date_minute" id="order_date_minute" maxlength="2" size="2" value="<?php echo date_i18n( 'i', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />
</p>
<p class="form-field form-field-wide"><label for="order_status"><?php _e( 'Donation status:', WC_QD_TXT ) ?></label>
......@@ -207,7 +207,7 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
</select></p>
<p class="form-field form-field-wide wc-customer-user">
<label for="customer_user"><?php _e( 'Customer:', 'woocommerce' ) ?> <?php
<label for="customer_user"><?php _e( 'Customer:', WC_QD_TXT ) ?> <?php
if ( ! empty( $order->customer_user ) ) {
$args = array( 'post_status' => 'all',
'post_type' => 'shop_order',
......@@ -215,7 +215,7 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
);
printf( '<a href="%s">%s &rarr;</a>',
esc_url( add_query_arg( $args, admin_url( 'edit.php' ) ) ),
__( 'View other orders', 'woocommerce' )
__( 'View other orders', WC_QD_TXT )
);
}
?></label>
......@@ -228,24 +228,24 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
$user_string = esc_html( $user->display_name ) . ' (#' . absint( $user->ID ) . ' &ndash; ' . esc_html( $user->user_email ) . ')';
}
?>
<input type="hidden" class="wc-customer-search" id="customer_user" name="customer_user" data-placeholder="<?php esc_attr_e( 'Guest', 'woocommerce' ); ?>" data-selected="<?php echo htmlspecialchars( $user_string ); ?>" value="<?php echo $user_id; ?>" data-allow_clear="true" />
<input type="hidden" class="wc-customer-search" id="customer_user" name="customer_user" data-placeholder="<?php esc_attr_e( 'Guest', WC_QD_TXT ); ?>" data-selected="<?php echo htmlspecialchars( $user_string ); ?>" value="<?php echo $user_id; ?>" data-allow_clear="true" />
</p>
<?php do_action( 'woocommerce_admin_order_data_after_order_details', $order ); ?>
</div>
<div class="order_data_column">
<h4>
<?php _e( 'Donor Details', 'woocommerce' ); ?>
<a href="#" class="edit_address"><?php _e( 'Edit', 'woocommerce' ); ?></a>
<a href="#" class="tips load_customer_billing" data-tip="<?php esc_attr_e( 'Load billing address', 'woocommerce' ); ?>" style="display:none;"><?php _e( 'Load billing address', 'woocommerce' ); ?></a>
<?php _e( 'Donor Details', WC_QD_TXT ); ?>
<a href="#" class="edit_address"><?php _e( 'Edit', WC_QD_TXT ); ?></a>
<a href="#" class="tips load_customer_billing" data-tip="<?php esc_attr_e( 'Load billing address', WC_QD_TXT ); ?>" style="display:none;"><?php _e( 'Load billing address', WC_QD_TXT ); ?></a>
</h4>
<?php
// Display values
echo '<div class="address">';
if ( $order->get_formatted_billing_address() ) {
echo '<p><strong>' . __( 'Address', 'woocommerce' ) . ':</strong>' . wp_kses( $order->get_formatted_billing_address(), array( 'br' => array() ) ) . '</p>';
echo '<p><strong>' . __( 'Address', WC_QD_TXT ) . ':</strong>' . wp_kses( $order->get_formatted_billing_address(), array( 'br' => array() ) ) . '</p>';
} else {
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No billing address set.', 'woocommerce' ) . '</p>';
echo '<p class="none_set"><strong>' . __( 'Address', WC_QD_TXT ) . ':</strong> ' . __( 'No billing address set.', WC_QD_TXT ) . '</p>';
}
foreach ( self::$billing_fields as $key => $field ) {
......@@ -283,9 +283,9 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
}
?>
<p class="form-field form-field-wide">
<label><?php _e( 'Payment Method:', 'woocommerce' ); ?></label>
<label><?php _e( 'Payment Method:', WC_QD_TXT ); ?></label>
<select name="_payment_method" id="_payment_method" class="first">
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
<option value=""><?php _e( 'N/A', WC_QD_TXT ); ?></option>
<?php
$found_method = false;
......@@ -299,16 +299,16 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
}
if ( ! $found_method && ! empty( $payment_method ) ) {
echo '<option value="' . esc_attr( $payment_method ) . '" selected="selected">' . __( 'Other', 'woocommerce' ) . '</option>';
echo '<option value="' . esc_attr( $payment_method ) . '" selected="selected">' . __( 'Other', WC_QD_TXT ) . '</option>';
} else {
echo '<option value="other">' . __( 'Other', 'woocommerce' ) . '</option>';
echo '<option value="other">' . __( 'Other', WC_QD_TXT ) . '</option>';
}
?>
</select>
</p>
<?php
woocommerce_wp_text_input( array( 'id' => '_transaction_id', 'label' => __( 'Transaction ID', 'woocommerce' ) ) );
woocommerce_wp_text_input( array( 'id' => '_transaction_id', 'label' => __( 'Transaction ID', WC_QD_TXT ) ) );
echo '</div>';
......@@ -325,7 +325,7 @@ class WC_Quick_Donation_Meta_Box_Order_Data {
require(WC_QD_ADMIN.'metabox/html/html-donation-info.php');
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>';
echo '<p><strong>' . __( 'Customer Provided Note', WC_QD_TXT ) . ':</strong> ' . nl2br( esc_html( $post->post_excerpt ) ) . '</p>';
}
echo '</div>';
......
......@@ -58,9 +58,9 @@
<div class="order_data_column" style="display:none; visibility: hidden;">
<?php
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 ( 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 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; }
......@@ -75,8 +75,8 @@ break;
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>
<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>
<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', WC_QD_TXT ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
<?php
}
......
......@@ -8,7 +8,7 @@ $fields['settings_general']['general'][] = array(
'label' => __( 'Redirect User To', WC_QD_TXT),
'desc' => __( 'After Donation Added To Cart',WC_QD_TXT),
'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%;')
);
......@@ -19,7 +19,7 @@ $fields['settings_general']['general'][] = array(
'label' => __( 'Donation Exist Redirect', WC_QD_TXT),
'desc' => __( 'Redirect User When Donation Already Exist In Cart',WC_QD_TXT),
'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%;')
);
......@@ -34,15 +34,12 @@ $fields['settings_general']['general'][] = array(
);
/** Message Settings **/
$fields['settings_message']['message'][] = array(
'desc' => __( '<div class="decs"> <span> Add <code>{donation_amount}</code> To Get Ented Amount By User. </span>
<span> Add <code>{min_amount}</code> To Get Minimum Required Amount From Selected Project </span>
<span> Add <code>{max_amount}</code> To Get Minimum Required Amount From Selected Project </span> </div>',WC_QD_TXT),
'desc' => sprintf(__( '<span> Add <code>%s</code> To Get Ented Amount By User.</span> <br/>
<span> Add <code>%s</code> To Get Minimum Required Amount From Selected Project </span> <br/>
<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',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'),
'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'content'
);
......@@ -51,7 +48,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Donation Conflict', 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',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'),
'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea'
);
......@@ -59,7 +56,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Empty Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Empty Donation Entered',WC_QD_TXT),
'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'
);
......@@ -67,7 +64,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Donation Already Exist', 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',
'attr' => array('style' => 'min-width:35%; width:auto;max-width:75%;'),
'attr' => array('style' => 'min-width:50%; width:auto;max-width:75%;'),
'type' => 'textarea',
);
......@@ -76,7 +73,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Invalid Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Invalid Donation Entered',WC_QD_TXT),
'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'
);
......@@ -84,7 +81,7 @@ $fields['settings_message']['message'][] = array(
'label' => __( 'Minimum Required Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Minimum Required Donation Not Entered',WC_QD_TXT),
'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'
);
......@@ -92,6 +89,43 @@ $fields['settings_message']['message'][] = array(
'label' =>__( 'Maximum Required Donation Amount', WC_QD_TXT),
'desc' => __( 'Custom Message To Show When Maximum Required Donation Not Entered ',WC_QD_TXT),
'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'
);
/** 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
global $pages;
$pages[] = array('id'=>'settings_general','slug'=>'general','title'=>'General');
$pages[] = array('id'=>'settings_message','slug'=>'message','title'=>'Message');
$pages[] = array('id'=>'settings_general','slug'=>'general','title'=>__('General',WC_QD_TXT));
$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
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(
'id'=>'message',
......@@ -9,3 +13,11 @@ $section['settings_message'][] = array(
'desc' => '',
'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
class WooCommerce_Quick_Donation_Settings {
private $page_hook = '';
public $settings;
......@@ -9,6 +8,7 @@ class WooCommerce_Quick_Donation_Settings {
private $create_function;
private $settings_key;
private $settings_values;
function __construct($page_hook = '') {
$this->settings_section = array();
$this->settings_fields = array();
......@@ -19,21 +19,24 @@ class WooCommerce_Quick_Donation_Settings {
$this->add_settings_section();
$this->create_callback_function();
$this->page_hook = $page_hook;
$this->settings = new WC_Quick_Donation_Settings();
if(empty($page_hook)) {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
add_action( 'current_screen', array( $this, 'admin_screen' ));
add_action( 'admin_init', array( $this, 'admin_init' ) );
}
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 = 'wc_qd';
$this->page_hook = add_submenu_page('edit.php?post_type='.WC_QD_PT,
__('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 {
$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(){
$this->settings = new WC_Quick_Donation_Settings();
$this->add_settings_fields();
$this->settings->add_pages($this->settings_page);
$sections = $this->settings_section;
......@@ -106,7 +115,7 @@ 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 {
settings_errors();
$this->settings->render_header();
echo $this->settings->debug;
$this->settings->render_form();
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 = ''){
if( ! empty($this->settings_values) && ! empty($id)){
if(isset($this->settings_values[$id])){
......@@ -155,6 +154,4 @@ class WooCommerce_Quick_Donation_Settings {
}
}
?>
\ No newline at end of file
......@@ -11,13 +11,17 @@ class WC_QD_INSTALL{
self::post_register();
self::wc_qd_table_install();
self::check_template_files();
self::add_options();
if(! $donation_exist){
$post_id = self::create_simple_donation();
update_option(WC_QD_DB.'product_id',$post_id);
}
}
/**
* Registers Custom Post, Custom Taxonomy
*/
public static function post_register(){
WC_QD_Post_Types::register_donation_posttype();
WC_QD_Post_Types::register_donation_category();
......@@ -67,6 +71,49 @@ class WC_QD_INSTALL{
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
* @return int donation Post id
......@@ -96,14 +143,18 @@ class WC_QD_INSTALL{
update_post_meta($post_id, '_sku', 'checkout-donation');
return $post_id;
}
/**
* Gets ALl Core Templates
*/
public static function get_template_list(){
$core_tempalte_list = WC_Admin_Status::scan_template_files( WC_QD_TEMPLATE );
return $core_tempalte_list;
}
/**
* Checks For Template Version
*/
public static function check_template_files(){
$template_files = self::get_template_list();
$outdated = false;
......@@ -137,7 +188,7 @@ class WC_QD_INSTALL{
$theme = wp_get_theme();
$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>',
'woocommerce' ),
WC_QD_TXT),
esc_html( $theme['Name'] ),
'<a href="' . admin_url( 'admin.php?page=wc-status' ) . '">','</a>',
'<a target="_blank" href="" class="button-primary" href="">','</a>',
......
......@@ -17,11 +17,8 @@ class WooCommerce_Quick_Donation_Emails_Functions {
add_action('woocommerce_order_status_failed',array($this,'check_order'),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_footer', array( $this, 'email_footer' ) );
//add_filter( 'woocommerce_template_directory', array( $this, 'change_dir'),2,2);
}
......
......@@ -155,9 +155,10 @@ 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;
$field_output = '';
$id = 'donation_project';
$name = 'wc_qd_donate_project_name';
$class = apply_filters('wcqd_project_name_'.$type.'_class',array(),$type);
......@@ -177,6 +178,7 @@ class WooCommerce_Quick_Donation_Functions {
'field_output' => $field_output,
'is_grouped' => $is_grouped,
'project_list' => $project_list,
'pre_selected' => $selected,
'attributes' => $attributes));
return $field_output;
}
......
......@@ -23,19 +23,21 @@ class WooCommerce_Quick_Donation_Shortcode {
public function shortcode_handler($settings){
global $donation_box,$donation_price,$currency;
$settings = shortcode_atts( array(
'type' => 'select',
'type' => wcqd_get_option(WC_QD_DB.'default_render_type'),
'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 );
$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();
$currency = get_woocommerce_currency_symbol();
$return_value = '';
$messages = '';
if($settings['show_erros']){
if($settings['show_errors']){
ob_start();
wc_print_notices();
$messages .= ob_get_clean();
......
......@@ -26,10 +26,10 @@ class WC_QD_donation_completed_email extends WC_Email {
$this->id = WC_QD_DB.'donation_completed_email';
$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->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_plain = 'emails/plain/donation-completed.php';
......@@ -135,30 +135,30 @@ class WC_QD_donation_completed_email extends WC_Email {
function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
'title' => __( 'Enable/Disable', WC_QD_TXT ),
'type' => 'checkbox',
'label' => __( 'Enable this email notification', 'woocommerce' ),
'label' => __( 'Enable this email notification', WC_QD_TXT ),
'default' => 'yes'
),
'subject' => array(
'title' => __( 'Subject', 'woocommerce' ),
'title' => __( 'Subject', WC_QD_TXT ),
'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' => '',
'default' => ''
),
'heading' => array(
'title' => __( 'Email Heading', 'woocommerce' ),
'title' => __( 'Email Heading', WC_QD_TXT ),
'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' => '',
'default' => ''
),
'email_type' => array(
'title' => __( 'Email type', 'woocommerce' ),
'title' => __( 'Email type', WC_QD_TXT ),
'type' => 'select',
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'description' => __( 'Choose which format of email to send.', WC_QD_TXT ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => $this->get_email_type_options()
......
......@@ -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->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_plain = 'emails/plain/donation-processing.php';
......
......@@ -63,10 +63,28 @@ if(! function_exists('wcqd_get_project_name')){
}
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){
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' ) ) {
<tr class="shipping">
<th><?php
if ( $show_package_details ) {
printf( __( 'Shipping #%d', 'woocommerce' ), $index + 1 );
printf( __( 'Shipping #%d', WC_QD_TXT ), $index + 1 );
} else {
_e( 'Shipping', 'woocommerce' );
_e( 'Shipping', WC_QD_TXT);
}
?></th>
<td>
......@@ -54,15 +54,15 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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() ) : ?>
<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 : ?>
<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; ?>
......@@ -71,13 +71,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( is_cart() ) : ?>
<?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 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; ?>
......@@ -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; ?>
......
......@@ -25,7 +25,7 @@ do_action( 'woocommerce_before_cart' ); ?>
<th class="product-remove" style="width:10%;">&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-price"><?php _e( 'Amount', 'woocommerce' ); ?></th>
<th class="product-price"><?php _e( 'Amount', WC_QD_TXT ); ?></th>
</tr>
</thead>
<tbody>
......@@ -45,7 +45,7 @@ do_action( 'woocommerce_before_cart' ); ?>
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>',
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->get_sku() )
), $cart_item_key );
......
......@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
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>',
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->get_sku() )
), $cart_item_key );
......@@ -58,7 +58,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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; ?>
......@@ -66,13 +66,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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' ); ?>
<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_checkout_url(); ?>" class="button checkout wc-forward"><?php _e( 'Checkout', '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', WC_QD_TXT ); ?></a>
</p>
<?php endif; ?>
......
......@@ -15,8 +15,8 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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' ); ?>
<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' ) ) {
<div class="woocommerce-billing-fields">
<?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 : ?>
<h3><?php _e( 'Donor Details', 'woocommerce' ); ?></h3>
<h3><?php _e( 'Donor Details', WC_QD_TXT ); ?></h3>
<?php endif; ?>
......@@ -39,7 +39,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $checkout->enable_guest_checkout ) : ?>
<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>
<?php endif; ?>
......@@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<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 ) : ?>
......
......@@ -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->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;
}
......@@ -36,7 +36,7 @@ $get_checkout_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->g
<?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; ?>
......
......@@ -15,15 +15,15 @@ if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_lo
return;
}
$info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'Returning customer?', 'woocommerce' ) );
$info_message .= ' <a href="#" class="showlogin">' . __( 'Click here to login', 'woocommerce' ) . '</a>';
$info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'Returning customer?', WC_QD_TXT ) );
$info_message .= ' <a href="#" class="showlogin">' . __( 'Click here to login', WC_QD_TXT ) . '</a>';
wc_print_notice( $info_message, 'notice' );
?>
<?php
woocommerce_login_form(
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' ),
'hidden' => true
)
......
......@@ -17,9 +17,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<table class="shop_table">
<thead>
<tr>
<th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th>
<th class="product-quantity"><?php _e( 'Qty', 'woocommerce' ); ?></th>
<th class="product-total"><?php _e( 'Totals', 'woocommerce' ); ?></th>
<th class="product-name"><?php _e( 'Product', WC_QD_TXT ); ?></th>
<th class="product-quantity"><?php _e( 'Qty', WC_QD_TXT ); ?></th>
<th class="product-total"><?php _e( 'Totals', WC_QD_TXT ); ?></th>
</tr>
</thead>
<tbody>
......@@ -52,7 +52,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div id="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">
<?php
if ( $available_gateways = WC()->payment_gateways->get_available_payment_gateways() ) {
......@@ -77,7 +77,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
} 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' ) ) {
<div class="form-row">
<?php wp_nonce_field( 'woocommerce-pay' ); ?>
<?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 ) . '" />' );
?>
......
......@@ -29,7 +29,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<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" />
</h3>
......@@ -55,7 +55,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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; ?>
......
......@@ -27,9 +27,9 @@ if ( ! defined( 'ABSPATH' ) ) {
}
} else {
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 {
$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>';
......@@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<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' ); ?>
......@@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) : ?>
<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" />
</p>
<?php endif; ?>
......
......@@ -14,8 +14,8 @@ if ( ! defined( 'ABSPATH' ) ) {
<table class="shop_table woocommerce-checkout-review-order-table">
<thead>
<tr>
<th class="product-name"><?php _e( 'Donation for', 'woocommerce' ); ?></th>
<th class="product-total"><?php _e( 'Amount', 'woocommerce' ); ?></th>
<th class="product-name"><?php _e( 'Donation for', WC_QD_TXT ); ?></th>
<th class="product-total"><?php _e( 'Amount', WC_QD_TXT ); ?></th>
</tr>
</thead>
<tbody>
......
......@@ -14,19 +14,19 @@ if ( $order ) : ?>
<?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
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
_e( 'Please attempt your purchase again.', 'woocommerce' );
_e( 'Please attempt your purchase again.', WC_QD_TXT );
?></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() ) : ?>
<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; ?>
</p>
......@@ -36,17 +36,17 @@ if ( $order ) : ?>
<ul class="order_details">
<li class="order">
<?php _e( 'Reference Number :', 'woocommerce' ); ?>
<?php _e( 'Reference Number :', WC_QD_TXT ); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
</li>
<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>
</li>
<?php if ( $order->payment_method_title ) : ?>
<li class="method">
<?php _e( 'Payment Method:', 'woocommerce' ); ?>
<?php _e( 'Payment Method:', WC_QD_TXT ); ?>
<strong><?php echo $order->payment_method_title; ?></strong>
</li>
<?php endif; ?>
......@@ -60,6 +60,6 @@ if ( $order ) : ?>
<?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; ?>
......@@ -17,19 +17,19 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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 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">
<thead>
<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( 'Price', 'woocommerce' ); ?></th>
<th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', WC_QD_TXT ); ?></th>
</tr>
</thead>
<tbody>
......
......@@ -15,18 +15,18 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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 ); ?>
<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">
<thead>
<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( 'Quantity', 'woocommerce' ); ?></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( 'Product', WC_QD_TXT ); ?></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', WC_QD_TXT ); ?></th>
</tr>
</thead>
<tbody>
......
......@@ -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%">
<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>
......@@ -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%">
<h3><?php _e( 'Shipping address', 'woocommerce' ); ?></h3>
<h3><?php _e( 'Shipping address', WC_QD_TXT ); ?></h3>
<p class="text"><?php echo $shipping; ?></p>
......
......@@ -26,7 +26,7 @@ foreach ( $items as $item_id => $item ) :
// Show title/image etc
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
......
......@@ -19,13 +19,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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">
<thead>
<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( 'Price', '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', WC_QD_TXT ); ?></th>
</tr>
</thead>
<tbody>
......
......@@ -14,14 +14,14 @@ if ( ! defined( 'ABSPATH' ) ) {
echo "= " . $email_heading . " =\n\n";
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";
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 date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n";
echo strtoupper( sprintf( __( 'Order number: %s', WC_QD_TXT ), $order->get_order_number() ) ) . "\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 );
......
......@@ -13,14 +13,14 @@ if ( ! defined( 'ABSPATH' ) ) {
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";
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 date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n";
echo strtoupper( sprintf( __( 'Order number: %s', WC_QD_TXT ), $order->get_order_number() ) ) . "\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 );
......
......@@ -11,10 +11,10 @@ if ( ! defined( 'ABSPATH' ) ) {
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";
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";
}
......@@ -32,10 +32,10 @@ foreach ( $items as $item_id => $item ) :
echo ( $item_meta_content = $item_meta->display( true, true ) ) ? "\n" . $item_meta_content : '';
// 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
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
if ( $show_download_links && $_product->exists() && $_product->is_downloadable() ) {
......@@ -46,9 +46,9 @@ foreach ( $items as $item_id => $item ) :
$i++;
if ( count( $download_files ) > 1 ) {
$prefix = sprintf( __( 'Download %d', 'woocommerce' ), $i );
$prefix = sprintf( __( 'Download %d', WC_QD_TXT ), $i );
} elseif ( $i == 1 ) {
$prefix = __( 'Download', 'woocommerce' );
$prefix = __( 'Download', WC_QD_TXT );
}
echo "\n" . $prefix . '(' . esc_html( $file['name'] ) . '): ' . esc_url( $file['download_url'] );
......
......@@ -13,14 +13,14 @@ if ( ! defined( 'ABSPATH' ) ) {
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";
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 date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) . "\n";
echo strtoupper( sprintf( __( 'Order number: %s', WC_QD_TXT ), $order->get_order_number() ) ) . "\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 );
......
......@@ -4,19 +4,24 @@
*
* @author Varun Sridharan
* @package WooCommerce Quick Donation/Templates/fields
* @version 0.1
* @version 0.2
*/
foreach($project_list as $id => $val){
if(is_array($val)){
$field_output .= ' <fieldset> <legend>'.$id.'</legend>';
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>';
} 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 @@
*
* @author Varun Sridharan
* @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;?>">
<?php
foreach($project_list as $id => $val){
foreach($project_list as $id => $val){
$attr = '';
if(is_array($val)){
$field_output .= ' <optgroup label="'.$id.'">';
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>';
} 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 ) : ?>
$item_count = $order->get_item_count();
?><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() ); ?>">
<?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>
</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);?>
<a href="<?php echo get_permalink($project_id); ?>">
<?php echo get_the_title($project_id); ?>
</a>
</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>
</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() ); ?>
</td>
<td class="order-total" data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>">
<?php echo sprintf( _n( '%s for %s item', '%s for %s items', $item_count, 'woocommerce' ), $order->get_formatted_order_total(), $item_count ); ?>
<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, WC_QD_TXT ), $order->get_formatted_order_total(), $item_count ); ?>
</td>
<td class="order-actions">
<?php
......@@ -73,20 +73,20 @@ if ( $customer_orders ) : ?>
if ( $order->needs_payment() ) {
$actions['pay'] = array(
'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 ) ) ) {
$actions['cancel'] = array(
'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ),
'name' => __( 'Cancel', 'woocommerce' )
'name' => __( 'Cancel', WC_QD_TXT )
);
}
$actions['view'] = array(
'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 );
......
......@@ -19,13 +19,13 @@ if ( ! defined( 'ABSPATH' ) ) {
<?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">
<?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>
<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">
<?php echo wpautop( wptexturize( $note->comment_content ) ); ?>
</div>
......
......@@ -17,13 +17,13 @@ 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><?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-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-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', 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>
<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' ); ?>
</form>
\ No newline at end of file
......@@ -13,5 +13,5 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<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>
......@@ -13,13 +13,13 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<div class="col1-set addresses">
<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;">
<?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>
<?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 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>
......
......@@ -11,9 +11,9 @@ 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() ) );
$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 .= '.';
......@@ -22,13 +22,13 @@ echo wpautop( esc_attr( apply_filters( 'woocommerce_order_tracking_status', $ord
$notes = $order->get_customer_order_notes();
if ( $notes ) : ?>
<h2><?php _e( 'Order Updates', 'woocommerce' ); ?></h2>
<h2><?php _e( 'Order Updates', WC_QD_TXT ); ?></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>
<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">
<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>
</div>
......
......@@ -248,6 +248,7 @@ class WooCommerce_Quick_Donation {
$this->define('WC_QD_TB',$wpdb->prefix . 'wc_quick_donation');
$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_CAT','wcqd_category');
$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