Version Description
- 25/04/2019 =
- Fix - SHIPPING & ORDERS - Order Quantities - Decimal Quantities -
init
hook priority lowered. This fixes the issue with "PDF Invoicing & Packing Slips" module not displaying decimal quantities. - Fix - PDF INVOICING & PACKING SLIPS - Fix "failed to delete buffer" warning when generating pdf.
- Dev - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Create new option to add compatibility with Smart Coupons plugin.
- Dev - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Create new option to add compatibility with WooCommerce Price Filter widget.
- Dev - PRICES & CURRENCIES - Multicurrency Product Base Price - Add option to make module compatible with "Price Filter" widget.
- Dev - SHIPPING & ORDERS - Order Quantities - Decimal Quantities - Setting float number
pattern
for quantity input. - Dev - SHIPPING & ORDERS - Order Quantities - Module renamed from "Order Min/Max Quantities" and description updated.
- Dev - PDF INVOICING & PACKING SLIPS - Create new option on advanced settings to manage output buffer.
Download this release
Release Info
Developer | algoritmika |
Plugin | Booster for WooCommerce |
Version | 4.3.1 |
Comparing to | |
See all releases |
Code changes from version 4.3.0 to 4.3.1
- includes/class-wcj-multicurrency-product-base-price.php +396 -85
- includes/class-wcj-multicurrency.php +9 -5
- includes/class-wcj-order-quantities.php +23 -11
- includes/class-wcj-pdf-invoicing.php +14 -8
- includes/settings/wcj-settings-multicurrency-base-price.php +18 -3
- includes/settings/wcj-settings-multicurrency.php +36 -4
- includes/settings/wcj-settings-pdf-invoicing-advanced.php +8 -1
- readme.txt +11 -1
- woocommerce-jetpack.php +3 -3
includes/class-wcj-multicurrency-product-base-price.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - Multicurrency Product Base Price
|
4 |
*
|
5 |
-
* @version 3.
|
6 |
* @since 2.4.8
|
7 |
* @author Algoritmika Ltd.
|
8 |
*/
|
@@ -11,113 +11,424 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
11 |
|
12 |
if ( ! class_exists( 'WCJ_Multicurrency_Base_Price' ) ) :
|
13 |
|
14 |
-
class WCJ_Multicurrency_Base_Price extends WCJ_Module {
|
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 |
-
$this->
|
41 |
-
wcj_add_change_price_hooks( $this, $this->price_hooks_priority, false );
|
42 |
}
|
|
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
-
}
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
-
return $price;
|
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 |
if (
|
105 |
-
|
106 |
-
|
107 |
) {
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
114 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
116 |
}
|
117 |
-
return $currency_symbol;
|
118 |
-
}
|
119 |
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
endif;
|
123 |
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - Multicurrency Product Base Price
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @since 2.4.8
|
7 |
* @author Algoritmika Ltd.
|
8 |
*/
|
11 |
|
12 |
if ( ! class_exists( 'WCJ_Multicurrency_Base_Price' ) ) :
|
13 |
|
14 |
+
class WCJ_Multicurrency_Base_Price extends WCJ_Module {
|
15 |
|
16 |
+
/**
|
17 |
+
* Constructor.
|
18 |
+
*
|
19 |
+
* @version 4.3.1
|
20 |
+
* @since 2.4.8
|
21 |
+
*/
|
22 |
+
function __construct() {
|
23 |
|
24 |
+
$this->id = 'multicurrency_base_price';
|
25 |
+
$this->short_desc = __( 'Multicurrency Product Base Price', 'woocommerce-jetpack' );
|
26 |
+
$this->desc = __( 'Enter prices for products in different currencies.', 'woocommerce-jetpack' );
|
27 |
+
$this->link_slug = 'woocommerce-multicurrency-product-base-price';
|
28 |
+
parent::__construct();
|
29 |
|
30 |
+
if ( $this->is_enabled() ) {
|
31 |
|
32 |
+
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
|
33 |
+
add_action( 'save_post_product', array( $this, 'save_meta_box' ), PHP_INT_MAX, 2 );
|
34 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol_on_product_edit' ), PHP_INT_MAX, 2 );
|
35 |
|
36 |
+
$this->do_convert_in_back_end = ( 'yes' === get_option( 'wcj_multicurrency_base_price_do_convert_in_back_end', 'no' ) );
|
37 |
|
38 |
+
if ( $this->do_convert_in_back_end || wcj_is_frontend() ) {
|
39 |
+
$this->price_hooks_priority = wcj_get_module_price_hooks_priority( 'multicurrency_base_price' );
|
40 |
+
wcj_add_change_price_hooks( $this, $this->price_hooks_priority, false );
|
41 |
+
}
|
42 |
|
43 |
+
// Compatibility with WooCommerce Price Filter Widget
|
44 |
+
$this->handle_price_filter_widget_compatibility();
|
|
|
45 |
}
|
46 |
+
}
|
47 |
|
48 |
+
/**
|
49 |
+
* Adds Compatibility with WooCommerce Price Filter Widget.
|
50 |
+
*
|
51 |
+
* @version 4.3.1
|
52 |
+
* @since 4.3.1
|
53 |
+
*/
|
54 |
+
function handle_price_filter_widget_compatibility() {
|
55 |
+
add_action( 'updated_post_meta', array( $this, 'update_base_price_meta_on_price_update' ), 10, 3 );
|
56 |
+
add_action( 'updated_post_meta', array( $this, 'update_base_price_meta_on_base_price_currency_update' ), 10, 3 );
|
57 |
+
add_action( 'added_post_meta', array( $this, 'update_base_price_meta_on_base_price_currency_update' ), 10, 3 );
|
58 |
+
add_filter( 'woocommerce_product_query_meta_query', array( $this, 'add_base_price_on_product_meta_query' ) );
|
59 |
+
add_action( 'updated_option', array( $this, 'update_products_base_price_on_exchange_rate_change' ), 10, 3 );
|
60 |
+
add_action( 'updated_post_meta', array( $this, 'handle_price_filter_compatibility_flag_on_base_price_update' ), 10, 4 );
|
61 |
+
add_action( 'updated_post_meta', array( $this, 'handle_price_filter_compatibility_flag_on_base_price_currency_update' ), 10, 4 );
|
62 |
+
add_filter( 'woocommerce_price_filter_sql', array($this,'change_woocommerce_price_filter_sql'));
|
63 |
}
|
|
|
64 |
|
65 |
+
/**
|
66 |
+
* Changes WooCommerce Price Filter Widget SQL.
|
67 |
+
*
|
68 |
+
* All in all, it creates the min and max from '_price' meta, and from '_wcj_multicurrency_base_price' if there is the '_wcj_multicurrency_base_price_comp_pf' meta
|
69 |
+
*
|
70 |
+
* @version 4.3.1
|
71 |
+
* @since 4.3.1
|
72 |
+
*
|
73 |
+
* @see WC_Widget_Price_Filter::get_filtered_price()
|
74 |
+
* @param $sql
|
75 |
+
*
|
76 |
+
* @return string
|
77 |
+
*/
|
78 |
+
function change_woocommerce_price_filter_sql($sql){
|
79 |
+
if ( 'no' === get_option( 'wcj_multicurrency_base_price_advanced_price_filter_comp', 'no' ) ) {
|
80 |
+
return $sql;
|
81 |
+
}
|
82 |
+
global $wpdb;
|
83 |
+
$args = wc()->query->get_main_query()->query_vars;
|
84 |
+
$tax_query = isset( $args['tax_query'] ) ? $args['tax_query'] : array();
|
85 |
+
$meta_query = isset( $args['meta_query'] ) ? $args['meta_query'] : array();
|
86 |
+
if ( ! is_post_type_archive( 'product' ) && ! empty( $args['taxonomy'] ) && ! empty( $args['term'] ) ) {
|
87 |
+
$tax_query[] = array(
|
88 |
+
'taxonomy' => $args['taxonomy'],
|
89 |
+
'terms' => array( $args['term'] ),
|
90 |
+
'field' => 'slug',
|
91 |
+
);
|
92 |
+
}
|
93 |
+
foreach ( $meta_query + $tax_query as $key => $query ) {
|
94 |
+
if ( ! empty( $query['price_filter'] ) || ! empty( $query['rating_filter'] ) ) {
|
95 |
+
unset( $meta_query[ $key ] );
|
96 |
}
|
97 |
}
|
98 |
+
$meta_query = new WP_Meta_Query( $meta_query );
|
99 |
+
$tax_query = new WP_Tax_Query( $tax_query );
|
100 |
+
$meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
|
101 |
+
$tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
|
102 |
+
$sql = "SELECT MIN(FLOOR(IF(pm2.meta_value=1, pm3.meta_value, pm.meta_value))) AS min_price, MAX(CEILING(IF(pm2.meta_value=1, pm3.meta_value, pm.meta_value))) AS max_price FROM {$wpdb->posts}";
|
103 |
+
$sql .= " JOIN {$wpdb->postmeta} as pm ON {$wpdb->posts}.ID = pm.post_id " . $tax_query_sql['join'] . $meta_query_sql['join'];
|
104 |
+
$sql .= " LEFT JOIN {$wpdb->postmeta} as pm2 ON {$wpdb->posts}.ID = pm2.post_id AND pm2.meta_key = '_wcj_multicurrency_base_price_comp_pf' ";
|
105 |
+
$sql .= " LEFT JOIN {$wpdb->postmeta} as pm3 ON {$wpdb->posts}.ID = pm3.post_id AND pm3.meta_key = '_wcj_multicurrency_base_price' ";
|
106 |
+
$sql .= " WHERE {$wpdb->posts}.post_type IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_post_type', array( 'product' ) ) ) ) . "')
|
107 |
+
AND {$wpdb->posts}.post_status = 'publish'
|
108 |
+
AND pm.meta_key IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_meta_keys', array( '_price' ) ) ) ) . "')
|
109 |
+
AND pm.meta_value > '' ";
|
110 |
+
$sql .= $tax_query_sql['where'] . $meta_query_sql['where'];
|
111 |
+
$search = WC_Query::get_main_search_query_sql();
|
112 |
+
if ( $search ) {
|
113 |
+
$sql .= ' AND ' . $search;
|
114 |
+
}
|
115 |
+
return $sql;
|
116 |
}
|
|
|
|
|
117 |
|
118 |
+
/**
|
119 |
+
* Updates '_wcj_multicurrency_base_price' when '_wcj_multicurrency_base_price_currency' changes.
|
120 |
+
*
|
121 |
+
* @version 4.3.1
|
122 |
+
* @since 4.3.1
|
123 |
+
*
|
124 |
+
* @param $meta_id
|
125 |
+
* @param $object_id
|
126 |
+
* @param $meta_key
|
127 |
+
*/
|
128 |
+
function update_base_price_meta_on_base_price_currency_update( $meta_id, $object_id, $meta_key ) {
|
129 |
+
if (
|
130 |
+
'no' === get_option( 'wcj_multicurrency_base_price_advanced_price_filter_comp', 'no' ) ||
|
131 |
+
! function_exists( 'wc_get_product' ) ||
|
132 |
+
'_wcj_multicurrency_base_price_currency' !== $meta_key ||
|
133 |
+
! is_a( $product = wc_get_product( $object_id ), 'WC_Product' )
|
134 |
+
) {
|
135 |
+
return;
|
136 |
+
}
|
137 |
+
$this->update_wcj_multicurrency_base_price_meta( $product );
|
138 |
+
}
|
139 |
|
140 |
+
/**
|
141 |
+
* Updates '_wcj_multicurrency_base_price' when '_price' meta is updated.
|
142 |
+
*
|
143 |
+
* @version 4.3.1
|
144 |
+
* @since 4.3.1
|
145 |
+
*
|
146 |
+
* @param $meta_id
|
147 |
+
* @param $object_id
|
148 |
+
* @param $meta_key
|
149 |
+
*/
|
150 |
+
function update_base_price_meta_on_price_update( $meta_id, $object_id, $meta_key ){
|
151 |
+
if (
|
152 |
+
'no' === get_option('wcj_multicurrency_base_price_advanced_price_filter_comp') ||
|
153 |
+
! function_exists( 'wc_get_product' ) ||
|
154 |
+
'_price' !== $meta_key ||
|
155 |
+
! is_a( $product = wc_get_product( $object_id ), 'WC_Product' )
|
156 |
+
) {
|
157 |
+
return;
|
158 |
+
}
|
159 |
+
$this->update_wcj_multicurrency_base_price_meta( $product );
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Adds compatibility with price filter adding '_wcj_multicurrency_base_price' on product meta query.
|
164 |
+
* It only compares products with '_wcj_multicurrency_base_price_comp_pf' meta
|
165 |
+
*
|
166 |
+
* @version 4.3.1
|
167 |
+
* @since 4.3.1
|
168 |
+
*
|
169 |
+
* @param $query
|
170 |
+
*
|
171 |
+
* @return mixed
|
172 |
+
*/
|
173 |
+
function add_base_price_on_product_meta_query( $query ) {
|
174 |
+
if (
|
175 |
+
! isset( $query['price_filter'] ) || empty( $query['price_filter'] ) ||
|
176 |
+
'no' === get_option( 'wcj_multicurrency_base_price_advanced_price_filter_comp', 'no' )
|
177 |
+
) {
|
178 |
+
return $query;
|
179 |
+
}
|
180 |
+
$price_filter = $price_filter_wcj = $query['price_filter'];
|
181 |
+
$price_filter_wcj['key'] = '_wcj_multicurrency_base_price';
|
182 |
+
$price_filter_wcj['wcj_mcpb_price_filter'] = 1;
|
183 |
+
unset( $query['price_filter'] );
|
184 |
+
$query['price_filter'] = array(
|
185 |
+
'relation' => 'OR',
|
186 |
+
array(
|
187 |
+
'relation' => 'AND',
|
188 |
+
$price_filter,
|
189 |
+
array(
|
190 |
+
'key' => '_wcj_multicurrency_base_price_comp_pf',
|
191 |
+
'compare' => 'NOT EXISTS',
|
192 |
+
)
|
193 |
+
),
|
194 |
+
array(
|
195 |
+
'relation' => 'AND',
|
196 |
+
$price_filter_wcj,
|
197 |
+
array(
|
198 |
+
'key' => '_wcj_multicurrency_base_price_comp_pf',
|
199 |
+
'compare' => 'EXISTS',
|
200 |
+
)
|
201 |
+
)
|
202 |
+
);
|
203 |
+
return $query;
|
204 |
+
}
|
205 |
|
206 |
+
/**
|
207 |
+
* Updates '_wcj_multicurrency_base_price' meta on products by currency when exchange rate changes inside 'Multicurrency Product Base Price' module.
|
208 |
+
*
|
209 |
+
* @version 4.3.1
|
210 |
+
* @since 4.3.1
|
211 |
+
*
|
212 |
+
* @param $option_name
|
213 |
+
* @param $old_value
|
214 |
+
* @param $option_value
|
215 |
+
*/
|
216 |
+
function update_products_base_price_on_exchange_rate_change( $option_name, $old_value, $option_value){
|
217 |
if (
|
218 |
+
'no' === get_option( 'wcj_multicurrency_base_price_advanced_price_filter_comp', 'no' ) ||
|
219 |
+
false === strpos( $option_name, 'wcj_multicurrency_base_price_exchange_rate_' )
|
220 |
) {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
$currency_number = substr( $option_name, strrpos( $option_name, '_' ) + 1 );
|
224 |
+
$currency = get_option( 'wcj_multicurrency_base_price_currency_' . $currency_number );
|
225 |
+
$the_query = $this->get_products_by_base_price_currency( '=', $currency );
|
226 |
+
if ( $the_query->have_posts() ) {
|
227 |
+
foreach ( $the_query->posts as $post_id ) {
|
228 |
+
$this->update_wcj_multicurrency_base_price_meta( $post_id );
|
229 |
}
|
230 |
+
wp_reset_postdata();
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Flags a product with '_wcj_multicurrency_base_price_comp_pf' if its '_wcj_multicurrency_base_price_currency' is different from base woocommerce currency.
|
236 |
+
*
|
237 |
+
* @version 4.3.1
|
238 |
+
* @since 4.3.1
|
239 |
+
*
|
240 |
+
* @param $meta_id
|
241 |
+
* @param $object_id
|
242 |
+
* @param $meta_key
|
243 |
+
* @param $meta_value
|
244 |
+
*/
|
245 |
+
function handle_price_filter_compatibility_flag_on_base_price_currency_update( $meta_id, $object_id, $meta_key, $meta_value ) {
|
246 |
+
if (
|
247 |
+
'no' === get_option( 'wcj_multicurrency_base_price_advanced_price_filter_comp', 'no' ) ||
|
248 |
+
! function_exists( 'wc_get_product' ) ||
|
249 |
+
'_wcj_multicurrency_base_price_currency' !== $meta_key ||
|
250 |
+
! is_a( $product = wc_get_product( $object_id ), 'WC_Product' )
|
251 |
+
) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
+
if ( $meta_value === get_option( 'woocommerce_currency' ) ) {
|
255 |
+
delete_post_meta( $product->get_id(), '_wcj_multicurrency_base_price_comp_pf' );
|
256 |
+
} else {
|
257 |
+
update_post_meta( $product->get_id(), '_wcj_multicurrency_base_price_comp_pf', true );
|
258 |
}
|
259 |
}
|
|
|
|
|
260 |
|
261 |
+
/**
|
262 |
+
* Flags a product with '_wcj_multicurrency_base_price_comp_pf' if its '_price' is != '_wcj_multicurrency_base_price'
|
263 |
+
*
|
264 |
+
* @version 4.3.1
|
265 |
+
* @since 4.3.1
|
266 |
+
*
|
267 |
+
* @param $meta_id
|
268 |
+
* @param $object_id
|
269 |
+
* @param $meta_key
|
270 |
+
* @param $meta_value
|
271 |
+
*/
|
272 |
+
function handle_price_filter_compatibility_flag_on_base_price_update( $meta_id, $object_id, $meta_key, $meta_value ) {
|
273 |
+
if (
|
274 |
+
'no' === get_option( 'wcj_multicurrency_base_price_advanced_price_filter_comp', 'no' ) ||
|
275 |
+
! function_exists( 'wc_get_product' ) ||
|
276 |
+
'_wcj_multicurrency_base_price' !== $meta_key ||
|
277 |
+
! is_a( $product = wc_get_product( $object_id ), 'WC_Product' )
|
278 |
+
) {
|
279 |
+
return;
|
280 |
+
}
|
281 |
+
if ( $meta_value === get_post_meta( $product->get_id(), '_price', true ) ) {
|
282 |
+
delete_post_meta( $product->get_id(), '_wcj_multicurrency_base_price_comp_pf' );
|
283 |
+
} else {
|
284 |
+
update_post_meta( $product->get_id(), '_wcj_multicurrency_base_price_comp_pf', true );
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Gets products by base price currency.
|
290 |
+
*
|
291 |
+
* @version 4.3.1
|
292 |
+
* @since 4.3.1
|
293 |
+
*
|
294 |
+
* @param string $compare
|
295 |
+
* @param string $currency
|
296 |
+
*
|
297 |
+
* @return WP_Query
|
298 |
+
*/
|
299 |
+
function get_products_by_base_price_currency( $compare = '=', $currency = '' ) {
|
300 |
+
if ( empty( $currency ) ) {
|
301 |
+
$currency = get_option( 'woocommerce_currency' );
|
302 |
+
}
|
303 |
+
$args = array(
|
304 |
+
'post_type' => 'product',
|
305 |
+
'posts_per_page' => - 1,
|
306 |
+
'no_found_rows' => true,
|
307 |
+
'update_post_meta_cache' => false,
|
308 |
+
'update_post_term_cache' => false,
|
309 |
+
'fields' => 'ids',
|
310 |
+
'meta_query' => array(
|
311 |
+
array(
|
312 |
+
'key' => '_wcj_multicurrency_base_price_currency',
|
313 |
+
'value' => $currency,
|
314 |
+
'compare' => $compare
|
315 |
+
)
|
316 |
+
)
|
317 |
+
);
|
318 |
+
$query = new WP_Query( $args );
|
319 |
+
return $query;
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Updates '_wcj_multicurrency_base_price' meta.
|
324 |
+
*
|
325 |
+
* @version 4.3.1
|
326 |
+
* @since 4.3.1
|
327 |
+
*
|
328 |
+
* @param $product
|
329 |
+
* @param null $price
|
330 |
+
*
|
331 |
+
* @return bool
|
332 |
+
*/
|
333 |
+
function update_wcj_multicurrency_base_price_meta( $product, $price = null ) {
|
334 |
+
if ( filter_var( $product, FILTER_VALIDATE_INT ) ) {
|
335 |
+
$product = wc_get_product( $product );
|
336 |
+
}
|
337 |
+
if ( ! is_a( $product, 'WC_Product' ) ) {
|
338 |
+
return false;
|
339 |
+
}
|
340 |
+
$multicurrency_base_price_currency = get_post_meta( $product->get_id(), '_' . 'wcj_multicurrency_base_price_currency', true );
|
341 |
+
if ( $multicurrency_base_price_currency === get_option( 'woocommerce_currency' ) ) {
|
342 |
+
update_post_meta( $product->get_id(), '_wcj_multicurrency_base_price', get_post_meta( $product->get_id(), '_price', true ) );
|
343 |
+
return false;
|
344 |
+
}
|
345 |
+
if ( ! $price ) {
|
346 |
+
$price = get_post_meta( $product->get_id(), '_price', true );
|
347 |
+
if ( 1 != ( $currency_exchange_rate = wcj_get_currency_exchange_rate_product_base_currency( $multicurrency_base_price_currency ) ) ) {
|
348 |
+
$price = $price / $currency_exchange_rate;
|
349 |
+
if ( 'yes' === get_option( 'wcj_multicurrency_base_price_round_enabled', 'no' ) ) {
|
350 |
+
$price = round( $price, get_option( 'wcj_multicurrency_rounding_precision', absint( get_option( 'woocommerce_price_num_decimals', 2 ) ) ) );
|
351 |
+
}
|
352 |
+
}
|
353 |
+
}
|
354 |
+
update_post_meta( $product->get_id(), '_wcj_multicurrency_base_price', $price );
|
355 |
+
return true;
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* change_price_grouped.
|
360 |
+
*
|
361 |
+
* @version 2.7.0
|
362 |
+
* @since 2.5.0
|
363 |
+
*/
|
364 |
+
function change_price_grouped( $price, $qty, $_product ) {
|
365 |
+
if ( $_product->is_type( 'grouped' ) ) {
|
366 |
+
foreach ( $_product->get_children() as $child_id ) {
|
367 |
+
$the_price = get_post_meta( $child_id, '_price', true );
|
368 |
+
$the_product = wc_get_product( $child_id );
|
369 |
+
$the_price = wcj_get_product_display_price( $the_product, $the_price, 1 );
|
370 |
+
if ( $the_price == $price ) {
|
371 |
+
return $this->change_price( $price, $the_product );
|
372 |
+
}
|
373 |
+
}
|
374 |
+
}
|
375 |
+
return $price;
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* change_price.
|
380 |
+
*
|
381 |
+
* @version 2.7.0
|
382 |
+
* @since 2.4.8
|
383 |
+
*/
|
384 |
+
function change_price( $price, $_product ) {
|
385 |
+
return wcj_price_by_product_base_currency( $price, wcj_get_product_id_or_variation_parent_id( $_product ) );
|
386 |
+
}
|
387 |
+
|
388 |
+
/**
|
389 |
+
* get_variation_prices_hash.
|
390 |
+
*
|
391 |
+
* @version 3.5.0
|
392 |
+
* @since 2.4.8
|
393 |
+
*/
|
394 |
+
function get_variation_prices_hash( $price_hash, $_product, $display ) {
|
395 |
+
$multicurrency_base_price_currency = get_post_meta( wcj_get_product_id_or_variation_parent_id( $_product, true ), '_' . 'wcj_multicurrency_base_price_currency', true );
|
396 |
+
$price_hash['wcj_multicurrency_base_price'] = array(
|
397 |
+
'currency' => $multicurrency_base_price_currency,
|
398 |
+
'exchange_rate' => wcj_get_currency_exchange_rate_product_base_currency( $multicurrency_base_price_currency ),
|
399 |
+
'rounding' => get_option( 'wcj_multicurrency_base_price_round_enabled', 'no' ),
|
400 |
+
'rounding_precision' => get_option( 'wcj_multicurrency_base_price_round_precision', get_option( 'woocommerce_price_num_decimals' ) ),
|
401 |
+
'save_prices' => get_option( 'wcj_multicurrency_base_price_save_prices', 'no' ),
|
402 |
+
);
|
403 |
+
return $price_hash;
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* change_currency_symbol_on_product_edit.
|
408 |
+
*
|
409 |
+
* @version 3.9.0
|
410 |
+
* @since 2.4.8
|
411 |
+
*/
|
412 |
+
function change_currency_symbol_on_product_edit( $currency_symbol, $currency ) {
|
413 |
+
if ( is_admin() ) {
|
414 |
+
global $pagenow;
|
415 |
+
if (
|
416 |
+
( 'post.php' === $pagenow && isset( $_GET['action'] ) && 'edit' === $_GET['action'] ) || // admin product edit page
|
417 |
+
( ! $this->do_convert_in_back_end && 'edit.php' === $pagenow && isset( $_GET['post_type'] ) && 'product' === $_GET['post_type'] ) // admin products list
|
418 |
+
) {
|
419 |
+
$multicurrency_base_price_currency = get_post_meta( get_the_ID(), '_' . 'wcj_multicurrency_base_price_currency', true );
|
420 |
+
if ( '' != $multicurrency_base_price_currency ) {
|
421 |
+
remove_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol_on_product_edit' ), PHP_INT_MAX, 2 );
|
422 |
+
$return = get_woocommerce_currency_symbol( $multicurrency_base_price_currency );
|
423 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol_on_product_edit' ), PHP_INT_MAX, 2 );
|
424 |
+
return $return;
|
425 |
+
}
|
426 |
+
}
|
427 |
+
}
|
428 |
+
return $currency_symbol;
|
429 |
+
}
|
430 |
+
|
431 |
+
}
|
432 |
|
433 |
endif;
|
434 |
|
includes/class-wcj-multicurrency.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - Multicurrency (Currency Switcher)
|
4 |
*
|
5 |
-
* @version 4.3.
|
6 |
* @since 2.4.3
|
7 |
* @author Algoritmika Ltd.
|
8 |
*/
|
@@ -67,16 +67,20 @@ class WCJ_Multicurrency extends WCJ_Module {
|
|
67 |
/**
|
68 |
* Handles third party compatibility
|
69 |
*
|
70 |
-
* @version 4.3.
|
71 |
* @since 4.3.0
|
72 |
*/
|
73 |
function handle_third_party_compatibility(){
|
74 |
// "WooCommerce Smart Coupons" Compatibility
|
75 |
-
|
|
|
|
|
76 |
|
77 |
// WooCommerce Price Filter Widget
|
78 |
-
|
79 |
-
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - Multicurrency (Currency Switcher)
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @since 2.4.3
|
7 |
* @author Algoritmika Ltd.
|
8 |
*/
|
67 |
/**
|
68 |
* Handles third party compatibility
|
69 |
*
|
70 |
+
* @version 4.3.1
|
71 |
* @since 4.3.0
|
72 |
*/
|
73 |
function handle_third_party_compatibility(){
|
74 |
// "WooCommerce Smart Coupons" Compatibility
|
75 |
+
if ( 'yes' === get_option( 'wcj_multicurrency_compatibility_wc_smart_coupons' , 'yes' ) ) {
|
76 |
+
add_filter( 'woocommerce_coupon_get_amount', array( $this, 'smart_coupons_get_amount' ), 10, 2 );
|
77 |
+
}
|
78 |
|
79 |
// WooCommerce Price Filter Widget
|
80 |
+
if ( 'yes' === get_option( 'wcj_multicurrency_compatibility_wc_price_filter' , 'yes' ) ) {
|
81 |
+
add_action( 'wp_footer', array( $this, 'add_compatibility_with_price_filter_widget' ) );
|
82 |
+
add_action( 'wp_footer', array( $this, 'fix_price_filter_widget_currency_format' ) );
|
83 |
+
}
|
84 |
}
|
85 |
|
86 |
/**
|
includes/class-wcj-order-quantities.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - Order Min/Max Quantities
|
4 |
*
|
5 |
-
* @version 4.
|
6 |
* @since 2.9.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
*/
|
@@ -16,18 +16,19 @@ class WCJ_Order_Quantities extends WCJ_Module {
|
|
16 |
/**
|
17 |
* Constructor.
|
18 |
*
|
19 |
-
* @version 4.
|
20 |
* @since 2.9.0
|
21 |
-
* @todo maybe rename the module to "Order
|
22 |
-
* @todo loop (`woocommerce_loop_add_to_cart_link`)
|
23 |
-
* @todo
|
24 |
-
* @todo [
|
|
|
25 |
*/
|
26 |
function __construct() {
|
27 |
|
28 |
$this->id = 'order_quantities';
|
29 |
-
$this->short_desc = __( 'Order
|
30 |
-
$this->desc = __( '
|
31 |
$this->link_slug = 'woocommerce-order-min-max-quantities';
|
32 |
parent::__construct();
|
33 |
|
@@ -81,11 +82,22 @@ class WCJ_Order_Quantities extends WCJ_Module {
|
|
81 |
add_filter( 'woocommerce_loop_add_to_cart_link', array( $this, 'replace_quantity_attribute_on_loop_cart_link' ), PHP_INT_MAX, 2 );
|
82 |
// Decimal qty
|
83 |
if ( 'yes' === get_option( 'wcj_order_quantities_decimal_qty_enabled', 'no' ) ) {
|
84 |
-
add_action( 'init',
|
|
|
85 |
}
|
86 |
}
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
/**
|
90 |
* float_stock_amount.
|
91 |
*
|
@@ -236,8 +248,8 @@ class WCJ_Order_Quantities extends WCJ_Module {
|
|
236 |
*
|
237 |
* @version 3.2.3
|
238 |
* @since 3.2.2
|
239 |
-
* @todo `force_on_add_to_cart` for simple products
|
240 |
-
* @todo make this optional?
|
241 |
*/
|
242 |
function enqueue_script() {
|
243 |
$_product = wc_get_product();
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - Order Min/Max Quantities
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @since 2.9.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
*/
|
16 |
/**
|
17 |
* Constructor.
|
18 |
*
|
19 |
+
* @version 4.3.1
|
20 |
* @since 2.9.0
|
21 |
+
* @todo [dev] maybe rename the module to "Order Product Quantities" or "Product Quantities"?
|
22 |
+
* @todo [dev] loop (`woocommerce_loop_add_to_cart_link`)
|
23 |
+
* @todo [dev] apply quantity **step per variation**
|
24 |
+
* @todo [dev] (maybe) order quantities by user roles
|
25 |
+
* @todo [dev] (maybe) validate (and optionally auto-correct) **on add to cart**
|
26 |
*/
|
27 |
function __construct() {
|
28 |
|
29 |
$this->id = 'order_quantities';
|
30 |
+
$this->short_desc = __( 'Order Quantities', 'woocommerce-jetpack' );
|
31 |
+
$this->desc = __( 'Manage product quantities in WooCommerce order: set min, max, step; enable decimal quantities etc.', 'woocommerce-jetpack' );
|
32 |
$this->link_slug = 'woocommerce-order-min-max-quantities';
|
33 |
parent::__construct();
|
34 |
|
82 |
add_filter( 'woocommerce_loop_add_to_cart_link', array( $this, 'replace_quantity_attribute_on_loop_cart_link' ), PHP_INT_MAX, 2 );
|
83 |
// Decimal qty
|
84 |
if ( 'yes' === get_option( 'wcj_order_quantities_decimal_qty_enabled', 'no' ) ) {
|
85 |
+
add_action( 'init', array( $this, 'float_stock_amount' ) );
|
86 |
+
add_action( 'woocommerce_quantity_input_pattern', array( $this, 'float_quantity_input_pattern' ) );
|
87 |
}
|
88 |
}
|
89 |
}
|
90 |
|
91 |
+
/**
|
92 |
+
* float_quantity_input_pattern.
|
93 |
+
*
|
94 |
+
* @version 4.3.1
|
95 |
+
* @since 4.3.1
|
96 |
+
*/
|
97 |
+
function float_quantity_input_pattern( $pattern ) {
|
98 |
+
return '[0-9.]*';
|
99 |
+
}
|
100 |
+
|
101 |
/**
|
102 |
* float_stock_amount.
|
103 |
*
|
248 |
*
|
249 |
* @version 3.2.3
|
250 |
* @since 3.2.2
|
251 |
+
* @todo [dev] `force_on_add_to_cart` for simple products
|
252 |
+
* @todo [dev] make this optional?
|
253 |
*/
|
254 |
function enqueue_script() {
|
255 |
$_product = wc_get_product();
|
includes/class-wcj-pdf-invoicing.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - PDF Invoicing
|
4 |
*
|
5 |
-
* @version 4.3.
|
6 |
* @author Algoritmika Ltd.
|
7 |
*/
|
8 |
|
@@ -437,7 +437,7 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
|
|
437 |
/**
|
438 |
* generate_pdf_on_init.
|
439 |
*
|
440 |
-
* @version 4.3.
|
441 |
*/
|
442 |
function generate_pdf_on_init() {
|
443 |
// Check if all is OK
|
@@ -446,12 +446,18 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
|
|
446 |
}
|
447 |
// Get PDF
|
448 |
$the_invoice = wcj_get_pdf_invoice( $this->order_id, $this->invoice_type_id );
|
449 |
-
$dest
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
die();
|
456 |
}
|
457 |
|
2 |
/**
|
3 |
* Booster for WooCommerce - Module - PDF Invoicing
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @author Algoritmika Ltd.
|
7 |
*/
|
8 |
|
437 |
/**
|
438 |
* generate_pdf_on_init.
|
439 |
*
|
440 |
+
* @version 4.3.1
|
441 |
*/
|
442 |
function generate_pdf_on_init() {
|
443 |
// Check if all is OK
|
446 |
}
|
447 |
// Get PDF
|
448 |
$the_invoice = wcj_get_pdf_invoice( $this->order_id, $this->invoice_type_id );
|
449 |
+
$dest = ( true === $this->save_as_pdf ? 'D' : 'I' );
|
450 |
+
if ( 'yes' === get_option( 'wcj_general_advanced_disable_output_buffer', 'no' ) ) {
|
451 |
+
ob_clean();
|
452 |
+
ob_flush();
|
453 |
+
$the_invoice->get_pdf( $dest );
|
454 |
+
ob_end_flush();
|
455 |
+
if ( ob_get_contents() ) {
|
456 |
+
ob_end_clean();
|
457 |
+
}
|
458 |
+
} else {
|
459 |
+
$the_invoice->get_pdf( $dest );
|
460 |
+
}
|
461 |
die();
|
462 |
}
|
463 |
|
includes/settings/wcj-settings-multicurrency-base-price.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Settings - Multicurrency Product Base Price
|
4 |
*
|
5 |
-
* @version 3.
|
6 |
* @since 2.8.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
* @todo (maybe) `if ( isset( $all_currencies[ $currency_from ] ) ) { unset( $all_currencies[ $currency_from ] ); }`
|
@@ -56,7 +56,16 @@ $settings = array(
|
|
56 |
'type' => 'checkbox',
|
57 |
),
|
58 |
array(
|
59 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
'desc_tip' => __( 'This may help if you are experiencing compatibility issues with other plugins.', 'woocommerce-jetpack' ),
|
61 |
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
62 |
'id' => 'wcj_multicurrency_base_price_save_prices',
|
@@ -64,13 +73,19 @@ $settings = array(
|
|
64 |
'type' => 'checkbox',
|
65 |
),
|
66 |
array(
|
67 |
-
'title' => __( '
|
68 |
'desc_tip' => __( 'Priority for all module\'s price filters. Set to zero to use default priority.' ),
|
69 |
'id' => 'wcj_multicurrency_base_price_advanced_price_hooks_priority',
|
70 |
'default' => 0,
|
71 |
'type' => 'number',
|
72 |
),
|
73 |
array(
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
'type' => 'sectionend',
|
75 |
'id' => 'wcj_multicurrency_base_price_options',
|
76 |
),
|
2 |
/**
|
3 |
* Booster for WooCommerce - Settings - Multicurrency Product Base Price
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @since 2.8.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
* @todo (maybe) `if ( isset( $all_currencies[ $currency_from ] ) ) { unset( $all_currencies[ $currency_from ] ); }`
|
56 |
'type' => 'checkbox',
|
57 |
),
|
58 |
array(
|
59 |
+
'type' => 'sectionend',
|
60 |
+
'id' => 'wcj_multicurrency_base_price_options',
|
61 |
+
),
|
62 |
+
array(
|
63 |
+
'title' => __( 'Advanced', 'woocommerce-jetpack' ),
|
64 |
+
'type' => 'title',
|
65 |
+
'id' => 'wcj_multicurrency_base_price_advanced',
|
66 |
+
),
|
67 |
+
array(
|
68 |
+
'title' => __( 'Save Calculated Products Prices', 'woocommerce-jetpack' ),
|
69 |
'desc_tip' => __( 'This may help if you are experiencing compatibility issues with other plugins.', 'woocommerce-jetpack' ),
|
70 |
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
71 |
'id' => 'wcj_multicurrency_base_price_save_prices',
|
73 |
'type' => 'checkbox',
|
74 |
),
|
75 |
array(
|
76 |
+
'title' => __( 'Price Filters Priority', 'woocommerce-jetpack' ),
|
77 |
'desc_tip' => __( 'Priority for all module\'s price filters. Set to zero to use default priority.' ),
|
78 |
'id' => 'wcj_multicurrency_base_price_advanced_price_hooks_priority',
|
79 |
'default' => 0,
|
80 |
'type' => 'number',
|
81 |
),
|
82 |
array(
|
83 |
+
'title' => __( 'Price Filter Compatibility', 'woocommerce-jetpack' ),
|
84 |
+
'desc' => __( 'Add compatibility with WooCommerce Price Filter Widget' ),
|
85 |
+
'id' => 'wcj_multicurrency_base_price_advanced_price_filter_comp',
|
86 |
+
'default' => 'no',
|
87 |
+
'type' => 'checkbox',
|
88 |
+
),array(
|
89 |
'type' => 'sectionend',
|
90 |
'id' => 'wcj_multicurrency_base_price_options',
|
91 |
),
|
includes/settings/wcj-settings-multicurrency.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Settings - Multicurrency (Currency Switcher)
|
4 |
*
|
5 |
-
* @version 3.
|
6 |
* @since 2.8.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
* @todo "pretty prices"
|
@@ -99,7 +99,39 @@ $settings = array(
|
|
99 |
'class' => 'widefat',
|
100 |
),
|
101 |
array(
|
102 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
'desc_tip' => __( 'Add additional price filters here. One per line. Leave blank if not sure.' ),
|
104 |
'desc' => sprintf( __( 'E.g.: %s' ), '<code>' . 'woocommerce_subscriptions_product_price' . '</code>' . ', ' .'<code>' . 'woocommerce_get_price' . '</code>' . '.' ),
|
105 |
'id' => 'wcj_multicurrency_switcher_additional_price_filters',
|
@@ -108,7 +140,7 @@ $settings = array(
|
|
108 |
'css' => 'min-width:300px;height:150px;',
|
109 |
),
|
110 |
array(
|
111 |
-
'title' => __( '
|
112 |
'desc_tip' => __( 'Priority for all module\'s price filters. Set to zero to use default priority.' ),
|
113 |
'id' => 'wcj_multicurrency_advanced_price_hooks_priority',
|
114 |
'default' => 0,
|
@@ -116,7 +148,7 @@ $settings = array(
|
|
116 |
),
|
117 |
array(
|
118 |
'type' => 'sectionend',
|
119 |
-
'id' => '
|
120 |
),
|
121 |
array(
|
122 |
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
2 |
/**
|
3 |
* Booster for WooCommerce - Settings - Multicurrency (Currency Switcher)
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @since 2.8.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
* @todo "pretty prices"
|
99 |
'class' => 'widefat',
|
100 |
),
|
101 |
array(
|
102 |
+
'type' => 'sectionend',
|
103 |
+
'id' => 'wcj_multicurrency_options',
|
104 |
+
),
|
105 |
+
array(
|
106 |
+
'title' => __( 'Compatibility', 'woocommerce-jetpack' ),
|
107 |
+
'type' => 'title',
|
108 |
+
'id' => 'wcj_multicurrency_compatibility',
|
109 |
+
),
|
110 |
+
array(
|
111 |
+
'title' => __( 'WooCommerce Smart Coupons', 'woocommerce-jetpack' ),
|
112 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
113 |
+
'id' => 'wcj_multicurrency_compatibility_wc_smart_coupons',
|
114 |
+
'default' => 'yes',
|
115 |
+
'type' => 'checkbox',
|
116 |
+
),
|
117 |
+
array(
|
118 |
+
'title' => __( 'WooCommerce Price Filter', 'woocommerce-jetpack' ),
|
119 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
120 |
+
'id' => 'wcj_multicurrency_compatibility_wc_price_filter',
|
121 |
+
'default' => 'yes',
|
122 |
+
'type' => 'checkbox',
|
123 |
+
),
|
124 |
+
array(
|
125 |
+
'type' => 'sectionend',
|
126 |
+
'id' => 'wcj_multicurrency_compatibility',
|
127 |
+
),
|
128 |
+
array(
|
129 |
+
'title' => __( 'Advanced', 'woocommerce-jetpack' ),
|
130 |
+
'type' => 'title',
|
131 |
+
'id' => 'wcj_multicurrency_adv',
|
132 |
+
),
|
133 |
+
array(
|
134 |
+
'title' => __( 'Additional Price Filters', 'woocommerce-jetpack' ),
|
135 |
'desc_tip' => __( 'Add additional price filters here. One per line. Leave blank if not sure.' ),
|
136 |
'desc' => sprintf( __( 'E.g.: %s' ), '<code>' . 'woocommerce_subscriptions_product_price' . '</code>' . ', ' .'<code>' . 'woocommerce_get_price' . '</code>' . '.' ),
|
137 |
'id' => 'wcj_multicurrency_switcher_additional_price_filters',
|
140 |
'css' => 'min-width:300px;height:150px;',
|
141 |
),
|
142 |
array(
|
143 |
+
'title' => __( 'Price Filters Priority', 'woocommerce-jetpack' ),
|
144 |
'desc_tip' => __( 'Priority for all module\'s price filters. Set to zero to use default priority.' ),
|
145 |
'id' => 'wcj_multicurrency_advanced_price_hooks_priority',
|
146 |
'default' => 0,
|
148 |
),
|
149 |
array(
|
150 |
'type' => 'sectionend',
|
151 |
+
'id' => 'wcj_multicurrency_options_adv',
|
152 |
),
|
153 |
array(
|
154 |
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
includes/settings/wcj-settings-pdf-invoicing-advanced.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Booster for WooCommerce - Settings - PDF Invoicing - Advanced
|
4 |
*
|
5 |
-
* @version 3.
|
6 |
* @since 3.3.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
* @todo (maybe) create "Tools (Options)" submodule
|
@@ -86,6 +86,13 @@ return array(
|
|
86 |
'default' => 'no',
|
87 |
'type' => 'checkbox',
|
88 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
array(
|
90 |
'type' => 'sectionend',
|
91 |
'id' => 'wcj_pdf_invoicing_advanced_options',
|
2 |
/**
|
3 |
* Booster for WooCommerce - Settings - PDF Invoicing - Advanced
|
4 |
*
|
5 |
+
* @version 4.3.1
|
6 |
* @since 3.3.0
|
7 |
* @author Algoritmika Ltd.
|
8 |
* @todo (maybe) create "Tools (Options)" submodule
|
86 |
'default' => 'no',
|
87 |
'type' => 'checkbox',
|
88 |
),
|
89 |
+
array(
|
90 |
+
'title' => __( 'Prevent Output Buffer', 'woocommerce-jetpack' ),
|
91 |
+
'desc' => __( 'Returns the content of output buffering instead of displaying it', 'woocommerce-jetpack' ),
|
92 |
+
'id' => 'wcj_general_advanced_disable_output_buffer',
|
93 |
+
'default' => 'no',
|
94 |
+
'type' => 'checkbox',
|
95 |
+
),
|
96 |
array(
|
97 |
'type' => 'sectionend',
|
98 |
'id' => 'wcj_pdf_invoicing_advanced_options',
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: algoritmika, anbinder, debugeris, karzin
|
|
3 |
Tags: woocommerce, booster for woocommerce, woocommerce jetpack
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.1
|
6 |
-
Stable tag: 4.3.
|
7 |
License: GNU General Public License v3.0
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -193,6 +193,16 @@ You can see the differences between versions in this [table](https://booster.io/
|
|
193 |
|
194 |
== Changelog ==
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
= 4.3.0 - 16/04/2019 =
|
197 |
* Fix - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Fix PHP warning about headers already sent.
|
198 |
* Fix - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Improve compatibility with Add-ons plugin.
|
3 |
Tags: woocommerce, booster for woocommerce, woocommerce jetpack
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.1
|
6 |
+
Stable tag: 4.3.1
|
7 |
License: GNU General Public License v3.0
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
193 |
|
194 |
== Changelog ==
|
195 |
|
196 |
+
= 4.3.1 - 25/04/2019 =
|
197 |
+
* Fix - SHIPPING & ORDERS - Order Quantities - Decimal Quantities - `init` hook priority lowered. This fixes the issue with "PDF Invoicing & Packing Slips" module not displaying decimal quantities.
|
198 |
+
* Fix - PDF INVOICING & PACKING SLIPS - Fix "failed to delete buffer" warning when generating pdf.
|
199 |
+
* Dev - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Create new option to add compatibility with Smart Coupons plugin.
|
200 |
+
* Dev - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Create new option to add compatibility with WooCommerce Price Filter widget.
|
201 |
+
* Dev - PRICES & CURRENCIES - Multicurrency Product Base Price - Add option to make module compatible with "Price Filter" widget.
|
202 |
+
* Dev - SHIPPING & ORDERS - Order Quantities - Decimal Quantities - Setting float number `pattern` for quantity input.
|
203 |
+
* Dev - SHIPPING & ORDERS - Order Quantities - Module renamed from "Order Min/Max Quantities" and description updated.
|
204 |
+
* Dev - PDF INVOICING & PACKING SLIPS - Create new option on advanced settings to manage output buffer.
|
205 |
+
|
206 |
= 4.3.0 - 16/04/2019 =
|
207 |
* Fix - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Fix PHP warning about headers already sent.
|
208 |
* Fix - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Improve compatibility with Add-ons plugin.
|
woocommerce-jetpack.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
Plugin Name: Booster for WooCommerce
|
4 |
Plugin URI: https://booster.io
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
|
6 |
-
Version: 4.3.
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: https://booster.io
|
9 |
Text Domain: woocommerce-jetpack
|
10 |
Domain Path: /langs
|
11 |
Copyright: © 2019 Algoritmika Ltd.
|
12 |
-
WC tested up to: 3.
|
13 |
License: GNU General Public License v3.0
|
14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
*/
|
@@ -57,7 +57,7 @@ final class WC_Jetpack {
|
|
57 |
* @var string
|
58 |
* @since 2.4.7
|
59 |
*/
|
60 |
-
public $version = '4.3.
|
61 |
|
62 |
/**
|
63 |
* @var WC_Jetpack The single instance of the class
|
3 |
Plugin Name: Booster for WooCommerce
|
4 |
Plugin URI: https://booster.io
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
|
6 |
+
Version: 4.3.1
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: https://booster.io
|
9 |
Text Domain: woocommerce-jetpack
|
10 |
Domain Path: /langs
|
11 |
Copyright: © 2019 Algoritmika Ltd.
|
12 |
+
WC tested up to: 3.6
|
13 |
License: GNU General Public License v3.0
|
14 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
15 |
*/
|
57 |
* @var string
|
58 |
* @since 2.4.7
|
59 |
*/
|
60 |
+
public $version = '4.3.1';
|
61 |
|
62 |
/**
|
63 |
* @var WC_Jetpack The single instance of the class
|