Version Description
- 09/03/2016 =
- Dev - PAYMENT GATEWAYS - Gateways Currency - "Reset settings" button added to admin settings.
- Fix - "Reset settings" bug fixed.
- Dev -
WCJ_Module
class code refactoring. - Fix - PRICES & CURRENCIES - Price by Country - Price range for variable products bug fixed.
- Fix - PRICES & CURRENCIES - Price by Country - Price per product for variable products bug fixed.
- Dev - PRICES & CURRENCIES - Multicurrency - Initial module release.
Download this release
Release Info
Developer | algoritmika |
Plugin | Booster for WooCommerce |
Version | 2.4.3 |
Comparing to | |
See all releases |
Code changes from version 2.4.2 to 2.4.3
- includes/admin/wcj-modules-cats.php +2 -1
- includes/class-wcj-multicurrency.php +349 -0
- includes/class-wcj-payment-gateways-currency.php +4 -6
- includes/classes/class-wcj-module.php +15 -10
- includes/currencies/wcj-currencies.php +171 -164
- includes/exchange-rates/class-wcj-exchange-rates-crons.php +10 -2
- includes/exchange-rates/class-wcj-exchange-rates.php +21 -5
- includes/price-by-country/class-wcj-price-by-country-core.php +28 -21
- includes/shortcodes/class-wcj-general-shortcodes.php +49 -4
- includes/widgets/class-wcj-widget-multicurrency.php +83 -0
- readme.txt +11 -2
- woocommerce-jetpack.php +10 -3
includes/admin/wcj-modules-cats.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Modules Array.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -26,6 +26,7 @@ return array(
|
|
26 |
'default_cat_id' => 'price_by_country',
|
27 |
'all_cat_ids' => array(
|
28 |
'price_by_country',
|
|
|
29 |
'currency',
|
30 |
'currency_external_products',
|
31 |
'bulk_price_converter',
|
4 |
*
|
5 |
* The WooCommerce Modules Array.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
26 |
'default_cat_id' => 'price_by_country',
|
27 |
'all_cat_ids' => array(
|
28 |
'price_by_country',
|
29 |
+
'multicurrency',
|
30 |
'currency',
|
31 |
'currency_external_products',
|
32 |
'bulk_price_converter',
|
includes/class-wcj-multicurrency.php
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Multicurrency
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Multicurrency class.
|
6 |
+
*
|
7 |
+
* @version 2.4.3
|
8 |
+
* @since 2.4.3
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WCJ_Multicurrency' ) ) :
|
15 |
+
|
16 |
+
class WCJ_Multicurrency extends WCJ_Module {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.3
|
22 |
+
*/
|
23 |
+
function __construct() {
|
24 |
+
|
25 |
+
$this->id = 'multicurrency';
|
26 |
+
$this->short_desc = __( 'Multicurrency', 'woocommerce-jetpack' );
|
27 |
+
$this->desc = __( 'Add multiple currencies (currency switcher) to WooCommerce.', 'woocommerce-jetpack' );
|
28 |
+
parent::__construct();
|
29 |
+
|
30 |
+
add_filter( 'init', array( $this, 'add_settings_hook' ) );
|
31 |
+
|
32 |
+
if ( $this->is_enabled() ) {
|
33 |
+
add_filter( 'init', array( $this, 'add_hooks' ) );
|
34 |
+
|
35 |
+
if ( 'yes' === get_option( 'wcj_multicurrency_per_product_enabled' , 'yes' ) ) {
|
36 |
+
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
|
37 |
+
add_action( 'save_post_product', array( $this, 'save_meta_box' ), PHP_INT_MAX, 2 );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* get_meta_box_options.
|
44 |
+
*
|
45 |
+
* @version 2.4.3
|
46 |
+
*/
|
47 |
+
function get_meta_box_options() {
|
48 |
+
$main_product_id = get_the_ID();
|
49 |
+
$_product = wc_get_product( $main_product_id );
|
50 |
+
$products = array();
|
51 |
+
if ( $_product->is_type( 'variable' ) ) {
|
52 |
+
$available_variations = $_product->get_available_variations();
|
53 |
+
foreach ( $available_variations as $variation ) {
|
54 |
+
$variation_product = wc_get_product( $variation['variation_id'] );
|
55 |
+
$products[ $variation['variation_id'] ] = ' (' . $variation_product->get_formatted_variation_attributes( true ) . ')';
|
56 |
+
}
|
57 |
+
} else {
|
58 |
+
$products[ $main_product_id ] = '';
|
59 |
+
}
|
60 |
+
$currencies = array();
|
61 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
|
62 |
+
foreach ( $products as $product_id => $desc ) {
|
63 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
64 |
+
$currency_code = get_option( 'wcj_multicurrency_currency_' . $i );
|
65 |
+
$currencies = array_merge( $currencies, array(
|
66 |
+
array(
|
67 |
+
'name' => 'wcj_multicurrency_per_product_regular_price_' . $currency_code . '_' . $product_id,
|
68 |
+
'default' => '',
|
69 |
+
'type' => 'price',
|
70 |
+
'title' => '[' . $currency_code . '] ' . __( 'Regular Price', 'woocommerce-jetpack' ),
|
71 |
+
'desc' => $desc,
|
72 |
+
'product_id' => $product_id,
|
73 |
+
'meta_name' => '_' . 'wcj_multicurrency_per_product_regular_price_' . $currency_code,
|
74 |
+
),
|
75 |
+
array(
|
76 |
+
'name' => 'wcj_multicurrency_per_product_sale_price_' . $currency_code . '_' . $product_id,
|
77 |
+
'default' => '',
|
78 |
+
'type' => 'price',
|
79 |
+
'title' => '[' . $currency_code . '] ' . __( 'Sale Price', 'woocommerce-jetpack' ),
|
80 |
+
'desc' => $desc,
|
81 |
+
'product_id' => $product_id,
|
82 |
+
'meta_name' => '_' . 'wcj_multicurrency_per_product_sale_price_' . $currency_code,
|
83 |
+
),
|
84 |
+
) );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
return $currencies;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* add_hooks.
|
92 |
+
*
|
93 |
+
* @version 2.4.3
|
94 |
+
*/
|
95 |
+
function add_hooks() {
|
96 |
+
// Session
|
97 |
+
if ( ! session_id() ) {
|
98 |
+
session_start();
|
99 |
+
}
|
100 |
+
if ( isset( $_REQUEST['wcj-currency'] ) ) {
|
101 |
+
$_SESSION['wcj-currency'] = $_REQUEST['wcj-currency'];
|
102 |
+
}
|
103 |
+
if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
|
104 |
+
// Prices
|
105 |
+
add_filter( 'woocommerce_get_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
106 |
+
add_filter( 'woocommerce_get_sale_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
107 |
+
add_filter( 'woocommerce_get_regular_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
108 |
+
// Currency hooks
|
109 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol' ), PHP_INT_MAX - 1, 2 );
|
110 |
+
add_filter( 'woocommerce_currency', array( $this, 'change_currency_code' ), PHP_INT_MAX - 1, 1 );
|
111 |
+
// Shipping
|
112 |
+
add_filter( 'woocommerce_package_rates', array( $this, 'change_shipping_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
113 |
+
// Variations
|
114 |
+
add_filter( 'woocommerce_variation_prices_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
115 |
+
add_filter( 'woocommerce_variation_prices_regular_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
116 |
+
add_filter( 'woocommerce_variation_prices_sale_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 1, 2 );
|
117 |
+
add_filter( 'woocommerce_get_variation_prices_hash', array( $this, 'get_variation_prices_hash' ), PHP_INT_MAX - 1, 3 );
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* get_variation_prices_hash.
|
123 |
+
*
|
124 |
+
* @version 2.4.3
|
125 |
+
*/
|
126 |
+
function get_variation_prices_hash( $price_hash, $_product, $display ) {
|
127 |
+
$price_hash['wcj_currency'] = $this->get_current_currency_code();
|
128 |
+
return $price_hash;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* change_price_by_currency.
|
133 |
+
*
|
134 |
+
* @version 2.4.3
|
135 |
+
*/
|
136 |
+
function get_currency_exchange_rate( $currency_code ) {
|
137 |
+
$currency_exchange_rate = 1;
|
138 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
|
139 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
140 |
+
if ( $currency_code === get_option( 'wcj_multicurrency_currency_' . $i ) ) {
|
141 |
+
$currency_exchange_rate = get_option( 'wcj_multicurrency_exchange_rate_' . $i );
|
142 |
+
break;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
return $currency_exchange_rate;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* change_price_by_currency.
|
150 |
+
*
|
151 |
+
* @version 2.4.3
|
152 |
+
*/
|
153 |
+
function change_price_by_currency( $price, $_product ) {
|
154 |
+
|
155 |
+
// Per product
|
156 |
+
if ( 'yes' === get_option( 'wcj_multicurrency_per_product_enabled' , 'yes' ) ) {
|
157 |
+
$the_product_id = ( isset( $_product->variation_id ) ) ? $_product->variation_id : $_product->id;
|
158 |
+
if ( '' != ( $regular_price_per_product = get_post_meta( $the_product_id, '_' . 'wcj_multicurrency_per_product_regular_price_' . $this->get_current_currency_code(), true ) ) ) {
|
159 |
+
if ( 'woocommerce_get_price' == current_filter() || 'woocommerce_variation_prices_price' == current_filter() ) {
|
160 |
+
$sale_price_per_product = get_post_meta( $the_product_id, '_' . 'wcj_multicurrency_per_product_sale_price_' . $this->get_current_currency_code(), true );
|
161 |
+
return ( '' != $sale_price_per_product && $sale_price_per_product < $regular_price_per_product ) ? $sale_price_per_product : $regular_price_per_product;
|
162 |
+
} elseif ( 'woocommerce_get_regular_price' == current_filter() || 'woocommerce_variation_prices_regular_price' == current_filter() ) {
|
163 |
+
return $regular_price_per_product;
|
164 |
+
} elseif ( 'woocommerce_get_sale_price' == current_filter() || 'woocommerce_variation_prices_sale_price' == current_filter() ) {
|
165 |
+
$sale_price_per_product = get_post_meta( $the_product_id, '_' . 'wcj_multicurrency_per_product_sale_price_' . $this->get_current_currency_code(), true );
|
166 |
+
return ( '' != $sale_price_per_product ) ? $sale_price_per_product : $price;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
// Global
|
172 |
+
if ( 1 != ( $currency_exchange_rate = $this->get_currency_exchange_rate( $this->get_current_currency_code() ) ) ) {
|
173 |
+
return $price * $currency_exchange_rate;
|
174 |
+
}
|
175 |
+
|
176 |
+
// No changes
|
177 |
+
return $price;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* change_currency_symbol.
|
182 |
+
*
|
183 |
+
* @version 2.4.3
|
184 |
+
*/
|
185 |
+
function change_currency_symbol( $currency_symbol, $currency ) {
|
186 |
+
return wcj_get_currency_symbol( $this->get_current_currency_code( $currency ) );
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* change_currency_code.
|
191 |
+
*
|
192 |
+
* @version 2.4.3
|
193 |
+
*/
|
194 |
+
function get_current_currency_code( $default_currency = '' ) {
|
195 |
+
return ( isset( $_SESSION['wcj-currency'] ) ) ? $_SESSION['wcj-currency'] : $default_currency;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* change_currency_code.
|
200 |
+
*
|
201 |
+
* @version 2.4.3
|
202 |
+
*/
|
203 |
+
function change_currency_code( $currency ) {
|
204 |
+
return $this->get_current_currency_code( $currency );
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* change_shipping_price_by_currency.
|
209 |
+
*
|
210 |
+
* @version 2.4.3
|
211 |
+
*/
|
212 |
+
function change_shipping_price_by_currency( $package_rates, $package ) {
|
213 |
+
$currency_exchange_rate = $this->get_currency_exchange_rate( $this->get_current_currency_code() );
|
214 |
+
$modified_package_rates = array();
|
215 |
+
foreach ( $package_rates as $id => $package_rate ) {
|
216 |
+
if ( 1 != $currency_exchange_rate && isset( $package_rate->cost ) ) {
|
217 |
+
$package_rate->cost = $package_rate->cost * $currency_exchange_rate;
|
218 |
+
}
|
219 |
+
$modified_package_rates[ $id ] = $package_rate;
|
220 |
+
}
|
221 |
+
return $modified_package_rates;
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* add_settings_hook.
|
226 |
+
*
|
227 |
+
* @version 2.4.3
|
228 |
+
*/
|
229 |
+
function add_settings_hook() {
|
230 |
+
add_filter( 'wcj_multicurrency_settings', array( $this, 'add_settings' ) );
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* get_settings.
|
235 |
+
*
|
236 |
+
* @version 2.4.3
|
237 |
+
*/
|
238 |
+
function get_settings() {
|
239 |
+
$settings = apply_filters( 'wcj_multicurrency_settings', array() );
|
240 |
+
return $this->add_standard_settings( $settings, __( 'After setting currencies in the Currencies Options below, use <em>Booster - Multicurrency Switcher</em> widget, or <em>[wcj_currency_select_drop_down_list]</em> shortcode. If you want to insert switcher in your PHP code, just use <em>echo do_shortcode( \'[wcj_currency_select_drop_down_list]\' );</em>', 'woocommerce-jetpack' ) );
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* add_settings.
|
245 |
+
*
|
246 |
+
* @version 2.4.3
|
247 |
+
* @todo rounding (maybe)
|
248 |
+
*/
|
249 |
+
function add_settings() {
|
250 |
+
$currency_from = get_woocommerce_currency();
|
251 |
+
$all_currencies = wcj_get_currencies_names_and_symbols();
|
252 |
+
$settings = array(
|
253 |
+
array(
|
254 |
+
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
255 |
+
'type' => 'title',
|
256 |
+
'id' => 'wcj_multicurrency_options',
|
257 |
+
),
|
258 |
+
array(
|
259 |
+
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
260 |
+
'id' => 'wcj_multicurrency_exchange_rate_update_auto',
|
261 |
+
'default' => 'manual',
|
262 |
+
'type' => 'select',
|
263 |
+
'options' => array(
|
264 |
+
'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
|
265 |
+
'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
|
266 |
+
),
|
267 |
+
'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
|
268 |
+
__( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies§ion=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
|
269 |
+
:
|
270 |
+
apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
271 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
272 |
+
),
|
273 |
+
array(
|
274 |
+
'title' => __( 'Multicurrency on per Product Basis', 'woocommerce-jetpack' ),
|
275 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
276 |
+
'desc_tip' => __( 'This will add meta boxes in product edit.', 'woocommerce-jetpack' ),
|
277 |
+
'id' => 'wcj_multicurrency_per_product_enabled',
|
278 |
+
'default' => 'yes',
|
279 |
+
'type' => 'checkbox',
|
280 |
+
),
|
281 |
+
array(
|
282 |
+
'type' => 'sectionend',
|
283 |
+
'id' => 'wcj_multicurrency_options',
|
284 |
+
),
|
285 |
+
array(
|
286 |
+
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
287 |
+
'type' => 'title',
|
288 |
+
'desc' => __( 'One currency probably should be set to current (original) shop currency with an exchange rate of 1.', 'woocommerce-jetpack' ),
|
289 |
+
'id' => 'wcj_multicurrency_currencies_options',
|
290 |
+
),
|
291 |
+
array(
|
292 |
+
'title' => __( 'Total Currencies', 'woocommerce-jetpack' ),
|
293 |
+
'id' => 'wcj_multicurrency_total_number',
|
294 |
+
'default' => 2,
|
295 |
+
'type' => 'custom_number',
|
296 |
+
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
297 |
+
'custom_attributes' => array_merge(
|
298 |
+
is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
|
299 |
+
array( 'step' => '1', 'min' => '2', )
|
300 |
+
),
|
301 |
+
),
|
302 |
+
);
|
303 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
|
304 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
305 |
+
$currency_to = get_option( 'wcj_multicurrency_currency_' . $i, $currency_from );
|
306 |
+
$custom_attributes = array(
|
307 |
+
'currency_from' => $currency_from,
|
308 |
+
'currency_to' => $currency_to,
|
309 |
+
'multiply_by_field_id' => 'wcj_multicurrency_exchange_rate_' . $i,
|
310 |
+
);
|
311 |
+
if ( $currency_from == $currency_to ) {
|
312 |
+
$custom_attributes['disabled'] = 'disabled';
|
313 |
+
}
|
314 |
+
$settings = array_merge( $settings, array(
|
315 |
+
array(
|
316 |
+
'title' => __( 'Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
317 |
+
'id' => 'wcj_multicurrency_currency_' . $i,
|
318 |
+
'default' => $currency_from,
|
319 |
+
'type' => 'select',
|
320 |
+
'options' => $all_currencies,
|
321 |
+
'css' => 'width:250px;',
|
322 |
+
),
|
323 |
+
array(
|
324 |
+
'title' => '',
|
325 |
+
'id' => 'wcj_multicurrency_exchange_rate_' . $i,
|
326 |
+
'default' => 1,
|
327 |
+
'type' => 'exchange_rate',
|
328 |
+
'custom_attributes' => array( 'step' => '0.000001', 'min' => '0', ),
|
329 |
+
'custom_attributes_button' => $custom_attributes,
|
330 |
+
'css' => 'width:100px;',
|
331 |
+
'value' => $currency_from . '/' . $currency_to,
|
332 |
+
'value_title' => sprintf( __( 'Grab %s rate from Yahoo.com', 'woocommerce-jetpack' ), $currency_from . '/' . $currency_to ),
|
333 |
+
),
|
334 |
+
) );
|
335 |
+
}
|
336 |
+
$settings = array_merge( $settings, array(
|
337 |
+
array(
|
338 |
+
'type' => 'sectionend',
|
339 |
+
'id' => 'wcj_multicurrency_currencies_options',
|
340 |
+
),
|
341 |
+
) );
|
342 |
+
return $settings;
|
343 |
+
}
|
344 |
+
|
345 |
+
}
|
346 |
+
|
347 |
+
endif;
|
348 |
+
|
349 |
+
return new WCJ_Multicurrency();
|
includes/class-wcj-payment-gateways-currency.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways Currency class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -149,13 +149,11 @@ class WCJ_Payment_Gateways_Currency extends WCJ_Module {
|
|
149 |
/**
|
150 |
* get_settings.
|
151 |
*
|
152 |
-
* @version 2.4.
|
153 |
*/
|
154 |
function get_settings() {
|
155 |
-
$settings = array();
|
156 |
-
$
|
157 |
-
// return $this->add_standard_settings( $settings ); // TODO
|
158 |
-
return $this->add_enable_module_setting( $settings );
|
159 |
}
|
160 |
|
161 |
/**
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways Currency class.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
149 |
/**
|
150 |
* get_settings.
|
151 |
*
|
152 |
+
* @version 2.4.3
|
153 |
*/
|
154 |
function get_settings() {
|
155 |
+
$settings = apply_filters( 'wcj_payment_gateways_currency_settings', array() );
|
156 |
+
return $this->add_standard_settings( $settings );
|
|
|
|
|
157 |
}
|
158 |
|
159 |
/**
|
includes/classes/class-wcj-module.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Module class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -24,7 +24,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
24 |
/**
|
25 |
* Constructor.
|
26 |
*
|
27 |
-
* @version 2.4.
|
28 |
*/
|
29 |
public function __construct( $type = 'module' ) {
|
30 |
add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
|
@@ -33,7 +33,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
33 |
if ( 'module' === $this->type ) {
|
34 |
$this->parent_id = '';
|
35 |
}
|
36 |
-
add_action( 'init', array( $this, 'reset_settings' ) );
|
37 |
}
|
38 |
|
39 |
/**
|
@@ -88,15 +88,17 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
88 |
/**
|
89 |
* save_meta_box.
|
90 |
*
|
91 |
-
* @since 2.
|
92 |
*/
|
93 |
function save_meta_box( $post_id, $post ) {
|
94 |
// Check that we are saving with current metabox displayed.
|
95 |
if ( ! isset( $_POST[ 'woojetpack_' . $this->id . '_save_post' ] ) ) return;
|
96 |
// Save options
|
97 |
foreach ( $this->get_meta_box_options() as $option ) {
|
98 |
-
$option_value
|
99 |
-
|
|
|
|
|
100 |
}
|
101 |
}
|
102 |
|
@@ -123,15 +125,16 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
123 |
/**
|
124 |
* create_meta_box.
|
125 |
*
|
126 |
-
* @since 2.
|
127 |
*/
|
128 |
function create_meta_box() {
|
129 |
$current_post_id = get_the_ID();
|
130 |
$html = '';
|
131 |
-
//$html .= '<div style="width:40%;">';
|
132 |
$html .= '<table>';
|
133 |
foreach ( $this->get_meta_box_options() as $option ) {
|
134 |
-
$
|
|
|
|
|
135 |
$input_ending = ' id="' . $option['name'] . '" name="' . $option['name'] . '" value="' . $option_value . '">';
|
136 |
switch ( $option['type'] ) {
|
137 |
case 'number':
|
@@ -149,12 +152,14 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
149 |
}
|
150 |
$html .= '<tr>';
|
151 |
$html .= '<th style="text-align:left;">' . $option['title'] . '</th>';
|
|
|
|
|
|
|
152 |
$html .= '<td>' . $field_html . '</td>';
|
153 |
$html .= '</tr>';
|
154 |
}
|
155 |
$html .= '</table>';
|
156 |
$html .= '<input type="hidden" name="woojetpack_' . $this->id . '_save_post" value="woojetpack_' . $this->id . '_save_post">';
|
157 |
-
//$html .= '</div>';
|
158 |
echo $html;
|
159 |
}
|
160 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Module class.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
24 |
/**
|
25 |
* Constructor.
|
26 |
*
|
27 |
+
* @version 2.4.3
|
28 |
*/
|
29 |
public function __construct( $type = 'module' ) {
|
30 |
add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
|
33 |
if ( 'module' === $this->type ) {
|
34 |
$this->parent_id = '';
|
35 |
}
|
36 |
+
add_action( 'init', array( $this, 'reset_settings' ), PHP_INT_MAX );
|
37 |
}
|
38 |
|
39 |
/**
|
88 |
/**
|
89 |
* save_meta_box.
|
90 |
*
|
91 |
+
* @since 2.4.3
|
92 |
*/
|
93 |
function save_meta_box( $post_id, $post ) {
|
94 |
// Check that we are saving with current metabox displayed.
|
95 |
if ( ! isset( $_POST[ 'woojetpack_' . $this->id . '_save_post' ] ) ) return;
|
96 |
// Save options
|
97 |
foreach ( $this->get_meta_box_options() as $option ) {
|
98 |
+
$option_value = ( isset( $_POST[ $option['name'] ] ) ) ? $_POST[ $option['name'] ] : $option['default'];
|
99 |
+
$the_post_id = ( isset( $option['product_id'] ) ) ? $option['product_id'] : $post_id;
|
100 |
+
$the_meta_name = ( isset( $option['meta_name'] ) ) ? $option['meta_name'] : '_' . $option['name'];
|
101 |
+
update_post_meta( $the_post_id, $the_meta_name, $option_value );
|
102 |
}
|
103 |
}
|
104 |
|
125 |
/**
|
126 |
* create_meta_box.
|
127 |
*
|
128 |
+
* @since 2.4.3
|
129 |
*/
|
130 |
function create_meta_box() {
|
131 |
$current_post_id = get_the_ID();
|
132 |
$html = '';
|
|
|
133 |
$html .= '<table>';
|
134 |
foreach ( $this->get_meta_box_options() as $option ) {
|
135 |
+
$the_post_id = ( isset( $option['product_id'] ) ) ? $option['product_id'] : $current_post_id;
|
136 |
+
$the_meta_name = ( isset( $option['meta_name'] ) ) ? $option['meta_name'] : '_' . $option['name'];
|
137 |
+
$option_value = get_post_meta( $the_post_id, $the_meta_name, true );
|
138 |
$input_ending = ' id="' . $option['name'] . '" name="' . $option['name'] . '" value="' . $option_value . '">';
|
139 |
switch ( $option['type'] ) {
|
140 |
case 'number':
|
152 |
}
|
153 |
$html .= '<tr>';
|
154 |
$html .= '<th style="text-align:left;">' . $option['title'] . '</th>';
|
155 |
+
if ( isset( $option['desc'] ) && '' != $option['desc'] ) {
|
156 |
+
$html .= '<td style="font-style:italic;">' . $option['desc'] . '</td>';
|
157 |
+
}
|
158 |
$html .= '<td>' . $field_html . '</td>';
|
159 |
$html .= '</tr>';
|
160 |
}
|
161 |
$html .= '</table>';
|
162 |
$html .= '<input type="hidden" name="woojetpack_' . $this->id . '_save_post" value="woojetpack_' . $this->id . '_save_post">';
|
|
|
163 |
echo $html;
|
164 |
}
|
165 |
|
includes/currencies/wcj-currencies.php
CHANGED
@@ -1,166 +1,173 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
array( 'code' => 'AWG', 'name' => __( 'Aruban florin' ), 'symbol' => 'AWG', ),
|
11 |
-
array( 'code' => 'AUD', 'name' => __( 'Australian dollar' ), 'symbol' => '$', ),
|
12 |
-
array( 'code' => 'AZN', 'name' => __( 'Azerbaijani manat' ), 'symbol' => 'AZN', ),
|
13 |
-
array( 'code' => 'BSD', 'name' => __( 'Bahamian dollar' ), 'symbol' => 'BSD', ),
|
14 |
-
array( 'code' => 'BHD', 'name' => __( 'Bahraini dinar' ), 'symbol' => 'BHD', ),
|
15 |
-
array( 'code' => 'BDT', 'name' => __( 'Bangladeshi taka' ), 'symbol' => 'BDT', ),
|
16 |
-
array( 'code' => 'BBD', 'name' => __( 'Barbadian dollar' ), 'symbol' => 'BBD', ),
|
17 |
-
array( 'code' => 'BYR', 'name' => __( 'Belarusian ruble' ), 'symbol' => 'BYR', ),
|
18 |
-
array( 'code' => 'BZD', 'name' => __( 'Belize dollar' ), 'symbol' => 'BZD', ),
|
19 |
-
array( 'code' => 'BTN', 'name' => __( 'Bhutanese ngultrum' ), 'symbol' => 'BTN', ),
|
20 |
-
array( 'code' => 'BOB', 'name' => __( 'Bolivian boliviano' ), 'symbol' => 'BOB', ),
|
21 |
-
array( 'code' => 'BAM', 'name' => __( 'Bosnia and Herzegovina konvertibilna marka' ), 'symbol' => 'BAM', ),
|
22 |
-
array( 'code' => 'BWP', 'name' => __( 'Botswana pula' ), 'symbol' => 'BWP', ),
|
23 |
-
array( 'code' => 'BRL', 'name' => __( 'Brazilian real' ), 'symbol' => 'R$', ),
|
24 |
-
array( 'code' => 'GBP', 'name' => __( 'British pound' ), 'symbol' => '£', ),
|
25 |
-
array( 'code' => 'BND', 'name' => __( 'Brunei dollar' ), 'symbol' => 'BND', ),
|
26 |
-
array( 'code' => 'BGN', 'name' => __( 'Bulgarian lev' ), 'symbol' => 'BGN', ),
|
27 |
-
array( 'code' => 'BIF', 'name' => __( 'Burundi franc' ), 'symbol' => 'BIF', ),
|
28 |
-
array( 'code' => 'KYD', 'name' => __( 'Cayman Islands dollar' ), 'symbol' => 'KYD', ),
|
29 |
-
array( 'code' => 'KHR', 'name' => __( 'Cambodian riel' ), 'symbol' => 'KHR', ),
|
30 |
-
array( 'code' => 'CAD', 'name' => __( 'Canadian dollar' ), 'symbol' => 'CAD', ),
|
31 |
-
array( 'code' => 'CVE', 'name' => __( 'Cape Verdean escudo' ), 'symbol' => 'CVE', ),
|
32 |
-
array( 'code' => 'XAF', 'name' => __( 'Central African CFA franc' ), 'symbol' => 'XAF', ),
|
33 |
-
array( 'code' => 'GQE', 'name' => __( 'Central African CFA franc' ), 'symbol' => 'GQE', ),
|
34 |
-
array( 'code' => 'XPF', 'name' => __( 'CFP franc' ), 'symbol' => 'XPF', ),
|
35 |
-
array( 'code' => 'CLP', 'name' => __( 'Chilean peso' ), 'symbol' => 'CLP', ),
|
36 |
-
array( 'code' => 'CNY', 'name' => __( 'Chinese renminbi' ), 'symbol' => '¥', ),
|
37 |
-
array( 'code' => 'COP', 'name' => __( 'Colombian peso' ), 'symbol' => 'COP', ),
|
38 |
-
array( 'code' => 'KMF', 'name' => __( 'Comorian franc' ), 'symbol' => 'KMF', ),
|
39 |
-
array( 'code' => 'CDF', 'name' => __( 'Congolese franc' ), 'symbol' => 'CDF', ),
|
40 |
-
array( 'code' => 'CRC', 'name' => __( 'Costa Rican colon' ), 'symbol' => 'CRC', ),
|
41 |
-
array( 'code' => 'HRK', 'name' => __( 'Croatian kuna' ), 'symbol' => 'HRK', ),
|
42 |
-
array( 'code' => 'CUC', 'name' => __( 'Cuban peso' ), 'symbol' => 'CUC', ),
|
43 |
-
array( 'code' => 'CZK', 'name' => __( 'Czech koruna' ), 'symbol' => 'Kč', ),
|
44 |
-
array( 'code' => 'DKK', 'name' => __( 'Danish krone' ), 'symbol' => 'kr', ),
|
45 |
-
array( 'code' => 'DJF', 'name' => __( 'Djiboutian franc' ), 'symbol' => 'DJF', ),
|
46 |
-
array( 'code' => 'DOP', 'name' => __( 'Dominican peso' ), 'symbol' => 'DOP', ),
|
47 |
-
array( 'code' => 'XCD', 'name' => __( 'East Caribbean dollar' ), 'symbol' => 'XCD', ),
|
48 |
-
array( 'code' => 'EGP', 'name' => __( 'Egyptian pound' ), 'symbol' => 'EGP', ),
|
49 |
-
array( 'code' => 'ERN', 'name' => __( 'Eritrean nakfa' ), 'symbol' => 'ERN', ),
|
50 |
-
array( 'code' => 'EEK', 'name' => __( 'Estonian kroon' ), 'symbol' => 'EEK', ),
|
51 |
-
array( 'code' => 'ETB', 'name' => __( 'Ethiopian birr' ), 'symbol' => 'ETB', ),
|
52 |
-
array( 'code' => 'EUR', 'name' => __( 'European euro' ), 'symbol' => '€', ),
|
53 |
-
array( 'code' => 'FKP', 'name' => __( 'Falkland Islands pound' ), 'symbol' => 'FKP', ),
|
54 |
-
array( 'code' => 'FJD', 'name' => __( 'Fijian dollar' ), 'symbol' => 'FJD', ),
|
55 |
-
array( 'code' => 'GMD', 'name' => __( 'Gambian dalasi' ), 'symbol' => 'GMD', ),
|
56 |
-
array( 'code' => 'GEL', 'name' => __( 'Georgian lari' ), 'symbol' => 'GEL', ),
|
57 |
-
array( 'code' => 'GHS', 'name' => __( 'Ghanaian cedi' ), 'symbol' => 'GHS', ),
|
58 |
-
array( 'code' => 'GIP', 'name' => __( 'Gibraltar pound' ), 'symbol' => 'GIP', ),
|
59 |
-
array( 'code' => 'GTQ', 'name' => __( 'Guatemalan quetzal' ), 'symbol' => 'GTQ', ),
|
60 |
-
array( 'code' => 'GNF', 'name' => __( 'Guinean franc' ), 'symbol' => 'GNF', ),
|
61 |
-
array( 'code' => 'GYD', 'name' => __( 'Guyanese dollar' ), 'symbol' => 'GYD', ),
|
62 |
-
array( 'code' => 'HTG', 'name' => __( 'Haitian gourde' ), 'symbol' => 'HTG', ),
|
63 |
-
array( 'code' => 'HNL', 'name' => __( 'Honduran lempira' ), 'symbol' => 'HNL', ),
|
64 |
-
array( 'code' => 'HKD', 'name' => __( 'Hong Kong dollar' ), 'symbol' => '$', ),
|
65 |
-
array( 'code' => 'HUF', 'name' => __( 'Hungarian forint' ), 'symbol' => 'Ft', ),
|
66 |
-
array( 'code' => 'ISK', 'name' => __( 'Icelandic krona' ), 'symbol' => 'ISK', ),
|
67 |
-
array( 'code' => 'INR', 'name' => __( 'Indian rupee' ), 'symbol' => '₹', ),
|
68 |
-
array( 'code' => 'IDR', 'name' => __( 'Indonesian rupiah' ), 'symbol' => 'Rp', ),
|
69 |
-
array( 'code' => 'IRR', 'name' => __( 'Iranian rial' ), 'symbol' => 'IRR', ),
|
70 |
-
array( 'code' => 'IQD', 'name' => __( 'Iraqi dinar' ), 'symbol' => 'IQD', ),
|
71 |
-
array( 'code' => 'ILS', 'name' => __( 'Israeli new sheqel' ), 'symbol' => '₪', ),
|
72 |
-
array( 'code' => 'YER', 'name' => __( 'Yemeni rial' ), 'symbol' => 'YER', ),
|
73 |
-
array( 'code' => 'JMD', 'name' => __( 'Jamaican dollar' ), 'symbol' => 'JMD', ),
|
74 |
-
array( 'code' => 'JPY', 'name' => __( 'Japanese yen' ), 'symbol' => '¥', ),
|
75 |
-
array( 'code' => 'JOD', 'name' => __( 'Jordanian dinar' ), 'symbol' => 'JOD', ),
|
76 |
-
array( 'code' => 'KZT', 'name' => __( 'Kazakhstani tenge' ), 'symbol' => 'KZT', ),
|
77 |
-
array( 'code' => 'KES', 'name' => __( 'Kenyan shilling' ), 'symbol' => 'KES', ),
|
78 |
-
array( 'code' => 'KGS', 'name' => __( 'Kyrgyzstani som' ), 'symbol' => 'KGS', ),
|
79 |
-
array( 'code' => 'KWD', 'name' => __( 'Kuwaiti dinar' ), 'symbol' => 'KWD', ),
|
80 |
-
array( 'code' => 'LAK', 'name' => __( 'Lao kip' ), 'symbol' => 'LAK', ),
|
81 |
-
//array( 'code' => 'KIP', 'name' => __( 'Lao kip' ), 'symbol' => 'KIP', ),
|
82 |
-
array( 'code' => 'LVL', 'name' => __( 'Latvian lats' ), 'symbol' => 'LVL', ),
|
83 |
-
array( 'code' => 'LBP', 'name' => __( 'Lebanese lira' ), 'symbol' => 'LBP', ),
|
84 |
-
array( 'code' => 'LSL', 'name' => __( 'Lesotho loti' ), 'symbol' => 'LSL', ),
|
85 |
-
array( 'code' => 'LRD', 'name' => __( 'Liberian dollar' ), 'symbol' => 'LRD', ),
|
86 |
-
array( 'code' => 'LYD', 'name' => __( 'Libyan dinar' ), 'symbol' => 'LYD', ),
|
87 |
-
array( 'code' => 'LTL', 'name' => __( 'Lithuanian litas' ), 'symbol' => 'LTL', ),
|
88 |
-
array( 'code' => 'MOP', 'name' => __( 'Macanese pataca' ), 'symbol' => 'MOP', ),
|
89 |
-
array( 'code' => 'MKD', 'name' => __( 'Macedonian denar' ), 'symbol' => 'MKD', ),
|
90 |
-
array( 'code' => 'MGA', 'name' => __( 'Malagasy ariary' ), 'symbol' => 'MGA', ),
|
91 |
-
array( 'code' => 'MYR', 'name' => __( 'Malaysian ringgit' ), 'symbol' => 'RM', ),
|
92 |
-
array( 'code' => 'MWK', 'name' => __( 'Malawian kwacha' ), 'symbol' => 'MWK', ),
|
93 |
-
array( 'code' => 'MVR', 'name' => __( 'Maldivian rufiyaa' ), 'symbol' => 'MVR', ),
|
94 |
-
array( 'code' => 'MRO', 'name' => __( 'Mauritanian ouguiya' ), 'symbol' => 'MRO', ),
|
95 |
-
array( 'code' => 'MUR', 'name' => __( 'Mauritian rupee' ), 'symbol' => 'MUR', ),
|
96 |
-
array( 'code' => 'MXN', 'name' => __( 'Mexican peso' ), 'symbol' => '$', ),
|
97 |
-
array( 'code' => 'MMK', 'name' => __( 'Myanma kyat' ), 'symbol' => 'MMK', ),
|
98 |
-
array( 'code' => 'MDL', 'name' => __( 'Moldovan leu' ), 'symbol' => 'MDL', ),
|
99 |
-
array( 'code' => 'MNT', 'name' => __( 'Mongolian tugrik' ), 'symbol' => 'MNT', ),
|
100 |
-
array( 'code' => 'MAD', 'name' => __( 'Moroccan dirham' ), 'symbol' => 'MAD', ),
|
101 |
-
array( 'code' => 'MZM', 'name' => __( 'Mozambican metical' ), 'symbol' => 'MZM', ),
|
102 |
-
array( 'code' => 'NAD', 'name' => __( 'Namibian dollar' ), 'symbol' => 'NAD', ),
|
103 |
-
array( 'code' => 'NPR', 'name' => __( 'Nepalese rupee' ), 'symbol' => 'NPR', ),
|
104 |
-
array( 'code' => 'ANG', 'name' => __( 'Netherlands Antillean gulden' ), 'symbol' => 'ANG', ),
|
105 |
-
array( 'code' => 'TWD', 'name' => __( 'New Taiwan dollar' ), 'symbol' => 'NT$', ),
|
106 |
-
array( 'code' => 'NZD', 'name' => __( 'New Zealand dollar' ), 'symbol' => '$', ),
|
107 |
-
array( 'code' => 'NIO', 'name' => __( 'Nicaraguan cordoba' ), 'symbol' => 'NIO', ),
|
108 |
-
array( 'code' => 'NGN', 'name' => __( 'Nigerian naira' ), 'symbol' => 'NGN', ),
|
109 |
-
array( 'code' => 'KPW', 'name' => __( 'North Korean won' ), 'symbol' => 'KPW', ),
|
110 |
-
array( 'code' => 'NOK', 'name' => __( 'Norwegian krone' ), 'symbol' => 'kr', ),
|
111 |
-
array( 'code' => 'OMR', 'name' => __( 'Omani rial' ), 'symbol' => 'OMR', ),
|
112 |
-
array( 'code' => 'TOP', 'name' => __( 'Paanga' ), 'symbol' => 'TOP', ),
|
113 |
-
array( 'code' => 'PKR', 'name' => __( 'Pakistani rupee' ), 'symbol' => 'PKR', ),
|
114 |
-
array( 'code' => 'PAB', 'name' => __( 'Panamanian balboa' ), 'symbol' => 'PAB', ),
|
115 |
-
array( 'code' => 'PGK', 'name' => __( 'Papua New Guinean kina' ), 'symbol' => 'PGK', ),
|
116 |
-
array( 'code' => 'PYG', 'name' => __( 'Paraguayan guarani' ), 'symbol' => 'PYG', ),
|
117 |
-
array( 'code' => 'PEN', 'name' => __( 'Peruvian nuevo sol' ), 'symbol' => 'PEN', ),
|
118 |
-
array( 'code' => 'PHP', 'name' => __( 'Philippine peso' ), 'symbol' => '₱', ),
|
119 |
-
array( 'code' => 'PLN', 'name' => __( 'Polish zloty' ), 'symbol' => 'zł', ),
|
120 |
-
array( 'code' => 'QAR', 'name' => __( 'Qatari riyal' ), 'symbol' => 'QAR', ),
|
121 |
-
array( 'code' => 'RON', 'name' => __( 'Romanian leu' ), 'symbol' => 'lei', ),
|
122 |
-
array( 'code' => 'RUB', 'name' => __( 'Russian ruble' ), 'symbol' => 'RUB', ),
|
123 |
-
array( 'code' => 'RWF', 'name' => __( 'Rwandan franc' ), 'symbol' => 'RWF', ),
|
124 |
-
array( 'code' => 'SHP', 'name' => __( 'Saint Helena pound' ), 'symbol' => 'SHP', ),
|
125 |
-
array( 'code' => 'WST', 'name' => __( 'Samoan tala' ), 'symbol' => 'WST', ),
|
126 |
-
array( 'code' => 'STD', 'name' => __( 'Sao Tome and Principe dobra' ), 'symbol' => 'STD', ),
|
127 |
-
array( 'code' => 'SAR', 'name' => __( 'Saudi riyal' ), 'symbol' => 'SAR', ),
|
128 |
-
array( 'code' => 'SCR', 'name' => __( 'Seychellois rupee' ), 'symbol' => 'SCR', ),
|
129 |
-
array( 'code' => 'RSD', 'name' => __( 'Serbian dinar' ), 'symbol' => 'RSD', ),
|
130 |
-
array( 'code' => 'SLL', 'name' => __( 'Sierra Leonean leone' ), 'symbol' => 'SLL', ),
|
131 |
-
array( 'code' => 'SGD', 'name' => __( 'Singapore dollar' ), 'symbol' => '$', ),
|
132 |
-
array( 'code' => 'SYP', 'name' => __( 'Syrian pound' ), 'symbol' => 'SYP', ),
|
133 |
-
array( 'code' => 'SKK', 'name' => __( 'Slovak koruna' ), 'symbol' => 'SKK', ),
|
134 |
-
array( 'code' => 'SBD', 'name' => __( 'Solomon Islands dollar' ), 'symbol' => 'SBD', ),
|
135 |
-
array( 'code' => 'SOS', 'name' => __( 'Somali shilling' ), 'symbol' => 'SOS', ),
|
136 |
-
array( 'code' => 'ZAR', 'name' => __( 'South African rand' ), 'symbol' => 'R', ),
|
137 |
-
array( 'code' => 'KRW', 'name' => __( 'South Korean won' ), 'symbol' => '₩', ),
|
138 |
-
array( 'code' => 'XDR', 'name' => __( 'Special Drawing Rights' ), 'symbol' => 'XDR', ),
|
139 |
-
array( 'code' => 'LKR', 'name' => __( 'Sri Lankan rupee' ), 'symbol' => 'LKR', ),
|
140 |
-
array( 'code' => 'SDG', 'name' => __( 'Sudanese pound' ), 'symbol' => 'SDG', ),
|
141 |
-
array( 'code' => 'SRD', 'name' => __( 'Surinamese dollar' ), 'symbol' => 'SRD', ),
|
142 |
-
array( 'code' => 'SZL', 'name' => __( 'Swazi lilangeni' ), 'symbol' => 'SZL', ),
|
143 |
-
array( 'code' => 'SEK', 'name' => __( 'Swedish krona' ), 'symbol' => 'kr', ),
|
144 |
-
array( 'code' => 'CHF', 'name' => __( 'Swiss franc' ), 'symbol' => 'CHF', ),
|
145 |
-
array( 'code' => 'TJS', 'name' => __( 'Tajikistani somoni' ), 'symbol' => 'TJS', ),
|
146 |
-
array( 'code' => 'TZS', 'name' => __( 'Tanzanian shilling' ), 'symbol' => 'TZS', ),
|
147 |
-
array( 'code' => 'THB', 'name' => __( 'Thai baht' ), 'symbol' => '฿', ),
|
148 |
-
array( 'code' => 'TTD', 'name' => __( 'Trinidad and Tobago dollar' ), 'symbol' => 'TTD', ),
|
149 |
-
array( 'code' => 'TND', 'name' => __( 'Tunisian dinar' ), 'symbol' => 'TND', ),
|
150 |
-
array( 'code' => 'TRY', 'name' => __( 'Turkish new lira' ), 'symbol' => 'TL', ),
|
151 |
-
array( 'code' => 'TMM', 'name' => __( 'Turkmen manat' ), 'symbol' => 'TMM', ),
|
152 |
-
array( 'code' => 'AED', 'name' => __( 'UAE dirham' ), 'symbol' => 'AED', ),
|
153 |
-
array( 'code' => 'UGX', 'name' => __( 'Ugandan shilling' ), 'symbol' => 'UGX', ),
|
154 |
-
array( 'code' => 'UAH', 'name' => __( 'Ukrainian hryvnia' ), 'symbol' => 'UAH', ),
|
155 |
-
array( 'code' => 'USD', 'name' => __( 'United States dollar' ), 'symbol' => '$', ),
|
156 |
-
array( 'code' => 'UYU', 'name' => __( 'Uruguayan peso' ), 'symbol' => 'UYU', ),
|
157 |
-
array( 'code' => 'UZS', 'name' => __( 'Uzbekistani som' ), 'symbol' => 'UZS', ),
|
158 |
-
array( 'code' => 'VUV', 'name' => __( 'Vanuatu vatu' ), 'symbol' => 'VUV', ),
|
159 |
-
array( 'code' => 'VEF', 'name' => __( 'Venezuelan bolivar' ), 'symbol' => 'VEF', ),
|
160 |
-
array( 'code' => 'VND', 'name' => __( 'Vietnamese dong' ), 'symbol' => 'VND', ),
|
161 |
-
array( 'code' => 'XOF', 'name' => __( 'West African CFA franc' ), 'symbol' => 'XOF', ),
|
162 |
-
array( 'code' => 'ZMK', 'name' => __( 'Zambian kwacha' ), 'symbol' => 'ZMK', ),
|
163 |
-
array( 'code' => 'ZWD', 'name' => __( 'Zimbabwean dollar' ), 'symbol' => 'ZWD', ),
|
164 |
-
array( 'code' => 'RMB', 'name' => __( 'Chinese Yuan' ), 'symbol' => '¥', ),
|
165 |
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Functions
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Functions.
|
6 |
+
*
|
7 |
+
* @version 2.4.3
|
8 |
+
* @author Algoritmika Ltd.
|
9 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
return array(
|
12 |
+
array( 'code' => 'AFN', 'name' => __( 'Afghan afghani', 'woocommerce-jetpack' ), 'symbol' => 'AFN', ),
|
13 |
+
array( 'code' => 'ALL', 'name' => __( 'Albanian lek', 'woocommerce-jetpack' ), 'symbol' => 'ALL', ),
|
14 |
+
array( 'code' => 'DZD', 'name' => __( 'Algerian dinar', 'woocommerce-jetpack' ), 'symbol' => 'DZD', ),
|
15 |
+
array( 'code' => 'AOA', 'name' => __( 'Angolan kwanza', 'woocommerce-jetpack' ), 'symbol' => 'AOA', ),
|
16 |
+
array( 'code' => 'ARS', 'name' => __( 'Argentine peso', 'woocommerce-jetpack' ), 'symbol' => 'ARS', ),
|
17 |
+
array( 'code' => 'AMD', 'name' => __( 'Armenian dram', 'woocommerce-jetpack' ), 'symbol' => 'AMD', ),
|
18 |
+
array( 'code' => 'AWG', 'name' => __( 'Aruban florin', 'woocommerce-jetpack' ), 'symbol' => 'AWG', ),
|
19 |
+
array( 'code' => 'AUD', 'name' => __( 'Australian dollar', 'woocommerce-jetpack' ), 'symbol' => '$', ),
|
20 |
+
array( 'code' => 'AZN', 'name' => __( 'Azerbaijani manat', 'woocommerce-jetpack' ), 'symbol' => 'AZN', ),
|
21 |
+
array( 'code' => 'BSD', 'name' => __( 'Bahamian dollar', 'woocommerce-jetpack' ), 'symbol' => 'BSD', ),
|
22 |
+
array( 'code' => 'BHD', 'name' => __( 'Bahraini dinar', 'woocommerce-jetpack' ), 'symbol' => 'BHD', ),
|
23 |
+
array( 'code' => 'BDT', 'name' => __( 'Bangladeshi taka', 'woocommerce-jetpack' ), 'symbol' => 'BDT', ),
|
24 |
+
array( 'code' => 'BBD', 'name' => __( 'Barbadian dollar', 'woocommerce-jetpack' ), 'symbol' => 'BBD', ),
|
25 |
+
array( 'code' => 'BYR', 'name' => __( 'Belarusian ruble', 'woocommerce-jetpack' ), 'symbol' => 'BYR', ),
|
26 |
+
array( 'code' => 'BZD', 'name' => __( 'Belize dollar', 'woocommerce-jetpack' ), 'symbol' => 'BZD', ),
|
27 |
+
array( 'code' => 'BTN', 'name' => __( 'Bhutanese ngultrum', 'woocommerce-jetpack' ), 'symbol' => 'BTN', ),
|
28 |
+
array( 'code' => 'BOB', 'name' => __( 'Bolivian boliviano', 'woocommerce-jetpack' ), 'symbol' => 'BOB', ),
|
29 |
+
array( 'code' => 'BAM', 'name' => __( 'Bosnia and Herzegovina konvertibilna marka', 'woocommerce-jetpack' ), 'symbol' => 'BAM', ),
|
30 |
+
array( 'code' => 'BWP', 'name' => __( 'Botswana pula', 'woocommerce-jetpack' ), 'symbol' => 'BWP', ),
|
31 |
+
array( 'code' => 'BRL', 'name' => __( 'Brazilian real', 'woocommerce-jetpack' ), 'symbol' => 'R$', ),
|
32 |
+
array( 'code' => 'GBP', 'name' => __( 'British pound', 'woocommerce-jetpack' ), 'symbol' => '£', ),
|
33 |
+
array( 'code' => 'BND', 'name' => __( 'Brunei dollar', 'woocommerce-jetpack' ), 'symbol' => 'BND', ),
|
34 |
+
array( 'code' => 'BGN', 'name' => __( 'Bulgarian lev', 'woocommerce-jetpack' ), 'symbol' => 'BGN', ),
|
35 |
+
array( 'code' => 'BIF', 'name' => __( 'Burundi franc', 'woocommerce-jetpack' ), 'symbol' => 'BIF', ),
|
36 |
+
array( 'code' => 'KYD', 'name' => __( 'Cayman Islands dollar', 'woocommerce-jetpack' ), 'symbol' => 'KYD', ),
|
37 |
+
array( 'code' => 'KHR', 'name' => __( 'Cambodian riel', 'woocommerce-jetpack' ), 'symbol' => 'KHR', ),
|
38 |
+
array( 'code' => 'CAD', 'name' => __( 'Canadian dollar', 'woocommerce-jetpack' ), 'symbol' => 'CAD', ),
|
39 |
+
array( 'code' => 'CVE', 'name' => __( 'Cape Verdean escudo', 'woocommerce-jetpack' ), 'symbol' => 'CVE', ),
|
40 |
+
array( 'code' => 'XAF', 'name' => __( 'Central African CFA franc', 'woocommerce-jetpack' ), 'symbol' => 'XAF', ),
|
41 |
+
array( 'code' => 'GQE', 'name' => __( 'Central African CFA franc', 'woocommerce-jetpack' ), 'symbol' => 'GQE', ),
|
42 |
+
array( 'code' => 'XPF', 'name' => __( 'CFP franc', 'woocommerce-jetpack' ), 'symbol' => 'XPF', ),
|
43 |
+
array( 'code' => 'CLP', 'name' => __( 'Chilean peso', 'woocommerce-jetpack' ), 'symbol' => 'CLP', ),
|
44 |
+
array( 'code' => 'CNY', 'name' => __( 'Chinese renminbi', 'woocommerce-jetpack' ), 'symbol' => '¥', ),
|
45 |
+
array( 'code' => 'COP', 'name' => __( 'Colombian peso', 'woocommerce-jetpack' ), 'symbol' => 'COP', ),
|
46 |
+
array( 'code' => 'KMF', 'name' => __( 'Comorian franc', 'woocommerce-jetpack' ), 'symbol' => 'KMF', ),
|
47 |
+
array( 'code' => 'CDF', 'name' => __( 'Congolese franc', 'woocommerce-jetpack' ), 'symbol' => 'CDF', ),
|
48 |
+
array( 'code' => 'CRC', 'name' => __( 'Costa Rican colon', 'woocommerce-jetpack' ), 'symbol' => 'CRC', ),
|
49 |
+
array( 'code' => 'HRK', 'name' => __( 'Croatian kuna', 'woocommerce-jetpack' ), 'symbol' => 'HRK', ),
|
50 |
+
array( 'code' => 'CUC', 'name' => __( 'Cuban peso', 'woocommerce-jetpack' ), 'symbol' => 'CUC', ),
|
51 |
+
array( 'code' => 'CZK', 'name' => __( 'Czech koruna', 'woocommerce-jetpack' ), 'symbol' => 'Kč', ),
|
52 |
+
array( 'code' => 'DKK', 'name' => __( 'Danish krone', 'woocommerce-jetpack' ), 'symbol' => 'kr', ),
|
53 |
+
array( 'code' => 'DJF', 'name' => __( 'Djiboutian franc', 'woocommerce-jetpack' ), 'symbol' => 'DJF', ),
|
54 |
+
array( 'code' => 'DOP', 'name' => __( 'Dominican peso', 'woocommerce-jetpack' ), 'symbol' => 'DOP', ),
|
55 |
+
array( 'code' => 'XCD', 'name' => __( 'East Caribbean dollar', 'woocommerce-jetpack' ), 'symbol' => 'XCD', ),
|
56 |
+
array( 'code' => 'EGP', 'name' => __( 'Egyptian pound', 'woocommerce-jetpack' ), 'symbol' => 'EGP', ),
|
57 |
+
array( 'code' => 'ERN', 'name' => __( 'Eritrean nakfa', 'woocommerce-jetpack' ), 'symbol' => 'ERN', ),
|
58 |
+
array( 'code' => 'EEK', 'name' => __( 'Estonian kroon', 'woocommerce-jetpack' ), 'symbol' => 'EEK', ),
|
59 |
+
array( 'code' => 'ETB', 'name' => __( 'Ethiopian birr', 'woocommerce-jetpack' ), 'symbol' => 'ETB', ),
|
60 |
+
array( 'code' => 'EUR', 'name' => __( 'European euro', 'woocommerce-jetpack' ), 'symbol' => '€', ),
|
61 |
+
array( 'code' => 'FKP', 'name' => __( 'Falkland Islands pound', 'woocommerce-jetpack' ), 'symbol' => 'FKP', ),
|
62 |
+
array( 'code' => 'FJD', 'name' => __( 'Fijian dollar', 'woocommerce-jetpack' ), 'symbol' => 'FJD', ),
|
63 |
+
array( 'code' => 'GMD', 'name' => __( 'Gambian dalasi', 'woocommerce-jetpack' ), 'symbol' => 'GMD', ),
|
64 |
+
array( 'code' => 'GEL', 'name' => __( 'Georgian lari', 'woocommerce-jetpack' ), 'symbol' => 'GEL', ),
|
65 |
+
array( 'code' => 'GHS', 'name' => __( 'Ghanaian cedi', 'woocommerce-jetpack' ), 'symbol' => 'GHS', ),
|
66 |
+
array( 'code' => 'GIP', 'name' => __( 'Gibraltar pound', 'woocommerce-jetpack' ), 'symbol' => 'GIP', ),
|
67 |
+
array( 'code' => 'GTQ', 'name' => __( 'Guatemalan quetzal', 'woocommerce-jetpack' ), 'symbol' => 'GTQ', ),
|
68 |
+
array( 'code' => 'GNF', 'name' => __( 'Guinean franc', 'woocommerce-jetpack' ), 'symbol' => 'GNF', ),
|
69 |
+
array( 'code' => 'GYD', 'name' => __( 'Guyanese dollar', 'woocommerce-jetpack' ), 'symbol' => 'GYD', ),
|
70 |
+
array( 'code' => 'HTG', 'name' => __( 'Haitian gourde', 'woocommerce-jetpack' ), 'symbol' => 'HTG', ),
|
71 |
+
array( 'code' => 'HNL', 'name' => __( 'Honduran lempira', 'woocommerce-jetpack' ), 'symbol' => 'HNL', ),
|
72 |
+
array( 'code' => 'HKD', 'name' => __( 'Hong Kong dollar', 'woocommerce-jetpack' ), 'symbol' => '$', ),
|
73 |
+
array( 'code' => 'HUF', 'name' => __( 'Hungarian forint', 'woocommerce-jetpack' ), 'symbol' => 'Ft', ),
|
74 |
+
array( 'code' => 'ISK', 'name' => __( 'Icelandic krona', 'woocommerce-jetpack' ), 'symbol' => 'ISK', ),
|
75 |
+
array( 'code' => 'INR', 'name' => __( 'Indian rupee', 'woocommerce-jetpack' ), 'symbol' => '₹', ),
|
76 |
+
array( 'code' => 'IDR', 'name' => __( 'Indonesian rupiah', 'woocommerce-jetpack' ), 'symbol' => 'Rp', ),
|
77 |
+
array( 'code' => 'IRR', 'name' => __( 'Iranian rial', 'woocommerce-jetpack' ), 'symbol' => 'IRR', ),
|
78 |
+
array( 'code' => 'IQD', 'name' => __( 'Iraqi dinar', 'woocommerce-jetpack' ), 'symbol' => 'IQD', ),
|
79 |
+
array( 'code' => 'ILS', 'name' => __( 'Israeli new sheqel', 'woocommerce-jetpack' ), 'symbol' => '₪', ),
|
80 |
+
array( 'code' => 'YER', 'name' => __( 'Yemeni rial', 'woocommerce-jetpack' ), 'symbol' => 'YER', ),
|
81 |
+
array( 'code' => 'JMD', 'name' => __( 'Jamaican dollar', 'woocommerce-jetpack' ), 'symbol' => 'JMD', ),
|
82 |
+
array( 'code' => 'JPY', 'name' => __( 'Japanese yen', 'woocommerce-jetpack' ), 'symbol' => '¥', ),
|
83 |
+
array( 'code' => 'JOD', 'name' => __( 'Jordanian dinar', 'woocommerce-jetpack' ), 'symbol' => 'JOD', ),
|
84 |
+
array( 'code' => 'KZT', 'name' => __( 'Kazakhstani tenge', 'woocommerce-jetpack' ), 'symbol' => 'KZT', ),
|
85 |
+
array( 'code' => 'KES', 'name' => __( 'Kenyan shilling', 'woocommerce-jetpack' ), 'symbol' => 'KES', ),
|
86 |
+
array( 'code' => 'KGS', 'name' => __( 'Kyrgyzstani som', 'woocommerce-jetpack' ), 'symbol' => 'KGS', ),
|
87 |
+
array( 'code' => 'KWD', 'name' => __( 'Kuwaiti dinar', 'woocommerce-jetpack' ), 'symbol' => 'KWD', ),
|
88 |
+
array( 'code' => 'LAK', 'name' => __( 'Lao kip', 'woocommerce-jetpack' ), 'symbol' => 'LAK', ),
|
89 |
+
// array( 'code' => 'KIP', 'name' => __( 'Lao kip', 'woocommerce-jetpack' ), 'symbol' => 'KIP', ),
|
90 |
+
array( 'code' => 'LVL', 'name' => __( 'Latvian lats', 'woocommerce-jetpack' ), 'symbol' => 'LVL', ),
|
91 |
+
array( 'code' => 'LBP', 'name' => __( 'Lebanese lira', 'woocommerce-jetpack' ), 'symbol' => 'LBP', ),
|
92 |
+
array( 'code' => 'LSL', 'name' => __( 'Lesotho loti', 'woocommerce-jetpack' ), 'symbol' => 'LSL', ),
|
93 |
+
array( 'code' => 'LRD', 'name' => __( 'Liberian dollar', 'woocommerce-jetpack' ), 'symbol' => 'LRD', ),
|
94 |
+
array( 'code' => 'LYD', 'name' => __( 'Libyan dinar', 'woocommerce-jetpack' ), 'symbol' => 'LYD', ),
|
95 |
+
array( 'code' => 'LTL', 'name' => __( 'Lithuanian litas', 'woocommerce-jetpack' ), 'symbol' => 'LTL', ),
|
96 |
+
array( 'code' => 'MOP', 'name' => __( 'Macanese pataca', 'woocommerce-jetpack' ), 'symbol' => 'MOP', ),
|
97 |
+
array( 'code' => 'MKD', 'name' => __( 'Macedonian denar', 'woocommerce-jetpack' ), 'symbol' => 'MKD', ),
|
98 |
+
array( 'code' => 'MGA', 'name' => __( 'Malagasy ariary', 'woocommerce-jetpack' ), 'symbol' => 'MGA', ),
|
99 |
+
array( 'code' => 'MYR', 'name' => __( 'Malaysian ringgit', 'woocommerce-jetpack' ), 'symbol' => 'RM', ),
|
100 |
+
array( 'code' => 'MWK', 'name' => __( 'Malawian kwacha', 'woocommerce-jetpack' ), 'symbol' => 'MWK', ),
|
101 |
+
array( 'code' => 'MVR', 'name' => __( 'Maldivian rufiyaa', 'woocommerce-jetpack' ), 'symbol' => 'MVR', ),
|
102 |
+
array( 'code' => 'MRO', 'name' => __( 'Mauritanian ouguiya', 'woocommerce-jetpack' ), 'symbol' => 'MRO', ),
|
103 |
+
array( 'code' => 'MUR', 'name' => __( 'Mauritian rupee', 'woocommerce-jetpack' ), 'symbol' => 'MUR', ),
|
104 |
+
array( 'code' => 'MXN', 'name' => __( 'Mexican peso', 'woocommerce-jetpack' ), 'symbol' => '$', ),
|
105 |
+
array( 'code' => 'MMK', 'name' => __( 'Myanma kyat', 'woocommerce-jetpack' ), 'symbol' => 'MMK', ),
|
106 |
+
array( 'code' => 'MDL', 'name' => __( 'Moldovan leu', 'woocommerce-jetpack' ), 'symbol' => 'MDL', ),
|
107 |
+
array( 'code' => 'MNT', 'name' => __( 'Mongolian tugrik', 'woocommerce-jetpack' ), 'symbol' => 'MNT', ),
|
108 |
+
array( 'code' => 'MAD', 'name' => __( 'Moroccan dirham', 'woocommerce-jetpack' ), 'symbol' => 'MAD', ),
|
109 |
+
array( 'code' => 'MZM', 'name' => __( 'Mozambican metical', 'woocommerce-jetpack' ), 'symbol' => 'MZM', ),
|
110 |
+
array( 'code' => 'NAD', 'name' => __( 'Namibian dollar', 'woocommerce-jetpack' ), 'symbol' => 'NAD', ),
|
111 |
+
array( 'code' => 'NPR', 'name' => __( 'Nepalese rupee', 'woocommerce-jetpack' ), 'symbol' => 'NPR', ),
|
112 |
+
array( 'code' => 'ANG', 'name' => __( 'Netherlands Antillean gulden', 'woocommerce-jetpack' ), 'symbol' => 'ANG', ),
|
113 |
+
array( 'code' => 'TWD', 'name' => __( 'New Taiwan dollar', 'woocommerce-jetpack' ), 'symbol' => 'NT$', ),
|
114 |
+
array( 'code' => 'NZD', 'name' => __( 'New Zealand dollar', 'woocommerce-jetpack' ), 'symbol' => '$', ),
|
115 |
+
array( 'code' => 'NIO', 'name' => __( 'Nicaraguan cordoba', 'woocommerce-jetpack' ), 'symbol' => 'NIO', ),
|
116 |
+
array( 'code' => 'NGN', 'name' => __( 'Nigerian naira', 'woocommerce-jetpack' ), 'symbol' => 'NGN', ),
|
117 |
+
array( 'code' => 'KPW', 'name' => __( 'North Korean won', 'woocommerce-jetpack' ), 'symbol' => 'KPW', ),
|
118 |
+
array( 'code' => 'NOK', 'name' => __( 'Norwegian krone', 'woocommerce-jetpack' ), 'symbol' => 'kr', ),
|
119 |
+
array( 'code' => 'OMR', 'name' => __( 'Omani rial', 'woocommerce-jetpack' ), 'symbol' => 'OMR', ),
|
120 |
+
array( 'code' => 'TOP', 'name' => __( 'Paanga', 'woocommerce-jetpack' ), 'symbol' => 'TOP', ),
|
121 |
+
array( 'code' => 'PKR', 'name' => __( 'Pakistani rupee', 'woocommerce-jetpack' ), 'symbol' => 'PKR', ),
|
122 |
+
array( 'code' => 'PAB', 'name' => __( 'Panamanian balboa', 'woocommerce-jetpack' ), 'symbol' => 'PAB', ),
|
123 |
+
array( 'code' => 'PGK', 'name' => __( 'Papua New Guinean kina', 'woocommerce-jetpack' ), 'symbol' => 'PGK', ),
|
124 |
+
array( 'code' => 'PYG', 'name' => __( 'Paraguayan guarani', 'woocommerce-jetpack' ), 'symbol' => 'PYG', ),
|
125 |
+
array( 'code' => 'PEN', 'name' => __( 'Peruvian nuevo sol', 'woocommerce-jetpack' ), 'symbol' => 'PEN', ),
|
126 |
+
array( 'code' => 'PHP', 'name' => __( 'Philippine peso', 'woocommerce-jetpack' ), 'symbol' => '₱', ),
|
127 |
+
array( 'code' => 'PLN', 'name' => __( 'Polish zloty', 'woocommerce-jetpack' ), 'symbol' => 'zł', ),
|
128 |
+
array( 'code' => 'QAR', 'name' => __( 'Qatari riyal', 'woocommerce-jetpack' ), 'symbol' => 'QAR', ),
|
129 |
+
array( 'code' => 'RON', 'name' => __( 'Romanian leu', 'woocommerce-jetpack' ), 'symbol' => 'lei', ),
|
130 |
+
array( 'code' => 'RUB', 'name' => __( 'Russian ruble', 'woocommerce-jetpack' ), 'symbol' => 'RUB', ),
|
131 |
+
array( 'code' => 'RWF', 'name' => __( 'Rwandan franc', 'woocommerce-jetpack' ), 'symbol' => 'RWF', ),
|
132 |
+
array( 'code' => 'SHP', 'name' => __( 'Saint Helena pound', 'woocommerce-jetpack' ), 'symbol' => 'SHP', ),
|
133 |
+
array( 'code' => 'WST', 'name' => __( 'Samoan tala', 'woocommerce-jetpack' ), 'symbol' => 'WST', ),
|
134 |
+
array( 'code' => 'STD', 'name' => __( 'Sao Tome and Principe dobra', 'woocommerce-jetpack' ), 'symbol' => 'STD', ),
|
135 |
+
array( 'code' => 'SAR', 'name' => __( 'Saudi riyal', 'woocommerce-jetpack' ), 'symbol' => 'SAR', ),
|
136 |
+
array( 'code' => 'SCR', 'name' => __( 'Seychellois rupee', 'woocommerce-jetpack' ), 'symbol' => 'SCR', ),
|
137 |
+
array( 'code' => 'RSD', 'name' => __( 'Serbian dinar', 'woocommerce-jetpack' ), 'symbol' => 'RSD', ),
|
138 |
+
array( 'code' => 'SLL', 'name' => __( 'Sierra Leonean leone', 'woocommerce-jetpack' ), 'symbol' => 'SLL', ),
|
139 |
+
array( 'code' => 'SGD', 'name' => __( 'Singapore dollar', 'woocommerce-jetpack' ), 'symbol' => '$', ),
|
140 |
+
array( 'code' => 'SYP', 'name' => __( 'Syrian pound', 'woocommerce-jetpack' ), 'symbol' => 'SYP', ),
|
141 |
+
array( 'code' => 'SKK', 'name' => __( 'Slovak koruna', 'woocommerce-jetpack' ), 'symbol' => 'SKK', ),
|
142 |
+
array( 'code' => 'SBD', 'name' => __( 'Solomon Islands dollar', 'woocommerce-jetpack' ), 'symbol' => 'SBD', ),
|
143 |
+
array( 'code' => 'SOS', 'name' => __( 'Somali shilling', 'woocommerce-jetpack' ), 'symbol' => 'SOS', ),
|
144 |
+
array( 'code' => 'ZAR', 'name' => __( 'South African rand', 'woocommerce-jetpack' ), 'symbol' => 'R', ),
|
145 |
+
array( 'code' => 'KRW', 'name' => __( 'South Korean won', 'woocommerce-jetpack' ), 'symbol' => '₩', ),
|
146 |
+
array( 'code' => 'XDR', 'name' => __( 'Special Drawing Rights', 'woocommerce-jetpack' ), 'symbol' => 'XDR', ),
|
147 |
+
array( 'code' => 'LKR', 'name' => __( 'Sri Lankan rupee', 'woocommerce-jetpack' ), 'symbol' => 'LKR', ),
|
148 |
+
array( 'code' => 'SDG', 'name' => __( 'Sudanese pound', 'woocommerce-jetpack' ), 'symbol' => 'SDG', ),
|
149 |
+
array( 'code' => 'SRD', 'name' => __( 'Surinamese dollar', 'woocommerce-jetpack' ), 'symbol' => 'SRD', ),
|
150 |
+
array( 'code' => 'SZL', 'name' => __( 'Swazi lilangeni', 'woocommerce-jetpack' ), 'symbol' => 'SZL', ),
|
151 |
+
array( 'code' => 'SEK', 'name' => __( 'Swedish krona', 'woocommerce-jetpack' ), 'symbol' => 'kr', ),
|
152 |
+
array( 'code' => 'CHF', 'name' => __( 'Swiss franc', 'woocommerce-jetpack' ), 'symbol' => 'CHF', ),
|
153 |
+
array( 'code' => 'TJS', 'name' => __( 'Tajikistani somoni', 'woocommerce-jetpack' ), 'symbol' => 'TJS', ),
|
154 |
+
array( 'code' => 'TZS', 'name' => __( 'Tanzanian shilling', 'woocommerce-jetpack' ), 'symbol' => 'TZS', ),
|
155 |
+
array( 'code' => 'THB', 'name' => __( 'Thai baht', 'woocommerce-jetpack' ), 'symbol' => '฿', ),
|
156 |
+
array( 'code' => 'TTD', 'name' => __( 'Trinidad and Tobago dollar', 'woocommerce-jetpack' ), 'symbol' => 'TTD', ),
|
157 |
+
array( 'code' => 'TND', 'name' => __( 'Tunisian dinar', 'woocommerce-jetpack' ), 'symbol' => 'TND', ),
|
158 |
+
array( 'code' => 'TRY', 'name' => __( 'Turkish new lira', 'woocommerce-jetpack' ), 'symbol' => 'TL', ),
|
159 |
+
array( 'code' => 'TMM', 'name' => __( 'Turkmen manat', 'woocommerce-jetpack' ), 'symbol' => 'TMM', ),
|
160 |
+
array( 'code' => 'AED', 'name' => __( 'UAE dirham', 'woocommerce-jetpack' ), 'symbol' => 'AED', ),
|
161 |
+
array( 'code' => 'UGX', 'name' => __( 'Ugandan shilling', 'woocommerce-jetpack' ), 'symbol' => 'UGX', ),
|
162 |
+
array( 'code' => 'UAH', 'name' => __( 'Ukrainian hryvnia', 'woocommerce-jetpack' ), 'symbol' => 'UAH', ),
|
163 |
+
array( 'code' => 'USD', 'name' => __( 'United States dollar', 'woocommerce-jetpack' ), 'symbol' => '$', ),
|
164 |
+
array( 'code' => 'UYU', 'name' => __( 'Uruguayan peso', 'woocommerce-jetpack' ), 'symbol' => 'UYU', ),
|
165 |
+
array( 'code' => 'UZS', 'name' => __( 'Uzbekistani som', 'woocommerce-jetpack' ), 'symbol' => 'UZS', ),
|
166 |
+
array( 'code' => 'VUV', 'name' => __( 'Vanuatu vatu', 'woocommerce-jetpack' ), 'symbol' => 'VUV', ),
|
167 |
+
array( 'code' => 'VEF', 'name' => __( 'Venezuelan bolivar', 'woocommerce-jetpack' ), 'symbol' => 'VEF', ),
|
168 |
+
array( 'code' => 'VND', 'name' => __( 'Vietnamese dong', 'woocommerce-jetpack' ), 'symbol' => 'VND', ),
|
169 |
+
array( 'code' => 'XOF', 'name' => __( 'West African CFA franc', 'woocommerce-jetpack' ), 'symbol' => 'XOF', ),
|
170 |
+
array( 'code' => 'ZMK', 'name' => __( 'Zambian kwacha', 'woocommerce-jetpack' ), 'symbol' => 'ZMK', ),
|
171 |
+
array( 'code' => 'ZWD', 'name' => __( 'Zimbabwean dollar', 'woocommerce-jetpack' ), 'symbol' => 'ZWD', ),
|
172 |
+
array( 'code' => 'RMB', 'name' => __( 'Chinese Yuan', 'woocommerce-jetpack' ), 'symbol' => '¥', ),
|
173 |
+
);
|
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.3
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -110,7 +110,7 @@ class WCJ_Exchange_Rates_Crons {
|
|
110 |
/**
|
111 |
* On the scheduled action hook, run a function.
|
112 |
*
|
113 |
-
* @version 2.3
|
114 |
*/
|
115 |
function update_the_exchange_rates( $interval ) {
|
116 |
|
@@ -124,6 +124,14 @@ class WCJ_Exchange_Rates_Crons {
|
|
124 |
}
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
// Currency Pairs - Preparation - Gateway Currency
|
128 |
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
|
129 |
global $woocommerce;
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates Crons class.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
110 |
/**
|
111 |
* On the scheduled action hook, run a function.
|
112 |
*
|
113 |
+
* @version 2.4.3
|
114 |
*/
|
115 |
function update_the_exchange_rates( $interval ) {
|
116 |
|
124 |
}
|
125 |
}
|
126 |
|
127 |
+
// Currency Pairs - Preparation - Multicurrency
|
128 |
+
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_multicurrency_exchange_rate_update_auto', 'manual' ) ) ) {
|
129 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_total_number', 1 ) ); $i++ ) {
|
130 |
+
$currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
|
131 |
+
$currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_exchange_rate_' . $i );
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
// Currency Pairs - Preparation - Gateway Currency
|
136 |
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
|
137 |
global $woocommerce;
|
includes/exchange-rates/class-wcj-exchange-rates.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates class.
|
6 |
*
|
7 |
-
* @version 2.3
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -28,10 +28,18 @@ class WCJ_Exchange_Rates {
|
|
28 |
/**
|
29 |
* register_script.
|
30 |
*
|
31 |
-
* @version 2.3
|
32 |
*/
|
33 |
public function register_script() {
|
34 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
wp_register_script( 'wcj-exchange-rates', trailingslashit( WCJ()->plugin_url() ) . 'includes/js/exchange_rates.js', array( 'jquery' ), false, true );
|
36 |
}
|
37 |
}
|
@@ -39,10 +47,18 @@ class WCJ_Exchange_Rates {
|
|
39 |
/**
|
40 |
* enqueue_exchange_rates_script.
|
41 |
*
|
42 |
-
* @version 2.3
|
43 |
*/
|
44 |
public function enqueue_exchange_rates_script() {
|
45 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
wp_enqueue_script( 'wcj-exchange-rates' );
|
47 |
}
|
48 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates class.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
28 |
/**
|
29 |
* register_script.
|
30 |
*
|
31 |
+
* @version 2.4.3
|
32 |
*/
|
33 |
public function register_script() {
|
34 |
+
if (
|
35 |
+
isset( $_GET['section'] ) &&
|
36 |
+
in_array( $_GET['section'], array(
|
37 |
+
'multicurrency',
|
38 |
+
'price_by_country',
|
39 |
+
'payment_gateways_currency',
|
40 |
+
'currency_exchange_rates',
|
41 |
+
) )
|
42 |
+
) {
|
43 |
wp_register_script( 'wcj-exchange-rates', trailingslashit( WCJ()->plugin_url() ) . 'includes/js/exchange_rates.js', array( 'jquery' ), false, true );
|
44 |
}
|
45 |
}
|
47 |
/**
|
48 |
* enqueue_exchange_rates_script.
|
49 |
*
|
50 |
+
* @version 2.4.3
|
51 |
*/
|
52 |
public function enqueue_exchange_rates_script() {
|
53 |
+
if (
|
54 |
+
isset( $_GET['section'] ) &&
|
55 |
+
in_array( $_GET['section'], array(
|
56 |
+
'multicurrency',
|
57 |
+
'price_by_country',
|
58 |
+
'payment_gateways_currency',
|
59 |
+
'currency_exchange_rates',
|
60 |
+
) )
|
61 |
+
) {
|
62 |
wp_enqueue_script( 'wcj-exchange-rates' );
|
63 |
}
|
64 |
}
|
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 |
|
@@ -40,7 +40,7 @@ class WCJ_Price_by_Country_Core {
|
|
40 |
}
|
41 |
}
|
42 |
|
43 |
-
//if ( ) { //
|
44 |
|
45 |
// Price hooks
|
46 |
// add_filter( 'woocommerce_variation_prices', array( $this, 'change_price_by_country_variations' ), PHP_INT_MAX - 1, 2 );
|
@@ -60,10 +60,11 @@ class WCJ_Price_by_Country_Core {
|
|
60 |
// Shipping
|
61 |
add_filter( 'woocommerce_package_rates', array( $this, 'change_shipping_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
62 |
|
63 |
-
//
|
64 |
add_filter( 'woocommerce_variation_prices_price', array( $this, 'change_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
65 |
add_filter( 'woocommerce_variation_prices_regular_price', array( $this, 'change_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
66 |
add_filter( 'woocommerce_variation_prices_sale_price', array( $this, 'change_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
|
|
67 |
//}
|
68 |
|
69 |
// Country selection box
|
@@ -72,21 +73,9 @@ class WCJ_Price_by_Country_Core {
|
|
72 |
} */
|
73 |
|
74 |
// Debug
|
75 |
-
// add_shortcode( 'wcj_debug_price_by_country',
|
76 |
}
|
77 |
|
78 |
-
/**
|
79 |
-
* get_variation_prices_hash.
|
80 |
-
*
|
81 |
-
* @version 2.4.0
|
82 |
-
* @since 2.4.0
|
83 |
-
*/
|
84 |
-
/* function get_variation_prices_hash( $price_hash, $_product, $display ) {
|
85 |
-
if ( ! empty( $price_hash ) ) wcj_log( $price_hash );
|
86 |
-
//$price_hash = array( false );
|
87 |
-
return $price_hash;
|
88 |
-
} */
|
89 |
-
|
90 |
/**
|
91 |
* add_country_selection_box.
|
92 |
*
|
@@ -301,7 +290,7 @@ class WCJ_Price_by_Country_Core {
|
|
301 |
* @version 2.3.0
|
302 |
* @since 2.3.0
|
303 |
*/
|
304 |
-
public function change_price_by_country_variations( $prices_array, $product ) {
|
305 |
$modified_prices_array = $prices_array;
|
306 |
foreach ( $prices_array as $price_type => $prices ) {
|
307 |
foreach ( $prices as $variation_id => $price ) {
|
@@ -309,12 +298,23 @@ class WCJ_Price_by_Country_Core {
|
|
309 |
}
|
310 |
}
|
311 |
return $modified_prices_array;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
}
|
313 |
|
314 |
/**
|
315 |
* change_price_by_country.
|
316 |
*
|
317 |
-
* @version 2.3
|
318 |
*/
|
319 |
public function change_price_by_country( $price, $product ) {
|
320 |
|
@@ -336,7 +336,7 @@ class WCJ_Price_by_Country_Core {
|
|
336 |
}
|
337 |
|
338 |
$price_by_country = '';
|
339 |
-
if ( 'woocommerce_get_price' == current_filter() ) {
|
340 |
|
341 |
$regular_or_sale = '_regular_price_';
|
342 |
$meta_id = '_' . 'wcj_' . $meta_box_id . $regular_or_sale . $scope . '_' . $group_id;
|
@@ -352,8 +352,15 @@ class WCJ_Price_by_Country_Core {
|
|
352 |
$price_by_country = $regular_price;
|
353 |
|
354 |
}
|
355 |
-
elseif (
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
$meta_id = '_' . 'wcj_' . $meta_box_id . $regular_or_sale . $scope . '_' . $group_id;
|
358 |
$price_by_country = get_post_meta( $the_product_id, $meta_id, true );
|
359 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country Core class.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
//if ( ) { // TODO
|
44 |
|
45 |
// Price hooks
|
46 |
// add_filter( 'woocommerce_variation_prices', array( $this, 'change_price_by_country_variations' ), PHP_INT_MAX - 1, 2 );
|
60 |
// Shipping
|
61 |
add_filter( 'woocommerce_package_rates', array( $this, 'change_shipping_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
62 |
|
63 |
+
// Variable products
|
64 |
add_filter( 'woocommerce_variation_prices_price', array( $this, 'change_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
65 |
add_filter( 'woocommerce_variation_prices_regular_price', array( $this, 'change_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
66 |
add_filter( 'woocommerce_variation_prices_sale_price', array( $this, 'change_price_by_country' ), PHP_INT_MAX - 1, 2 );
|
67 |
+
add_filter( 'woocommerce_get_variation_prices_hash', array( $this, 'get_variation_prices_hash' ), PHP_INT_MAX - 1, 3 );
|
68 |
//}
|
69 |
|
70 |
// Country selection box
|
73 |
} */
|
74 |
|
75 |
// Debug
|
76 |
+
// add_shortcode( 'wcj_debug_price_by_country', array( $this, 'get_debug_info' ) );
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
/**
|
80 |
* add_country_selection_box.
|
81 |
*
|
290 |
* @version 2.3.0
|
291 |
* @since 2.3.0
|
292 |
*/
|
293 |
+
/* public function change_price_by_country_variations( $prices_array, $product ) {
|
294 |
$modified_prices_array = $prices_array;
|
295 |
foreach ( $prices_array as $price_type => $prices ) {
|
296 |
foreach ( $prices as $variation_id => $price ) {
|
298 |
}
|
299 |
}
|
300 |
return $modified_prices_array;
|
301 |
+
} */
|
302 |
+
|
303 |
+
/**
|
304 |
+
* get_variation_prices_hash.
|
305 |
+
*
|
306 |
+
* @version 2.4.3
|
307 |
+
* @since 2.4.3
|
308 |
+
*/
|
309 |
+
function get_variation_prices_hash( $price_hash, $_product, $display ) {
|
310 |
+
$price_hash['wcj_country_group_id'] = $this->get_customer_country_group_id();
|
311 |
+
return $price_hash;
|
312 |
}
|
313 |
|
314 |
/**
|
315 |
* change_price_by_country.
|
316 |
*
|
317 |
+
* @version 2.4.3
|
318 |
*/
|
319 |
public function change_price_by_country( $price, $product ) {
|
320 |
|
336 |
}
|
337 |
|
338 |
$price_by_country = '';
|
339 |
+
if ( 'woocommerce_get_price' == current_filter() || 'woocommerce_variation_prices_price' == current_filter() ) {
|
340 |
|
341 |
$regular_or_sale = '_regular_price_';
|
342 |
$meta_id = '_' . 'wcj_' . $meta_box_id . $regular_or_sale . $scope . '_' . $group_id;
|
352 |
$price_by_country = $regular_price;
|
353 |
|
354 |
}
|
355 |
+
elseif (
|
356 |
+
'woocommerce_get_regular_price' == current_filter() ||
|
357 |
+
'woocommerce_get_sale_price' == current_filter() ||
|
358 |
+
'woocommerce_variation_prices_regular_price' == current_filter() ||
|
359 |
+
'woocommerce_variation_prices_sale_price' == current_filter()
|
360 |
+
) {
|
361 |
+
$regular_or_sale = (
|
362 |
+
'woocommerce_get_regular_price' == current_filter() || 'woocommerce_variation_prices_regular_price' == current_filter()
|
363 |
+
) ? '_regular_price_' : '_sale_price_';
|
364 |
$meta_id = '_' . 'wcj_' . $meta_box_id . $regular_or_sale . $scope . '_' . $group_id;
|
365 |
$price_by_country = get_post_meta( $the_product_id, $meta_id, true );
|
366 |
}
|
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,17 +17,18 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.3
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->the_shortcodes = array(
|
25 |
'wcj_current_date',
|
26 |
-
|
27 |
'wcj_cart_items_total_weight',
|
28 |
'wcj_wpml',
|
29 |
'wcj_wpml_translate',
|
30 |
'wcj_country_select_drop_down_list',
|
|
|
31 |
'wcj_text',
|
32 |
'wcj_tcpdf_pagebreak',
|
33 |
);
|
@@ -39,10 +40,11 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
39 |
'width' => '',
|
40 |
'height' => '',*/
|
41 |
'lang' => '',
|
42 |
-
'form_method' => 'get',
|
43 |
'class' => '',
|
44 |
'style' => '',
|
45 |
'countries' => '',
|
|
|
46 |
);
|
47 |
|
48 |
parent::__construct();
|
@@ -59,6 +61,49 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
59 |
return '<tcpdf method="AddPage" />';
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/**
|
63 |
* wcj_country_select_drop_down_list.
|
64 |
*
|
4 |
*
|
5 |
* The WooCommerce Jetpack General Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.3
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.3
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->the_shortcodes = array(
|
25 |
'wcj_current_date',
|
26 |
+
// 'wcj_image',
|
27 |
'wcj_cart_items_total_weight',
|
28 |
'wcj_wpml',
|
29 |
'wcj_wpml_translate',
|
30 |
'wcj_country_select_drop_down_list',
|
31 |
+
'wcj_currency_select_drop_down_list',
|
32 |
'wcj_text',
|
33 |
'wcj_tcpdf_pagebreak',
|
34 |
);
|
40 |
'width' => '',
|
41 |
'height' => '',*/
|
42 |
'lang' => '',
|
43 |
+
'form_method' => 'post',//'get',
|
44 |
'class' => '',
|
45 |
'style' => '',
|
46 |
'countries' => '',
|
47 |
+
'currencies' => '',
|
48 |
);
|
49 |
|
50 |
parent::__construct();
|
61 |
return '<tcpdf method="AddPage" />';
|
62 |
}
|
63 |
|
64 |
+
/**
|
65 |
+
* wcj_currency_select_drop_down_list.
|
66 |
+
*
|
67 |
+
* @version 2.4.3
|
68 |
+
* @since 2.4.3
|
69 |
+
*/
|
70 |
+
function wcj_currency_select_drop_down_list( $atts, $content ) {
|
71 |
+
// Start
|
72 |
+
$html = '';
|
73 |
+
$form_method = $atts['form_method'];
|
74 |
+
$select_class = $atts['class'];
|
75 |
+
$select_style = $atts['style'];
|
76 |
+
$html .= '<form action="" method="' . $form_method . '">';
|
77 |
+
$html .= '<select name="wcj-currency" id="wcj-currency" style="' . $select_style . '" class="' . $select_class . '" onchange="this.form.submit()">';
|
78 |
+
// Shortcode currencies
|
79 |
+
$shortcode_currencies = $atts['currencies'];
|
80 |
+
if ( '' == $shortcode_currencies ) {
|
81 |
+
$shortcode_currencies = array();
|
82 |
+
} else {
|
83 |
+
$shortcode_currencies = str_replace( ' ', '', $shortcode_currencies );
|
84 |
+
$shortcode_currencies = trim( $shortcode_currencies, ',' );
|
85 |
+
$shortcode_currencies = explode( ',', $shortcode_currencies );
|
86 |
+
}
|
87 |
+
if ( empty( $shortcode_currencies ) ) {
|
88 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
|
89 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
90 |
+
$shortcode_currencies[] = get_option( 'wcj_multicurrency_currency_' . $i );
|
91 |
+
}
|
92 |
+
}
|
93 |
+
// Options
|
94 |
+
$currencies = wcj_get_currencies_names_and_symbols();
|
95 |
+
$selected_currency = ( isset( $_SESSION['wcj-currency'] ) ) ? $_SESSION['wcj-currency'] : '';
|
96 |
+
foreach ( $shortcode_currencies as $currency_code ) {
|
97 |
+
if ( isset( $currencies[ $currency_code ] ) ) {
|
98 |
+
$html .= '<option value="' . $currency_code . '" ' . selected( $currency_code, $selected_currency, false ) . '>' . $currencies[ $currency_code ] . '</option>';
|
99 |
+
}
|
100 |
+
}
|
101 |
+
// End
|
102 |
+
$html .= '</select>';
|
103 |
+
$html .= '</form>';
|
104 |
+
return $html;
|
105 |
+
}
|
106 |
+
|
107 |
/**
|
108 |
* wcj_country_select_drop_down_list.
|
109 |
*
|
includes/widgets/class-wcj-widget-multicurrency.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Multicurrency Widget
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Multicurrency Widget class.
|
6 |
+
*
|
7 |
+
* @version 2.4.3
|
8 |
+
* @since 2.4.3
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WCJ_Widget_Multicurrency' ) ) :
|
15 |
+
|
16 |
+
class WCJ_Widget_Multicurrency 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_multicurrency',
|
24 |
+
'description' => __( 'Booster: Multicurrency Switcher Widget', 'woocommerce-jetpack' ),
|
25 |
+
);
|
26 |
+
parent::__construct( 'wcj_widget_multicurrency', __( 'Booster - Multicurrency Switcher', '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 do_shortcode( '[wcj_currency_select_drop_down_list]' );
|
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'] : __( 'Currency Switcher', 'woocommerce-jetpack' );
|
53 |
+
?>
|
54 |
+
<p>
|
55 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
56 |
+
<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 ); ?>">
|
57 |
+
</p>
|
58 |
+
<?php
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Processing widget options on save
|
63 |
+
*
|
64 |
+
* @param array $new_instance The new options
|
65 |
+
* @param array $old_instance The previous options
|
66 |
+
*/
|
67 |
+
public function update( $new_instance, $old_instance ) {
|
68 |
+
// processes widget options to be saved
|
69 |
+
$instance = array();
|
70 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
71 |
+
return $instance;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
endif;
|
76 |
+
|
77 |
+
// register WCJ_Widget_Multicurrency widget
|
78 |
+
if ( ! function_exists( 'register_wcj_widget_multicurrency' ) ) {
|
79 |
+
function register_wcj_widget_multicurrency() {
|
80 |
+
register_widget( 'WCJ_Widget_Multicurrency' );
|
81 |
+
}
|
82 |
+
}
|
83 |
+
add_action( 'widgets_init', 'register_wcj_widget_multicurrency' );
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Booster for WooCommerce ===
|
2 |
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
|
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 |
|
@@ -22,6 +22,7 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
|
|
22 |
* *Currency Exchange Rates* - Automatic currency exchange rates for WooCommerce.
|
23 |
* *Currency for External Products* - Set different currency for external WooCommerce products.
|
24 |
* *Prices and Currencies by Country* - Change WooCommerce product price and currency automatically by customer's country.
|
|
|
25 |
* *Wholesale Price* - Set WooCommerce wholesale pricing depending on product quantity in cart (buy more pay less).
|
26 |
|
27 |
**Button & Price Labels**
|
@@ -118,6 +119,14 @@ To unlock all Booster for WooCommerce features, please install additional [Boost
|
|
118 |
|
119 |
== Changelog ==
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
= 2.4.2 - 04/03/2016 =
|
122 |
* Dev - CART & CHECKOUT - Mini Cart - Code refactoring.
|
123 |
* Dev - PAYMENT GATEWAYS - Gateways Currency - Code refactoring.
|
1 |
=== Booster for WooCommerce ===
|
2 |
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.3
|
7 |
License: GNU General Public License v3.0
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
22 |
* *Currency Exchange Rates* - Automatic currency exchange rates for WooCommerce.
|
23 |
* *Currency for External Products* - Set different currency for external WooCommerce products.
|
24 |
* *Prices and Currencies by Country* - Change WooCommerce product price and currency automatically by customer's country.
|
25 |
+
* *Multicurrency* - Add multiple currencies (currency switcher) to WooCommerce.
|
26 |
* *Wholesale Price* - Set WooCommerce wholesale pricing depending on product quantity in cart (buy more pay less).
|
27 |
|
28 |
**Button & Price Labels**
|
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.
|
125 |
+
* Dev - `WCJ_Module` class code refactoring.
|
126 |
+
* Fix - PRICES & CURRENCIES - Price by Country - Price range for variable products bug fixed.
|
127 |
+
* Fix - PRICES & CURRENCIES - Price by Country - Price per product for variable products bug fixed.
|
128 |
+
* Dev - PRICES & CURRENCIES - Multicurrency - Initial module release.
|
129 |
+
|
130 |
= 2.4.2 - 04/03/2016 =
|
131 |
* Dev - CART & CHECKOUT - Mini Cart - Code refactoring.
|
132 |
* Dev - PAYMENT GATEWAYS - Gateways Currency - Code refactoring.
|
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 {
|
@@ -329,6 +329,9 @@ final class WC_Jetpack {
|
|
329 |
|
330 |
/**
|
331 |
* Include required core files used in admin and on the frontend.
|
|
|
|
|
|
|
332 |
*/
|
333 |
private function includes() {
|
334 |
|
@@ -347,6 +350,9 @@ final class WC_Jetpack {
|
|
347 |
// Shortcodes
|
348 |
$this->include_shortcodes();
|
349 |
|
|
|
|
|
|
|
350 |
// Abstracts
|
351 |
//include_once( 'includes/abstracts/class-wcj-product-input-fields.php' );
|
352 |
|
@@ -385,7 +391,7 @@ final class WC_Jetpack {
|
|
385 |
/**
|
386 |
* Include modules and submodules
|
387 |
*
|
388 |
-
* @version 2.4.
|
389 |
*/
|
390 |
private function include_modules() {
|
391 |
$settings = array();
|
@@ -430,6 +436,7 @@ final class WC_Jetpack {
|
|
430 |
$settings[] = include_once( 'includes/class-wcj-pdf-invoicing.php' );
|
431 |
$settings[] = include_once( 'includes/class-wcj-emails.php' );
|
432 |
$settings[] = include_once( 'includes/class-wcj-currencies.php' );
|
|
|
433 |
$settings[] = include_once( 'includes/class-wcj-currency-external-products.php' );
|
434 |
$settings[] = include_once( 'includes/class-wcj-price-by-country.php' );
|
435 |
$settings[] = include_once( 'includes/class-wcj-currency-exchange-rates.php' );
|
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.3
|
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.3
|
25 |
*/
|
26 |
|
27 |
final class WC_Jetpack {
|
329 |
|
330 |
/**
|
331 |
* Include required core files used in admin and on the frontend.
|
332 |
+
*
|
333 |
+
* @version 2.4.3
|
334 |
+
* @since 2.4.3
|
335 |
*/
|
336 |
private function includes() {
|
337 |
|
350 |
// Shortcodes
|
351 |
$this->include_shortcodes();
|
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' );
|
358 |
|
391 |
/**
|
392 |
* Include modules and submodules
|
393 |
*
|
394 |
+
* @version 2.4.3
|
395 |
*/
|
396 |
private function include_modules() {
|
397 |
$settings = array();
|
436 |
$settings[] = include_once( 'includes/class-wcj-pdf-invoicing.php' );
|
437 |
$settings[] = include_once( 'includes/class-wcj-emails.php' );
|
438 |
$settings[] = include_once( 'includes/class-wcj-currencies.php' );
|
439 |
+
$settings[] = include_once( 'includes/class-wcj-multicurrency.php' );
|
440 |
$settings[] = include_once( 'includes/class-wcj-currency-external-products.php' );
|
441 |
$settings[] = include_once( 'includes/class-wcj-price-by-country.php' );
|
442 |
$settings[] = include_once( 'includes/class-wcj-currency-exchange-rates.php' );
|