Version Description
- 23/03/2016 =
- Dev - "Booster Currencies Array" (wcj-currencies.php) updated.
- Dev -
wcj_get_currencies_names_and_symbols()
andwcj_get_currency_symbol()
functions modified. - Fix - "http" removed in exchange_rates.js. Fixes bug when loading https.
- Dev - Shortcodes - Orders -
[wcj_order_items_table]
-item_product_input_fields
anditem_key=
options (columns) added. - Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Shipping (taxable) calculation fixed.
- Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Wrong currency in emails bug fixed (again).
- Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Autogenerate Groups -
UK
changed toGB
inwcj_get_country_currency()
. - Dev - PRICES & CURRENCIES - Prices and Currencies by Country - "Countries Selection" admin option added.
- Fix - PRICES & CURRENCIES - Currency for External Products -
change_currency_code()
added. - Dev - PRICES & CURRENCIES - Currency for External Products - Custom currencies added to the list.
- Dev - PRICES & CURRENCIES - Currency for External Products - "Reset settings" button added.
- Dev - PRICES & CURRENCIES - Bulk Price Converter - "Price type to modify" functionality added to the Bulk Price Converter tool.
- Dev - PRICES & CURRENCIES - Bulk Price Converter - "None" product category added to the Bulk Price Converter tool.
- Dev - PRICES & CURRENCIES - Bulk Price Converter - "Pretty price" functionality added to the Bulk Price Converter tool.
- Fix - PRICES & CURRENCIES - Currency Exchange Rates - Only enabled modules currencies are added to the list.
- Fix - PRICES & CURRENCIES - Currency Exchange Rates -
no_changes
currency bug fixed. - Fix - PRICES & CURRENCIES - Multicurrency and Currency Exchange Rates - Currency pairs added to Currency Exchange Rates module.
- Dev - BUTTON & PRICE LABELS - Custom Price Labels - WooCommerce Subscription products support added.
- Dev - PRODUCTS - Product Tabs - "CATEGORIES to HIDE this tab" and "CATEGORIES to SHOW this tab" options added, instead of depreciated "Comma separated CATEGORY IDs..." options.
- Dev - PRODUCTS - Product Tabs - "PRODUCTS to HIDE this tab" and "PRODUCTS to SHOW this tab" options added, instead of depreciated "Comma separated PRODUCT IDs..." options.
- Dev - PRODUCTS - Product Tabs - "TAGS to HIDE this tab" and "TAGS to SHOW this tab" options added.
- Dev - PRODUCTS - Product Tabs - "Reset settings" button added.
- Dev - PAYMENT GATEWAYS - Gateways by Country or State - "Include States (Base Country)" and "Exclude States (Base Country)" options added.
- Dev - SHIPPING & ORDERS - Shipping - "Left to free shipping" functionality added (including widget and shortcode).
- Dev - SHIPPING & ORDERS - Shipping - Code refactoring.
- Dev - SHIPPING & ORDERS - Order Numbers - "Use MySQL Transaction" option added to admin settings. This will ensure no duplicated order numbers for shops with large number of simultaneous orders (sequential).
- Dev - SHIPPING & ORDERS - Order Numbers - "Orders Renumerate" tool code refactoring.
- Fix - PDF Invoicing - Header - "Default Images Directory" option added (
K_PATH_IMAGES
intcpdf_config.php
). - Dev - EMAILS & MISC. - WPML - wpml-config.xml file updated.
- Dev - EMAILS & MISC. - WPML - "Regenerate wpml-config.xml file" tool optimized for speed.
- Fix - EMAILS & MISC. - WPML - "Regenerate wpml-config.xml file" link fixed.
- Fix - EMAILS & MISC. - WPML - "Regenerate wpml-config.xml file" tool bug fixed.
Download this release
Release Info
Developer | algoritmika |
Plugin | Booster for WooCommerce |
Version | 2.4.4 |
Comparing to | |
See all releases |
Code changes from version 2.4.3 to 2.4.4
- includes/class-wcj-cart.php +3 -29
- includes/class-wcj-currencies.php +21 -32
- includes/class-wcj-currency-exchange-rates.php +30 -11
- includes/class-wcj-currency-external-products.php +26 -23
- includes/class-wcj-order-numbers.php +40 -9
- includes/class-wcj-payment-gateways-by-country.php +47 -5
- includes/class-wcj-price-by-country.php +70 -28
- includes/class-wcj-price-labels.php +30 -7
- includes/class-wcj-product-bulk-price-converter.php +111 -76
- includes/class-wcj-product-tabs.php +206 -67
- includes/class-wcj-shipping.php +283 -154
- includes/class-wcj-wpml.php +34 -22
- includes/currencies/wcj-currencies.php +172 -166
- includes/exchange-rates/class-wcj-exchange-rates-crons.php +27 -19
- includes/functions/wcj-country-functions.php +16 -1
- includes/functions/wcj-functions.php +174 -32
- includes/js/exchange_rates.js +3 -3
- includes/lib/tcpdf_min/config/tcpdf_config.php +15 -3
- includes/pdf-invoices/settings/class-wcj-pdf-invoicing-header.php +29 -2
- includes/price-by-country/class-wcj-price-by-country-core.php +25 -6
- includes/price-by-country/class-wcj-price-by-country-group-generator.php +13 -3
- includes/price-by-country/class-wcj-price-by-country-local.php +14 -2
- includes/price-by-country/wcj-country-currency.php +4 -3
- includes/shortcodes/class-wcj-general-shortcodes.php +14 -2
- includes/shortcodes/class-wcj-order-items-shortcodes.php +13 -3
- includes/widgets/class-wcj-widget-left-to-free-shipping.php +87 -0
- readme.txt +35 -1
- woocommerce-jetpack.php +8 -4
- wpml-config.xml +253 -4
includes/class-wcj-cart.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Cart class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -93,7 +93,7 @@ class WCJ_Cart extends WCJ_Module {
|
|
93 |
/**
|
94 |
* get_settings.
|
95 |
*
|
96 |
-
* @version 2.
|
97 |
*/
|
98 |
function get_settings() {
|
99 |
|
@@ -155,33 +155,7 @@ class WCJ_Cart extends WCJ_Module {
|
|
155 |
'id' => 'wcj_cart_custom_info_hook_' . $i,
|
156 |
'default' => 'woocommerce_after_cart_totals',
|
157 |
'type' => 'select',
|
158 |
-
'options' =>
|
159 |
-
|
160 |
-
'woocommerce_before_cart' => __( 'Before cart', 'woocommerce-jetpack' ),
|
161 |
-
'woocommerce_before_cart_table' => __( 'Before cart table', 'woocommerce-jetpack' ),
|
162 |
-
'woocommerce_before_cart_contents' => __( 'Before cart contents', 'woocommerce-jetpack' ),
|
163 |
-
'woocommerce_cart_contents' => __( 'Cart contents', 'woocommerce-jetpack' ),
|
164 |
-
'woocommerce_cart_coupon' => __( 'Cart coupon', 'woocommerce-jetpack' ),
|
165 |
-
'woocommerce_cart_actions' => __( 'Cart actions', 'woocommerce-jetpack' ),
|
166 |
-
'woocommerce_after_cart_contents' => __( 'After cart contents', 'woocommerce-jetpack' ),
|
167 |
-
'woocommerce_after_cart_table' => __( 'After cart table', 'woocommerce-jetpack' ),
|
168 |
-
'woocommerce_cart_collaterals' => __( 'Cart collaterals', 'woocommerce-jetpack' ),
|
169 |
-
'woocommerce_after_cart' => __( 'After cart', 'woocommerce-jetpack' ),
|
170 |
-
|
171 |
-
'woocommerce_before_cart_totals' => __( 'Before cart totals', 'woocommerce-jetpack' ),
|
172 |
-
'woocommerce_cart_totals_before_shipping' => __( 'Cart totals: Before shipping', 'woocommerce-jetpack' ),
|
173 |
-
'woocommerce_cart_totals_after_shipping' => __( 'Cart totals: After shipping', 'woocommerce-jetpack' ),
|
174 |
-
'woocommerce_cart_totals_before_order_total' => __( 'Cart totals: Before order total', 'woocommerce-jetpack' ),
|
175 |
-
'woocommerce_cart_totals_after_order_total' => __( 'Cart totals: After order total', 'woocommerce-jetpack' ),
|
176 |
-
'woocommerce_proceed_to_checkout' => __( 'Proceed to checkout', 'woocommerce-jetpack' ),
|
177 |
-
'woocommerce_after_cart_totals' => __( 'After cart totals', 'woocommerce-jetpack' ),
|
178 |
-
|
179 |
-
'woocommerce_before_shipping_calculator' => __( 'Before shipping calculator', 'woocommerce-jetpack' ),
|
180 |
-
'woocommerce_after_shipping_calculator' => __( 'After shipping calculator', 'woocommerce-jetpack' ),
|
181 |
-
|
182 |
-
'woocommerce_cart_is_empty' => __( 'If cart is empty', 'woocommerce-jetpack' ),
|
183 |
-
|
184 |
-
),
|
185 |
'css' => 'width:250px;',
|
186 |
),
|
187 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Cart class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
93 |
/**
|
94 |
* get_settings.
|
95 |
*
|
96 |
+
* @version 2.4.4
|
97 |
*/
|
98 |
function get_settings() {
|
99 |
|
155 |
'id' => 'wcj_cart_custom_info_hook_' . $i,
|
156 |
'default' => 'woocommerce_after_cart_totals',
|
157 |
'type' => 'select',
|
158 |
+
'options' => wcj_get_cart_filters(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
'css' => 'width:250px;',
|
160 |
),
|
161 |
|
includes/class-wcj-currencies.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack currencies class stores currencies data.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_Currencies extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
@@ -26,36 +26,21 @@ class WCJ_Currencies extends WCJ_Module {
|
|
26 |
$this->desc = __( 'Add all world currencies to your WooCommerce store; change currency symbol.', 'woocommerce-jetpack' );
|
27 |
parent::__construct();
|
28 |
|
29 |
-
$currencies = include( 'currencies/wcj-currencies.php' );
|
30 |
-
foreach( $currencies as $data ) {
|
31 |
-
$this->currency_symbols[ $data['code'] ] = $data['symbol'];
|
32 |
-
$this->currency_names[ $data['code'] ] = $data['name'];
|
33 |
-
}
|
34 |
-
|
35 |
-
$custom_currency_total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
|
36 |
-
for ( $i = 1; $i <= $custom_currency_total_number; $i++) {
|
37 |
-
$custom_currency_code = get_option( 'wcj_currency_custom_currency_code_' . $i );
|
38 |
-
$custom_currency_name = get_option( 'wcj_currency_custom_currency_name_' . $i );
|
39 |
-
$custom_currency_symbol = get_option( 'wcj_currency_custom_currency_symbol_' . $i );
|
40 |
-
if ( '' != $custom_currency_code && '' != $custom_currency_name /* && '' != $custom_currency_symbol */ ) {
|
41 |
-
$this->currency_names[ $custom_currency_code ] = $custom_currency_name;
|
42 |
-
$this->currency_symbols[ $custom_currency_code ] = $custom_currency_symbol;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
if ( $this->is_enabled() ) {
|
47 |
-
add_filter( 'woocommerce_currencies',
|
48 |
-
add_filter( 'woocommerce_currency_symbol',
|
49 |
-
|
50 |
-
add_filter( 'woocommerce_general_settings', array( $this, 'add_edit_currency_symbol_field' ), 100 );
|
51 |
}
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
-
* add_all_currencies.
|
|
|
|
|
56 |
*/
|
57 |
function add_all_currencies( $currencies ) {
|
58 |
-
|
|
|
59 |
$currencies[ $currency_code ] = $currency_name;
|
60 |
}
|
61 |
asort( $currencies );
|
@@ -63,14 +48,16 @@ class WCJ_Currencies extends WCJ_Module {
|
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
-
*
|
|
|
|
|
67 |
*/
|
68 |
-
function
|
69 |
if ( 'yes' === get_option( 'wcj_currency_hide_symbol' ) ) {
|
70 |
return '';
|
71 |
}
|
72 |
-
|
73 |
-
return
|
74 |
}
|
75 |
|
76 |
/**
|
@@ -101,7 +88,7 @@ class WCJ_Currencies extends WCJ_Module {
|
|
101 |
/**
|
102 |
* get_settings.
|
103 |
*
|
104 |
-
* @version 2.4.
|
105 |
*/
|
106 |
function get_settings() {
|
107 |
|
@@ -123,12 +110,14 @@ class WCJ_Currencies extends WCJ_Module {
|
|
123 |
),
|
124 |
);
|
125 |
|
126 |
-
|
|
|
|
|
127 |
$settings[] = array(
|
128 |
'title' => $currency_name,
|
129 |
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
|
130 |
'id' => 'wcj_currency_' . $currency_code,
|
131 |
-
'default' => $
|
132 |
'type' => 'text',
|
133 |
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
134 |
);
|
4 |
*
|
5 |
* The WooCommerce Jetpack currencies class stores currencies data.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.4
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
26 |
$this->desc = __( 'Add all world currencies to your WooCommerce store; change currency symbol.', 'woocommerce-jetpack' );
|
27 |
parent::__construct();
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
if ( $this->is_enabled() ) {
|
30 |
+
add_filter( 'woocommerce_currencies', array( $this, 'add_all_currencies'), PHP_INT_MAX );
|
31 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol'), PHP_INT_MAX, 2 );
|
32 |
+
add_filter( 'woocommerce_general_settings', array( $this, 'add_edit_currency_symbol_field' ), PHP_INT_MAX );
|
|
|
33 |
}
|
34 |
}
|
35 |
|
36 |
/**
|
37 |
+
* add_all_currencies - changing currency code.
|
38 |
+
*
|
39 |
+
* @version 2.4.4
|
40 |
*/
|
41 |
function add_all_currencies( $currencies ) {
|
42 |
+
$currency_names = wcj_get_currencies_names_and_symbols( 'names' );
|
43 |
+
foreach ( $currency_names as $currency_code => $currency_name ) {
|
44 |
$currencies[ $currency_code ] = $currency_name;
|
45 |
}
|
46 |
asort( $currencies );
|
48 |
}
|
49 |
|
50 |
/**
|
51 |
+
* change_currency_symbol.
|
52 |
+
*
|
53 |
+
* @version 2.4.4
|
54 |
*/
|
55 |
+
function change_currency_symbol( $currency_symbol, $currency ) {
|
56 |
if ( 'yes' === get_option( 'wcj_currency_hide_symbol' ) ) {
|
57 |
return '';
|
58 |
}
|
59 |
+
// return apply_filters( 'wcj_get_option_filter', wcj_get_currency_symbol( $currency ), get_option( 'wcj_currency_' . $currency, $currency_symbol ) ); // TODO: custom currency
|
60 |
+
return wcj_get_currency_symbol( $currency );
|
61 |
}
|
62 |
|
63 |
/**
|
88 |
/**
|
89 |
* get_settings.
|
90 |
*
|
91 |
+
* @version 2.4.4
|
92 |
*/
|
93 |
function get_settings() {
|
94 |
|
110 |
),
|
111 |
);
|
112 |
|
113 |
+
$currency_names = wcj_get_currencies_names_and_symbols( 'names', 'no_custom' );
|
114 |
+
$currency_symbols = wcj_get_currencies_names_and_symbols( 'symbols', 'no_custom' );
|
115 |
+
foreach ( $currency_names as $currency_code => $currency_name ) {
|
116 |
$settings[] = array(
|
117 |
'title' => $currency_name,
|
118 |
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
|
119 |
'id' => 'wcj_currency_' . $currency_code,
|
120 |
+
'default' => $currency_symbols[ $currency_code ],
|
121 |
'type' => 'text',
|
122 |
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
123 |
);
|
includes/class-wcj-currency-exchange-rates.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Currency Exchange Rates class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -80,6 +80,8 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
|
|
80 |
|
81 |
/**
|
82 |
* add_currency_exchange_rates_settings.
|
|
|
|
|
83 |
*/
|
84 |
function add_currency_exchange_rates_settings() {
|
85 |
|
@@ -88,6 +90,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
|
|
88 |
$settings[] = array(
|
89 |
'title' => __( 'Exchange Rates', 'woocommerce-jetpack' ),
|
90 |
'type' => 'title',
|
|
|
91 |
'id' => 'wcj_currency_exchange_rates_options',
|
92 |
);
|
93 |
|
@@ -106,18 +109,34 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
|
|
106 |
),
|
107 |
);
|
108 |
|
109 |
-
// Currency Pairs - Price by Country
|
110 |
$currency_from = get_option( 'woocommerce_currency' );
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
|
123 |
$settings[] = array(
|
4 |
*
|
5 |
* The WooCommerce Jetpack Currency Exchange Rates class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
80 |
|
81 |
/**
|
82 |
* add_currency_exchange_rates_settings.
|
83 |
+
*
|
84 |
+
* @version 2.4.4
|
85 |
*/
|
86 |
function add_currency_exchange_rates_settings() {
|
87 |
|
90 |
$settings[] = array(
|
91 |
'title' => __( 'Exchange Rates', 'woocommerce-jetpack' ),
|
92 |
'type' => 'title',
|
93 |
+
'desc' => __( 'All currencies from all <strong>enabled</strong> modules will be automatically added to the list.', 'woocommerce-jetpack' ),
|
94 |
'id' => 'wcj_currency_exchange_rates_options',
|
95 |
);
|
96 |
|
109 |
),
|
110 |
);
|
111 |
|
|
|
112 |
$currency_from = get_option( 'woocommerce_currency' );
|
113 |
+
|
114 |
+
if ( wcj_is_module_enabled( 'price_by_country' ) ) {
|
115 |
+
// Currency Pairs - Price by Country
|
116 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
117 |
+
$currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
|
118 |
+
$settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
|
119 |
+
}
|
120 |
}
|
121 |
+
|
122 |
+
if ( wcj_is_module_enabled( 'multicurrency' ) ) {
|
123 |
+
// Currency Pairs - Multicurrency
|
124 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
|
125 |
+
$currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
|
126 |
+
$settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
131 |
+
// Currency Pairs - Gateway Currency
|
132 |
+
global $woocommerce;
|
133 |
+
$available_gateways = $woocommerce->payment_gateways->payment_gateways();
|
134 |
+
foreach ( $available_gateways as $key => $gateway ) {
|
135 |
+
$currency_to = get_option( 'wcj_gateways_currency_' . $key );
|
136 |
+
if ( 'no_changes' != $currency_to ) {
|
137 |
+
$settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
|
138 |
+
}
|
139 |
+
}
|
140 |
}
|
141 |
|
142 |
$settings[] = array(
|
includes/class-wcj-currency-external-products.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Currency for External Products class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_Currency_External_Products extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -26,28 +26,37 @@ class WCJ_Currency_External_Products extends WCJ_Module {
|
|
26 |
$this->desc = __( 'Set different currency for external WooCommerce products.', 'woocommerce-jetpack' );
|
27 |
parent::__construct();
|
28 |
|
29 |
-
$currencies = include( 'currencies/wcj-currencies.php' );
|
30 |
-
foreach( $currencies as $data ) {
|
31 |
-
$this->currency_symbols[ $data['code'] ] = $data['symbol'];
|
32 |
-
$this->currency_names_and_symbols[ $data['code'] ] = $data['name'] . ' (' . $data['symbol'] . ')';
|
33 |
-
}
|
34 |
-
|
35 |
if ( $this->is_enabled() ) {
|
36 |
if ( '' != get_option( 'wcj_currency_external_products_symbol' ) ) {
|
37 |
-
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol' ),
|
|
|
38 |
}
|
39 |
}
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
/**
|
43 |
* change_currency_symbol.
|
44 |
*
|
45 |
-
* @version 2.
|
46 |
*/
|
47 |
public function change_currency_symbol( $currency_symbol, $currency ) {
|
48 |
global $product;
|
49 |
if ( is_object( $product ) && isset( $product->product_type ) && 'external' === $product->product_type ) {
|
50 |
-
return
|
51 |
}
|
52 |
return $currency_symbol;
|
53 |
}
|
@@ -55,36 +64,30 @@ class WCJ_Currency_External_Products extends WCJ_Module {
|
|
55 |
/**
|
56 |
* get_settings.
|
57 |
*
|
58 |
-
* @version 2.
|
59 |
*/
|
60 |
function get_settings() {
|
61 |
-
|
62 |
$settings = array(
|
63 |
-
|
64 |
array(
|
65 |
'title' => __( 'Currency for External Products Options', 'woocommerce-jetpack' ),
|
66 |
'type' => 'title',
|
67 |
'desc' => '',
|
68 |
'id' => 'wcj_currency_external_products_options',
|
69 |
),
|
70 |
-
|
71 |
array(
|
72 |
-
'title' => __( 'Currency
|
73 |
-
'
|
74 |
-
'
|
75 |
-
'id' => 'wcj_currency_external_products_symbol',
|
76 |
'default' => 'EUR',
|
77 |
'type' => 'select',
|
78 |
-
'options' =>
|
79 |
),
|
80 |
-
|
81 |
array(
|
82 |
'type' => 'sectionend',
|
83 |
'id' => 'wcj_currency_external_products_options',
|
84 |
),
|
85 |
);
|
86 |
-
|
87 |
-
return $this->add_enable_module_setting( $settings );
|
88 |
}
|
89 |
}
|
90 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Currency for External Products class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.4
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
26 |
$this->desc = __( 'Set different currency for external WooCommerce products.', 'woocommerce-jetpack' );
|
27 |
parent::__construct();
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
if ( $this->is_enabled() ) {
|
30 |
if ( '' != get_option( 'wcj_currency_external_products_symbol' ) ) {
|
31 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol' ), PHP_INT_MAX, 2 );
|
32 |
+
add_filter( 'woocommerce_currency', array( $this, 'change_currency_code' ), PHP_INT_MAX, 1 );
|
33 |
}
|
34 |
}
|
35 |
}
|
36 |
|
37 |
+
/**
|
38 |
+
* change_currency_code.
|
39 |
+
*
|
40 |
+
* @version 2.4.4
|
41 |
+
* @since 2.4.4
|
42 |
+
*/
|
43 |
+
public function change_currency_code( $currency ) {
|
44 |
+
global $product;
|
45 |
+
if ( is_object( $product ) && isset( $product->product_type ) && 'external' === $product->product_type ) {
|
46 |
+
return get_option( 'wcj_currency_external_products_symbol' );
|
47 |
+
}
|
48 |
+
return $currency;
|
49 |
+
}
|
50 |
+
|
51 |
/**
|
52 |
* change_currency_symbol.
|
53 |
*
|
54 |
+
* @version 2.4.4
|
55 |
*/
|
56 |
public function change_currency_symbol( $currency_symbol, $currency ) {
|
57 |
global $product;
|
58 |
if ( is_object( $product ) && isset( $product->product_type ) && 'external' === $product->product_type ) {
|
59 |
+
return wcj_get_currency_symbol( get_option( 'wcj_currency_external_products_symbol' ) );
|
60 |
}
|
61 |
return $currency_symbol;
|
62 |
}
|
64 |
/**
|
65 |
* get_settings.
|
66 |
*
|
67 |
+
* @version 2.4.4
|
68 |
*/
|
69 |
function get_settings() {
|
|
|
70 |
$settings = array(
|
|
|
71 |
array(
|
72 |
'title' => __( 'Currency for External Products Options', 'woocommerce-jetpack' ),
|
73 |
'type' => 'title',
|
74 |
'desc' => '',
|
75 |
'id' => 'wcj_currency_external_products_options',
|
76 |
),
|
|
|
77 |
array(
|
78 |
+
'title' => __( 'Currency', 'woocommerce-jetpack' ),
|
79 |
+
'desc_tip' => __( 'Set currency for all external products.', 'woocommerce-jetpack' ),
|
80 |
+
'id' => 'wcj_currency_external_products_symbol', // mislabeled, should be 'wcj_currency_external_products_code'
|
|
|
81 |
'default' => 'EUR',
|
82 |
'type' => 'select',
|
83 |
+
'options' => wcj_get_currencies_names_and_symbols(),
|
84 |
),
|
|
|
85 |
array(
|
86 |
'type' => 'sectionend',
|
87 |
'id' => 'wcj_currency_external_products_options',
|
88 |
),
|
89 |
);
|
90 |
+
return $this->add_standard_settings( $settings );
|
|
|
91 |
}
|
92 |
}
|
93 |
|
includes/class-wcj-order-numbers.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Order Numbers class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -67,7 +67,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
|
|
67 |
/**
|
68 |
* Add Renumerate Orders tool to WooCommerce menu (the content).
|
69 |
*
|
70 |
-
* @version 2.
|
71 |
*/
|
72 |
public function create_renumerate_orders_tool() {
|
73 |
$result_message = '';
|
@@ -76,8 +76,8 @@ class WCJ_Order_Numbers extends WCJ_Module {
|
|
76 |
$result_message = '<p><div class="updated"><p><strong>' . __( 'Orders successfully renumerated!', 'woocommerce-jetpack' ) . '</strong></p></div></p>';
|
77 |
}
|
78 |
?><div>
|
79 |
-
|
80 |
-
<p><?php echo __( '
|
81 |
<?php echo $result_message; ?>
|
82 |
<form method="post" action="">
|
83 |
<input class="button-primary" type="submit" name="renumerate_orders" value="<?php echo __( 'Renumerate orders', 'woocommerce-jetpack' ); ?>">
|
@@ -94,16 +94,38 @@ class WCJ_Order_Numbers extends WCJ_Module {
|
|
94 |
|
95 |
/**
|
96 |
* Add/update order_number meta to order.
|
|
|
|
|
97 |
*/
|
98 |
public function add_order_number_meta( $order_id, $do_overwrite ) {
|
99 |
|
100 |
-
if ( 'shop_order' !== get_post_type( $order_id ) )
|
101 |
return;
|
|
|
102 |
|
103 |
if ( true === $do_overwrite || 0 == get_post_meta( $order_id, '_wcj_order_number', true ) ) {
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
}
|
109 |
|
@@ -133,7 +155,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
|
|
133 |
/**
|
134 |
* get_settings.
|
135 |
*
|
136 |
-
* @version 2.
|
137 |
*/
|
138 |
function get_settings() {
|
139 |
|
@@ -215,6 +237,15 @@ class WCJ_Order_Numbers extends WCJ_Module {
|
|
215 |
'css' => 'width:300px;',
|
216 |
),
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
array( 'type' => 'sectionend', 'id' => 'wcj_order_numbers_options' ),
|
219 |
|
220 |
);
|
4 |
*
|
5 |
* The WooCommerce Jetpack Order Numbers class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
67 |
/**
|
68 |
* Add Renumerate Orders tool to WooCommerce menu (the content).
|
69 |
*
|
70 |
+
* @version 2.4.4
|
71 |
*/
|
72 |
public function create_renumerate_orders_tool() {
|
73 |
$result_message = '';
|
76 |
$result_message = '<p><div class="updated"><p><strong>' . __( 'Orders successfully renumerated!', 'woocommerce-jetpack' ) . '</strong></p></div></p>';
|
77 |
}
|
78 |
?><div>
|
79 |
+
<?php echo $this->get_tool_header_html( 'renumerate_orders' ); ?>
|
80 |
+
<p><?php echo __( 'Press the button below to renumerate all existing orders starting from order counter settings in WooCommerce > Settings > Booster > Order Numbers.', 'woocommerce-jetpack' ); ?></p>
|
81 |
<?php echo $result_message; ?>
|
82 |
<form method="post" action="">
|
83 |
<input class="button-primary" type="submit" name="renumerate_orders" value="<?php echo __( 'Renumerate orders', 'woocommerce-jetpack' ); ?>">
|
94 |
|
95 |
/**
|
96 |
* Add/update order_number meta to order.
|
97 |
+
*
|
98 |
+
* @version 2.4.4
|
99 |
*/
|
100 |
public function add_order_number_meta( $order_id, $do_overwrite ) {
|
101 |
|
102 |
+
if ( 'shop_order' !== get_post_type( $order_id ) ) {
|
103 |
return;
|
104 |
+
}
|
105 |
|
106 |
if ( true === $do_overwrite || 0 == get_post_meta( $order_id, '_wcj_order_number', true ) ) {
|
107 |
+
if ( 'yes' === get_option( 'wcj_order_number_use_mysql_transaction_enabled', 'no' ) ) {
|
108 |
+
global $wpdb;
|
109 |
+
$wpdb->query( 'START TRANSACTION' );
|
110 |
+
$wp_options_table = $wpdb->prefix . 'options';
|
111 |
+
$result_select = $wpdb->get_row( "SELECT * FROM $wp_options_table WHERE option_name = 'wcj_order_number_counter'" );
|
112 |
+
if ( NULL != $result_select ) {
|
113 |
+
$current_order_number = $result_select->option_value;
|
114 |
+
$result_update = $wpdb->update( $wp_options_table, array( 'option_value' => ( $current_order_number + 1 ) ), array( 'option_name' => 'wcj_order_number_counter' ) );
|
115 |
+
if ( NULL != $result_update ) {
|
116 |
+
$wpdb->query( 'COMMIT' ); // all ok
|
117 |
+
update_post_meta( $order_id, '_wcj_order_number', $current_order_number );
|
118 |
+
} else {
|
119 |
+
$wpdb->query( 'ROLLBACK' ); // something went wrong, Rollback
|
120 |
+
}
|
121 |
+
} else {
|
122 |
+
$wpdb->query( 'ROLLBACK' ); // something went wrong, Rollback
|
123 |
+
}
|
124 |
+
} else {
|
125 |
+
$current_order_number = get_option( 'wcj_order_number_counter' );
|
126 |
+
update_option( 'wcj_order_number_counter', ( $current_order_number + 1 ) );
|
127 |
+
update_post_meta( $order_id, '_wcj_order_number', $current_order_number );
|
128 |
+
}
|
129 |
}
|
130 |
}
|
131 |
|
155 |
/**
|
156 |
* get_settings.
|
157 |
*
|
158 |
+
* @version 2.4.4
|
159 |
*/
|
160 |
function get_settings() {
|
161 |
|
237 |
'css' => 'width:300px;',
|
238 |
),
|
239 |
|
240 |
+
array(
|
241 |
+
'title' => __( 'Use MySQL Transaction', 'woocommerce-jetpack' ),
|
242 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
243 |
+
'desc_tip' => __( 'This should be enabled if you have a lot of simultaneous orders in your shop - to prevent duplicate order numbers (sequential).', 'woocommerce-jetpack' ),
|
244 |
+
'id' => 'wcj_order_number_use_mysql_transaction_enabled',
|
245 |
+
'default' => 'no',
|
246 |
+
'type' => 'checkbox',
|
247 |
+
),
|
248 |
+
|
249 |
array( 'type' => 'sectionend', 'id' => 'wcj_order_numbers_options' ),
|
250 |
|
251 |
);
|
includes/class-wcj-payment-gateways-by-country.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways by Country class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.4.1
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -17,12 +17,14 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
|
|
|
|
20 |
*/
|
21 |
function __construct() {
|
22 |
|
23 |
$this->id = 'payment_gateways_by_country';
|
24 |
-
$this->short_desc = __( 'Gateways by Country', 'woocommerce-jetpack' );
|
25 |
-
$this->desc = __( 'Set countries to include/exclude for WooCommerce payment gateways to show up.', 'woocommerce-jetpack' );
|
26 |
parent::__construct();
|
27 |
|
28 |
add_filter( 'init', array( $this, 'add_hooks' ) );
|
@@ -34,6 +36,8 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
34 |
|
35 |
/**
|
36 |
* available_payment_gateways.
|
|
|
|
|
37 |
*/
|
38 |
function available_payment_gateways( $_available_gateways ) {
|
39 |
foreach ( $_available_gateways as $key => $gateway ) {
|
@@ -48,6 +52,17 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
48 |
unset( $_available_gateways[ $key ] );
|
49 |
continue;
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
return $_available_gateways;
|
53 |
}
|
@@ -61,6 +76,8 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
61 |
|
62 |
/**
|
63 |
* add_countries_settings.
|
|
|
|
|
64 |
*/
|
65 |
function add_countries_settings( $settings ) {
|
66 |
$settings = array();
|
@@ -71,6 +88,7 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
71 |
'id' => 'wcj_payment_gateways_by_country_gateways_options',
|
72 |
);
|
73 |
$countries = wcj_get_countries();
|
|
|
74 |
$gateways = WC()->payment_gateways->payment_gateways();
|
75 |
foreach ( $gateways as $key => $gateway ) {
|
76 |
$default_gateways = array( 'bacs' );
|
@@ -87,7 +105,7 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
87 |
$settings[] = array(
|
88 |
'title' => $gateway->title,
|
89 |
'desc_tip' => $desc_tip,
|
90 |
-
'desc' => __( 'Include', 'woocommerce-jetpack' ),
|
91 |
'id' => 'wcj_gateways_countries_include_' . $key,
|
92 |
'default' => '',
|
93 |
'type' => 'multiselect',
|
@@ -99,7 +117,7 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
99 |
$settings[] = array(
|
100 |
'title' => '',
|
101 |
'desc_tip' => $desc_tip,
|
102 |
-
'desc' => __( 'Exclude', 'woocommerce-jetpack' ),
|
103 |
'id' => 'wcj_gateways_countries_exclude_' . $key,
|
104 |
'default' => '',
|
105 |
'type' => 'multiselect',
|
@@ -108,6 +126,30 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
|
|
108 |
'options' => $countries,
|
109 |
'custom_attributes' => $custom_attributes,
|
110 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
$settings[] = array(
|
113 |
'type' => 'sectionend',
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways by Country class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @since 2.4.1
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.4
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'payment_gateways_by_country';
|
26 |
+
$this->short_desc = __( 'Gateways by Country or State', 'woocommerce-jetpack' );
|
27 |
+
$this->desc = __( 'Set countries or states to include/exclude for WooCommerce payment gateways to show up.', 'woocommerce-jetpack' );
|
28 |
parent::__construct();
|
29 |
|
30 |
add_filter( 'init', array( $this, 'add_hooks' ) );
|
36 |
|
37 |
/**
|
38 |
* available_payment_gateways.
|
39 |
+
*
|
40 |
+
* @version 2.4.4
|
41 |
*/
|
42 |
function available_payment_gateways( $_available_gateways ) {
|
43 |
foreach ( $_available_gateways as $key => $gateway ) {
|
52 |
unset( $_available_gateways[ $key ] );
|
53 |
continue;
|
54 |
}
|
55 |
+
$customer_state = WC()->customer->get_state();
|
56 |
+
$include_states = get_option( 'wcj_gateways_states_include_' . $key, '' );
|
57 |
+
if ( ! empty( $include_states ) && ! in_array( $customer_state, $include_states ) ) {
|
58 |
+
unset( $_available_gateways[ $key ] );
|
59 |
+
continue;
|
60 |
+
}
|
61 |
+
$exclude_states = get_option( 'wcj_gateways_states_exclude_' . $key, '' );
|
62 |
+
if ( ! empty( $exclude_states ) && in_array( $customer_state, $exclude_states ) ) {
|
63 |
+
unset( $_available_gateways[ $key ] );
|
64 |
+
continue;
|
65 |
+
}
|
66 |
}
|
67 |
return $_available_gateways;
|
68 |
}
|
76 |
|
77 |
/**
|
78 |
* add_countries_settings.
|
79 |
+
*
|
80 |
+
* @version 2.4.4
|
81 |
*/
|
82 |
function add_countries_settings( $settings ) {
|
83 |
$settings = array();
|
88 |
'id' => 'wcj_payment_gateways_by_country_gateways_options',
|
89 |
);
|
90 |
$countries = wcj_get_countries();
|
91 |
+
$states = wcj_get_states();
|
92 |
$gateways = WC()->payment_gateways->payment_gateways();
|
93 |
foreach ( $gateways as $key => $gateway ) {
|
94 |
$default_gateways = array( 'bacs' );
|
105 |
$settings[] = array(
|
106 |
'title' => $gateway->title,
|
107 |
'desc_tip' => $desc_tip,
|
108 |
+
'desc' => __( 'Include Countries', 'woocommerce-jetpack' ),
|
109 |
'id' => 'wcj_gateways_countries_include_' . $key,
|
110 |
'default' => '',
|
111 |
'type' => 'multiselect',
|
117 |
$settings[] = array(
|
118 |
'title' => '',
|
119 |
'desc_tip' => $desc_tip,
|
120 |
+
'desc' => __( 'Exclude Countries', 'woocommerce-jetpack' ),
|
121 |
'id' => 'wcj_gateways_countries_exclude_' . $key,
|
122 |
'default' => '',
|
123 |
'type' => 'multiselect',
|
126 |
'options' => $countries,
|
127 |
'custom_attributes' => $custom_attributes,
|
128 |
);
|
129 |
+
$settings[] = array(
|
130 |
+
'title' => '',
|
131 |
+
'desc_tip' => $desc_tip,
|
132 |
+
'desc' => __( 'Include States (Base Country)', 'woocommerce-jetpack' ),
|
133 |
+
'id' => 'wcj_gateways_states_include_' . $key,
|
134 |
+
'default' => '',
|
135 |
+
'type' => 'multiselect',
|
136 |
+
'class' => 'chosen_select',
|
137 |
+
'css' => 'width: 450px;',
|
138 |
+
'options' => $states,
|
139 |
+
'custom_attributes' => $custom_attributes,
|
140 |
+
);
|
141 |
+
$settings[] = array(
|
142 |
+
'title' => '',
|
143 |
+
'desc_tip' => $desc_tip,
|
144 |
+
'desc' => __( 'Exclude States (Base Country)', 'woocommerce-jetpack' ),
|
145 |
+
'id' => 'wcj_gateways_states_exclude_' . $key,
|
146 |
+
'default' => '',
|
147 |
+
'type' => 'multiselect',
|
148 |
+
'class' => 'chosen_select',
|
149 |
+
'css' => 'width: 450px;',
|
150 |
+
'options' => $states,
|
151 |
+
'custom_attributes' => $custom_attributes,
|
152 |
+
);
|
153 |
}
|
154 |
$settings[] = array(
|
155 |
'type' => 'sectionend',
|
includes/class-wcj-price-by-country.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -31,9 +31,18 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
31 |
|
32 |
if ( $this->is_enabled() ) {
|
33 |
|
34 |
-
if ( ! is_admin()
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
if ( is_admin() ) {
|
39 |
// Backend
|
@@ -52,7 +61,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
52 |
/**
|
53 |
* get_settings.
|
54 |
*
|
55 |
-
* @version 2.
|
56 |
*/
|
57 |
function get_settings() {
|
58 |
|
@@ -92,7 +101,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
92 |
), */
|
93 |
|
94 |
array(
|
95 |
-
'title' => __( 'Override Country
|
96 |
'id' => 'wcj_price_by_country_override_on_checkout_with_billing_country',
|
97 |
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
98 |
'default' => 'no',
|
@@ -124,7 +133,24 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
124 |
|
125 |
array( 'type' => 'sectionend', 'id' => 'wcj_price_by_country_options' ),
|
126 |
|
127 |
-
array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
array(
|
130 |
'title' => __( 'Autogenerate Groups', 'woocommerce-jetpack' ),
|
@@ -165,26 +191,42 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
165 |
|
166 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
$settings[] = array(
|
190 |
'title' => '',
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.4
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
31 |
|
32 |
if ( $this->is_enabled() ) {
|
33 |
|
34 |
+
if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
|
35 |
+
$do_load_core = true;
|
36 |
+
if ( is_admin() ) {
|
37 |
+
global $pagenow;
|
38 |
+
if ( 'admin-ajax.php' === $pagenow ) {
|
39 |
+
$do_load_core = false;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
if ( $do_load_core ) {
|
43 |
+
// Frontend
|
44 |
+
include_once( 'price-by-country/class-wcj-price-by-country-core.php' );
|
45 |
+
}
|
46 |
}
|
47 |
if ( is_admin() ) {
|
48 |
// Backend
|
61 |
/**
|
62 |
* get_settings.
|
63 |
*
|
64 |
+
* @version 2.4.4
|
65 |
*/
|
66 |
function get_settings() {
|
67 |
|
101 |
), */
|
102 |
|
103 |
array(
|
104 |
+
'title' => __( 'Override Country with Customer\'s Checkout Billing Country', 'woocommerce-jetpack' ),
|
105 |
'id' => 'wcj_price_by_country_override_on_checkout_with_billing_country',
|
106 |
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
107 |
'default' => 'no',
|
133 |
|
134 |
array( 'type' => 'sectionend', 'id' => 'wcj_price_by_country_options' ),
|
135 |
|
136 |
+
array(
|
137 |
+
'title' => __( 'Country Groups', 'woocommerce-jetpack' ),
|
138 |
+
'type' => 'title',
|
139 |
+
'id' => 'wcj_price_by_country_country_groups_options',
|
140 |
+
),
|
141 |
+
|
142 |
+
array(
|
143 |
+
'title' => __( 'Countries Selection', 'woocommerce-jetpack' ),
|
144 |
+
'desc' => __( 'Choose how do you want to enter countries groups in admin.', 'woocommerce-jetpack' ),
|
145 |
+
'id' => 'wcj_price_by_country_selection',
|
146 |
+
'default' => 'comma_list',
|
147 |
+
'type' => 'select',
|
148 |
+
'options' => array(
|
149 |
+
'comma_list' => __( 'Comma separated list', 'woocommerce-jetpack' ),
|
150 |
+
'multiselect' => __( 'Multiselect', 'woocommerce-jetpack' ),
|
151 |
+
'chosen_select' => __( 'Chosen select', 'woocommerce-jetpack' ),
|
152 |
+
),
|
153 |
+
),
|
154 |
|
155 |
array(
|
156 |
'title' => __( 'Autogenerate Groups', 'woocommerce-jetpack' ),
|
191 |
|
192 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
193 |
|
194 |
+
switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
|
195 |
+
|
196 |
+
case 'comma_list':
|
197 |
+
$settings[] = array(
|
198 |
+
'title' => __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i,
|
199 |
+
'desc' => __( 'Countries. List of comma separated country codes.<br>For country codes and predifined sets visit <a href="http://booster.io/features/prices-and-currencies-by-customers-country" target="_blank">http://booster.io</a>', 'woocommerce-jetpack' ),
|
200 |
+
'id' => 'wcj_price_by_country_exchange_rate_countries_group_' . $i,
|
201 |
+
'default' => '',
|
202 |
+
'type' => 'textarea',
|
203 |
+
'css' => 'width:50%;min-width:300px;height:100px;',
|
204 |
+
);
|
205 |
+
break;
|
206 |
+
|
207 |
+
case 'multiselect':
|
208 |
+
$settings[] = array(
|
209 |
+
'title' => __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i,
|
210 |
+
'id' => 'wcj_price_by_country_countries_group_' . $i,
|
211 |
+
'default' => '',
|
212 |
+
'type' => 'multiselect',
|
213 |
+
'options' => wcj_get_countries(),
|
214 |
+
'css' => 'width:50%;min-width:300px;height:100px;',
|
215 |
+
);
|
216 |
+
break;
|
217 |
+
|
218 |
+
case 'chosen_select':
|
219 |
+
$settings[] = array(
|
220 |
+
'title' => __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i,
|
221 |
+
'id' => 'wcj_price_by_country_countries_group_chosen_select_' . $i,
|
222 |
+
'default' => '',
|
223 |
+
'type' => 'multiselect',
|
224 |
+
'options' => wcj_get_countries(),
|
225 |
+
'class' => 'chosen_select',
|
226 |
+
'css' => 'width:50%;min-width:300px;',
|
227 |
+
);
|
228 |
+
break;
|
229 |
+
}
|
230 |
|
231 |
$settings[] = array(
|
232 |
'title' => '',
|
includes/class-wcj-price-labels.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price Labels class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -100,6 +100,9 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
100 |
'woocommerce_variation_free_price_html',
|
101 |
'woocommerce_variation_price_html',
|
102 |
'woocommerce_variation_sale_price_html',
|
|
|
|
|
|
|
103 |
);
|
104 |
foreach ( $this->prices_filters as $the_filter )
|
105 |
add_filter( $the_filter, array( $this, 'custom_price' ), 100, 2 );
|
@@ -380,13 +383,13 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
380 |
break;
|
381 |
}
|
382 |
|
383 |
-
return str_replace( 'From: ', '', $price );
|
384 |
}
|
385 |
|
386 |
/*
|
387 |
* custom_price - front end.
|
388 |
*
|
389 |
-
* @version 2.
|
390 |
*/
|
391 |
public function custom_price( $price, $product ) {
|
392 |
|
@@ -394,11 +397,28 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
394 |
|
395 |
$current_filter_name = current_filter();
|
396 |
|
397 |
-
if (
|
|
|
|
|
|
|
|
|
398 |
return $price;
|
|
|
399 |
|
400 |
-
if ( '
|
401 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
|
403 |
$do_apply_global = true;
|
404 |
$products_incl = get_option( 'wcj_global_price_labels_products_incl', array() );
|
@@ -502,6 +522,7 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
502 |
'woocommerce_variable_free_sale_price_html',
|
503 |
'woocommerce_variable_price_html',
|
504 |
'woocommerce_variable_sale_price_html',
|
|
|
505 |
);
|
506 |
|
507 |
$variation_filters_array = array(
|
@@ -510,6 +531,7 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
510 |
//woocommerce_variation_option_name
|
511 |
'woocommerce_variation_price_html',
|
512 |
'woocommerce_variation_sale_price_html',
|
|
|
513 |
);
|
514 |
|
515 |
if (
|
@@ -525,6 +547,7 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
525 |
}
|
526 |
}
|
527 |
|
|
|
528 |
return do_shortcode( $price );
|
529 |
}
|
530 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price Labels class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.4
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
100 |
'woocommerce_variation_free_price_html',
|
101 |
'woocommerce_variation_price_html',
|
102 |
'woocommerce_variation_sale_price_html',
|
103 |
+
// WooCommerce Subscription
|
104 |
+
'woocommerce_subscriptions_product_price_string',
|
105 |
+
'woocommerce_variable_subscription_price_html',
|
106 |
);
|
107 |
foreach ( $this->prices_filters as $the_filter )
|
108 |
add_filter( $the_filter, array( $this, 'custom_price' ), 100, 2 );
|
383 |
break;
|
384 |
}
|
385 |
|
386 |
+
return str_replace( 'From: ', '', $price ); // TODO: recheck if this is necessary? Also this works only for English WP installs.
|
387 |
}
|
388 |
|
389 |
/*
|
390 |
* custom_price - front end.
|
391 |
*
|
392 |
+
* @version 2.4.4
|
393 |
*/
|
394 |
public function custom_price( $price, $product ) {
|
395 |
|
397 |
|
398 |
$current_filter_name = current_filter();
|
399 |
|
400 |
+
if ( 'woocommerce_cart_item_price' === $current_filter_name ) {
|
401 |
+
$product = $product['data'];
|
402 |
+
}
|
403 |
+
|
404 |
+
if ( 'woocommerce_get_price_html' === $current_filter_name && 'booking' !== $product->product_type ) {
|
405 |
return $price;
|
406 |
+
}
|
407 |
|
408 |
+
if ( 'subscription' === $product->product_type && 'woocommerce_subscriptions_product_price_string' !== $current_filter_name ) {
|
409 |
+
return $price;
|
410 |
+
}
|
411 |
+
|
412 |
+
if ( 'variable-subscription' === $product->product_type && 'woocommerce_variable_subscription_price_html' !== $current_filter_name ) {
|
413 |
+
return $price;
|
414 |
+
}
|
415 |
+
|
416 |
+
if ( 'subscription_variation' === $product->product_type && 'woocommerce_subscriptions_product_price_string' !== $current_filter_name ) {
|
417 |
+
return $price;
|
418 |
+
}
|
419 |
+
if ( 'subscription_variation' === $product->product_type && 'woocommerce_subscriptions_product_price_string' === $current_filter_name ) {
|
420 |
+
$current_filter_name = 'woocommerce_variation_subscription_price_html';
|
421 |
+
}
|
422 |
|
423 |
$do_apply_global = true;
|
424 |
$products_incl = get_option( 'wcj_global_price_labels_products_incl', array() );
|
522 |
'woocommerce_variable_free_sale_price_html',
|
523 |
'woocommerce_variable_price_html',
|
524 |
'woocommerce_variable_sale_price_html',
|
525 |
+
'woocommerce_variable_subscription_price_html',
|
526 |
);
|
527 |
|
528 |
$variation_filters_array = array(
|
531 |
//woocommerce_variation_option_name
|
532 |
'woocommerce_variation_price_html',
|
533 |
'woocommerce_variation_sale_price_html',
|
534 |
+
'woocommerce_variation_subscription_price_html', // pseudo filter!
|
535 |
);
|
536 |
|
537 |
if (
|
547 |
}
|
548 |
}
|
549 |
|
550 |
+
// return do_shortcode( $price . $current_filter_name . $product->product_type . $labels_array['variation_variable'] . $labels_array['variation_variation'] );
|
551 |
return do_shortcode( $price );
|
552 |
}
|
553 |
|
includes/class-wcj-product-bulk-price-converter.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Bulk Price Converter class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -37,16 +37,26 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
37 |
/**
|
38 |
* change_price_by_type.
|
39 |
*
|
40 |
-
* @version 2.4.
|
41 |
*/
|
42 |
-
public function change_price_by_type( $product_id, $multiply_price_by, $price_type, $is_preview, $parent_product_id ) {
|
43 |
$the_price = get_post_meta( $product_id, '_' . $price_type, true );
|
44 |
$the_modified_price = $the_price;
|
45 |
-
if ( '' != $the_price ) {
|
46 |
$precision = get_option( 'woocommerce_price_num_decimals', 2 );
|
47 |
$the_modified_price = round( $the_price * $multiply_price_by, $precision );
|
48 |
-
|
49 |
-
$the_modified_price = $this->make_pretty_price( $the_modified_price );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
if ( ! $is_preview ) {
|
51 |
update_post_meta( $product_id, '_' . $price_type, $the_modified_price );
|
52 |
}
|
@@ -59,24 +69,48 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
59 |
$product_cats[] = esc_html( $term->name );
|
60 |
}
|
61 |
}
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
* change_price_all_types.
|
73 |
*
|
74 |
-
* @version 2.4.
|
75 |
*/
|
76 |
public function change_price_all_types( $product_id, $multiply_price_by, $is_preview, $parent_product_id ) {
|
77 |
-
$
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -99,7 +133,7 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
99 |
/**
|
100 |
* change_all_products_prices
|
101 |
*
|
102 |
-
* @version 2.4.
|
103 |
*/
|
104 |
public function change_all_products_prices( $multiply_prices_by, $is_preview ) {
|
105 |
$multiply_prices_by = floatval( $multiply_prices_by );
|
@@ -135,6 +169,7 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
135 |
'taxonomy' => 'product_cat',
|
136 |
'field' => 'slug',
|
137 |
'terms' => array( $_POST['wcj_product_cat'] ),
|
|
|
138 |
),
|
139 |
);
|
140 |
}
|
@@ -155,7 +190,7 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
155 |
/**
|
156 |
* create_bulk_price_converter_tool.
|
157 |
*
|
158 |
-
* @version 2.4.
|
159 |
*/
|
160 |
public function create_bulk_price_converter_tool() {
|
161 |
|
@@ -174,7 +209,8 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
174 |
if ( isset( $_POST['bulk_change_prices'] ) || isset( $_POST['bulk_change_prices_preview'] ) ) {
|
175 |
$result_changing_prices = $this->change_all_products_prices( $multiply_prices_by, $is_preview );
|
176 |
if ( ! $is_preview ) {
|
177 |
-
$result_message = '<p><div class="updated"><p><strong>' . __( 'Prices changed successfully!', 'woocommerce-jetpack' ) .
|
|
|
178 |
$multiply_prices_by = 1;
|
179 |
}
|
180 |
}
|
@@ -185,7 +221,9 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
185 |
$product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
|
186 |
if ( ! empty( $product_categories ) && ! is_wp_error( $product_categories ) ){
|
187 |
foreach ( $product_categories as $product_category ) {
|
188 |
-
$select_options_html .= '<option value="' . $product_category->slug . '"' . selected( $product_category->slug, $selected_option, false ) . '>' .
|
|
|
|
|
189 |
}
|
190 |
}
|
191 |
|
@@ -197,28 +235,58 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
197 |
$data_table = array();
|
198 |
$data_table[] = array(
|
199 |
__( 'Multiply all product prices by', 'woocommerce-jetpack' ),
|
200 |
-
'<input class="" type="number" step="0.000001" min="0.000001" name="multiply_prices_by" id="multiply_prices_by" value="' .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
);
|
|
|
202 |
if ( '' != $select_options_html ) {
|
203 |
$data_table[] = array(
|
204 |
-
__( '
|
205 |
'<select name="wcj_product_cat" ' . apply_filters( 'wcj_get_option_filter', 'disabled', '' ) . '>' .
|
206 |
'<option value="wcj_any">' . __( 'Any', 'woocommerce-jetpack' ) . '</option>' .
|
207 |
$select_options_html .
|
208 |
-
|
|
|
|
|
209 |
);
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
$data_table[] = array(
|
212 |
-
'<input class="button-primary" type="submit" name="bulk_change_prices_preview" id="bulk_change_prices_preview" value="' .
|
|
|
|
|
213 |
'',
|
214 |
);
|
215 |
if ( isset( $_POST['bulk_change_prices_preview'] ) ) {
|
216 |
$data_table[] = array(
|
217 |
-
'<input class="button-primary" type="submit" name="bulk_change_prices" id="bulk_change_prices" value="' .
|
|
|
|
|
218 |
'',
|
219 |
);
|
220 |
}
|
221 |
-
/* <input type="checkbox" name="make_pretty_prices" id="make_pretty_prices" value="">Make Pretty Prices */
|
222 |
echo wcj_get_table_html( $data_table, array( 'table_heading_type' => 'none', ) );
|
223 |
echo '</form>';
|
224 |
if ( $is_preview ) echo $result_changing_prices;
|
@@ -228,60 +296,27 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
|
|
228 |
|
229 |
/**
|
230 |
* make_pretty_price.
|
|
|
|
|
|
|
231 |
*/
|
232 |
-
|
233 |
-
|
234 |
-
if ( 0 == $price )
|
235 |
return $price;
|
236 |
-
|
237 |
-
$the_price = $price;
|
238 |
-
$the_multiplied_price = $price;
|
239 |
-
|
240 |
-
if ( $the_price < 20 ) {
|
241 |
-
|
242 |
-
|
243 |
-
$mod_10_cents = ( $the_multiplied_price * 10 - floor( $the_multiplied_price * 10 ) ) / 10;
|
244 |
-
// E.g. 14.44 -> 14.39
|
245 |
-
if ( $mod_10_cents < 0.05 )
|
246 |
-
$the_multiplied_price = $the_multiplied_price - ( $mod_10_cents + 0.01 );
|
247 |
-
// E.g. 14.45 -> 14.49
|
248 |
-
else if ( $mod_10_cents >= 0.05 )
|
249 |
-
$the_multiplied_price = $the_multiplied_price + ( 0.1 - ( $mod_10_cents + 0.01 ) );
|
250 |
-
|
251 |
-
$mod_100_cents = ( $the_multiplied_price - floor( $the_multiplied_price ) );
|
252 |
-
// E.g. 14.09 -> 13.99
|
253 |
-
if ( $mod_100_cents < 0.10 )
|
254 |
-
$the_multiplied_price = $the_multiplied_price - ( $mod_100_cents + 0.01 );
|
255 |
}
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
$the_multiplied_price = round( $the_multiplied_price );
|
266 |
-
|
267 |
-
$mod_10 = $the_multiplied_price % 10;
|
268 |
-
if ( $mod_10 < 5 )
|
269 |
-
// E.g. 114.00 -> 109.00
|
270 |
-
$the_multiplied_price = $the_multiplied_price - ( $mod_10 + 1 );
|
271 |
-
else if ( $mod_10 >= 5 )
|
272 |
-
// E.g. 115.00 -> 119.00
|
273 |
-
$the_multiplied_price = $the_multiplied_price + ( 10 - ( $mod_10 + 1 ) );
|
274 |
-
|
275 |
-
if ( $the_price >= 200 ) {
|
276 |
-
$mod_100 = $the_multiplied_price % 100;
|
277 |
-
if ( $mod_100 < 10 )
|
278 |
-
// E.g. 209.00 -> 199.00
|
279 |
-
$the_multiplied_price = $the_multiplied_price - ( $mod_100 + 1 );
|
280 |
}
|
281 |
}
|
282 |
-
|
283 |
-
|
284 |
-
} */
|
285 |
|
286 |
}
|
287 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Bulk Price Converter class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
37 |
/**
|
38 |
* change_price_by_type.
|
39 |
*
|
40 |
+
* @version 2.4.4
|
41 |
*/
|
42 |
+
public function change_price_by_type( $product_id, $multiply_price_by, $price_type, $is_preview, $parent_product_id, $min_price = 0, $max_price = 0 ) {
|
43 |
$the_price = get_post_meta( $product_id, '_' . $price_type, true );
|
44 |
$the_modified_price = $the_price;
|
45 |
+
if ( '' != $the_price && 0 != $the_price ) {
|
46 |
$precision = get_option( 'woocommerce_price_num_decimals', 2 );
|
47 |
$the_modified_price = round( $the_price * $multiply_price_by, $precision );
|
48 |
+
if ( isset( $_POST['make_pretty_prices_threshold'] ) && apply_filters( 'wcj_get_option_filter', 0, $_POST['make_pretty_prices_threshold'] ) > 0 ) {
|
49 |
+
$the_modified_price = $this->make_pretty_price( $the_modified_price );
|
50 |
+
}
|
51 |
+
if ( $the_modified_price < 0 ) {
|
52 |
+
$the_modified_price = 0;
|
53 |
+
}
|
54 |
+
if ( 0 != $min_price && $the_modified_price < $min_price ) {
|
55 |
+
$the_modified_price = $min_price;
|
56 |
+
}
|
57 |
+
if ( 0 != $max_price && $the_modified_price > $max_price ) {
|
58 |
+
$the_modified_price = $max_price;
|
59 |
+
}
|
60 |
if ( ! $is_preview ) {
|
61 |
update_post_meta( $product_id, '_' . $price_type, $the_modified_price );
|
62 |
}
|
69 |
$product_cats[] = esc_html( $term->name );
|
70 |
}
|
71 |
}
|
72 |
+
if ( '' != $the_price || '' != $the_modified_price ) {
|
73 |
+
echo '<tr>' .
|
74 |
+
'<td>' . get_the_title( $product_id ) . '</td>' .
|
75 |
+
'<td>' . implode( ', ', $product_cats ) . '</td>' .
|
76 |
+
'<td>' . '<em>' . $price_type . '</em>' . '</td>' .
|
77 |
+
'<td>' . $the_price . '</td>' .
|
78 |
+
'<td>' . $the_modified_price . '</td>' .
|
79 |
+
'</tr>';
|
80 |
+
}
|
81 |
}
|
82 |
|
83 |
/**
|
84 |
* change_price_all_types.
|
85 |
*
|
86 |
+
* @version 2.4.4
|
87 |
*/
|
88 |
public function change_price_all_types( $product_id, $multiply_price_by, $is_preview, $parent_product_id ) {
|
89 |
+
$what_prices_to_modify = ( isset( $_POST['wcj_price_types'] ) ) ? $_POST['wcj_price_types'] : 'wcj_both';
|
90 |
+
if ( 'wcj_both' === $what_prices_to_modify ) {
|
91 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'price', $is_preview, $parent_product_id );
|
92 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'sale_price', $is_preview, $parent_product_id );
|
93 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'regular_price', $is_preview, $parent_product_id );
|
94 |
+
} elseif ( 'wcj_sale_prices' === $what_prices_to_modify ) {
|
95 |
+
if ( get_post_meta( $product_id, '_' . 'price', true ) === get_post_meta( $product_id, '_' . 'sale_price', true ) ) {
|
96 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'price', $is_preview, $parent_product_id,
|
97 |
+
0, get_post_meta( $product_id, '_' . 'regular_price', true ) );
|
98 |
+
}
|
99 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'sale_price', $is_preview, $parent_product_id,
|
100 |
+
0, get_post_meta( $product_id, '_' . 'regular_price', true ) );
|
101 |
+
} elseif ( 'wcj_regular_prices' === $what_prices_to_modify ) {
|
102 |
+
if ( get_post_meta( $product_id, '_' . 'price', true ) === get_post_meta( $product_id, '_' . 'regular_price', true ) ) {
|
103 |
+
if (
|
104 |
+
get_post_meta( $product_id, '_' . 'price', true ) !== get_post_meta( $product_id, '_' . 'sale_price', true ) ||
|
105 |
+
$multiply_price_by <= 1
|
106 |
+
) {
|
107 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'price', $is_preview, $parent_product_id,
|
108 |
+
get_post_meta( $product_id, '_' . 'sale_price', true ), 0 );
|
109 |
+
}
|
110 |
+
}
|
111 |
+
$this->change_price_by_type( $product_id, $multiply_price_by, 'regular_price', $is_preview, $parent_product_id,
|
112 |
+
get_post_meta( $product_id, '_' . 'sale_price', true ), 0 );
|
113 |
+
}
|
114 |
}
|
115 |
|
116 |
/**
|
133 |
/**
|
134 |
* change_all_products_prices
|
135 |
*
|
136 |
+
* @version 2.4.4
|
137 |
*/
|
138 |
public function change_all_products_prices( $multiply_prices_by, $is_preview ) {
|
139 |
$multiply_prices_by = floatval( $multiply_prices_by );
|
169 |
'taxonomy' => 'product_cat',
|
170 |
'field' => 'slug',
|
171 |
'terms' => array( $_POST['wcj_product_cat'] ),
|
172 |
+
'operator' => ( 'wcj_none' != $_POST['wcj_product_cat'] ) ? 'IN' : 'NOT EXISTS',
|
173 |
),
|
174 |
);
|
175 |
}
|
190 |
/**
|
191 |
* create_bulk_price_converter_tool.
|
192 |
*
|
193 |
+
* @version 2.4.4
|
194 |
*/
|
195 |
public function create_bulk_price_converter_tool() {
|
196 |
|
209 |
if ( isset( $_POST['bulk_change_prices'] ) || isset( $_POST['bulk_change_prices_preview'] ) ) {
|
210 |
$result_changing_prices = $this->change_all_products_prices( $multiply_prices_by, $is_preview );
|
211 |
if ( ! $is_preview ) {
|
212 |
+
$result_message = '<p><div class="updated"><p><strong>' . __( 'Prices changed successfully!', 'woocommerce-jetpack' ) .
|
213 |
+
'</strong></p></div></p>';
|
214 |
$multiply_prices_by = 1;
|
215 |
}
|
216 |
}
|
221 |
$product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
|
222 |
if ( ! empty( $product_categories ) && ! is_wp_error( $product_categories ) ){
|
223 |
foreach ( $product_categories as $product_category ) {
|
224 |
+
$select_options_html .= '<option value="' . $product_category->slug . '"' . selected( $product_category->slug, $selected_option, false ) . '>' .
|
225 |
+
$product_category->name .
|
226 |
+
'</option>';
|
227 |
}
|
228 |
}
|
229 |
|
235 |
$data_table = array();
|
236 |
$data_table[] = array(
|
237 |
__( 'Multiply all product prices by', 'woocommerce-jetpack' ),
|
238 |
+
'<input class="" type="number" step="0.000001" min="0.000001" name="multiply_prices_by" id="multiply_prices_by" value="' .
|
239 |
+
$multiply_prices_by . '">',
|
240 |
+
'',
|
241 |
+
);
|
242 |
+
|
243 |
+
$selected_option_price_types = ( isset( $_POST['wcj_price_types'] ) ) ? $_POST['wcj_price_types'] : '';
|
244 |
+
$data_table[] = array(
|
245 |
+
__( 'Price type to modify', 'woocommerce-jetpack' ),
|
246 |
+
'<select name="wcj_price_types">' .
|
247 |
+
'<option value="wcj_both">' . __( 'Both', 'woocommerce-jetpack' ) . '</option>' .
|
248 |
+
'<option value="wcj_sale_prices"' . selected( 'wcj_sale_prices', $selected_option_price_types, false ) . '>'
|
249 |
+
. __( 'Sale prices only', 'woocommerce-jetpack' ) . '</option>' .
|
250 |
+
'<option value="wcj_regular_prices"' . selected( 'wcj_regular_prices', $selected_option_price_types, false ) . '>'
|
251 |
+
. __( 'Regular prices only', 'woocommerce-jetpack' ) . '</option>' .
|
252 |
+
'</select>',
|
253 |
+
'',
|
254 |
);
|
255 |
+
|
256 |
if ( '' != $select_options_html ) {
|
257 |
$data_table[] = array(
|
258 |
+
__( 'Products category', 'woocommerce-jetpack' ),
|
259 |
'<select name="wcj_product_cat" ' . apply_filters( 'wcj_get_option_filter', 'disabled', '' ) . '>' .
|
260 |
'<option value="wcj_any">' . __( 'Any', 'woocommerce-jetpack' ) . '</option>' .
|
261 |
$select_options_html .
|
262 |
+
'<option value="wcj_none"' . selected( 'wcj_none', $selected_option, false ) . '>' . __( 'None', 'woocommerce-jetpack' ) . '</option>' .
|
263 |
+
'</select>',
|
264 |
+
apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
265 |
);
|
266 |
}
|
267 |
+
$make_pretty_prices_threshold = isset( $_POST['make_pretty_prices_threshold'] ) ? $_POST['make_pretty_prices_threshold'] : 0;
|
268 |
+
$data_table[] = array(
|
269 |
+
__( '"Pretty prices" threshold', 'woocommerce-jetpack' ),
|
270 |
+
'<input class="" type="number" step="0.000001" min="0" name="make_pretty_prices_threshold" id="make_pretty_prices_threshold" value="' .
|
271 |
+
$make_pretty_prices_threshold . '"' . apply_filters( 'wcj_get_option_filter', 'disabled', '' ) . '>',
|
272 |
+
( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
|
273 |
+
'<em>' . __( 'Leave zero to disable', 'woocommerce-jetpack' ) . '</em>' :
|
274 |
+
apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
275 |
+
);
|
276 |
$data_table[] = array(
|
277 |
+
'<input class="button-primary" type="submit" name="bulk_change_prices_preview" id="bulk_change_prices_preview" value="' .
|
278 |
+
__( 'Preview Prices', 'woocommerce-jetpack' ) . '">',
|
279 |
+
'',
|
280 |
'',
|
281 |
);
|
282 |
if ( isset( $_POST['bulk_change_prices_preview'] ) ) {
|
283 |
$data_table[] = array(
|
284 |
+
'<input class="button-primary" type="submit" name="bulk_change_prices" id="bulk_change_prices" value="' .
|
285 |
+
__( 'Change Prices', 'woocommerce-jetpack' ) . '">',
|
286 |
+
'',
|
287 |
'',
|
288 |
);
|
289 |
}
|
|
|
290 |
echo wcj_get_table_html( $data_table, array( 'table_heading_type' => 'none', ) );
|
291 |
echo '</form>';
|
292 |
if ( $is_preview ) echo $result_changing_prices;
|
296 |
|
297 |
/**
|
298 |
* make_pretty_price.
|
299 |
+
*
|
300 |
+
* @version 2.4.4
|
301 |
+
* @since 2.4.4
|
302 |
*/
|
303 |
+
function make_pretty_price( $price ) {
|
304 |
+
if ( 0 == $price ) {
|
|
|
305 |
return $price;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
}
|
307 |
+
$the_modified_price = round( $price );
|
308 |
+
if ( $price < $_POST['make_pretty_prices_threshold'] ) {
|
309 |
+
$the_modified_price -= 0.01; // E.g. 49.49 -> 48.99 and 49.50 -> 49.99
|
310 |
+
} else {
|
311 |
+
$mod_10 = $the_modified_price % 10;
|
312 |
+
if ( 9 != $mod_10 ) {
|
313 |
+
$the_modified_price = ( $mod_10 < 5 ) ?
|
314 |
+
$the_modified_price - ( $mod_10 + 1 ) : // E.g. 114.00 -> 109.00
|
315 |
+
$the_modified_price + ( 10 - ( $mod_10 + 1 ) ); // E.g. 115.00 -> 119.00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
}
|
317 |
}
|
318 |
+
return $the_modified_price;
|
319 |
+
}
|
|
|
320 |
|
321 |
}
|
322 |
|
includes/class-wcj-product-tabs.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Tabs class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -37,6 +37,8 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
37 |
|
38 |
/**
|
39 |
* Customize the product tabs.
|
|
|
|
|
40 |
*/
|
41 |
function customize_product_tabs( $tabs ) {
|
42 |
|
@@ -75,18 +77,28 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
75 |
if ( '' != get_option( 'wcj_custom_product_tabs_title_' . $key, '' ) && '' != get_option( 'wcj_custom_product_tabs_content_' . $key, '' ) ) {
|
76 |
|
77 |
// Exclude by product id
|
78 |
-
$
|
79 |
-
if ( ''
|
80 |
-
$
|
81 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
82 |
continue;
|
|
|
83 |
}
|
84 |
|
85 |
// Exclude by product category
|
86 |
-
$
|
87 |
-
if ( ''
|
88 |
-
$
|
89 |
-
|
|
|
|
|
|
|
|
|
90 |
$do_exclude = false;
|
91 |
$product_categories_objects = get_the_terms( $product->id, 'product_cat' );
|
92 |
if ( $product_categories_objects && ! empty( $product_categories_objects ) ) {
|
@@ -97,24 +109,53 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
97 |
}
|
98 |
}
|
99 |
}
|
100 |
-
if ( $do_exclude )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
continue;
|
|
|
102 |
}
|
103 |
|
104 |
// Include by product id
|
105 |
-
$
|
106 |
-
if ( ''
|
107 |
-
$
|
|
|
|
|
|
|
|
|
|
|
108 |
// If NOT in array then hide this tab for this product
|
109 |
-
if ( $product && $array_to_include && ! in_array( $product->id, $array_to_include ) )
|
110 |
continue;
|
|
|
111 |
}
|
112 |
|
113 |
// Include by product category
|
114 |
-
$
|
115 |
-
if ( ''
|
116 |
-
$
|
117 |
-
|
|
|
|
|
|
|
|
|
118 |
$do_include = false;
|
119 |
$product_categories_objects = get_the_terms( $product->id, 'product_cat' );
|
120 |
if ( $product_categories_objects && ! empty( $product_categories_objects ) ) {
|
@@ -125,8 +166,27 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
125 |
}
|
126 |
}
|
127 |
}
|
128 |
-
if ( ! $do_include )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
continue;
|
|
|
130 |
}
|
131 |
|
132 |
// Adding the tab
|
@@ -304,7 +364,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
304 |
/**
|
305 |
* get_settings.
|
306 |
*
|
307 |
-
* @version 2.
|
308 |
*/
|
309 |
function get_settings() {
|
310 |
|
@@ -330,6 +390,24 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
330 |
),
|
331 |
);
|
332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_global_total_number', 1 ) ); $i++ ) {
|
334 |
$settings = array_merge( $settings,
|
335 |
array(
|
@@ -359,7 +437,67 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
359 |
),
|
360 |
array(
|
361 |
'title' => '',
|
362 |
-
'desc' => __( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
'desc_tip' => __( 'To hide this tab from some products, enter product IDs here.', 'woocommerce-jetpack' ),
|
364 |
'id' => 'wcj_custom_product_tabs_title_global_hide_in_product_ids_' . $i,
|
365 |
'default' => '',
|
@@ -368,25 +506,25 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
368 |
),
|
369 |
array(
|
370 |
'title' => '',
|
371 |
-
'desc' => __( 'Comma separated
|
372 |
-
'desc_tip' => __( 'To
|
373 |
-
'id' => '
|
374 |
'default' => '',
|
375 |
'type' => 'text',
|
376 |
'css' => 'width:30%;min-width:300px;',
|
377 |
),
|
378 |
array(
|
379 |
'title' => '',
|
380 |
-
'desc' => __( 'Comma separated
|
381 |
-
'desc_tip' => __( 'To
|
382 |
-
'id' => '
|
383 |
'default' => '',
|
384 |
'type' => 'text',
|
385 |
'css' => 'width:30%;min-width:300px;',
|
386 |
),
|
387 |
array(
|
388 |
'title' => '',
|
389 |
-
'desc' => __( 'Comma separated CATEGORY IDs to SHOW this tab', 'woocommerce-jetpack' ),
|
390 |
'desc_tip' => __( 'To show this tab only for some categories, enter category IDs here.', 'woocommerce-jetpack' ),
|
391 |
'id' => 'wcj_custom_product_tabs_title_global_show_in_cats_ids_' . $i,
|
392 |
'default' => '',
|
@@ -406,22 +544,23 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
406 |
|
407 |
// Local Custom Tabs
|
408 |
array(
|
409 |
-
'title' => __( '
|
410 |
'type' => 'title',
|
411 |
-
'desc' => __( 'This section lets you set defaults for
|
412 |
'id' => 'wcj_custom_product_tabs_options_local',
|
413 |
),
|
414 |
|
415 |
array(
|
416 |
-
'title' => __( 'Enable Custom Product Tabs', 'woocommerce-jetpack' ),
|
417 |
-
|
|
|
418 |
'id' => 'wcj_custom_product_tabs_local_enabled',
|
419 |
'default' => 'yes',
|
420 |
'type' => 'checkbox',
|
421 |
),
|
422 |
|
423 |
array(
|
424 |
-
'title' => __( 'Default
|
425 |
'id' => 'wcj_custom_product_tabs_local_total_number_default',
|
426 |
'default' => 1,
|
427 |
'type' => 'number',
|
@@ -452,23 +591,23 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
452 |
),
|
453 |
|
454 |
array(
|
455 |
-
'title' =>
|
456 |
-
'
|
457 |
-
'default' => 10,
|
458 |
-
'type' => 'number',
|
459 |
-
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
460 |
-
'custom_attributes'
|
461 |
-
=> apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
462 |
-
),
|
463 |
-
|
464 |
-
array(
|
465 |
-
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
466 |
'desc_tip' => __( 'Leave blank for WooCommerce defaults', 'woocommerce-jetpack' ),
|
467 |
'id' => 'wcj_product_info_product_tabs_description_title',
|
468 |
'default' => '',
|
469 |
'type' => 'text',
|
470 |
),
|
471 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
array(
|
473 |
'title' => __( 'Additional Information Tab', 'woocommerce-jetpack' ),
|
474 |
'desc' => __( 'Remove tab from product page', 'woocommerce-jetpack' ),
|
@@ -478,23 +617,23 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
478 |
),
|
479 |
|
480 |
array(
|
481 |
-
'title' =>
|
482 |
-
'
|
483 |
-
'default' => 20,
|
484 |
-
'type' => 'number',
|
485 |
-
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
486 |
-
'custom_attributes'
|
487 |
-
=> apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
488 |
-
),
|
489 |
-
|
490 |
-
array(
|
491 |
-
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
492 |
'desc_tip' => __( 'Leave blank for WooCommerce defaults', 'woocommerce-jetpack' ),
|
493 |
'id' => 'wcj_product_info_product_tabs_additional_information_title',
|
494 |
'default' => '',
|
495 |
'type' => 'text',
|
496 |
),
|
497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
array(
|
499 |
'title' => __( 'Reviews Tab', 'woocommerce-jetpack' ),
|
500 |
'desc' => __( 'Remove tab from product page', 'woocommerce-jetpack' ),
|
@@ -504,23 +643,23 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
504 |
),
|
505 |
|
506 |
array(
|
507 |
-
'title' =>
|
508 |
-
'
|
509 |
-
'default' => 30,
|
510 |
-
'type' => 'number',
|
511 |
-
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
512 |
-
'custom_attributes'
|
513 |
-
=> apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
514 |
-
),
|
515 |
-
|
516 |
-
array(
|
517 |
-
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
518 |
'desc_tip' => __( 'Leave blank for WooCommerce defaults', 'woocommerce-jetpack' ),
|
519 |
'id' => 'wcj_product_info_product_tabs_reviews_title',
|
520 |
'default' => '',
|
521 |
'type' => 'text',
|
522 |
),
|
523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
array(
|
525 |
'type' => 'sectionend',
|
526 |
'id' => 'wcj_product_info_product_tabs_options',
|
@@ -528,7 +667,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
528 |
|
529 |
) );
|
530 |
|
531 |
-
return $this->
|
532 |
}
|
533 |
}
|
534 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Tabs class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
37 |
|
38 |
/**
|
39 |
* Customize the product tabs.
|
40 |
+
*
|
41 |
+
* @version 2.4.4
|
42 |
*/
|
43 |
function customize_product_tabs( $tabs ) {
|
44 |
|
77 |
if ( '' != get_option( 'wcj_custom_product_tabs_title_' . $key, '' ) && '' != get_option( 'wcj_custom_product_tabs_content_' . $key, '' ) ) {
|
78 |
|
79 |
// Exclude by product id
|
80 |
+
$array_to_exclude = get_option( 'wcj_custom_product_tabs_global_hide_in_products_' . $i );
|
81 |
+
if ( '' == $array_to_exclude || empty( $array_to_exclude ) ) {
|
82 |
+
$list_to_exclude = get_option( 'wcj_custom_product_tabs_title_global_hide_in_product_ids_' . $i );
|
83 |
+
if ( '' != $list_to_exclude ) {
|
84 |
+
$array_to_exclude = explode( ',', $list_to_exclude );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
if ( '' != $array_to_exclude && ! empty( $array_to_exclude ) ) {
|
88 |
+
if ( $product && $array_to_exclude && in_array( $product->id, $array_to_exclude ) ) {
|
89 |
continue;
|
90 |
+
}
|
91 |
}
|
92 |
|
93 |
// Exclude by product category
|
94 |
+
$array_to_exclude = get_option( 'wcj_custom_product_tabs_global_hide_in_cats_' . $i );
|
95 |
+
if ( '' == $array_to_exclude || empty( $array_to_exclude ) ) {
|
96 |
+
$list_to_exclude = get_option( 'wcj_custom_product_tabs_title_global_hide_in_cats_ids_' . $i );
|
97 |
+
if ( '' != $list_to_exclude ) {
|
98 |
+
$array_to_exclude = explode( ',', $list_to_exclude );
|
99 |
+
}
|
100 |
+
}
|
101 |
+
if ( '' != $array_to_exclude && ! empty( $array_to_exclude ) ) {
|
102 |
$do_exclude = false;
|
103 |
$product_categories_objects = get_the_terms( $product->id, 'product_cat' );
|
104 |
if ( $product_categories_objects && ! empty( $product_categories_objects ) ) {
|
109 |
}
|
110 |
}
|
111 |
}
|
112 |
+
if ( $do_exclude ) {
|
113 |
+
continue;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
// Exclude by product tag
|
118 |
+
$array_to_exclude = get_option( 'wcj_custom_product_tabs_global_hide_in_tags_' . $i );
|
119 |
+
if ( '' != $array_to_exclude && ! empty( $array_to_exclude ) ) {
|
120 |
+
$do_exclude = false;
|
121 |
+
$product_tags_objects = get_the_terms( $product->id, 'product_tag' );
|
122 |
+
if ( $product_tags_objects && ! empty( $product_tags_objects ) ) {
|
123 |
+
foreach ( $product_tags_objects as $product_tags_object ) {
|
124 |
+
if ( $product && $array_to_exclude && in_array( $product_tags_object->term_id, $array_to_exclude ) ) {
|
125 |
+
$do_exclude = true;
|
126 |
+
break;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
130 |
+
if ( $do_exclude ) {
|
131 |
continue;
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
// Include by product id
|
136 |
+
$array_to_include = get_option( 'wcj_custom_product_tabs_global_show_in_products_' . $i );
|
137 |
+
if ( '' == $array_to_include || empty( $array_to_include ) ) {
|
138 |
+
$list_to_include = get_option( 'wcj_custom_product_tabs_title_global_show_in_product_ids_' . $i );
|
139 |
+
if ( '' != $list_to_include ) {
|
140 |
+
$array_to_include = explode( ',', $list_to_include );
|
141 |
+
}
|
142 |
+
}
|
143 |
+
if ( '' != $array_to_include && ! empty( $array_to_include ) ) {
|
144 |
// If NOT in array then hide this tab for this product
|
145 |
+
if ( $product && $array_to_include && ! in_array( $product->id, $array_to_include ) ) {
|
146 |
continue;
|
147 |
+
}
|
148 |
}
|
149 |
|
150 |
// Include by product category
|
151 |
+
$array_to_include = get_option( 'wcj_custom_product_tabs_global_show_in_cats_' . $i );
|
152 |
+
if ( '' == $array_to_include || empty( $array_to_include ) ) {
|
153 |
+
$list_to_include = get_option( 'wcj_custom_product_tabs_title_global_show_in_cats_ids_' . $i );
|
154 |
+
if ( '' != $list_to_include ) {
|
155 |
+
$array_to_include = explode( ',', $list_to_include );
|
156 |
+
}
|
157 |
+
}
|
158 |
+
if ( '' != $array_to_include && ! empty( $array_to_include ) ) {
|
159 |
$do_include = false;
|
160 |
$product_categories_objects = get_the_terms( $product->id, 'product_cat' );
|
161 |
if ( $product_categories_objects && ! empty( $product_categories_objects ) ) {
|
166 |
}
|
167 |
}
|
168 |
}
|
169 |
+
if ( ! $do_include ) {
|
170 |
+
continue;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
// Include by product tag
|
175 |
+
$array_to_include = get_option( 'wcj_custom_product_tabs_global_show_in_tags_' . $i );
|
176 |
+
if ( '' != $array_to_include && ! empty( $array_to_include ) ) {
|
177 |
+
$do_include = false;
|
178 |
+
$product_tags_objects = get_the_terms( $product->id, 'product_tag' );
|
179 |
+
if ( $product_tags_objects && ! empty( $product_tags_objects ) ) {
|
180 |
+
foreach ( $product_tags_objects as $product_tags_object ) {
|
181 |
+
if ( $product && $array_to_include && in_array( $product_tags_object->term_id, $array_to_include ) ) {
|
182 |
+
$do_include = true;
|
183 |
+
break;
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
if ( ! $do_include ) {
|
188 |
continue;
|
189 |
+
}
|
190 |
}
|
191 |
|
192 |
// Adding the tab
|
364 |
/**
|
365 |
* get_settings.
|
366 |
*
|
367 |
+
* @version 2.4.4
|
368 |
*/
|
369 |
function get_settings() {
|
370 |
|
390 |
),
|
391 |
);
|
392 |
|
393 |
+
$product_tags_options = array();
|
394 |
+
$product_tags = get_terms( 'product_tag', 'orderby=name&hide_empty=0' );
|
395 |
+
if ( ! empty( $product_tags ) && ! is_wp_error( $product_tags ) ){
|
396 |
+
foreach ( $product_tags as $product_tag ) {
|
397 |
+
$product_tags_options[ $product_tag->term_id ] = $product_tag->name;
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
$product_cats_options = array();
|
402 |
+
$product_cats = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
|
403 |
+
if ( ! empty( $product_cats ) && ! is_wp_error( $product_cats ) ){
|
404 |
+
foreach ( $product_cats as $product_cat ) {
|
405 |
+
$product_cats_options[ $product_cat->term_id ] = $product_cat->name;
|
406 |
+
}
|
407 |
+
}
|
408 |
+
|
409 |
+
$products_options = apply_filters( 'wcj_get_products_filter', array() );
|
410 |
+
|
411 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_global_total_number', 1 ) ); $i++ ) {
|
412 |
$settings = array_merge( $settings,
|
413 |
array(
|
437 |
),
|
438 |
array(
|
439 |
'title' => '',
|
440 |
+
'desc' => __( 'PRODUCTS to HIDE this tab', 'woocommerce-jetpack' ),
|
441 |
+
'desc_tip' => __( 'To hide this tab from some products, enter products here.', 'woocommerce-jetpack' ),
|
442 |
+
'id' => 'wcj_custom_product_tabs_global_hide_in_products_' . $i,
|
443 |
+
'default' => '',
|
444 |
+
'class' => 'chosen_select',
|
445 |
+
'type' => 'multiselect',
|
446 |
+
'options' => $products_options,
|
447 |
+
),
|
448 |
+
array(
|
449 |
+
'title' => '',
|
450 |
+
'desc' => __( 'PRODUCTS to SHOW this tab', 'woocommerce-jetpack' ),
|
451 |
+
'desc_tip' => __( 'To show this tab only for some products, enter products here.', 'woocommerce-jetpack' ),
|
452 |
+
'id' => 'wcj_custom_product_tabs_global_show_in_products_' . $i,
|
453 |
+
'default' => '',
|
454 |
+
'class' => 'chosen_select',
|
455 |
+
'type' => 'multiselect',
|
456 |
+
'options' => $products_options,
|
457 |
+
),
|
458 |
+
array(
|
459 |
+
'title' => '',
|
460 |
+
'desc' => __( 'CATEGORIES to HIDE this tab', 'woocommerce-jetpack' ),
|
461 |
+
'desc_tip' => __( 'To hide this tab from some categories, enter categories here.', 'woocommerce-jetpack' ),
|
462 |
+
'id' => 'wcj_custom_product_tabs_global_hide_in_cats_' . $i,
|
463 |
+
'default' => '',
|
464 |
+
'class' => 'chosen_select',
|
465 |
+
'type' => 'multiselect',
|
466 |
+
'options' => $product_cats_options,
|
467 |
+
),
|
468 |
+
array(
|
469 |
+
'title' => '',
|
470 |
+
'desc' => __( 'CATEGORIES to SHOW this tab', 'woocommerce-jetpack' ),
|
471 |
+
'desc_tip' => __( 'To show this tab only for some categories, enter categories here.', 'woocommerce-jetpack' ),
|
472 |
+
'id' => 'wcj_custom_product_tabs_global_show_in_cats_' . $i,
|
473 |
+
'default' => '',
|
474 |
+
'class' => 'chosen_select',
|
475 |
+
'type' => 'multiselect',
|
476 |
+
'options' => $product_cats_options,
|
477 |
+
),
|
478 |
+
array(
|
479 |
+
'title' => '',
|
480 |
+
'desc' => __( 'TAGS to HIDE this tab', 'woocommerce-jetpack' ),
|
481 |
+
'desc_tip' => __( 'To hide this tab from some tags, enter tags here.', 'woocommerce-jetpack' ),
|
482 |
+
'id' => 'wcj_custom_product_tabs_global_hide_in_tags_' . $i,
|
483 |
+
'default' => '',
|
484 |
+
'class' => 'chosen_select',
|
485 |
+
'type' => 'multiselect',
|
486 |
+
'options' => $product_tags_options,
|
487 |
+
),
|
488 |
+
array(
|
489 |
+
'title' => '',
|
490 |
+
'desc' => __( 'TAGS to SHOW this tab', 'woocommerce-jetpack' ),
|
491 |
+
'desc_tip' => __( 'To show this tab only for some tags, enter tags here.', 'woocommerce-jetpack' ),
|
492 |
+
'id' => 'wcj_custom_product_tabs_global_show_in_tags_' . $i,
|
493 |
+
'default' => '',
|
494 |
+
'class' => 'chosen_select',
|
495 |
+
'type' => 'multiselect',
|
496 |
+
'options' => $product_tags_options,
|
497 |
+
),
|
498 |
+
array(
|
499 |
+
'title' => '',
|
500 |
+
'desc' => __( 'Comma separated PRODUCT IDs to HIDE this tab', 'woocommerce-jetpack' ) . '. <strong><em>' . __( 'Depreciated', 'woocommerce-jetpack' ) . '!</em></strong>',
|
501 |
'desc_tip' => __( 'To hide this tab from some products, enter product IDs here.', 'woocommerce-jetpack' ),
|
502 |
'id' => 'wcj_custom_product_tabs_title_global_hide_in_product_ids_' . $i,
|
503 |
'default' => '',
|
506 |
),
|
507 |
array(
|
508 |
'title' => '',
|
509 |
+
'desc' => __( 'Comma separated PRODUCT IDs to SHOW this tab', 'woocommerce-jetpack' ) . '. <strong><em>' . __( 'Depreciated', 'woocommerce-jetpack' ) . '!</em></strong>',
|
510 |
+
'desc_tip' => __( 'To show this tab only for some products, enter product IDs here.', 'woocommerce-jetpack' ),
|
511 |
+
'id' => 'wcj_custom_product_tabs_title_global_show_in_product_ids_' . $i,
|
512 |
'default' => '',
|
513 |
'type' => 'text',
|
514 |
'css' => 'width:30%;min-width:300px;',
|
515 |
),
|
516 |
array(
|
517 |
'title' => '',
|
518 |
+
'desc' => __( 'Comma separated CATEGORY IDs to HIDE this tab', 'woocommerce-jetpack' ) . '. <strong><em>' . __( 'Depreciated', 'woocommerce-jetpack' ) . '!</em></strong>',
|
519 |
+
'desc_tip' => __( 'To hide this tab from some categories, enter category IDs here.', 'woocommerce-jetpack' ),
|
520 |
+
'id' => 'wcj_custom_product_tabs_title_global_hide_in_cats_ids_' . $i,
|
521 |
'default' => '',
|
522 |
'type' => 'text',
|
523 |
'css' => 'width:30%;min-width:300px;',
|
524 |
),
|
525 |
array(
|
526 |
'title' => '',
|
527 |
+
'desc' => __( 'Comma separated CATEGORY IDs to SHOW this tab', 'woocommerce-jetpack' ) . '. <strong><em>' . __( 'Depreciated', 'woocommerce-jetpack' ) . '!</em></strong>',
|
528 |
'desc_tip' => __( 'To show this tab only for some categories, enter category IDs here.', 'woocommerce-jetpack' ),
|
529 |
'id' => 'wcj_custom_product_tabs_title_global_show_in_cats_ids_' . $i,
|
530 |
'default' => '',
|
544 |
|
545 |
// Local Custom Tabs
|
546 |
array(
|
547 |
+
'title' => __( 'Custom Product Tabs - Per Product', 'woocommerce-jetpack' ),
|
548 |
'type' => 'title',
|
549 |
+
'desc' => __( 'This section lets you set defaults for per product custom tabs.', 'woocommerce-jetpack' ),
|
550 |
'id' => 'wcj_custom_product_tabs_options_local',
|
551 |
),
|
552 |
|
553 |
array(
|
554 |
+
'title' => __( 'Enable Per Product Custom Product Tabs', 'woocommerce-jetpack' ),
|
555 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
556 |
+
'desc_tip' => __( 'This will add meta boxes to each product\'s edit page.', 'woocommerce-jetpack' ),
|
557 |
'id' => 'wcj_custom_product_tabs_local_enabled',
|
558 |
'default' => 'yes',
|
559 |
'type' => 'checkbox',
|
560 |
),
|
561 |
|
562 |
array(
|
563 |
+
'title' => __( 'Default Per Product Custom Product Tabs Number', 'woocommerce-jetpack' ),
|
564 |
'id' => 'wcj_custom_product_tabs_local_total_number_default',
|
565 |
'default' => 1,
|
566 |
'type' => 'number',
|
591 |
),
|
592 |
|
593 |
array(
|
594 |
+
'title' => '',
|
595 |
+
'desc' => __( 'Title.', 'woocommerce-jetpack' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
'desc_tip' => __( 'Leave blank for WooCommerce defaults', 'woocommerce-jetpack' ),
|
597 |
'id' => 'wcj_product_info_product_tabs_description_title',
|
598 |
'default' => '',
|
599 |
'type' => 'text',
|
600 |
),
|
601 |
|
602 |
+
array(
|
603 |
+
'title' => '',
|
604 |
+
'id' => 'wcj_product_info_product_tabs_description_priority',
|
605 |
+
'default' => 10,
|
606 |
+
'type' => 'number',
|
607 |
+
'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
608 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
609 |
+
),
|
610 |
+
|
611 |
array(
|
612 |
'title' => __( 'Additional Information Tab', 'woocommerce-jetpack' ),
|
613 |
'desc' => __( 'Remove tab from product page', 'woocommerce-jetpack' ),
|
617 |
),
|
618 |
|
619 |
array(
|
620 |
+
'title' => '',
|
621 |
+
'desc' => __( 'Title.', 'woocommerce-jetpack' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
'desc_tip' => __( 'Leave blank for WooCommerce defaults', 'woocommerce-jetpack' ),
|
623 |
'id' => 'wcj_product_info_product_tabs_additional_information_title',
|
624 |
'default' => '',
|
625 |
'type' => 'text',
|
626 |
),
|
627 |
|
628 |
+
array(
|
629 |
+
'title' => '',
|
630 |
+
'id' => 'wcj_product_info_product_tabs_additional_information_priority',
|
631 |
+
'default' => 20,
|
632 |
+
'type' => 'number',
|
633 |
+
'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
634 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
635 |
+
),
|
636 |
+
|
637 |
array(
|
638 |
'title' => __( 'Reviews Tab', 'woocommerce-jetpack' ),
|
639 |
'desc' => __( 'Remove tab from product page', 'woocommerce-jetpack' ),
|
643 |
),
|
644 |
|
645 |
array(
|
646 |
+
'title' => '',
|
647 |
+
'desc' => __( 'Title.', 'woocommerce-jetpack' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
'desc_tip' => __( 'Leave blank for WooCommerce defaults', 'woocommerce-jetpack' ),
|
649 |
'id' => 'wcj_product_info_product_tabs_reviews_title',
|
650 |
'default' => '',
|
651 |
'type' => 'text',
|
652 |
),
|
653 |
|
654 |
+
array(
|
655 |
+
'title' => '',
|
656 |
+
'id' => 'wcj_product_info_product_tabs_reviews_priority',
|
657 |
+
'default' => 30,
|
658 |
+
'type' => 'number',
|
659 |
+
'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
660 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
661 |
+
),
|
662 |
+
|
663 |
array(
|
664 |
'type' => 'sectionend',
|
665 |
'id' => 'wcj_product_info_product_tabs_options',
|
667 |
|
668 |
) );
|
669 |
|
670 |
+
return $this->add_standard_settings( $settings );
|
671 |
}
|
672 |
}
|
673 |
|
includes/class-wcj-shipping.php
CHANGED
@@ -4,205 +4,334 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Shipping class.
|
6 |
*
|
7 |
-
* @
|
8 |
-
* @
|
9 |
-
* @category Class
|
10 |
-
* @author Algoritmika Ltd.
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
14 |
-
|
15 |
if ( ! class_exists( 'WCJ_Shipping' ) ) :
|
16 |
-
|
17 |
-
class WCJ_Shipping {
|
18 |
-
|
19 |
/**
|
20 |
* Constructor.
|
|
|
|
|
21 |
*/
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
-
|
38 |
/**
|
39 |
-
*
|
|
|
|
|
|
|
40 |
*/
|
41 |
-
|
42 |
-
|
43 |
-
$all_settings = $this->get_settings();
|
44 |
-
$settings[] = $all_settings[1];
|
45 |
-
|
46 |
-
return $settings;
|
47 |
}
|
48 |
-
|
49 |
-
function add_hide_shipping_if_free_available_fields( $settings ) {
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
'default' => 'no',
|
79 |
-
'type' => 'checkbox',
|
80 |
-
'checkboxgroup' => 'end',
|
81 |
-
);
|
82 |
-
|
83 |
-
//$updated_settings[] =
|
84 |
-
// array( 'type' => 'sectionend', 'id' => 'wcj_shipping_hide_if_free_available_options' );
|
85 |
-
|
86 |
-
}
|
87 |
-
|
88 |
-
$updated_settings[] = $section;
|
89 |
-
}
|
90 |
-
|
91 |
-
return $updated_settings;
|
92 |
-
}
|
93 |
-
|
94 |
function hide_shipping_when_free_is_available( $rates, $package ) {
|
95 |
-
|
96 |
-
//print_r( $rates );
|
97 |
-
|
98 |
// Only modify rates if free_shipping is present
|
99 |
if ( isset( $rates['free_shipping'] ) ) {
|
100 |
-
|
101 |
// To unset a single rate/method, do the following. This example unsets flat_rate shipping
|
102 |
-
if ( get_option( 'wcj_shipping_hide_if_free_available_local_delivery' )
|
103 |
unset( $rates['local_delivery'] );
|
104 |
-
|
105 |
-
if ( get_option( 'wcj_shipping_hide_if_free_available_all' )
|
106 |
-
|
107 |
// To unset all methods except for free_shipping, do the following
|
108 |
$free_shipping = $rates['free_shipping'];
|
109 |
-
//unset( $rates );
|
110 |
$rates = array();
|
111 |
$rates['free_shipping'] = $free_shipping;
|
112 |
}
|
113 |
-
|
114 |
-
//echo 'free-shipping';
|
115 |
}
|
116 |
-
|
117 |
return $rates;
|
118 |
-
}
|
119 |
-
|
120 |
/**
|
121 |
* Hide ALL Shipping option when free shipping is available
|
122 |
*
|
123 |
* @param array $available_methods
|
124 |
-
|
125 |
-
function hide_all_shipping_when_free_is_available( $available_methods ) {
|
126 |
-
|
127 |
if( isset( $available_methods['free_shipping'] ) ) {
|
128 |
-
|
129 |
// Get Free Shipping array into a new array
|
130 |
$freeshipping = array();
|
131 |
$freeshipping = $available_methods['free_shipping'];
|
132 |
-
|
133 |
// Empty the $available_methods array
|
134 |
unset( $available_methods );
|
135 |
-
|
136 |
// Add Free Shipping back into $avaialble_methods
|
137 |
$available_methods = array();
|
138 |
$available_methods[] = $freeshipping;
|
139 |
-
|
140 |
}
|
141 |
-
|
142 |
return $available_methods;
|
143 |
-
}
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
/**
|
146 |
* get_settings.
|
147 |
-
|
|
|
|
|
148 |
function get_settings() {
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
'desc_tip' => __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack' ),
|
158 |
-
'id' => 'wcj_shipping_enabled',
|
159 |
-
'default' => 'no',
|
160 |
-
'type' => 'checkbox',
|
161 |
-
),
|
162 |
-
|
163 |
-
array( 'type' => 'sectionend', 'id' => 'wcj_shipping_options' ),
|
164 |
-
|
165 |
-
array( 'title' => __( 'Hide if free is available', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you hide other shipping options when free shipping is available on shop frontend.', 'woocommerce-jetpack' ), 'id' => 'wcj_shipping_hide_if_free_available_options' ),
|
166 |
-
|
167 |
-
array(
|
168 |
-
//'title' => __( 'Hide local delivery', 'woocommerce-jetpack' ),
|
169 |
'title' => __( 'Hide shipping', 'woocommerce-jetpack' ),
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
'
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* settings_section.
|
197 |
-
*/
|
198 |
-
function settings_section( $sections ) {
|
199 |
-
|
200 |
-
$sections['shipping'] = __( 'Shipping', 'woocommerce-jetpack' );
|
201 |
-
|
202 |
-
return $sections;
|
203 |
-
}
|
204 |
}
|
205 |
-
|
206 |
endif;
|
207 |
-
|
208 |
return new WCJ_Shipping();
|
4 |
*
|
5 |
* The WooCommerce Jetpack Shipping class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
+
* @author Algoritmika Ltd.
|
|
|
|
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
12 |
+
|
13 |
if ( ! class_exists( 'WCJ_Shipping' ) ) :
|
14 |
+
|
15 |
+
class WCJ_Shipping extends WCJ_Module {
|
16 |
+
|
17 |
/**
|
18 |
* Constructor.
|
19 |
+
*
|
20 |
+
* @version 2.4.4
|
21 |
*/
|
22 |
+
function __construct() {
|
23 |
+
|
24 |
+
$this->id = 'shipping';
|
25 |
+
$this->short_desc = __( 'Shipping', 'woocommerce-jetpack' );
|
26 |
+
$this->desc = __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack' );
|
27 |
+
parent::__construct();
|
28 |
+
|
29 |
+
if ( $this->is_enabled() ) {
|
30 |
+
// include_once( 'shipping/class-wc-shipping-wcj-custom.php' );
|
31 |
+
// add_filter( 'woocommerce_available_shipping_methods', array( $this, 'hide_all_shipping_when_free_is_available' ), 10, 1 );
|
32 |
+
add_filter( 'woocommerce_package_rates', array( $this, 'hide_shipping_when_free_is_available' ), 10, 2 );
|
33 |
+
add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), 100 );
|
34 |
+
|
35 |
+
if ( 'yes' === get_option( 'wcj_shipping_left_to_free_info_enabled_cart', 'no' ) ) {
|
36 |
+
add_action(
|
37 |
+
get_option( 'wcj_shipping_left_to_free_info_position_cart', 'woocommerce_after_cart_totals' ),
|
38 |
+
array( $this, 'show_left_to_free_shipping_info_cart' ),
|
39 |
+
get_option( 'wcj_shipping_left_to_free_info_priority_cart', 10 )
|
40 |
+
);
|
41 |
+
}
|
42 |
+
if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_shipping_left_to_free_info_enabled_mini_cart', 'no' ) ) ) {
|
43 |
+
add_action(
|
44 |
+
get_option( 'wcj_shipping_left_to_free_info_position_mini_cart', 'woocommerce_after_mini_cart' ),
|
45 |
+
array( $this, 'show_left_to_free_shipping_info_mini_cart' ),
|
46 |
+
get_option( 'wcj_shipping_left_to_free_info_priority_mini_cart', 10 )
|
47 |
+
);
|
48 |
+
}
|
49 |
+
if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_shipping_left_to_free_info_enabled_checkout', 'no' ) ) ) {
|
50 |
+
add_action(
|
51 |
+
get_option( 'wcj_shipping_left_to_free_info_position_checkout', 'woocommerce_checkout_after_order_review' ),
|
52 |
+
array( $this, 'show_left_to_free_shipping_info_checkout' ),
|
53 |
+
get_option( 'wcj_shipping_left_to_free_info_priority_checkout', 10 )
|
54 |
+
);
|
55 |
+
}
|
56 |
+
}
|
57 |
}
|
58 |
+
|
59 |
/**
|
60 |
+
* show_left_to_free_shipping_info_checkout.
|
61 |
+
*
|
62 |
+
* @version 2.4.4
|
63 |
+
* @since 2.4.4
|
64 |
*/
|
65 |
+
function show_left_to_free_shipping_info_checkout() {
|
66 |
+
$this->show_left_to_free_shipping_info( get_option( 'wcj_shipping_left_to_free_info_content_checkout', __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ) ) );
|
|
|
|
|
|
|
|
|
67 |
}
|
|
|
|
|
68 |
|
69 |
+
/**
|
70 |
+
* show_left_to_free_shipping_info_mini_cart.
|
71 |
+
*
|
72 |
+
* @version 2.4.4
|
73 |
+
* @since 2.4.4
|
74 |
+
*/
|
75 |
+
function show_left_to_free_shipping_info_mini_cart() {
|
76 |
+
$this->show_left_to_free_shipping_info( get_option( 'wcj_shipping_left_to_free_info_content_mini_cart', __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ) ) );
|
77 |
+
}
|
78 |
|
79 |
+
/**
|
80 |
+
* show_left_to_free_shipping_info_cart.
|
81 |
+
*
|
82 |
+
* @version 2.4.4
|
83 |
+
* @since 2.4.4
|
84 |
+
*/
|
85 |
+
function show_left_to_free_shipping_info_cart() {
|
86 |
+
$this->show_left_to_free_shipping_info( get_option( 'wcj_shipping_left_to_free_info_content_cart', __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ) ) );
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* show_left_to_free_shipping_info.
|
91 |
+
*
|
92 |
+
* @version 2.4.4
|
93 |
+
* @since 2.4.4
|
94 |
+
*/
|
95 |
+
function show_left_to_free_shipping_info( $content ) {
|
96 |
+
echo wcj_get_left_to_free_shipping( $content );
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* hide_shipping_when_free_is_available.
|
101 |
+
*
|
102 |
+
* @version 2.4.4
|
103 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
function hide_shipping_when_free_is_available( $rates, $package ) {
|
|
|
|
|
|
|
105 |
// Only modify rates if free_shipping is present
|
106 |
if ( isset( $rates['free_shipping'] ) ) {
|
|
|
107 |
// To unset a single rate/method, do the following. This example unsets flat_rate shipping
|
108 |
+
if ( 'yes' === get_option( 'wcj_shipping_hide_if_free_available_local_delivery' ) ) {
|
109 |
unset( $rates['local_delivery'] );
|
110 |
+
}
|
111 |
+
if ( 'yes' === get_option( 'wcj_shipping_hide_if_free_available_all' ) ) {
|
|
|
112 |
// To unset all methods except for free_shipping, do the following
|
113 |
$free_shipping = $rates['free_shipping'];
|
|
|
114 |
$rates = array();
|
115 |
$rates['free_shipping'] = $free_shipping;
|
116 |
}
|
|
|
|
|
117 |
}
|
|
|
118 |
return $rates;
|
119 |
+
}
|
120 |
+
|
121 |
/**
|
122 |
* Hide ALL Shipping option when free shipping is available
|
123 |
*
|
124 |
* @param array $available_methods
|
125 |
+
*/
|
126 |
+
/* function hide_all_shipping_when_free_is_available( $available_methods ) {
|
|
|
127 |
if( isset( $available_methods['free_shipping'] ) ) {
|
|
|
128 |
// Get Free Shipping array into a new array
|
129 |
$freeshipping = array();
|
130 |
$freeshipping = $available_methods['free_shipping'];
|
|
|
131 |
// Empty the $available_methods array
|
132 |
unset( $available_methods );
|
|
|
133 |
// Add Free Shipping back into $avaialble_methods
|
134 |
$available_methods = array();
|
135 |
$available_methods[] = $freeshipping;
|
|
|
136 |
}
|
|
|
137 |
return $available_methods;
|
138 |
+
} */
|
139 |
+
|
140 |
+
/**
|
141 |
+
* add_hide_shipping_if_free_available_fields.
|
142 |
+
*
|
143 |
+
* @version 2.4.4
|
144 |
+
*/
|
145 |
+
function add_hide_shipping_if_free_available_fields( $settings ) {
|
146 |
+
$updated_settings = array();
|
147 |
+
foreach ( $settings as $section ) {
|
148 |
+
if ( isset( $section['type'] ) && 'shipping_methods' === $section['type'] ) {
|
149 |
+
$updated_settings[] = array(
|
150 |
+
'title' => __( 'Booster: Hide shipping', 'woocommerce-jetpack' ),
|
151 |
+
'desc' => __( 'Hide local delivery when free is available', 'woocommerce-jetpack' ),
|
152 |
+
'desc_tip' => __( '', 'woocommerce-jetpack' ),
|
153 |
+
'id' => 'wcj_shipping_hide_if_free_available_local_delivery',
|
154 |
+
'default' => 'no',
|
155 |
+
'type' => 'checkbox',
|
156 |
+
'checkboxgroup' => 'start',
|
157 |
+
);
|
158 |
+
$updated_settings[] = array(
|
159 |
+
'desc' => __( 'Hide all when free is available', 'woocommerce-jetpack' ),
|
160 |
+
'desc_tip' => __( '', 'woocommerce-jetpack' ),
|
161 |
+
'id' => 'wcj_shipping_hide_if_free_available_all',
|
162 |
+
'default' => 'no',
|
163 |
+
'type' => 'checkbox',
|
164 |
+
'checkboxgroup' => 'end',
|
165 |
+
);
|
166 |
+
}
|
167 |
+
$updated_settings[] = $section;
|
168 |
+
}
|
169 |
+
return $updated_settings;
|
170 |
+
}
|
171 |
+
|
172 |
/**
|
173 |
* get_settings.
|
174 |
+
*
|
175 |
+
* @version 2.4.4
|
176 |
+
*/
|
177 |
function get_settings() {
|
178 |
+
$settings = array(
|
179 |
+
array(
|
180 |
+
'title' => __( 'Hide if free is available', 'woocommerce-jetpack' ),
|
181 |
+
'type' => 'title',
|
182 |
+
'desc' => __( 'This section lets you hide other shipping options when free shipping is available on shop frontend.', 'woocommerce-jetpack' ),
|
183 |
+
'id' => 'wcj_shipping_hide_if_free_available_options',
|
184 |
+
),
|
185 |
+
array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
'title' => __( 'Hide shipping', 'woocommerce-jetpack' ),
|
187 |
+
'desc' => __( 'Hide local delivery when free is available', 'woocommerce-jetpack' ),
|
188 |
+
'id' => 'wcj_shipping_hide_if_free_available_local_delivery',
|
189 |
+
'default' => 'no',
|
190 |
+
'type' => 'checkbox',
|
191 |
+
'checkboxgroup' => 'start',
|
192 |
+
),
|
193 |
+
array(
|
194 |
+
'desc' => __( 'Hide all when free is available', 'woocommerce-jetpack' ),
|
195 |
+
'id' => 'wcj_shipping_hide_if_free_available_all',
|
196 |
+
'default' => 'no',
|
197 |
+
'type' => 'checkbox',
|
198 |
+
'checkboxgroup' => 'end',
|
199 |
+
),
|
200 |
+
array(
|
201 |
+
'type' => 'sectionend',
|
202 |
+
'id' => 'wcj_shipping_hide_if_free_available_options',
|
203 |
+
),
|
204 |
+
array(
|
205 |
+
'title' => __( 'Left to Free Shipping Info Options', 'woocommerce-jetpack' ),
|
206 |
+
'type' => 'title',
|
207 |
+
'desc' => __( 'This section lets you enable info or cart, mini cart and checkout pages.', 'woocommerce-jetpack' )
|
208 |
+
. '<br>' . __( 'You can also use <em>Booster - Left to Free Shipping</em> widget, <em>[wcj_get_left_to_free_shipping content=""]</em> shortcode or <em>wcj_get_left_to_free_shipping( $content );</em> function.', 'woocommerce-jetpack' )
|
209 |
+
. '<br>' . __( 'In content you can use: <em>%left_to_free%</em> and <em>%free_shipping_min_amount%</em> shortcodes.', 'woocommerce-jetpack' ),
|
210 |
+
'id' => 'wcj_shipping_left_to_free_info_options',
|
211 |
+
),
|
212 |
+
array(
|
213 |
+
'title' => __( 'Info on Cart', 'woocommerce-jetpack' ),
|
214 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
215 |
+
'id' => 'wcj_shipping_left_to_free_info_enabled_cart',
|
216 |
+
'default' => 'no',
|
217 |
+
'type' => 'checkbox',
|
218 |
+
),
|
219 |
+
array(
|
220 |
+
'title' => '',
|
221 |
+
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
222 |
+
'id' => 'wcj_shipping_left_to_free_info_content_cart',
|
223 |
+
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
224 |
+
'type' => 'textarea',
|
225 |
+
'css' => 'width:30%;min-width:300px;height:100px;',
|
226 |
+
),
|
227 |
+
array(
|
228 |
+
'title' => '',
|
229 |
+
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
230 |
+
'id' => 'wcj_shipping_left_to_free_info_position_cart',
|
231 |
+
'default' => 'woocommerce_after_cart_totals',
|
232 |
+
'type' => 'select',
|
233 |
+
'options' => wcj_get_cart_filters(),
|
234 |
+
'css' => 'width:250px;',
|
235 |
+
),
|
236 |
+
array(
|
237 |
+
'title' => '',
|
238 |
+
'desc' => __( 'Order (Priority)', 'woocommerce-jetpack' ),
|
239 |
+
'id' => 'wcj_shipping_left_to_free_info_priority_cart',
|
240 |
+
'default' => 10,
|
241 |
+
'type' => 'number',
|
242 |
+
'css' => 'width:250px;',
|
243 |
+
),
|
244 |
+
array(
|
245 |
+
'title' => __( 'Info on Mini Cart', 'woocommerce-jetpack' ),
|
246 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
247 |
+
'id' => 'wcj_shipping_left_to_free_info_enabled_mini_cart',
|
248 |
+
'default' => 'no',
|
249 |
+
'type' => 'checkbox',
|
250 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
251 |
+
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
252 |
+
),
|
253 |
+
array(
|
254 |
+
'title' => '',
|
255 |
+
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
256 |
+
'id' => 'wcj_shipping_left_to_free_info_content_mini_cart',
|
257 |
+
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
258 |
+
'type' => 'textarea',
|
259 |
+
'css' => 'width:30%;min-width:300px;height:100px;',
|
260 |
+
),
|
261 |
+
array(
|
262 |
+
'title' => '',
|
263 |
+
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
264 |
+
'id' => 'wcj_shipping_left_to_free_info_position_mini_cart',
|
265 |
+
'default' => 'woocommerce_after_mini_cart',
|
266 |
+
'type' => 'select',
|
267 |
+
'options' => array(
|
268 |
+
'woocommerce_before_mini_cart' => __( 'Before mini cart', 'woocommerce-jetpack' ),
|
269 |
+
'woocommerce_widget_shopping_cart_before_buttons' => __( 'Before buttons', 'woocommerce-jetpack' ),
|
270 |
+
'woocommerce_after_mini_cart' => __( 'After mini cart', 'woocommerce-jetpack' ),
|
271 |
+
),
|
272 |
+
'css' => 'width:250px;',
|
273 |
+
),
|
274 |
+
array(
|
275 |
+
'title' => '',
|
276 |
+
'desc' => __( 'Order (Priority)', 'woocommerce-jetpack' ),
|
277 |
+
'id' => 'wcj_shipping_left_to_free_info_priority_mini_cart',
|
278 |
+
'default' => 10,
|
279 |
+
'type' => 'number',
|
280 |
+
'css' => 'width:250px;',
|
281 |
+
),
|
282 |
+
array(
|
283 |
+
'title' => __( 'Info on Checkout', 'woocommerce-jetpack' ),
|
284 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
285 |
+
'id' => 'wcj_shipping_left_to_free_info_enabled_checkout',
|
286 |
+
'default' => 'no',
|
287 |
+
'type' => 'checkbox',
|
288 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
289 |
+
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
290 |
+
),
|
291 |
+
array(
|
292 |
+
'title' => '',
|
293 |
+
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
294 |
+
'id' => 'wcj_shipping_left_to_free_info_content_checkout',
|
295 |
+
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
296 |
+
'type' => 'textarea',
|
297 |
+
'css' => 'width:30%;min-width:300px;height:100px;',
|
298 |
+
),
|
299 |
+
array(
|
300 |
+
'title' => '',
|
301 |
+
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
302 |
+
'id' => 'wcj_shipping_left_to_free_info_position_checkout',
|
303 |
+
'default' => 'woocommerce_checkout_after_order_review',
|
304 |
+
'type' => 'select',
|
305 |
+
'options' => array(
|
306 |
+
'woocommerce_before_checkout_form' => __( 'Before checkout form', 'woocommerce-jetpack' ),
|
307 |
+
'woocommerce_checkout_before_customer_details' => __( 'Before customer details', 'woocommerce-jetpack' ),
|
308 |
+
'woocommerce_checkout_billing' => __( 'Billing', 'woocommerce-jetpack' ),
|
309 |
+
'woocommerce_checkout_shipping' => __( 'Shipping', 'woocommerce-jetpack' ),
|
310 |
+
'woocommerce_checkout_after_customer_details' => __( 'After customer details', 'woocommerce-jetpack' ),
|
311 |
+
'woocommerce_checkout_before_order_review' => __( 'Before order review', 'woocommerce-jetpack' ),
|
312 |
+
'woocommerce_checkout_order_review' => __( 'Order review', 'woocommerce-jetpack' ),
|
313 |
+
'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
|
314 |
+
'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
|
315 |
+
),
|
316 |
+
'css' => 'width:250px;',
|
317 |
+
),
|
318 |
+
array(
|
319 |
+
'title' => '',
|
320 |
+
'desc' => __( 'Order (Priority)', 'woocommerce-jetpack' ),
|
321 |
+
'id' => 'wcj_shipping_left_to_free_info_priority_checkout',
|
322 |
+
'default' => 10,
|
323 |
+
'type' => 'number',
|
324 |
+
'css' => 'width:250px;',
|
325 |
+
),
|
326 |
+
array(
|
327 |
+
'type' => 'sectionend',
|
328 |
+
'id' => 'wcj_shipping_left_to_free_info_options',
|
329 |
+
),
|
330 |
+
);
|
331 |
+
return $this->add_standard_settings( $settings );
|
332 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
}
|
334 |
+
|
335 |
endif;
|
336 |
+
|
337 |
return new WCJ_Shipping();
|
includes/class-wcj-wpml.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack WPML class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -18,7 +18,7 @@ class WCJ_WPML extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.4.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
@@ -28,7 +28,7 @@ class WCJ_WPML extends WCJ_Module {
|
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
31 |
-
add_action( '
|
32 |
/* if ( 'yes' === get_option( 'wcj_' . $this->id . '_auto_regenerate', 'no' ) ) {
|
33 |
add_action( 'woojetpack_after_settings_save', array( $this, 'create_wpml_xml_file' ) );
|
34 |
} */
|
@@ -40,7 +40,7 @@ class WCJ_WPML extends WCJ_Module {
|
|
40 |
/**
|
41 |
* get_settings.
|
42 |
*
|
43 |
-
* @version 2.4.
|
44 |
*/
|
45 |
function get_settings() {
|
46 |
$settings = array(
|
@@ -70,10 +70,12 @@ class WCJ_WPML extends WCJ_Module {
|
|
70 |
'title' => __( 'Module Tools', 'woocommerce-jetpack' ),
|
71 |
'id' => 'wcj_' . $this->id . '_module_tools',
|
72 |
'type' => 'custom_link',
|
73 |
-
'link' =>
|
|
|
74 |
'<a href="' . add_query_arg( 'create_wpml_xml_file', '1' ) . '">' . __( 'Regenerate wpml-config.xml file', 'woocommerce-jetpack' ) . '</a>' .
|
75 |
-
'</
|
76 |
-
'<pre>' . $this->notice . '</pre>'
|
|
|
77 |
),
|
78 |
array(
|
79 |
'type' => 'sectionend',
|
@@ -104,7 +106,7 @@ class WCJ_WPML extends WCJ_Module {
|
|
104 |
/**
|
105 |
* create_wpml_xml_file.
|
106 |
*
|
107 |
-
* @version 2.4.
|
108 |
*/
|
109 |
function create_wpml_xml_file() {
|
110 |
$file_path = wcj_plugin_path() . '/wpml-config.xml';
|
@@ -114,11 +116,13 @@ class WCJ_WPML extends WCJ_Module {
|
|
114 |
fwrite( $handle, '<admin-texts>' . PHP_EOL );
|
115 |
$sections = apply_filters( 'wcj_settings_sections', array() );
|
116 |
foreach ( $sections as $section => $section_title ) {
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
|
|
122 |
}
|
123 |
}
|
124 |
}
|
@@ -132,16 +136,13 @@ class WCJ_WPML extends WCJ_Module {
|
|
132 |
/**
|
133 |
* is_wpml_value.
|
134 |
*
|
135 |
-
* @version 2.4.
|
|
|
136 |
*/
|
137 |
-
function
|
138 |
-
|
139 |
-
// Type
|
140 |
-
$is_type_ok = ( 'textarea' === $value['type'] || 'text' === $value['type'] ) ? true : false;
|
141 |
-
|
142 |
-
// Section
|
143 |
$sections_to_skip = array(
|
144 |
'price_by_country',
|
|
|
145 |
'currency',
|
146 |
'currency_external_products',
|
147 |
'bulk_price_converter',
|
@@ -180,7 +181,18 @@ class WCJ_WPML extends WCJ_Module {
|
|
180 |
'emails',
|
181 |
'wpml',
|
182 |
);
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
// ID
|
186 |
$values_to_skip = array(
|
@@ -202,7 +214,7 @@ class WCJ_WPML extends WCJ_Module {
|
|
202 |
}
|
203 |
|
204 |
// Final return
|
205 |
-
return ( $is_type_ok && $
|
206 |
}
|
207 |
|
208 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack WPML class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.4
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
31 |
+
add_action( 'init', array( $this, 'create_wpml_xml_file_tool' ), PHP_INT_MAX );
|
32 |
/* if ( 'yes' === get_option( 'wcj_' . $this->id . '_auto_regenerate', 'no' ) ) {
|
33 |
add_action( 'woojetpack_after_settings_save', array( $this, 'create_wpml_xml_file' ) );
|
34 |
} */
|
40 |
/**
|
41 |
* get_settings.
|
42 |
*
|
43 |
+
* @version 2.4.4
|
44 |
*/
|
45 |
function get_settings() {
|
46 |
$settings = array(
|
70 |
'title' => __( 'Module Tools', 'woocommerce-jetpack' ),
|
71 |
'id' => 'wcj_' . $this->id . '_module_tools',
|
72 |
'type' => 'custom_link',
|
73 |
+
'link' => ( $this->is_enabled() ) ?
|
74 |
+
'<code>' .
|
75 |
'<a href="' . add_query_arg( 'create_wpml_xml_file', '1' ) . '">' . __( 'Regenerate wpml-config.xml file', 'woocommerce-jetpack' ) . '</a>' .
|
76 |
+
'</code>' .
|
77 |
+
'<pre>' . $this->notice . '</pre>' :
|
78 |
+
'<code>' . __( 'Regenerate wpml-config.xml file', 'woocommerce-jetpack' ) . '</code>',
|
79 |
),
|
80 |
array(
|
81 |
'type' => 'sectionend',
|
106 |
/**
|
107 |
* create_wpml_xml_file.
|
108 |
*
|
109 |
+
* @version 2.4.4
|
110 |
*/
|
111 |
function create_wpml_xml_file() {
|
112 |
$file_path = wcj_plugin_path() . '/wpml-config.xml';
|
116 |
fwrite( $handle, '<admin-texts>' . PHP_EOL );
|
117 |
$sections = apply_filters( 'wcj_settings_sections', array() );
|
118 |
foreach ( $sections as $section => $section_title ) {
|
119 |
+
if ( $this->is_wpml_section( $section ) ) {
|
120 |
+
$settings = apply_filters( 'wcj_settings_' . $section, array() );
|
121 |
+
foreach ( $settings as $value ) {
|
122 |
+
if ( $this->is_wpml_value( $value ) ) {
|
123 |
+
fwrite( $handle, "\t\t" );
|
124 |
+
fwrite( $handle, '<key name="' . $value['id'] . '" />' . PHP_EOL );
|
125 |
+
}
|
126 |
}
|
127 |
}
|
128 |
}
|
136 |
/**
|
137 |
* is_wpml_value.
|
138 |
*
|
139 |
+
* @version 2.4.4
|
140 |
+
* @since 2.4.4
|
141 |
*/
|
142 |
+
function is_wpml_section( $section ) {
|
|
|
|
|
|
|
|
|
|
|
143 |
$sections_to_skip = array(
|
144 |
'price_by_country',
|
145 |
+
'multicurrency',
|
146 |
'currency',
|
147 |
'currency_external_products',
|
148 |
'bulk_price_converter',
|
181 |
'emails',
|
182 |
'wpml',
|
183 |
);
|
184 |
+
return ( ! in_array( $section, $sections_to_skip ) ) ? true : false;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* is_wpml_value.
|
189 |
+
*
|
190 |
+
* @version 2.4.4
|
191 |
+
*/
|
192 |
+
function is_wpml_value( $value ) {
|
193 |
+
|
194 |
+
// Type
|
195 |
+
$is_type_ok = ( 'textarea' === $value['type'] || 'text' === $value['type'] ) ? true : false;
|
196 |
|
197 |
// ID
|
198 |
$values_to_skip = array(
|
214 |
}
|
215 |
|
216 |
// Final return
|
217 |
+
return ( $is_type_ok && $is_id_ok );
|
218 |
}
|
219 |
|
220 |
}
|
includes/currencies/wcj-currencies.php
CHANGED
@@ -1,173 +1,179 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* WooCommerce Jetpack
|
4 |
*
|
5 |
-
* The WooCommerce Jetpack
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
/**
|
3 |
+
* WooCommerce Jetpack Currencies Array
|
4 |
*
|
5 |
+
* The WooCommerce Jetpack Currencies Array.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
11 |
+
if ( ! function_exists( 'wcj_get_currencies_array' ) ) {
|
12 |
+
function wcj_get_currencies_array() {
|
13 |
+
return array(
|
14 |
+
array( 'code' => 'AED', 'symbol' => 'د.إ', 'name' => __( 'United Arab Emirates Dirham', 'woocommerce' ) ),
|
15 |
+
array( 'code' => 'AFN', 'symbol' => 'AFN', 'name' => __( 'Afghan afghani', 'woocommerce-jetpack' ) ),
|
16 |
+
array( 'code' => 'ALL', 'symbol' => 'ALL', 'name' => __( 'Albanian lek', 'woocommerce-jetpack' ) ),
|
17 |
+
array( 'code' => 'AMD', 'symbol' => 'AMD', 'name' => __( 'Armenian dram', 'woocommerce-jetpack' ) ),
|
18 |
+
array( 'code' => 'ANG', 'symbol' => 'ANG', 'name' => __( 'Netherlands Antillean gulden', 'woocommerce-jetpack' ) ),
|
19 |
+
array( 'code' => 'AOA', 'symbol' => 'AOA', 'name' => __( 'Angolan kwanza', 'woocommerce-jetpack' ) ),
|
20 |
+
array( 'code' => 'ARS', 'symbol' => '$', 'name' => __( 'Argentine Peso', 'woocommerce' ) ),
|
21 |
+
array( 'code' => 'AUD', 'symbol' => '$', 'name' => __( 'Australian Dollars', 'woocommerce' ) ),
|
22 |
+
array( 'code' => 'AWG', 'symbol' => 'AWG', 'name' => __( 'Aruban florin', 'woocommerce-jetpack' ) ),
|
23 |
+
array( 'code' => 'AZN', 'symbol' => 'AZN', 'name' => __( 'Azerbaijani manat', 'woocommerce-jetpack' ) ),
|
24 |
+
array( 'code' => 'BAM', 'symbol' => 'BAM', 'name' => __( 'Bosnia and Herzegovina konvertibilna marka', 'woocommerce-jetpack' ) ),
|
25 |
+
array( 'code' => 'BBD', 'symbol' => 'BBD', 'name' => __( 'Barbadian dollar', 'woocommerce-jetpack' ) ),
|
26 |
+
array( 'code' => 'BDT', 'symbol' => '৳ ', 'name' => __( 'Bangladeshi Taka', 'woocommerce' ) ),
|
27 |
+
array( 'code' => 'BGN', 'symbol' => 'лв.', 'name' => __( 'Bulgarian Lev', 'woocommerce' ) ),
|
28 |
+
array( 'code' => 'BHD', 'symbol' => 'BHD', 'name' => __( 'Bahraini dinar', 'woocommerce-jetpack' ) ),
|
29 |
+
array( 'code' => 'BIF', 'symbol' => 'BIF', 'name' => __( 'Burundi franc', 'woocommerce-jetpack' ) ),
|
30 |
+
array( 'code' => 'BYR', 'symbol' => 'BYR', 'name' => __( 'Belarusian ruble', 'woocommerce-jetpack' ) ),
|
31 |
+
array( 'code' => 'BND', 'symbol' => 'BND', 'name' => __( 'Brunei dollar', 'woocommerce-jetpack' ) ),
|
32 |
+
array( 'code' => 'BOB', 'symbol' => 'BOB', 'name' => __( 'Bolivian boliviano', 'woocommerce-jetpack' ) ),
|
33 |
+
array( 'code' => 'BRL', 'symbol' => 'R$', 'name' => __( 'Brazilian Real', 'woocommerce' ) ),
|
34 |
+
array( 'code' => 'BSD', 'symbol' => 'BSD', 'name' => __( 'Bahamian dollar', 'woocommerce-jetpack' ) ),
|
35 |
+
array( 'code' => 'BTN', 'symbol' => 'BTN', 'name' => __( 'Bhutanese ngultrum', 'woocommerce-jetpack' ) ),
|
36 |
+
array( 'code' => 'BWP', 'symbol' => 'BWP', 'name' => __( 'Botswana pula', 'woocommerce-jetpack' ) ),
|
37 |
+
array( 'code' => 'BZD', 'symbol' => 'BZD', 'name' => __( 'Belize dollar', 'woocommerce-jetpack' ) ),
|
38 |
+
array( 'code' => 'CAD', 'symbol' => '$', 'name' => __( 'Canadian Dollars', 'woocommerce' ) ),
|
39 |
+
array( 'code' => 'CDF', 'symbol' => 'CDF', 'name' => __( 'Congolese franc', 'woocommerce-jetpack' ) ),
|
40 |
+
array( 'code' => 'CHF', 'symbol' => 'CHF', 'name' => __( 'Swiss Franc', 'woocommerce' ) ),
|
41 |
+
array( 'code' => 'CLP', 'symbol' => '$', 'name' => __( 'Chilean Peso', 'woocommerce' ) ),
|
42 |
+
array( 'code' => 'CNY', 'symbol' => '¥', 'name' => __( 'Chinese Yuan', 'woocommerce' ) ),
|
43 |
+
array( 'code' => 'COP', 'symbol' => '$', 'name' => __( 'Colombian Peso', 'woocommerce' ) ),
|
44 |
+
array( 'code' => 'CRC', 'symbol' => 'CRC', 'name' => __( 'Costa Rican colon', 'woocommerce-jetpack' ) ),
|
45 |
+
array( 'code' => 'CUC', 'symbol' => 'CUC', 'name' => __( 'Cuban peso', 'woocommerce-jetpack' ) ),
|
46 |
+
array( 'code' => 'CVE', 'symbol' => 'CVE', 'name' => __( 'Cape Verdean escudo', 'woocommerce-jetpack' ) ),
|
47 |
+
array( 'code' => 'CZK', 'symbol' => 'Kč', 'name' => __( 'Czech Koruna', 'woocommerce' ) ),
|
48 |
+
array( 'code' => 'DJF', 'symbol' => 'DJF', 'name' => __( 'Djiboutian franc', 'woocommerce-jetpack' ) ),
|
49 |
+
array( 'code' => 'DKK', 'symbol' => 'DKK', 'name' => __( 'Danish Krone', 'woocommerce' ) ),
|
50 |
+
array( 'code' => 'DOP', 'symbol' => 'RD$', 'name' => __( 'Dominican Peso', 'woocommerce' ) ),
|
51 |
+
array( 'code' => 'DZD', 'symbol' => 'DZD', 'name' => __( 'Algerian dinar', 'woocommerce-jetpack' ) ),
|
52 |
+
array( 'code' => 'EEK', 'symbol' => 'EEK', 'name' => __( 'Estonian kroon', 'woocommerce-jetpack' ) ),
|
53 |
+
array( 'code' => 'EGP', 'symbol' => 'EGP', 'name' => __( 'Egyptian Pound', 'woocommerce' ) ),
|
54 |
+
array( 'code' => 'ERN', 'symbol' => 'ERN', 'name' => __( 'Eritrean nakfa', 'woocommerce-jetpack' ) ),
|
55 |
+
array( 'code' => 'ETB', 'symbol' => 'ETB', 'name' => __( 'Ethiopian birr', 'woocommerce-jetpack' ) ),
|
56 |
+
array( 'code' => 'EUR', 'symbol' => '€', 'name' => __( 'Euros', 'woocommerce' ) ),
|
57 |
+
array( 'code' => 'FJD', 'symbol' => 'FJD', 'name' => __( 'Fijian dollar', 'woocommerce-jetpack' ) ),
|
58 |
+
array( 'code' => 'FKP', 'symbol' => 'FKP', 'name' => __( 'Falkland Islands pound', 'woocommerce-jetpack' ) ),
|
59 |
+
array( 'code' => 'GBP', 'symbol' => '£', 'name' => __( 'Pounds Sterling', 'woocommerce' ) ),
|
60 |
+
array( 'code' => 'GEL', 'symbol' => 'GEL', 'name' => __( 'Georgian lari', 'woocommerce-jetpack' ) ),
|
61 |
+
array( 'code' => 'GHS', 'symbol' => 'GHS', 'name' => __( 'Ghanaian cedi', 'woocommerce-jetpack' ) ),
|
62 |
+
array( 'code' => 'GIP', 'symbol' => 'GIP', 'name' => __( 'Gibraltar pound', 'woocommerce-jetpack' ) ),
|
63 |
+
array( 'code' => 'GYD', 'symbol' => 'GYD', 'name' => __( 'Guyanese dollar', 'woocommerce-jetpack' ) ),
|
64 |
+
array( 'code' => 'GMD', 'symbol' => 'GMD', 'name' => __( 'Gambian dalasi', 'woocommerce-jetpack' ) ),
|
65 |
+
array( 'code' => 'GNF', 'symbol' => 'GNF', 'name' => __( 'Guinean franc', 'woocommerce-jetpack' ) ),
|
66 |
+
array( 'code' => 'GQE', 'symbol' => 'GQE', 'name' => __( 'Central African CFA franc', 'woocommerce-jetpack' ) ),
|
67 |
+
array( 'code' => 'GTQ', 'symbol' => 'GTQ', 'name' => __( 'Guatemalan quetzal', 'woocommerce-jetpack' ) ),
|
68 |
+
array( 'code' => 'HKD', 'symbol' => '$', 'name' => __( 'Hong Kong Dollar', 'woocommerce' ) ),
|
69 |
+
array( 'code' => 'HNL', 'symbol' => 'HNL', 'name' => __( 'Honduran lempira', 'woocommerce-jetpack' ) ),
|
70 |
+
array( 'code' => 'HRK', 'symbol' => 'Kn', 'name' => __( 'Croatia kuna', 'woocommerce' ) ),
|
71 |
+
array( 'code' => 'HTG', 'symbol' => 'HTG', 'name' => __( 'Haitian gourde', 'woocommerce-jetpack' ) ),
|
72 |
+
array( 'code' => 'HUF', 'symbol' => 'Ft', 'name' => __( 'Hungarian Forint', 'woocommerce' ) ),
|
73 |
+
array( 'code' => 'IDR', 'symbol' => 'Rp', 'name' => __( 'Indonesia Rupiah', 'woocommerce' ) ),
|
74 |
+
array( 'code' => 'ILS', 'symbol' => '₪', 'name' => __( 'Israeli Shekel', 'woocommerce' ) ),
|
75 |
+
array( 'code' => 'INR', 'symbol' => '₹', 'name' => __( 'Indian Rupee', 'woocommerce' ) ),
|
76 |
+
array( 'code' => 'IQD', 'symbol' => 'IQD', 'name' => __( 'Iraqi dinar', 'woocommerce-jetpack' ) ),
|
77 |
+
array( 'code' => 'IRR', 'symbol' => 'IRR', 'name' => __( 'Iranian rial', 'woocommerce-jetpack' ) ),
|
78 |
+
array( 'code' => 'ISK', 'symbol' => 'Kr.', 'name' => __( 'Icelandic krona', 'woocommerce' ) ),
|
79 |
+
array( 'code' => 'YER', 'symbol' => 'YER', 'name' => __( 'Yemeni rial', 'woocommerce-jetpack' ) ),
|
80 |
+
array( 'code' => 'JMD', 'symbol' => 'JMD', 'name' => __( 'Jamaican dollar', 'woocommerce-jetpack' ) ),
|
81 |
+
array( 'code' => 'JOD', 'symbol' => 'JOD', 'name' => __( 'Jordanian dinar', 'woocommerce-jetpack' ) ),
|
82 |
+
array( 'code' => 'JPY', 'symbol' => '¥', 'name' => __( 'Japanese Yen', 'woocommerce' ) ),
|
83 |
+
array( 'code' => 'KES', 'symbol' => 'KSh', 'name' => __( 'Kenyan shilling', 'woocommerce' ) ),
|
84 |
+
array( 'code' => 'KGS', 'symbol' => 'KGS', 'name' => __( 'Kyrgyzstani som', 'woocommerce-jetpack' ) ),
|
85 |
+
array( 'code' => 'KHR', 'symbol' => 'KHR', 'name' => __( 'Cambodian riel', 'woocommerce-jetpack' ) ),
|
86 |
+
array( 'code' => 'KIP', 'symbol' => 'KIP', 'name' => __( 'Lao kip', 'woocommerce-jetpack' ) ),
|
87 |
+
array( 'code' => 'KYD', 'symbol' => 'KYD', 'name' => __( 'Cayman Islands dollar', 'woocommerce-jetpack' ) ),
|
88 |
+
array( 'code' => 'KMF', 'symbol' => 'KMF', 'name' => __( 'Comorian franc', 'woocommerce-jetpack' ) ),
|
89 |
+
array( 'code' => 'KPW', 'symbol' => 'KPW', 'name' => __( 'North Korean won', 'woocommerce-jetpack' ) ),
|
90 |
+
array( 'code' => 'KRW', 'symbol' => '₩', 'name' => __( 'South Korean Won', 'woocommerce' ) ),
|
91 |
+
array( 'code' => 'KWD', 'symbol' => 'KWD', 'name' => __( 'Kuwaiti dinar', 'woocommerce-jetpack' ) ),
|
92 |
+
array( 'code' => 'KZT', 'symbol' => 'KZT', 'name' => __( 'Kazakhstani tenge', 'woocommerce-jetpack' ) ),
|
93 |
+
array( 'code' => 'LAK', 'symbol' => '₭', 'name' => __( 'Lao Kip', 'woocommerce' ) ),
|
94 |
+
array( 'code' => 'LBP', 'symbol' => 'LBP', 'name' => __( 'Lebanese lira', 'woocommerce-jetpack' ) ),
|
95 |
+
array( 'code' => 'LYD', 'symbol' => 'LYD', 'name' => __( 'Libyan dinar', 'woocommerce-jetpack' ) ),
|
96 |
+
array( 'code' => 'LKR', 'symbol' => 'LKR', 'name' => __( 'Sri Lankan rupee', 'woocommerce-jetpack' ) ),
|
97 |
+
array( 'code' => 'LRD', 'symbol' => 'LRD', 'name' => __( 'Liberian dollar', 'woocommerce-jetpack' ) ),
|
98 |
+
array( 'code' => 'LSL', 'symbol' => 'LSL', 'name' => __( 'Lesotho loti', 'woocommerce-jetpack' ) ),
|
99 |
+
array( 'code' => 'LTL', 'symbol' => 'LTL', 'name' => __( 'Lithuanian litas', 'woocommerce-jetpack' ) ),
|
100 |
+
array( 'code' => 'LVL', 'symbol' => 'LVL', 'name' => __( 'Latvian lats', 'woocommerce-jetpack' ) ),
|
101 |
+
array( 'code' => 'MAD', 'symbol' => 'MAD', 'name' => __( 'Moroccan dirham', 'woocommerce-jetpack' ) ),
|
102 |
+
array( 'code' => 'MDL', 'symbol' => 'MDL', 'name' => __( 'Moldovan leu', 'woocommerce-jetpack' ) ),
|
103 |
+
array( 'code' => 'MGA', 'symbol' => 'MGA', 'name' => __( 'Malagasy ariary', 'woocommerce-jetpack' ) ),
|
104 |
+
array( 'code' => 'MYR', 'symbol' => 'RM', 'name' => __( 'Malaysian ringgit', 'woocommerce-jetpack' ) ),
|
105 |
+
array( 'code' => 'MKD', 'symbol' => 'MKD', 'name' => __( 'Macedonian denar', 'woocommerce-jetpack' ) ),
|
106 |
+
array( 'code' => 'MMK', 'symbol' => 'MMK', 'name' => __( 'Myanma kyat', 'woocommerce-jetpack' ) ),
|
107 |
+
array( 'code' => 'MNT', 'symbol' => 'MNT', 'name' => __( 'Mongolian tugrik', 'woocommerce-jetpack' ) ),
|
108 |
+
array( 'code' => 'MOP', 'symbol' => 'MOP', 'name' => __( 'Macanese pataca', 'woocommerce-jetpack' ) ),
|
109 |
+
array( 'code' => 'MRO', 'symbol' => 'MRO', 'name' => __( 'Mauritanian ouguiya', 'woocommerce-jetpack' ) ),
|
110 |
+
array( 'code' => 'MUR', 'symbol' => 'MUR', 'name' => __( 'Mauritian rupee', 'woocommerce-jetpack' ) ),
|
111 |
+
array( 'code' => 'MVR', 'symbol' => 'MVR', 'name' => __( 'Maldivian rufiyaa', 'woocommerce-jetpack' ) ),
|
112 |
+
array( 'code' => 'MWK', 'symbol' => 'MWK', 'name' => __( 'Malawian kwacha', 'woocommerce-jetpack' ) ),
|
113 |
+
array( 'code' => 'MXN', 'symbol' => '$', 'name' => __( 'Mexican Peso', 'woocommerce' ) ),
|
114 |
+
array( 'code' => 'MYR', 'symbol' => 'RM', 'name' => __( 'Malaysian Ringgits', 'woocommerce' ) ),
|
115 |
+
array( 'code' => 'MZM', 'symbol' => 'MZM', 'name' => __( 'Mozambican metical', 'woocommerce-jetpack' ) ),
|
116 |
+
array( 'code' => 'NAD', 'symbol' => 'NAD', 'name' => __( 'Namibian dollar', 'woocommerce-jetpack' ) ),
|
117 |
+
array( 'code' => 'NGN', 'symbol' => '₦', 'name' => __( 'Nigerian Naira', 'woocommerce' ) ),
|
118 |
+
array( 'code' => 'NIO', 'symbol' => 'NIO', 'name' => __( 'Nicaraguan cordoba', 'woocommerce-jetpack' ) ),
|
119 |
+
array( 'code' => 'NOK', 'symbol' => 'kr', 'name' => __( 'Norwegian Krone', 'woocommerce' ) ),
|
120 |
+
array( 'code' => 'NPR', 'symbol' => '₨', 'name' => __( 'Nepali Rupee', 'woocommerce' ) ),
|
121 |
+
array( 'code' => 'NZD', 'symbol' => '$', 'name' => __( 'New Zealand Dollar', 'woocommerce' ) ),
|
122 |
+
array( 'code' => 'OMR', 'symbol' => 'OMR', 'name' => __( 'Omani rial', 'woocommerce-jetpack' ) ),
|
123 |
+
array( 'code' => 'PAB', 'symbol' => 'PAB', 'name' => __( 'Panamanian balboa', 'woocommerce-jetpack' ) ),
|
124 |
+
array( 'code' => 'PEN', 'symbol' => 'PEN', 'name' => __( 'Peruvian nuevo sol', 'woocommerce-jetpack' ) ),
|
125 |
+
array( 'code' => 'PGK', 'symbol' => 'PGK', 'name' => __( 'Papua New Guinean kina', 'woocommerce-jetpack' ) ),
|
126 |
+
array( 'code' => 'PHP', 'symbol' => '₱', 'name' => __( 'Philippine Pesos', 'woocommerce' ) ),
|
127 |
+
array( 'code' => 'PYG', 'symbol' => 'PYG', 'name' => __( 'Paraguayan guarani', 'woocommerce-jetpack' ) ),
|
128 |
+
array( 'code' => 'PKR', 'symbol' => '₨', 'name' => __( 'Pakistani Rupee', 'woocommerce' ) ),
|
129 |
+
array( 'code' => 'PLN', 'symbol' => 'zł', 'name' => __( 'Polish Zloty', 'woocommerce' ) ),
|
130 |
+
array( 'code' => 'PYG', 'symbol' => '₲', 'name' => __( 'Paraguayan Guaraní', 'woocommerce' ) ),
|
131 |
+
array( 'code' => 'QAR', 'symbol' => 'QAR', 'name' => __( 'Qatari riyal', 'woocommerce-jetpack' ) ),
|
132 |
+
array( 'code' => 'RMB', 'symbol' => '¥', 'name' => __( 'Chinese renminbi', 'woocommerce-jetpack' ) ),
|
133 |
+
array( 'code' => 'RON', 'symbol' => 'lei', 'name' => __( 'Romanian Leu', 'woocommerce' ) ),
|
134 |
+
array( 'code' => 'RSD', 'symbol' => 'RSD', 'name' => __( 'Serbian dinar', 'woocommerce-jetpack' ) ),
|
135 |
+
array( 'code' => 'RUB', 'symbol' => '₽', 'name' => __( 'Russian Ruble', 'woocommerce' ) ),
|
136 |
+
array( 'code' => 'RWF', 'symbol' => 'RWF', 'name' => __( 'Rwandan franc', 'woocommerce-jetpack' ) ),
|
137 |
+
array( 'code' => 'SAR', 'symbol' => 'ر.س', 'name' => __( 'Saudi Riyal', 'woocommerce' ) ),
|
138 |
+
array( 'code' => 'SBD', 'symbol' => 'SBD', 'name' => __( 'Solomon Islands dollar', 'woocommerce-jetpack' ) ),
|
139 |
+
array( 'code' => 'SCR', 'symbol' => 'SCR', 'name' => __( 'Seychellois rupee', 'woocommerce-jetpack' ) ),
|
140 |
+
array( 'code' => 'SDG', 'symbol' => 'SDG', 'name' => __( 'Sudanese pound', 'woocommerce-jetpack' ) ),
|
141 |
+
array( 'code' => 'SEK', 'symbol' => 'kr', 'name' => __( 'Swedish Krona', 'woocommerce' ) ),
|
142 |
+
array( 'code' => 'SGD', 'symbol' => '$', 'name' => __( 'Singapore Dollar', 'woocommerce' ) ),
|
143 |
+
array( 'code' => 'SHP', 'symbol' => 'SHP', 'name' => __( 'Saint Helena pound', 'woocommerce-jetpack' ) ),
|
144 |
+
array( 'code' => 'SYP', 'symbol' => 'SYP', 'name' => __( 'Syrian pound', 'woocommerce-jetpack' ) ),
|
145 |
+
array( 'code' => 'SKK', 'symbol' => 'SKK', 'name' => __( 'Slovak koruna', 'woocommerce-jetpack' ) ),
|
146 |
+
array( 'code' => 'SLL', 'symbol' => 'SLL', 'name' => __( 'Sierra Leonean leone', 'woocommerce-jetpack' ) ),
|
147 |
+
array( 'code' => 'SOS', 'symbol' => 'SOS', 'name' => __( 'Somali shilling', 'woocommerce-jetpack' ) ),
|
148 |
+
array( 'code' => 'SRD', 'symbol' => 'SRD', 'name' => __( 'Surinamese dollar', 'woocommerce-jetpack' ) ),
|
149 |
+
array( 'code' => 'STD', 'symbol' => 'STD', 'name' => __( 'Sao Tome and Principe dobra', 'woocommerce-jetpack' ) ),
|
150 |
+
array( 'code' => 'SZL', 'symbol' => 'SZL', 'name' => __( 'Swazi lilangeni', 'woocommerce-jetpack' ) ),
|
151 |
+
array( 'code' => 'THB', 'symbol' => '฿', 'name' => __( 'Thai Baht', 'woocommerce' ) ),
|
152 |
+
array( 'code' => 'TJS', 'symbol' => 'TJS', 'name' => __( 'Tajikistani somoni', 'woocommerce-jetpack' ) ),
|
153 |
+
array( 'code' => 'TMM', 'symbol' => 'TMM', 'name' => __( 'Turkmen manat', 'woocommerce-jetpack' ) ),
|
154 |
+
array( 'code' => 'TND', 'symbol' => 'TND', 'name' => __( 'Tunisian dinar', 'woocommerce-jetpack' ) ),
|
155 |
+
array( 'code' => 'TOP', 'symbol' => 'TOP', 'name' => __( 'Paanga', 'woocommerce-jetpack' ) ),
|
156 |
+
array( 'code' => 'TRY', 'symbol' => '₺', 'name' => __( 'Turkish Lira', 'woocommerce' ) ),
|
157 |
+
array( 'code' => 'TTD', 'symbol' => 'TTD', 'name' => __( 'Trinidad and Tobago dollar', 'woocommerce-jetpack' ) ),
|
158 |
+
array( 'code' => 'TWD', 'symbol' => 'NT$', 'name' => __( 'Taiwan New Dollars', 'woocommerce' ) ),
|
159 |
+
array( 'code' => 'TZS', 'symbol' => 'TZS', 'name' => __( 'Tanzanian shilling', 'woocommerce-jetpack' ) ),
|
160 |
+
array( 'code' => 'UAH', 'symbol' => '₴', 'name' => __( 'Ukrainian Hryvnia', 'woocommerce' ) ),
|
161 |
+
array( 'code' => 'UGX', 'symbol' => 'UGX', 'name' => __( 'Ugandan shilling', 'woocommerce-jetpack' ) ),
|
162 |
+
array( 'code' => 'UYU', 'symbol' => 'UYU', 'name' => __( 'Uruguayan peso', 'woocommerce-jetpack' ) ),
|
163 |
+
array( 'code' => 'USD', 'symbol' => '$', 'name' => __( 'US Dollars', 'woocommerce' ) ),
|
164 |
+
array( 'code' => 'UZS', 'symbol' => 'UZS', 'name' => __( 'Uzbekistani som', 'woocommerce-jetpack' ) ),
|
165 |
+
array( 'code' => 'VEF', 'symbol' => 'VEF', 'name' => __( 'Venezuelan bolivar', 'woocommerce-jetpack' ) ),
|
166 |
+
array( 'code' => 'VND', 'symbol' => '₫', 'name' => __( 'Vietnamese Dong', 'woocommerce' ) ),
|
167 |
+
array( 'code' => 'VUV', 'symbol' => 'VUV', 'name' => __( 'Vanuatu vatu', 'woocommerce-jetpack' ) ),
|
168 |
+
array( 'code' => 'WST', 'symbol' => 'WST', 'name' => __( 'Samoan tala', 'woocommerce-jetpack' ) ),
|
169 |
+
array( 'code' => 'XAF', 'symbol' => 'XAF', 'name' => __( 'Central African CFA franc', 'woocommerce-jetpack' ) ),
|
170 |
+
array( 'code' => 'XCD', 'symbol' => 'XCD', 'name' => __( 'East Caribbean dollar', 'woocommerce-jetpack' ) ),
|
171 |
+
array( 'code' => 'XDR', 'symbol' => 'XDR', 'name' => __( 'Special Drawing Rights', 'woocommerce-jetpack' ) ),
|
172 |
+
array( 'code' => 'XOF', 'symbol' => 'XOF', 'name' => __( 'West African CFA franc', 'woocommerce-jetpack' ) ),
|
173 |
+
array( 'code' => 'XPF', 'symbol' => 'XPF', 'name' => __( 'CFP franc', 'woocommerce-jetpack' ) ),
|
174 |
+
array( 'code' => 'ZAR', 'symbol' => 'R', 'name' => __( 'South African rand', 'woocommerce' ) ),
|
175 |
+
array( 'code' => 'ZMK', 'symbol' => 'ZMK', 'name' => __( 'Zambian kwacha', 'woocommerce-jetpack' ) ),
|
176 |
+
array( 'code' => 'ZWD', 'symbol' => 'ZWD', 'name' => __( 'Zimbabwean dollar', 'woocommerce-jetpack' ) ),
|
177 |
+
);
|
178 |
+
}
|
179 |
+
}
|
includes/exchange-rates/class-wcj-exchange-rates-crons.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates Crons class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -110,35 +110,43 @@ class WCJ_Exchange_Rates_Crons {
|
|
110 |
/**
|
111 |
* On the scheduled action hook, run a function.
|
112 |
*
|
113 |
-
* @version 2.4.
|
114 |
*/
|
115 |
function update_the_exchange_rates( $interval ) {
|
116 |
|
117 |
$currency_pairs[] = array();
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
$
|
123 |
-
|
|
|
|
|
124 |
}
|
125 |
}
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
$
|
131 |
-
|
|
|
|
|
132 |
}
|
133 |
}
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
}
|
144 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates Crons class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
110 |
/**
|
111 |
* On the scheduled action hook, run a function.
|
112 |
*
|
113 |
+
* @version 2.4.4
|
114 |
*/
|
115 |
function update_the_exchange_rates( $interval ) {
|
116 |
|
117 |
$currency_pairs[] = array();
|
118 |
|
119 |
+
if ( wcj_is_module_enabled( 'price_by_country' ) ) {
|
120 |
+
// Currency Pairs - Preparation - Price by Country
|
121 |
+
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_price_by_country_auto_exchange_rates', 'manual' ) ) ) {
|
122 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
123 |
+
$currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
|
124 |
+
$currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_price_by_country_exchange_rate_group_' . $i );
|
125 |
+
}
|
126 |
}
|
127 |
}
|
128 |
|
129 |
+
if ( wcj_is_module_enabled( 'multicurrency' ) ) {
|
130 |
+
// Currency Pairs - Preparation - Multicurrency
|
131 |
+
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_multicurrency_exchange_rate_update_auto', 'manual' ) ) ) {
|
132 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
|
133 |
+
$currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
|
134 |
+
$currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_exchange_rate_' . $i );
|
135 |
+
}
|
136 |
}
|
137 |
}
|
138 |
|
139 |
+
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
140 |
+
// Currency Pairs - Preparation - Gateway Currency
|
141 |
+
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
|
142 |
+
global $woocommerce;
|
143 |
+
$available_gateways = $woocommerce->payment_gateways->payment_gateways();
|
144 |
+
foreach ( $available_gateways as $key => $gateway ) {
|
145 |
+
$currency_to = get_option( 'wcj_gateways_currency_' . $key );
|
146 |
+
if ( 'no_changes' != $currency_to ) {
|
147 |
+
$currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_gateways_currency_exchange_rate_' . $key );
|
148 |
+
}
|
149 |
+
}
|
150 |
}
|
151 |
}
|
152 |
|
includes/functions/wcj-country-functions.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Country Jetpack Functions.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -87,6 +87,21 @@ if ( ! function_exists( 'wcj_get_country_name_by_code' ) ) {
|
|
87 |
}
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
/**
|
91 |
* Get all countries array.
|
92 |
*
|
4 |
*
|
5 |
* The WooCommerce Country Jetpack Functions.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
87 |
}
|
88 |
}
|
89 |
|
90 |
+
/**
|
91 |
+
* Get all states array.
|
92 |
+
*
|
93 |
+
* @version 2.4.4
|
94 |
+
* @since 2.4.4
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
if ( ! function_exists( 'wcj_get_states' ) ) {
|
98 |
+
function wcj_get_states() {
|
99 |
+
$base_country = WC()->countries->get_base_country();
|
100 |
+
$states = WC()->countries->get_states( $base_country );
|
101 |
+
return ( isset( $states ) && ! empty( $states ) ) ? $states : array();
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
/**
|
106 |
* Get all countries array.
|
107 |
*
|
includes/functions/wcj-functions.php
CHANGED
@@ -4,16 +4,102 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Functions.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
-
*
|
13 |
*
|
14 |
-
* @version
|
15 |
-
* @since
|
16 |
-
* @return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
*/
|
18 |
if ( ! function_exists( 'wcj_is_module_enabled' ) ) {
|
19 |
function wcj_is_module_enabled( $module_id ) {
|
@@ -117,7 +203,7 @@ if ( ! function_exists( 'wcj_is_product_wholesale_enabled' ) ) {
|
|
117 |
}
|
118 |
|
119 |
/**
|
120 |
-
*
|
121 |
*/
|
122 |
add_action( 'init', 'add_wcj_get_products_filter' );
|
123 |
if ( ! function_exists( 'add_wcj_get_products_filter' ) ) {
|
@@ -125,22 +211,33 @@ if ( ! function_exists( 'add_wcj_get_products_filter' ) ) {
|
|
125 |
add_filter( 'wcj_get_products_filter', 'wcj_get_products' );
|
126 |
}
|
127 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
if ( ! function_exists( 'wcj_get_products' ) ) {
|
129 |
-
function wcj_get_products( $products ) {
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
144 |
return $products;
|
145 |
}
|
146 |
}
|
@@ -509,12 +606,54 @@ if ( ! function_exists( 'wcj_get_order_statuses' ) ) {
|
|
509 |
|
510 |
/**
|
511 |
* wcj_get_currencies_names_and_symbols.
|
|
|
|
|
512 |
*/
|
513 |
if ( ! function_exists( 'wcj_get_currencies_names_and_symbols' ) ) {
|
514 |
-
function wcj_get_currencies_names_and_symbols() {
|
515 |
-
$
|
516 |
-
|
517 |
-
$currency_names_and_symbols
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
}
|
519 |
return $currency_names_and_symbols;
|
520 |
}
|
@@ -523,19 +662,22 @@ if ( ! function_exists( 'wcj_get_currencies_names_and_symbols' ) ) {
|
|
523 |
/**
|
524 |
* wcj_get_currency_symbol.
|
525 |
*
|
526 |
-
* @version 2.
|
527 |
*/
|
528 |
if ( ! function_exists( 'wcj_get_currency_symbol' ) ) {
|
529 |
function wcj_get_currency_symbol( $currency_code ) {
|
530 |
$return = '';
|
531 |
-
$currencies =
|
532 |
-
|
533 |
-
if (
|
534 |
-
$return = $
|
535 |
-
|
|
|
536 |
}
|
|
|
|
|
|
|
537 |
}
|
538 |
-
$return = apply_filters( 'wcj_get_option_filter', $return, get_option( 'wcj_currency_' . $currency_code, $return ) );
|
539 |
return ( '' != $return ) ? $return : false;
|
540 |
}
|
541 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Functions.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
+
* wcj_get_product_input_fields.
|
13 |
*
|
14 |
+
* @version 2.4.4
|
15 |
+
* @since 2.4.4
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
if ( ! function_exists( 'wcj_get_product_input_fields' ) ) {
|
19 |
+
function wcj_get_product_input_fields( $item ) {
|
20 |
+
$product_input_fields = array();
|
21 |
+
foreach ( $item as $key => $value ) {
|
22 |
+
if ( false !== strpos( $key, 'wcj_product_input_fields_' ) ) {
|
23 |
+
$product_input_fields[] = /* $key . ': ' . */ $value;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
return ( ! empty( $product_input_fields ) ) ? /* ' (' . */ implode( ', ', $product_input_fields ) /* . ')' */ : '';
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
/*
|
31 |
+
* wcj_get_left_to_free_shipping.
|
32 |
+
*
|
33 |
+
* @version 2.4.4
|
34 |
+
* @since 2.4.4
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
if ( ! function_exists( 'wcj_get_left_to_free_shipping' ) ) {
|
38 |
+
function wcj_get_left_to_free_shipping( $content ) {
|
39 |
+
if ( '' == $content ) {
|
40 |
+
$content = __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' );
|
41 |
+
}
|
42 |
+
$free_shipping = new WC_Shipping_Free_Shipping();
|
43 |
+
if ( in_array( $free_shipping->requires, array( 'min_amount', 'either', 'both' ) ) && isset( WC()->cart->cart_contents_total ) ) {
|
44 |
+
if ( WC()->cart->prices_include_tax ) {
|
45 |
+
$total = WC()->cart->cart_contents_total + array_sum( WC()->cart->taxes );
|
46 |
+
} else {
|
47 |
+
$total = WC()->cart->cart_contents_total;
|
48 |
+
}
|
49 |
+
if ( $total >= $free_shipping->min_amount ) {
|
50 |
+
return '';
|
51 |
+
} else {
|
52 |
+
$content = str_replace( '%left_to_free%', wc_price( $free_shipping->min_amount - $total ), $content );
|
53 |
+
$content = str_replace( '%free_shipping_min_amount%', wc_price( $free_shipping->min_amount ), $content );
|
54 |
+
return $content;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
/*
|
61 |
+
* wcj_get_cart_filters()
|
62 |
+
*
|
63 |
+
* @version 2.4.4
|
64 |
+
* @since 2.4.4
|
65 |
+
* @return array
|
66 |
+
*/
|
67 |
+
if ( ! function_exists( 'wcj_get_cart_filters' ) ) {
|
68 |
+
function wcj_get_cart_filters() {
|
69 |
+
return array(
|
70 |
+
'woocommerce_before_cart' => __( 'Before cart', 'woocommerce-jetpack' ),
|
71 |
+
'woocommerce_before_cart_table' => __( 'Before cart table', 'woocommerce-jetpack' ),
|
72 |
+
'woocommerce_before_cart_contents' => __( 'Before cart contents', 'woocommerce-jetpack' ),
|
73 |
+
'woocommerce_cart_contents' => __( 'Cart contents', 'woocommerce-jetpack' ),
|
74 |
+
'woocommerce_cart_coupon' => __( 'Cart coupon', 'woocommerce-jetpack' ),
|
75 |
+
'woocommerce_cart_actions' => __( 'Cart actions', 'woocommerce-jetpack' ),
|
76 |
+
'woocommerce_after_cart_contents' => __( 'After cart contents', 'woocommerce-jetpack' ),
|
77 |
+
'woocommerce_after_cart_table' => __( 'After cart table', 'woocommerce-jetpack' ),
|
78 |
+
'woocommerce_cart_collaterals' => __( 'Cart collaterals', 'woocommerce-jetpack' ),
|
79 |
+
'woocommerce_after_cart' => __( 'After cart', 'woocommerce-jetpack' ),
|
80 |
+
|
81 |
+
'woocommerce_before_cart_totals' => __( 'Before cart totals', 'woocommerce-jetpack' ),
|
82 |
+
'woocommerce_cart_totals_before_shipping' => __( 'Cart totals: Before shipping', 'woocommerce-jetpack' ),
|
83 |
+
'woocommerce_cart_totals_after_shipping' => __( 'Cart totals: After shipping', 'woocommerce-jetpack' ),
|
84 |
+
'woocommerce_cart_totals_before_order_total' => __( 'Cart totals: Before order total', 'woocommerce-jetpack' ),
|
85 |
+
'woocommerce_cart_totals_after_order_total' => __( 'Cart totals: After order total', 'woocommerce-jetpack' ),
|
86 |
+
'woocommerce_proceed_to_checkout' => __( 'Proceed to checkout', 'woocommerce-jetpack' ),
|
87 |
+
'woocommerce_after_cart_totals' => __( 'After cart totals', 'woocommerce-jetpack' ),
|
88 |
+
|
89 |
+
'woocommerce_before_shipping_calculator' => __( 'Before shipping calculator', 'woocommerce-jetpack' ),
|
90 |
+
'woocommerce_after_shipping_calculator' => __( 'After shipping calculator', 'woocommerce-jetpack' ),
|
91 |
+
|
92 |
+
'woocommerce_cart_is_empty' => __( 'If cart is empty', 'woocommerce-jetpack' ),
|
93 |
+
);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
/*
|
98 |
+
* wcj_is_module_enabled()
|
99 |
+
*
|
100 |
+
* @version 2.4.0
|
101 |
+
* @since 2.4.0
|
102 |
+
* @return boolean
|
103 |
*/
|
104 |
if ( ! function_exists( 'wcj_is_module_enabled' ) ) {
|
105 |
function wcj_is_module_enabled( $module_id ) {
|
203 |
}
|
204 |
|
205 |
/**
|
206 |
+
* add_wcj_get_products_filter.
|
207 |
*/
|
208 |
add_action( 'init', 'add_wcj_get_products_filter' );
|
209 |
if ( ! function_exists( 'add_wcj_get_products_filter' ) ) {
|
211 |
add_filter( 'wcj_get_products_filter', 'wcj_get_products' );
|
212 |
}
|
213 |
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* wcj_get_products.
|
217 |
+
*
|
218 |
+
* @version 2.4.4
|
219 |
+
*/
|
220 |
if ( ! function_exists( 'wcj_get_products' ) ) {
|
221 |
+
function wcj_get_products( $products = array() ) {
|
222 |
+
$offset = 0;
|
223 |
+
$block_size = 96;
|
224 |
+
while( true ) {
|
225 |
+
$args = array(
|
226 |
+
'post_type' => 'product',
|
227 |
+
'post_status' => 'any',
|
228 |
+
'posts_per_page' => $block_size,
|
229 |
+
'offset' => $offset,
|
230 |
+
'orderby' => 'title',
|
231 |
+
'order' => 'ASC',
|
232 |
+
);
|
233 |
+
$loop = new WP_Query( $args );
|
234 |
+
if ( ! $loop->have_posts() ) break;
|
235 |
+
while ( $loop->have_posts() ) : $loop->the_post();
|
236 |
+
$products[ strval( $loop->post->ID ) ] = get_the_title( $loop->post->ID );
|
237 |
+
endwhile;
|
238 |
+
$offset += $block_size;
|
239 |
+
}
|
240 |
+
wp_reset_postdata();
|
241 |
return $products;
|
242 |
}
|
243 |
}
|
606 |
|
607 |
/**
|
608 |
* wcj_get_currencies_names_and_symbols.
|
609 |
+
*
|
610 |
+
* @version 2.4.4
|
611 |
*/
|
612 |
if ( ! function_exists( 'wcj_get_currencies_names_and_symbols' ) ) {
|
613 |
+
function wcj_get_currencies_names_and_symbols( $result = 'names_and_symbols', $scope = 'all' ) {
|
614 |
+
$currency_names_and_symbols = array();
|
615 |
+
/* if ( ! wcj_is_module_enabled( 'currency' ) ) {
|
616 |
+
return $currency_names_and_symbols;
|
617 |
+
} */
|
618 |
+
if ( 'all' === $scope || 'no_custom' === $scope ) {
|
619 |
+
// $currencies = include( wcj_plugin_path() . '/includes/currencies/wcj-currencies.php' );
|
620 |
+
// include( wcj_plugin_path() . '/includes/currencies/wcj-currencies.php' );
|
621 |
+
$currencies = wcj_get_currencies_array();
|
622 |
+
foreach( $currencies as $data ) {
|
623 |
+
switch ( $result ) {
|
624 |
+
case 'names_and_symbols':
|
625 |
+
$currency_names_and_symbols[ $data['code'] ] = $data['name'] . ' (' . $data['symbol'] . ')';
|
626 |
+
break;
|
627 |
+
case 'names':
|
628 |
+
$currency_names_and_symbols[ $data['code'] ] = $data['name'];
|
629 |
+
break;
|
630 |
+
case 'symbols':
|
631 |
+
$currency_names_and_symbols[ $data['code'] ] = $data['symbol'];
|
632 |
+
break;
|
633 |
+
}
|
634 |
+
}
|
635 |
+
}
|
636 |
+
if ( wcj_is_module_enabled( 'currency' ) && ( 'all' === $scope || 'custom_only' === $scope ) ) {
|
637 |
+
// Custom currencies
|
638 |
+
$custom_currency_total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
|
639 |
+
for ( $i = 1; $i <= $custom_currency_total_number; $i++) {
|
640 |
+
$custom_currency_code = get_option( 'wcj_currency_custom_currency_code_' . $i );
|
641 |
+
$custom_currency_name = get_option( 'wcj_currency_custom_currency_name_' . $i );
|
642 |
+
$custom_currency_symbol = get_option( 'wcj_currency_custom_currency_symbol_' . $i );
|
643 |
+
if ( '' != $custom_currency_code && '' != $custom_currency_name /* && '' != $custom_currency_symbol */ ) {
|
644 |
+
switch ( $result ) {
|
645 |
+
case 'names_and_symbols':
|
646 |
+
$currency_names_and_symbols[ $custom_currency_code ] = $custom_currency_name . ' (' . $custom_currency_symbol . ')';
|
647 |
+
break;
|
648 |
+
case 'names':
|
649 |
+
$currency_names_and_symbols[ $custom_currency_code ] = $custom_currency_name;
|
650 |
+
break;
|
651 |
+
case 'symbols':
|
652 |
+
$currency_names_and_symbols[ $custom_currency_code ] = $custom_currency_symbol;
|
653 |
+
break;
|
654 |
+
}
|
655 |
+
}
|
656 |
+
}
|
657 |
}
|
658 |
return $currency_names_and_symbols;
|
659 |
}
|
662 |
/**
|
663 |
* wcj_get_currency_symbol.
|
664 |
*
|
665 |
+
* @version 2.4.4
|
666 |
*/
|
667 |
if ( ! function_exists( 'wcj_get_currency_symbol' ) ) {
|
668 |
function wcj_get_currency_symbol( $currency_code ) {
|
669 |
$return = '';
|
670 |
+
$currencies = wcj_get_currencies_names_and_symbols( 'symbols', 'no_custom' );
|
671 |
+
if ( isset( $currencies[ $currency_code ] ) ) {
|
672 |
+
if ( wcj_is_module_enabled( 'currency' ) ) {
|
673 |
+
$return = apply_filters( 'wcj_get_option_filter', $currencies[ $currency_code ], get_option( 'wcj_currency_' . $currency_code, $currencies[ $currency_code ] ) );
|
674 |
+
} else {
|
675 |
+
$return = $currencies[ $currency_code ];
|
676 |
}
|
677 |
+
} else {
|
678 |
+
$currencies = wcj_get_currencies_names_and_symbols( 'symbols', 'custom_only' );
|
679 |
+
$return = isset( $currencies[ $currency_code ] ) ? $currencies[ $currency_code ] : '';
|
680 |
}
|
|
|
681 |
return ( '' != $return ) ? $return : false;
|
682 |
}
|
683 |
}
|
includes/js/exchange_rates.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
var jsonpCallbacks = {cntr: 0};
|
2 |
|
3 |
function doJSONP(from, to, callbackFuncName) {
|
4 |
-
var url = "
|
5 |
var fullURL = url + "&callback=" + callbackFuncName;
|
6 |
// generate the script tag here
|
7 |
var script = document.createElement('script');
|
8 |
script.setAttribute('src', fullURL);
|
9 |
-
document.body.appendChild(script);
|
10 |
}
|
11 |
|
12 |
function getRate(from, to, id, fn) {
|
@@ -32,7 +32,7 @@ function parseExchangeRate(id, data) {
|
|
32 |
jQuery("#"+id).val(rate);
|
33 |
}
|
34 |
|
35 |
-
jQuery(document).ready(function() {
|
36 |
jQuery(".exchage_rate_button").click(function(){
|
37 |
getRate(this.getAttribute('currency_from'), this.getAttribute('currency_to'), this.getAttribute('multiply_by_field_id'), parseExchangeRate);
|
38 |
return false;
|
1 |
var jsonpCallbacks = {cntr: 0};
|
2 |
|
3 |
function doJSONP(from, to, callbackFuncName) {
|
4 |
+
var url = "//query.yahooapis.com/v1/public/yql?q=select%20rate%2Cname%20from%20csv%20where%20url%3D'http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes%3Fs%3D"+from+to+"%253DX%26f%3Dl1n'%20and%20columns%3D'rate%2Cname'&format=json";
|
5 |
var fullURL = url + "&callback=" + callbackFuncName;
|
6 |
// generate the script tag here
|
7 |
var script = document.createElement('script');
|
8 |
script.setAttribute('src', fullURL);
|
9 |
+
document.body.appendChild(script);
|
10 |
}
|
11 |
|
12 |
function getRate(from, to, id, fn) {
|
32 |
jQuery("#"+id).val(rate);
|
33 |
}
|
34 |
|
35 |
+
jQuery(document).ready(function() {
|
36 |
jQuery(".exchage_rate_button").click(function(){
|
37 |
getRate(this.getAttribute('currency_from'), this.getAttribute('currency_to'), this.getAttribute('multiply_by_field_id'), parseExchangeRate);
|
38 |
return false;
|
includes/lib/tcpdf_min/config/tcpdf_config.php
CHANGED
@@ -63,9 +63,21 @@
|
|
63 |
* Default images directory.
|
64 |
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
65 |
*/
|
66 |
-
//
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
/**
|
71 |
* Deafult image logo used be the default Header() method.
|
63 |
* Default images directory.
|
64 |
* By default it is automatically set but you can also set it as a fixed string to improve performances.
|
65 |
*/
|
66 |
+
// Algoritmika - Booster version 2.4.4
|
67 |
+
switch ( get_option( 'wcj_invoicing_general_header_images_path', 'empty' ) ) {
|
68 |
+
case 'tcpdf_default':
|
69 |
+
//define ( 'K_PATH_IMAGES', '' );
|
70 |
+
break;
|
71 |
+
case 'empty':
|
72 |
+
define ( 'K_PATH_IMAGES', '' );
|
73 |
+
break;
|
74 |
+
case 'document_root':
|
75 |
+
define ( 'K_PATH_IMAGES', $_SERVER['DOCUMENT_ROOT'] );
|
76 |
+
break;
|
77 |
+
case 'abspath':
|
78 |
+
define ( 'K_PATH_IMAGES', ABSPATH );
|
79 |
+
break;
|
80 |
+
}
|
81 |
|
82 |
/**
|
83 |
* Deafult image logo used be the default Header() method.
|
includes/pdf-invoices/settings/class-wcj-pdf-invoicing-header.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoicing Header class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -30,7 +30,7 @@ class WCJ_PDF_Invoicing_Header extends WCJ_Module {
|
|
30 |
/**
|
31 |
* get_settings.
|
32 |
*
|
33 |
-
* @version 2.4.
|
34 |
*/
|
35 |
function get_settings() {
|
36 |
$settings = array();
|
@@ -101,6 +101,33 @@ class WCJ_PDF_Invoicing_Header extends WCJ_Module {
|
|
101 |
'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_options',
|
102 |
);
|
103 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
return $settings;
|
105 |
}
|
106 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoicing Header class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
30 |
/**
|
31 |
* get_settings.
|
32 |
*
|
33 |
+
* @version 2.4.4
|
34 |
*/
|
35 |
function get_settings() {
|
36 |
$settings = array();
|
101 |
'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_header_options',
|
102 |
);
|
103 |
}
|
104 |
+
|
105 |
+
$settings = array_merge( $settings, array(
|
106 |
+
array(
|
107 |
+
'title' => __( 'PDF Invoicing Header General Options', 'woocommerce-jetpack' ),
|
108 |
+
'type' => 'title',
|
109 |
+
'id' => 'wcj_invoicing_general_header_options',
|
110 |
+
),
|
111 |
+
array(
|
112 |
+
'title' => __( 'Default Images Directory', 'woocommerce-jetpack' ),
|
113 |
+
'desc' => __( 'Default images directory in TCPDF library (K_PATH_IMAGES).', 'woocommerce-jetpack' ),
|
114 |
+
'desc_tip' => __( 'Try changing this if you have issues displaying image in header.', 'woocommerce-jetpack' ),
|
115 |
+
'id' => 'wcj_invoicing_general_header_images_path',
|
116 |
+
'default' => 'empty',
|
117 |
+
'type' => 'select',
|
118 |
+
'options' => array(
|
119 |
+
'empty' => __( 'Empty', 'woocommerce-jetpack' ),
|
120 |
+
'tcpdf_default' => __( 'TCPDF Default', 'woocommerce-jetpack' ),
|
121 |
+
'abspath' => __( 'ABSPATH', 'woocommerce-jetpack' ),// . ': ' . ABSPATH,
|
122 |
+
'document_root' => __( 'DOCUMENT_ROOT', 'woocommerce-jetpack' ),// . ': ' . $_SERVER['DOCUMENT_ROOT'],
|
123 |
+
),
|
124 |
+
),
|
125 |
+
array(
|
126 |
+
'type' => 'sectionend',
|
127 |
+
'id' => 'wcj_invoicing_general_header_options',
|
128 |
+
),
|
129 |
+
) );
|
130 |
+
|
131 |
return $settings;
|
132 |
}
|
133 |
}
|
includes/price-by-country/class-wcj-price-by-country-core.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country Core class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -111,6 +111,8 @@ class WCJ_Price_by_Country_Core {
|
|
111 |
|
112 |
/**
|
113 |
* change_shipping_price_by_country.
|
|
|
|
|
114 |
*/
|
115 |
function change_shipping_price_by_country( $package_rates, $package ) {
|
116 |
|
@@ -119,7 +121,14 @@ class WCJ_Price_by_Country_Core {
|
|
119 |
$country_exchange_rate = get_option( 'wcj_price_by_country_exchange_rate_group_' . $group_id, 1 );
|
120 |
$modified_package_rates = array();
|
121 |
foreach ( $package_rates as $id => $package_rate ) {
|
122 |
-
if ( 1 != $country_exchange_rate && isset( $package_rate->cost ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
$modified_package_rates[ $id ] = $package_rate;
|
124 |
}
|
125 |
return $modified_package_rates;
|
@@ -186,7 +195,7 @@ class WCJ_Price_by_Country_Core {
|
|
186 |
/**
|
187 |
* get_customer_country_group_id.
|
188 |
*
|
189 |
-
* @version 2.4.
|
190 |
*/
|
191 |
public function get_customer_country_group_id() {
|
192 |
|
@@ -245,9 +254,19 @@ class WCJ_Price_by_Country_Core {
|
|
245 |
|
246 |
// Get the country group id - go through all the groups, first found group is returned
|
247 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
if ( in_array( $country, $country_exchange_rate_group ) ) {
|
252 |
$this->customer_country_group_id = $i;
|
253 |
//wcj_log( 'customer_country_group_id=' . $this->customer_country_group_id );
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country Core class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
111 |
|
112 |
/**
|
113 |
* change_shipping_price_by_country.
|
114 |
+
*
|
115 |
+
* @version 2.4.4
|
116 |
*/
|
117 |
function change_shipping_price_by_country( $package_rates, $package ) {
|
118 |
|
121 |
$country_exchange_rate = get_option( 'wcj_price_by_country_exchange_rate_group_' . $group_id, 1 );
|
122 |
$modified_package_rates = array();
|
123 |
foreach ( $package_rates as $id => $package_rate ) {
|
124 |
+
if ( 1 != $country_exchange_rate && isset( $package_rate->cost ) ) {
|
125 |
+
$package_rate->cost = $package_rate->cost * $country_exchange_rate;
|
126 |
+
if ( isset( $package_rate->taxes ) && ! empty( $package_rate->taxes ) ) {
|
127 |
+
foreach ( $package_rate->taxes as $tax_id => $tax ) {
|
128 |
+
$package_rate->taxes[ $tax_id ] = $package_rate->taxes[ $tax_id ] * $country_exchange_rate;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
$modified_package_rates[ $id ] = $package_rate;
|
133 |
}
|
134 |
return $modified_package_rates;
|
195 |
/**
|
196 |
* get_customer_country_group_id.
|
197 |
*
|
198 |
+
* @version 2.4.4
|
199 |
*/
|
200 |
public function get_customer_country_group_id() {
|
201 |
|
254 |
|
255 |
// Get the country group id - go through all the groups, first found group is returned
|
256 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
257 |
+
switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
|
258 |
+
case 'comma_list':
|
259 |
+
$country_exchange_rate_group = get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
|
260 |
+
$country_exchange_rate_group = str_replace( ' ', '', $country_exchange_rate_group );
|
261 |
+
$country_exchange_rate_group = explode( ',', $country_exchange_rate_group );
|
262 |
+
break;
|
263 |
+
case 'multiselect':
|
264 |
+
$country_exchange_rate_group = get_option( 'wcj_price_by_country_countries_group_' . $i );
|
265 |
+
break;
|
266 |
+
case 'chosen_select':
|
267 |
+
$country_exchange_rate_group = get_option( 'wcj_price_by_country_countries_group_chosen_select_' . $i );
|
268 |
+
break;
|
269 |
+
}
|
270 |
if ( in_array( $country, $country_exchange_rate_group ) ) {
|
271 |
$this->customer_country_group_id = $i;
|
272 |
//wcj_log( 'customer_country_group_id=' . $this->customer_country_group_id );
|
includes/price-by-country/class-wcj-price-by-country-group-generator.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price By Country Group Generator class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -63,7 +63,7 @@ class WCJ_Price_By_Country_Group_Generator {
|
|
63 |
/**
|
64 |
* create_all_countries_groups.
|
65 |
*
|
66 |
-
* @version 2.
|
67 |
*/
|
68 |
function create_all_countries_groups() {
|
69 |
global $wcj_notice;
|
@@ -106,7 +106,17 @@ class WCJ_Price_By_Country_Group_Generator {
|
|
106 |
$i = 0;
|
107 |
foreach ( $currencies as $group_currency => $countries ) {
|
108 |
$i++;
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
update_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i, $group_currency );
|
111 |
update_option( 'wcj_price_by_country_exchange_rate_group_' . $i, 1 );
|
112 |
update_option( 'wcj_price_by_country_make_empty_price_group_' . $i, 'no' );
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price By Country Group Generator class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
63 |
/**
|
64 |
* create_all_countries_groups.
|
65 |
*
|
66 |
+
* @version 2.4.4
|
67 |
*/
|
68 |
function create_all_countries_groups() {
|
69 |
global $wcj_notice;
|
106 |
$i = 0;
|
107 |
foreach ( $currencies as $group_currency => $countries ) {
|
108 |
$i++;
|
109 |
+
switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
|
110 |
+
case 'comma_list':
|
111 |
+
update_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i, implode( ',', $countries ) );
|
112 |
+
break;
|
113 |
+
case 'multiselect':
|
114 |
+
update_option( 'wcj_price_by_country_countries_group_' . $i, $countries );
|
115 |
+
break;
|
116 |
+
case 'chosen_select':
|
117 |
+
update_option( 'wcj_price_by_country_countries_group_chosen_select_' . $i, $countries );
|
118 |
+
break;
|
119 |
+
}
|
120 |
update_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i, $group_currency );
|
121 |
update_option( 'wcj_price_by_country_exchange_rate_group_' . $i, 1 );
|
122 |
update_option( 'wcj_price_by_country_make_empty_price_group_' . $i, 'no' );
|
includes/price-by-country/class-wcj-price-by-country-local.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country Local class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -232,6 +232,8 @@ class WCJ_Price_by_Country_Local {
|
|
232 |
|
233 |
/**
|
234 |
* get_all_options_html.
|
|
|
|
|
235 |
*/
|
236 |
public function get_all_options_html( $simple_or_variable, $current_post_id, $total_number, $variation_id_addon = '' ) {
|
237 |
$html = '';
|
@@ -247,7 +249,17 @@ class WCJ_Price_by_Country_Local {
|
|
247 |
$html .= '<strong>';
|
248 |
$html .= __( 'Country Group Nr.', 'woocommerce-jetpack' ) . ' ' . $i;
|
249 |
$html .= ': ';
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
$html .= '</strong>';
|
252 |
$html .= '</p>';
|
253 |
//}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country Local class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
232 |
|
233 |
/**
|
234 |
* get_all_options_html.
|
235 |
+
*
|
236 |
+
* @version 2.4.4
|
237 |
*/
|
238 |
public function get_all_options_html( $simple_or_variable, $current_post_id, $total_number, $variation_id_addon = '' ) {
|
239 |
$html = '';
|
249 |
$html .= '<strong>';
|
250 |
$html .= __( 'Country Group Nr.', 'woocommerce-jetpack' ) . ' ' . $i;
|
251 |
$html .= ': ';
|
252 |
+
switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
|
253 |
+
case 'comma_list':
|
254 |
+
$html .= get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
|
255 |
+
break;
|
256 |
+
case 'multiselect':
|
257 |
+
$html .= implode( ',', get_option( 'wcj_price_by_country_countries_group_' . $i ) );
|
258 |
+
break;
|
259 |
+
case 'chosen_select':
|
260 |
+
$html .= implode( ',', get_option( 'wcj_price_by_country_countries_group_chosen_select_' . $i ) );
|
261 |
+
break;
|
262 |
+
}
|
263 |
$html .= '</strong>';
|
264 |
$html .= '</p>';
|
265 |
//}
|
includes/price-by-country/wcj-country-currency.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* WooCommerce Jetpack Country Currency functions
|
4 |
*
|
5 |
-
* @version 2.
|
6 |
* @author Algoritmika Ltd.
|
7 |
*/
|
8 |
|
@@ -234,7 +234,7 @@ if ( ! function_exists( 'wcj_get_country_currency' ) ) {
|
|
234 |
/**
|
235 |
* wcj_get_country_currency.
|
236 |
*
|
237 |
-
* @version 2.
|
238 |
*/
|
239 |
function wcj_get_country_currency() {
|
240 |
return array(
|
@@ -453,7 +453,8 @@ if ( ! function_exists( 'wcj_get_country_currency' ) ) {
|
|
453 |
'TV' => 'AUD',
|
454 |
'UG' => 'UGX',
|
455 |
'AE' => 'AED',
|
456 |
-
'UK' => 'GBP',
|
|
|
457 |
'US' => 'USD',
|
458 |
'UY' => 'UYU',
|
459 |
'UZ' => 'UZS',
|
2 |
/**
|
3 |
* WooCommerce Jetpack Country Currency functions
|
4 |
*
|
5 |
+
* @version 2.4.4
|
6 |
* @author Algoritmika Ltd.
|
7 |
*/
|
8 |
|
234 |
/**
|
235 |
* wcj_get_country_currency.
|
236 |
*
|
237 |
+
* @version 2.4.4
|
238 |
*/
|
239 |
function wcj_get_country_currency() {
|
240 |
return array(
|
453 |
'TV' => 'AUD',
|
454 |
'UG' => 'UGX',
|
455 |
'AE' => 'AED',
|
456 |
+
// 'UK' => 'GBP',
|
457 |
+
'GB' => 'GBP',
|
458 |
'US' => 'USD',
|
459 |
'UY' => 'UYU',
|
460 |
'UZ' => 'UZS',
|
includes/shortcodes/class-wcj-general-shortcodes.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack General Shortcodes class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -31,6 +31,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
31 |
'wcj_currency_select_drop_down_list',
|
32 |
'wcj_text',
|
33 |
'wcj_tcpdf_pagebreak',
|
|
|
34 |
);
|
35 |
|
36 |
$this->the_atts = array(
|
@@ -45,12 +46,23 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
45 |
'style' => '',
|
46 |
'countries' => '',
|
47 |
'currencies' => '',
|
|
|
48 |
);
|
49 |
|
50 |
parent::__construct();
|
51 |
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* wcj_tcpdf_pagebreak.
|
56 |
*
|
4 |
*
|
5 |
* The WooCommerce Jetpack General Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.4
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
31 |
'wcj_currency_select_drop_down_list',
|
32 |
'wcj_text',
|
33 |
'wcj_tcpdf_pagebreak',
|
34 |
+
'wcj_get_left_to_free_shipping',
|
35 |
);
|
36 |
|
37 |
$this->the_atts = array(
|
46 |
'style' => '',
|
47 |
'countries' => '',
|
48 |
'currencies' => '',
|
49 |
+
'content' => '',
|
50 |
);
|
51 |
|
52 |
parent::__construct();
|
53 |
|
54 |
}
|
55 |
|
56 |
+
/**
|
57 |
+
* wcj_get_left_to_free_shipping.
|
58 |
+
*
|
59 |
+
* @version 2.4.4
|
60 |
+
* @since 2.4.4
|
61 |
+
*/
|
62 |
+
function wcj_get_left_to_free_shipping( $atts, $content ) {
|
63 |
+
echo wcj_get_left_to_free_shipping( $atts['content'] );
|
64 |
+
}
|
65 |
+
|
66 |
/**
|
67 |
* wcj_tcpdf_pagebreak.
|
68 |
*
|
includes/shortcodes/class-wcj-order-items-shortcodes.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Order Items Shortcodes class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -126,7 +126,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
|
|
126 |
/**
|
127 |
* wcj_order_items_table.
|
128 |
*
|
129 |
-
* @version 2.4.
|
130 |
*/
|
131 |
function wcj_order_items_table( $atts, $content = '' ) {
|
132 |
|
@@ -184,6 +184,10 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
|
|
184 |
$item_counter++;
|
185 |
// Columns
|
186 |
foreach( $columns as $column ) {
|
|
|
|
|
|
|
|
|
187 |
switch ( $column ) {
|
188 |
case 'item_number':
|
189 |
$data[ $item_counter ][] = $item_counter;
|
@@ -201,6 +205,12 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
|
|
201 |
$data[ $item_counter ][] = $the_item_title;
|
202 |
}
|
203 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
case 'item_excerpt':
|
205 |
case 'item_description':
|
206 |
case 'item_short_description':
|
@@ -290,7 +300,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
|
|
290 |
$data[ $item_counter ][] = sprintf( $atts['tax_percent_format'], $line_tax_percent );
|
291 |
break; */
|
292 |
default:
|
293 |
-
$data[ $item_counter ][] = '';
|
294 |
}
|
295 |
}
|
296 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Order Items Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.4
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
126 |
/**
|
127 |
* wcj_order_items_table.
|
128 |
*
|
129 |
+
* @version 2.4.4
|
130 |
*/
|
131 |
function wcj_order_items_table( $atts, $content = '' ) {
|
132 |
|
184 |
$item_counter++;
|
185 |
// Columns
|
186 |
foreach( $columns as $column ) {
|
187 |
+
if ( false !== ( $pos = strpos( $column, '=' ) ) ) {
|
188 |
+
$column_param = substr( $column, $pos + 1 );
|
189 |
+
$column = substr( $column, 0, $pos );
|
190 |
+
}
|
191 |
switch ( $column ) {
|
192 |
case 'item_number':
|
193 |
$data[ $item_counter ][] = $item_counter;
|
205 |
$data[ $item_counter ][] = $the_item_title;
|
206 |
}
|
207 |
break;
|
208 |
+
case 'item_product_input_fields':
|
209 |
+
$data[ $item_counter ][] = wcj_get_product_input_fields( $item );
|
210 |
+
break;
|
211 |
+
case 'item_key':
|
212 |
+
$data[ $item_counter ][] = isset( $item[ $column_param ] ) ? $item[ $column_param ] : '';
|
213 |
+
break;
|
214 |
case 'item_excerpt':
|
215 |
case 'item_description':
|
216 |
case 'item_short_description':
|
300 |
$data[ $item_counter ][] = sprintf( $atts['tax_percent_format'], $line_tax_percent );
|
301 |
break; */
|
302 |
default:
|
303 |
+
$data[ $item_counter ][] = ''; //$column;
|
304 |
}
|
305 |
}
|
306 |
}
|
includes/widgets/class-wcj-widget-left-to-free-shipping.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Left to Free Shipping Widget
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Left to Free Shipping Widget class.
|
6 |
+
*
|
7 |
+
* @version 2.4.4
|
8 |
+
* @since 2.4.4
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WCJ_Widget_Left_to_Free_Shipping' ) ) :
|
15 |
+
|
16 |
+
class WCJ_Widget_Left_to_Free_Shipping extends WP_Widget {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Sets up the widgets name etc
|
20 |
+
*/
|
21 |
+
public function __construct() {
|
22 |
+
$widget_ops = array(
|
23 |
+
'classname' => 'wcj_widget_left_to_free_shipping',
|
24 |
+
'description' => __( 'Booster: Left to Free Shipping Widget', 'woocommerce-jetpack' ),
|
25 |
+
);
|
26 |
+
parent::__construct( 'wcj_widget_left_to_free_shipping', __( 'Booster - Left to Free Shipping', 'woocommerce-jetpack' ), $widget_ops );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Outputs the content of the widget
|
31 |
+
*
|
32 |
+
* @param array $args
|
33 |
+
* @param array $instance
|
34 |
+
*/
|
35 |
+
public function widget( $args, $instance ) {
|
36 |
+
// outputs the content of the widget
|
37 |
+
echo $args['before_widget'];
|
38 |
+
if ( ! empty( $instance['title'] ) ) {
|
39 |
+
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
|
40 |
+
}
|
41 |
+
echo wcj_get_left_to_free_shipping( $instance['content'] );
|
42 |
+
echo $args['after_widget'];
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Outputs the options form on admin
|
47 |
+
*
|
48 |
+
* @param array $instance The widget options
|
49 |
+
*/
|
50 |
+
public function form( $instance ) {
|
51 |
+
// outputs the options form on admin
|
52 |
+
$title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Left to Free Shipping', 'woocommerce-jetpack' );
|
53 |
+
$content = ! empty( $instance['content'] ) ? $instance['content'] : __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' );
|
54 |
+
?>
|
55 |
+
<p>
|
56 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
57 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
58 |
+
<label for="<?php echo $this->get_field_id( 'content' ); ?>"><?php _e( 'Content:' ); ?></label>
|
59 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" type="text" value="<?php echo esc_attr( $content ); ?>">
|
60 |
+
</p>
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Processing widget options on save
|
66 |
+
*
|
67 |
+
* @param array $new_instance The new options
|
68 |
+
* @param array $old_instance The previous options
|
69 |
+
*/
|
70 |
+
public function update( $new_instance, $old_instance ) {
|
71 |
+
// processes widget options to be saved
|
72 |
+
$instance = array();
|
73 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
74 |
+
$instance['content'] = ( ! empty( $new_instance['content'] ) ) ? strip_tags( $new_instance['content'] ) : '';
|
75 |
+
return $instance;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
endif;
|
80 |
+
|
81 |
+
// register WCJ_Widget_Left_to_Free_Shipping widget
|
82 |
+
if ( ! function_exists( 'register_wcj_widget_left_to_free_shipping' ) ) {
|
83 |
+
function register_wcj_widget_left_to_free_shipping() {
|
84 |
+
register_widget( 'WCJ_Widget_Left_to_Free_Shipping' );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
add_action( 'widgets_init', 'register_wcj_widget_left_to_free_shipping' );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: algoritmika,anbinder,solovjov
|
|
3 |
Tags: woocommerce,booster for 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,payment gateway fee,vat,gateway by country,price by country,currency switcher
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.4
|
6 |
-
Stable tag: 2.4.
|
7 |
License: GNU General Public License v3.0
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -119,6 +119,40 @@ To unlock all Booster for WooCommerce features, please install additional [Boost
|
|
119 |
|
120 |
== Changelog ==
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
= 2.4.3 - 09/03/2016 =
|
123 |
* Dev - PAYMENT GATEWAYS - Gateways Currency - "Reset settings" button added to admin settings.
|
124 |
* Fix - "Reset settings" bug fixed.
|
3 |
Tags: woocommerce,booster for 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,payment gateway fee,vat,gateway by country,price by country,currency switcher
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.4
|
6 |
+
Stable tag: 2.4.4
|
7 |
License: GNU General Public License v3.0
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
119 |
|
120 |
== Changelog ==
|
121 |
|
122 |
+
= 2.4.4 - 23/03/2016 =
|
123 |
+
* Dev - "Booster Currencies Array" (wcj-currencies.php) updated.
|
124 |
+
* Dev - `wcj_get_currencies_names_and_symbols()` and `wcj_get_currency_symbol()` functions modified.
|
125 |
+
* Fix - "http" removed in exchange_rates.js. Fixes bug when loading https.
|
126 |
+
* Dev - Shortcodes - Orders - `[wcj_order_items_table]` - `item_product_input_fields` and `item_key=` options (columns) added.
|
127 |
+
* Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Shipping (taxable) calculation fixed.
|
128 |
+
* Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Wrong currency in emails bug fixed (again).
|
129 |
+
* Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Autogenerate Groups - `UK` changed to `GB` in `wcj_get_country_currency()`.
|
130 |
+
* Dev - PRICES & CURRENCIES - Prices and Currencies by Country - "Countries Selection" admin option added.
|
131 |
+
* Fix - PRICES & CURRENCIES - Currency for External Products - `change_currency_code()` added.
|
132 |
+
* Dev - PRICES & CURRENCIES - Currency for External Products - Custom currencies added to the list.
|
133 |
+
* Dev - PRICES & CURRENCIES - Currency for External Products - "Reset settings" button added.
|
134 |
+
* Dev - PRICES & CURRENCIES - Bulk Price Converter - "Price type to modify" functionality added to the Bulk Price Converter tool.
|
135 |
+
* Dev - PRICES & CURRENCIES - Bulk Price Converter - "None" product category added to the Bulk Price Converter tool.
|
136 |
+
* Dev - PRICES & CURRENCIES - Bulk Price Converter - "Pretty price" functionality added to the Bulk Price Converter tool.
|
137 |
+
* Fix - PRICES & CURRENCIES - Currency Exchange Rates - Only enabled modules currencies are added to the list.
|
138 |
+
* Fix - PRICES & CURRENCIES - Currency Exchange Rates - `no_changes` currency bug fixed.
|
139 |
+
* Fix - PRICES & CURRENCIES - Multicurrency and Currency Exchange Rates - Currency pairs added to Currency Exchange Rates module.
|
140 |
+
* Dev - BUTTON & PRICE LABELS - Custom Price Labels - WooCommerce Subscription products support added.
|
141 |
+
* Dev - PRODUCTS - Product Tabs - "CATEGORIES to HIDE this tab" and "CATEGORIES to SHOW this tab" options added, instead of depreciated "Comma separated CATEGORY IDs..." options.
|
142 |
+
* Dev - PRODUCTS - Product Tabs - "PRODUCTS to HIDE this tab" and "PRODUCTS to SHOW this tab" options added, instead of depreciated "Comma separated PRODUCT IDs..." options.
|
143 |
+
* Dev - PRODUCTS - Product Tabs - "TAGS to HIDE this tab" and "TAGS to SHOW this tab" options added.
|
144 |
+
* Dev - PRODUCTS - Product Tabs - "Reset settings" button added.
|
145 |
+
* Dev - PAYMENT GATEWAYS - Gateways by Country or State - "Include States (Base Country)" and "Exclude States (Base Country)" options added.
|
146 |
+
* Dev - SHIPPING & ORDERS - Shipping - "Left to free shipping" functionality added (including widget and shortcode).
|
147 |
+
* Dev - SHIPPING & ORDERS - Shipping - Code refactoring.
|
148 |
+
* Dev - SHIPPING & ORDERS - Order Numbers - "Use MySQL Transaction" option added to admin settings. This will ensure no duplicated order numbers for shops with large number of simultaneous orders (sequential).
|
149 |
+
* Dev - SHIPPING & ORDERS - Order Numbers - "Orders Renumerate" tool code refactoring.
|
150 |
+
* Fix - PDF Invoicing - Header - "Default Images Directory" option added (`K_PATH_IMAGES` in `tcpdf_config.php`).
|
151 |
+
* Dev - EMAILS & MISC. - WPML - wpml-config.xml file updated.
|
152 |
+
* Dev - EMAILS & MISC. - WPML - "Regenerate wpml-config.xml file" tool optimized for speed.
|
153 |
+
* Fix - EMAILS & MISC. - WPML - "Regenerate wpml-config.xml file" link fixed.
|
154 |
+
* Fix - EMAILS & MISC. - WPML - "Regenerate wpml-config.xml file" tool bug fixed.
|
155 |
+
|
156 |
= 2.4.3 - 09/03/2016 =
|
157 |
* Dev - PAYMENT GATEWAYS - Gateways Currency - "Reset settings" button added to admin settings.
|
158 |
* Fix - "Reset settings" bug fixed.
|
woocommerce-jetpack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Booster for WooCommerce
|
4 |
Plugin URI: http://booster.io
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features.
|
6 |
-
Version: 2.4.
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: http://www.algoritmika.com
|
9 |
Copyright: © 2016 Algoritmika Ltd.
|
@@ -21,7 +21,7 @@ if ( ! class_exists( 'WC_Jetpack' ) ) :
|
|
21 |
* Main WC_Jetpack Class
|
22 |
*
|
23 |
* @class WC_Jetpack
|
24 |
-
* @version 2.4.
|
25 |
*/
|
26 |
|
27 |
final class WC_Jetpack {
|
@@ -330,8 +330,7 @@ final class WC_Jetpack {
|
|
330 |
/**
|
331 |
* Include required core files used in admin and on the frontend.
|
332 |
*
|
333 |
-
* @version 2.4.
|
334 |
-
* @since 2.4.3
|
335 |
*/
|
336 |
private function includes() {
|
337 |
|
@@ -352,6 +351,7 @@ final class WC_Jetpack {
|
|
352 |
|
353 |
// Widgets
|
354 |
include_once( 'includes/widgets/class-wcj-widget-multicurrency.php' );
|
|
|
355 |
|
356 |
// Abstracts
|
357 |
//include_once( 'includes/abstracts/class-wcj-product-input-fields.php' );
|
@@ -362,6 +362,8 @@ final class WC_Jetpack {
|
|
362 |
|
363 |
/**
|
364 |
* include_functions.
|
|
|
|
|
365 |
*/
|
366 |
private function include_functions() {
|
367 |
include_once( 'includes/functions/wcj-debug-functions.php' );
|
@@ -369,6 +371,8 @@ final class WC_Jetpack {
|
|
369 |
include_once( 'includes/functions/wcj-html-functions.php' );
|
370 |
include_once( 'includes/functions/wcj-country-functions.php' );
|
371 |
include_once( 'includes/functions/wcj-invoicing-functions.php' );
|
|
|
|
|
372 |
}
|
373 |
|
374 |
/**
|
3 |
Plugin Name: Booster for WooCommerce
|
4 |
Plugin URI: http://booster.io
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features.
|
6 |
+
Version: 2.4.4
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: http://www.algoritmika.com
|
9 |
Copyright: © 2016 Algoritmika Ltd.
|
21 |
* Main WC_Jetpack Class
|
22 |
*
|
23 |
* @class WC_Jetpack
|
24 |
+
* @version 2.4.4
|
25 |
*/
|
26 |
|
27 |
final class WC_Jetpack {
|
330 |
/**
|
331 |
* Include required core files used in admin and on the frontend.
|
332 |
*
|
333 |
+
* @version 2.4.4
|
|
|
334 |
*/
|
335 |
private function includes() {
|
336 |
|
351 |
|
352 |
// Widgets
|
353 |
include_once( 'includes/widgets/class-wcj-widget-multicurrency.php' );
|
354 |
+
include_once( 'includes/widgets/class-wcj-widget-left-to-free-shipping.php' );
|
355 |
|
356 |
// Abstracts
|
357 |
//include_once( 'includes/abstracts/class-wcj-product-input-fields.php' );
|
362 |
|
363 |
/**
|
364 |
* include_functions.
|
365 |
+
*
|
366 |
+
* @version 2.4.4
|
367 |
*/
|
368 |
private function include_functions() {
|
369 |
include_once( 'includes/functions/wcj-debug-functions.php' );
|
371 |
include_once( 'includes/functions/wcj-html-functions.php' );
|
372 |
include_once( 'includes/functions/wcj-country-functions.php' );
|
373 |
include_once( 'includes/functions/wcj-invoicing-functions.php' );
|
374 |
+
|
375 |
+
include_once( 'includes/currencies/wcj-currencies.php' );
|
376 |
}
|
377 |
|
378 |
/**
|
wpml-config.xml
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<wpml-config>
|
2 |
<admin-texts>
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
<key name="wcj_call_for_price_text" />
|
4 |
<key name="wcj_call_for_price_text_on_archive" />
|
5 |
<key name="wcj_call_for_price_text_on_home" />
|
@@ -10,18 +16,68 @@
|
|
10 |
<key name="wcj_sorting_by_sku_desc_text" />
|
11 |
<key name="wcj_sorting_by_stock_quantity_asc_text" />
|
12 |
<key name="wcj_sorting_by_stock_quantity_desc_text" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
<key name="wcj_more_product_info_on_archive_1" />
|
14 |
<key name="wcj_more_product_info_on_archive_2" />
|
15 |
<key name="wcj_more_product_info_on_archive_3" />
|
16 |
<key name="wcj_more_product_info_on_archive_4" />
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<key name="wcj_more_product_info_on_single_1" />
|
18 |
<key name="wcj_more_product_info_on_single_2" />
|
19 |
<key name="wcj_more_product_info_on_single_3" />
|
20 |
<key name="wcj_more_product_info_on_single_4" />
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
<key name="wcj_product_info_on_archive" />
|
22 |
<key name="wcj_product_info_on_single" />
|
23 |
<key name="wcj_custom_product_tabs_title_global_1" />
|
24 |
<key name="wcj_custom_product_tabs_content_global_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<key name="wcj_product_info_product_tabs_description_title" />
|
26 |
<key name="wcj_product_info_product_tabs_additional_information_title" />
|
27 |
<key name="wcj_product_info_product_tabs_reviews_title" />
|
@@ -34,6 +90,87 @@
|
|
34 |
<key name="wcj_product_input_fields_title_global_1" />
|
35 |
<key name="wcj_product_input_fields_placeholder_global_1" />
|
36 |
<key name="wcj_product_input_fields_required_message_global_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
<key name="wcj_product_input_fields_frontend_view_required_html" />
|
38 |
<key name="wcj_product_input_fields_frontend_view_order_table_format" />
|
39 |
<key name="wcj_wholesale_price_show_info_on_cart_format" />
|
@@ -43,6 +180,24 @@
|
|
43 |
<key name="wcj_product_images_sale_flash_html" />
|
44 |
<key name="wcj_add_to_cart_per_category_text_single_group_1" />
|
45 |
<key name="wcj_add_to_cart_per_category_text_archive_group_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<key name="wcj_add_to_cart_text_on_single_simple" />
|
47 |
<key name="wcj_add_to_cart_text_on_archives_simple" />
|
48 |
<key name="wcj_add_to_cart_text_on_single_zero_price_simple" />
|
@@ -75,10 +230,28 @@
|
|
75 |
<key name="wcj_add_to_cart_text_on_archives_in_cart_other" />
|
76 |
<key name="wcj_checkout_place_order_button_text" />
|
77 |
<key name="wcj_cart_custom_info_content_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<key name="wcj_cart_custom_info_item" />
|
79 |
<key name="wcj_empty_cart_text" />
|
80 |
<key name="wcj_empty_cart_confirmation_text" />
|
81 |
<key name="wcj_mini_cart_custom_info_content_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
<key name="wcj_checkout_fields_billing_country_label" />
|
83 |
<key name="wcj_checkout_fields_billing_country_placeholder" />
|
84 |
<key name="wcj_checkout_fields_billing_first_name_label" />
|
@@ -130,9 +303,89 @@
|
|
130 |
<key name="wcj_checkout_custom_field_timepicker_format_1" />
|
131 |
<key name="wcj_checkout_custom_field_label_1" />
|
132 |
<key name="wcj_checkout_custom_field_placeholder_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
<key name="wcj_checkout_custom_info_content_1" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
<key name="wcj_order_minimum_amount_error_message" />
|
135 |
<key name="wcj_order_minimum_amount_cart_notice_message" />
|
|
|
|
|
|
|
|
|
136 |
<key name="wcj_invoicing_invoice_template" />
|
137 |
<key name="wcj_invoicing_proforma_invoice_template" />
|
138 |
<key name="wcj_invoicing_packing_slip_template" />
|
@@ -183,9 +436,5 @@
|
|
183 |
<key name="wcj_invoicing_custom_doc_admin_column_delete_btn" />
|
184 |
<key name="wcj_invoicing_custom_doc_link_text" />
|
185 |
<key name="wcj_invoicing_custom_doc_file_name" />
|
186 |
-
<key name="wcj_eu_vat_number_field_label" />
|
187 |
-
<key name="wcj_eu_vat_number_field_placeholder" />
|
188 |
-
<key name="wcj_eu_vat_number_field_description" />
|
189 |
-
<key name="wcj_eu_vat_number_not_valid_message" />
|
190 |
</admin-texts>
|
191 |
</wpml-config>
|
1 |
<wpml-config>
|
2 |
<admin-texts>
|
3 |
+
<key name="wcj_global_price_labels_add_before_text" />
|
4 |
+
<key name="wcj_global_price_labels_add_after_text" />
|
5 |
+
<key name="wcj_global_price_labels_between_regular_and_sale_text" />
|
6 |
+
<key name="wcj_global_price_labels_remove_text" />
|
7 |
+
<key name="wcj_global_price_labels_replace_text" />
|
8 |
+
<key name="wcj_global_price_labels_replace_with_text" />
|
9 |
<key name="wcj_call_for_price_text" />
|
10 |
<key name="wcj_call_for_price_text_on_archive" />
|
11 |
<key name="wcj_call_for_price_text_on_home" />
|
16 |
<key name="wcj_sorting_by_sku_desc_text" />
|
17 |
<key name="wcj_sorting_by_stock_quantity_asc_text" />
|
18 |
<key name="wcj_sorting_by_stock_quantity_desc_text" />
|
19 |
+
<key name="wcj_product_custom_info_content_single_1" />
|
20 |
+
<key name="wcj_product_custom_info_content_single_2" />
|
21 |
+
<key name="wcj_product_custom_info_content_single_3" />
|
22 |
+
<key name="wcj_product_custom_info_content_single_4" />
|
23 |
+
<key name="wcj_product_custom_info_content_single_5" />
|
24 |
+
<key name="wcj_product_custom_info_content_single_6" />
|
25 |
+
<key name="wcj_product_custom_info_content_single_7" />
|
26 |
+
<key name="wcj_product_custom_info_content_single_8" />
|
27 |
+
<key name="wcj_product_custom_info_content_single_9" />
|
28 |
+
<key name="wcj_product_custom_info_content_single_10" />
|
29 |
+
<key name="wcj_product_custom_info_content_archive_1" />
|
30 |
+
<key name="wcj_product_custom_info_content_archive_2" />
|
31 |
+
<key name="wcj_product_custom_info_content_archive_3" />
|
32 |
+
<key name="wcj_product_custom_info_content_archive_4" />
|
33 |
+
<key name="wcj_product_custom_info_content_archive_5" />
|
34 |
+
<key name="wcj_product_custom_info_content_archive_6" />
|
35 |
+
<key name="wcj_product_custom_info_content_archive_7" />
|
36 |
+
<key name="wcj_product_custom_info_content_archive_8" />
|
37 |
+
<key name="wcj_product_custom_info_content_archive_9" />
|
38 |
+
<key name="wcj_product_custom_info_content_archive_10" />
|
39 |
<key name="wcj_more_product_info_on_archive_1" />
|
40 |
<key name="wcj_more_product_info_on_archive_2" />
|
41 |
<key name="wcj_more_product_info_on_archive_3" />
|
42 |
<key name="wcj_more_product_info_on_archive_4" />
|
43 |
+
<key name="wcj_more_product_info_on_archive_5" />
|
44 |
+
<key name="wcj_more_product_info_on_archive_6" />
|
45 |
+
<key name="wcj_more_product_info_on_archive_7" />
|
46 |
+
<key name="wcj_more_product_info_on_archive_8" />
|
47 |
+
<key name="wcj_more_product_info_on_archive_9" />
|
48 |
+
<key name="wcj_more_product_info_on_archive_10" />
|
49 |
<key name="wcj_more_product_info_on_single_1" />
|
50 |
<key name="wcj_more_product_info_on_single_2" />
|
51 |
<key name="wcj_more_product_info_on_single_3" />
|
52 |
<key name="wcj_more_product_info_on_single_4" />
|
53 |
+
<key name="wcj_more_product_info_on_single_5" />
|
54 |
+
<key name="wcj_more_product_info_on_single_6" />
|
55 |
+
<key name="wcj_more_product_info_on_single_7" />
|
56 |
+
<key name="wcj_more_product_info_on_single_8" />
|
57 |
+
<key name="wcj_more_product_info_on_single_9" />
|
58 |
+
<key name="wcj_more_product_info_on_single_10" />
|
59 |
<key name="wcj_product_info_on_archive" />
|
60 |
<key name="wcj_product_info_on_single" />
|
61 |
<key name="wcj_custom_product_tabs_title_global_1" />
|
62 |
<key name="wcj_custom_product_tabs_content_global_1" />
|
63 |
+
<key name="wcj_custom_product_tabs_title_global_2" />
|
64 |
+
<key name="wcj_custom_product_tabs_content_global_2" />
|
65 |
+
<key name="wcj_custom_product_tabs_title_global_3" />
|
66 |
+
<key name="wcj_custom_product_tabs_content_global_3" />
|
67 |
+
<key name="wcj_custom_product_tabs_title_global_4" />
|
68 |
+
<key name="wcj_custom_product_tabs_content_global_4" />
|
69 |
+
<key name="wcj_custom_product_tabs_title_global_5" />
|
70 |
+
<key name="wcj_custom_product_tabs_content_global_5" />
|
71 |
+
<key name="wcj_custom_product_tabs_title_global_6" />
|
72 |
+
<key name="wcj_custom_product_tabs_content_global_6" />
|
73 |
+
<key name="wcj_custom_product_tabs_title_global_7" />
|
74 |
+
<key name="wcj_custom_product_tabs_content_global_7" />
|
75 |
+
<key name="wcj_custom_product_tabs_title_global_8" />
|
76 |
+
<key name="wcj_custom_product_tabs_content_global_8" />
|
77 |
+
<key name="wcj_custom_product_tabs_title_global_9" />
|
78 |
+
<key name="wcj_custom_product_tabs_content_global_9" />
|
79 |
+
<key name="wcj_custom_product_tabs_title_global_10" />
|
80 |
+
<key name="wcj_custom_product_tabs_content_global_10" />
|
81 |
<key name="wcj_product_info_product_tabs_description_title" />
|
82 |
<key name="wcj_product_info_product_tabs_additional_information_title" />
|
83 |
<key name="wcj_product_info_product_tabs_reviews_title" />
|
90 |
<key name="wcj_product_input_fields_title_global_1" />
|
91 |
<key name="wcj_product_input_fields_placeholder_global_1" />
|
92 |
<key name="wcj_product_input_fields_required_message_global_1" />
|
93 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_2" />
|
94 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_2" />
|
95 |
+
<key name="wcj_product_input_fields_type_file_accept_global_2" />
|
96 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_2" />
|
97 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_2" />
|
98 |
+
<key name="wcj_product_input_fields_type_select_options_global_2" />
|
99 |
+
<key name="wcj_product_input_fields_title_global_2" />
|
100 |
+
<key name="wcj_product_input_fields_placeholder_global_2" />
|
101 |
+
<key name="wcj_product_input_fields_required_message_global_2" />
|
102 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_3" />
|
103 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_3" />
|
104 |
+
<key name="wcj_product_input_fields_type_file_accept_global_3" />
|
105 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_3" />
|
106 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_3" />
|
107 |
+
<key name="wcj_product_input_fields_type_select_options_global_3" />
|
108 |
+
<key name="wcj_product_input_fields_title_global_3" />
|
109 |
+
<key name="wcj_product_input_fields_placeholder_global_3" />
|
110 |
+
<key name="wcj_product_input_fields_required_message_global_3" />
|
111 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_4" />
|
112 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_4" />
|
113 |
+
<key name="wcj_product_input_fields_type_file_accept_global_4" />
|
114 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_4" />
|
115 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_4" />
|
116 |
+
<key name="wcj_product_input_fields_type_select_options_global_4" />
|
117 |
+
<key name="wcj_product_input_fields_title_global_4" />
|
118 |
+
<key name="wcj_product_input_fields_placeholder_global_4" />
|
119 |
+
<key name="wcj_product_input_fields_required_message_global_4" />
|
120 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_5" />
|
121 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_5" />
|
122 |
+
<key name="wcj_product_input_fields_type_file_accept_global_5" />
|
123 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_5" />
|
124 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_5" />
|
125 |
+
<key name="wcj_product_input_fields_type_select_options_global_5" />
|
126 |
+
<key name="wcj_product_input_fields_title_global_5" />
|
127 |
+
<key name="wcj_product_input_fields_placeholder_global_5" />
|
128 |
+
<key name="wcj_product_input_fields_required_message_global_5" />
|
129 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_6" />
|
130 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_6" />
|
131 |
+
<key name="wcj_product_input_fields_type_file_accept_global_6" />
|
132 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_6" />
|
133 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_6" />
|
134 |
+
<key name="wcj_product_input_fields_type_select_options_global_6" />
|
135 |
+
<key name="wcj_product_input_fields_title_global_6" />
|
136 |
+
<key name="wcj_product_input_fields_placeholder_global_6" />
|
137 |
+
<key name="wcj_product_input_fields_required_message_global_6" />
|
138 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_7" />
|
139 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_7" />
|
140 |
+
<key name="wcj_product_input_fields_type_file_accept_global_7" />
|
141 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_7" />
|
142 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_7" />
|
143 |
+
<key name="wcj_product_input_fields_type_select_options_global_7" />
|
144 |
+
<key name="wcj_product_input_fields_title_global_7" />
|
145 |
+
<key name="wcj_product_input_fields_placeholder_global_7" />
|
146 |
+
<key name="wcj_product_input_fields_required_message_global_7" />
|
147 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_8" />
|
148 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_8" />
|
149 |
+
<key name="wcj_product_input_fields_type_file_accept_global_8" />
|
150 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_8" />
|
151 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_8" />
|
152 |
+
<key name="wcj_product_input_fields_type_select_options_global_8" />
|
153 |
+
<key name="wcj_product_input_fields_title_global_8" />
|
154 |
+
<key name="wcj_product_input_fields_placeholder_global_8" />
|
155 |
+
<key name="wcj_product_input_fields_required_message_global_8" />
|
156 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_9" />
|
157 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_9" />
|
158 |
+
<key name="wcj_product_input_fields_type_file_accept_global_9" />
|
159 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_9" />
|
160 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_9" />
|
161 |
+
<key name="wcj_product_input_fields_type_select_options_global_9" />
|
162 |
+
<key name="wcj_product_input_fields_title_global_9" />
|
163 |
+
<key name="wcj_product_input_fields_placeholder_global_9" />
|
164 |
+
<key name="wcj_product_input_fields_required_message_global_9" />
|
165 |
+
<key name="wcj_product_input_fields_type_checkbox_yes_global_10" />
|
166 |
+
<key name="wcj_product_input_fields_type_checkbox_no_global_10" />
|
167 |
+
<key name="wcj_product_input_fields_type_file_accept_global_10" />
|
168 |
+
<key name="wcj_product_input_fields_type_datepicker_format_global_10" />
|
169 |
+
<key name="wcj_product_input_fields_type_timepicker_format_global_10" />
|
170 |
+
<key name="wcj_product_input_fields_type_select_options_global_10" />
|
171 |
+
<key name="wcj_product_input_fields_title_global_10" />
|
172 |
+
<key name="wcj_product_input_fields_placeholder_global_10" />
|
173 |
+
<key name="wcj_product_input_fields_required_message_global_10" />
|
174 |
<key name="wcj_product_input_fields_frontend_view_required_html" />
|
175 |
<key name="wcj_product_input_fields_frontend_view_order_table_format" />
|
176 |
<key name="wcj_wholesale_price_show_info_on_cart_format" />
|
180 |
<key name="wcj_product_images_sale_flash_html" />
|
181 |
<key name="wcj_add_to_cart_per_category_text_single_group_1" />
|
182 |
<key name="wcj_add_to_cart_per_category_text_archive_group_1" />
|
183 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_2" />
|
184 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_2" />
|
185 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_3" />
|
186 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_3" />
|
187 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_4" />
|
188 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_4" />
|
189 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_5" />
|
190 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_5" />
|
191 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_6" />
|
192 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_6" />
|
193 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_7" />
|
194 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_7" />
|
195 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_8" />
|
196 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_8" />
|
197 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_9" />
|
198 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_9" />
|
199 |
+
<key name="wcj_add_to_cart_per_category_text_single_group_10" />
|
200 |
+
<key name="wcj_add_to_cart_per_category_text_archive_group_10" />
|
201 |
<key name="wcj_add_to_cart_text_on_single_simple" />
|
202 |
<key name="wcj_add_to_cart_text_on_archives_simple" />
|
203 |
<key name="wcj_add_to_cart_text_on_single_zero_price_simple" />
|
230 |
<key name="wcj_add_to_cart_text_on_archives_in_cart_other" />
|
231 |
<key name="wcj_checkout_place_order_button_text" />
|
232 |
<key name="wcj_cart_custom_info_content_1" />
|
233 |
+
<key name="wcj_cart_custom_info_content_2" />
|
234 |
+
<key name="wcj_cart_custom_info_content_3" />
|
235 |
+
<key name="wcj_cart_custom_info_content_4" />
|
236 |
+
<key name="wcj_cart_custom_info_content_5" />
|
237 |
+
<key name="wcj_cart_custom_info_content_6" />
|
238 |
+
<key name="wcj_cart_custom_info_content_7" />
|
239 |
+
<key name="wcj_cart_custom_info_content_8" />
|
240 |
+
<key name="wcj_cart_custom_info_content_9" />
|
241 |
+
<key name="wcj_cart_custom_info_content_10" />
|
242 |
<key name="wcj_cart_custom_info_item" />
|
243 |
<key name="wcj_empty_cart_text" />
|
244 |
<key name="wcj_empty_cart_confirmation_text" />
|
245 |
<key name="wcj_mini_cart_custom_info_content_1" />
|
246 |
+
<key name="wcj_mini_cart_custom_info_content_2" />
|
247 |
+
<key name="wcj_mini_cart_custom_info_content_3" />
|
248 |
+
<key name="wcj_mini_cart_custom_info_content_4" />
|
249 |
+
<key name="wcj_mini_cart_custom_info_content_5" />
|
250 |
+
<key name="wcj_mini_cart_custom_info_content_6" />
|
251 |
+
<key name="wcj_mini_cart_custom_info_content_7" />
|
252 |
+
<key name="wcj_mini_cart_custom_info_content_8" />
|
253 |
+
<key name="wcj_mini_cart_custom_info_content_9" />
|
254 |
+
<key name="wcj_mini_cart_custom_info_content_10" />
|
255 |
<key name="wcj_checkout_fields_billing_country_label" />
|
256 |
<key name="wcj_checkout_fields_billing_country_placeholder" />
|
257 |
<key name="wcj_checkout_fields_billing_first_name_label" />
|
303 |
<key name="wcj_checkout_custom_field_timepicker_format_1" />
|
304 |
<key name="wcj_checkout_custom_field_label_1" />
|
305 |
<key name="wcj_checkout_custom_field_placeholder_1" />
|
306 |
+
<key name="wcj_checkout_custom_field_select_options_2" />
|
307 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_2" />
|
308 |
+
<key name="wcj_checkout_custom_field_checkbox_no_2" />
|
309 |
+
<key name="wcj_checkout_custom_field_datepicker_format_2" />
|
310 |
+
<key name="wcj_checkout_custom_field_timepicker_format_2" />
|
311 |
+
<key name="wcj_checkout_custom_field_label_2" />
|
312 |
+
<key name="wcj_checkout_custom_field_placeholder_2" />
|
313 |
+
<key name="wcj_checkout_custom_field_select_options_3" />
|
314 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_3" />
|
315 |
+
<key name="wcj_checkout_custom_field_checkbox_no_3" />
|
316 |
+
<key name="wcj_checkout_custom_field_datepicker_format_3" />
|
317 |
+
<key name="wcj_checkout_custom_field_timepicker_format_3" />
|
318 |
+
<key name="wcj_checkout_custom_field_label_3" />
|
319 |
+
<key name="wcj_checkout_custom_field_placeholder_3" />
|
320 |
+
<key name="wcj_checkout_custom_field_select_options_4" />
|
321 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_4" />
|
322 |
+
<key name="wcj_checkout_custom_field_checkbox_no_4" />
|
323 |
+
<key name="wcj_checkout_custom_field_datepicker_format_4" />
|
324 |
+
<key name="wcj_checkout_custom_field_timepicker_format_4" />
|
325 |
+
<key name="wcj_checkout_custom_field_label_4" />
|
326 |
+
<key name="wcj_checkout_custom_field_placeholder_4" />
|
327 |
+
<key name="wcj_checkout_custom_field_select_options_5" />
|
328 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_5" />
|
329 |
+
<key name="wcj_checkout_custom_field_checkbox_no_5" />
|
330 |
+
<key name="wcj_checkout_custom_field_datepicker_format_5" />
|
331 |
+
<key name="wcj_checkout_custom_field_timepicker_format_5" />
|
332 |
+
<key name="wcj_checkout_custom_field_label_5" />
|
333 |
+
<key name="wcj_checkout_custom_field_placeholder_5" />
|
334 |
+
<key name="wcj_checkout_custom_field_select_options_6" />
|
335 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_6" />
|
336 |
+
<key name="wcj_checkout_custom_field_checkbox_no_6" />
|
337 |
+
<key name="wcj_checkout_custom_field_datepicker_format_6" />
|
338 |
+
<key name="wcj_checkout_custom_field_timepicker_format_6" />
|
339 |
+
<key name="wcj_checkout_custom_field_label_6" />
|
340 |
+
<key name="wcj_checkout_custom_field_placeholder_6" />
|
341 |
+
<key name="wcj_checkout_custom_field_select_options_7" />
|
342 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_7" />
|
343 |
+
<key name="wcj_checkout_custom_field_checkbox_no_7" />
|
344 |
+
<key name="wcj_checkout_custom_field_datepicker_format_7" />
|
345 |
+
<key name="wcj_checkout_custom_field_timepicker_format_7" />
|
346 |
+
<key name="wcj_checkout_custom_field_label_7" />
|
347 |
+
<key name="wcj_checkout_custom_field_placeholder_7" />
|
348 |
+
<key name="wcj_checkout_custom_field_select_options_8" />
|
349 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_8" />
|
350 |
+
<key name="wcj_checkout_custom_field_checkbox_no_8" />
|
351 |
+
<key name="wcj_checkout_custom_field_datepicker_format_8" />
|
352 |
+
<key name="wcj_checkout_custom_field_timepicker_format_8" />
|
353 |
+
<key name="wcj_checkout_custom_field_label_8" />
|
354 |
+
<key name="wcj_checkout_custom_field_placeholder_8" />
|
355 |
+
<key name="wcj_checkout_custom_field_select_options_9" />
|
356 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_9" />
|
357 |
+
<key name="wcj_checkout_custom_field_checkbox_no_9" />
|
358 |
+
<key name="wcj_checkout_custom_field_datepicker_format_9" />
|
359 |
+
<key name="wcj_checkout_custom_field_timepicker_format_9" />
|
360 |
+
<key name="wcj_checkout_custom_field_label_9" />
|
361 |
+
<key name="wcj_checkout_custom_field_placeholder_9" />
|
362 |
+
<key name="wcj_checkout_custom_field_select_options_10" />
|
363 |
+
<key name="wcj_checkout_custom_field_checkbox_yes_10" />
|
364 |
+
<key name="wcj_checkout_custom_field_checkbox_no_10" />
|
365 |
+
<key name="wcj_checkout_custom_field_datepicker_format_10" />
|
366 |
+
<key name="wcj_checkout_custom_field_timepicker_format_10" />
|
367 |
+
<key name="wcj_checkout_custom_field_label_10" />
|
368 |
+
<key name="wcj_checkout_custom_field_placeholder_10" />
|
369 |
<key name="wcj_checkout_custom_info_content_1" />
|
370 |
+
<key name="wcj_checkout_custom_info_content_2" />
|
371 |
+
<key name="wcj_checkout_custom_info_content_3" />
|
372 |
+
<key name="wcj_checkout_custom_info_content_4" />
|
373 |
+
<key name="wcj_checkout_custom_info_content_5" />
|
374 |
+
<key name="wcj_checkout_custom_info_content_6" />
|
375 |
+
<key name="wcj_checkout_custom_info_content_7" />
|
376 |
+
<key name="wcj_checkout_custom_info_content_8" />
|
377 |
+
<key name="wcj_checkout_custom_info_content_9" />
|
378 |
+
<key name="wcj_checkout_custom_info_content_10" />
|
379 |
+
<key name="wcj_gateways_fees_text_bacs" />
|
380 |
+
<key name="wcj_gateways_fees_text_cheque" />
|
381 |
+
<key name="wcj_gateways_fees_text_cod" />
|
382 |
+
<key name="wcj_gateways_fees_text_paypal" />
|
383 |
<key name="wcj_order_minimum_amount_error_message" />
|
384 |
<key name="wcj_order_minimum_amount_cart_notice_message" />
|
385 |
+
<key name="wcj_eu_vat_number_field_label" />
|
386 |
+
<key name="wcj_eu_vat_number_field_placeholder" />
|
387 |
+
<key name="wcj_eu_vat_number_field_description" />
|
388 |
+
<key name="wcj_eu_vat_number_not_valid_message" />
|
389 |
<key name="wcj_invoicing_invoice_template" />
|
390 |
<key name="wcj_invoicing_proforma_invoice_template" />
|
391 |
<key name="wcj_invoicing_packing_slip_template" />
|
436 |
<key name="wcj_invoicing_custom_doc_admin_column_delete_btn" />
|
437 |
<key name="wcj_invoicing_custom_doc_link_text" />
|
438 |
<key name="wcj_invoicing_custom_doc_file_name" />
|
|
|
|
|
|
|
|
|
439 |
</admin-texts>
|
440 |
</wpml-config>
|