Version Description
- 24/10/2014 =
- Fix - PDF Invoices - Variation(s) name was not showing in invoice, fixed. Reported by https://wordpress.org/support/topic/item-description?replies=4
- Feature Upgraded - PDF Invoices - Now shortcodes are displayed in invoice's additional header and footer.
Idea by https://wordpress.org/support/topic/displaying-short-codes?replies=3
- Feature Upgraded - PDF Invoices - Additional header option added.
- Feature Upgraded - PDF Invoices - Item Name Additional Info (e.g. SKU) option added to invoice. Idea by https://wordpress.org/support/topic/item-description?replies=4
Download this release
Release Info
Developer | algoritmika |
Plugin | Booster for WooCommerce |
Version | 1.8.1 |
Comparing to | |
See all releases |
Code changes from version 1.8.0 to 1.8.1
- includes/class-wcj-pdf-invoices.php +50 -15
- includes/class-wcj-product-info.php +58 -7
- includes/class-wcj-product-input-fields.php +21 -5
- includes/class-wcj-reports.php +61 -2
- readme.txt +20 -10
- woocommerce-jetpack.php +1 -1
includes/class-wcj-pdf-invoices.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The WooCommerce Jetpack PDF Invoices class.
|
6 |
*
|
7 |
* @class WCJ_PDF_Invoices
|
8 |
-
* @version 1.
|
9 |
* @category Class
|
10 |
* @author Algoritmika Ltd.
|
11 |
*/
|
@@ -519,25 +519,31 @@ class WCJ_PDF_Invoices {
|
|
519 |
// Line Prices
|
520 |
$line_total_excl_tax = $the_order->get_line_total( $item, false );//$the_order->get_line_subtotal( $item, false, true );//$item['line_subtotal'];//$item['line_total'];
|
521 |
$line_tax = $the_order->get_line_tax( $item );//$item['line_tax'];
|
522 |
-
$line_total_tax_percent
|
|
|
|
|
523 |
$line_total_incl_tax = $the_order->get_line_total( $item, true );//$line_total_excl_tax + $line_tax;
|
524 |
$line_total_excl_tax_formatted = wc_price( $line_total_excl_tax, $order_currency_array );
|
525 |
$line_total_tax_formatted = wc_price( $line_tax, $order_currency_array );
|
526 |
-
$line_total_incl_tax_formatted = wc_price( $line_total_incl_tax, $order_currency_array );
|
|
|
527 |
// Item Quantity
|
528 |
$item_quantity = $item['qty'];
|
|
|
529 |
// Item Name
|
530 |
-
$item_name = $item['name'];
|
531 |
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
|
|
|
|
541 |
// Item Counter
|
542 |
$item_counter++;
|
543 |
|
@@ -585,7 +591,18 @@ class WCJ_PDF_Invoices {
|
|
585 |
if ( '' != get_option( 'wcj_pdf_invoices_order_shipping_method_text' ) )
|
586 |
$html .= '<p>' . get_option( 'wcj_pdf_invoices_order_shipping_method_text' ). ': ' . $the_order->get_shipping_method() . '</p>';
|
587 |
// ADDITIONAL FOOTER
|
588 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
|
590 |
return $html;
|
591 |
}
|
@@ -738,6 +755,15 @@ class WCJ_PDF_Invoices {
|
|
738 |
'type' => 'number',
|
739 |
'css' => 'width:33%;min-width:300px;',
|
740 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
|
742 |
array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_header_options' ),
|
743 |
|
@@ -851,6 +877,15 @@ class WCJ_PDF_Invoices {
|
|
851 |
'type' => 'text',
|
852 |
'css' => 'width:33%;min-width:300px;',
|
853 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
854 |
|
855 |
array(
|
856 |
'title' => __( 'Qty', 'woocommerce-jetpack' ),
|
@@ -1006,7 +1041,7 @@ class WCJ_PDF_Invoices {
|
|
1006 |
|
1007 |
array(
|
1008 |
'title' => __( 'Additional Footer', 'woocommerce-jetpack' ),
|
1009 |
-
|
1010 |
'id' => 'wcj_pdf_invoices_footer_text',
|
1011 |
'default' => '',
|
1012 |
'type' => 'textarea',
|
5 |
* The WooCommerce Jetpack PDF Invoices class.
|
6 |
*
|
7 |
* @class WCJ_PDF_Invoices
|
8 |
+
* @version 1.6.0
|
9 |
* @category Class
|
10 |
* @author Algoritmika Ltd.
|
11 |
*/
|
519 |
// Line Prices
|
520 |
$line_total_excl_tax = $the_order->get_line_total( $item, false );//$the_order->get_line_subtotal( $item, false, true );//$item['line_subtotal'];//$item['line_total'];
|
521 |
$line_tax = $the_order->get_line_tax( $item );//$item['line_tax'];
|
522 |
+
$line_total_tax_percent = 0;
|
523 |
+
if ( 0 != $item['line_subtotal'] )
|
524 |
+
$line_total_tax_percent = round( ( $item['line_tax'] / $item['line_subtotal'] * 100 ), 2 );
|
525 |
$line_total_incl_tax = $the_order->get_line_total( $item, true );//$line_total_excl_tax + $line_tax;
|
526 |
$line_total_excl_tax_formatted = wc_price( $line_total_excl_tax, $order_currency_array );
|
527 |
$line_total_tax_formatted = wc_price( $line_tax, $order_currency_array );
|
528 |
+
$line_total_incl_tax_formatted = wc_price( $line_total_incl_tax, $order_currency_array );
|
529 |
+
|
530 |
// Item Quantity
|
531 |
$item_quantity = $item['qty'];
|
532 |
+
|
533 |
// Item Name
|
534 |
+
$item_name = $item['name']; //$product->get_title();
|
535 |
|
536 |
+
|
537 |
+
$product = $the_order->get_product_from_item( $item );
|
538 |
+
|
539 |
+
// Additional info (e.g. SKU)
|
540 |
+
if ( '' != get_option( 'wcj_pdf_invoices_column_item_name_additional_text' ) && $product->get_sku() )
|
541 |
+
$item_name .= ' ' . str_replace( '%sku%', $product->get_sku(), get_option( 'wcj_pdf_invoices_column_item_name_additional_text' ) );
|
542 |
+
|
543 |
+
// Variation (if needed)
|
544 |
+
if ( $product->is_type( 'variation' ) )
|
545 |
+
$item_name .= '<div style="font-size:smaller;">' . wc_get_formatted_variation( $product->variation_data, true ) . '</div>';
|
546 |
+
|
547 |
// Item Counter
|
548 |
$item_counter++;
|
549 |
|
591 |
if ( '' != get_option( 'wcj_pdf_invoices_order_shipping_method_text' ) )
|
592 |
$html .= '<p>' . get_option( 'wcj_pdf_invoices_order_shipping_method_text' ). ': ' . $the_order->get_shipping_method() . '</p>';
|
593 |
// ADDITIONAL FOOTER
|
594 |
+
if ( '' != get_option( 'wcj_pdf_invoices_footer_text' ) ) {
|
595 |
+
$additional_footer = str_replace( PHP_EOL, '<br>', get_option( 'wcj_pdf_invoices_footer_text' ) );
|
596 |
+
$additional_footer = apply_filters( 'the_content', $additional_footer );
|
597 |
+
$html .= '<p>' . $additional_footer . '</p>';
|
598 |
+
}
|
599 |
+
|
600 |
+
// ADDITIONAL HEADER
|
601 |
+
if ( '' != get_option( 'wcj_pdf_invoices_additional_header_text' ) ) {
|
602 |
+
$additional_header = str_replace( PHP_EOL, '<br>', get_option( 'wcj_pdf_invoices_additional_header_text' ) );
|
603 |
+
$additional_header = apply_filters( 'the_content', $additional_header );
|
604 |
+
$html = '<p>' . $additional_header . '</p>' . $html;
|
605 |
+
}
|
606 |
|
607 |
return $html;
|
608 |
}
|
755 |
'type' => 'number',
|
756 |
'css' => 'width:33%;min-width:300px;',
|
757 |
),
|
758 |
+
|
759 |
+
array(
|
760 |
+
'title' => __( 'Additional Header', 'woocommerce-jetpack' ),
|
761 |
+
'desc_tip' => __( 'Additional header - will be displayed above all data on invoice. You can use html and/or shortcodes here.', 'woocommerce-jetpack' ),
|
762 |
+
'id' => 'wcj_pdf_invoices_additional_header_text',
|
763 |
+
'default' => '',
|
764 |
+
'type' => 'textarea',
|
765 |
+
'css' => 'width:33%;min-width:300px;min-height:300px;',
|
766 |
+
),
|
767 |
|
768 |
array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_header_options' ),
|
769 |
|
877 |
'type' => 'text',
|
878 |
'css' => 'width:33%;min-width:300px;',
|
879 |
),
|
880 |
+
|
881 |
+
array(
|
882 |
+
'title' => __( 'Item Name Additional Info', 'woocommerce-jetpack' ),
|
883 |
+
'desc_tip' => __( 'Here you can add more info to item\'s name column (e.g. sku). Default is (SKU: %sku%)', 'woocommerce-jetpack' ),
|
884 |
+
'id' => 'wcj_pdf_invoices_column_item_name_additional_text',
|
885 |
+
'default' => __( '(SKU: %sku%)', 'woocommerce-jetpack' ),
|
886 |
+
'type' => 'textarea',
|
887 |
+
'css' => 'width:33%;min-width:300px;',
|
888 |
+
),
|
889 |
|
890 |
array(
|
891 |
'title' => __( 'Qty', 'woocommerce-jetpack' ),
|
1041 |
|
1042 |
array(
|
1043 |
'title' => __( 'Additional Footer', 'woocommerce-jetpack' ),
|
1044 |
+
'desc_tip' => __( 'Additional footer - will be displayed below all other data on invoice. You can use html and/or shortcodes here.', 'woocommerce-jetpack' ),
|
1045 |
'id' => 'wcj_pdf_invoices_footer_text',
|
1046 |
'default' => '',
|
1047 |
'type' => 'textarea',
|
includes/class-wcj-product-info.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The WooCommerce Jetpack Product Info class.
|
6 |
*
|
7 |
* @class WCJ_Product_Info
|
8 |
-
* @version 1.2.
|
9 |
* @category Class
|
10 |
* @author Algoritmika Ltd.
|
11 |
*/
|
@@ -89,9 +89,23 @@ class WCJ_Product_Info {
|
|
89 |
global $product;
|
90 |
$product_custom_fields = get_post_custom( $product->id );
|
91 |
$total_sales = ( isset( $product_custom_fields['total_sales'][0] ) ) ? $product_custom_fields['total_sales'][0] : 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
$product_info_shortcodes_array = array(
|
93 |
-
'%sku%'
|
94 |
-
'%total_sales%'
|
|
|
|
|
|
|
95 |
);
|
96 |
foreach ( $product_info_shortcodes_array as $search_for_phrase => $replace_with_phrase )
|
97 |
$the_product_info = str_replace( $search_for_phrase, $replace_with_phrase, $the_product_info );
|
@@ -135,7 +149,7 @@ class WCJ_Product_Info {
|
|
135 |
array(
|
136 |
'title' => __( 'Product Info', 'woocommerce-jetpack' ),
|
137 |
'desc' => __( 'Enable the Product Info feature', 'woocommerce-jetpack' ),
|
138 |
-
'desc_tip' => __( '
|
139 |
'id' => 'wcj_product_info_enabled',
|
140 |
'default' => 'yes',
|
141 |
'type' => 'checkbox',
|
@@ -152,8 +166,8 @@ class WCJ_Product_Info {
|
|
152 |
'id' => 'wcj_product_info_on_archive_enabled',
|
153 |
'default' => 'no',
|
154 |
'type' => 'checkbox',
|
155 |
-
),
|
156 |
-
|
157 |
array(
|
158 |
'title' => '',
|
159 |
'desc_tip' => __( 'HTML info. Predefined: %total_sales%, %sku%', 'woocommerce-jetpack' ),
|
@@ -163,6 +177,43 @@ class WCJ_Product_Info {
|
|
163 |
'css' => 'width:50%;min-width:300px;height:100px;',
|
164 |
),
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
array(
|
167 |
'title' => '',
|
168 |
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
@@ -172,7 +223,7 @@ class WCJ_Product_Info {
|
|
172 |
'default' => 'woocommerce_after_shop_loop_item_title',
|
173 |
'type' => 'select',
|
174 |
'options' => $this->product_info_on_archive_filters_array,
|
175 |
-
'desc_tip' =>
|
176 |
),
|
177 |
|
178 |
array(
|
5 |
* The WooCommerce Jetpack Product Info class.
|
6 |
*
|
7 |
* @class WCJ_Product_Info
|
8 |
+
* @version 1.2.1
|
9 |
* @category Class
|
10 |
* @author Algoritmika Ltd.
|
11 |
*/
|
89 |
global $product;
|
90 |
$product_custom_fields = get_post_custom( $product->id );
|
91 |
$total_sales = ( isset( $product_custom_fields['total_sales'][0] ) ) ? $product_custom_fields['total_sales'][0] : 0;
|
92 |
+
/*$you_save = 0;
|
93 |
+
$you_save_percent = 0;
|
94 |
+
if ( $product->is_on_sale() ) {
|
95 |
+
$you_save = $product->get_regular_price() - $product->get_sale_price();
|
96 |
+
if ( 0 != $product->get_regular_price() )
|
97 |
+
$you_save_percent = intval( $you_save / $product->get_regular_price() * 100 );
|
98 |
+
}
|
99 |
+
*/
|
100 |
+
/*//$available_variations = '';
|
101 |
+
//if ( 'variable' === $product->product_type )
|
102 |
+
$available_variations = $product->list_attributes();// $product->get_formatted_name();// print_r( $product->get_available_variations() );*/
|
103 |
$product_info_shortcodes_array = array(
|
104 |
+
'%sku%' => $product->get_sku(),
|
105 |
+
'%total_sales%' => $total_sales,
|
106 |
+
//'%you_save%' => wc_price( $you_save ),
|
107 |
+
//'%you_save_percent%' => $you_save_percent . '%',
|
108 |
+
//'%available_variations%' => $available_variations,
|
109 |
);
|
110 |
foreach ( $product_info_shortcodes_array as $search_for_phrase => $replace_with_phrase )
|
111 |
$the_product_info = str_replace( $search_for_phrase, $replace_with_phrase, $the_product_info );
|
149 |
array(
|
150 |
'title' => __( 'Product Info', 'woocommerce-jetpack' ),
|
151 |
'desc' => __( 'Enable the Product Info feature', 'woocommerce-jetpack' ),
|
152 |
+
'desc_tip' => __( 'Add additional info to product, change related products number.', 'woocommerce-jetpack' ),
|
153 |
'id' => 'wcj_product_info_enabled',
|
154 |
'default' => 'yes',
|
155 |
'type' => 'checkbox',
|
166 |
'id' => 'wcj_product_info_on_archive_enabled',
|
167 |
'default' => 'no',
|
168 |
'type' => 'checkbox',
|
169 |
+
),
|
170 |
+
|
171 |
array(
|
172 |
'title' => '',
|
173 |
'desc_tip' => __( 'HTML info. Predefined: %total_sales%, %sku%', 'woocommerce-jetpack' ),
|
177 |
'css' => 'width:50%;min-width:300px;height:100px;',
|
178 |
),
|
179 |
|
180 |
+
/*
|
181 |
+
array(
|
182 |
+
'title' => '',
|
183 |
+
'desc_tip' => __( '"You save" information for products on sale.', 'woocommerce-jetpack' ),
|
184 |
+
'id' => 'wcj_product_info_on_archive_you_save',
|
185 |
+
'default' => '<p>You save: %you_save% (%you_save_percent%)</p>',
|
186 |
+
'type' => 'textarea',
|
187 |
+
'css' => 'width:30%;min-width:300px;',
|
188 |
+
),
|
189 |
+
|
190 |
+
array(
|
191 |
+
'title' => '',
|
192 |
+
'desc_tip' => __( '"You save" information for products on sale.', 'woocommerce-jetpack' ),
|
193 |
+
'id' => 'wcj_product_info_on_archive_you_save_priority',
|
194 |
+
'default' => '<p>You save: %you_save% (%you_save_percent%)</p>',
|
195 |
+
'type' => 'number',
|
196 |
+
),
|
197 |
+
|
198 |
+
array(
|
199 |
+
'title' => '',
|
200 |
+
'desc_tip' => __( 'Product\'s total sales counter.', 'woocommerce-jetpack' ),
|
201 |
+
'id' => 'wcj_product_info_on_archive_total_sales',
|
202 |
+
'default' => '<p>Total sales: %total_sales%</p>',
|
203 |
+
'type' => 'textarea',
|
204 |
+
'css' => 'width:30%;min-width:300px;',
|
205 |
+
),
|
206 |
+
|
207 |
+
array(
|
208 |
+
'title' => '',
|
209 |
+
'desc_tip' => __( 'SKU.', 'woocommerce-jetpack' ),
|
210 |
+
'id' => 'wcj_product_info_on_archive_sku',
|
211 |
+
'default' => '<p>SKU: %sku%</p>',
|
212 |
+
'type' => 'textarea',
|
213 |
+
'css' => 'width:30%;min-width:300px;',
|
214 |
+
),
|
215 |
+
*/
|
216 |
+
|
217 |
array(
|
218 |
'title' => '',
|
219 |
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
223 |
'default' => 'woocommerce_after_shop_loop_item_title',
|
224 |
'type' => 'select',
|
225 |
'options' => $this->product_info_on_archive_filters_array,
|
226 |
+
'desc_tip' => true,
|
227 |
),
|
228 |
|
229 |
array(
|
includes/class-wcj-product-input-fields.php
CHANGED
@@ -52,11 +52,24 @@ class WCJ_Product_Custom_Input {
|
|
52 |
// Check that we are saving with input fields displayed.
|
53 |
if ( ! isset( $_POST['woojetpack_input_fields_save_post'] ) )
|
54 |
return;
|
55 |
-
//
|
56 |
-
$option_name = '
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
|
62 |
/**
|
@@ -70,6 +83,9 @@ class WCJ_Product_Custom_Input {
|
|
70 |
* create_custom_input_fields_meta_box.
|
71 |
*/
|
72 |
public function create_custom_input_fields_meta_box() {
|
|
|
|
|
|
|
73 |
$html = '<h4>' . __( 'Text Fields', 'woocommerce-jetpack' ) . '</h4>';
|
74 |
$html .= '<table style="width:100%;">';
|
75 |
|
52 |
// Check that we are saving with input fields displayed.
|
53 |
if ( ! isset( $_POST['woojetpack_input_fields_save_post'] ) )
|
54 |
return;
|
55 |
+
// Save: total custom text input fields number
|
56 |
+
$option_name = 'wcj_input_fields_text_local_total_number';
|
57 |
+
$total_text_input_fields = isset( $_POST[ $option_name ] ) ? $_POST[ $option_name ] : apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_input_fields_text_local_total_number_default', 1 ) );
|
58 |
+
update_post_meta( $post_id, '_' . $option_name, $_POST[ $option_name ] );
|
59 |
+
// Save: enabled, required, title
|
60 |
+
$option_names = array(
|
61 |
+
'wcj_input_fields_text_enabled_local_',
|
62 |
+
'wcj_input_fields_text_required_local_',
|
63 |
+
'wcj_input_fields_text_title_local_',
|
64 |
+
);
|
65 |
+
for ( $i = 1; $i <= $total_text_input_fields; $i++ ) {
|
66 |
+
foreach ( $option_names as $option_name ) {
|
67 |
+
if ( isset( $_POST[ $option_name . $i ] ) )
|
68 |
+
update_post_meta( $post_id, '_' . $option_name . $i, $_POST[ $option_name . $i ] );
|
69 |
+
else if ( 'wcj_input_fields_text_title_local_' != $option_name )
|
70 |
+
update_post_meta( $post_id, '_' . $option_name . $i, 'off' );
|
71 |
+
}
|
72 |
+
}
|
73 |
}
|
74 |
|
75 |
/**
|
83 |
* create_custom_input_fields_meta_box.
|
84 |
*/
|
85 |
public function create_custom_input_fields_meta_box() {
|
86 |
+
|
87 |
+
//$number_of_text_fields_to_add = 2;
|
88 |
+
|
89 |
$html = '<h4>' . __( 'Text Fields', 'woocommerce-jetpack' ) . '</h4>';
|
90 |
$html .= '<table style="width:100%;">';
|
91 |
|
includes/class-wcj-reports.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* The WooCommerce Jetpack Reports class.
|
6 |
*
|
7 |
* @class WCJ_Reports
|
8 |
-
* @version 1.1.2
|
9 |
* @category Class
|
10 |
* @author Algoritmika Ltd.
|
11 |
*/
|
@@ -33,6 +33,63 @@ class WCJ_Reports {
|
|
33 |
add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) ); // Add section to WooCommerce > Settings > Jetpack
|
34 |
add_filter( 'wcj_settings_reports', array( $this, 'get_settings' ), 100 ); // Add the settings
|
35 |
add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 ); // Add Enable option to Jetpack Settings Dashboard
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
/**
|
@@ -115,7 +172,9 @@ class WCJ_Reports {
|
|
115 |
$the_title = get_the_title();
|
116 |
$the_date = get_the_date();
|
117 |
$the_permalink = get_the_permalink();
|
118 |
-
|
|
|
|
|
119 |
|
120 |
$products_info[$the_ID] = array(
|
121 |
'ID' => $the_ID,
|
5 |
* The WooCommerce Jetpack Reports class.
|
6 |
*
|
7 |
* @class WCJ_Reports
|
8 |
+
* @version 1.1.2.1
|
9 |
* @category Class
|
10 |
* @author Algoritmika Ltd.
|
11 |
*/
|
33 |
add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) ); // Add section to WooCommerce > Settings > Jetpack
|
34 |
add_filter( 'wcj_settings_reports', array( $this, 'get_settings' ), 100 ); // Add the settings
|
35 |
add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 ); // Add Enable option to Jetpack Settings Dashboard
|
36 |
+
|
37 |
+
|
38 |
+
add_filter( 'woocommerce_admin_reports', array( $this, 'add_customers_by_country_report' ) );
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* prepare_items function.
|
44 |
+
*/
|
45 |
+
public function prepare_items() {
|
46 |
+
|
47 |
+
|
48 |
+
//$customers = get_users( 'orderby=nicename&role=customer' );
|
49 |
+
$customers = get_users( 'role=customer' );
|
50 |
+
// Array of WP_User objects.
|
51 |
+
foreach ( $customers as $customer ) {
|
52 |
+
//print_r( $user );
|
53 |
+
//print_r( get_user_meta( $user->ID ) );
|
54 |
+
$user_meta = get_user_meta( $customer->ID );
|
55 |
+
$customer_country = isset( $user_meta['billing_country'][0] ) ? $user_meta['billing_country'][0] : 'UNKNOWN';
|
56 |
+
//echo "<p>$customer_country</p>";
|
57 |
+
$country_counter[ $customer_country ]++;
|
58 |
+
}
|
59 |
+
|
60 |
+
echo '<pre>';
|
61 |
+
print_r( $country_counter );
|
62 |
+
echo '</pre>';
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Add tab to WooCommerce > Jetpack Tools.
|
67 |
+
*/
|
68 |
+
public function add_customers_by_country_report( $reports ) {
|
69 |
+
$reports['wcj_reports'] = array(
|
70 |
+
'title' => __( 'WooCommerce Jetpack Reports', 'woocommerce-jetpack' ),
|
71 |
+
'reports' => array(
|
72 |
+
'customers_by_country' => array(
|
73 |
+
'title' => __( 'Customers By Country', 'woocommerce' ),
|
74 |
+
'description' => '',
|
75 |
+
'hide_title' => true,
|
76 |
+
'callback' => array( $this, 'get_report' ),
|
77 |
+
),
|
78 |
+
),
|
79 |
+
);
|
80 |
+
|
81 |
+
$reports['customers']['reports']['customers_by_country'] = array(
|
82 |
+
'title' => __( 'Customers By Country', 'woocommerce-jetpack' ),
|
83 |
+
'description' => '',
|
84 |
+
'hide_title' => true,
|
85 |
+
'callback' => array( $this, 'get_report' ),
|
86 |
+
);
|
87 |
+
|
88 |
+
return $reports;
|
89 |
+
}
|
90 |
+
|
91 |
+
public function get_report() {
|
92 |
+
$this->prepare_items();
|
93 |
}
|
94 |
|
95 |
/**
|
172 |
$the_title = get_the_title();
|
173 |
$the_date = get_the_date();
|
174 |
$the_permalink = get_the_permalink();
|
175 |
+
|
176 |
+
$post_custom = get_post_custom( $the_ID );
|
177 |
+
$total_sales = $post_custom['total_sales'][0];
|
178 |
|
179 |
$products_info[$the_ID] = array(
|
180 |
'ID' => $the_ID,
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://algoritmika.com/donate/
|
|
4 |
Tags: woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,email pdf invoice,pdf invoice,pdf invoices,already in cart,empty cart,redirect to checkout,minimum order amount,customize checkout fields,checkout fields,email,customize product tabs,product tabs,related products number,empty cart,redirect add to cart,redirect to checkout,product already in cart,custom payment gateway,payment gateway icon,auto-complete all orders,custom order statuses,custom order status,remove text from price,custom css,hide categories count,hide subcategories count,hide category count,hide subcategory count,display total sales,custom product tabs,remove product tab,
|
5 |
Requires at least: 3.9.1
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 1.8.
|
8 |
License: GNU General Public License v3.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -70,16 +70,21 @@ Please let us know if you want anything added to list by <a href="http://woojetp
|
|
70 |
If you wish that some task would go up the queue to make it faster, please contact us by <a href="http://woojetpack.com/contact-us/">filling this form</a>. We are listening carefully to our users!
|
71 |
|
72 |
= 1.9.0 - XX/10/2014 =
|
73 |
-
*
|
74 |
* Upgrade Feature - PDF Invoices - Make emailing PDF as attachment option available for certain payment methods only (user selection). Idea by Jen.
|
75 |
* Upgrade Feature - PDF Invoices - Sending invoice on customer's request. Idea by Jen.
|
|
|
|
|
|
|
76 |
* New Feature - Checkout to PDF (wish list). Idea by Mick.
|
77 |
-
* Upgrade Feature - Checkout - Extra fee (e.g. for PayPal).
|
|
|
78 |
* New Feature - Custom Product Input Fields - Fields to fill before adding product to cart. Idea by Mangesh.
|
79 |
-
|
80 |
-
= 1.X.X - XX/11/2014 =
|
81 |
* New Feature - Smart Reports - Various reports based on products prices, sales, stock, customers.
|
82 |
* New Feature - Add second currency to the price.
|
|
|
|
|
|
|
83 |
* New Feature - Products per Page - Add "products per page" option for customers (i.e. front end).
|
84 |
* Upgrade Feature - Shipping - Add "Custom Shipping Method".
|
85 |
* Upgrade Feature - PDF Invoices - Separate numbering for invoices option, then can add `add_order_number_to_invoice` option.
|
@@ -92,13 +97,10 @@ If you wish that some task would go up the queue to make it faster, please conta
|
|
92 |
* Upgrade Feature - Smart Reports - Export to CSV file.
|
93 |
* Upgrade Feature - Call for Price - Call for price for variable products (all variations or only some).
|
94 |
* Upgrade Feature - Custom Statuses - Bulk change status.
|
95 |
-
* Upgrade Feature - Custom Price Labels - ?Add "local remove".
|
96 |
* Upgrade Feature - Orders - Bulk orders i.e. "Buy More - Pay Less". Start from global discount for all products, i.e. cart discount; later - discounts for individual products.
|
97 |
* Upgrade Feature - Custom Price Labels - Add different labels for archives, single, homepage, related. Add option to select which price hooks to use. Different labels for variable and variation.
|
98 |
* Upgrade Feature - Custom Price Labels - Custom free price.
|
99 |
* Upgrade Feature - Checkout - Custom checkout fields.
|
100 |
-
* Upgrade Feature - Checkout - Skrill.
|
101 |
-
* Upgrade Feature - Checkout - Amazon Payments.
|
102 |
* Upgrade Feature - Orders - Maximum weight - "Contact us" to place order with products total weight over some amount.
|
103 |
* Upgrade Feature - Sorting - Add sorting by popularity in e.g. 90 days (not by `total_sales` as it is by default in WooCommerce).
|
104 |
* New Feature - Integrating Amazon FBA inventory into WooCommerce.
|
@@ -115,7 +117,6 @@ If you wish that some task would go up the queue to make it faster, please conta
|
|
115 |
|
116 |
= More Ideas =
|
117 |
* Different prices for different countries (WPML?). Suggested by Daniele.
|
118 |
-
* Product Info on Archive Pages option within Woo Jetpack to list the different colour variations of a product on the category sections. Idea by Tony.
|
119 |
* Ideas by Jean-Marc:
|
120 |
- PDF invoice: Sequential invoice numbers: different than the order number. could use woocomerce santard order number and special invoice number,
|
121 |
- Choose starting point for invoice numbers,
|
@@ -130,6 +131,15 @@ If you wish that some task would go up the queue to make it faster, please conta
|
|
130 |
|
131 |
== Changelog ==
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
= 1.8.0 - 17/10/2014 =
|
134 |
* New Feature - Product Tabs - **Custom product tabs** - global or per product.
|
135 |
Related *product tabs* options were also moved to this feature from *Product Info*.
|
@@ -146,7 +156,7 @@ If you wish that some task would go up the queue to make it faster, please conta
|
|
146 |
|
147 |
= 1.7.7 - 13/10/2014 =
|
148 |
* Fix - Custom Price Labels - Bug causing setting checkboxes back to *on*, fixed. Suggested by Erika.
|
149 |
-
* Fix - Custom Price Labels -
|
150 |
|
151 |
= 1.7.6 - 09/10/2014 =
|
152 |
* Fix - Custom Price Labels - Bug causing setting all product's checkbox labels to off, fixed.
|
4 |
Tags: woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,email pdf invoice,pdf invoice,pdf invoices,already in cart,empty cart,redirect to checkout,minimum order amount,customize checkout fields,checkout fields,email,customize product tabs,product tabs,related products number,empty cart,redirect add to cart,redirect to checkout,product already in cart,custom payment gateway,payment gateway icon,auto-complete all orders,custom order statuses,custom order status,remove text from price,custom css,hide categories count,hide subcategories count,hide category count,hide subcategory count,display total sales,custom product tabs,remove product tab,
|
5 |
Requires at least: 3.9.1
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 1.8.1
|
8 |
License: GNU General Public License v3.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
70 |
If you wish that some task would go up the queue to make it faster, please contact us by <a href="http://woojetpack.com/contact-us/">filling this form</a>. We are listening carefully to our users!
|
71 |
|
72 |
= 1.9.0 - XX/10/2014 =
|
73 |
+
* Fix - Crash report - https://wordpress.org/support/topic/crash-15?replies=2#post-
|
74 |
* Upgrade Feature - PDF Invoices - Make emailing PDF as attachment option available for certain payment methods only (user selection). Idea by Jen.
|
75 |
* Upgrade Feature - PDF Invoices - Sending invoice on customer's request. Idea by Jen.
|
76 |
+
* Upgrade Feature - PDF Invoices - Bilingual invoice. Idea by Tudor Mateescu.
|
77 |
+
* Upgrade Feature - PDF Invoices - Second currency in invoice. Idea by Tudor Mateescu.
|
78 |
+
* Upgrade Feature - Shipping - Advance free shipping - Free shipping for multiple country/places. Each country/places different prices. Idea by LQTOYS.
|
79 |
* New Feature - Checkout to PDF (wish list). Idea by Mick.
|
80 |
+
* Upgrade Feature - Checkout - Extra fee (e.g. for PayPal). Idea by Daniele.
|
81 |
+
* Product Info on Archive Pages option within WooJetpack to list the different colour variations of a product on the category sections. Idea by Tony.
|
82 |
* New Feature - Custom Product Input Fields - Fields to fill before adding product to cart. Idea by Mangesh.
|
|
|
|
|
83 |
* New Feature - Smart Reports - Various reports based on products prices, sales, stock, customers.
|
84 |
* New Feature - Add second currency to the price.
|
85 |
+
|
86 |
+
= 1.X.X - XX/11/2014 =
|
87 |
+
|
88 |
* New Feature - Products per Page - Add "products per page" option for customers (i.e. front end).
|
89 |
* Upgrade Feature - Shipping - Add "Custom Shipping Method".
|
90 |
* Upgrade Feature - PDF Invoices - Separate numbering for invoices option, then can add `add_order_number_to_invoice` option.
|
97 |
* Upgrade Feature - Smart Reports - Export to CSV file.
|
98 |
* Upgrade Feature - Call for Price - Call for price for variable products (all variations or only some).
|
99 |
* Upgrade Feature - Custom Statuses - Bulk change status.
|
|
|
100 |
* Upgrade Feature - Orders - Bulk orders i.e. "Buy More - Pay Less". Start from global discount for all products, i.e. cart discount; later - discounts for individual products.
|
101 |
* Upgrade Feature - Custom Price Labels - Add different labels for archives, single, homepage, related. Add option to select which price hooks to use. Different labels for variable and variation.
|
102 |
* Upgrade Feature - Custom Price Labels - Custom free price.
|
103 |
* Upgrade Feature - Checkout - Custom checkout fields.
|
|
|
|
|
104 |
* Upgrade Feature - Orders - Maximum weight - "Contact us" to place order with products total weight over some amount.
|
105 |
* Upgrade Feature - Sorting - Add sorting by popularity in e.g. 90 days (not by `total_sales` as it is by default in WooCommerce).
|
106 |
* New Feature - Integrating Amazon FBA inventory into WooCommerce.
|
117 |
|
118 |
= More Ideas =
|
119 |
* Different prices for different countries (WPML?). Suggested by Daniele.
|
|
|
120 |
* Ideas by Jean-Marc:
|
121 |
- PDF invoice: Sequential invoice numbers: different than the order number. could use woocomerce santard order number and special invoice number,
|
122 |
- Choose starting point for invoice numbers,
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 1.8.1 - 24/10/2014 =
|
135 |
+
* Fix - PDF Invoices - Variation(s) name was not showing in invoice, fixed.
|
136 |
+
Reported by https://wordpress.org/support/topic/item-description?replies=4
|
137 |
+
* Feature Upgraded - PDF Invoices - Now shortcodes are displayed in invoice's additional header and footer.
|
138 |
+
Idea by https://wordpress.org/support/topic/displaying-short-codes?replies=3
|
139 |
+
* Feature Upgraded - PDF Invoices - Additional header option added.
|
140 |
+
* Feature Upgraded - PDF Invoices - *Item Name Additional Info* (e.g. SKU) option added to invoice.
|
141 |
+
Idea by https://wordpress.org/support/topic/item-description?replies=4
|
142 |
+
|
143 |
= 1.8.0 - 17/10/2014 =
|
144 |
* New Feature - Product Tabs - **Custom product tabs** - global or per product.
|
145 |
Related *product tabs* options were also moved to this feature from *Product Info*.
|
156 |
|
157 |
= 1.7.7 - 13/10/2014 =
|
158 |
* Fix - Custom Price Labels - Bug causing setting checkboxes back to *on*, fixed. Suggested by Erika.
|
159 |
+
* Fix - Custom Price Labels - *Migrate from Custom Price Labels (Pro)* tool - new since Custom Price Labels plugin data was missing, fixed. Suggested by Paolo.
|
160 |
|
161 |
= 1.7.6 - 09/10/2014 =
|
162 |
* Fix - Custom Price Labels - Bug causing setting all product's checkbox labels to off, fixed.
|
woocommerce-jetpack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WooCommerce Jetpack
|
4 |
Plugin URI: http://woojetpack.com
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features.
|
6 |
-
Version: 1.8.
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: http://www.algoritmika.com
|
9 |
Copyright: © 2014 Algoritmika Ltd.
|
3 |
Plugin Name: WooCommerce Jetpack
|
4 |
Plugin URI: http://woojetpack.com
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features.
|
6 |
+
Version: 1.8.1
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: http://www.algoritmika.com
|
9 |
Copyright: © 2014 Algoritmika Ltd.
|