Version Description
- 04/05/2016 =
- Dev - "Booster - Country Switcher" widget added.
- Dev - Currency reports added to Multicurrency and Gateways Currency modules.
- Dev -
WCJ_Module
-create_meta_box
-select
type added. - Dev -
WCJ_Module
-create_meta_box
now takes option default value if no post meta is set. - Dev -
wcj_product_id_for_shortcode
added to products shortcodes and to Custom Price Labels module. - Fix - Admin module dashboard - Version display fixed.
- Dev - Documentation link and button link modified according to Google URL standards.
- Dev - Shortcodes - General -
[wcj_wholesale_price_table]
shortcode added. - Fix - Shortcodes - Orders -
[wcj_order_items_table]
-item_key
column -maybe_unserialize
added (this fixes displaying file type product input fields). - Dev - Shortcodes - Orders -
[wcj_order_total_fees_tax]
shortcode added. - Dev - Shortcodes - Orders -
[wcj_order_total_fees_incl_tax]
shortcode added. - Dev - Shortcodes - Orders -
[wcj_order_custom_field]
shortcode added. - Fix - Shortcodes - Products -
[wcj_product_wholesale_price_table]
- Columns styles fixed (now works for more than three levels). - Fix - Shortcodes - Products -
[wcj_product_wholesale_price_table]
- Fix for variable products with same min and max prices. - Dev - Shortcodes - Products -
[wcj_product_wholesale_price_table]
-add_price_row
shortcode parameter added. - Fix - Shortcodes - Products - Fixed for variable products if min and max are equal (in
[wcj_product_price]
shortcode). - Dev - Shortcodes - Products - Now accepting product variation id as
product_id
attribute. - Dev - Shortcodes - Products - Variable products support added to
[wcj_product_price_excluding_tax]
and[wcj_product_price_including_tax]
shortcodes. - Fix - PRICES & CURRENCIES - Multicurrency - Shipping (taxable) calculation fixed.
- Dev - PRICES & CURRENCIES - Multicurrency Product Base Price - Initial module release.
- Dev - PRICES & CURRENCIES - Product Open Pricing (Name Your Price) - Initial module release.
- Fix - PRICES & CURRENCIES - Wholesale Price - Bug with "PayPal Express Checkout" fixed.
- Dev - PRODUCTS - Product Add to Cart - Add to Cart Variable Product - "Display Radio Buttons Instead of Drop Box" option added.
- Dev - PRODUCTS - Product Cost Price - Custom Price Fields options added.
- Dev - PRODUCTS - Product Info V2 - Single product page add to cart hooks added.
- Dev - PRODUCTS - Product Tabs - "Use Visual Editor" option added.
- Dev - PRODUCTS - SKU - In variable products now counting all variations instead of only available.
- Dev - CART & CHECKOUT - Checkout Custom Fields - "Conditional visibility by selected product (in cart)" option added.
- Dev - PAYMENT GATEWAYS - Custom Gateways - "Admin Title Custom Gateway" options added.
- Fix - PAYMENT GATEWAYS - Gateways Currency - Shipping conversion added.
- Dev - SHIPPING & ORDERS - Shipping - "Message on Free Shipping Reached" option added.
- Dev - SHIPPING & ORDERS - Shipping - Custom shipping added.
- Dev - PDF INVOICING & PACKING SLIPS - Styling - Three Thai fonts added.
- Dev - EMAILS & MISC. - General - Advanced Options - "Disable Saving PDFs in PHP directory for temporary files" option added.
- Dev - EMAILS & MISC. - General - "Export Customers" tool added.
- Dev - EMAILS & MISC. - General - "Export Customers" tool renamed to "Export Customers from Orders".
- Dev - EMAILS & MISC. - General - "Export Orders" tool added.
- Dev - EMAILS & MISC. - Reports - Monthly Sales -
set_time_limit
increased.show_rates
added. - Dev - EMAILS & MISC. - Reports - Monthly Sales - "Average / Day" row added.
- Fix - EMAILS & MISC. - Emails - Custom Emails - Custom statuses added to custom emails actions.
- Dev - EMAILS & MISC. - Emails - Custom Emails - Shortcodes can now be used in templates.
- Dev - EMAILS & MISC. - Emails - Custom Emails - "Admin Title Custom Email" options added.
- Tweak - PRICES & CURRENCIES - Currencies - Documentation link added.
- Tweak - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Documentation link added. "Currency Switcher" added to the module name.
- Tweak - PRICES & CURRENCIES - Prices and Currencies by Country - Documentation link added. Reset button added. "Countries Selection" default set to "Chosen select".
- Tweak - PRICES & CURRENCIES - Wholesale Price - Documentation link added.
- Tweak - BUTTON & PRICE LABELS - Add to Cart Labels - Metabox title renamed.
- Tweak - BUTTON & PRICE LABELS - Custom Price Labels - Metabox title renamed.
- Tweak - BUTTON & PRICE LABELS - More Button Labels - Documentation link added. Reset button added.
- Tweak - PRODUCTS - Crowdfunding - Documentation link added.
- Tweak - PRODUCTS - Product Add to Cart - Documentation link added. Reset button added.
- Tweak - PRODUCTS - Product Images - Documentation link added. Reset button added.
- Tweak - PRODUCTS - Product Input Fields - Documentation link added.
- Tweak - PRODUCTS - Product Input Fields - Metabox title renamed.
- Tweak - PRODUCTS - Product Listings - Documentation link added.
- Tweak - PRODUCTS - Product Tabs - Documentation link added.
- Tweak - PRODUCTS - Related Products - Documentation link added. Reset button added.
- Tweak - PRODUCTS - SKU - Documentation link added.
- Tweak - PRODUCTS - Sorting - Documentation link added. Reset button added.
- Tweak - CART & CHECKOUT - Checkout Files Upload - Documentation link added.
- Tweak - PAYMENT GATEWAYS - Custom Gateways - Documentation link added. Reset button added.
- Tweak - SHIPPING & ORDERS - Address Formats - Documentation link added. Reset button added.
- Tweak - SHIPPING & ORDERS - Shipping - Documentation link added.
Download this release
Release Info
Developer | algoritmika |
Plugin | Booster for WooCommerce |
Version | 2.4.8 |
Comparing to | |
See all releases |
Code changes from version 2.4.7 to 2.4.8
- includes/add-to-cart/class-wcj-add-to-cart-per-product.php +4 -2
- includes/admin/class-wc-settings-jetpack.php +8 -6
- includes/admin/wcj-modules-cats.php +3 -1
- includes/class-wcj-address-formats.php +7 -2
- includes/class-wcj-checkout-custom-fields.php +29 -5
- includes/class-wcj-checkout-files-upload.php +3 -2
- includes/class-wcj-crowdfunding.php +4 -1
- includes/class-wcj-currencies.php +3 -2
- includes/class-wcj-currency-exchange-rates.php +10 -2
- includes/class-wcj-emails.php +43 -6
- includes/class-wcj-general.php +181 -16
- includes/class-wcj-more-button-labels.php +35 -34
- includes/class-wcj-multicurrency-product-base-price.php +276 -0
- includes/class-wcj-multicurrency.php +15 -5
- includes/class-wcj-payment-gateways-currency.php +38 -3
- includes/class-wcj-payment-gateways.php +30 -10
- includes/class-wcj-price-by-country.php +7 -6
- includes/class-wcj-price-labels.php +21 -6
- includes/class-wcj-product-add-to-cart.php +108 -54
- includes/class-wcj-product-custom-info.php +6 -2
- includes/class-wcj-product-images.php +5 -4
- includes/class-wcj-product-input-fields.php +3 -2
- includes/class-wcj-product-listings.php +163 -165
- includes/class-wcj-product-open-pricing.php +394 -0
- includes/class-wcj-product-tabs.php +54 -19
- includes/class-wcj-purchase-data.php +84 -10
- includes/class-wcj-related-products.php +30 -38
- includes/class-wcj-shipping.php +60 -31
- includes/class-wcj-sku.php +20 -4
- includes/class-wcj-sorting.php +15 -33
- includes/class-wcj-wholesale-price.php +14 -5
- includes/class-wcj-wpml.php +3 -2
- includes/classes/class-wcj-module.php +20 -7
- includes/classes/class-wcj-pdf-invoice.php +27 -16
- includes/classes/class-wcj-product.php +13 -2
- includes/emails/class-wc-email-wcj-custom.php +13 -9
- includes/exchange-rates/class-wcj-exchange-rates-crons.php +12 -2
- includes/exchange-rates/class-wcj-exchange-rates.php +5 -3
- includes/functions/wcj-functions.php +53 -3
- includes/gateways/class-wc-gateway-wcj-custom.php +3 -3
- includes/input-fields/class-wcj-product-input-fields-global.php +24 -35
- includes/input-fields/class-wcj-product-input-fields-per-product.php +4 -2
- includes/js/wcj-variations-frontend.js +26 -0
- includes/lib/tcpdf_min/fonts/angsanaupc.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupc.php +48 -0
- includes/lib/tcpdf_min/fonts/angsanaupc.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupcb.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupcb.php +48 -0
- includes/lib/tcpdf_min/fonts/angsanaupcb.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupcbi.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupcbi.php +37 -0
- includes/lib/tcpdf_min/fonts/angsanaupcbi.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupci.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/angsanaupci.php +37 -0
- includes/lib/tcpdf_min/fonts/angsanaupci.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupc.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupc.php +48 -0
- includes/lib/tcpdf_min/fonts/cordiaupc.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupcb.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupcb.php +48 -0
- includes/lib/tcpdf_min/fonts/cordiaupcb.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupcbi.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupcbi.php +37 -0
- includes/lib/tcpdf_min/fonts/cordiaupcbi.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupci.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/cordiaupci.php +37 -0
- includes/lib/tcpdf_min/fonts/cordiaupci.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabun.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabun.php +65 -0
- includes/lib/tcpdf_min/fonts/thsarabun.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabunb.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabunb.php +65 -0
- includes/lib/tcpdf_min/fonts/thsarabunb.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabunbi.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabunbi.php +65 -0
- includes/lib/tcpdf_min/fonts/thsarabunbi.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabuni.ctg.z +0 -0
- includes/lib/tcpdf_min/fonts/thsarabuni.php +65 -0
- includes/lib/tcpdf_min/fonts/thsarabuni.z +0 -0
- includes/pdf-invoices/class-wcj-pdf-invoicing-report-tool.php +12 -8
- includes/pdf-invoices/settings/class-wcj-pdf-invoicing-emails.php +6 -2
- includes/pdf-invoices/settings/class-wcj-pdf-invoicing-styling.php +5 -2
- includes/price-by-country/class-wcj-price-by-country-reports.php +0 -103
- includes/reports/class-wcj-currency-reports.php +125 -0
- includes/reports/wcj-class-reports-monthly-sales.php +18 -8
- includes/shipping/class-wc-shipping-wcj-custom.php +142 -84
- includes/shortcodes/class-wcj-general-shortcodes.php +41 -13
- includes/shortcodes/class-wcj-order-items-shortcodes.php +12 -3
- includes/shortcodes/class-wcj-orders-shortcodes.php +57 -2
- includes/shortcodes/class-wcj-products-shortcodes.php +86 -29
- includes/templates/wcj-add-to-cart-variable.php +71 -0
- includes/widgets/class-wcj-widget-country-switcher.php +113 -0
- readme.txt +71 -4
- woocommerce-jetpack.php +8 -5
includes/add-to-cart/class-wcj-add-to-cart-per-product.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Add to Cart per Product class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -72,9 +72,11 @@ class WCJ_Add_To_Cart_Per_Product {
|
|
72 |
|
73 |
/**
|
74 |
* add_custom_add_to_cart_meta_box.
|
|
|
|
|
75 |
*/
|
76 |
public function add_custom_add_to_cart_meta_box() {
|
77 |
-
add_meta_box( 'wc-jetpack-custom-add-to-cart', __( '
|
78 |
}
|
79 |
|
80 |
/**
|
4 |
*
|
5 |
* The WooCommerce Jetpack Add to Cart per Product class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
72 |
|
73 |
/**
|
74 |
* add_custom_add_to_cart_meta_box.
|
75 |
+
*
|
76 |
+
* @version 2.4.8
|
77 |
*/
|
78 |
public function add_custom_add_to_cart_meta_box() {
|
79 |
+
add_meta_box( 'wc-jetpack-custom-add-to-cart', __( 'Booster: Custom Add to Cart', 'woocommerce-jetpack' ), array( $this, 'create_custom_add_to_cart_meta_box' ), 'product', 'normal', 'high' );
|
80 |
}
|
81 |
|
82 |
/**
|
includes/admin/class-wc-settings-jetpack.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Settings class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 1.0.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -319,6 +319,8 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
|
|
319 |
|
320 |
/**
|
321 |
* output_dashboard.
|
|
|
|
|
322 |
*/
|
323 |
function output_dashboard( $current_section ) {
|
324 |
$the_settings = $this->get_settings();
|
@@ -346,6 +348,8 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
|
|
346 |
$this->output_dashboard_modules( $the_settings, 'active_modules_only' );
|
347 |
}
|
348 |
|
|
|
|
|
349 |
$readme_html .= '</pre>';
|
350 |
if ( isset( $_GET['woojetpack_readme'] ) ) echo $readme_html;
|
351 |
}
|
@@ -360,7 +364,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
|
|
360 |
/**
|
361 |
* output_dashboard_modules.
|
362 |
*
|
363 |
-
* @version 2.4.
|
364 |
*/
|
365 |
function output_dashboard_modules( $settings, $cat_id = '' ) {
|
366 |
$readme_html = '';
|
@@ -415,7 +419,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
|
|
415 |
|
416 |
$html .= '<span class="0"><a href="' . admin_url() . 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=' . $this->get_cat_by_section( $section ) . '§ion=' . $section . '">' . __( 'Settings', 'woocommerce' ) . '</a></span>';
|
417 |
if ( isset( $the_feature['wcj_link'] ) && '' != $the_feature['wcj_link'] ) {
|
418 |
-
$html .= ' | <span class="0"><a href="' . $the_feature['wcj_link'] . '?
|
419 |
}
|
420 |
$html .= '</div>';
|
421 |
$html .= '</td>';
|
@@ -430,9 +434,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
|
|
430 |
}
|
431 |
echo $html;
|
432 |
?></tbody>
|
433 |
-
</table><p style="color:gray;font-size:x-small;font-style:italic;"><?php echo __( 'Total Modules:' ) . ' ' . $total_modules; ?></p
|
434 |
-
<p style="text-align:right;color:gray;font-size:x-small;font-style:italic;"><?php echo __( 'Version:' ) . ' ' . get_option( 'booster_for_woocommerce_version', 'N/A' ); ?></p>
|
435 |
-
<?php
|
436 |
return $readme_html;
|
437 |
}
|
438 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Settings class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 1.0.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
319 |
|
320 |
/**
|
321 |
* output_dashboard.
|
322 |
+
*
|
323 |
+
* @version 2.4.8
|
324 |
*/
|
325 |
function output_dashboard( $current_section ) {
|
326 |
$the_settings = $this->get_settings();
|
348 |
$this->output_dashboard_modules( $the_settings, 'active_modules_only' );
|
349 |
}
|
350 |
|
351 |
+
echo '<p style="text-align:right;color:gray;font-size:x-small;font-style:italic;">' . __( 'Version' ) . ': ' . get_option( 'booster_for_woocommerce_version', 'N/A' ) . '</p>';
|
352 |
+
|
353 |
$readme_html .= '</pre>';
|
354 |
if ( isset( $_GET['woojetpack_readme'] ) ) echo $readme_html;
|
355 |
}
|
364 |
/**
|
365 |
* output_dashboard_modules.
|
366 |
*
|
367 |
+
* @version 2.4.8
|
368 |
*/
|
369 |
function output_dashboard_modules( $settings, $cat_id = '' ) {
|
370 |
$readme_html = '';
|
419 |
|
420 |
$html .= '<span class="0"><a href="' . admin_url() . 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=' . $this->get_cat_by_section( $section ) . '§ion=' . $section . '">' . __( 'Settings', 'woocommerce' ) . '</a></span>';
|
421 |
if ( isset( $the_feature['wcj_link'] ) && '' != $the_feature['wcj_link'] ) {
|
422 |
+
$html .= ' | <span class="0"><a href="' . $the_feature['wcj_link'] . '?utm_source=module_documentation&utm_medium=dashboard_link&utm_campaign=booster_documentation" target="_blank">' . __( 'Documentation', 'woocommerce' ) . '</a></span>';
|
423 |
}
|
424 |
$html .= '</div>';
|
425 |
$html .= '</td>';
|
434 |
}
|
435 |
echo $html;
|
436 |
?></tbody>
|
437 |
+
</table><p style="color:gray;font-size:x-small;font-style:italic;"><?php echo __( 'Total Modules:' ) . ' ' . $total_modules; ?></p><?php
|
|
|
|
|
438 |
return $readme_html;
|
439 |
}
|
440 |
|
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 |
*/
|
@@ -27,10 +27,12 @@ return array(
|
|
27 |
'all_cat_ids' => array(
|
28 |
'price_by_country',
|
29 |
'multicurrency',
|
|
|
30 |
'currency',
|
31 |
'currency_external_products',
|
32 |
'bulk_price_converter',
|
33 |
'wholesale_price',
|
|
|
34 |
'currency_exchange_rates',
|
35 |
),
|
36 |
),
|
4 |
*
|
5 |
* The WooCommerce Modules Array.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
27 |
'all_cat_ids' => array(
|
28 |
'price_by_country',
|
29 |
'multicurrency',
|
30 |
+
'multicurrency_base_price',
|
31 |
'currency',
|
32 |
'currency_external_products',
|
33 |
'bulk_price_converter',
|
34 |
'wholesale_price',
|
35 |
+
'product_open_pricing',
|
36 |
'currency_exchange_rates',
|
37 |
),
|
38 |
),
|
includes/class-wcj-address-formats.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Address Formats class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -17,12 +17,15 @@ class WCJ_Address_Formats extends WCJ_Module {
|
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
|
|
|
|
20 |
*/
|
21 |
function __construct() {
|
22 |
|
23 |
$this->id = 'address_formats';
|
24 |
$this->short_desc = __( 'Address Formats', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'Set address format in WooCommerce orders on per country basis. Force base country display.', 'woocommerce-jetpack' );
|
|
|
26 |
parent::__construct();
|
27 |
|
28 |
if ( $this->is_enabled() ) {
|
@@ -115,6 +118,8 @@ class WCJ_Address_Formats extends WCJ_Module {
|
|
115 |
|
116 |
/**
|
117 |
* get_settings.
|
|
|
|
|
118 |
*/
|
119 |
function get_settings() {
|
120 |
|
@@ -162,7 +167,7 @@ class WCJ_Address_Formats extends WCJ_Module {
|
|
162 |
'id' => 'wcj_address_formats_country_options'
|
163 |
);
|
164 |
|
165 |
-
return $this->
|
166 |
}
|
167 |
}
|
168 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Address Formats class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'address_formats';
|
26 |
$this->short_desc = __( 'Address Formats', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Set address format in WooCommerce orders on per country basis. Force base country display.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-address-formats/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
118 |
|
119 |
/**
|
120 |
* get_settings.
|
121 |
+
*
|
122 |
+
* @version 2.4.8
|
123 |
*/
|
124 |
function get_settings() {
|
125 |
|
167 |
'id' => 'wcj_address_formats_country_options'
|
168 |
);
|
169 |
|
170 |
+
return $this->add_standard_settings( $settings );
|
171 |
}
|
172 |
}
|
173 |
|
includes/class-wcj-checkout-custom-fields.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Checkout Custom Fields class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -455,7 +455,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
455 |
/**
|
456 |
* add_custom_checkout_fields.
|
457 |
*
|
458 |
-
* @version 2.4.
|
459 |
*/
|
460 |
public function add_custom_checkout_fields( $fields ) {
|
461 |
|
@@ -464,7 +464,6 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
464 |
if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
|
465 |
|
466 |
$categories_in = get_option( 'wcj_checkout_custom_field_categories_in_' . $i );
|
467 |
-
|
468 |
if ( ! empty( $categories_in ) ) {
|
469 |
$do_skip = true;
|
470 |
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
|
@@ -481,6 +480,18 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
481 |
if ( $do_skip ) continue;
|
482 |
}
|
483 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
$the_type = get_option( 'wcj_checkout_custom_field_type_' . $i );
|
485 |
$custom_attributes = array();
|
486 |
if ( 'datepicker' === $the_type || 'weekpicker' === $the_type || 'timepicker' === $the_type || 'number' === $the_type ) {
|
@@ -548,7 +559,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
548 |
/**
|
549 |
* get_settings.
|
550 |
*
|
551 |
-
* @version 2.4.
|
552 |
*/
|
553 |
public function get_settings() {
|
554 |
|
@@ -611,6 +622,8 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
611 |
}
|
612 |
}
|
613 |
|
|
|
|
|
614 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
|
615 |
$settings = array_merge( $settings,
|
616 |
array(
|
@@ -813,7 +826,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
813 |
array(
|
814 |
'title' => '',
|
815 |
'desc' => __( 'categories', 'woocommerce-jetpack' ),
|
816 |
-
'desc_tip' => __( '', 'woocommerce-jetpack' ),
|
817 |
'id' => 'wcj_checkout_custom_field_categories_in_' . $i,
|
818 |
'default' => '',
|
819 |
'type' => 'multiselect',
|
@@ -821,6 +834,17 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
|
|
821 |
'css' => 'min-width:300px;width:50%;',
|
822 |
'options' => $product_cats,
|
823 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
824 |
)
|
825 |
);
|
826 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Checkout Custom Fields class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
455 |
/**
|
456 |
* add_custom_checkout_fields.
|
457 |
*
|
458 |
+
* @version 2.4.8
|
459 |
*/
|
460 |
public function add_custom_checkout_fields( $fields ) {
|
461 |
|
464 |
if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
|
465 |
|
466 |
$categories_in = get_option( 'wcj_checkout_custom_field_categories_in_' . $i );
|
|
|
467 |
if ( ! empty( $categories_in ) ) {
|
468 |
$do_skip = true;
|
469 |
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
|
480 |
if ( $do_skip ) continue;
|
481 |
}
|
482 |
|
483 |
+
$products_in = get_option( 'wcj_checkout_custom_field_products_in_' . $i );
|
484 |
+
if ( ! empty( $products_in ) ) {
|
485 |
+
$do_skip = true;
|
486 |
+
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
|
487 |
+
if ( in_array( $values['product_id'], $products_in ) ) {
|
488 |
+
$do_skip = false;
|
489 |
+
break;
|
490 |
+
}
|
491 |
+
}
|
492 |
+
if ( $do_skip ) continue;
|
493 |
+
}
|
494 |
+
|
495 |
$the_type = get_option( 'wcj_checkout_custom_field_type_' . $i );
|
496 |
$custom_attributes = array();
|
497 |
if ( 'datepicker' === $the_type || 'weekpicker' === $the_type || 'timepicker' === $the_type || 'number' === $the_type ) {
|
559 |
/**
|
560 |
* get_settings.
|
561 |
*
|
562 |
+
* @version 2.4.8
|
563 |
*/
|
564 |
public function get_settings() {
|
565 |
|
622 |
}
|
623 |
}
|
624 |
|
625 |
+
$products_options = apply_filters( 'wcj_get_products_filter', array() );
|
626 |
+
|
627 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
|
628 |
$settings = array_merge( $settings,
|
629 |
array(
|
826 |
array(
|
827 |
'title' => '',
|
828 |
'desc' => __( 'categories', 'woocommerce-jetpack' ),
|
829 |
+
'desc_tip' => __( 'Show this field only if there is a product of selected category in cart.', 'woocommerce-jetpack' ),
|
830 |
'id' => 'wcj_checkout_custom_field_categories_in_' . $i,
|
831 |
'default' => '',
|
832 |
'type' => 'multiselect',
|
834 |
'css' => 'min-width:300px;width:50%;',
|
835 |
'options' => $product_cats,
|
836 |
),
|
837 |
+
array(
|
838 |
+
'title' => '',
|
839 |
+
'desc' => __( 'products', 'woocommerce-jetpack' ),
|
840 |
+
'desc_tip' => __( 'Show this field only if there is a selected product in cart.', 'woocommerce-jetpack' ),
|
841 |
+
'id' => 'wcj_checkout_custom_field_products_in_' . $i,
|
842 |
+
'default' => '',
|
843 |
+
'type' => 'multiselect',
|
844 |
+
'class' => 'chosen_select',
|
845 |
+
'css' => 'min-width:300px;width:50%;',
|
846 |
+
'options' => $products_options,
|
847 |
+
),
|
848 |
)
|
849 |
);
|
850 |
}
|
includes/class-wcj-checkout-files-upload.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Checkout Files Upload class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.4.5
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -18,13 +18,14 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.4.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'checkout_files_upload';
|
26 |
$this->short_desc = __( 'Checkout Files Upload', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Let customers upload files on WooCommerce checkout.', 'woocommerce-jetpack' );
|
|
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
4 |
*
|
5 |
* The WooCommerce Jetpack Checkout Files Upload class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.4.5
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'checkout_files_upload';
|
26 |
$this->short_desc = __( 'Checkout Files Upload', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Let customers upload files on WooCommerce checkout.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-checkout-files-upload/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
includes/class-wcj-crowdfunding.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Crowdfunding class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @since 2.2.6
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -17,12 +17,15 @@ class WCJ_Crowdfunding extends WCJ_Module {
|
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
|
|
|
|
20 |
*/
|
21 |
function __construct() {
|
22 |
|
23 |
$this->id = 'crowdfunding';
|
24 |
$this->short_desc = __( 'Crowdfunding', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'Add crowdfunding products to WooCommerce.', 'woocommerce-jetpack' );
|
|
|
26 |
parent::__construct();
|
27 |
|
28 |
if ( $this->is_enabled() ) {
|
4 |
*
|
5 |
* The WooCommerce Jetpack Crowdfunding class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.6
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'crowdfunding';
|
26 |
$this->short_desc = __( 'Crowdfunding', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Add crowdfunding products to WooCommerce.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-crowdfunding/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
includes/class-wcj-currencies.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack currencies class stores currencies data.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,13 +17,14 @@ class WCJ_Currencies extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
24 |
$this->id = 'currency';
|
25 |
$this->short_desc = __( 'Currencies', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Add all world currencies to your WooCommerce store; change currency symbol.', 'woocommerce-jetpack' );
|
|
|
27 |
parent::__construct();
|
28 |
|
29 |
if ( $this->is_enabled() ) {
|
4 |
*
|
5 |
* The WooCommerce Jetpack currencies class stores currencies data.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
24 |
$this->id = 'currency';
|
25 |
$this->short_desc = __( 'Currencies', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Add all world currencies to your WooCommerce store; change currency symbol.', 'woocommerce-jetpack' );
|
27 |
+
$this->link = 'http://booster.io/features/woocommerce-all-currencies/';
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
includes/class-wcj-currency-exchange-rates.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Currency Exchange Rates class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -81,7 +81,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
|
|
81 |
/**
|
82 |
* add_currency_exchange_rates_settings.
|
83 |
*
|
84 |
-
* @version 2.4.
|
85 |
*/
|
86 |
function add_currency_exchange_rates_settings() {
|
87 |
|
@@ -127,6 +127,14 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
|
|
127 |
}
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
131 |
// Currency Pairs - Gateway Currency
|
132 |
global $woocommerce;
|
4 |
*
|
5 |
* The WooCommerce Jetpack Currency Exchange Rates class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
81 |
/**
|
82 |
* add_currency_exchange_rates_settings.
|
83 |
*
|
84 |
+
* @version 2.4.8
|
85 |
*/
|
86 |
function add_currency_exchange_rates_settings() {
|
87 |
|
127 |
}
|
128 |
}
|
129 |
|
130 |
+
if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
|
131 |
+
// Currency Pairs - Multicurrency Product Base Price
|
132 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
|
133 |
+
$currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
134 |
+
$settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
139 |
// Currency Pairs - Gateway Currency
|
140 |
global $woocommerce;
|
includes/class-wcj-emails.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Emails class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -42,14 +42,41 @@ class WCJ_Emails extends WCJ_Module {
|
|
42 |
}
|
43 |
}
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
/**
|
46 |
* add_custom_woocommerce_email_actions.
|
47 |
*
|
48 |
-
* @version 2.4.
|
49 |
* @since 2.4.5
|
50 |
*/
|
51 |
function add_custom_woocommerce_email_actions( $email_actions ) {
|
|
|
52 |
$email_actions[] = 'woocommerce_new_order';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
return $email_actions;
|
54 |
}
|
55 |
|
@@ -152,7 +179,7 @@ class WCJ_Emails extends WCJ_Module {
|
|
152 |
/**
|
153 |
* get_settings.
|
154 |
*
|
155 |
-
* @version 2.
|
156 |
*/
|
157 |
function get_settings() {
|
158 |
$settings = array(
|
@@ -168,14 +195,24 @@ class WCJ_Emails extends WCJ_Module {
|
|
168 |
'default' => 1,
|
169 |
'type' => 'custom_number',
|
170 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
171 |
-
'custom_attributes'
|
172 |
-
=> apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
173 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
array(
|
175 |
'type' => 'sectionend',
|
176 |
'id' => 'wcj_emails_custom_emails_options',
|
177 |
),
|
178 |
-
);
|
179 |
$settings = array_merge( $settings, $this->get_emails_forwarding_settings() );
|
180 |
return $this->add_standard_settings( $settings );
|
181 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Emails class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
42 |
}
|
43 |
}
|
44 |
|
45 |
+
/**
|
46 |
+
* get_order_statuses.
|
47 |
+
*
|
48 |
+
* @version 2.4.8
|
49 |
+
* @since 2.4.8
|
50 |
+
*/
|
51 |
+
function get_order_statuses() {
|
52 |
+
$result = array();
|
53 |
+
$statuses = function_exists( 'wc_get_order_statuses' ) ? wc_get_order_statuses() : array();
|
54 |
+
foreach( $statuses as $status => $status_name ) {
|
55 |
+
$result[ substr( $status, 3 ) ] = $statuses[ $status ];
|
56 |
+
}
|
57 |
+
return $result;
|
58 |
+
}
|
59 |
+
|
60 |
/**
|
61 |
* add_custom_woocommerce_email_actions.
|
62 |
*
|
63 |
+
* @version 2.4.8
|
64 |
* @since 2.4.5
|
65 |
*/
|
66 |
function add_custom_woocommerce_email_actions( $email_actions ) {
|
67 |
+
|
68 |
$email_actions[] = 'woocommerce_new_order';
|
69 |
+
|
70 |
+
$order_statuses = $this->get_order_statuses();
|
71 |
+
foreach ( $order_statuses as $slug => $name ) {
|
72 |
+
$email_actions[] = 'woocommerce_order_status_' . $slug;
|
73 |
+
foreach ( $order_statuses as $slug2 => $name2 ) {
|
74 |
+
if ( $slug != $slug2 ) {
|
75 |
+
$email_actions[] = 'woocommerce_order_status_' . $slug . '_to_' . $slug2;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
return $email_actions;
|
81 |
}
|
82 |
|
179 |
/**
|
180 |
* get_settings.
|
181 |
*
|
182 |
+
* @version 2.4.8
|
183 |
*/
|
184 |
function get_settings() {
|
185 |
$settings = array(
|
195 |
'default' => 1,
|
196 |
'type' => 'custom_number',
|
197 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
198 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
|
|
199 |
),
|
200 |
+
);
|
201 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) );
|
202 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
203 |
+
$settings [] = array(
|
204 |
+
'title' => __( 'Admin Title Custom Email', 'woocommerce-jetpack' ) . ' #' . $i,
|
205 |
+
'id' => 'wcj_emails_custom_emails_admin_title_' . $i,
|
206 |
+
'default' => __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $i,
|
207 |
+
'type' => 'text',
|
208 |
+
);
|
209 |
+
}
|
210 |
+
$settings = array_merge( $settings, array(
|
211 |
array(
|
212 |
'type' => 'sectionend',
|
213 |
'id' => 'wcj_emails_custom_emails_options',
|
214 |
),
|
215 |
+
) );
|
216 |
$settings = array_merge( $settings, $this->get_emails_forwarding_settings() );
|
217 |
return $this->add_standard_settings( $settings );
|
218 |
}
|
includes/class-wcj-general.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack General class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_General extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -33,8 +33,16 @@ class WCJ_General extends WCJ_Module {
|
|
33 |
),
|
34 |
'export_customers' => array(
|
35 |
'title' => __( 'Export Customers', 'woocommerce-jetpack' ),
|
|
|
|
|
|
|
|
|
36 |
'desc' => __( 'Export Customers (extracted from orders).', 'woocommerce-jetpack' ),
|
37 |
),
|
|
|
|
|
|
|
|
|
38 |
) );
|
39 |
|
40 |
if ( $this->is_enabled() ) {
|
@@ -53,6 +61,8 @@ class WCJ_General extends WCJ_Module {
|
|
53 |
if ( '' != get_option( 'wcj_general_custom_admin_css' ) ) {
|
54 |
add_action( 'admin_head', array( $this, 'hook_custom_admin_css' ) );
|
55 |
}
|
|
|
|
|
56 |
}
|
57 |
}
|
58 |
|
@@ -67,21 +77,169 @@ class WCJ_General extends WCJ_Module {
|
|
67 |
return $args;
|
68 |
}
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
/**
|
71 |
* create_export_customers_tool.
|
72 |
*
|
73 |
-
* @version 2.
|
74 |
-
* @since 2.
|
75 |
*/
|
76 |
function create_export_customers_tool() {
|
77 |
-
$
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
$total_customers = 0;
|
86 |
$orders = array();
|
87 |
$offset = 0;
|
@@ -104,15 +262,14 @@ class WCJ_General extends WCJ_Module {
|
|
104 |
$emails_to_skip = array();
|
105 |
if ( ! in_array( $order->billing_email, $emails_to_skip ) ) {
|
106 |
$total_customers++;
|
107 |
-
$
|
108 |
$orders[] = $order->billing_email;
|
109 |
}
|
110 |
}
|
111 |
endwhile;
|
112 |
$offset += $block_size;
|
113 |
}
|
114 |
-
$
|
115 |
-
echo $html;
|
116 |
}
|
117 |
|
118 |
/**
|
@@ -224,7 +381,7 @@ class WCJ_General extends WCJ_Module {
|
|
224 |
/**
|
225 |
* get_settings.
|
226 |
*
|
227 |
-
* @version 2.4.
|
228 |
* @todo add link to Booster's shortcodes list
|
229 |
*/
|
230 |
function get_settings() {
|
@@ -371,6 +528,14 @@ class WCJ_General extends WCJ_Module {
|
|
371 |
'type' => 'checkbox',
|
372 |
),
|
373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
array(
|
375 |
'type' => 'sectionend',
|
376 |
'id' => 'wcj_general_advanced_options',
|
4 |
*
|
5 |
* The WooCommerce Jetpack General class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
33 |
),
|
34 |
'export_customers' => array(
|
35 |
'title' => __( 'Export Customers', 'woocommerce-jetpack' ),
|
36 |
+
'desc' => __( 'Export Customers.', 'woocommerce-jetpack' ),
|
37 |
+
),
|
38 |
+
'export_customers_from_orders' => array(
|
39 |
+
'title' => __( 'Export Customers from Orders', 'woocommerce-jetpack' ),
|
40 |
'desc' => __( 'Export Customers (extracted from orders).', 'woocommerce-jetpack' ),
|
41 |
),
|
42 |
+
'export_orders' => array(
|
43 |
+
'title' => __( 'Export Orders', 'woocommerce-jetpack' ),
|
44 |
+
'desc' => __( 'Export Orders.', 'woocommerce-jetpack' ),
|
45 |
+
),
|
46 |
) );
|
47 |
|
48 |
if ( $this->is_enabled() ) {
|
61 |
if ( '' != get_option( 'wcj_general_custom_admin_css' ) ) {
|
62 |
add_action( 'admin_head', array( $this, 'hook_custom_admin_css' ) );
|
63 |
}
|
64 |
+
|
65 |
+
add_action( 'init', array( $this, 'export_csv' ) );
|
66 |
}
|
67 |
}
|
68 |
|
77 |
return $args;
|
78 |
}
|
79 |
|
80 |
+
/**
|
81 |
+
* export.
|
82 |
+
*
|
83 |
+
* @version 2.4.8
|
84 |
+
* @since 2.4.8
|
85 |
+
*/
|
86 |
+
function export( $tool_id ) {
|
87 |
+
$data = array();
|
88 |
+
switch ( $tool_id ) {
|
89 |
+
case 'customers':
|
90 |
+
$data = $this->export_customers();
|
91 |
+
break;
|
92 |
+
case 'customers_from_orders':
|
93 |
+
$data = $this->export_customers_from_orders();
|
94 |
+
break;
|
95 |
+
case 'orders':
|
96 |
+
$data = $this->export_orders();
|
97 |
+
break;
|
98 |
+
}
|
99 |
+
return $data;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* export_csv.
|
104 |
+
*
|
105 |
+
* @version 2.4.8
|
106 |
+
* @since 2.4.8
|
107 |
+
*/
|
108 |
+
function export_csv() {
|
109 |
+
if ( isset( $_POST['wcj_export'] ) ) {
|
110 |
+
$data = $this->export( $_POST['wcj_export'] );
|
111 |
+
$csv = '';
|
112 |
+
foreach ( $data as $row ) {
|
113 |
+
$csv .= implode( ',', $row ) . PHP_EOL;
|
114 |
+
}
|
115 |
+
header( "Content-Type: application/octet-stream" );
|
116 |
+
header( "Content-Disposition: attachment; filename=" . $_POST['wcj_export'] . ".csv" );
|
117 |
+
header( "Content-Type: application/octet-stream" );
|
118 |
+
header( "Content-Type: application/download" );
|
119 |
+
header( "Content-Description: File Transfer" );
|
120 |
+
header( "Content-Length: " . strlen( $csv ) );
|
121 |
+
echo $csv;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* create_export_tool.
|
127 |
+
*
|
128 |
+
* @version 2.4.8
|
129 |
+
* @since 2.4.8
|
130 |
+
*/
|
131 |
+
function create_export_tool( $tool_id ) {
|
132 |
+
$data = $this->export( $tool_id );
|
133 |
+
echo '<p><form method="post" action="">';
|
134 |
+
echo '<button class="button-primary" type="submit" name="wcj_export" value="' . $tool_id . '">' . __( 'Download CSV', 'woocommerce-jetpack' ) . '</button>';
|
135 |
+
echo '</form></p>';
|
136 |
+
echo wcj_get_table_html( $data, array( 'table_class' => 'widefat striped' ) );
|
137 |
+
}
|
138 |
+
|
139 |
/**
|
140 |
* create_export_customers_tool.
|
141 |
*
|
142 |
+
* @version 2.4.8
|
143 |
+
* @since 2.4.8
|
144 |
*/
|
145 |
function create_export_customers_tool() {
|
146 |
+
$this->create_export_tool( 'customers' );
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* create_export_orders_tool.
|
151 |
+
*
|
152 |
+
* @version 2.4.8
|
153 |
+
* @since 2.4.8
|
154 |
+
*/
|
155 |
+
function create_export_orders_tool() {
|
156 |
+
$this->create_export_tool( 'orders' );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* create_export_customers_from_orders_tool.
|
161 |
+
*
|
162 |
+
* @version 2.4.8
|
163 |
+
* @since 2.3.9
|
164 |
+
*/
|
165 |
+
function create_export_customers_from_orders_tool() {
|
166 |
+
$this->create_export_tool( 'customers_from_orders' );
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* export_customers.
|
171 |
+
*
|
172 |
+
* @version 2.4.8
|
173 |
+
* @since 2.4.8
|
174 |
+
*/
|
175 |
+
function export_customers() {
|
176 |
+
$data = array();
|
177 |
+
$data[] = array(
|
178 |
+
__( 'Customer ID', 'woocommerce-jetpack' ),
|
179 |
+
__( 'Customer Email', 'woocommerce-jetpack' ),
|
180 |
+
__( 'Customer First Name', 'woocommerce-jetpack' ),
|
181 |
+
__( 'Customer Last Name', 'woocommerce-jetpack' ),
|
182 |
+
);
|
183 |
+
$customers = get_users( 'role=customer' );
|
184 |
+
foreach ( $customers as $customer ) {
|
185 |
+
$data[] = array( $customer->ID, $customer->user_email, $customer->first_name, $customer->last_name, );
|
186 |
+
}
|
187 |
+
return $data;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* export_orders.
|
192 |
+
*
|
193 |
+
* @version 2.4.8
|
194 |
+
* @since 2.4.8
|
195 |
+
*/
|
196 |
+
function export_orders() {
|
197 |
+
$data = array();
|
198 |
+
$data[] = array(
|
199 |
+
__( 'Order ID', 'woocommerce-jetpack' ),
|
200 |
+
__( 'Customer Email', 'woocommerce-jetpack' ),
|
201 |
+
__( 'Customer First Name', 'woocommerce-jetpack' ),
|
202 |
+
__( 'Customer Last Name', 'woocommerce-jetpack' ),
|
203 |
+
__( 'Order Date', 'woocommerce-jetpack' ),
|
204 |
+
);
|
205 |
+
$offset = 0;
|
206 |
+
$block_size = 96;
|
207 |
+
while( true ) {
|
208 |
+
$args_orders = array(
|
209 |
+
'post_type' => 'shop_order',
|
210 |
+
'post_status' => 'any',
|
211 |
+
'posts_per_page' => $block_size,
|
212 |
+
'orderby' => 'date',
|
213 |
+
'order' => 'DESC',
|
214 |
+
'offset' => $offset,
|
215 |
+
);
|
216 |
+
$loop_orders = new WP_Query( $args_orders );
|
217 |
+
if ( ! $loop_orders->have_posts() ) break;
|
218 |
+
while ( $loop_orders->have_posts() ) : $loop_orders->the_post();
|
219 |
+
$order_id = $loop_orders->post->ID;
|
220 |
+
$order = wc_get_order( $order_id );
|
221 |
+
$data[] = array( $order_id, $order->billing_email, $order->billing_first_name, $order->billing_last_name, get_the_date( 'Y/m/d' ), );
|
222 |
+
endwhile;
|
223 |
+
$offset += $block_size;
|
224 |
+
}
|
225 |
+
return $data;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* export_customers_from_orders.
|
230 |
+
*
|
231 |
+
* @version 2.4.8
|
232 |
+
* @since 2.4.8
|
233 |
+
*/
|
234 |
+
function export_customers_from_orders() {
|
235 |
+
$data = array();
|
236 |
+
$data[] = array(
|
237 |
+
__( 'Nr.', 'woocommerce-jetpack' ),
|
238 |
+
__( 'Email', 'woocommerce-jetpack' ),
|
239 |
+
__( 'First Name', 'woocommerce-jetpack' ),
|
240 |
+
__( 'Last Name', 'woocommerce-jetpack' ),
|
241 |
+
__( 'Last Order Date', 'woocommerce-jetpack' ),
|
242 |
+
);
|
243 |
$total_customers = 0;
|
244 |
$orders = array();
|
245 |
$offset = 0;
|
262 |
$emails_to_skip = array();
|
263 |
if ( ! in_array( $order->billing_email, $emails_to_skip ) ) {
|
264 |
$total_customers++;
|
265 |
+
$data[] = array( $total_customers, $order->billing_email, $order->billing_first_name, $order->billing_last_name, get_the_date( 'Y/m/d' ), );
|
266 |
$orders[] = $order->billing_email;
|
267 |
}
|
268 |
}
|
269 |
endwhile;
|
270 |
$offset += $block_size;
|
271 |
}
|
272 |
+
return $data;
|
|
|
273 |
}
|
274 |
|
275 |
/**
|
381 |
/**
|
382 |
* get_settings.
|
383 |
*
|
384 |
+
* @version 2.4.8
|
385 |
* @todo add link to Booster's shortcodes list
|
386 |
*/
|
387 |
function get_settings() {
|
528 |
'type' => 'checkbox',
|
529 |
),
|
530 |
|
531 |
+
array(
|
532 |
+
'title' => __( 'Disable Saving PDFs in PHP directory for temporary files', 'woocommerce-jetpack' ),
|
533 |
+
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
534 |
+
'id' => 'wcj_general_advanced_disable_save_sys_temp_dir',
|
535 |
+
'default' => 'no',
|
536 |
+
'type' => 'checkbox',
|
537 |
+
),
|
538 |
+
|
539 |
array(
|
540 |
'type' => 'sectionend',
|
541 |
'id' => 'wcj_general_advanced_options',
|
includes/class-wcj-more-button-labels.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack More Button Labels class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -17,49 +17,21 @@ class WCJ_More_Button_Labels extends WCJ_Module {
|
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
|
|
|
|
20 |
*/
|
21 |
public function __construct() {
|
22 |
|
23 |
$this->id = 'more_button_labels';
|
24 |
$this->short_desc = __( 'More Button Labels', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'Set WooCommerce "Place order" button label.', 'woocommerce-jetpack' );
|
|
|
26 |
parent::__construct();
|
27 |
-
|
28 |
-
//if ( 'yes' === get_option( 'wcj_more_button_labels_enabled' ) ) {
|
29 |
if ( $this->is_enabled() ) {
|
30 |
add_filter( 'woocommerce_order_button_text', array( $this, 'set_order_button_text' ) );
|
31 |
-
|
32 |
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* get_settings.
|
36 |
-
*/
|
37 |
-
function get_settings() {
|
38 |
-
|
39 |
-
$settings = array();
|
40 |
-
|
41 |
-
// Place order (Order now) Button
|
42 |
-
$settings[] = array(
|
43 |
-
'title' => __( 'Place order (Order now) Button', 'woocommerce-jetpack' ),
|
44 |
-
'type' => 'title',
|
45 |
-
'desc' => '',
|
46 |
-
'id' => 'wcj_checkout_place_order_button_options'
|
47 |
-
);
|
48 |
-
$settings[] = array(
|
49 |
-
'title' => __( 'Text', 'woocommerce-jetpack' ),
|
50 |
-
'desc' => __( 'leave blank for WooCommerce default', 'woocommerce-jetpack' ),
|
51 |
-
'desc_tip' => __( 'Button on the checkout page.', 'woocommerce-jetpack' ),
|
52 |
-
'id' => 'wcj_checkout_place_order_button_text',
|
53 |
-
'default' => '',
|
54 |
-
'type' => 'text',
|
55 |
-
);
|
56 |
-
$settings[] = array(
|
57 |
-
'type' => 'sectionend',
|
58 |
-
'id' => 'wcj_checkout_place_order_button_options'
|
59 |
-
);
|
60 |
-
|
61 |
-
return $this->add_enable_module_setting( $settings );
|
62 |
-
}
|
63 |
|
64 |
/**
|
65 |
* set_order_button_text.
|
@@ -68,6 +40,35 @@ class WCJ_More_Button_Labels extends WCJ_Module {
|
|
68 |
$new_text = get_option( 'wcj_checkout_place_order_button_text' );
|
69 |
return ( '' != $new_text ) ? $new_text : $current_text;
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
endif;
|
4 |
*
|
5 |
* The WooCommerce Jetpack More Button Labels class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
|
25 |
$this->id = 'more_button_labels';
|
26 |
$this->short_desc = __( 'More Button Labels', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Set WooCommerce "Place order" button label.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-more-button-labels/';
|
29 |
parent::__construct();
|
30 |
+
|
|
|
31 |
if ( $this->is_enabled() ) {
|
32 |
add_filter( 'woocommerce_order_button_text', array( $this, 'set_order_button_text' ) );
|
33 |
+
}
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
/**
|
37 |
* set_order_button_text.
|
40 |
$new_text = get_option( 'wcj_checkout_place_order_button_text' );
|
41 |
return ( '' != $new_text ) ? $new_text : $current_text;
|
42 |
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* get_settings.
|
46 |
+
*
|
47 |
+
* @version 2.4.8
|
48 |
+
*/
|
49 |
+
function get_settings() {
|
50 |
+
$settings = array(
|
51 |
+
array(
|
52 |
+
'title' => __( 'Place order (Order now) Button', 'woocommerce-jetpack' ),
|
53 |
+
'type' => 'title',
|
54 |
+
'desc' => '',
|
55 |
+
'id' => 'wcj_checkout_place_order_button_options',
|
56 |
+
),
|
57 |
+
array(
|
58 |
+
'title' => __( 'Text', 'woocommerce-jetpack' ),
|
59 |
+
'desc' => __( 'leave blank for WooCommerce default', 'woocommerce-jetpack' ),
|
60 |
+
'desc_tip' => __( 'Button on the checkout page.', 'woocommerce-jetpack' ),
|
61 |
+
'id' => 'wcj_checkout_place_order_button_text',
|
62 |
+
'default' => '',
|
63 |
+
'type' => 'text',
|
64 |
+
),
|
65 |
+
array(
|
66 |
+
'type' => 'sectionend',
|
67 |
+
'id' => 'wcj_checkout_place_order_button_options',
|
68 |
+
),
|
69 |
+
);
|
70 |
+
return $this->add_standard_settings( $settings );
|
71 |
+
}
|
72 |
}
|
73 |
|
74 |
endif;
|
includes/class-wcj-multicurrency-product-base-price.php
ADDED
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Multicurrency Product Base Price
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Multicurrency Product Base Price class.
|
6 |
+
*
|
7 |
+
* @version 2.4.8
|
8 |
+
* @since 2.4.8
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WCJ_Multicurrency_Base_Price' ) ) :
|
15 |
+
|
16 |
+
class WCJ_Multicurrency_Base_Price extends WCJ_Module {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor.
|
20 |
+
*/
|
21 |
+
function __construct() {
|
22 |
+
|
23 |
+
$this->id = 'multicurrency_base_price';
|
24 |
+
$this->short_desc = __( 'Multicurrency Product Base Price', 'woocommerce-jetpack' );
|
25 |
+
$this->desc = __( 'Enter prices for WooCommerce products in different currencies.', 'woocommerce-jetpack' );
|
26 |
+
parent::__construct();
|
27 |
+
|
28 |
+
add_action( 'init', array( $this, 'add_settings_hook' ) );
|
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 |
+
|
35 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol_on_product_edit' ), PHP_INT_MAX, 2 );
|
36 |
+
|
37 |
+
if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
|
38 |
+
// Prices
|
39 |
+
add_filter( 'woocommerce_get_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 10, 2 );
|
40 |
+
add_filter( 'woocommerce_get_sale_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 10, 2 );
|
41 |
+
add_filter( 'woocommerce_get_regular_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 10, 2 );
|
42 |
+
// Variations
|
43 |
+
add_filter( 'woocommerce_variation_prices_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 10, 2 );
|
44 |
+
add_filter( 'woocommerce_variation_prices_regular_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 10, 2 );
|
45 |
+
add_filter( 'woocommerce_variation_prices_sale_price', array( $this, 'change_price_by_currency' ), PHP_INT_MAX - 10, 2 );
|
46 |
+
add_filter( 'woocommerce_get_variation_prices_hash', array( $this, 'get_variation_prices_hash' ), PHP_INT_MAX - 10, 3 );
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( is_admin() ) {
|
50 |
+
include_once( 'reports/class-wcj-currency-reports.php' );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* get_currency_exchange_rate.
|
57 |
+
*/
|
58 |
+
function get_currency_exchange_rate( $currency_code ) {
|
59 |
+
$currency_exchange_rate = 1;
|
60 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
61 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
62 |
+
if ( $currency_code === get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ) {
|
63 |
+
$currency_exchange_rate = get_option( 'wcj_multicurrency_base_price_exchange_rate_' . $i );
|
64 |
+
break;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
return $currency_exchange_rate;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* change_price_by_currency.
|
72 |
+
*/
|
73 |
+
function change_price_by_currency( $price, $_product ) {
|
74 |
+
$multicurrency_base_price_currency = get_post_meta( $_product->id, '_' . 'wcj_multicurrency_base_price_currency', true );
|
75 |
+
if ( '' != $multicurrency_base_price_currency ) {
|
76 |
+
if ( 1 != ( $currency_exchange_rate = $this->get_currency_exchange_rate( $multicurrency_base_price_currency ) ) ) {
|
77 |
+
return $price / $currency_exchange_rate;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
return $price;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* get_variation_prices_hash.
|
85 |
+
*/
|
86 |
+
function get_variation_prices_hash( $price_hash, $_product, $display ) {
|
87 |
+
$price_hash['wcj_base_currency'] = get_post_meta( $_product->id, '_' . 'wcj_multicurrency_base_price_currency', true );
|
88 |
+
return $price_hash;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* get_meta_box_options.
|
93 |
+
*/
|
94 |
+
function get_meta_box_options() {
|
95 |
+
|
96 |
+
/* $main_product_id = get_the_ID();
|
97 |
+
$_product = wc_get_product( $main_product_id );
|
98 |
+
$products = array();
|
99 |
+
if ( $_product->is_type( 'variable' ) ) {
|
100 |
+
$available_variations = $_product->get_available_variations();
|
101 |
+
foreach ( $available_variations as $variation ) {
|
102 |
+
$variation_product = wc_get_product( $variation['variation_id'] );
|
103 |
+
$products[ $variation['variation_id'] ] = ' (' . $variation_product->get_formatted_variation_attributes( true ) . ')';
|
104 |
+
}
|
105 |
+
} else {
|
106 |
+
$products[ $main_product_id ] = '';
|
107 |
+
}
|
108 |
+
$options = array();
|
109 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
110 |
+
foreach ( $products as $product_id => $desc ) {
|
111 |
+
$currency_codes = array();
|
112 |
+
$currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
|
113 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
114 |
+
$currency_codes[ get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ] = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
115 |
+
}
|
116 |
+
$options[] = array(
|
117 |
+
'name' => 'wcj_multicurrency_base_price_currency_' . $product_id,
|
118 |
+
'default' => '',
|
119 |
+
'type' => 'select',
|
120 |
+
'title' => __( 'Product Currency', 'woocommerce-jetpack' ),
|
121 |
+
'desc' => $desc,
|
122 |
+
'product_id' => $product_id,
|
123 |
+
'meta_name' => '_' . 'wcj_multicurrency_base_price_currency',
|
124 |
+
'options' => $currency_codes,
|
125 |
+
);
|
126 |
+
}
|
127 |
+
return $options; */
|
128 |
+
|
129 |
+
$currency_codes = array();
|
130 |
+
$currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
|
131 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
132 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
133 |
+
$currency_codes[ get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ] = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
134 |
+
}
|
135 |
+
$options = array(
|
136 |
+
array(
|
137 |
+
'name' => 'wcj_multicurrency_base_price_currency',
|
138 |
+
'default' => get_woocommerce_currency(),
|
139 |
+
'type' => 'select',
|
140 |
+
'title' => __( 'Product Currency', 'woocommerce-jetpack' ),
|
141 |
+
'options' => $currency_codes,
|
142 |
+
),
|
143 |
+
);
|
144 |
+
return $options;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* change_currency_symbol_on_product_edit.
|
149 |
+
*/
|
150 |
+
function change_currency_symbol_on_product_edit( $currency_symbol, $currency ) {
|
151 |
+
if ( is_admin() ) {
|
152 |
+
global $pagenow;
|
153 |
+
if ( 'post.php' === $pagenow && isset( $_GET['action'] ) && 'edit' === $_GET['action'] ) {
|
154 |
+
$multicurrency_base_price_currency = get_post_meta( get_the_ID(), '_' . 'wcj_multicurrency_base_price_currency', true );
|
155 |
+
if ( '' != $multicurrency_base_price_currency ) {
|
156 |
+
return wcj_get_currency_symbol( $multicurrency_base_price_currency );
|
157 |
+
}
|
158 |
+
}
|
159 |
+
}
|
160 |
+
return $currency_symbol;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* add_settings_hook.
|
165 |
+
*/
|
166 |
+
function add_settings_hook() {
|
167 |
+
add_filter( 'wcj_multicurrency_base_price_settings', array( $this, 'add_settings' ) );
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* get_settings.
|
172 |
+
*/
|
173 |
+
function get_settings() {
|
174 |
+
$settings = apply_filters( 'wcj_multicurrency_base_price_settings', array() );
|
175 |
+
return $this->add_standard_settings( $settings );
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* add_settings.
|
180 |
+
*/
|
181 |
+
function add_settings() {
|
182 |
+
$currency_from = get_woocommerce_currency();
|
183 |
+
$all_currencies = wcj_get_currencies_names_and_symbols();
|
184 |
+
foreach ( $all_currencies as $currency_key => $currency_name ) {
|
185 |
+
if ( $currency_from == $currency_key ) {
|
186 |
+
unset( $all_currencies[ $currency_key ] );
|
187 |
+
}
|
188 |
+
}
|
189 |
+
$settings = array(
|
190 |
+
array(
|
191 |
+
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
192 |
+
'type' => 'title',
|
193 |
+
'id' => 'wcj_multicurrency_base_price_options',
|
194 |
+
),
|
195 |
+
array(
|
196 |
+
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
197 |
+
'id' => 'wcj_multicurrency_base_price_exchange_rate_update',
|
198 |
+
'default' => 'manual',
|
199 |
+
'type' => 'select',
|
200 |
+
'options' => array(
|
201 |
+
'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
|
202 |
+
'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
|
203 |
+
),
|
204 |
+
'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
|
205 |
+
__( '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>'
|
206 |
+
:
|
207 |
+
apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
208 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
209 |
+
),
|
210 |
+
array(
|
211 |
+
'type' => 'sectionend',
|
212 |
+
'id' => 'wcj_multicurrency_base_price_options',
|
213 |
+
),
|
214 |
+
array(
|
215 |
+
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
216 |
+
'type' => 'title',
|
217 |
+
'id' => 'wcj_multicurrency_base_price_currencies_options',
|
218 |
+
),
|
219 |
+
array(
|
220 |
+
'title' => __( 'Total Currencies', 'woocommerce-jetpack' ),
|
221 |
+
'id' => 'wcj_multicurrency_base_price_total_number',
|
222 |
+
'default' => 1,
|
223 |
+
'type' => 'custom_number',
|
224 |
+
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
225 |
+
'custom_attributes' => array_merge(
|
226 |
+
is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
|
227 |
+
array( 'step' => '1', 'min' => '1', )
|
228 |
+
),
|
229 |
+
),
|
230 |
+
);
|
231 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
232 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
233 |
+
$currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i, $currency_from );
|
234 |
+
$custom_attributes = array(
|
235 |
+
'currency_from' => $currency_from,
|
236 |
+
'currency_to' => $currency_to,
|
237 |
+
'multiply_by_field_id' => 'wcj_multicurrency_base_price_exchange_rate_' . $i,
|
238 |
+
);
|
239 |
+
if ( $currency_from == $currency_to ) {
|
240 |
+
$custom_attributes['disabled'] = 'disabled';
|
241 |
+
}
|
242 |
+
$settings = array_merge( $settings, array(
|
243 |
+
array(
|
244 |
+
'title' => __( 'Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
245 |
+
'id' => 'wcj_multicurrency_base_price_currency_' . $i,
|
246 |
+
'default' => $currency_from,
|
247 |
+
'type' => 'select',
|
248 |
+
'options' => $all_currencies,
|
249 |
+
'css' => 'width:250px;',
|
250 |
+
),
|
251 |
+
array(
|
252 |
+
'title' => '',
|
253 |
+
'id' => 'wcj_multicurrency_base_price_exchange_rate_' . $i,
|
254 |
+
'default' => 1,
|
255 |
+
'type' => 'exchange_rate',
|
256 |
+
'custom_attributes' => array( 'step' => '0.000001', 'min' => '0', ),
|
257 |
+
'custom_attributes_button' => $custom_attributes,
|
258 |
+
'css' => 'width:100px;',
|
259 |
+
'value' => $currency_from . '/' . $currency_to,
|
260 |
+
'value_title' => sprintf( __( 'Grab %s rate from Yahoo.com', 'woocommerce-jetpack' ), $currency_from . '/' . $currency_to ),
|
261 |
+
),
|
262 |
+
) );
|
263 |
+
}
|
264 |
+
$settings = array_merge( $settings, array(
|
265 |
+
array(
|
266 |
+
'type' => 'sectionend',
|
267 |
+
'id' => 'wcj_multicurrency_base_price_currencies_options',
|
268 |
+
),
|
269 |
+
) );
|
270 |
+
return $settings;
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
endif;
|
275 |
+
|
276 |
+
return new WCJ_Multicurrency_Base_Price();
|
includes/class-wcj-multicurrency.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Multicurrency class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.4.3
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -18,13 +18,14 @@ class WCJ_Multicurrency extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.4.
|
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' ) );
|
@@ -36,6 +37,10 @@ class WCJ_Multicurrency extends WCJ_Module {
|
|
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 |
|
@@ -129,7 +134,7 @@ class WCJ_Multicurrency extends WCJ_Module {
|
|
129 |
}
|
130 |
|
131 |
/**
|
132 |
-
*
|
133 |
*
|
134 |
* @version 2.4.3
|
135 |
*/
|
@@ -207,7 +212,7 @@ class WCJ_Multicurrency extends WCJ_Module {
|
|
207 |
/**
|
208 |
* change_shipping_price_by_currency.
|
209 |
*
|
210 |
-
* @version 2.4.
|
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() );
|
@@ -215,6 +220,11 @@ class WCJ_Multicurrency extends WCJ_Module {
|
|
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 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Multicurrency class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.4.3
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'multicurrency';
|
26 |
+
$this->short_desc = __( 'Multicurrency (Currency Switcher)', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Add multiple currencies (currency switcher) to WooCommerce.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-multicurrency-currency-switcher/';
|
29 |
parent::__construct();
|
30 |
|
31 |
add_filter( 'init', array( $this, 'add_settings_hook' ) );
|
37 |
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
|
38 |
add_action( 'save_post_product', array( $this, 'save_meta_box' ), PHP_INT_MAX, 2 );
|
39 |
}
|
40 |
+
|
41 |
+
if ( is_admin() ) {
|
42 |
+
include_once( 'reports/class-wcj-currency-reports.php' );
|
43 |
+
}
|
44 |
}
|
45 |
}
|
46 |
|
134 |
}
|
135 |
|
136 |
/**
|
137 |
+
* get_currency_exchange_rate.
|
138 |
*
|
139 |
* @version 2.4.3
|
140 |
*/
|
212 |
/**
|
213 |
* change_shipping_price_by_currency.
|
214 |
*
|
215 |
+
* @version 2.4.8
|
216 |
*/
|
217 |
function change_shipping_price_by_currency( $package_rates, $package ) {
|
218 |
$currency_exchange_rate = $this->get_currency_exchange_rate( $this->get_current_currency_code() );
|
220 |
foreach ( $package_rates as $id => $package_rate ) {
|
221 |
if ( 1 != $currency_exchange_rate && isset( $package_rate->cost ) ) {
|
222 |
$package_rate->cost = $package_rate->cost * $currency_exchange_rate;
|
223 |
+
if ( isset( $package_rate->taxes ) && ! empty( $package_rate->taxes ) ) {
|
224 |
+
foreach ( $package_rate->taxes as $tax_id => $tax ) {
|
225 |
+
$package_rate->taxes[ $tax_id ] = $package_rate->taxes[ $tax_id ] * $currency_exchange_rate;
|
226 |
+
}
|
227 |
+
}
|
228 |
}
|
229 |
$modified_package_rates[ $id ] = $package_rate;
|
230 |
}
|
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 |
*/
|
@@ -18,7 +18,7 @@ class WCJ_Payment_Gateways_Currency extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
@@ -32,13 +32,16 @@ class WCJ_Payment_Gateways_Currency extends WCJ_Module {
|
|
32 |
if ( $this->is_enabled() ) {
|
33 |
/* add_action( 'init', array( $this, 'add_hooks' ) ); */
|
34 |
$this->add_hooks();
|
|
|
|
|
|
|
35 |
}
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
* add_hooks.
|
40 |
*
|
41 |
-
* @version 2.
|
42 |
* @since 2.3.2
|
43 |
*/
|
44 |
function add_hooks() {
|
@@ -49,10 +52,42 @@ class WCJ_Payment_Gateways_Currency extends WCJ_Module {
|
|
49 |
|
50 |
add_filter( 'woocommerce_get_price', array( $this, 'change_price_by_gateway' ), PHP_INT_MAX, 2 );
|
51 |
|
|
|
|
|
52 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_checkout_script' ) );
|
53 |
add_action( 'init', array( $this, 'register_script' ) );
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
/**
|
57 |
* is_cart_or_checkout.
|
58 |
*
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways Currency class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.3.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
32 |
if ( $this->is_enabled() ) {
|
33 |
/* add_action( 'init', array( $this, 'add_hooks' ) ); */
|
34 |
$this->add_hooks();
|
35 |
+
if ( is_admin() ) {
|
36 |
+
include_once( 'reports/class-wcj-currency-reports.php' );
|
37 |
+
}
|
38 |
}
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
* add_hooks.
|
43 |
*
|
44 |
+
* @version 2.4.8
|
45 |
* @since 2.3.2
|
46 |
*/
|
47 |
function add_hooks() {
|
52 |
|
53 |
add_filter( 'woocommerce_get_price', array( $this, 'change_price_by_gateway' ), PHP_INT_MAX, 2 );
|
54 |
|
55 |
+
add_filter( 'woocommerce_package_rates', array( $this, 'change_shipping_price_by_gateway' ), PHP_INT_MAX, 2 );
|
56 |
+
|
57 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_checkout_script' ) );
|
58 |
add_action( 'init', array( $this, 'register_script' ) );
|
59 |
}
|
60 |
|
61 |
+
/**
|
62 |
+
* change_shipping_price_by_gateway.
|
63 |
+
*
|
64 |
+
* @version 2.4.8
|
65 |
+
* @since 2.4.8
|
66 |
+
*/
|
67 |
+
function change_shipping_price_by_gateway( $package_rates, $package ) {
|
68 |
+
if ( $this->is_cart_or_checkout() ) {
|
69 |
+
global $woocommerce;
|
70 |
+
$current_gateway = $woocommerce->session->chosen_payment_method;
|
71 |
+
if ( '' != $current_gateway ) {
|
72 |
+
$gateway_currency_exchange_rate = get_option( 'wcj_gateways_currency_exchange_rate_' . $current_gateway );
|
73 |
+
$modified_package_rates = array();
|
74 |
+
foreach ( $package_rates as $id => $package_rate ) {
|
75 |
+
if ( 1 != $gateway_currency_exchange_rate && isset( $package_rate->cost ) ) {
|
76 |
+
$package_rate->cost = $package_rate->cost * $gateway_currency_exchange_rate;
|
77 |
+
if ( isset( $package_rate->taxes ) && ! empty( $package_rate->taxes ) ) {
|
78 |
+
foreach ( $package_rate->taxes as $tax_id => $tax ) {
|
79 |
+
$package_rate->taxes[ $tax_id ] = $package_rate->taxes[ $tax_id ] * $gateway_currency_exchange_rate;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
$modified_package_rates[ $id ] = $package_rate;
|
84 |
+
}
|
85 |
+
return $modified_package_rates;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
return $package_rates;
|
89 |
+
}
|
90 |
+
|
91 |
/**
|
92 |
* is_cart_or_checkout.
|
93 |
*
|
includes/class-wcj-payment-gateways.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,13 +17,14 @@ class WCJ_Payment_Gateways extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'payment_gateways';
|
25 |
$this->short_desc = __( 'Custom Gateways', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Add multiple custom payment gateways to WooCommerce.', 'woocommerce-jetpack' );
|
|
|
27 |
parent::__construct();
|
28 |
|
29 |
if ( $this->is_enabled() ) {
|
@@ -34,13 +35,20 @@ class WCJ_Payment_Gateways extends WCJ_Module {
|
|
34 |
|
35 |
/**
|
36 |
* get_settings.
|
|
|
|
|
37 |
*/
|
38 |
function get_settings() {
|
39 |
-
|
|
|
40 |
$settings = array(
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
44 |
array(
|
45 |
'title' => __( 'Number of Gateways', 'woocommerce-jetpack' ),
|
46 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
@@ -53,11 +61,23 @@ class WCJ_Payment_Gateways extends WCJ_Module {
|
|
53 |
array( 'step' => '1', 'min' => '1', 'max' => '10', )
|
54 |
),
|
55 |
),
|
56 |
-
|
57 |
-
array( 'type' => 'sectionend', 'id' => 'wcj_custom_payment_gateways_options' ),
|
58 |
);
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
63 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Payment Gateways class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'payment_gateways';
|
25 |
$this->short_desc = __( 'Custom Gateways', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Add multiple custom payment gateways to WooCommerce.', 'woocommerce-jetpack' );
|
27 |
+
$this->link = 'http://booster.io/features/woocommerce-custom-payment-gateways/';
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
35 |
|
36 |
/**
|
37 |
* get_settings.
|
38 |
+
*
|
39 |
+
* @version 2.4.8
|
40 |
*/
|
41 |
function get_settings() {
|
42 |
+
$wocommerce_checkout_settings_url = admin_url( 'admin.php?page=wc-settings&tab=checkout' );
|
43 |
+
$wocommerce_checkout_settings_url = '<a href="' . $wocommerce_checkout_settings_url . '">' . __( 'WooCommerce > Settings > Checkout', 'woocommerce-jetpack' ) . '</a>';
|
44 |
$settings = array(
|
45 |
+
array(
|
46 |
+
'title' => __( 'Custom Payment Gateways Options', 'woocommerce-jetpack' ),
|
47 |
+
'type' => 'title',
|
48 |
+
'id' => 'wcj_custom_payment_gateways_options',
|
49 |
+
'desc' => __( 'This section lets you set number of custom payment gateways to add.', 'woocommerce-jetpack' )
|
50 |
+
. ' ' . sprintf( __( 'After setting the number, visit %s to set each gateway options.', 'woocommerce-jetpack' ), $wocommerce_checkout_settings_url ),
|
51 |
+
),
|
52 |
array(
|
53 |
'title' => __( 'Number of Gateways', 'woocommerce-jetpack' ),
|
54 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
61 |
array( 'step' => '1', 'min' => '1', 'max' => '10', )
|
62 |
),
|
63 |
),
|
|
|
|
|
64 |
);
|
65 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_payment_gateways_number', 1 ) );
|
66 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
67 |
+
$settings [] = array(
|
68 |
+
'title' => __( 'Admin Title Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $i,
|
69 |
+
'id' => 'wcj_custom_payment_gateways_admin_title_' . $i,
|
70 |
+
'default' => __( 'Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $i,
|
71 |
+
'type' => 'text',
|
72 |
+
);
|
73 |
+
}
|
74 |
+
$settings = array_merge( $settings, array(
|
75 |
+
array(
|
76 |
+
'type' => 'sectionend',
|
77 |
+
'id' => 'wcj_custom_payment_gateways_options',
|
78 |
+
),
|
79 |
+
) );
|
80 |
+
return $this->add_standard_settings( $settings );
|
81 |
}
|
82 |
}
|
83 |
|
includes/class-wcj-price-by-country.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,13 +17,14 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'price_by_country';
|
25 |
$this->short_desc = __( 'Prices and Currencies by Country', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Change WooCommerce product price and currency automatically by customer\'s country.', 'woocommerce-jetpack' );
|
|
|
27 |
parent::__construct();
|
28 |
|
29 |
global $wcj_notice;
|
@@ -50,7 +51,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
50 |
}
|
51 |
if ( is_admin() ) {
|
52 |
// Backend
|
53 |
-
include_once( '
|
54 |
if ( 'yes' === get_option( 'wcj_price_by_country_local_enabled' ) ) {
|
55 |
include_once( 'price-by-country/class-wcj-price-by-country-local.php' );
|
56 |
}
|
@@ -65,7 +66,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
65 |
/**
|
66 |
* get_settings.
|
67 |
*
|
68 |
-
* @version 2.4.
|
69 |
*/
|
70 |
function get_settings() {
|
71 |
|
@@ -147,7 +148,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
147 |
'title' => __( 'Countries Selection', 'woocommerce-jetpack' ),
|
148 |
'desc' => __( 'Choose how do you want to enter countries groups in admin.', 'woocommerce-jetpack' ),
|
149 |
'id' => 'wcj_price_by_country_selection',
|
150 |
-
'default' => '
|
151 |
'type' => 'select',
|
152 |
'options' => array(
|
153 |
'comma_list' => __( 'Comma separated list', 'woocommerce-jetpack' ),
|
@@ -372,7 +373,7 @@ class WCJ_Price_By_Country extends WCJ_Module {
|
|
372 |
),
|
373 |
) ); */
|
374 |
|
375 |
-
return $this->
|
376 |
}
|
377 |
}
|
378 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price by Country class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'price_by_country';
|
25 |
$this->short_desc = __( 'Prices and Currencies by Country', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Change WooCommerce product price and currency automatically by customer\'s country.', 'woocommerce-jetpack' );
|
27 |
+
$this->link = 'http://booster.io/features/woocommerce-prices-and-currencies-by-country/';
|
28 |
parent::__construct();
|
29 |
|
30 |
global $wcj_notice;
|
51 |
}
|
52 |
if ( is_admin() ) {
|
53 |
// Backend
|
54 |
+
include_once( 'reports/class-wcj-currency-reports.php' );
|
55 |
if ( 'yes' === get_option( 'wcj_price_by_country_local_enabled' ) ) {
|
56 |
include_once( 'price-by-country/class-wcj-price-by-country-local.php' );
|
57 |
}
|
66 |
/**
|
67 |
* get_settings.
|
68 |
*
|
69 |
+
* @version 2.4.8
|
70 |
*/
|
71 |
function get_settings() {
|
72 |
|
148 |
'title' => __( 'Countries Selection', 'woocommerce-jetpack' ),
|
149 |
'desc' => __( 'Choose how do you want to enter countries groups in admin.', 'woocommerce-jetpack' ),
|
150 |
'id' => 'wcj_price_by_country_selection',
|
151 |
+
'default' => 'chosen_select',
|
152 |
'type' => 'select',
|
153 |
'options' => array(
|
154 |
'comma_list' => __( 'Comma separated list', 'woocommerce-jetpack' ),
|
373 |
),
|
374 |
) ); */
|
375 |
|
376 |
+
return $this->add_standard_settings( $settings );
|
377 |
}
|
378 |
}
|
379 |
|
includes/class-wcj-price-labels.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price Labels class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -259,15 +259,26 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
259 |
|
260 |
/**
|
261 |
* add_price_label_meta_box.
|
|
|
|
|
262 |
*/
|
263 |
public function add_price_label_meta_box() {
|
264 |
-
add_meta_box(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
}
|
266 |
|
267 |
/*
|
268 |
-
*
|
|
|
|
|
269 |
*/
|
270 |
-
public function
|
271 |
|
272 |
$current_post_id = get_the_ID();
|
273 |
echo '<table style="width:100%;">';
|
@@ -389,7 +400,7 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
389 |
/*
|
390 |
* custom_price - front end.
|
391 |
*
|
392 |
-
* @version 2.4.
|
393 |
*/
|
394 |
public function custom_price( $price, $product ) {
|
395 |
|
@@ -548,7 +559,11 @@ class WCJ_Price_Labels extends WCJ_Module {
|
|
548 |
}
|
549 |
|
550 |
// return do_shortcode( $price . $current_filter_name . $product->product_type . $labels_array['variation_variable'] . $labels_array['variation_variation'] );
|
551 |
-
|
|
|
|
|
|
|
|
|
552 |
}
|
553 |
|
554 |
/**
|
4 |
*
|
5 |
* The WooCommerce Jetpack Price Labels class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
259 |
|
260 |
/**
|
261 |
* add_price_label_meta_box.
|
262 |
+
*
|
263 |
+
* @version 2.4.8
|
264 |
*/
|
265 |
public function add_price_label_meta_box() {
|
266 |
+
add_meta_box(
|
267 |
+
'wc-jetpack-price-labels',
|
268 |
+
__( 'Booster: Custom Price Labels', 'woocommerce-jetpack' ),
|
269 |
+
array( $this, 'create_price_label_meta_box' ),
|
270 |
+
'product',
|
271 |
+
'normal',
|
272 |
+
'high'
|
273 |
+
);
|
274 |
}
|
275 |
|
276 |
/*
|
277 |
+
* create_price_label_meta_box - back end.
|
278 |
+
*
|
279 |
+
* @version 2.4.8
|
280 |
*/
|
281 |
+
public function create_price_label_meta_box() {
|
282 |
|
283 |
$current_post_id = get_the_ID();
|
284 |
echo '<table style="width:100%;">';
|
400 |
/*
|
401 |
* custom_price - front end.
|
402 |
*
|
403 |
+
* @version 2.4.8
|
404 |
*/
|
405 |
public function custom_price( $price, $product ) {
|
406 |
|
559 |
}
|
560 |
|
561 |
// return do_shortcode( $price . $current_filter_name . $product->product_type . $labels_array['variation_variable'] . $labels_array['variation_variation'] );
|
562 |
+
global $wcj_product_id_for_shortcode;
|
563 |
+
$wcj_product_id_for_shortcode = ( isset( $product->variation_id ) ) ? $product->variation_id : $product->id;
|
564 |
+
$result = do_shortcode( $price );
|
565 |
+
$wcj_product_id_for_shortcode = 0;
|
566 |
+
return $result;
|
567 |
}
|
568 |
|
569 |
/**
|
includes/class-wcj-product-add-to-cart.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Add To Cart class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -17,12 +17,15 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
|
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
|
|
|
|
20 |
*/
|
21 |
public function __construct() {
|
22 |
|
23 |
$this->id = 'product_add_to_cart';
|
24 |
$this->short_desc = __( 'Product Add to Cart', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'Set any local url to redirect to on WooCommerce Add to Cart. Automatically add to cart on product visit.', 'woocommerce-jetpack' );
|
|
|
26 |
parent::__construct();
|
27 |
|
28 |
if ( $this->is_enabled() ) {
|
@@ -34,77 +37,54 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
|
|
34 |
if ( 'yes' === get_option( 'wcj_add_to_cart_on_visit_enabled' ) ) {
|
35 |
add_action( 'woocommerce_before_single_product', array( $this, 'add_to_cart_on_visit' ), 100 );
|
36 |
}
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
-
*
|
|
|
|
|
|
|
42 |
*/
|
43 |
-
function
|
44 |
-
|
45 |
-
$settings = array(
|
46 |
-
|
47 |
-
array(
|
48 |
-
'title' => __( 'Add to Cart Local Redirect Options', 'woocommerce-jetpack' ),
|
49 |
-
'type' => 'title',
|
50 |
-
'desc' => __( 'This section lets you set any local URL to redirect to after successfully adding product to cart. Leave empty to redirect to checkout page (skipping the cart page).', 'woocommerce-jetpack' ),
|
51 |
-
'id' => 'wcj_add_to_cart_redirect_options',
|
52 |
-
),
|
53 |
-
|
54 |
-
array(
|
55 |
-
'title' => __( 'Local Redirect', 'woocommerce-jetpack' ),
|
56 |
-
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
57 |
-
'id' => 'wcj_add_to_cart_redirect_enabled',
|
58 |
-
'default' => 'no',
|
59 |
-
'type' => 'checkbox',
|
60 |
-
),
|
61 |
-
|
62 |
-
array(
|
63 |
-
'title' => __( 'Local Redirect URL', 'woocommerce-jetpack' ),
|
64 |
-
'desc_tip' => __( 'Performs a safe (local) redirect, using wp_redirect().', 'woocommerce-jetpack' ),
|
65 |
-
'desc' => __( 'Local redirect URL. Leave empty to redirect to checkout.', 'woocommerce-jetpack' ),
|
66 |
-
'id' => 'wcj_add_to_cart_redirect_url',
|
67 |
-
'default' => '',
|
68 |
-
'type' => 'text',
|
69 |
-
'css' => 'width:50%;min-width:300px;',
|
70 |
-
),
|
71 |
-
|
72 |
-
array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_redirect_options' ),
|
73 |
-
|
74 |
-
array( 'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you enable automatically adding product to cart on visiting the product page. Product is only added once, so if it is already in cart - duplicate product is not added. ', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_on_visit_options' ),
|
75 |
-
|
76 |
-
array(
|
77 |
-
'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ),
|
78 |
-
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
79 |
-
'id' => 'wcj_add_to_cart_on_visit_enabled',
|
80 |
-
'default' => 'no',
|
81 |
-
'type' => 'checkbox',
|
82 |
-
),
|
83 |
-
|
84 |
-
array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_on_visit_options' ),
|
85 |
-
);
|
86 |
-
|
87 |
-
return $this->add_enable_module_setting( $settings );
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
/*
|
91 |
* redirect_to_url.
|
92 |
*/
|
93 |
function redirect_to_url( $url ) {
|
94 |
global $woocommerce;
|
95 |
$checkout_url = get_option( 'wcj_add_to_cart_redirect_url' );
|
96 |
-
if ( '' === $checkout_url )
|
97 |
$checkout_url = $woocommerce->cart->get_checkout_url();
|
|
|
98 |
return $checkout_url;
|
99 |
}
|
100 |
|
101 |
/*
|
102 |
* Add item to cart on visit.
|
103 |
*/
|
104 |
-
|
105 |
-
|
106 |
if ( is_product() ) {
|
107 |
-
|
108 |
global $woocommerce;
|
109 |
$product_id = get_the_ID();
|
110 |
$found = false;
|
@@ -112,18 +92,92 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
|
|
112 |
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {
|
113 |
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
|
114 |
$_product = $values['data'];
|
115 |
-
if ( $_product->id == $product_id )
|
116 |
$found = true;
|
|
|
117 |
}
|
118 |
// if product not found, add it
|
119 |
-
if ( ! $found )
|
120 |
$woocommerce->cart->add_to_cart( $product_id );
|
|
|
121 |
} else {
|
122 |
// if no products in cart, add it
|
123 |
$woocommerce->cart->add_to_cart( $product_id );
|
124 |
}
|
125 |
}
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
|
129 |
endif;
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Add To Cart class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
|
25 |
$this->id = 'product_add_to_cart';
|
26 |
$this->short_desc = __( 'Product Add to Cart', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Set any local url to redirect to on WooCommerce Add to Cart. Automatically add to cart on product visit.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-product-add-to-cart/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
37 |
if ( 'yes' === get_option( 'wcj_add_to_cart_on_visit_enabled' ) ) {
|
38 |
add_action( 'woocommerce_before_single_product', array( $this, 'add_to_cart_on_visit' ), 100 );
|
39 |
}
|
40 |
+
|
41 |
+
// Variable Add to Cart Template
|
42 |
+
if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_add_to_cart_variable_as_radio_enabled', 'no' ) ) ) {
|
43 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_variable_add_to_cart_scripts' ) );
|
44 |
+
add_filter( 'wc_get_template', array( $this, 'change_variable_add_to_cart_template' ), PHP_INT_MAX, 5 );
|
45 |
+
}
|
46 |
+
}
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
+
* enqueue_variable_add_to_cart_scripts.
|
51 |
+
*
|
52 |
+
* @version 2.4.8
|
53 |
+
* @since 2.4.8
|
54 |
*/
|
55 |
+
function enqueue_variable_add_to_cart_scripts() {
|
56 |
+
wp_enqueue_script( 'wcj-variations', wcj_plugin_url() . '/includes/js/wcj-variations-frontend.js', array( 'jquery' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
+
/**
|
60 |
+
* change_variable_add_to_cart_template.
|
61 |
+
*
|
62 |
+
* @version 2.4.8
|
63 |
+
* @since 2.4.8
|
64 |
+
*/
|
65 |
+
function change_variable_add_to_cart_template( $located, $template_name, $args, $template_path, $default_path ) {
|
66 |
+
if ( 'single-product/add-to-cart/variable.php' == $template_name ) {
|
67 |
+
$located = untrailingslashit( realpath( plugin_dir_path( __FILE__ ) . '/..' ) ) . '/includes/templates/wcj-add-to-cart-variable.php';
|
68 |
+
}
|
69 |
+
return $located;
|
70 |
+
}
|
71 |
/*
|
72 |
* redirect_to_url.
|
73 |
*/
|
74 |
function redirect_to_url( $url ) {
|
75 |
global $woocommerce;
|
76 |
$checkout_url = get_option( 'wcj_add_to_cart_redirect_url' );
|
77 |
+
if ( '' === $checkout_url ) {
|
78 |
$checkout_url = $woocommerce->cart->get_checkout_url();
|
79 |
+
}
|
80 |
return $checkout_url;
|
81 |
}
|
82 |
|
83 |
/*
|
84 |
* Add item to cart on visit.
|
85 |
*/
|
86 |
+
function add_to_cart_on_visit() {
|
|
|
87 |
if ( is_product() ) {
|
|
|
88 |
global $woocommerce;
|
89 |
$product_id = get_the_ID();
|
90 |
$found = false;
|
92 |
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {
|
93 |
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
|
94 |
$_product = $values['data'];
|
95 |
+
if ( $_product->id == $product_id ) {
|
96 |
$found = true;
|
97 |
+
}
|
98 |
}
|
99 |
// if product not found, add it
|
100 |
+
if ( ! $found ) {
|
101 |
$woocommerce->cart->add_to_cart( $product_id );
|
102 |
+
}
|
103 |
} else {
|
104 |
// if no products in cart, add it
|
105 |
$woocommerce->cart->add_to_cart( $product_id );
|
106 |
}
|
107 |
}
|
108 |
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* get_settings.
|
112 |
+
*
|
113 |
+
* @version 2.4.8
|
114 |
+
*/
|
115 |
+
function get_settings() {
|
116 |
+
$settings = array(
|
117 |
+
array(
|
118 |
+
'title' => __( 'Add to Cart Local Redirect Options', 'woocommerce-jetpack' ),
|
119 |
+
'type' => 'title',
|
120 |
+
'desc' => __( 'This section lets you set any local URL to redirect to after successfully adding product to cart. Leave empty to redirect to checkout page (skipping the cart page).', 'woocommerce-jetpack' ),
|
121 |
+
'id' => 'wcj_add_to_cart_redirect_options',
|
122 |
+
),
|
123 |
+
array(
|
124 |
+
'title' => __( 'Local Redirect', 'woocommerce-jetpack' ),
|
125 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
126 |
+
'id' => 'wcj_add_to_cart_redirect_enabled',
|
127 |
+
'default' => 'no',
|
128 |
+
'type' => 'checkbox',
|
129 |
+
),
|
130 |
+
array(
|
131 |
+
'title' => __( 'Local Redirect URL', 'woocommerce-jetpack' ),
|
132 |
+
'desc_tip' => __( 'Performs a safe (local) redirect, using wp_redirect().', 'woocommerce-jetpack' ),
|
133 |
+
'desc' => __( 'Local redirect URL. Leave empty to redirect to checkout.', 'woocommerce-jetpack' ),
|
134 |
+
'id' => 'wcj_add_to_cart_redirect_url',
|
135 |
+
'default' => '',
|
136 |
+
'type' => 'text',
|
137 |
+
'css' => 'width:50%;min-width:300px;',
|
138 |
+
),
|
139 |
+
array(
|
140 |
+
'type' => 'sectionend',
|
141 |
+
'id' => 'wcj_add_to_cart_redirect_options',
|
142 |
+
),
|
143 |
+
array(
|
144 |
+
'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ),
|
145 |
+
'type' => 'title',
|
146 |
+
'desc' => __( 'This section lets you enable automatically adding product to cart on visiting the product page. Product is only added once, so if it is already in cart - duplicate product is not added. ', 'woocommerce-jetpack' ),
|
147 |
+
'id' => 'wcj_add_to_cart_on_visit_options',
|
148 |
+
),
|
149 |
+
array(
|
150 |
+
'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ),
|
151 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
152 |
+
'id' => 'wcj_add_to_cart_on_visit_enabled',
|
153 |
+
'default' => 'no',
|
154 |
+
'type' => 'checkbox',
|
155 |
+
),
|
156 |
+
array(
|
157 |
+
'type' => 'sectionend',
|
158 |
+
'id' => 'wcj_add_to_cart_on_visit_options',
|
159 |
+
),
|
160 |
+
array(
|
161 |
+
'title' => __( 'Add to Cart Variable Product', 'woocommerce-jetpack' ),
|
162 |
+
'type' => 'title',
|
163 |
+
'id' => 'wcj_add_to_cart_variable_options',
|
164 |
+
),
|
165 |
+
array(
|
166 |
+
'title' => __( 'Display Radio Buttons Instead of Drop Box', 'woocommerce-jetpack' ),
|
167 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
168 |
+
'id' => 'wcj_add_to_cart_variable_as_radio_enabled',
|
169 |
+
'default' => 'no',
|
170 |
+
'type' => 'checkbox',
|
171 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
172 |
+
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
173 |
+
),
|
174 |
+
array(
|
175 |
+
'type' => 'sectionend',
|
176 |
+
'id' => 'wcj_add_to_cart_variable_options',
|
177 |
+
),
|
178 |
+
);
|
179 |
+
return $this->add_standard_settings( $settings );
|
180 |
+
}
|
181 |
}
|
182 |
|
183 |
endif;
|
includes/class-wcj-product-custom-info.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Custom Info class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.4.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -94,7 +94,7 @@ class WCJ_Product_Custom_info extends WCJ_Module {
|
|
94 |
/**
|
95 |
* add_settings.
|
96 |
*
|
97 |
-
* @version 2.4.
|
98 |
*/
|
99 |
function add_settings() {
|
100 |
|
@@ -161,6 +161,10 @@ class WCJ_Product_Custom_info extends WCJ_Module {
|
|
161 |
'woocommerce_single_product_summary' => __( 'Inside single product summary', 'woocommerce-jetpack' ),
|
162 |
'woocommerce_after_single_product_summary' => __( 'After single product summary', 'woocommerce-jetpack' ),
|
163 |
'woocommerce_after_single_product' => __( 'After single product', 'woocommerce-jetpack' ),
|
|
|
|
|
|
|
|
|
164 |
) :
|
165 |
array(
|
166 |
'woocommerce_before_shop_loop_item' => __( 'Before product', 'woocommerce-jetpack' ),
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Custom Info class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.4.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
94 |
/**
|
95 |
* add_settings.
|
96 |
*
|
97 |
+
* @version 2.4.8
|
98 |
*/
|
99 |
function add_settings() {
|
100 |
|
161 |
'woocommerce_single_product_summary' => __( 'Inside single product summary', 'woocommerce-jetpack' ),
|
162 |
'woocommerce_after_single_product_summary' => __( 'After single product summary', 'woocommerce-jetpack' ),
|
163 |
'woocommerce_after_single_product' => __( 'After single product', 'woocommerce-jetpack' ),
|
164 |
+
'woocommerce_before_add_to_cart_form' => __( 'Before add to cart form', 'woocommerce-jetpack' ),
|
165 |
+
'woocommerce_before_add_to_cart_button' => __( 'Before add to cart button', 'woocommerce-jetpack' ),
|
166 |
+
'woocommerce_after_add_to_cart_button' => __( 'After add to cart button', 'woocommerce-jetpack' ),
|
167 |
+
'woocommerce_after_add_to_cart_form' => __( 'After add to cart form', 'woocommerce-jetpack' ),
|
168 |
) :
|
169 |
array(
|
170 |
'woocommerce_before_shop_loop_item' => __( 'Before product', 'woocommerce-jetpack' ),
|
includes/class-wcj-product-images.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Images class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -18,13 +18,14 @@ class WCJ_Product_Images extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'product_images';
|
26 |
$this->short_desc = __( 'Product Images', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Customize WooCommerce products images, thumbnails and sale flashes.', 'woocommerce-jetpack' );
|
|
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
@@ -171,7 +172,7 @@ class WCJ_Product_Images extends WCJ_Module {
|
|
171 |
/**
|
172 |
* get_settings.
|
173 |
*
|
174 |
-
* @version 2.
|
175 |
*/
|
176 |
function get_settings() {
|
177 |
|
@@ -288,7 +289,7 @@ class WCJ_Product_Images extends WCJ_Module {
|
|
288 |
array( 'type' => 'sectionend', 'id' => 'wcj_product_images_sale_flash_options' ),
|
289 |
);
|
290 |
|
291 |
-
return $this->
|
292 |
}
|
293 |
}
|
294 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Images class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'product_images';
|
26 |
$this->short_desc = __( 'Product Images', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Customize WooCommerce products images, thumbnails and sale flashes.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-product-images/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
172 |
/**
|
173 |
* get_settings.
|
174 |
*
|
175 |
+
* @version 2.4.8
|
176 |
*/
|
177 |
function get_settings() {
|
178 |
|
289 |
array( 'type' => 'sectionend', 'id' => 'wcj_product_images_sale_flash_options' ),
|
290 |
);
|
291 |
|
292 |
+
return $this->add_standard_settings( $settings );
|
293 |
}
|
294 |
}
|
295 |
|
includes/class-wcj-product-input-fields.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Input Fields class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -16,13 +16,14 @@ class WCJ_Product_Input_Fields extends WCJ_Module {
|
|
16 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
-
* @version 2.4.
|
20 |
*/
|
21 |
public function __construct() {
|
22 |
|
23 |
$this->id = 'product_input_fields';
|
24 |
$this->short_desc = __( 'Product Input Fields', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'WooCommerce product input fields.', 'woocommerce-jetpack' );
|
|
|
26 |
parent::__construct();
|
27 |
|
28 |
include_once( 'input-fields/class-wcj-product-input-fields-abstract.php' );
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Input Fields class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
16 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
+
* @version 2.4.8
|
20 |
*/
|
21 |
public function __construct() {
|
22 |
|
23 |
$this->id = 'product_input_fields';
|
24 |
$this->short_desc = __( 'Product Input Fields', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'WooCommerce product input fields.', 'woocommerce-jetpack' );
|
26 |
+
$this->link = 'http://booster.io/features/woocommerce-product-input-fields/';
|
27 |
parent::__construct();
|
28 |
|
29 |
include_once( 'input-fields/class-wcj-product-input-fields-abstract.php' );
|
includes/class-wcj-product-listings.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Listings class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,12 +17,13 @@ class WCJ_Product_Listings extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
$this->id = 'product_listings';
|
24 |
$this->short_desc = __( 'Product Listings', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'Change WooCommerce display options for shop and category pages: show/hide categories count, exclude categories, show/hide empty categories.', 'woocommerce-jetpack' );
|
|
|
26 |
parent::__construct();
|
27 |
|
28 |
if ( $this->is_enabled() ) {
|
@@ -30,180 +31,148 @@ class WCJ_Product_Listings extends WCJ_Module {
|
|
30 |
add_filter( 'woocommerce_product_subcategories_args', array( $this, 'filter_subcategories' ), 100 );
|
31 |
add_filter( 'woocommerce_product_subcategories_hide_empty', array( $this, 'filter_subcategories_show_empty' ), 100 );
|
32 |
// Hide Count
|
33 |
-
if ( 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) || 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) )
|
34 |
add_filter( 'woocommerce_subcategory_count_html', array( $this, 'remove_subcategory_count' ), 100 );
|
|
|
35 |
// Settings to "WooCommerce > Settings > Products > Product Listings"
|
36 |
add_filter( 'woocommerce_product_settings', array( $this, 'add_fields_to_woocommerce_settings' ), 100 );
|
37 |
}
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
-
*
|
42 |
-
*
|
43 |
-
* @version 2.4.6
|
44 |
*/
|
45 |
-
function
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
'id' => 'wcj_product_listings_hide_cats_count_on_shop',
|
55 |
-
'default' => 'no',
|
56 |
-
'type' => 'checkbox',
|
57 |
-
),
|
58 |
-
|
59 |
-
array(
|
60 |
-
'title' => __( 'Exclude Categories', 'woocommerce-jetpack' ),
|
61 |
-
'desc_tip' => __(' Excludes one or more categories from the shop page. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
62 |
-
'id' => 'wcj_product_listings_exclude_cats_on_shop',
|
63 |
-
'default' => '',
|
64 |
-
'type' => 'text',
|
65 |
-
'css' => 'width:50%;min-width:300px;',
|
66 |
-
),
|
67 |
-
|
68 |
-
array(
|
69 |
-
'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
|
70 |
-
'desc' => __( 'Hide empty categories on shop page', 'woocommerce-jetpack' ),
|
71 |
-
'id' => 'wcj_product_listings_hide_empty_cats_on_shop',
|
72 |
-
'default' => 'yes',
|
73 |
-
'type' => 'checkbox',
|
74 |
-
),
|
75 |
-
|
76 |
-
array(
|
77 |
-
'title' => __( 'Show Products', 'woocommerce-jetpack' ),
|
78 |
-
'desc' => __( 'Show products if no categories are displayed on shop page', 'woocommerce-jetpack' ),
|
79 |
-
'id' => 'wcj_product_listings_show_products_if_no_cats_on_shop',
|
80 |
-
'default' => 'yes',
|
81 |
-
'type' => 'checkbox',
|
82 |
-
),
|
83 |
-
|
84 |
-
array( 'type' => 'sectionend', 'id' => 'wcj_product_listings_shop_page_options' ),
|
85 |
-
|
86 |
-
array( 'title' => __( 'Category Display Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This will work only when "Default Category Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_archive_pages_options' ),
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
)
|
|
|
|
|
|
|
|
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
'default' => 'yes',
|
112 |
-
'type' => 'checkbox',
|
113 |
-
),
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
'desc' => __( 'Show products if no categories are displayed on category page', 'woocommerce-jetpack' ),
|
118 |
-
'id' => 'wcj_product_listings_show_products_if_no_cats_on_archives',
|
119 |
-
'default' => 'yes',
|
120 |
-
'type' => 'checkbox',
|
121 |
-
),
|
122 |
|
123 |
-
|
124 |
-
)
|
|
|
|
|
|
|
|
|
125 |
|
126 |
-
return $
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
* add_fields_to_woocommerce_settings.
|
131 |
*/
|
132 |
function add_fields_to_woocommerce_settings( $settings ) {
|
133 |
-
|
134 |
$updated_settings = array();
|
135 |
-
|
136 |
foreach ( $settings as $section ) {
|
137 |
-
|
138 |
$updated_settings[] = $section;
|
139 |
-
|
140 |
if ( isset( $section['id'] ) && 'woocommerce_shop_page_display' == $section['id'] ) {
|
141 |
-
|
142 |
$updated_settings[] = array(
|
143 |
'title' => __( 'WooJetpack: Categories Count', 'woocommerce-jetpack' ),
|
144 |
-
'desc'
|
145 |
'id' => 'wcj_product_listings_hide_cats_count_on_shop',
|
146 |
'default' => 'no',
|
147 |
'type' => 'checkbox',
|
148 |
);
|
149 |
-
|
150 |
$updated_settings[] = array(
|
151 |
-
'title'
|
152 |
'desc_tip' => __(' Excludes one or more categories from the shop page. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
153 |
'id' => 'wcj_product_listings_exclude_cats_on_shop',
|
154 |
'default' => '',
|
155 |
'type' => 'text',
|
156 |
-
'css'
|
157 |
);
|
158 |
-
|
159 |
$updated_settings[] = array(
|
160 |
-
'title'
|
161 |
'desc' => __( 'Hide empty categories on shop page', 'woocommerce-jetpack' ),
|
162 |
'id' => 'wcj_product_listings_hide_empty_cats_on_shop',
|
163 |
'default' => 'yes',
|
164 |
'type' => 'checkbox',
|
165 |
);
|
166 |
-
|
167 |
$updated_settings[] = array(
|
168 |
-
'title'
|
169 |
'desc' => __( 'Show products if no categories are displayed on shop page', 'woocommerce-jetpack' ),
|
170 |
'id' => 'wcj_product_listings_show_products_if_no_cats_on_shop',
|
171 |
'default' => 'yes',
|
172 |
'type' => 'checkbox',
|
173 |
);
|
174 |
}
|
175 |
-
|
176 |
if ( isset( $section['id'] ) && 'woocommerce_category_archive_display' == $section['id'] ) {
|
177 |
-
|
178 |
$updated_settings[] = array(
|
179 |
'title' => __( 'WooJetpack: Subcategories Count', 'woocommerce-jetpack' ),
|
180 |
-
'desc'
|
181 |
'id' => 'wcj_product_listings_hide_cats_count_on_archive',
|
182 |
'default' => 'no',
|
183 |
'type' => 'checkbox',
|
184 |
-
'custom_attributes'
|
185 |
-
'desc_tip'
|
186 |
);
|
187 |
-
|
188 |
$updated_settings[] = array(
|
189 |
-
'title'
|
190 |
'desc_tip' => __(' Excludes one or more categories from the category (archive) pages. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
191 |
'id' => 'wcj_product_listings_exclude_cats_on_archives',
|
192 |
'default' => '',
|
193 |
'type' => 'text',
|
194 |
-
'css'
|
195 |
);
|
196 |
-
|
197 |
$updated_settings[] = array(
|
198 |
-
'title'
|
199 |
'desc' => __( 'Hide empty subcategories on category pages', 'woocommerce-jetpack' ),
|
200 |
'id' => 'wcj_product_listings_hide_empty_cats_on_archives',
|
201 |
'default' => 'yes',
|
202 |
'type' => 'checkbox',
|
203 |
);
|
204 |
-
|
205 |
$updated_settings[] = array(
|
206 |
-
'title'
|
207 |
'desc' => __( 'Show products if no categories are displayed on category page', 'woocommerce-jetpack' ),
|
208 |
'id' => 'wcj_product_listings_show_products_if_no_cats_on_archives',
|
209 |
'default' => 'yes',
|
@@ -211,71 +180,100 @@ class WCJ_Product_Listings extends WCJ_Module {
|
|
211 |
);
|
212 |
}
|
213 |
}
|
214 |
-
|
215 |
return $updated_settings;
|
216 |
}
|
217 |
|
218 |
/**
|
219 |
-
*
|
220 |
-
|
221 |
-
|
222 |
-
if ( ( is_shop() && 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) ) ||
|
223 |
-
( ! is_shop() && 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) ) )
|
224 |
-
return '';
|
225 |
-
return $count_html;
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* filter_subcategories.
|
230 |
-
*/
|
231 |
-
public function filter_subcategories( $args ) {
|
232 |
-
if ( is_shop() ) {
|
233 |
-
$args['exclude'] = get_option( 'wcj_product_listings_exclude_cats_on_shop' );
|
234 |
-
$args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_shop' ) ) ? 1 : 0; // depreciated?
|
235 |
-
}
|
236 |
-
else {
|
237 |
-
$args['exclude'] = get_option( 'wcj_product_listings_exclude_cats_on_archives' );
|
238 |
-
$args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? 1 : 0; // depreciated?
|
239 |
-
}
|
240 |
-
return $args;
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* hide_products_by_disabling_loop.
|
245 |
*/
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
|
263 |
-
/**
|
264 |
-
* filter_subcategories_show_empty.
|
265 |
-
*/
|
266 |
-
public function filter_subcategories_show_empty() {
|
267 |
-
|
268 |
-
// Not the best solution, but it's the only place I found to put it...
|
269 |
-
$this->hide_products_by_disabling_loop();
|
270 |
-
|
271 |
-
$show_empty = false;
|
272 |
-
if ( is_shop() )
|
273 |
-
$show_empty = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_shop' ) ) ? false : true;
|
274 |
-
else
|
275 |
-
$show_empty = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? false : true;
|
276 |
-
|
277 |
-
return $show_empty;
|
278 |
-
}
|
279 |
}
|
280 |
|
281 |
endif;
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Listings class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
$this->id = 'product_listings';
|
24 |
$this->short_desc = __( 'Product Listings', 'woocommerce-jetpack' );
|
25 |
$this->desc = __( 'Change WooCommerce display options for shop and category pages: show/hide categories count, exclude categories, show/hide empty categories.', 'woocommerce-jetpack' );
|
26 |
+
$this->link = 'http://booster.io/features/woocommerce-product-listings/';
|
27 |
parent::__construct();
|
28 |
|
29 |
if ( $this->is_enabled() ) {
|
31 |
add_filter( 'woocommerce_product_subcategories_args', array( $this, 'filter_subcategories' ), 100 );
|
32 |
add_filter( 'woocommerce_product_subcategories_hide_empty', array( $this, 'filter_subcategories_show_empty' ), 100 );
|
33 |
// Hide Count
|
34 |
+
if ( 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) || 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) {
|
35 |
add_filter( 'woocommerce_subcategory_count_html', array( $this, 'remove_subcategory_count' ), 100 );
|
36 |
+
}
|
37 |
// Settings to "WooCommerce > Settings > Products > Product Listings"
|
38 |
add_filter( 'woocommerce_product_settings', array( $this, 'add_fields_to_woocommerce_settings' ), 100 );
|
39 |
}
|
40 |
}
|
41 |
|
42 |
/**
|
43 |
+
* remove_subcategory_count.
|
|
|
|
|
44 |
*/
|
45 |
+
public function remove_subcategory_count( $count_html ) {
|
46 |
+
if (
|
47 |
+
( is_shop() && 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) ) ||
|
48 |
+
( ! is_shop() && 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) )
|
49 |
+
) {
|
50 |
+
return '';
|
51 |
+
}
|
52 |
+
return $count_html;
|
53 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
/**
|
56 |
+
* filter_subcategories.
|
57 |
+
*/
|
58 |
+
public function filter_subcategories( $args ) {
|
59 |
+
if ( is_shop() ) {
|
60 |
+
$args['exclude'] = get_option( 'wcj_product_listings_exclude_cats_on_shop' );
|
61 |
+
$args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_shop' ) ) ? 1 : 0; // depreciated?
|
62 |
+
} else {
|
63 |
+
$args['exclude'] = get_option( 'wcj_product_listings_exclude_cats_on_archives' );
|
64 |
+
$args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? 1 : 0; // depreciated?
|
65 |
+
}
|
66 |
+
return $args;
|
67 |
+
}
|
68 |
|
69 |
+
/**
|
70 |
+
* hide_products_by_disabling_loop.
|
71 |
+
*/
|
72 |
+
public function hide_products_by_disabling_loop() {
|
73 |
+
// If we are hiding products disable the loop and pagination
|
74 |
+
global $wp_query;
|
75 |
+
if (
|
76 |
+
is_product_category() &&
|
77 |
+
get_option( 'woocommerce_category_archive_display' ) == 'subcategories' &&
|
78 |
+
'no' === get_option( 'wcj_product_listings_show_products_if_no_cats_on_archives' )
|
79 |
+
) {
|
80 |
+
$wp_query->post_count = 0;
|
81 |
+
$wp_query->max_num_pages = 0;
|
82 |
+
}
|
83 |
+
if (
|
84 |
+
is_shop() &&
|
85 |
+
get_option( 'woocommerce_shop_page_display' ) == 'subcategories' &&
|
86 |
+
'no' === get_option( 'wcj_product_listings_show_products_if_no_cats_on_shop' )
|
87 |
+
) {
|
88 |
+
$wp_query->post_count = 0;
|
89 |
+
$wp_query->max_num_pages = 0;
|
90 |
+
}
|
91 |
+
}
|
92 |
|
93 |
+
/**
|
94 |
+
* filter_subcategories_show_empty.
|
95 |
+
*/
|
96 |
+
public function filter_subcategories_show_empty() {
|
|
|
|
|
|
|
97 |
|
98 |
+
// Not the best solution, but it's the only place I found to put it...
|
99 |
+
$this->hide_products_by_disabling_loop();
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
+
$show_empty = false;
|
102 |
+
if ( is_shop() ) {
|
103 |
+
$show_empty = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_shop' ) ) ? false : true;
|
104 |
+
} else {
|
105 |
+
$show_empty = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? false : true;
|
106 |
+
}
|
107 |
|
108 |
+
return $show_empty;
|
109 |
}
|
110 |
|
111 |
/**
|
112 |
* add_fields_to_woocommerce_settings.
|
113 |
*/
|
114 |
function add_fields_to_woocommerce_settings( $settings ) {
|
|
|
115 |
$updated_settings = array();
|
|
|
116 |
foreach ( $settings as $section ) {
|
|
|
117 |
$updated_settings[] = $section;
|
|
|
118 |
if ( isset( $section['id'] ) && 'woocommerce_shop_page_display' == $section['id'] ) {
|
|
|
119 |
$updated_settings[] = array(
|
120 |
'title' => __( 'WooJetpack: Categories Count', 'woocommerce-jetpack' ),
|
121 |
+
'desc' => __( 'Hide categories count on shop page', 'woocommerce-jetpack' ),
|
122 |
'id' => 'wcj_product_listings_hide_cats_count_on_shop',
|
123 |
'default' => 'no',
|
124 |
'type' => 'checkbox',
|
125 |
);
|
|
|
126 |
$updated_settings[] = array(
|
127 |
+
'title' => __( 'WooJetpack: Exclude Categories on Shop Page', 'woocommerce-jetpack' ),
|
128 |
'desc_tip' => __(' Excludes one or more categories from the shop page. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
129 |
'id' => 'wcj_product_listings_exclude_cats_on_shop',
|
130 |
'default' => '',
|
131 |
'type' => 'text',
|
132 |
+
'css' => 'width:50%;min-width:300px;',
|
133 |
);
|
|
|
134 |
$updated_settings[] = array(
|
135 |
+
'title' => __( 'WooJetpack: Hide Empty', 'woocommerce-jetpack' ),
|
136 |
'desc' => __( 'Hide empty categories on shop page', 'woocommerce-jetpack' ),
|
137 |
'id' => 'wcj_product_listings_hide_empty_cats_on_shop',
|
138 |
'default' => 'yes',
|
139 |
'type' => 'checkbox',
|
140 |
);
|
|
|
141 |
$updated_settings[] = array(
|
142 |
+
'title' => __( 'WooJetpack: Show Products', 'woocommerce-jetpack' ),
|
143 |
'desc' => __( 'Show products if no categories are displayed on shop page', 'woocommerce-jetpack' ),
|
144 |
'id' => 'wcj_product_listings_show_products_if_no_cats_on_shop',
|
145 |
'default' => 'yes',
|
146 |
'type' => 'checkbox',
|
147 |
);
|
148 |
}
|
|
|
149 |
if ( isset( $section['id'] ) && 'woocommerce_category_archive_display' == $section['id'] ) {
|
|
|
150 |
$updated_settings[] = array(
|
151 |
'title' => __( 'WooJetpack: Subcategories Count', 'woocommerce-jetpack' ),
|
152 |
+
'desc' => __( 'Hide subcategories count on category pages', 'woocommerce-jetpack' ),
|
153 |
'id' => 'wcj_product_listings_hide_cats_count_on_archive',
|
154 |
'default' => 'no',
|
155 |
'type' => 'checkbox',
|
156 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
157 |
+
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
158 |
);
|
|
|
159 |
$updated_settings[] = array(
|
160 |
+
'title' => __( 'WooJetpack: Exclude Subcategories on Category Pages', 'woocommerce-jetpack' ),
|
161 |
'desc_tip' => __(' Excludes one or more categories from the category (archive) pages. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
162 |
'id' => 'wcj_product_listings_exclude_cats_on_archives',
|
163 |
'default' => '',
|
164 |
'type' => 'text',
|
165 |
+
'css' => 'width:50%;min-width:300px;',
|
166 |
);
|
|
|
167 |
$updated_settings[] = array(
|
168 |
+
'title' => __( 'WooJetpack: Hide Empty', 'woocommerce-jetpack' ),
|
169 |
'desc' => __( 'Hide empty subcategories on category pages', 'woocommerce-jetpack' ),
|
170 |
'id' => 'wcj_product_listings_hide_empty_cats_on_archives',
|
171 |
'default' => 'yes',
|
172 |
'type' => 'checkbox',
|
173 |
);
|
|
|
174 |
$updated_settings[] = array(
|
175 |
+
'title' => __( 'WooJetpack: Show Products', 'woocommerce-jetpack' ),
|
176 |
'desc' => __( 'Show products if no categories are displayed on category page', 'woocommerce-jetpack' ),
|
177 |
'id' => 'wcj_product_listings_show_products_if_no_cats_on_archives',
|
178 |
'default' => 'yes',
|
180 |
);
|
181 |
}
|
182 |
}
|
|
|
183 |
return $updated_settings;
|
184 |
}
|
185 |
|
186 |
/**
|
187 |
+
* get_settings.
|
188 |
+
*
|
189 |
+
* @version 2.4.6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
*/
|
191 |
+
function get_settings() {
|
192 |
+
$settings = array(
|
193 |
+
array(
|
194 |
+
'title' => __( 'Shop Page Display Options', 'woocommerce-jetpack' ),
|
195 |
+
'type' => 'title',
|
196 |
+
'desc' => __( 'This will work only when "Shop Page Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ),
|
197 |
+
'id' => 'wcj_product_listings_shop_page_options',
|
198 |
+
),
|
199 |
+
array(
|
200 |
+
'title' => __( 'Categories Count', 'woocommerce-jetpack' ),
|
201 |
+
'desc' => __( 'Hide categories count on shop page', 'woocommerce-jetpack' ),
|
202 |
+
'id' => 'wcj_product_listings_hide_cats_count_on_shop',
|
203 |
+
'default' => 'no',
|
204 |
+
'type' => 'checkbox',
|
205 |
+
),
|
206 |
+
array(
|
207 |
+
'title' => __( 'Exclude Categories', 'woocommerce-jetpack' ),
|
208 |
+
'desc_tip' => __(' Excludes one or more categories from the shop page. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
209 |
+
'id' => 'wcj_product_listings_exclude_cats_on_shop',
|
210 |
+
'default' => '',
|
211 |
+
'type' => 'text',
|
212 |
+
'css' => 'width:50%;min-width:300px;',
|
213 |
+
),
|
214 |
+
array(
|
215 |
+
'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
|
216 |
+
'desc' => __( 'Hide empty categories on shop page', 'woocommerce-jetpack' ),
|
217 |
+
'id' => 'wcj_product_listings_hide_empty_cats_on_shop',
|
218 |
+
'default' => 'yes',
|
219 |
+
'type' => 'checkbox',
|
220 |
+
),
|
221 |
+
array(
|
222 |
+
'title' => __( 'Show Products', 'woocommerce-jetpack' ),
|
223 |
+
'desc' => __( 'Show products if no categories are displayed on shop page', 'woocommerce-jetpack' ),
|
224 |
+
'id' => 'wcj_product_listings_show_products_if_no_cats_on_shop',
|
225 |
+
'default' => 'yes',
|
226 |
+
'type' => 'checkbox',
|
227 |
+
),
|
228 |
+
array(
|
229 |
+
'type' => 'sectionend',
|
230 |
+
'id' => 'wcj_product_listings_shop_page_options',
|
231 |
+
),
|
232 |
+
array(
|
233 |
+
'title' => __( 'Category Display Options', 'woocommerce-jetpack' ),
|
234 |
+
'type' => 'title',
|
235 |
+
'desc' => __( 'This will work only when "Default Category Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ),
|
236 |
+
'id' => 'wcj_product_listings_archive_pages_options',
|
237 |
+
),
|
238 |
+
array(
|
239 |
+
'title' => __( 'Subcategories Count', 'woocommerce-jetpack' ),
|
240 |
+
'desc' => __( 'Hide subcategories count on category pages', 'woocommerce-jetpack' ),
|
241 |
+
'id' => 'wcj_product_listings_hide_cats_count_on_archive',
|
242 |
+
'default' => 'no',
|
243 |
+
'type' => 'checkbox',
|
244 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
245 |
+
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
246 |
+
),
|
247 |
+
array(
|
248 |
+
'title' => __( 'Exclude Subcategories', 'woocommerce-jetpack' ),
|
249 |
+
'desc_tip' => __(' Excludes one or more categories from the category (archive) pages. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
|
250 |
+
'id' => 'wcj_product_listings_exclude_cats_on_archives',
|
251 |
+
'default' => '',
|
252 |
+
'type' => 'text',
|
253 |
+
'css' => 'width:50%;min-width:300px;',
|
254 |
+
),
|
255 |
+
array(
|
256 |
+
'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
|
257 |
+
'desc' => __( 'Hide empty subcategories on category pages', 'woocommerce-jetpack' ),
|
258 |
+
'id' => 'wcj_product_listings_hide_empty_cats_on_archives',
|
259 |
+
'default' => 'yes',
|
260 |
+
'type' => 'checkbox',
|
261 |
+
),
|
262 |
+
array(
|
263 |
+
'title' => __( 'Show Products', 'woocommerce-jetpack' ),
|
264 |
+
'desc' => __( 'Show products if no categories are displayed on category page', 'woocommerce-jetpack' ),
|
265 |
+
'id' => 'wcj_product_listings_show_products_if_no_cats_on_archives',
|
266 |
+
'default' => 'yes',
|
267 |
+
'type' => 'checkbox',
|
268 |
+
),
|
269 |
+
array(
|
270 |
+
'type' => 'sectionend',
|
271 |
+
'id' => 'wcj_product_listings_archive_pages_options',
|
272 |
+
),
|
273 |
+
);
|
274 |
+
return $this->add_standard_settings( $settings );
|
275 |
}
|
276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
}
|
278 |
|
279 |
endif;
|
includes/class-wcj-product-open-pricing.php
ADDED
@@ -0,0 +1,394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Product Open Pricing
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Product Open Pricing class.
|
6 |
+
*
|
7 |
+
* @version 2.4.8
|
8 |
+
* @since 2.4.8
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WCJ_Product_Open_Pricing' ) ) :
|
15 |
+
|
16 |
+
class WCJ_Product_Open_Pricing extends WCJ_Module {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor.
|
20 |
+
*
|
21 |
+
* @version 2.4.8
|
22 |
+
* @since 2.4.8
|
23 |
+
*/
|
24 |
+
function __construct() {
|
25 |
+
|
26 |
+
$this->id = 'product_open_pricing';
|
27 |
+
$this->short_desc = __( 'Product Open Pricing (Name Your Price)', 'woocommerce-jetpack' );
|
28 |
+
$this->desc = __( 'Let your WooCommerce store customers enter price for the product manually.', 'woocommerce-jetpack' );
|
29 |
+
$this->link = '';
|
30 |
+
parent::__construct();
|
31 |
+
|
32 |
+
if ( $this->is_enabled() ) {
|
33 |
+
add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
|
34 |
+
add_action( 'save_post_product', array( $this, 'save_meta_box' ), PHP_INT_MAX, 2 );
|
35 |
+
add_filter( 'woocommerce_get_price', array( $this, 'get_open_price' ), PHP_INT_MAX, 2 );
|
36 |
+
add_filter( 'woocommerce_get_price_html', array( $this, 'hide_original_price' ), PHP_INT_MAX, 2 );
|
37 |
+
add_filter( 'woocommerce_get_variation_price_html', array( $this, 'hide_original_price' ), PHP_INT_MAX, 2 );
|
38 |
+
add_filter( 'woocommerce_is_sold_individually', array( $this, 'hide_quantity_input_field' ), PHP_INT_MAX, 2 );
|
39 |
+
add_filter( 'woocommerce_is_purchasable', array( $this, 'is_purchasable' ), PHP_INT_MAX, 2 );
|
40 |
+
add_filter( 'woocommerce_product_add_to_cart_url', array( $this, 'add_to_cart_url' ), PHP_INT_MAX, 2 );
|
41 |
+
add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'add_to_cart_text' ), PHP_INT_MAX, 2 );
|
42 |
+
add_action( 'woocommerce_before_add_to_cart_button', array( $this, 'add_open_price_input_field_to_frontend' ), PHP_INT_MAX );
|
43 |
+
add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'validate_open_price_on_add_to_cart' ), PHP_INT_MAX, 2 );
|
44 |
+
add_filter( 'woocommerce_add_cart_item_data', array( $this, 'add_open_price_to_cart_item_data' ), PHP_INT_MAX, 3 );
|
45 |
+
add_filter( 'woocommerce_add_cart_item', array( $this, 'add_open_price_to_cart_item' ), PHP_INT_MAX, 2 );
|
46 |
+
add_filter( 'woocommerce_get_cart_item_from_session', array( $this, 'get_cart_item_open_price_from_session' ), PHP_INT_MAX, 3 );
|
47 |
+
add_filter( 'wcj_save_meta_box_value', array( $this, 'save_meta_box_value' ), PHP_INT_MAX, 3 );
|
48 |
+
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* is_open_price_product.
|
54 |
+
*
|
55 |
+
* @version 2.4.8
|
56 |
+
* @since 2.4.8
|
57 |
+
*/
|
58 |
+
function is_open_price_product( $_product ) {
|
59 |
+
return ( 'yes' === get_post_meta( $_product->id, '_' . 'wcj_product_open_price_enabled', true ) ) ? true : false;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* save_meta_box_value.
|
64 |
+
*
|
65 |
+
* @version 2.4.8
|
66 |
+
* @since 2.4.8
|
67 |
+
*/
|
68 |
+
function save_meta_box_value( $option_value, $option_name, $module_id ) {
|
69 |
+
if ( true === apply_filters( 'wcj_get_option_filter', false, true ) ) {
|
70 |
+
return $option_value;
|
71 |
+
}
|
72 |
+
if ( 'no' === $option_value ) {
|
73 |
+
return $option_value;
|
74 |
+
}
|
75 |
+
if ( $this->id === $module_id && 'wcj_product_open_price_enabled' === $option_name ) {
|
76 |
+
$args = array(
|
77 |
+
'post_type' => 'product',
|
78 |
+
'post_status' => 'any',
|
79 |
+
'posts_per_page' => -1,
|
80 |
+
'meta_key' => '_' . 'wcj_product_open_price_enabled',
|
81 |
+
'meta_value' => 'yes',
|
82 |
+
);
|
83 |
+
$loop = new WP_Query( $args );
|
84 |
+
$c = $loop->found_posts;
|
85 |
+
if ( $c >= 2 ) {
|
86 |
+
add_filter( 'redirect_post_location', array( $this, 'add_notice_query_var' ), 99 );
|
87 |
+
return 'no';
|
88 |
+
}
|
89 |
+
}
|
90 |
+
return $option_value;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* add_notice_query_var.
|
95 |
+
*
|
96 |
+
* @version 2.4.8
|
97 |
+
* @since 2.4.8
|
98 |
+
*/
|
99 |
+
function add_notice_query_var( $location ) {
|
100 |
+
remove_filter( 'redirect_post_location', array( $this, 'add_notice_query_var' ), 99 );
|
101 |
+
return add_query_arg( array( 'wcj_product_open_price_admin_notice' => true ), $location );
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* admin_notices.
|
106 |
+
*
|
107 |
+
* @version 2.4.8
|
108 |
+
* @since 2.4.8
|
109 |
+
*/
|
110 |
+
function admin_notices() {
|
111 |
+
if ( ! isset( $_GET['wcj_product_open_price_admin_notice'] ) ) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
?><div class="error"><p><?php
|
115 |
+
echo '<div class="message">'
|
116 |
+
. __( 'Booster: Free plugin\'s version is limited to only one open pricing product enabled at a time. You will need to get <a href="http://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of open pricing products.', 'woocommerce-jetpack' )
|
117 |
+
. '</div>';
|
118 |
+
?></p></div><?php
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* is_purchasable.
|
123 |
+
*
|
124 |
+
* @version 2.4.8
|
125 |
+
* @since 2.4.8
|
126 |
+
*/
|
127 |
+
function is_purchasable( $purchasable, $_product ) {
|
128 |
+
if ( $this->is_open_price_product( $_product ) ) {
|
129 |
+
$purchasable = true;
|
130 |
+
|
131 |
+
// Products must exist of course
|
132 |
+
if ( ! $_product->exists() ) {
|
133 |
+
$purchasable = false;
|
134 |
+
|
135 |
+
// Other products types need a price to be set
|
136 |
+
/* } elseif ( $_product->get_price() === '' ) {
|
137 |
+
$purchasable = false; */
|
138 |
+
|
139 |
+
// Check the product is published
|
140 |
+
} elseif ( $_product->post->post_status !== 'publish' && ! current_user_can( 'edit_post', $_product->id ) ) {
|
141 |
+
$purchasable = false;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
return $purchasable;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* get_meta_box_options.
|
149 |
+
*
|
150 |
+
* @version 2.4.8
|
151 |
+
* @since 2.4.8
|
152 |
+
*/
|
153 |
+
function get_meta_box_options() {
|
154 |
+
$options = array(
|
155 |
+
array(
|
156 |
+
'name' => 'wcj_product_open_price_enabled',
|
157 |
+
'default' => 'no',
|
158 |
+
'type' => 'select',
|
159 |
+
'options' => array(
|
160 |
+
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
161 |
+
'no' => __( 'No', 'woocommerce-jetpack' ),
|
162 |
+
),
|
163 |
+
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
164 |
+
),
|
165 |
+
array(
|
166 |
+
'name' => 'wcj_product_open_price_default_price',
|
167 |
+
'default' => '',
|
168 |
+
'type' => 'number',
|
169 |
+
'title' => __( 'Default Price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
170 |
+
),
|
171 |
+
array(
|
172 |
+
'name' => 'wcj_product_open_price_min_price',
|
173 |
+
'default' => 1,
|
174 |
+
'type' => 'number',
|
175 |
+
'title' => __( 'Min Price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
176 |
+
),
|
177 |
+
array(
|
178 |
+
'name' => 'wcj_product_open_price_max_price',
|
179 |
+
'default' => '',
|
180 |
+
'type' => 'number',
|
181 |
+
'title' => __( 'Max Price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
182 |
+
),
|
183 |
+
);
|
184 |
+
return $options;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* add_to_cart_text.
|
189 |
+
*
|
190 |
+
* @version 2.4.8
|
191 |
+
* @since 2.4.8
|
192 |
+
*/
|
193 |
+
function add_to_cart_text( $text, $_product ) {
|
194 |
+
return ( $this->is_open_price_product( $_product ) ) ? __( 'Read more', 'woocommerce' ) : $text;
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* add_to_cart_url.
|
199 |
+
*
|
200 |
+
* @version 2.4.8
|
201 |
+
* @since 2.4.8
|
202 |
+
*/
|
203 |
+
function add_to_cart_url( $url, $_product ) {
|
204 |
+
return ( $this->is_open_price_product( $_product ) ) ? get_permalink( $_product->id ) : $url;
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* hide_quantity_input_field.
|
209 |
+
*
|
210 |
+
* @version 2.4.8
|
211 |
+
* @since 2.4.8
|
212 |
+
*/
|
213 |
+
function hide_quantity_input_field( $return, $_product ) {
|
214 |
+
return ( $this->is_open_price_product( $_product ) ) ? true : $return;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* hide_original_price.
|
219 |
+
*
|
220 |
+
* @version 2.4.8
|
221 |
+
* @since 2.4.8
|
222 |
+
*/
|
223 |
+
function hide_original_price( $price, $_product ) {
|
224 |
+
return ( $this->is_open_price_product( $_product ) ) ? '' : $price;
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* get_open_price.
|
229 |
+
*
|
230 |
+
* @version 2.4.8
|
231 |
+
* @since 2.4.8
|
232 |
+
*/
|
233 |
+
function get_open_price( $price, $_product ) {
|
234 |
+
return ( $this->is_open_price_product( $_product ) && isset( $_product->wcj_open_price ) ) ? $_product->wcj_open_price : $price;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* validate_open_price_on_add_to_cart.
|
239 |
+
*
|
240 |
+
* @version 2.4.8
|
241 |
+
* @since 2.4.8
|
242 |
+
*/
|
243 |
+
function validate_open_price_on_add_to_cart( $passed, $product_id ) {
|
244 |
+
$the_product = wc_get_product( $product_id );
|
245 |
+
if ( $this->is_open_price_product( $the_product ) ) {
|
246 |
+
$min_price = get_post_meta( $product_id, '_' . 'wcj_product_open_price_min_price', true );
|
247 |
+
$max_price = get_post_meta( $product_id, '_' . 'wcj_product_open_price_max_price', true );
|
248 |
+
if ( $min_price > 0 ) {
|
249 |
+
if ( ! isset( $_POST['wcj_open_price'] ) || '' === $_POST['wcj_open_price'] ) {
|
250 |
+
wc_add_notice( get_option( 'wcj_product_open_price_messages_required', __( 'Price is required!', 'woocommerce-jetpack' ) ), 'error' );
|
251 |
+
return false;
|
252 |
+
}
|
253 |
+
if ( $_POST['wcj_open_price'] < $min_price ) {
|
254 |
+
wc_add_notice( get_option( 'wcj_product_open_price_messages_to_small', __( 'Entered price is to small!', 'woocommerce-jetpack' ) ), 'error' );
|
255 |
+
return false;
|
256 |
+
}
|
257 |
+
}
|
258 |
+
if ( $max_price > 0 ) {
|
259 |
+
if ( isset( $_POST['wcj_open_price'] ) && $_POST['wcj_open_price'] > $max_price ) {
|
260 |
+
wc_add_notice( get_option( 'wcj_product_open_price_messages_to_big', __( 'Entered price is to big!', 'woocommerce-jetpack' ) ), 'error' );
|
261 |
+
return false;
|
262 |
+
}
|
263 |
+
}
|
264 |
+
}
|
265 |
+
return $passed;
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* get_cart_item_open_price_from_session.
|
270 |
+
*
|
271 |
+
* @version 2.4.8
|
272 |
+
* @since 2.4.8
|
273 |
+
*/
|
274 |
+
function get_cart_item_open_price_from_session( $item, $values, $key ) {
|
275 |
+
if ( array_key_exists( 'wcj_open_price', $values ) ) {
|
276 |
+
$item['data']->wcj_open_price = $values['wcj_open_price'];
|
277 |
+
}
|
278 |
+
return $item;
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* add_open_price_to_cart_item_data.
|
283 |
+
*
|
284 |
+
* @version 2.4.8
|
285 |
+
* @since 2.4.8
|
286 |
+
*/
|
287 |
+
function add_open_price_to_cart_item_data( $cart_item_data, $product_id, $variation_id ) {
|
288 |
+
if ( isset( $_POST['wcj_open_price'] ) ) {
|
289 |
+
$cart_item_data['wcj_open_price'] = $_POST['wcj_open_price'];
|
290 |
+
}
|
291 |
+
return $cart_item_data;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* add_open_price_to_cart_item.
|
296 |
+
*
|
297 |
+
* @version 2.4.8
|
298 |
+
* @since 2.4.8
|
299 |
+
*/
|
300 |
+
function add_open_price_to_cart_item( $cart_item_data, $cart_item_key ) {
|
301 |
+
if ( isset( $cart_item_data['wcj_open_price'] ) ) {
|
302 |
+
$cart_item_data['data']->wcj_open_price = $cart_item_data['wcj_open_price'];
|
303 |
+
}
|
304 |
+
return $cart_item_data;
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* add_open_price_input_field_to_frontend.
|
309 |
+
*
|
310 |
+
* @version 2.4.8
|
311 |
+
* @since 2.4.8
|
312 |
+
*/
|
313 |
+
function add_open_price_input_field_to_frontend() {
|
314 |
+
$the_product = wc_get_product();
|
315 |
+
if ( $this->is_open_price_product( $the_product ) ) {
|
316 |
+
$title = get_option( 'wcj_product_open_price_label_frontend', __( 'Name Your Price', 'woocommerce-jetpack' ) );
|
317 |
+
// $placeholder = $the_product->get_price();
|
318 |
+
$value = ( isset( $_POST['wcj_open_price'] ) ) ?
|
319 |
+
$_POST['wcj_open_price'] :
|
320 |
+
get_post_meta( $the_product->id, '_' . 'wcj_product_open_price_default_price', true );
|
321 |
+
$custom_attributes = '';
|
322 |
+
$wc_price_decimals = wc_get_price_decimals();
|
323 |
+
if ( $wc_price_decimals > 0 ) {
|
324 |
+
$custom_attributes .= sprintf( 'step="0.%0' . ( $wc_price_decimals ) . 'd" ', 1 );
|
325 |
+
}
|
326 |
+
echo
|
327 |
+
/* '<div>' . */ '<label for="wcj_open_price">' . $title . '</label>' . ' '
|
328 |
+
. '<input '
|
329 |
+
. 'type="number" '
|
330 |
+
. 'class="text" '
|
331 |
+
. 'style="width:75px;text-align:center;" '
|
332 |
+
. 'name="wcj_open_price" '
|
333 |
+
. 'id="wcj_open_price" '
|
334 |
+
// . 'placeholder="' . $placeholder . '" '
|
335 |
+
. 'value="' . $value . '" '
|
336 |
+
. $custom_attributes
|
337 |
+
. '>'
|
338 |
+
. ' ' . get_woocommerce_currency_symbol() /* . '</div>' */;
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* get_settings.
|
344 |
+
*
|
345 |
+
* @version 2.4.8
|
346 |
+
* @since 2.4.8
|
347 |
+
*/
|
348 |
+
function get_settings() {
|
349 |
+
$settings = array(
|
350 |
+
array(
|
351 |
+
'title' => __( 'Labels and Messages', 'woocommerce-jetpack' ),
|
352 |
+
'type' => 'title',
|
353 |
+
'id' => 'wcj_product_open_price_messages_options',
|
354 |
+
),
|
355 |
+
array(
|
356 |
+
'title' => __( 'Frontend Label', 'woocommerce-jetpack' ),
|
357 |
+
'id' => 'wcj_product_open_price_label_frontend',
|
358 |
+
'default' => __( 'Name Your Price', 'woocommerce-jetpack' ),
|
359 |
+
'type' => 'text',
|
360 |
+
'css' => 'width:250px;',
|
361 |
+
),
|
362 |
+
array(
|
363 |
+
'title' => __( 'Message on Empty Price', 'woocommerce-jetpack' ),
|
364 |
+
'id' => 'wcj_product_open_price_messages_required',
|
365 |
+
'default' => __( 'Price is required!', 'woocommerce-jetpack' ),
|
366 |
+
'type' => 'text',
|
367 |
+
'css' => 'width:250px;',
|
368 |
+
),
|
369 |
+
array(
|
370 |
+
'title' => __( 'Message on Price to Small', 'woocommerce-jetpack' ),
|
371 |
+
'id' => 'wcj_product_open_price_messages_to_small',
|
372 |
+
'default' => __( 'Entered price is to small!', 'woocommerce-jetpack' ),
|
373 |
+
'type' => 'text',
|
374 |
+
'css' => 'width:250px;',
|
375 |
+
),
|
376 |
+
array(
|
377 |
+
'title' => __( 'Message on Price to Big', 'woocommerce-jetpack' ),
|
378 |
+
'id' => 'wcj_product_open_price_messages_to_big',
|
379 |
+
'default' => __( 'Entered price is to big!', 'woocommerce-jetpack' ),
|
380 |
+
'type' => 'text',
|
381 |
+
'css' => 'width:250px;',
|
382 |
+
),
|
383 |
+
array(
|
384 |
+
'type' => 'sectionend',
|
385 |
+
'id' => 'wcj_product_open_price_messages_options',
|
386 |
+
),
|
387 |
+
);
|
388 |
+
return $this->add_standard_settings( $settings );
|
389 |
+
}
|
390 |
+
}
|
391 |
+
|
392 |
+
endif;
|
393 |
+
|
394 |
+
return new WCJ_Product_Open_Pricing();
|
includes/class-wcj-product-tabs.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Tabs class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,13 +17,14 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'product_tabs';
|
25 |
$this->short_desc = __( 'Product Tabs', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Add custom product tabs - globally or per product. Customize or completely remove WooCommerce default product tabs.', 'woocommerce-jetpack' );
|
|
|
27 |
parent::__construct();
|
28 |
|
29 |
if ( $this->is_enabled() ) {
|
@@ -385,7 +386,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
385 |
/**
|
386 |
* create_custom_tabs_meta_box.
|
387 |
*
|
388 |
-
* @version 2.4.
|
389 |
*/
|
390 |
public function create_custom_tabs_meta_box() {
|
391 |
|
@@ -404,7 +405,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
404 |
$html .= __( 'Total number of custom tabs', 'woocommerce-jetpack' );
|
405 |
$html .= '</th>';
|
406 |
$html .= '<td>';
|
407 |
-
$html .= '<input type="number" id="' . $option_name . '" name="' . $option_name . '" value="' . $total_custom_tabs . '" ' . $is_disabled . '>';
|
408 |
$html .= '</td>';
|
409 |
$html .= '<td>';
|
410 |
$html .= __( 'Click "Update" product after you change this number.', 'woocommerce-jetpack' ) . '<br>' . $is_disabled_message;
|
@@ -412,6 +413,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
412 |
$html .= '</td>';
|
413 |
$html .= '</tr>';
|
414 |
$html .= '</table>';
|
|
|
415 |
|
416 |
$options = array(
|
417 |
array(
|
@@ -419,24 +421,29 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
419 |
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
420 |
'type' => 'text',
|
421 |
),
|
422 |
-
array(
|
423 |
-
'id' => 'wcj_custom_product_tabs_content_local_',
|
424 |
-
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
425 |
-
'type' => 'textarea',
|
426 |
-
),
|
427 |
array(
|
428 |
'id' => 'wcj_custom_product_tabs_priority_local_',
|
429 |
'title' => __( 'Order', 'woocommerce-jetpack' ),
|
430 |
'type' => 'number',
|
431 |
),
|
|
|
|
|
|
|
|
|
|
|
432 |
);
|
|
|
|
|
433 |
for ( $i = 1; $i <= $total_custom_tabs; $i++ ) {
|
434 |
$is_local_tab_visible = $this->is_local_tab_visible( $i, $current_post_id );
|
435 |
$readonly = ( $is_local_tab_visible ) ? '' : ' readonly'; // not really used
|
436 |
$disabled = ( $is_local_tab_visible ) ? '' : ' - ' . __( 'Disabled', 'woocommerce-jetpack' );
|
437 |
$data = array();
|
438 |
-
$html
|
439 |
$html .= '<h4>' . __( 'Custom Product Tab', 'woocommerce-jetpack' ) . ' #' . $i . $disabled . '</h4>';
|
|
|
|
|
|
|
440 |
if ( $is_local_tab_visible ) {
|
441 |
foreach ( $options as $option ) {
|
442 |
$option_id = $option['id'] . $i;
|
@@ -454,22 +461,33 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
454 |
$the_field = '<input style="width:50%;min-width:150px;" type="' . $option['type'] . '" id="' . $option_id . '" name="' . $option_id . '" value="' . $option_value . '"' . $readonly . '>';
|
455 |
break;
|
456 |
case 'textarea':
|
457 |
-
|
|
|
|
|
|
|
|
|
|
|
458 |
break;
|
459 |
}
|
460 |
-
|
|
|
|
|
461 |
}
|
462 |
-
$html .= wcj_get_table_html( $data, array( 'table_class' => 'widefat', 'table_heading_type' => 'vertical', 'columns_styles' => array( 'width:10%;', ) ) );
|
|
|
|
|
|
|
|
|
463 |
}
|
464 |
}
|
465 |
-
$html
|
466 |
echo $html;
|
467 |
}
|
468 |
|
469 |
/**
|
470 |
* get_settings.
|
471 |
*
|
472 |
-
* @version 2.4.
|
473 |
*/
|
474 |
function get_settings() {
|
475 |
|
@@ -488,8 +506,13 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
488 |
'default' => 1,
|
489 |
'type' => 'number',
|
490 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
491 |
-
'custom_attributes'
|
492 |
-
|
|
|
|
|
|
|
|
|
|
|
493 |
),
|
494 |
);
|
495 |
|
@@ -658,14 +681,26 @@ class WCJ_Product_Tabs extends WCJ_Module {
|
|
658 |
'default' => 'yes',
|
659 |
'type' => 'checkbox',
|
660 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
661 |
array(
|
662 |
'title' => __( 'Default Per Product Custom Product Tabs Number', 'woocommerce-jetpack' ),
|
663 |
'id' => 'wcj_custom_product_tabs_local_total_number_default',
|
664 |
'default' => 1,
|
665 |
'type' => 'number',
|
666 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
667 |
-
'custom_attributes'
|
668 |
-
|
|
|
|
|
|
|
|
|
|
|
669 |
),
|
670 |
) );
|
671 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Tabs class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'product_tabs';
|
25 |
$this->short_desc = __( 'Product Tabs', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Add custom product tabs - globally or per product. Customize or completely remove WooCommerce default product tabs.', 'woocommerce-jetpack' );
|
27 |
+
$this->link = 'http://booster.io/features/woocommerce-custom-product-tabs/';
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
386 |
/**
|
387 |
* create_custom_tabs_meta_box.
|
388 |
*
|
389 |
+
* @version 2.4.8
|
390 |
*/
|
391 |
public function create_custom_tabs_meta_box() {
|
392 |
|
405 |
$html .= __( 'Total number of custom tabs', 'woocommerce-jetpack' );
|
406 |
$html .= '</th>';
|
407 |
$html .= '<td>';
|
408 |
+
$html .= '<input type="number" min="1" id="' . $option_name . '" name="' . $option_name . '" value="' . $total_custom_tabs . '" ' . $is_disabled . '>';
|
409 |
$html .= '</td>';
|
410 |
$html .= '<td>';
|
411 |
$html .= __( 'Click "Update" product after you change this number.', 'woocommerce-jetpack' ) . '<br>' . $is_disabled_message;
|
413 |
$html .= '</td>';
|
414 |
$html .= '</tr>';
|
415 |
$html .= '</table>';
|
416 |
+
echo $html;
|
417 |
|
418 |
$options = array(
|
419 |
array(
|
421 |
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
422 |
'type' => 'text',
|
423 |
),
|
|
|
|
|
|
|
|
|
|
|
424 |
array(
|
425 |
'id' => 'wcj_custom_product_tabs_priority_local_',
|
426 |
'title' => __( 'Order', 'woocommerce-jetpack' ),
|
427 |
'type' => 'number',
|
428 |
),
|
429 |
+
array(
|
430 |
+
'id' => 'wcj_custom_product_tabs_content_local_',
|
431 |
+
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
432 |
+
'type' => 'textarea',
|
433 |
+
),
|
434 |
);
|
435 |
+
$enable_wp_editor = get_option( 'wcj_custom_product_tabs_local_wp_editor_enabled', 'yes' );
|
436 |
+
$enable_wp_editor = ( 'yes' === $enable_wp_editor ) ? true : false;
|
437 |
for ( $i = 1; $i <= $total_custom_tabs; $i++ ) {
|
438 |
$is_local_tab_visible = $this->is_local_tab_visible( $i, $current_post_id );
|
439 |
$readonly = ( $is_local_tab_visible ) ? '' : ' readonly'; // not really used
|
440 |
$disabled = ( $is_local_tab_visible ) ? '' : ' - ' . __( 'Disabled', 'woocommerce-jetpack' );
|
441 |
$data = array();
|
442 |
+
$html = '<hr>';
|
443 |
$html .= '<h4>' . __( 'Custom Product Tab', 'woocommerce-jetpack' ) . ' #' . $i . $disabled . '</h4>';
|
444 |
+
if ( $enable_wp_editor ) {
|
445 |
+
$the_field_wp_editor = array();
|
446 |
+
}
|
447 |
if ( $is_local_tab_visible ) {
|
448 |
foreach ( $options as $option ) {
|
449 |
$option_id = $option['id'] . $i;
|
461 |
$the_field = '<input style="width:50%;min-width:150px;" type="' . $option['type'] . '" id="' . $option_id . '" name="' . $option_id . '" value="' . $option_value . '"' . $readonly . '>';
|
462 |
break;
|
463 |
case 'textarea':
|
464 |
+
if ( $enable_wp_editor ) {
|
465 |
+
$the_field = '';
|
466 |
+
$the_field_wp_editor = array( $option_id => $option_value );
|
467 |
+
} else {
|
468 |
+
$the_field = '<textarea style="width:100%;height:300px;" id="' . $option_id . '" name="' . $option_id . '"' . $readonly . '>' . $option_value . '</textarea>';
|
469 |
+
}
|
470 |
break;
|
471 |
}
|
472 |
+
if ( '' != $the_field ) {
|
473 |
+
$data[] = array( $option['title'], $the_field );
|
474 |
+
}
|
475 |
}
|
476 |
+
$html .= wcj_get_table_html( $data, array( 'table_class' => 'widefat', 'table_style' => 'margin-bottom:20px;', 'table_heading_type' => 'vertical', 'columns_styles' => array( 'width:10%;', ) ) );
|
477 |
+
}
|
478 |
+
echo $html;
|
479 |
+
if ( $enable_wp_editor && ! empty( $the_field_wp_editor ) ) {
|
480 |
+
wp_editor( current( $the_field_wp_editor ), key( $the_field_wp_editor ) );
|
481 |
}
|
482 |
}
|
483 |
+
$html = '<input type="hidden" name="woojetpack_custom_tabs_save_post" value="woojetpack_custom_tabs_save_post">';
|
484 |
echo $html;
|
485 |
}
|
486 |
|
487 |
/**
|
488 |
* get_settings.
|
489 |
*
|
490 |
+
* @version 2.4.8
|
491 |
*/
|
492 |
function get_settings() {
|
493 |
|
506 |
'default' => 1,
|
507 |
'type' => 'number',
|
508 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
509 |
+
'custom_attributes' => array_merge(
|
510 |
+
is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
|
511 |
+
array(
|
512 |
+
'step' => '1',
|
513 |
+
'min' => '0',
|
514 |
+
)
|
515 |
+
),
|
516 |
),
|
517 |
);
|
518 |
|
681 |
'default' => 'yes',
|
682 |
'type' => 'checkbox',
|
683 |
),
|
684 |
+
array(
|
685 |
+
'title' => __( 'Use Visual Editor', 'woocommerce-jetpack' ),
|
686 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
687 |
+
'id' => 'wcj_custom_product_tabs_local_wp_editor_enabled',
|
688 |
+
'default' => 'yes',
|
689 |
+
'type' => 'checkbox',
|
690 |
+
),
|
691 |
array(
|
692 |
'title' => __( 'Default Per Product Custom Product Tabs Number', 'woocommerce-jetpack' ),
|
693 |
'id' => 'wcj_custom_product_tabs_local_total_number_default',
|
694 |
'default' => 1,
|
695 |
'type' => 'number',
|
696 |
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
697 |
+
'custom_attributes' => array_merge(
|
698 |
+
is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
|
699 |
+
array(
|
700 |
+
'step' => '1',
|
701 |
+
'min' => '0',
|
702 |
+
)
|
703 |
+
),
|
704 |
),
|
705 |
) );
|
706 |
|
includes/class-wcj-purchase-data.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Purchase Data class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -18,13 +18,14 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.4.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'purchase_data';
|
26 |
$this->short_desc = __( 'Product Cost Price', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Save WooCommerce product purchase costs data for admin reports.', 'woocommerce-jetpack' );
|
|
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
@@ -86,7 +87,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
86 |
/**
|
87 |
* get_meta_box_options.
|
88 |
*
|
89 |
-
* @version 2.4.
|
90 |
* @since 2.4.5
|
91 |
* @todo wcj_purchase_price_currency
|
92 |
*/
|
@@ -105,7 +106,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
105 |
}
|
106 |
$options = array();
|
107 |
foreach ( $products as $product_id => $desc ) {
|
108 |
-
$product_options =
|
109 |
array(
|
110 |
'name' => 'wcj_purchase_price_' . $product_id,
|
111 |
'default' => 0,
|
@@ -136,11 +137,33 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
136 |
'meta_name' => '_' . 'wcj_purchase_price_affiliate_commission',
|
137 |
'enabled' => get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ),
|
138 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
array(
|
140 |
'name' => 'wcj_purchase_date_' . $product_id,
|
141 |
'default' => '',
|
142 |
'type' => 'date',
|
143 |
-
'title' => __( '(Last) Purchase date', 'woocommerce-jetpack' ),
|
144 |
'desc' => $desc,
|
145 |
'product_id' => $product_id,
|
146 |
'meta_name' => '_' . 'wcj_purchase_date',
|
@@ -150,7 +173,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
150 |
'name' => 'wcj_purchase_partner_' . $product_id,
|
151 |
'default' => '',
|
152 |
'type' => 'text',
|
153 |
-
'title' => __( 'Seller', 'woocommerce-jetpack' ),
|
154 |
'desc' => $desc,
|
155 |
'product_id' => $product_id,
|
156 |
'meta_name' => '_' . 'wcj_purchase_partner',
|
@@ -160,13 +183,14 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
160 |
'name' => 'wcj_purchase_info_' . $product_id,
|
161 |
'default' => '',
|
162 |
'type' => 'textarea',
|
163 |
-
'title' => __( 'Purchase info', 'woocommerce-jetpack' ),
|
164 |
'desc' => $desc,
|
165 |
'product_id' => $product_id,
|
166 |
'meta_name' => '_' . 'wcj_purchase_info',
|
167 |
'enabled' => get_option( 'wcj_purchase_info_enabled', 'yes' ),
|
168 |
),
|
169 |
-
)
|
|
|
170 |
$options = array_merge( $options, $product_options );
|
171 |
}
|
172 |
return $options;
|
@@ -237,7 +261,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
237 |
/**
|
238 |
* get_settings.
|
239 |
*
|
240 |
-
* @version 2.4.
|
241 |
* @todo add options to set fields and column titles
|
242 |
*/
|
243 |
function get_settings() {
|
@@ -273,6 +297,56 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
273 |
'type' => 'sectionend',
|
274 |
'id' => 'wcj_purchase_data_price_fields_options',
|
275 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
array(
|
277 |
'title' => __( 'Info Fields', 'woocommerce-jetpack' ),
|
278 |
'type' => 'title',
|
@@ -321,7 +395,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
|
|
321 |
'type' => 'sectionend',
|
322 |
'id' => 'wcj_purchase_data_custom_columns_options',
|
323 |
),
|
324 |
-
);
|
325 |
return $this->add_standard_settings( $settings );
|
326 |
}
|
327 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Purchase Data class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'purchase_data';
|
26 |
$this->short_desc = __( 'Product Cost Price', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Save WooCommerce product purchase costs data for admin reports.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-product-cost-price/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
87 |
/**
|
88 |
* get_meta_box_options.
|
89 |
*
|
90 |
+
* @version 2.4.8
|
91 |
* @since 2.4.5
|
92 |
* @todo wcj_purchase_price_currency
|
93 |
*/
|
106 |
}
|
107 |
$options = array();
|
108 |
foreach ( $products as $product_id => $desc ) {
|
109 |
+
$product_options = array(
|
110 |
array(
|
111 |
'name' => 'wcj_purchase_price_' . $product_id,
|
112 |
'default' => 0,
|
137 |
'meta_name' => '_' . 'wcj_purchase_price_affiliate_commission',
|
138 |
'enabled' => get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ),
|
139 |
),
|
140 |
+
);
|
141 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
|
142 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
143 |
+
$the_title = get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' );
|
144 |
+
if ( '' == $the_title ) {
|
145 |
+
continue;
|
146 |
+
}
|
147 |
+
$the_type = get_option( 'wcj_purchase_data_custom_price_field_type_' . $i, 'fixed' );
|
148 |
+
$the_default_value = get_option( 'wcj_purchase_data_custom_price_field_default_value_' . $i, 0 );
|
149 |
+
$the_title .= ( 'fixed' === $the_type ) ? ' (' . get_woocommerce_currency_symbol() . ')' : ' (' . '%' . ')';
|
150 |
+
$product_options[] = array(
|
151 |
+
'name' => 'wcj_purchase_price_custom_field_' . $i . '_' . $product_id,
|
152 |
+
'default' => $the_default_value,
|
153 |
+
'type' => 'price',
|
154 |
+
'title' => $the_title,
|
155 |
+
'desc' => $desc,
|
156 |
+
'product_id' => $product_id,
|
157 |
+
'meta_name' => '_' . 'wcj_purchase_price_custom_field_' . $i,
|
158 |
+
'enabled' => 'yes',
|
159 |
+
);
|
160 |
+
}
|
161 |
+
$product_options = array_merge( $product_options, array(
|
162 |
array(
|
163 |
'name' => 'wcj_purchase_date_' . $product_id,
|
164 |
'default' => '',
|
165 |
'type' => 'date',
|
166 |
+
'title' => '<em>' . __( '(Last) Purchase date', 'woocommerce-jetpack' ) . '</em>',
|
167 |
'desc' => $desc,
|
168 |
'product_id' => $product_id,
|
169 |
'meta_name' => '_' . 'wcj_purchase_date',
|
173 |
'name' => 'wcj_purchase_partner_' . $product_id,
|
174 |
'default' => '',
|
175 |
'type' => 'text',
|
176 |
+
'title' => '<em>' . __( 'Seller', 'woocommerce-jetpack' ) . '</em>',
|
177 |
'desc' => $desc,
|
178 |
'product_id' => $product_id,
|
179 |
'meta_name' => '_' . 'wcj_purchase_partner',
|
183 |
'name' => 'wcj_purchase_info_' . $product_id,
|
184 |
'default' => '',
|
185 |
'type' => 'textarea',
|
186 |
+
'title' => '<em>' . __( 'Purchase info', 'woocommerce-jetpack' ) . '</em>',
|
187 |
'desc' => $desc,
|
188 |
'product_id' => $product_id,
|
189 |
'meta_name' => '_' . 'wcj_purchase_info',
|
190 |
'enabled' => get_option( 'wcj_purchase_info_enabled', 'yes' ),
|
191 |
),
|
192 |
+
) );
|
193 |
+
$product_options = apply_filters( 'wcj_purchase_data_product_options', $product_options, $product_id, $desc );
|
194 |
$options = array_merge( $options, $product_options );
|
195 |
}
|
196 |
return $options;
|
261 |
/**
|
262 |
* get_settings.
|
263 |
*
|
264 |
+
* @version 2.4.8
|
265 |
* @todo add options to set fields and column titles
|
266 |
*/
|
267 |
function get_settings() {
|
297 |
'type' => 'sectionend',
|
298 |
'id' => 'wcj_purchase_data_price_fields_options',
|
299 |
),
|
300 |
+
array(
|
301 |
+
'title' => __( 'Custom Price Fields', 'woocommerce-jetpack' ),
|
302 |
+
'type' => 'title',
|
303 |
+
'desc' => __( 'This fields will be added to product\'s edit page and will be included in product\'s purchase cost calculation.', 'woocommerce-jetpack' ),
|
304 |
+
'id' => 'wcj_purchase_data_custom_price_fields_options',
|
305 |
+
),
|
306 |
+
array(
|
307 |
+
'title' => __( 'Total Custom Price Fields', 'woocommerce-jetpack' ),
|
308 |
+
'id' => 'wcj_purchase_data_custom_price_fields_total_number',
|
309 |
+
'default' => 1,
|
310 |
+
'type' => 'custom_number',
|
311 |
+
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
312 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
313 |
+
),
|
314 |
+
);
|
315 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
|
316 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
317 |
+
$settings = array_merge( $settings, array(
|
318 |
+
array(
|
319 |
+
'title' => __( 'Custom Price Field', 'woocommerce-jetpack' ) . ' #' . $i,
|
320 |
+
'id' => 'wcj_purchase_data_custom_price_field_name_' . $i,
|
321 |
+
'desc' => __( 'Title', 'woocommerce-jetpack' ),
|
322 |
+
'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
|
323 |
+
'default' => '',
|
324 |
+
'type' => 'text',
|
325 |
+
),
|
326 |
+
array(
|
327 |
+
'id' => 'wcj_purchase_data_custom_price_field_type_' . $i,
|
328 |
+
'desc' => __( 'Type', 'woocommerce-jetpack' ),
|
329 |
+
'default' => 'fixed',
|
330 |
+
'type' => 'select',
|
331 |
+
'options' => array(
|
332 |
+
'fixed' => __( 'Fixed', 'woocommerce-jetpack' ),
|
333 |
+
'percent' => __( 'Percent', 'woocommerce-jetpack' ),
|
334 |
+
),
|
335 |
+
),
|
336 |
+
array(
|
337 |
+
'id' => 'wcj_purchase_data_custom_price_field_default_value_' . $i,
|
338 |
+
'desc' => __( 'Default Value', 'woocommerce-jetpack' ),
|
339 |
+
'default' => 0,
|
340 |
+
'type' => 'number',
|
341 |
+
'custom_attributes' => array( 'step' => '0.0001' ),
|
342 |
+
),
|
343 |
+
) );
|
344 |
+
}
|
345 |
+
$settings = array_merge( $settings, array(
|
346 |
+
array(
|
347 |
+
'type' => 'sectionend',
|
348 |
+
'id' => 'wcj_purchase_data_custom_price_fields_options',
|
349 |
+
),
|
350 |
array(
|
351 |
'title' => __( 'Info Fields', 'woocommerce-jetpack' ),
|
352 |
'type' => 'title',
|
395 |
'type' => 'sectionend',
|
396 |
'id' => 'wcj_purchase_data_custom_columns_options',
|
397 |
),
|
398 |
+
) );
|
399 |
return $this->add_standard_settings( $settings );
|
400 |
}
|
401 |
}
|
includes/class-wcj-related-products.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Related Products class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,13 +17,14 @@ class WCJ_Related_Products extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'related_products';
|
25 |
$this->short_desc = __( 'Related Products', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Change displayed WooCommerce related products number, columns, order, relate by tag and/or category, or hide related products completely.', 'woocommerce-jetpack' );
|
|
|
27 |
parent::__construct();
|
28 |
|
29 |
if ( $this->is_enabled() ) {
|
@@ -88,44 +89,40 @@ class WCJ_Related_Products extends WCJ_Module {
|
|
88 |
|
89 |
/**
|
90 |
* get_settings.
|
|
|
|
|
91 |
*/
|
92 |
function get_settings() {
|
93 |
-
|
94 |
$settings = array(
|
95 |
-
|
96 |
array(
|
97 |
-
'title' =>
|
98 |
'type' => 'title',
|
99 |
'desc' => '',
|
100 |
-
'id' => 'wcj_product_info_related_products_options'
|
101 |
),
|
102 |
-
|
103 |
array(
|
104 |
'title' => __( 'Related Products Number', 'woocommerce-jetpack' ),
|
105 |
'id' => 'wcj_product_info_related_products_num',
|
106 |
'default' => 3,
|
107 |
'type' => 'number',
|
108 |
),
|
109 |
-
|
110 |
array(
|
111 |
'title' => __( 'Related Products Columns', 'woocommerce-jetpack' ),
|
112 |
'id' => 'wcj_product_info_related_products_columns',
|
113 |
'default' => 3,
|
114 |
'type' => 'number',
|
115 |
),
|
116 |
-
|
117 |
array(
|
118 |
'title' => __( 'Order by', 'woocommerce-jetpack' ),
|
119 |
'id' => 'wcj_product_info_related_products_orderby',
|
120 |
'default' => 'rand',
|
121 |
'type' => 'select',
|
122 |
'options' => array(
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
),
|
128 |
-
|
129 |
array(
|
130 |
'title' => __( 'Order', 'woocommerce-jetpack' ),
|
131 |
'desc_tip' => __( 'Ignored if order by "Random" is selected above.', 'woocommerce-jetpack' ),
|
@@ -133,40 +130,35 @@ class WCJ_Related_Products extends WCJ_Module {
|
|
133 |
'default' => 'desc',
|
134 |
'type' => 'select',
|
135 |
'options' => array(
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
),
|
140 |
-
|
141 |
array(
|
142 |
-
'title'
|
143 |
-
'id'
|
144 |
-
'default'
|
145 |
-
'type'
|
146 |
),
|
147 |
-
|
148 |
array(
|
149 |
-
'title'
|
150 |
-
'id'
|
151 |
-
'default'
|
152 |
-
'type'
|
153 |
),
|
154 |
-
|
155 |
array(
|
156 |
-
'title'
|
157 |
-
'desc'
|
158 |
-
'id'
|
159 |
-
'default'
|
160 |
-
'type'
|
161 |
),
|
162 |
-
|
163 |
array(
|
164 |
-
'type'
|
165 |
-
'id'
|
166 |
),
|
167 |
);
|
168 |
-
|
169 |
-
return $this->add_enable_module_setting( $settings );
|
170 |
}
|
171 |
}
|
172 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack Related Products class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
24 |
$this->id = 'related_products';
|
25 |
$this->short_desc = __( 'Related Products', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Change displayed WooCommerce related products number, columns, order, relate by tag and/or category, or hide related products completely.', 'woocommerce-jetpack' );
|
27 |
+
$this->link = 'http://booster.io/features/woocommerce-related-products/';
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
89 |
|
90 |
/**
|
91 |
* get_settings.
|
92 |
+
*
|
93 |
+
* @version 2.4.8
|
94 |
*/
|
95 |
function get_settings() {
|
|
|
96 |
$settings = array(
|
|
|
97 |
array(
|
98 |
+
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
99 |
'type' => 'title',
|
100 |
'desc' => '',
|
101 |
+
'id' => 'wcj_product_info_related_products_options',
|
102 |
),
|
|
|
103 |
array(
|
104 |
'title' => __( 'Related Products Number', 'woocommerce-jetpack' ),
|
105 |
'id' => 'wcj_product_info_related_products_num',
|
106 |
'default' => 3,
|
107 |
'type' => 'number',
|
108 |
),
|
|
|
109 |
array(
|
110 |
'title' => __( 'Related Products Columns', 'woocommerce-jetpack' ),
|
111 |
'id' => 'wcj_product_info_related_products_columns',
|
112 |
'default' => 3,
|
113 |
'type' => 'number',
|
114 |
),
|
|
|
115 |
array(
|
116 |
'title' => __( 'Order by', 'woocommerce-jetpack' ),
|
117 |
'id' => 'wcj_product_info_related_products_orderby',
|
118 |
'default' => 'rand',
|
119 |
'type' => 'select',
|
120 |
'options' => array(
|
121 |
+
'rand' => __( 'Random', 'woocommerce-jetpack' ),
|
122 |
+
'date' => __( 'Date', 'woocommerce-jetpack' ),
|
123 |
+
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
124 |
+
),
|
125 |
),
|
|
|
126 |
array(
|
127 |
'title' => __( 'Order', 'woocommerce-jetpack' ),
|
128 |
'desc_tip' => __( 'Ignored if order by "Random" is selected above.', 'woocommerce-jetpack' ),
|
130 |
'default' => 'desc',
|
131 |
'type' => 'select',
|
132 |
'options' => array(
|
133 |
+
'asc' => __( 'Ascending', 'woocommerce-jetpack' ),
|
134 |
+
'desc' => __( 'Descending', 'woocommerce-jetpack' ),
|
135 |
+
),
|
136 |
),
|
|
|
137 |
array(
|
138 |
+
'title' => __( 'Relate by Category', 'woocommerce-jetpack' ),
|
139 |
+
'id' => 'wcj_product_info_related_products_relate_by_category',
|
140 |
+
'default' => 'yes',
|
141 |
+
'type' => 'checkbox',
|
142 |
),
|
|
|
143 |
array(
|
144 |
+
'title' => __( 'Relate by Tag', 'woocommerce-jetpack' ),
|
145 |
+
'id' => 'wcj_product_info_related_products_relate_by_tag',
|
146 |
+
'default' => 'yes',
|
147 |
+
'type' => 'checkbox',
|
148 |
),
|
|
|
149 |
array(
|
150 |
+
'title' => __( 'Hide Related Products', 'woocommerce-jetpack' ),
|
151 |
+
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
152 |
+
'id' => 'wcj_product_info_related_products_hide',
|
153 |
+
'default' => 'no',
|
154 |
+
'type' => 'checkbox',
|
155 |
),
|
|
|
156 |
array(
|
157 |
+
'type' => 'sectionend',
|
158 |
+
'id' => 'wcj_product_info_related_products_options',
|
159 |
),
|
160 |
);
|
161 |
+
return $this->add_standard_settings( $settings );
|
|
|
162 |
}
|
163 |
}
|
164 |
|
includes/class-wcj-shipping.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Shipping class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,18 +17,20 @@ class WCJ_Shipping extends WCJ_Module {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
24 |
$this->id = 'shipping';
|
25 |
$this->short_desc = __( 'Shipping', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack' );
|
|
|
27 |
parent::__construct();
|
28 |
|
29 |
if ( $this->is_enabled() ) {
|
30 |
-
|
31 |
-
|
|
|
32 |
add_filter( 'woocommerce_package_rates', array( $this, 'hide_shipping_when_free_is_available' ), 10, 2 );
|
33 |
add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), 100 );
|
34 |
|
@@ -104,12 +106,12 @@ class WCJ_Shipping extends WCJ_Module {
|
|
104 |
function hide_shipping_when_free_is_available( $rates, $package ) {
|
105 |
// Only modify rates if free_shipping is present
|
106 |
if ( isset( $rates['free_shipping'] ) ) {
|
107 |
-
//
|
108 |
if ( 'yes' === get_option( 'wcj_shipping_hide_if_free_available_local_delivery' ) ) {
|
109 |
unset( $rates['local_delivery'] );
|
110 |
}
|
111 |
if ( 'yes' === get_option( 'wcj_shipping_hide_if_free_available_all' ) ) {
|
112 |
-
//
|
113 |
$free_shipping = $rates['free_shipping'];
|
114 |
$rates = array();
|
115 |
$rates['free_shipping'] = $free_shipping;
|
@@ -118,25 +120,6 @@ class WCJ_Shipping extends WCJ_Module {
|
|
118 |
return $rates;
|
119 |
}
|
120 |
|
121 |
-
/**
|
122 |
-
* Hide ALL Shipping option when free shipping is available
|
123 |
-
*
|
124 |
-
* @param array $available_methods
|
125 |
-
*/
|
126 |
-
/* function hide_all_shipping_when_free_is_available( $available_methods ) {
|
127 |
-
if( isset( $available_methods['free_shipping'] ) ) {
|
128 |
-
// Get Free Shipping array into a new array
|
129 |
-
$freeshipping = array();
|
130 |
-
$freeshipping = $available_methods['free_shipping'];
|
131 |
-
// Empty the $available_methods array
|
132 |
-
unset( $available_methods );
|
133 |
-
// Add Free Shipping back into $avaialble_methods
|
134 |
-
$available_methods = array();
|
135 |
-
$available_methods[] = $freeshipping;
|
136 |
-
}
|
137 |
-
return $available_methods;
|
138 |
-
} */
|
139 |
-
|
140 |
/**
|
141 |
* add_hide_shipping_if_free_available_fields.
|
142 |
*
|
@@ -172,10 +155,48 @@ class WCJ_Shipping extends WCJ_Module {
|
|
172 |
/**
|
173 |
* get_settings.
|
174 |
*
|
175 |
-
* @version 2.4.
|
176 |
*/
|
177 |
function get_settings() {
|
|
|
|
|
178 |
$settings = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
array(
|
180 |
'title' => __( 'Hide if free is available', 'woocommerce-jetpack' ),
|
181 |
'type' => 'title',
|
@@ -204,7 +225,7 @@ class WCJ_Shipping extends WCJ_Module {
|
|
204 |
array(
|
205 |
'title' => __( 'Left to Free Shipping Info Options', 'woocommerce-jetpack' ),
|
206 |
'type' => 'title',
|
207 |
-
'desc' => __( 'This section lets you enable info
|
208 |
. '<br>' . __( 'You can also use <em>Booster - Left to Free Shipping</em> widget, <em>[wcj_get_left_to_free_shipping content=""]</em> shortcode or <em>wcj_get_left_to_free_shipping( $content );</em> function.', 'woocommerce-jetpack' )
|
209 |
. '<br>' . __( 'In content you can use: <em>%left_to_free%</em> and <em>%free_shipping_min_amount%</em> shortcodes.', 'woocommerce-jetpack' ),
|
210 |
'id' => 'wcj_shipping_left_to_free_info_options',
|
@@ -235,7 +256,7 @@ class WCJ_Shipping extends WCJ_Module {
|
|
235 |
),
|
236 |
array(
|
237 |
'title' => '',
|
238 |
-
'desc' => __( 'Order (Priority)', 'woocommerce-jetpack' ),
|
239 |
'id' => 'wcj_shipping_left_to_free_info_priority_cart',
|
240 |
'default' => 10,
|
241 |
'type' => 'number',
|
@@ -273,7 +294,7 @@ class WCJ_Shipping extends WCJ_Module {
|
|
273 |
),
|
274 |
array(
|
275 |
'title' => '',
|
276 |
-
'desc' => __( 'Order (Priority)', 'woocommerce-jetpack' ),
|
277 |
'id' => 'wcj_shipping_left_to_free_info_priority_mini_cart',
|
278 |
'default' => 10,
|
279 |
'type' => 'number',
|
@@ -317,17 +338,25 @@ class WCJ_Shipping extends WCJ_Module {
|
|
317 |
),
|
318 |
array(
|
319 |
'title' => '',
|
320 |
-
'desc' => __( 'Order (Priority)', 'woocommerce-jetpack' ),
|
321 |
'id' => 'wcj_shipping_left_to_free_info_priority_checkout',
|
322 |
'default' => 10,
|
323 |
'type' => 'number',
|
324 |
'css' => 'width:250px;',
|
325 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
array(
|
327 |
'type' => 'sectionend',
|
328 |
'id' => 'wcj_shipping_left_to_free_info_options',
|
329 |
),
|
330 |
-
);
|
331 |
return $this->add_standard_settings( $settings );
|
332 |
}
|
333 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Shipping class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
24 |
$this->id = 'shipping';
|
25 |
$this->short_desc = __( 'Shipping', 'woocommerce-jetpack' );
|
26 |
$this->desc = __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack' );
|
27 |
+
$this->link = 'http://booster.io/features/woocommerce-shipping/';
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
31 |
+
|
32 |
+
include_once( 'shipping/class-wc-shipping-wcj-custom.php' );
|
33 |
+
|
34 |
add_filter( 'woocommerce_package_rates', array( $this, 'hide_shipping_when_free_is_available' ), 10, 2 );
|
35 |
add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), 100 );
|
36 |
|
106 |
function hide_shipping_when_free_is_available( $rates, $package ) {
|
107 |
// Only modify rates if free_shipping is present
|
108 |
if ( isset( $rates['free_shipping'] ) ) {
|
109 |
+
// Unset a single rate/method
|
110 |
if ( 'yes' === get_option( 'wcj_shipping_hide_if_free_available_local_delivery' ) ) {
|
111 |
unset( $rates['local_delivery'] );
|
112 |
}
|
113 |
if ( 'yes' === get_option( 'wcj_shipping_hide_if_free_available_all' ) ) {
|
114 |
+
// Unset all methods except for free_shipping
|
115 |
$free_shipping = $rates['free_shipping'];
|
116 |
$rates = array();
|
117 |
$rates['free_shipping'] = $free_shipping;
|
120 |
return $rates;
|
121 |
}
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
/**
|
124 |
* add_hide_shipping_if_free_available_fields.
|
125 |
*
|
155 |
/**
|
156 |
* get_settings.
|
157 |
*
|
158 |
+
* @version 2.4.8
|
159 |
*/
|
160 |
function get_settings() {
|
161 |
+
$wocommerce_shipping_settings_url = admin_url( 'admin.php?page=wc-settings&tab=shipping' );
|
162 |
+
$wocommerce_shipping_settings_url = '<a href="' . $wocommerce_shipping_settings_url . '">' . __( 'WooCommerce > Settings > Shipping', 'woocommerce-jetpack' ) . '</a>';
|
163 |
$settings = array(
|
164 |
+
array(
|
165 |
+
'title' => __( 'Custom Shipping', 'woocommerce-jetpack' ),
|
166 |
+
'type' => 'title',
|
167 |
+
'id' => 'wcj_shipping_custom_shipping_options',
|
168 |
+
'desc' => __( 'This section lets you set number of custom shipping methods to add.', 'woocommerce-jetpack' )
|
169 |
+
. ' ' . sprintf( __( 'After setting the number, visit %s to set each method options.', 'woocommerce-jetpack' ), $wocommerce_shipping_settings_url ),
|
170 |
+
),
|
171 |
+
array(
|
172 |
+
'title' => __( 'Custom Shipping Methods Number', 'woocommerce-jetpack' ),
|
173 |
+
'id' => 'wcj_shipping_custom_shipping_total_number',
|
174 |
+
'default' => 1,
|
175 |
+
'type' => 'custom_number',
|
176 |
+
'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
177 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
|
178 |
+
'custom_attributes' => array_merge(
|
179 |
+
is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
|
180 |
+
array( 'step' => '1', 'min' => '0', 'max' => '10', )
|
181 |
+
),
|
182 |
+
),
|
183 |
+
);
|
184 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_shipping_custom_shipping_total_number', 1 ) );
|
185 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
186 |
+
$settings [] = array(
|
187 |
+
'title' => __( 'Admin Title Custom Shipping', 'woocommerce-jetpack' ) . ' #' . $i,
|
188 |
+
'id' => 'wcj_shipping_custom_shipping_admin_title_' . $i,
|
189 |
+
'default' => __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $i,
|
190 |
+
'type' => 'text',
|
191 |
+
);
|
192 |
+
}
|
193 |
+
$settings = array_merge( $settings, array(
|
194 |
+
array(
|
195 |
+
'type' => 'sectionend',
|
196 |
+
'id' => 'wcj_shipping_custom_shipping_options',
|
197 |
+
),
|
198 |
+
) );
|
199 |
+
$settings = array_merge( $settings, array(
|
200 |
array(
|
201 |
'title' => __( 'Hide if free is available', 'woocommerce-jetpack' ),
|
202 |
'type' => 'title',
|
225 |
array(
|
226 |
'title' => __( 'Left to Free Shipping Info Options', 'woocommerce-jetpack' ),
|
227 |
'type' => 'title',
|
228 |
+
'desc' => __( 'This section lets you enable info on cart, mini cart and checkout pages.', 'woocommerce-jetpack' )
|
229 |
. '<br>' . __( 'You can also use <em>Booster - Left to Free Shipping</em> widget, <em>[wcj_get_left_to_free_shipping content=""]</em> shortcode or <em>wcj_get_left_to_free_shipping( $content );</em> function.', 'woocommerce-jetpack' )
|
230 |
. '<br>' . __( 'In content you can use: <em>%left_to_free%</em> and <em>%free_shipping_min_amount%</em> shortcodes.', 'woocommerce-jetpack' ),
|
231 |
'id' => 'wcj_shipping_left_to_free_info_options',
|
256 |
),
|
257 |
array(
|
258 |
'title' => '',
|
259 |
+
'desc' => __( 'Position Order (Priority)', 'woocommerce-jetpack' ),
|
260 |
'id' => 'wcj_shipping_left_to_free_info_priority_cart',
|
261 |
'default' => 10,
|
262 |
'type' => 'number',
|
294 |
),
|
295 |
array(
|
296 |
'title' => '',
|
297 |
+
'desc' => __( 'Position Order (Priority)', 'woocommerce-jetpack' ),
|
298 |
'id' => 'wcj_shipping_left_to_free_info_priority_mini_cart',
|
299 |
'default' => 10,
|
300 |
'type' => 'number',
|
338 |
),
|
339 |
array(
|
340 |
'title' => '',
|
341 |
+
'desc' => __( 'Position Order (Priority)', 'woocommerce-jetpack' ),
|
342 |
'id' => 'wcj_shipping_left_to_free_info_priority_checkout',
|
343 |
'default' => 10,
|
344 |
'type' => 'number',
|
345 |
'css' => 'width:250px;',
|
346 |
),
|
347 |
+
array(
|
348 |
+
'title' => __( 'Message on Free Shipping Reached', 'woocommerce-jetpack' ),
|
349 |
+
'desc_tip' => __( 'You can set it empty', 'woocommerce-jetpack' ),
|
350 |
+
'id' => 'wcj_shipping_left_to_free_info_content_reached',
|
351 |
+
'default' => __( 'You have Free delivery', 'woocommerce-jetpack' ),
|
352 |
+
'type' => 'textarea',
|
353 |
+
'css' => 'width:30%;min-width:300px;height:100px;',
|
354 |
+
),
|
355 |
array(
|
356 |
'type' => 'sectionend',
|
357 |
'id' => 'wcj_shipping_left_to_free_info_options',
|
358 |
),
|
359 |
+
) );
|
360 |
return $this->add_standard_settings( $settings );
|
361 |
}
|
362 |
}
|
includes/class-wcj-sku.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack SKU class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
* @todo add "random number" option
|
10 |
*/
|
@@ -18,13 +18,14 @@ class WCJ_SKU extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.4.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'sku';
|
26 |
$this->short_desc = __( 'SKU', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Generate WooCommerce SKUs automatically.', 'woocommerce-jetpack' );
|
|
|
28 |
parent::__construct();
|
29 |
|
30 |
$this->add_tools( array(
|
@@ -39,10 +40,25 @@ class WCJ_SKU extends WCJ_Module {
|
|
39 |
}
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
/**
|
43 |
* set_sku_with_variable.
|
44 |
*
|
45 |
-
* @version 2.4.
|
46 |
* @todo Handle cases with more than 26 variations
|
47 |
*/
|
48 |
function set_sku_with_variable( $product_id, $is_preview ) {
|
@@ -53,7 +69,7 @@ class WCJ_SKU extends WCJ_Module {
|
|
53 |
$variation_handling = apply_filters( 'wcj_get_option_filter', 'as_variable', get_option( 'wcj_sku_variations_handling', 'as_variable' ) );
|
54 |
$product = wc_get_product( $product_id );
|
55 |
if ( $product->is_type( 'variable' ) ) {
|
56 |
-
$variations = $
|
57 |
if ( 'as_variable' === $variation_handling ) {
|
58 |
foreach ( $variations as $variation ) {
|
59 |
$this->set_sku( $variation['variation_id'], $product_id, '', $is_preview, $product_id );
|
4 |
*
|
5 |
* The WooCommerce Jetpack SKU class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
* @todo add "random number" option
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'sku';
|
26 |
$this->short_desc = __( 'SKU', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Generate WooCommerce SKUs automatically.', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-sku/';
|
29 |
parent::__construct();
|
30 |
|
31 |
$this->add_tools( array(
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
/**
|
44 |
+
* get_available_variations.
|
45 |
+
*
|
46 |
+
* @version 2.4.8
|
47 |
+
* @since 2.4.8
|
48 |
+
*/
|
49 |
+
function get_all_variations( $_product ) {
|
50 |
+
$all_variations = array();
|
51 |
+
foreach ( $_product->get_children() as $child_id ) {
|
52 |
+
$variation = $_product->get_child( $child_id );
|
53 |
+
$all_variations[] = $_product->get_available_variation( $variation );
|
54 |
+
}
|
55 |
+
return $all_variations;
|
56 |
+
}
|
57 |
+
|
58 |
/**
|
59 |
* set_sku_with_variable.
|
60 |
*
|
61 |
+
* @version 2.4.8
|
62 |
* @todo Handle cases with more than 26 variations
|
63 |
*/
|
64 |
function set_sku_with_variable( $product_id, $is_preview ) {
|
69 |
$variation_handling = apply_filters( 'wcj_get_option_filter', 'as_variable', get_option( 'wcj_sku_variations_handling', 'as_variable' ) );
|
70 |
$product = wc_get_product( $product_id );
|
71 |
if ( $product->is_type( 'variable' ) ) {
|
72 |
+
$variations = $this->get_all_variations( $product );
|
73 |
if ( 'as_variable' === $variation_handling ) {
|
74 |
foreach ( $variations as $variation ) {
|
75 |
$this->set_sku( $variation['variation_id'], $product_id, '', $is_preview, $product_id );
|
includes/class-wcj-sorting.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Sorting class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -19,21 +19,22 @@ class WCJ_Sorting extends WCJ_Module {
|
|
19 |
* WCJ_Sorting Constructor.
|
20 |
*
|
21 |
* @access public
|
22 |
-
* @version 2.
|
23 |
*/
|
24 |
public function __construct() {
|
25 |
|
26 |
$this->id = 'sorting';
|
27 |
$this->short_desc = __( 'Sorting', 'woocommerce-jetpack' );
|
28 |
$this->desc = __( 'Add more WooCommerce sorting options or remove all sorting including default.', 'woocommerce-jetpack' );
|
|
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
32 |
|
33 |
if ( 'yes' === get_option( 'wcj_more_sorting_enabled' ) ) {
|
34 |
-
add_filter( 'woocommerce_get_catalog_ordering_args', array( $this, 'custom_woocommerce_get_catalog_ordering_args' ), 100 )
|
35 |
-
add_filter( 'woocommerce_catalog_orderby', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 )
|
36 |
-
add_filter( 'woocommerce_default_catalog_orderby_options', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 )
|
37 |
}
|
38 |
|
39 |
if ( 'yes' === get_option( 'wcj_sorting_remove_all_enabled' ) ) {
|
@@ -158,19 +159,15 @@ class WCJ_Sorting extends WCJ_Module {
|
|
158 |
/*
|
159 |
* Add the settings.
|
160 |
*
|
161 |
-
* @version 2.
|
162 |
*/
|
163 |
function get_settings() {
|
164 |
-
|
165 |
$settings = array(
|
166 |
-
|
167 |
array(
|
168 |
'title' => __( 'Remove All Sorting', 'woocommerce-jetpack' ),
|
169 |
'type' => 'title',
|
170 |
-
'
|
171 |
-
'id' => 'wcj_remove_all_sorting_options'
|
172 |
),
|
173 |
-
|
174 |
array(
|
175 |
'title' => __( 'Remove All Sorting', 'woocommerce-jetpack' ),
|
176 |
'desc' => __( 'Remove all sorting (including WooCommerce default)', 'woocommerce-jetpack' ),
|
@@ -178,30 +175,24 @@ class WCJ_Sorting extends WCJ_Module {
|
|
178 |
'id' => 'wcj_sorting_remove_all_enabled',
|
179 |
'default' => 'no',
|
180 |
'type' => 'checkbox',
|
181 |
-
'custom_attributes'
|
182 |
-
=> apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
183 |
),
|
184 |
-
|
185 |
array(
|
186 |
'type' => 'sectionend',
|
187 |
-
'id' => 'wcj_remove_all_sorting_options'
|
188 |
),
|
189 |
-
|
190 |
array(
|
191 |
'title' => __( 'Add More Sorting', 'woocommerce-jetpack' ),
|
192 |
'type' => 'title',
|
193 |
-
'
|
194 |
-
'id' => 'wcj_more_sorting_options'
|
195 |
),
|
196 |
-
|
197 |
array(
|
198 |
'title' => __( 'Add More Sorting', 'woocommerce-jetpack' ),
|
199 |
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
200 |
'id' => 'wcj_more_sorting_enabled',
|
201 |
'default' => 'yes',
|
202 |
-
'type' => 'checkbox'
|
203 |
),
|
204 |
-
|
205 |
array(
|
206 |
'title' => __( 'Sort by Name', 'woocommerce-jetpack' ),
|
207 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by title: A to Z', 'woocommerce-jetpack' ),
|
@@ -211,7 +202,6 @@ class WCJ_Sorting extends WCJ_Module {
|
|
211 |
'type' => 'text',
|
212 |
'css' => 'min-width:300px;',
|
213 |
),
|
214 |
-
|
215 |
array(
|
216 |
'title' => '',//__( 'Sort by Name - Desc', 'woocommerce-jetpack' ),
|
217 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by title: Z to A', 'woocommerce-jetpack' ),
|
@@ -221,7 +211,6 @@ class WCJ_Sorting extends WCJ_Module {
|
|
221 |
'type' => 'text',
|
222 |
'css' => 'min-width:300px;',
|
223 |
),
|
224 |
-
|
225 |
array(
|
226 |
'title' => __( 'Sort by SKU', 'woocommerce-jetpack' ),
|
227 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by SKU: low to high', 'woocommerce-jetpack' ),
|
@@ -231,7 +220,6 @@ class WCJ_Sorting extends WCJ_Module {
|
|
231 |
'type' => 'text',
|
232 |
'css' => 'min-width:300px;',
|
233 |
),
|
234 |
-
|
235 |
array(
|
236 |
'title' => '',//__( 'Sort by SKU - Desc', 'woocommerce-jetpack' ),
|
237 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by SKU: high to low', 'woocommerce-jetpack' ),
|
@@ -241,7 +229,6 @@ class WCJ_Sorting extends WCJ_Module {
|
|
241 |
'type' => 'text',
|
242 |
'css' => 'min-width:300px;',
|
243 |
),
|
244 |
-
|
245 |
array(
|
246 |
'title' => '',
|
247 |
'desc' => __( 'Sort SKUs as numbers instead of as texts', 'woocommerce-jetpack' ),
|
@@ -249,10 +236,8 @@ class WCJ_Sorting extends WCJ_Module {
|
|
249 |
'default' => 'no',
|
250 |
'type' => 'checkbox',
|
251 |
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
252 |
-
'custom_attributes'
|
253 |
-
=> apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
254 |
),
|
255 |
-
|
256 |
array(
|
257 |
'title' => __( 'Sort by stock quantity', 'woocommerce-jetpack' ),
|
258 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by stock quantity: low to high', 'woocommerce-jetpack' ),
|
@@ -262,7 +247,6 @@ class WCJ_Sorting extends WCJ_Module {
|
|
262 |
'type' => 'text',
|
263 |
'css' => 'min-width:300px;',
|
264 |
),
|
265 |
-
|
266 |
array(
|
267 |
'title' => '',//__( 'Sort by stock quantity - Desc', 'woocommerce-jetpack' ),
|
268 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by stock quantity: high to low', 'woocommerce-jetpack' ),
|
@@ -272,14 +256,12 @@ class WCJ_Sorting extends WCJ_Module {
|
|
272 |
'type' => 'text',
|
273 |
'css' => 'min-width:300px;',
|
274 |
),
|
275 |
-
|
276 |
array(
|
277 |
'type' => 'sectionend',
|
278 |
-
'id' => 'wcj_more_sorting_options'
|
279 |
),
|
280 |
);
|
281 |
-
|
282 |
-
return $this->add_enable_module_setting( $settings );
|
283 |
}
|
284 |
|
285 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Sorting class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
19 |
* WCJ_Sorting Constructor.
|
20 |
*
|
21 |
* @access public
|
22 |
+
* @version 2.4.8
|
23 |
*/
|
24 |
public function __construct() {
|
25 |
|
26 |
$this->id = 'sorting';
|
27 |
$this->short_desc = __( 'Sorting', 'woocommerce-jetpack' );
|
28 |
$this->desc = __( 'Add more WooCommerce sorting options or remove all sorting including default.', 'woocommerce-jetpack' );
|
29 |
+
$this->link = 'http://booster.io/features/woocommerce-more-sorting-options/';
|
30 |
parent::__construct();
|
31 |
|
32 |
if ( $this->is_enabled() ) {
|
33 |
|
34 |
if ( 'yes' === get_option( 'wcj_more_sorting_enabled' ) ) {
|
35 |
+
add_filter( 'woocommerce_get_catalog_ordering_args', array( $this, 'custom_woocommerce_get_catalog_ordering_args' ), 100 ); // Sorting
|
36 |
+
add_filter( 'woocommerce_catalog_orderby', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 ); // Front end
|
37 |
+
add_filter( 'woocommerce_default_catalog_orderby_options', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 ); // Back end (default sorting)
|
38 |
}
|
39 |
|
40 |
if ( 'yes' === get_option( 'wcj_sorting_remove_all_enabled' ) ) {
|
159 |
/*
|
160 |
* Add the settings.
|
161 |
*
|
162 |
+
* @version 2.4.8
|
163 |
*/
|
164 |
function get_settings() {
|
|
|
165 |
$settings = array(
|
|
|
166 |
array(
|
167 |
'title' => __( 'Remove All Sorting', 'woocommerce-jetpack' ),
|
168 |
'type' => 'title',
|
169 |
+
'id' => 'wcj_remove_all_sorting_options',
|
|
|
170 |
),
|
|
|
171 |
array(
|
172 |
'title' => __( 'Remove All Sorting', 'woocommerce-jetpack' ),
|
173 |
'desc' => __( 'Remove all sorting (including WooCommerce default)', 'woocommerce-jetpack' ),
|
175 |
'id' => 'wcj_sorting_remove_all_enabled',
|
176 |
'default' => 'no',
|
177 |
'type' => 'checkbox',
|
178 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
|
|
179 |
),
|
|
|
180 |
array(
|
181 |
'type' => 'sectionend',
|
182 |
+
'id' => 'wcj_remove_all_sorting_options',
|
183 |
),
|
|
|
184 |
array(
|
185 |
'title' => __( 'Add More Sorting', 'woocommerce-jetpack' ),
|
186 |
'type' => 'title',
|
187 |
+
'id' => 'wcj_more_sorting_options',
|
|
|
188 |
),
|
|
|
189 |
array(
|
190 |
'title' => __( 'Add More Sorting', 'woocommerce-jetpack' ),
|
191 |
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
192 |
'id' => 'wcj_more_sorting_enabled',
|
193 |
'default' => 'yes',
|
194 |
+
'type' => 'checkbox',
|
195 |
),
|
|
|
196 |
array(
|
197 |
'title' => __( 'Sort by Name', 'woocommerce-jetpack' ),
|
198 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by title: A to Z', 'woocommerce-jetpack' ),
|
202 |
'type' => 'text',
|
203 |
'css' => 'min-width:300px;',
|
204 |
),
|
|
|
205 |
array(
|
206 |
'title' => '',//__( 'Sort by Name - Desc', 'woocommerce-jetpack' ),
|
207 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by title: Z to A', 'woocommerce-jetpack' ),
|
211 |
'type' => 'text',
|
212 |
'css' => 'min-width:300px;',
|
213 |
),
|
|
|
214 |
array(
|
215 |
'title' => __( 'Sort by SKU', 'woocommerce-jetpack' ),
|
216 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by SKU: low to high', 'woocommerce-jetpack' ),
|
220 |
'type' => 'text',
|
221 |
'css' => 'min-width:300px;',
|
222 |
),
|
|
|
223 |
array(
|
224 |
'title' => '',//__( 'Sort by SKU - Desc', 'woocommerce-jetpack' ),
|
225 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by SKU: high to low', 'woocommerce-jetpack' ),
|
229 |
'type' => 'text',
|
230 |
'css' => 'min-width:300px;',
|
231 |
),
|
|
|
232 |
array(
|
233 |
'title' => '',
|
234 |
'desc' => __( 'Sort SKUs as numbers instead of as texts', 'woocommerce-jetpack' ),
|
236 |
'default' => 'no',
|
237 |
'type' => 'checkbox',
|
238 |
'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
|
239 |
+
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
|
|
240 |
),
|
|
|
241 |
array(
|
242 |
'title' => __( 'Sort by stock quantity', 'woocommerce-jetpack' ),
|
243 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by stock quantity: low to high', 'woocommerce-jetpack' ),
|
247 |
'type' => 'text',
|
248 |
'css' => 'min-width:300px;',
|
249 |
),
|
|
|
250 |
array(
|
251 |
'title' => '',//__( 'Sort by stock quantity - Desc', 'woocommerce-jetpack' ),
|
252 |
'desc' => __( 'Default: ', 'woocommerce-jetpack' ) . __( 'Sort by stock quantity: high to low', 'woocommerce-jetpack' ),
|
256 |
'type' => 'text',
|
257 |
'css' => 'min-width:300px;',
|
258 |
),
|
|
|
259 |
array(
|
260 |
'type' => 'sectionend',
|
261 |
+
'id' => 'wcj_more_sorting_options',
|
262 |
),
|
263 |
);
|
264 |
+
return $this->add_standard_settings( $settings );
|
|
|
265 |
}
|
266 |
|
267 |
}
|
includes/class-wcj-wholesale-price.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Wholesale Price class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -18,13 +18,14 @@ class WCJ_Wholesale_Price extends WCJ_Module {
|
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
-
* @version 2.
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'wholesale_price';
|
26 |
$this->short_desc = __( 'Wholesale Price', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Set WooCommerce wholesale pricing depending on product quantity in cart (buy more pay less).', 'woocommerce-jetpack' );
|
|
|
28 |
parent::__construct();
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
@@ -133,11 +134,18 @@ class WCJ_Wholesale_Price extends WCJ_Module {
|
|
133 |
|
134 |
/**
|
135 |
* get_wholesale_quantity.
|
|
|
|
|
136 |
*/
|
137 |
private function get_wholesale_quantity( $_product ) {
|
138 |
|
139 |
// Get quanitity from cart
|
140 |
-
$
|
|
|
|
|
|
|
|
|
|
|
141 |
$quanitities = array();
|
142 |
$total_quantity = 0;
|
143 |
foreach ( $the_cart as $cart_item_key => $values ) {
|
@@ -153,7 +161,7 @@ class WCJ_Wholesale_Price extends WCJ_Module {
|
|
153 |
/**
|
154 |
* wholesale_price.
|
155 |
*
|
156 |
-
* @version 2.
|
157 |
*/
|
158 |
function wholesale_price( $price, $_product ) {
|
159 |
|
@@ -161,7 +169,8 @@ class WCJ_Wholesale_Price extends WCJ_Module {
|
|
161 |
|
162 |
// Show only on checkout and cart pages
|
163 |
//$is_ajax = ( is_admin() && ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) ? true : false;
|
164 |
-
|
|
|
165 |
|
166 |
// If other discount was applied in cart...
|
167 |
if ( 'yes' === get_option( 'wcj_wholesale_price_apply_only_if_no_other_discounts', 'no' ) ) {
|
4 |
*
|
5 |
* The WooCommerce Jetpack Wholesale Price class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
18 |
/**
|
19 |
* Constructor.
|
20 |
*
|
21 |
+
* @version 2.4.8
|
22 |
*/
|
23 |
function __construct() {
|
24 |
|
25 |
$this->id = 'wholesale_price';
|
26 |
$this->short_desc = __( 'Wholesale Price', 'woocommerce-jetpack' );
|
27 |
$this->desc = __( 'Set WooCommerce wholesale pricing depending on product quantity in cart (buy more pay less).', 'woocommerce-jetpack' );
|
28 |
+
$this->link = 'http://booster.io/features/woocommerce-wholesale-price/';
|
29 |
parent::__construct();
|
30 |
|
31 |
if ( $this->is_enabled() ) {
|
134 |
|
135 |
/**
|
136 |
* get_wholesale_quantity.
|
137 |
+
*
|
138 |
+
* @version 2.4.8
|
139 |
*/
|
140 |
private function get_wholesale_quantity( $_product ) {
|
141 |
|
142 |
// Get quanitity from cart
|
143 |
+
$is_paypal_express = ( isset( $_GET['wc-api'] ) && 'WC_Gateway_PayPal_Express_AngellEYE' === $_GET['wc-api'] ) ? true : false;
|
144 |
+
if ( $is_paypal_express ) {
|
145 |
+
$the_cart = array_filter( (array) WC()->cart->cart_contents );
|
146 |
+
} else {
|
147 |
+
$the_cart = WC()->cart->get_cart();
|
148 |
+
}
|
149 |
$quanitities = array();
|
150 |
$total_quantity = 0;
|
151 |
foreach ( $the_cart as $cart_item_key => $values ) {
|
161 |
/**
|
162 |
* wholesale_price.
|
163 |
*
|
164 |
+
* @version 2.4.8
|
165 |
*/
|
166 |
function wholesale_price( $price, $_product ) {
|
167 |
|
169 |
|
170 |
// Show only on checkout and cart pages
|
171 |
//$is_ajax = ( is_admin() && ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) ? true : false;
|
172 |
+
$is_paypal_express = ( isset( $_GET['wc-api'] ) && 'WC_Gateway_PayPal_Express_AngellEYE' === $_GET['wc-api'] ) ? true : false;
|
173 |
+
if ( ! ( is_checkout() || is_cart() || $is_paypal_express /* || $is_ajax */ ) ) return $price;
|
174 |
|
175 |
// If other discount was applied in cart...
|
176 |
if ( 'yes' === get_option( 'wcj_wholesale_price_apply_only_if_no_other_discounts', 'no' ) ) {
|
includes/class-wcj-wpml.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack WPML class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -136,13 +136,14 @@ class WCJ_WPML extends WCJ_Module {
|
|
136 |
/**
|
137 |
* is_wpml_value.
|
138 |
*
|
139 |
-
* @version 2.4.
|
140 |
* @since 2.4.4
|
141 |
*/
|
142 |
function is_wpml_section( $section ) {
|
143 |
$sections_to_skip = array(
|
144 |
'price_by_country',
|
145 |
'multicurrency',
|
|
|
146 |
'currency',
|
147 |
'currency_external_products',
|
148 |
'bulk_price_converter',
|
4 |
*
|
5 |
* The WooCommerce Jetpack WPML class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
136 |
/**
|
137 |
* is_wpml_value.
|
138 |
*
|
139 |
+
* @version 2.4.8
|
140 |
* @since 2.4.4
|
141 |
*/
|
142 |
function is_wpml_section( $section ) {
|
143 |
$sections_to_skip = array(
|
144 |
'price_by_country',
|
145 |
'multicurrency',
|
146 |
+
'multicurrency_base_price',
|
147 |
'currency',
|
148 |
'currency_external_products',
|
149 |
'bulk_price_converter',
|
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 |
*/
|
@@ -89,7 +89,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
89 |
/**
|
90 |
* save_meta_box.
|
91 |
*
|
92 |
-
* @since 2.4.
|
93 |
*/
|
94 |
function save_meta_box( $post_id, $post ) {
|
95 |
// Check that we are saving with current metabox displayed.
|
@@ -101,7 +101,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
101 |
$option_value = ( isset( $_POST[ $option['name'] ] ) ) ? $_POST[ $option['name'] ] : $option['default'];
|
102 |
$the_post_id = ( isset( $option['product_id'] ) ) ? $option['product_id'] : $post_id;
|
103 |
$the_meta_name = ( isset( $option['meta_name'] ) ) ? $option['meta_name'] : '_' . $option['name'];
|
104 |
-
update_post_meta( $the_post_id, $the_meta_name, $option_value );
|
105 |
}
|
106 |
}
|
107 |
}
|
@@ -129,7 +129,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
129 |
/**
|
130 |
* create_meta_box.
|
131 |
*
|
132 |
-
* @since 2.4.
|
133 |
*/
|
134 |
function create_meta_box() {
|
135 |
$current_post_id = get_the_ID();
|
@@ -140,8 +140,18 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
140 |
if ( $is_enabled ) {
|
141 |
$the_post_id = ( isset( $option['product_id'] ) ) ? $option['product_id'] : $current_post_id;
|
142 |
$the_meta_name = ( isset( $option['meta_name'] ) ) ? $option['meta_name'] : '_' . $option['name'];
|
143 |
-
|
|
|
|
|
|
|
|
|
144 |
$input_ending = ' id="' . $option['name'] . '" name="' . $option['name'] . '" value="' . $option_value . '">';
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
switch ( $option['type'] ) {
|
146 |
case 'price':
|
147 |
$field_html = '<input class="short wc_input_price" type="number" step="0.0001"' . $input_ending;
|
@@ -152,6 +162,9 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
152 |
case 'textarea':
|
153 |
$field_html = '<textarea style="min-width:300px;"' . ' id="' . $option['name'] . '" name="' . $option['name'] . '">' . $option_value . '</textarea>';
|
154 |
break;
|
|
|
|
|
|
|
155 |
default:
|
156 |
$field_html = '<input class="short" type="' . $option['type'] . '"' . $input_ending;
|
157 |
break;
|
@@ -394,7 +407,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
394 |
* settings_section.
|
395 |
* only for `module`
|
396 |
*
|
397 |
-
* @version 2.4.
|
398 |
*/
|
399 |
function add_enable_module_setting( $settings, $module_desc = '' ) {
|
400 |
if ( 'module' != $this->type ) {
|
@@ -404,7 +417,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
|
|
404 |
if ( isset( $this->link ) && '' != $this->link ) {
|
405 |
$the_link = ' <a class="button-primary"' .
|
406 |
' style="background: green; border-color: green; box-shadow: 0 1px 0 green; text-shadow: 0 -1px 1px #0a0,1px 0 1px #0a0,0 1px 1px #0a0,-1px 0 1px #0a0;"' .
|
407 |
-
' href="' . $this->link . '?
|
408 |
}
|
409 |
$enable_module_setting = array(
|
410 |
array(
|
4 |
*
|
5 |
* The WooCommerce Jetpack Module class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
89 |
/**
|
90 |
* save_meta_box.
|
91 |
*
|
92 |
+
* @since 2.4.8
|
93 |
*/
|
94 |
function save_meta_box( $post_id, $post ) {
|
95 |
// Check that we are saving with current metabox displayed.
|
101 |
$option_value = ( isset( $_POST[ $option['name'] ] ) ) ? $_POST[ $option['name'] ] : $option['default'];
|
102 |
$the_post_id = ( isset( $option['product_id'] ) ) ? $option['product_id'] : $post_id;
|
103 |
$the_meta_name = ( isset( $option['meta_name'] ) ) ? $option['meta_name'] : '_' . $option['name'];
|
104 |
+
update_post_meta( $the_post_id, $the_meta_name, apply_filters( 'wcj_save_meta_box_value', $option_value, $option['name'], $this->id ) );
|
105 |
}
|
106 |
}
|
107 |
}
|
129 |
/**
|
130 |
* create_meta_box.
|
131 |
*
|
132 |
+
* @since 2.4.8
|
133 |
*/
|
134 |
function create_meta_box() {
|
135 |
$current_post_id = get_the_ID();
|
140 |
if ( $is_enabled ) {
|
141 |
$the_post_id = ( isset( $option['product_id'] ) ) ? $option['product_id'] : $current_post_id;
|
142 |
$the_meta_name = ( isset( $option['meta_name'] ) ) ? $option['meta_name'] : '_' . $option['name'];
|
143 |
+
if ( get_post_meta( $the_post_id, $the_meta_name ) ) {
|
144 |
+
$option_value = get_post_meta( $the_post_id, $the_meta_name, true );
|
145 |
+
} else {
|
146 |
+
$option_value = ( isset( $option['default'] ) ) ? $option['default'] : '';
|
147 |
+
}
|
148 |
$input_ending = ' id="' . $option['name'] . '" name="' . $option['name'] . '" value="' . $option_value . '">';
|
149 |
+
if ( 'select' === $option['type'] ) {
|
150 |
+
$options = '';
|
151 |
+
foreach ( $option['options'] as $select_option_key => $select_option_value ) {
|
152 |
+
$options .= '<option value="' . $select_option_key . '" ' . selected( $option_value, $select_option_key, false ) . '>' . $select_option_value . '</option>';
|
153 |
+
}
|
154 |
+
}
|
155 |
switch ( $option['type'] ) {
|
156 |
case 'price':
|
157 |
$field_html = '<input class="short wc_input_price" type="number" step="0.0001"' . $input_ending;
|
162 |
case 'textarea':
|
163 |
$field_html = '<textarea style="min-width:300px;"' . ' id="' . $option['name'] . '" name="' . $option['name'] . '">' . $option_value . '</textarea>';
|
164 |
break;
|
165 |
+
case 'select':
|
166 |
+
$field_html = '<select' . ' id="' . $option['name'] . '" name="' . $option['name'] . '">' . $options . '</select>';
|
167 |
+
break;
|
168 |
default:
|
169 |
$field_html = '<input class="short" type="' . $option['type'] . '"' . $input_ending;
|
170 |
break;
|
407 |
* settings_section.
|
408 |
* only for `module`
|
409 |
*
|
410 |
+
* @version 2.4.8
|
411 |
*/
|
412 |
function add_enable_module_setting( $settings, $module_desc = '' ) {
|
413 |
if ( 'module' != $this->type ) {
|
417 |
if ( isset( $this->link ) && '' != $this->link ) {
|
418 |
$the_link = ' <a class="button-primary"' .
|
419 |
' style="background: green; border-color: green; box-shadow: 0 1px 0 green; text-shadow: 0 -1px 1px #0a0,1px 0 1px #0a0,0 1px 1px #0a0,-1px 0 1px #0a0;"' .
|
420 |
+
' href="' . $this->link . '?utm_source=module_documentation&utm_medium=module_button&utm_campaign=booster_documentation" target="_blank">' . __( 'Documentation', 'woocommerce-jetpack' ) . '</a>';
|
421 |
}
|
422 |
$enable_module_setting = array(
|
423 |
array(
|
includes/classes/class-wcj-pdf-invoice.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoice class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -137,7 +137,7 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
|
|
137 |
/**
|
138 |
* get_pdf.
|
139 |
*
|
140 |
-
* @version 2.
|
141 |
*/
|
142 |
function get_pdf( $dest ) {
|
143 |
|
@@ -215,11 +215,12 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
|
|
215 |
// Close and output PDF document
|
216 |
$result_pdf = $pdf->Output( '', 'S' );
|
217 |
$file_name = $this->get_file_name();
|
218 |
-
$file_path = sys_get_temp_dir() . '/' . $file_name;
|
219 |
-
if ( ! file_put_contents( $file_path, $result_pdf ) )
|
220 |
-
return null;
|
221 |
|
222 |
if ( 'F' === $dest ) {
|
|
|
|
|
|
|
|
|
223 |
return $file_path;
|
224 |
}
|
225 |
elseif ( 'D' === $dest || 'I' === $dest ) {
|
@@ -234,18 +235,28 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
|
|
234 |
header( "Content-type: application/pdf" );
|
235 |
header( "Content-Disposition: inline; filename=" . urlencode( $file_name ) );
|
236 |
}
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
if ( false !== ( $fp = fopen($file_path, "r") ) ) {
|
241 |
-
while (!feof($fp))
|
242 |
-
{
|
243 |
-
echo fread($fp, 65536);
|
244 |
-
flush(); // this is essential for large downloads
|
245 |
-
}
|
246 |
-
fclose($fp);
|
247 |
} else {
|
248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
}
|
250 |
}
|
251 |
return null;
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoice class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
137 |
/**
|
138 |
* get_pdf.
|
139 |
*
|
140 |
+
* @version 2.4.8
|
141 |
*/
|
142 |
function get_pdf( $dest ) {
|
143 |
|
215 |
// Close and output PDF document
|
216 |
$result_pdf = $pdf->Output( '', 'S' );
|
217 |
$file_name = $this->get_file_name();
|
|
|
|
|
|
|
218 |
|
219 |
if ( 'F' === $dest ) {
|
220 |
+
$file_path = sys_get_temp_dir() . '/' . $file_name;
|
221 |
+
if ( ! file_put_contents( $file_path, $result_pdf ) ) {
|
222 |
+
return null;
|
223 |
+
}
|
224 |
return $file_path;
|
225 |
}
|
226 |
elseif ( 'D' === $dest || 'I' === $dest ) {
|
235 |
header( "Content-type: application/pdf" );
|
236 |
header( "Content-Disposition: inline; filename=" . urlencode( $file_name ) );
|
237 |
}
|
238 |
+
if ( wcj_is_module_enabled( 'general' ) && 'yes' === get_option( 'wcj_general_advanced_disable_save_sys_temp_dir', 'no' ) ) {
|
239 |
+
header( "Content-Length: " . strlen( $result_pdf ) );
|
240 |
+
echo $result_pdf;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
} else {
|
242 |
+
|
243 |
+
$file_path = sys_get_temp_dir() . '/' . $file_name;
|
244 |
+
if ( ! file_put_contents( $file_path, $result_pdf ) ) {
|
245 |
+
return null;
|
246 |
+
}
|
247 |
+
|
248 |
+
header( "Content-Length: " . filesize( $file_path ) );
|
249 |
+
flush(); // this doesn't really matter.
|
250 |
+
|
251 |
+
if ( false !== ( $fp = fopen( $file_path, "r" ) ) ) {
|
252 |
+
while ( ! feof( $fp ) ) {
|
253 |
+
echo fread( $fp, 65536 );
|
254 |
+
flush(); // this is essential for large downloads
|
255 |
+
}
|
256 |
+
fclose( $fp );
|
257 |
+
} else {
|
258 |
+
die( __( 'Unexpected error', 'woocommerce-jetpack' ) );
|
259 |
+
}
|
260 |
}
|
261 |
}
|
262 |
return null;
|
includes/classes/class-wcj-product.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -29,7 +29,7 @@ class WCJ_Product {
|
|
29 |
/**
|
30 |
* get_purchase_price.
|
31 |
*
|
32 |
-
* @version 2.4.
|
33 |
*/
|
34 |
public function get_purchase_price() {
|
35 |
$purchase_price = 0;
|
@@ -42,6 +42,17 @@ class WCJ_Product {
|
|
42 |
if ( 'yes' === get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ) ) {
|
43 |
$purchase_price += get_post_meta( $this->id, '_' . 'wcj_purchase_price_affiliate_commission', true );
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
return apply_filters( 'wcj_get_product_purchase_price', $purchase_price, $this->id );
|
46 |
}
|
47 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.0
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
29 |
/**
|
30 |
* get_purchase_price.
|
31 |
*
|
32 |
+
* @version 2.4.8
|
33 |
*/
|
34 |
public function get_purchase_price() {
|
35 |
$purchase_price = 0;
|
42 |
if ( 'yes' === get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ) ) {
|
43 |
$purchase_price += get_post_meta( $this->id, '_' . 'wcj_purchase_price_affiliate_commission', true );
|
44 |
}
|
45 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
|
46 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
47 |
+
if ( '' == get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' ) ) {
|
48 |
+
continue;
|
49 |
+
}
|
50 |
+
$meta_value = get_post_meta( $this->id, '_' . 'wcj_purchase_price_custom_field_' . $i, true );
|
51 |
+
if ( '' != $meta_value ) {
|
52 |
+
$the_type = get_option( 'wcj_purchase_data_custom_price_field_type_' . $i, 'fixed' );
|
53 |
+
$purchase_price += ( 'fixed' === $the_type ) ? $meta_value : $purchase_price * $meta_value / 100.0;
|
54 |
+
}
|
55 |
+
}
|
56 |
return apply_filters( 'wcj_get_product_purchase_price', $purchase_price, $this->id );
|
57 |
}
|
58 |
}
|
includes/emails/class-wc-email-wcj-custom.php
CHANGED
@@ -11,7 +11,7 @@ if ( ! class_exists( 'WC_Email_WCJ_Custom' ) ) :
|
|
11 |
*
|
12 |
* An email sent to recipient list when selected triggers are called.
|
13 |
*
|
14 |
-
* @version 2.4.
|
15 |
* @since 2.3.9
|
16 |
* @author Algoritmika Ltd.
|
17 |
* @extends WC_Email
|
@@ -21,13 +21,13 @@ class WC_Email_WCJ_Custom extends WC_Email {
|
|
21 |
/**
|
22 |
* Constructor
|
23 |
*
|
24 |
-
* @version 2.4.
|
25 |
*/
|
26 |
function __construct( $id = 1 ) {
|
27 |
|
28 |
$this->id = 'wcj_custom' . '_' . $id;
|
29 |
$this->customer_email = ( '%customer%' === $this->get_option( 'recipient' ) ) ? true : false;
|
30 |
-
$this->title = __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $id;
|
31 |
$this->description = __( 'Custom emails are sent to the recipient list when selected triggers are called.', 'woocommerce-jetpack' );
|
32 |
|
33 |
$this->heading = __( 'Custom Heading', 'woocommerce' );
|
@@ -134,8 +134,9 @@ class WC_Email_WCJ_Custom extends WC_Email {
|
|
134 |
/**
|
135 |
* get_content_html function.
|
136 |
*
|
137 |
-
* @
|
138 |
-
* @
|
|
|
139 |
*/
|
140 |
function get_content_html() {
|
141 |
/* ob_start();
|
@@ -146,14 +147,15 @@ class WC_Email_WCJ_Custom extends WC_Email {
|
|
146 |
'plain_text' => false
|
147 |
), '', wcj_plugin_path() . '/templates' );
|
148 |
return ob_get_clean(); */
|
149 |
-
return $this->get_option( 'content_html_template' );
|
150 |
}
|
151 |
|
152 |
/**
|
153 |
* get_content_plain function.
|
154 |
*
|
155 |
-
* @
|
156 |
-
* @
|
|
|
157 |
*/
|
158 |
function get_content_plain() {
|
159 |
/* ob_start();
|
@@ -164,7 +166,7 @@ class WC_Email_WCJ_Custom extends WC_Email {
|
|
164 |
'plain_text' => true
|
165 |
), '', wcj_plugin_path() . '/templates' );
|
166 |
return ob_get_clean(); */
|
167 |
-
return $this->get_option( 'content_plain_template' );
|
168 |
}
|
169 |
|
170 |
/**
|
@@ -272,6 +274,7 @@ class WC_Email_WCJ_Custom extends WC_Email {
|
|
272 |
'content_html_template' => array(
|
273 |
'title' => __( 'HTML template', 'woocommerce' ),
|
274 |
'type' => 'textarea',
|
|
|
275 |
'description' => '',
|
276 |
'placeholder' => '',
|
277 |
'default' => $default_html_template,
|
@@ -280,6 +283,7 @@ class WC_Email_WCJ_Custom extends WC_Email {
|
|
280 |
'content_plain_template' => array(
|
281 |
'title' => __( 'Plain text template', 'woocommerce' ),
|
282 |
'type' => 'textarea',
|
|
|
283 |
'description' => '',
|
284 |
'placeholder' => '',
|
285 |
'default' => $default_plain_template,
|
11 |
*
|
12 |
* An email sent to recipient list when selected triggers are called.
|
13 |
*
|
14 |
+
* @version 2.4.8
|
15 |
* @since 2.3.9
|
16 |
* @author Algoritmika Ltd.
|
17 |
* @extends WC_Email
|
21 |
/**
|
22 |
* Constructor
|
23 |
*
|
24 |
+
* @version 2.4.8
|
25 |
*/
|
26 |
function __construct( $id = 1 ) {
|
27 |
|
28 |
$this->id = 'wcj_custom' . '_' . $id;
|
29 |
$this->customer_email = ( '%customer%' === $this->get_option( 'recipient' ) ) ? true : false;
|
30 |
+
$this->title = get_option( 'wcj_emails_custom_emails_admin_title_' . $id, __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $id );
|
31 |
$this->description = __( 'Custom emails are sent to the recipient list when selected triggers are called.', 'woocommerce-jetpack' );
|
32 |
|
33 |
$this->heading = __( 'Custom Heading', 'woocommerce' );
|
134 |
/**
|
135 |
* get_content_html function.
|
136 |
*
|
137 |
+
* @version 2.4.8
|
138 |
+
* @access public
|
139 |
+
* @return string
|
140 |
*/
|
141 |
function get_content_html() {
|
142 |
/* ob_start();
|
147 |
'plain_text' => false
|
148 |
), '', wcj_plugin_path() . '/templates' );
|
149 |
return ob_get_clean(); */
|
150 |
+
return do_shortcode( $this->get_option( 'content_html_template' ) );
|
151 |
}
|
152 |
|
153 |
/**
|
154 |
* get_content_plain function.
|
155 |
*
|
156 |
+
* @version 2.4.8
|
157 |
+
* @access public
|
158 |
+
* @return string
|
159 |
*/
|
160 |
function get_content_plain() {
|
161 |
/* ob_start();
|
166 |
'plain_text' => true
|
167 |
), '', wcj_plugin_path() . '/templates' );
|
168 |
return ob_get_clean(); */
|
169 |
+
return do_shortcode( $this->get_option( 'content_plain_template' ) );
|
170 |
}
|
171 |
|
172 |
/**
|
274 |
'content_html_template' => array(
|
275 |
'title' => __( 'HTML template', 'woocommerce' ),
|
276 |
'type' => 'textarea',
|
277 |
+
'desc_tip' => __( 'You can use shortcodes here. E.g. Booster\'s order shortcodes.', 'woocommerce' ),
|
278 |
'description' => '',
|
279 |
'placeholder' => '',
|
280 |
'default' => $default_html_template,
|
283 |
'content_plain_template' => array(
|
284 |
'title' => __( 'Plain text template', 'woocommerce' ),
|
285 |
'type' => 'textarea',
|
286 |
+
'desc_tip' => __( 'You can use shortcodes here. E.g. Booster\'s order shortcodes.', 'woocommerce' ),
|
287 |
'description' => '',
|
288 |
'placeholder' => '',
|
289 |
'default' => $default_plain_template,
|
includes/exchange-rates/class-wcj-exchange-rates-crons.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates Crons class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -110,7 +110,7 @@ class WCJ_Exchange_Rates_Crons {
|
|
110 |
/**
|
111 |
* On the scheduled action hook, run a function.
|
112 |
*
|
113 |
-
* @version 2.4.
|
114 |
*/
|
115 |
function update_the_exchange_rates( $interval ) {
|
116 |
|
@@ -136,6 +136,16 @@ class WCJ_Exchange_Rates_Crons {
|
|
136 |
}
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
140 |
// Currency Pairs - Preparation - Gateway Currency
|
141 |
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates Crons class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
110 |
/**
|
111 |
* On the scheduled action hook, run a function.
|
112 |
*
|
113 |
+
* @version 2.4.8
|
114 |
*/
|
115 |
function update_the_exchange_rates( $interval ) {
|
116 |
|
136 |
}
|
137 |
}
|
138 |
|
139 |
+
if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
|
140 |
+
// Currency Pairs - Preparation - Multicurrency Product Base Price
|
141 |
+
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_multicurrency_base_price_exchange_rate_update', 'manual' ) ) ) {
|
142 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
|
143 |
+
$currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
144 |
+
$currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_base_price_exchange_rate_' . $i );
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
150 |
// Currency Pairs - Preparation - Gateway Currency
|
151 |
if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
|
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.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -28,13 +28,14 @@ class WCJ_Exchange_Rates {
|
|
28 |
/**
|
29 |
* register_script.
|
30 |
*
|
31 |
-
* @version 2.4.
|
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',
|
@@ -47,13 +48,14 @@ class WCJ_Exchange_Rates {
|
|
47 |
/**
|
48 |
* enqueue_exchange_rates_script.
|
49 |
*
|
50 |
-
* @version 2.4.
|
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',
|
4 |
*
|
5 |
* The WooCommerce Jetpack Exchange Rates class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
28 |
/**
|
29 |
* register_script.
|
30 |
*
|
31 |
+
* @version 2.4.8
|
32 |
*/
|
33 |
public function register_script() {
|
34 |
if (
|
35 |
isset( $_GET['section'] ) &&
|
36 |
in_array( $_GET['section'], array(
|
37 |
'multicurrency',
|
38 |
+
'multicurrency_base_price',
|
39 |
'price_by_country',
|
40 |
'payment_gateways_currency',
|
41 |
'currency_exchange_rates',
|
48 |
/**
|
49 |
* enqueue_exchange_rates_script.
|
50 |
*
|
51 |
+
* @version 2.4.8
|
52 |
*/
|
53 |
public function enqueue_exchange_rates_script() {
|
54 |
if (
|
55 |
isset( $_GET['section'] ) &&
|
56 |
in_array( $_GET['section'], array(
|
57 |
'multicurrency',
|
58 |
+
'multicurrency_base_price',
|
59 |
'price_by_country',
|
60 |
'payment_gateways_currency',
|
61 |
'currency_exchange_rates',
|
includes/functions/wcj-functions.php
CHANGED
@@ -4,10 +4,60 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Functions.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
/*
|
12 |
* wcj_current_filter_priority.
|
13 |
*
|
@@ -44,7 +94,7 @@ if ( ! function_exists( 'wcj_get_product_input_fields' ) ) {
|
|
44 |
/*
|
45 |
* wcj_get_left_to_free_shipping.
|
46 |
*
|
47 |
-
* @version 2.4.
|
48 |
* @since 2.4.4
|
49 |
* @return string
|
50 |
*/
|
@@ -61,7 +111,7 @@ if ( ! function_exists( 'wcj_get_left_to_free_shipping' ) ) {
|
|
61 |
$total = WC()->cart->cart_contents_total;
|
62 |
}
|
63 |
if ( $total >= $free_shipping->min_amount ) {
|
64 |
-
return '';
|
65 |
} else {
|
66 |
$content = str_replace( '%left_to_free%', wc_price( $free_shipping->min_amount - $total ), $content );
|
67 |
$content = str_replace( '%free_shipping_min_amount%', wc_price( $free_shipping->min_amount ), $content );
|
4 |
*
|
5 |
* The WooCommerce Jetpack Functions.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
11 |
+
if ( ! function_exists( 'wcj_variation_radio_button' ) ) {
|
12 |
+
/**
|
13 |
+
* wcj_variation_radio_button.
|
14 |
+
*
|
15 |
+
* @version 2.4.8
|
16 |
+
* @since 2.4.8
|
17 |
+
*/
|
18 |
+
function wcj_variation_radio_button( $_product, $variation ) {
|
19 |
+
$attributes_html = '';
|
20 |
+
$variation_attributes_display_values = array();
|
21 |
+
$is_checked = true;
|
22 |
+
foreach ( $variation['attributes'] as $attribute_full_name => $attribute_value ) {
|
23 |
+
|
24 |
+
$attributes_html .= ' ' . $attribute_full_name . '="' . $attribute_value . '"';
|
25 |
+
|
26 |
+
$attribute_name = $attribute_full_name;
|
27 |
+
$prefix = 'attribute_';
|
28 |
+
if ( substr( $attribute_full_name, 0, strlen( $prefix ) ) === $prefix ) {
|
29 |
+
$attribute_name = substr( $attribute_full_name, strlen( $prefix ) );
|
30 |
+
}
|
31 |
+
|
32 |
+
$checked = isset( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) ? wc_clean( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) : $_product->get_variation_default_attribute( $attribute_name );
|
33 |
+
if ( $checked != $attribute_value ) $is_checked = false;
|
34 |
+
|
35 |
+
$terms = get_terms( $attribute_name );
|
36 |
+
foreach ( $terms as $term ) {
|
37 |
+
if ( is_object( $term ) && isset( $term->slug ) && $term->slug === $attribute_value && isset( $term->name ) ) {
|
38 |
+
$attribute_value = $term->name;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
$variation_attributes_display_values[] = $attribute_value;
|
43 |
+
|
44 |
+
}
|
45 |
+
$variation_title = implode( ', ', $variation_attributes_display_values ) . ' (' . wc_price( $variation['display_price'] ) . ')';
|
46 |
+
$variation_id = $variation['variation_id'];
|
47 |
+
$is_checked = checked( $is_checked, true, false );
|
48 |
+
|
49 |
+
echo '<td style="width:10%;">';
|
50 |
+
echo '<input name="wcj_variations" type="radio"' . $attributes_html . ' variation_id="' . $variation_id . '"' . $is_checked . '>';
|
51 |
+
echo '</td>';
|
52 |
+
echo '<td>';
|
53 |
+
echo $variation_title;
|
54 |
+
echo '<br>';
|
55 |
+
// echo '<small>' . $variation['variation_description'] . '</small>';
|
56 |
+
echo '<small>' . get_post_meta( $variation_id, '_variation_description', true ) . '</small>';
|
57 |
+
echo '</td>';
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
/*
|
62 |
* wcj_current_filter_priority.
|
63 |
*
|
94 |
/*
|
95 |
* wcj_get_left_to_free_shipping.
|
96 |
*
|
97 |
+
* @version 2.4.8
|
98 |
* @since 2.4.4
|
99 |
* @return string
|
100 |
*/
|
111 |
$total = WC()->cart->cart_contents_total;
|
112 |
}
|
113 |
if ( $total >= $free_shipping->min_amount ) {
|
114 |
+
return get_option( 'wcj_shipping_left_to_free_info_content_reached', __( 'You have Free delivery', 'woocommerce-jetpack' ) );
|
115 |
} else {
|
116 |
$content = str_replace( '%left_to_free%', wc_price( $free_shipping->min_amount - $total ), $content );
|
117 |
$content = str_replace( '%free_shipping_min_amount%', wc_price( $free_shipping->min_amount ), $content );
|
includes/gateways/class-wc-gateway-wcj-custom.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Custom Payment Gateway class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -337,12 +337,12 @@ if ( ! function_exists( 'init_wc_gateway_wcj_custom_class' ) ) {
|
|
337 |
/**
|
338 |
* init.
|
339 |
*
|
340 |
-
* @version 2.4.
|
341 |
*/
|
342 |
public function init( $id_count ) {
|
343 |
$this->id = ( 1 === $id_count ) ? 'jetpack_custom_gateway' : 'jetpack_custom_gateway_' . $id_count;
|
344 |
$this->has_fields = false;
|
345 |
-
$this->method_title = __( 'Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $id_count;
|
346 |
$this->method_description = __( 'Booster for WooCommerce: Custom Payment Gateway', 'woocommerce-jetpack' ) . ' #' . $id_count;
|
347 |
$this->id_count = $id_count;
|
348 |
// Load the settings.
|
4 |
*
|
5 |
* The WooCommerce Jetpack Custom Payment Gateway class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
337 |
/**
|
338 |
* init.
|
339 |
*
|
340 |
+
* @version 2.4.8
|
341 |
*/
|
342 |
public function init( $id_count ) {
|
343 |
$this->id = ( 1 === $id_count ) ? 'jetpack_custom_gateway' : 'jetpack_custom_gateway_' . $id_count;
|
344 |
$this->has_fields = false;
|
345 |
+
$this->method_title = get_option( 'wcj_custom_payment_gateways_admin_title_' . $id_count, __( 'Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $id_count );
|
346 |
$this->method_description = __( 'Booster for WooCommerce: Custom Payment Gateway', 'woocommerce-jetpack' ) . ' #' . $id_count;
|
347 |
$this->id_count = $id_count;
|
348 |
// Load the settings.
|
includes/input-fields/class-wcj-product-input-fields-global.php
CHANGED
@@ -14,57 +14,47 @@ if ( ! class_exists( 'WCJ_Product_Input_Fields_Global' ) ) :
|
|
14 |
|
15 |
class WCJ_Product_Input_Fields_Global extends WCJ_Product_Input_Fields_Abstract {
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
$this->scope = 'global';
|
23 |
|
24 |
-
|
25 |
-
if ( 'yes' === get_option( 'wcj_product_input_fields_global_enabled' ) ) {
|
26 |
|
27 |
// Show fields at frontend
|
28 |
-
add_action( 'woocommerce_before_add_to_cart_button',
|
29 |
|
30 |
// Process from $_POST to cart item data
|
31 |
-
add_filter( 'woocommerce_add_to_cart_validation',
|
32 |
-
add_filter( 'woocommerce_add_cart_item_data',
|
33 |
// from session
|
34 |
-
add_filter( 'woocommerce_get_cart_item_from_session',
|
35 |
|
36 |
// Show details at cart, order details, emails
|
37 |
-
add_filter( 'woocommerce_cart_item_name',
|
38 |
-
add_filter( 'woocommerce_order_item_name',
|
39 |
|
40 |
// Add item meta from cart to order
|
41 |
-
add_action( 'woocommerce_add_order_item_meta',
|
42 |
|
43 |
// Make nicer name for product input fields in order at backend (shop manager)
|
44 |
-
//add_action( 'woocommerce_before_order_itemmeta',
|
45 |
-
//add_action( 'woocommerce_before_order_itemmeta',
|
46 |
-
//add_action( 'woocommerce_after_order_itemmeta',
|
47 |
-
add_action( 'woocommerce_after_order_itemmeta',
|
48 |
if ( 'yes' === get_option( 'wcj_product_input_fields_make_nicer_name_enabled' ) ) {
|
49 |
-
|
50 |
-
add_filter( 'woocommerce_hidden_order_itemmeta', array( $this, 'hide_custom_input_fields_default_output_in_admin_order' ), 100 );
|
51 |
}
|
52 |
//add_filter( 'woocommerce_attribute_label', array( $this, 'change_woocommerce_attribute_label' ), PHP_INT_MAX, 2 );
|
53 |
|
54 |
-
//add_action( 'init',
|
55 |
-
//add_action( 'woocommerce_ajax_added_to_cart',
|
56 |
-
//add_action( 'woocommerce_loop_add_to_cart_link',
|
57 |
-
//add_action( 'woocommerce_after_shop_loop_item',
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
}
|
62 |
-
|
63 |
-
// Settings hooks
|
64 |
-
//add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
|
65 |
-
//add_filter( 'wcj_settings_product_input_fields_global', array( $this, 'get_settings' ), 100 );
|
66 |
-
//add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
|
67 |
-
}
|
68 |
|
69 |
/**
|
70 |
* replace_loop_add_to_cart_button.
|
@@ -72,7 +62,7 @@ class WCJ_Product_Input_Fields_Global extends WCJ_Product_Input_Fields_Abstract
|
|
72 |
public function replace_loop_add_to_cart_button( $button, $product ) {
|
73 |
$html .= '<form class="cart" method="post" enctype=\'multipart/form-data\'>';
|
74 |
$html .= '<input type="hidden" name="add-to-cart" value="' . esc_attr( $product->id ) . '" />';
|
75 |
-
|
76 |
$html .= $button;
|
77 |
$html .= '</form>';
|
78 |
return $html;
|
@@ -111,7 +101,6 @@ class WCJ_Product_Input_Fields_Global extends WCJ_Product_Input_Fields_Abstract
|
|
111 |
return get_option( $option_name, $default );
|
112 |
}
|
113 |
|
114 |
-
|
115 |
}
|
116 |
|
117 |
endif;
|
14 |
|
15 |
class WCJ_Product_Input_Fields_Global extends WCJ_Product_Input_Fields_Abstract {
|
16 |
|
17 |
+
/**
|
18 |
+
* Constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
|
22 |
$this->scope = 'global';
|
23 |
|
24 |
+
if ( 'yes' === get_option( 'wcj_product_input_fields_global_enabled' ) ) {
|
|
|
25 |
|
26 |
// Show fields at frontend
|
27 |
+
add_action( 'woocommerce_before_add_to_cart_button', array( $this, 'add_product_input_fields_to_frontend' ), 100 );
|
28 |
|
29 |
// Process from $_POST to cart item data
|
30 |
+
add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'validate_product_input_fields_on_add_to_cart' ), 100, 2 );
|
31 |
+
add_filter( 'woocommerce_add_cart_item_data', array( $this, 'add_product_input_fields_to_cart_item_data' ), 100, 3 );
|
32 |
// from session
|
33 |
+
add_filter( 'woocommerce_get_cart_item_from_session', array( $this, 'get_cart_item_product_input_fields_from_session' ), 100, 3 );
|
34 |
|
35 |
// Show details at cart, order details, emails
|
36 |
+
add_filter( 'woocommerce_cart_item_name', array( $this, 'add_product_input_fields_to_cart_item_name' ), 100, 3 );
|
37 |
+
add_filter( 'woocommerce_order_item_name', array( $this, 'add_product_input_fields_to_order_item_name' ), 100, 2 );
|
38 |
|
39 |
// Add item meta from cart to order
|
40 |
+
add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_product_input_fields_to_order_item_meta' ), 100, 3 );
|
41 |
|
42 |
// Make nicer name for product input fields in order at backend (shop manager)
|
43 |
+
//add_action( 'woocommerce_before_order_itemmeta', array( $this, 'start_making_nicer_name_for_product_input_fields' ), 100, 3 );
|
44 |
+
//add_action( 'woocommerce_before_order_itemmeta', 'ob_start' );
|
45 |
+
//add_action( 'woocommerce_after_order_itemmeta', array( $this, 'finish_making_nicer_name_for_product_input_fields' ), 100, 3 );
|
46 |
+
add_action( 'woocommerce_after_order_itemmeta', array( $this, 'output_custom_input_fields_in_admin_order' ), 100, 3 );
|
47 |
if ( 'yes' === get_option( 'wcj_product_input_fields_make_nicer_name_enabled' ) ) {
|
48 |
+
add_filter( 'woocommerce_hidden_order_itemmeta', array( $this, 'hide_custom_input_fields_default_output_in_admin_order' ), 100 );
|
|
|
49 |
}
|
50 |
//add_filter( 'woocommerce_attribute_label', array( $this, 'change_woocommerce_attribute_label' ), PHP_INT_MAX, 2 );
|
51 |
|
52 |
+
//add_action( 'init', array( $this, 'init' ), 100 );
|
53 |
+
//add_action( 'woocommerce_ajax_added_to_cart', array( $this, 'ajax_add_to_cart' ), 100 );
|
54 |
+
//add_action( 'woocommerce_loop_add_to_cart_link', array( $this, 'replace_loop_add_to_cart_button' ), 100, 2 );
|
55 |
+
//add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_product_input_fields_to_frontend' ), 100 );
|
56 |
+
}
|
57 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
/**
|
60 |
* replace_loop_add_to_cart_button.
|
62 |
public function replace_loop_add_to_cart_button( $button, $product ) {
|
63 |
$html .= '<form class="cart" method="post" enctype=\'multipart/form-data\'>';
|
64 |
$html .= '<input type="hidden" name="add-to-cart" value="' . esc_attr( $product->id ) . '" />';
|
65 |
+
$html .= '<button type="submit" class="button add_to_cart_button product_type_simple">' . $product->single_add_to_cart_text() . '</button>';
|
66 |
$html .= $button;
|
67 |
$html .= '</form>';
|
68 |
return $html;
|
101 |
return get_option( $option_name, $default );
|
102 |
}
|
103 |
|
|
|
104 |
}
|
105 |
|
106 |
endif;
|
includes/input-fields/class-wcj-product-input-fields-per-product.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Input Fields per Product class.
|
6 |
*
|
7 |
-
* @version 2.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -98,11 +98,13 @@ class WCJ_Product_Input_Fields_Per_Product extends WCJ_Product_Input_Fields_Abst
|
|
98 |
|
99 |
/**
|
100 |
* add_local_product_input_fields_meta_box_to_product_edit.
|
|
|
|
|
101 |
*/
|
102 |
public function add_local_product_input_fields_meta_box_to_product_edit() {
|
103 |
add_meta_box(
|
104 |
'wc-jetpack-product-input-fields',
|
105 |
-
__( '
|
106 |
array( $this, 'create_local_product_input_fields_meta_box' ),
|
107 |
'product',
|
108 |
'normal',
|
4 |
*
|
5 |
* The WooCommerce Jetpack Product Input Fields per Product class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
98 |
|
99 |
/**
|
100 |
* add_local_product_input_fields_meta_box_to_product_edit.
|
101 |
+
*
|
102 |
+
* @version 2.4.8
|
103 |
*/
|
104 |
public function add_local_product_input_fields_meta_box_to_product_edit() {
|
105 |
add_meta_box(
|
106 |
'wc-jetpack-product-input-fields',
|
107 |
+
__( 'Booster: Product Input Fields', 'woocommerce-jetpack' ),
|
108 |
array( $this, 'create_local_product_input_fields_meta_box' ),
|
109 |
'product',
|
110 |
'normal',
|
includes/js/wcj-variations-frontend.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
if(jQuery("input:radio[name='wcj_variations']").is(':checked')){
|
3 |
+
var checked_radio = jQuery("input:radio[name='wcj_variations']:checked");
|
4 |
+
var variation_id = checked_radio.attr("variation_id");
|
5 |
+
jQuery("input:hidden[name='variation_id']").val(variation_id);
|
6 |
+
jQuery(checked_radio[0].attributes).each(
|
7 |
+
function(i, attribute){
|
8 |
+
if(attribute.name.match("^attribute_")){
|
9 |
+
jQuery("input:hidden[name='" + attribute.name + "']").val(attribute.value);
|
10 |
+
}
|
11 |
+
}
|
12 |
+
);
|
13 |
+
}
|
14 |
+
jQuery("input:radio[name='wcj_variations']").change(
|
15 |
+
function(){
|
16 |
+
jQuery("input:hidden[name='variation_id']").val(jQuery(this).attr("variation_id"));
|
17 |
+
jQuery(this.attributes).each(
|
18 |
+
function(i, attribute){
|
19 |
+
if(attribute.name.match("^attribute_")){
|
20 |
+
jQuery("input:hidden[name='" + attribute.name + "']").val(attribute.value);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
);
|
24 |
+
}
|
25 |
+
);
|
26 |
+
});
|
includes/lib/tcpdf_min/fonts/angsanaupc.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupc.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='AngsanaUPC';
|
4 |
+
$desc=array('Ascent'=>923,'Descent'=>-239,'CapHeight'=>5,'Flags'=>32,'FontBBox'=>'[-490 -410 791 941]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>165,33=>220,34=>270,35=>330,36=>330,37=>550,38=>513,39=>119,40=>220,41=>220,
|
10 |
+
42=>330,43=>372,44=>165,45=>220,46=>165,47=>183,48=>330,49=>330,50=>330,51=>330,
|
11 |
+
52=>330,53=>330,54=>330,55=>330,56=>330,57=>330,58=>183,59=>183,60=>372,61=>372,
|
12 |
+
62=>372,63=>293,64=>608,65=>477,66=>440,67=>440,68=>477,69=>403,70=>367,71=>477,
|
13 |
+
72=>477,73=>220,74=>257,75=>477,76=>403,77=>587,78=>477,79=>477,80=>367,81=>477,
|
14 |
+
82=>440,83=>367,84=>403,85=>477,86=>477,87=>623,88=>477,89=>477,90=>403,91=>220,
|
15 |
+
92=>183,93=>220,94=>310,95=>330,96=>220,97=>293,98=>330,99=>293,100=>330,101=>293,
|
16 |
+
102=>220,103=>330,104=>330,105=>183,106=>183,107=>330,108=>183,109=>513,110=>330,111=>330,
|
17 |
+
112=>330,113=>330,114=>220,115=>257,116=>183,117=>330,118=>330,119=>477,120=>330,121=>330,
|
18 |
+
122=>293,123=>317,124=>132,125=>317,126=>357,8364=>330,8218=>165,402=>330,8222=>293,8230=>660,
|
19 |
+
8224=>330,8225=>330,710=>220,8240=>660,352=>367,8249=>220,338=>587,8216=>220,8217=>220,8220=>293,
|
20 |
+
8221=>293,8226=>231,8211=>330,8212=>660,732=>220,8482=>647,353=>257,8250=>220,339=>477,376=>477,
|
21 |
+
161=>220,162=>330,163=>330,164=>330,165=>330,166=>132,167=>330,168=>220,169=>501,170=>182,
|
22 |
+
171=>330,172=>372,173=>220,174=>501,175=>330,176=>264,177=>362,178=>198,179=>198,180=>220,
|
23 |
+
181=>380,182=>299,183=>165,184=>220,185=>198,186=>205,187=>330,188=>495,189=>495,190=>495,
|
24 |
+
191=>293,192=>477,193=>477,194=>477,195=>477,196=>477,197=>477,198=>587,199=>440,200=>403,
|
25 |
+
201=>403,202=>403,203=>403,204=>220,205=>220,206=>220,207=>220,208=>477,209=>477,210=>477,
|
26 |
+
211=>477,212=>477,213=>477,214=>477,215=>372,216=>477,217=>477,218=>477,219=>477,220=>477,
|
27 |
+
221=>477,222=>367,223=>330,224=>293,225=>293,226=>293,227=>293,228=>293,229=>293,230=>440,
|
28 |
+
231=>293,232=>293,233=>293,234=>293,235=>293,236=>183,237=>183,238=>183,239=>183,240=>330,
|
29 |
+
241=>330,242=>330,243=>330,244=>330,245=>330,246=>330,247=>362,248=>330,249=>330,250=>330,
|
30 |
+
251=>330,252=>330,253=>330,254=>330,255=>330,63259=>0,63232=>378,63233=>0,63234=>0,63235=>0,
|
31 |
+
63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,
|
32 |
+
63246=>0,63247=>525,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,
|
33 |
+
3584=>100,3585=>396,3586=>398,3587=>454,3588=>398,3589=>400,3590=>484,3591=>315,3592=>355,3593=>428,
|
34 |
+
3594=>405,3595=>440,3596=>506,3597=>522,3598=>420,3599=>425,3600=>378,3601=>524,3602=>521,3603=>534,
|
35 |
+
3604=>400,3605=>401,3606=>395,3607=>450,3608=>380,3609=>460,3610=>450,3611=>450,3612=>391,3613=>391,
|
36 |
+
3614=>464,3615=>464,3616=>414,3617=>420,3618=>343,3619=>342,3620=>395,3621=>395,3622=>415,3623=>354,
|
37 |
+
3624=>390,3625=>441,3626=>440,3627=>467,3628=>455,3629=>394,3630=>371,3631=>400,3632=>358,3633=>0,
|
38 |
+
3634=>285,3635=>285,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>221,
|
39 |
+
63261=>221,3647=>440,3648=>168,3649=>377,3650=>342,3651=>306,3652=>344,3653=>292,3654=>425,3655=>0,
|
40 |
+
3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>428,3664=>402,3665=>404,
|
41 |
+
3666=>568,3667=>510,3668=>512,3669=>528,3670=>427,3671=>536,3672=>502,3673=>408,3674=>471,3675=>816,
|
42 |
+
63256=>0,63257=>0,63258=>0,9702=>220,305=>183,711=>220);
|
43 |
+
$enc='';
|
44 |
+
$diff='';
|
45 |
+
$file='angsanaupc.z';
|
46 |
+
$ctg='angsanaupc.ctg.z';
|
47 |
+
$originalsize=95808;
|
48 |
+
?>
|
includes/lib/tcpdf_min/fonts/angsanaupc.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupcb.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupcb.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='AngsanaUPC-Bold';
|
4 |
+
$desc=array('Ascent'=>888,'Descent'=>-239,'CapHeight'=>4,'Flags'=>32,'FontBBox'=>'[-501 -433 783 995]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>165,33=>220,34=>366,35=>330,36=>330,37=>660,38=>550,39=>183,40=>220,41=>220,
|
10 |
+
42=>330,43=>376,44=>165,45=>220,46=>165,47=>183,48=>330,49=>330,50=>330,51=>330,
|
11 |
+
52=>330,53=>330,54=>330,55=>330,56=>330,57=>330,58=>220,59=>220,60=>376,61=>376,
|
12 |
+
62=>376,63=>330,64=>614,65=>477,66=>440,67=>477,68=>477,69=>440,70=>403,71=>513,
|
13 |
+
72=>513,73=>257,74=>330,75=>513,76=>440,77=>623,78=>477,79=>513,80=>403,81=>513,
|
14 |
+
82=>477,83=>367,84=>440,85=>477,86=>477,87=>660,88=>477,89=>477,90=>440,91=>220,
|
15 |
+
92=>183,93=>220,94=>384,95=>330,96=>220,97=>330,98=>367,99=>293,100=>367,101=>293,
|
16 |
+
102=>220,103=>330,104=>367,105=>183,106=>220,107=>367,108=>183,109=>550,110=>367,111=>330,
|
17 |
+
112=>367,113=>367,114=>293,115=>257,116=>220,117=>367,118=>330,119=>477,120=>330,121=>330,
|
18 |
+
122=>293,123=>260,124=>145,125=>260,126=>358,8364=>330,8218=>220,402=>330,8222=>330,8230=>660,
|
19 |
+
8224=>330,8225=>330,710=>220,8240=>660,352=>367,8249=>220,338=>660,8216=>220,8217=>220,8220=>330,
|
20 |
+
8221=>330,8226=>231,8211=>330,8212=>660,732=>220,8482=>660,353=>257,8250=>220,339=>477,376=>477,
|
21 |
+
161=>220,162=>330,163=>330,164=>330,165=>330,166=>146,167=>330,168=>220,169=>493,170=>198,
|
22 |
+
171=>330,172=>376,173=>220,174=>493,175=>330,176=>264,177=>362,178=>198,179=>198,180=>220,
|
23 |
+
181=>380,182=>356,183=>165,184=>220,185=>198,186=>218,187=>330,188=>495,189=>495,190=>495,
|
24 |
+
191=>330,192=>477,193=>477,194=>477,195=>477,196=>477,197=>477,198=>660,199=>477,200=>440,
|
25 |
+
201=>440,202=>440,203=>440,204=>257,205=>257,206=>257,207=>257,208=>477,209=>477,210=>513,
|
26 |
+
211=>513,212=>513,213=>513,214=>513,215=>376,216=>514,217=>477,218=>477,219=>477,220=>477,
|
27 |
+
221=>477,222=>403,223=>367,224=>330,225=>330,226=>330,227=>330,228=>330,229=>330,230=>477,
|
28 |
+
231=>293,232=>293,233=>293,234=>293,235=>293,236=>184,237=>184,238=>184,239=>184,240=>330,
|
29 |
+
241=>367,242=>330,243=>330,244=>330,245=>330,246=>330,247=>362,248=>330,249=>367,250=>367,
|
30 |
+
251=>367,252=>367,253=>330,254=>367,255=>330,63259=>0,63232=>386,63233=>0,63234=>0,63235=>0,
|
31 |
+
63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,
|
32 |
+
63246=>0,63247=>540,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,
|
33 |
+
3584=>100,3585=>383,3586=>415,3587=>453,3588=>404,3589=>419,3590=>499,3591=>324,3592=>380,3593=>426,
|
34 |
+
3594=>403,3595=>470,3596=>527,3597=>545,3598=>444,3599=>449,3600=>386,3601=>526,3602=>561,3603=>543,
|
35 |
+
3604=>411,3605=>418,3606=>398,3607=>447,3608=>383,3609=>460,3610=>442,3611=>444,3612=>414,3613=>414,
|
36 |
+
3614=>494,3615=>494,3616=>433,3617=>435,3618=>370,3619=>349,3620=>387,3621=>383,3622=>437,3623=>360,
|
37 |
+
3624=>417,3625=>442,3626=>420,3627=>462,3628=>568,3629=>383,3630=>374,3631=>440,3632=>350,3633=>0,
|
38 |
+
3634=>284,3635=>284,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>221,
|
39 |
+
63261=>221,3647=>440,3648=>174,3649=>356,3650=>251,3651=>232,3652=>291,3653=>300,3654=>338,3655=>0,
|
40 |
+
3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>357,3664=>380,3665=>358,
|
41 |
+
3666=>529,3667=>498,3668=>496,3669=>508,3670=>356,3671=>515,3672=>503,3673=>388,3674=>491,3675=>821,
|
42 |
+
63256=>0,63257=>0,63258=>0,9702=>220,305=>184,711=>220);
|
43 |
+
$enc='';
|
44 |
+
$diff='';
|
45 |
+
$file='angsanaupcb.z';
|
46 |
+
$ctg='angsanaupcb.ctg.z';
|
47 |
+
$originalsize=91688;
|
48 |
+
?>
|
includes/lib/tcpdf_min/fonts/angsanaupcb.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupcbi.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupcbi.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='AngsanaUPC-BoldItalic';
|
4 |
+
$desc=array('Ascent'=>928,'Descent'=>-206,'CapHeight'=>-40,'Flags'=>96,'FontBBox'=>'[-458 -433 790 994]','ItalicAngle'=>-10,'StemV'=>120,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>165,33=>257,34=>366,35=>330,36=>330,37=>550,38=>513,39=>183,40=>220,41=>220,
|
10 |
+
42=>330,43=>376,44=>165,45=>220,46=>165,47=>183,48=>330,49=>330,50=>330,51=>330,
|
11 |
+
52=>330,53=>330,54=>330,55=>330,56=>330,57=>330,58=>220,59=>220,60=>376,61=>376,
|
12 |
+
62=>376,63=>330,64=>549,65=>440,66=>440,67=>440,68=>477,69=>440,70=>440,71=>477,
|
13 |
+
72=>513,73=>257,74=>330,75=>440,76=>403,77=>587,78=>477,79=>477,80=>403,81=>477,
|
14 |
+
82=>440,83=>367,84=>403,85=>477,86=>440,87=>587,88=>440,89=>403,90=>403,91=>220,
|
15 |
+
92=>183,93=>220,94=>376,95=>330,96=>220,97=>330,98=>330,99=>293,100=>330,101=>293,
|
16 |
+
102=>220,103=>330,104=>367,105=>183,106=>183,107=>330,108=>183,109=>513,110=>367,111=>330,
|
17 |
+
112=>330,113=>330,114=>257,115=>257,116=>183,117=>367,118=>293,119=>440,120=>330,121=>293,
|
18 |
+
122=>257,123=>230,124=>145,125=>230,126=>376,8364=>330,8230=>660,8216=>220,8217=>220,8220=>330,
|
19 |
+
8221=>330,8226=>231,8211=>330,8212=>660,63259=>0,63232=>386,63233=>0,63234=>0,63235=>0,63236=>0,
|
20 |
+
63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,
|
21 |
+
63247=>540,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,3584=>100,
|
22 |
+
3585=>383,3586=>415,3587=>453,3588=>404,3589=>419,3590=>499,3591=>324,3592=>380,3593=>426,3594=>403,
|
23 |
+
3595=>470,3596=>527,3597=>545,3598=>444,3599=>449,3600=>363,3601=>526,3602=>561,3603=>543,3604=>411,
|
24 |
+
3605=>418,3606=>398,3607=>447,3608=>383,3609=>460,3610=>442,3611=>444,3612=>414,3613=>414,3614=>494,
|
25 |
+
3615=>489,3616=>433,3617=>435,3618=>370,3619=>349,3620=>387,3621=>383,3622=>437,3623=>360,3624=>417,
|
26 |
+
3625=>442,3626=>420,3627=>462,3628=>568,3629=>383,3630=>374,3631=>440,3633=>0,3632=>350,3634=>284,
|
27 |
+
3635=>284,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>221,63261=>221,
|
28 |
+
3647=>448,3648=>174,3649=>356,3650=>251,3651=>232,3652=>291,3653=>300,3654=>338,3655=>0,3656=>0,
|
29 |
+
3657=>0,3658=>0,3659=>0,3660=>2,3661=>0,3662=>0,3663=>357,3664=>380,3665=>358,3666=>529,
|
30 |
+
3667=>498,3668=>496,3669=>508,3670=>356,3671=>515,3672=>503,3673=>388,3674=>491,3675=>821,63256=>0,
|
31 |
+
63257=>0,63258=>0);
|
32 |
+
$enc='';
|
33 |
+
$diff='';
|
34 |
+
$file='angsanaupcbi.z';
|
35 |
+
$ctg='angsanaupcbi.ctg.z';
|
36 |
+
$originalsize=76280;
|
37 |
+
?>
|
includes/lib/tcpdf_min/fonts/angsanaupcbi.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupci.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/angsanaupci.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='AngsanaUPC-Italic';
|
4 |
+
$desc=array('Ascent'=>923,'Descent'=>-239,'CapHeight'=>-44,'Flags'=>96,'FontBBox'=>'[-434 -410 797 941]','ItalicAngle'=>-10,'StemV'=>70,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>165,33=>220,34=>277,35=>330,36=>330,37=>550,38=>513,39=>141,40=>220,41=>220,
|
10 |
+
42=>330,43=>445,44=>165,45=>220,46=>165,47=>183,48=>330,49=>330,50=>330,51=>330,
|
11 |
+
52=>330,53=>330,54=>330,55=>330,56=>330,57=>330,58=>220,59=>220,60=>445,61=>445,
|
12 |
+
62=>445,63=>330,64=>607,65=>403,66=>403,67=>440,68=>477,69=>403,70=>403,71=>477,
|
13 |
+
72=>477,73=>220,74=>293,75=>440,76=>367,77=>550,78=>440,79=>477,80=>403,81=>477,
|
14 |
+
82=>403,83=>330,84=>367,85=>477,86=>403,87=>550,88=>403,89=>367,90=>367,91=>257,
|
15 |
+
92=>183,93=>257,94=>279,95=>330,96=>220,97=>330,98=>330,99=>293,100=>330,101=>293,
|
16 |
+
102=>183,103=>330,104=>330,105=>183,106=>183,107=>293,108=>183,109=>477,110=>330,111=>330,
|
17 |
+
112=>330,113=>330,114=>257,115=>257,116=>183,117=>330,118=>293,119=>440,120=>293,121=>293,
|
18 |
+
122=>257,123=>264,124=>181,125=>264,126=>357,8364=>330,8230=>587,8216=>220,8217=>220,8220=>367,
|
19 |
+
8221=>367,8226=>231,8211=>330,8212=>587,63259=>0,63232=>378,63233=>0,63234=>0,63235=>0,63236=>0,
|
20 |
+
63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,
|
21 |
+
63247=>525,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,3584=>100,
|
22 |
+
3585=>396,3586=>398,3587=>454,3588=>398,3589=>400,3590=>484,3591=>315,3592=>355,3593=>428,3594=>405,
|
23 |
+
3595=>440,3596=>506,3597=>522,3598=>420,3599=>425,3600=>378,3601=>524,3602=>521,3603=>534,3604=>400,
|
24 |
+
3605=>401,3606=>394,3607=>450,3608=>380,3609=>460,3610=>450,3611=>450,3612=>391,3613=>390,3614=>464,
|
25 |
+
3615=>464,3616=>414,3617=>420,3618=>343,3619=>342,3620=>395,3621=>395,3622=>415,3623=>354,3624=>390,
|
26 |
+
3625=>441,3626=>440,3627=>467,3628=>455,3629=>394,3630=>371,3631=>400,3633=>0,3632=>358,3634=>285,
|
27 |
+
3635=>290,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>221,63261=>221,
|
28 |
+
3647=>440,3648=>168,3649=>377,3650=>342,3651=>306,3652=>344,3653=>292,3654=>425,3655=>0,3656=>0,
|
29 |
+
3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>428,3664=>402,3665=>404,3666=>568,
|
30 |
+
3667=>510,3668=>512,3669=>528,3670=>427,3671=>536,3672=>502,3673=>408,3674=>471,3675=>816,63256=>0,
|
31 |
+
63257=>0,63258=>0);
|
32 |
+
$enc='';
|
33 |
+
$diff='';
|
34 |
+
$file='angsanaupci.z';
|
35 |
+
$ctg='angsanaupci.ctg.z';
|
36 |
+
$originalsize=75060;
|
37 |
+
?>
|
includes/lib/tcpdf_min/fonts/angsanaupci.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupc.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupc.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='CordiaUPC';
|
4 |
+
$desc=array('Ascent'=>893,'Descent'=>-254,'CapHeight'=>4,'Flags'=>32,'FontBBox'=>'[-452 -488 777 898]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>182,33=>218,34=>182,35=>365,36=>365,37=>583,38=>437,39=>146,40=>218,41=>218,
|
10 |
+
42=>255,43=>433,44=>182,45=>218,46=>182,47=>182,48=>365,49=>365,50=>365,51=>365,
|
11 |
+
52=>365,53=>365,54=>365,55=>365,56=>365,57=>365,58=>182,59=>182,60=>433,61=>433,
|
12 |
+
62=>433,63=>328,64=>524,65=>437,66=>437,67=>473,68=>473,69=>400,70=>365,71=>510,
|
13 |
+
72=>473,73=>182,74=>328,75=>437,76=>365,77=>546,78=>473,79=>510,80=>400,81=>510,
|
14 |
+
82=>437,83=>400,84=>365,85=>473,86=>400,87=>583,88=>400,89=>400,90=>400,91=>218,
|
15 |
+
92=>182,93=>218,94=>433,95=>328,96=>218,97=>365,98=>400,99=>365,100=>400,101=>365,
|
16 |
+
102=>182,103=>400,104=>365,105=>146,106=>146,107=>328,108=>146,109=>546,110=>365,111=>365,
|
17 |
+
112=>400,113=>400,114=>218,115=>328,116=>182,117=>365,118=>328,119=>473,120=>328,121=>328,
|
18 |
+
122=>328,123=>218,124=>146,125=>218,126=>433,8218=>151,402=>377,8222=>226,8230=>655,8224=>377,
|
19 |
+
8225=>377,710=>226,8240=>679,352=>400,8249=>226,338=>679,8216=>146,8217=>146,8220=>255,8221=>255,
|
20 |
+
8226=>328,8211=>328,8212=>655,732=>226,8482=>679,353=>328,8250=>226,339=>641,376=>400,161=>226,
|
21 |
+
162=>377,163=>377,164=>377,165=>377,166=>176,167=>377,168=>226,169=>500,170=>251,171=>377,
|
22 |
+
172=>396,173=>226,174=>500,175=>375,176=>271,177=>373,178=>226,179=>226,180=>226,181=>391,
|
23 |
+
182=>365,183=>188,184=>226,185=>226,186=>248,187=>377,188=>566,189=>566,190=>566,191=>415,
|
24 |
+
192=>437,193=>437,194=>437,195=>437,196=>437,197=>437,198=>679,199=>473,200=>400,201=>400,
|
25 |
+
202=>400,203=>400,204=>182,205=>182,206=>182,207=>182,208=>490,209=>473,210=>510,211=>510,
|
26 |
+
212=>510,213=>510,214=>510,215=>396,216=>528,217=>473,218=>473,219=>473,220=>473,221=>400,
|
27 |
+
222=>453,223=>415,224=>365,225=>365,226=>365,227=>365,228=>365,229=>365,230=>604,231=>365,
|
28 |
+
232=>365,233=>365,234=>365,235=>365,236=>188,237=>188,238=>188,239=>188,240=>377,241=>365,
|
29 |
+
242=>365,243=>365,244=>365,245=>365,246=>365,247=>373,248=>415,249=>365,250=>365,251=>365,
|
30 |
+
252=>365,253=>328,254=>377,255=>328,63259=>0,63232=>382,63233=>0,63234=>0,63235=>0,63236=>0,
|
31 |
+
63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,
|
32 |
+
63247=>608,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,3584=>100,
|
33 |
+
3585=>400,3586=>376,3587=>400,3588=>417,3589=>417,3590=>487,3591=>313,3592=>382,3593=>405,3594=>382,
|
34 |
+
3595=>382,3596=>597,3597=>608,3598=>440,3599=>440,3600=>382,3601=>504,3602=>614,3603=>608,3604=>417,
|
35 |
+
3605=>417,3606=>400,3607=>429,3608=>359,3609=>429,3610=>446,3611=>446,3612=>405,3613=>405,3614=>463,
|
36 |
+
3615=>463,3616=>440,3617=>434,3618=>400,3619=>301,3620=>400,3621=>405,3622=>440,3623=>347,3624=>417,
|
37 |
+
3625=>475,3626=>405,3627=>429,3628=>463,3629=>394,3630=>382,3631=>359,3632=>359,3633=>0,3634=>347,
|
38 |
+
3635=>347,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>220,63261=>220,
|
39 |
+
3647=>437,3648=>202,3649=>376,3650=>243,3651=>278,3652=>260,3653=>347,3654=>376,3655=>0,3656=>0,
|
40 |
+
3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>313,3664=>463,3665=>463,3666=>487,
|
41 |
+
3667=>487,3668=>487,3669=>487,3670=>463,3671=>487,3672=>487,3673=>487,3674=>409,3675=>792,63256=>0,
|
42 |
+
63257=>0,63258=>0,9702=>226,305=>188,711=>226);
|
43 |
+
$enc='';
|
44 |
+
$diff='';
|
45 |
+
$file='cordiaupc.z';
|
46 |
+
$ctg='cordiaupc.ctg.z';
|
47 |
+
$originalsize=96088;
|
48 |
+
?>
|
includes/lib/tcpdf_min/fonts/cordiaupc.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupcb.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupcb.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='CordiaUPC-Bold';
|
4 |
+
$desc=array('Ascent'=>833,'Descent'=>-261,'CapHeight'=>3,'Flags'=>32,'FontBBox'=>'[-547 -417 791 833]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>224,33=>182,34=>233,35=>365,36=>365,37=>583,38=>437,39=>125,40=>218,41=>218,
|
10 |
+
42=>255,43=>383,44=>182,45=>218,46=>182,47=>182,48=>365,49=>365,50=>365,51=>365,
|
11 |
+
52=>365,53=>365,54=>365,55=>365,56=>365,57=>365,58=>182,59=>182,60=>383,61=>383,
|
12 |
+
62=>383,63=>365,64=>665,65=>437,66=>437,67=>473,68=>473,69=>437,70=>400,71=>510,
|
13 |
+
72=>473,73=>182,74=>328,75=>437,76=>365,77=>546,78=>473,79=>510,80=>437,81=>510,
|
14 |
+
82=>473,83=>437,84=>400,85=>473,86=>437,87=>618,88=>437,89=>437,90=>400,91=>182,
|
15 |
+
92=>182,93=>182,94=>307,95=>365,96=>218,97=>365,98=>365,99=>328,100=>365,101=>365,
|
16 |
+
102=>182,103=>365,104=>365,105=>146,106=>146,107=>328,108=>146,109=>546,110=>365,111=>365,
|
17 |
+
112=>365,113=>365,114=>218,115=>328,116=>182,117=>365,118=>328,119=>473,120=>328,121=>328,
|
18 |
+
122=>328,123=>219,124=>170,125=>219,126=>383,8218=>146,402=>365,8222=>218,8230=>655,8224=>365,
|
19 |
+
8225=>365,710=>218,8240=>655,352=>437,8249=>218,338=>655,8216=>146,8217=>146,8220=>218,8221=>218,
|
20 |
+
8226=>229,8211=>365,8212=>655,732=>218,8482=>655,353=>328,8250=>218,339=>619,376=>437,161=>218,
|
21 |
+
162=>365,163=>365,164=>365,165=>365,166=>170,167=>365,168=>218,169=>483,170=>243,171=>365,
|
22 |
+
172=>383,173=>218,174=>483,175=>362,176=>262,177=>360,178=>218,179=>218,180=>218,181=>377,
|
23 |
+
182=>352,183=>182,184=>218,185=>218,186=>239,187=>365,188=>546,189=>546,190=>546,191=>400,
|
24 |
+
192=>437,193=>437,194=>437,195=>437,196=>437,197=>437,198=>655,199=>473,200=>437,201=>437,
|
25 |
+
202=>437,203=>437,204=>182,205=>182,206=>182,207=>182,208=>473,209=>473,210=>510,211=>510,
|
26 |
+
212=>510,213=>510,214=>510,215=>383,216=>510,217=>473,218=>473,219=>473,220=>473,221=>437,
|
27 |
+
222=>437,223=>400,224=>365,225=>365,226=>365,227=>365,228=>365,229=>365,230=>583,231=>328,
|
28 |
+
232=>365,233=>365,234=>365,235=>365,236=>182,237=>182,238=>182,239=>182,240=>365,241=>365,
|
29 |
+
242=>365,243=>365,244=>365,245=>365,246=>365,247=>360,248=>400,249=>365,250=>365,251=>365,
|
30 |
+
252=>365,253=>328,254=>365,255=>328,63259=>0,63232=>395,63233=>0,63234=>0,63235=>0,63236=>0,
|
31 |
+
63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,
|
32 |
+
63247=>625,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,3584=>100,
|
33 |
+
3585=>441,3586=>433,3587=>441,3588=>451,3589=>457,3590=>505,3591=>333,3592=>419,3593=>470,3594=>434,
|
34 |
+
3595=>436,3596=>626,3597=>626,3598=>485,3599=>489,3600=>399,3601=>544,3602=>627,3603=>624,3604=>458,
|
35 |
+
3605=>458,3606=>439,3607=>483,3608=>418,3609=>483,3610=>487,3611=>487,3612=>440,3613=>439,3614=>520,
|
36 |
+
3615=>523,3616=>479,3617=>472,3618=>430,3619=>363,3620=>438,3621=>444,3622=>482,3623=>373,3624=>448,
|
37 |
+
3625=>494,3626=>444,3627=>483,3628=>530,3629=>451,3630=>416,3631=>415,3632=>371,3633=>0,3634=>351,
|
38 |
+
3635=>351,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>224,63261=>224,
|
39 |
+
3647=>437,3648=>247,3649=>439,3650=>273,3651=>318,3652=>299,3653=>349,3654=>528,3655=>0,3656=>0,
|
40 |
+
3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>503,3664=>425,3665=>436,3666=>466,
|
41 |
+
3667=>448,3668=>460,3669=>460,3670=>464,3671=>550,3672=>496,3673=>516,3674=>487,3675=>806,63256=>0,
|
42 |
+
63257=>0,63258=>0,9702=>218,305=>182,711=>218);
|
43 |
+
$enc='';
|
44 |
+
$diff='';
|
45 |
+
$file='cordiaupcb.z';
|
46 |
+
$ctg='cordiaupcb.ctg.z';
|
47 |
+
$originalsize=82952;
|
48 |
+
?>
|
includes/lib/tcpdf_min/fonts/cordiaupcb.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupcbi.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupcbi.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='CordiaUPC-BoldItalic';
|
4 |
+
$desc=array('Ascent'=>833,'Descent'=>-262,'CapHeight'=>-21,'Flags'=>96,'FontBBox'=>'[-490 -399 797 833]','ItalicAngle'=>-10,'StemV'=>120,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>182,33=>182,34=>233,35=>365,36=>365,37=>583,38=>437,39=>125,40=>218,41=>218,
|
10 |
+
42=>255,43=>383,44=>182,45=>218,46=>182,47=>182,48=>365,49=>365,50=>365,51=>365,
|
11 |
+
52=>365,53=>365,54=>365,55=>365,56=>365,57=>365,58=>182,59=>182,60=>383,61=>383,
|
12 |
+
62=>383,63=>365,64=>665,65=>437,66=>437,67=>473,68=>473,69=>437,70=>400,71=>510,
|
13 |
+
72=>473,73=>182,74=>328,75=>437,76=>365,77=>546,78=>473,79=>510,80=>437,81=>510,
|
14 |
+
82=>473,83=>437,84=>400,85=>473,86=>437,87=>618,88=>437,89=>437,90=>400,91=>182,
|
15 |
+
92=>182,93=>182,94=>307,95=>365,96=>218,97=>365,98=>365,99=>328,100=>365,101=>365,
|
16 |
+
102=>182,103=>365,104=>365,105=>146,106=>146,107=>328,108=>146,109=>546,110=>365,111=>365,
|
17 |
+
112=>365,113=>365,114=>218,115=>328,116=>182,117=>365,118=>328,119=>473,120=>328,121=>328,
|
18 |
+
122=>328,123=>219,124=>170,125=>219,126=>383,8230=>655,8216=>146,8217=>146,8220=>218,8221=>218,
|
19 |
+
8226=>229,8211=>365,8212=>655,63259=>0,63232=>395,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,
|
20 |
+
63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>625,
|
21 |
+
63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,3584=>100,3585=>441,
|
22 |
+
3586=>433,3587=>441,3588=>451,3589=>457,3590=>505,3591=>333,3592=>419,3593=>470,3594=>434,3595=>436,
|
23 |
+
3596=>626,3597=>626,3598=>485,3599=>489,3600=>399,3601=>544,3602=>627,3603=>624,3604=>458,3605=>458,
|
24 |
+
3606=>439,3607=>483,3608=>418,3609=>483,3610=>487,3611=>487,3612=>439,3613=>439,3614=>523,3615=>523,
|
25 |
+
3616=>479,3617=>472,3618=>430,3619=>363,3620=>438,3621=>444,3622=>482,3623=>373,3624=>448,3625=>494,
|
26 |
+
3626=>444,3627=>483,3628=>530,3629=>451,3630=>416,3631=>415,3632=>371,3633=>0,3634=>351,3635=>351,
|
27 |
+
3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>224,63261=>224,3647=>437,
|
28 |
+
3648=>247,3649=>439,3650=>273,3651=>318,3652=>299,3653=>349,3654=>528,3655=>0,3656=>0,3657=>0,
|
29 |
+
3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>510,3664=>425,3665=>436,3666=>466,3667=>448,
|
30 |
+
3668=>460,3669=>460,3670=>464,3671=>550,3672=>496,3673=>516,3674=>487,3675=>806,63256=>0,63257=>0,
|
31 |
+
63258=>0);
|
32 |
+
$enc='';
|
33 |
+
$diff='';
|
34 |
+
$file='cordiaupcbi.z';
|
35 |
+
$ctg='cordiaupcbi.ctg.z';
|
36 |
+
$originalsize=69840;
|
37 |
+
?>
|
includes/lib/tcpdf_min/fonts/cordiaupcbi.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupci.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/cordiaupci.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='CordiaUPC-Italic';
|
4 |
+
$desc=array('Ascent'=>893,'Descent'=>-254,'CapHeight'=>-15,'Flags'=>96,'FontBBox'=>'[-394 -460 781 898]','ItalicAngle'=>-10,'StemV'=>70,'MissingWidth'=>600);
|
5 |
+
$up=-50;
|
6 |
+
$ut=25;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>220,33=>218,34=>182,35=>365,36=>365,37=>583,38=>437,39=>146,40=>218,41=>218,
|
10 |
+
42=>255,43=>433,44=>182,45=>218,46=>182,47=>182,48=>365,49=>365,50=>365,51=>365,
|
11 |
+
52=>365,53=>365,54=>365,55=>365,56=>365,57=>365,58=>182,59=>182,60=>433,61=>433,
|
12 |
+
62=>433,63=>328,64=>524,65=>437,66=>437,67=>473,68=>473,69=>400,70=>365,71=>510,
|
13 |
+
72=>473,73=>182,74=>328,75=>437,76=>365,77=>546,78=>473,79=>510,80=>400,81=>510,
|
14 |
+
82=>437,83=>400,84=>365,85=>473,86=>400,87=>583,88=>400,89=>400,90=>400,91=>218,
|
15 |
+
92=>182,93=>218,94=>433,95=>328,96=>218,97=>365,98=>400,99=>365,100=>400,101=>365,
|
16 |
+
102=>182,103=>400,104=>365,105=>146,106=>146,107=>328,108=>146,109=>546,110=>365,111=>365,
|
17 |
+
112=>400,113=>400,114=>218,115=>328,116=>182,117=>365,118=>328,119=>473,120=>328,121=>328,
|
18 |
+
122=>328,123=>218,124=>146,125=>218,126=>433,8230=>655,8216=>146,8217=>146,8220=>255,8221=>255,
|
19 |
+
8226=>328,8211=>328,8212=>655,63259=>0,63232=>382,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,
|
20 |
+
63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>608,
|
21 |
+
63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,3584=>100,3585=>400,
|
22 |
+
3586=>376,3587=>400,3588=>417,3589=>417,3590=>487,3591=>313,3592=>382,3593=>405,3594=>382,3595=>382,
|
23 |
+
3596=>597,3597=>608,3598=>440,3599=>440,3600=>382,3601=>504,3602=>614,3603=>608,3604=>417,3605=>417,
|
24 |
+
3606=>400,3607=>429,3608=>359,3609=>429,3610=>446,3611=>446,3612=>405,3613=>405,3614=>463,3615=>463,
|
25 |
+
3616=>440,3617=>434,3618=>400,3619=>301,3620=>400,3621=>405,3622=>440,3623=>347,3624=>417,3625=>475,
|
26 |
+
3626=>405,3627=>429,3628=>463,3629=>394,3630=>382,3631=>359,3632=>359,3633=>0,3634=>347,3635=>347,
|
27 |
+
3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,63260=>220,63261=>220,3647=>437,
|
28 |
+
3648=>202,3649=>376,3650=>243,3651=>278,3652=>260,3653=>347,3654=>376,3655=>0,3656=>0,3657=>0,
|
29 |
+
3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>313,3664=>463,3665=>463,3666=>487,3667=>487,
|
30 |
+
3668=>487,3669=>487,3670=>463,3671=>487,3672=>487,3673=>487,3674=>409,3675=>792,63256=>0,63257=>0,
|
31 |
+
63258=>0);
|
32 |
+
$enc='';
|
33 |
+
$diff='';
|
34 |
+
$file='cordiaupci.z';
|
35 |
+
$ctg='cordiaupci.ctg.z';
|
36 |
+
$originalsize=75700;
|
37 |
+
?>
|
includes/lib/tcpdf_min/fonts/cordiaupci.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabun.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabun.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='THSarabunPSK';
|
4 |
+
$desc=array('Ascent'=>850,'Descent'=>-250,'CapHeight'=>17,'Flags'=>32,'FontBBox'=>'[-427 -421 947 836]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600);
|
5 |
+
$up=-35;
|
6 |
+
$ut=30;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>216,33=>147,34=>208,35=>403,36=>361,37=>585,38=>423,39=>120,40=>190,41=>190,
|
10 |
+
42=>285,43=>411,44=>162,45=>216,46=>162,47=>270,48=>362,49=>362,50=>362,51=>362,
|
11 |
+
52=>362,53=>362,54=>362,55=>362,56=>362,57=>362,58=>162,59=>162,60=>411,61=>411,
|
12 |
+
62=>411,63=>283,64=>536,65=>400,66=>378,67=>406,68=>431,69=>351,70=>351,71=>425,
|
13 |
+
72=>441,73=>147,74=>264,75=>376,76=>353,77=>548,78=>441,79=>486,80=>378,81=>487,
|
14 |
+
82=>379,83=>352,84=>379,85=>466,86=>390,87=>588,88=>418,89=>366,90=>424,91=>196,
|
15 |
+
92=>262,93=>196,94=>412,95=>352,96=>204,97=>344,98=>401,99=>331,100=>401,101=>374,
|
16 |
+
102=>206,103=>311,104=>390,105=>143,106=>155,107=>316,108=>200,109=>601,110=>390,111=>398,
|
17 |
+
112=>401,113=>401,114=>217,115=>282,116=>238,117=>390,118=>341,119=>507,120=>318,121=>337,
|
18 |
+
122=>321,123=>208,124=>153,125=>208,126=>416,8364=>406,8218=>247,402=>398,8222=>370,8230=>479,
|
19 |
+
8224=>374,8225=>374,710=>212,8240=>829,352=>352,8249=>183,338=>711,142=>424,8216=>247,8217=>247,
|
20 |
+
8220=>370,8221=>370,8226=>216,8211=>360,8212=>720,732=>212,8482=>505,353=>282,8250=>183,339=>679,
|
21 |
+
158=>321,376=>382,160=>216,161=>151,162=>411,163=>411,164=>411,165=>411,166=>153,167=>374,
|
22 |
+
168=>212,169=>536,170=>246,171=>298,172=>420,174=>536,175=>352,176=>212,177=>411,178=>254,
|
23 |
+
179=>254,180=>212,181=>406,182=>374,183=>162,184=>212,185=>254,186=>285,187=>294,188=>536,
|
24 |
+
189=>536,190=>536,191=>289,192=>400,193=>400,194=>400,195=>400,196=>400,197=>400,198=>582,
|
25 |
+
199=>406,200=>351,201=>351,202=>351,203=>351,204=>147,205=>147,206=>147,207=>147,208=>431,
|
26 |
+
209=>441,210=>486,211=>486,212=>486,213=>486,214=>486,215=>411,216=>486,217=>466,218=>466,
|
27 |
+
219=>466,220=>466,221=>366,222=>380,223=>392,224=>344,225=>344,226=>344,227=>344,228=>344,
|
28 |
+
229=>344,230=>608,231=>331,232=>374,233=>374,234=>374,235=>374,236=>143,237=>143,238=>143,
|
29 |
+
239=>143,240=>362,241=>390,242=>398,243=>398,244=>398,245=>398,246=>398,247=>411,248=>398,
|
30 |
+
249=>390,250=>390,251=>390,252=>390,253=>337,254=>432,255=>337,305=>143,321=>361,322=>209,
|
31 |
+
711=>212,728=>302,729=>302,730=>302,731=>302,733=>279,3584=>0,3585=>386,3586=>378,3587=>382,
|
32 |
+
3588=>393,3589=>393,3590=>408,3591=>294,3592=>367,3593=>377,3594=>380,3595=>384,3596=>519,3597=>519,
|
33 |
+
3598=>425,3599=>425,3600=>343,3601=>461,3602=>532,3603=>543,3604=>391,3605=>391,3606=>378,3607=>430,
|
34 |
+
3608=>335,3609=>420,3610=>428,3611=>428,3612=>381,3613=>381,3614=>447,3615=>447,3616=>425,3617=>400,
|
35 |
+
3618=>375,3619=>322,3620=>378,3621=>381,3622=>425,3623=>335,3624=>393,3625=>438,3626=>381,3627=>427,
|
36 |
+
3628=>454,3629=>387,3630=>372,3631=>391,3632=>357,3633=>0,3634=>316,3635=>316,3636=>0,3637=>0,
|
37 |
+
3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,3647=>411,3648=>203,3649=>377,3650=>237,3651=>242,
|
38 |
+
3652=>244,3653=>205,3654=>399,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,
|
39 |
+
3662=>0,3663=>450,3664=>449,3665=>449,3666=>449,3667=>449,3668=>449,3669=>449,3670=>449,3671=>449,
|
40 |
+
3672=>449,3673=>449,3674=>522,3675=>697,8204=>0,8205=>0,8206=>0,8207=>0,8242=>125,8243=>214,
|
41 |
+
8260=>162,8467=>209,8486=>453,8494=>313,8706=>317,8710=>474,8719=>446,8721=>411,8722=>411,8730=>350,
|
42 |
+
8734=>618,8747=>242,8776=>411,8800=>411,8804=>411,8805=>411,9674=>386,9676=>400,63232=>336,63233=>0,
|
43 |
+
63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,
|
44 |
+
63244=>0,63245=>0,63246=>0,63247=>512,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,
|
45 |
+
63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>425,63261=>454,64257=>347,64258=>404,7840=>400,
|
46 |
+
7841=>344,7842=>400,7843=>344,7844=>400,7845=>344,7846=>400,7847=>344,7848=>400,7849=>344,7850=>400,
|
47 |
+
7851=>344,7852=>400,7853=>344,7854=>400,7855=>344,7856=>400,7857=>344,7858=>400,7859=>344,7860=>400,
|
48 |
+
7861=>344,7862=>400,7863=>344,7864=>351,7865=>374,7866=>351,7867=>374,7868=>351,7869=>374,7870=>351,
|
49 |
+
7871=>374,7872=>351,7873=>374,7874=>351,7875=>374,7876=>351,7877=>374,7878=>351,7879=>374,7880=>147,
|
50 |
+
7881=>143,7882=>147,7883=>143,7884=>486,7885=>398,7886=>486,7887=>398,7888=>486,7889=>398,7890=>486,
|
51 |
+
7891=>398,7892=>486,7893=>398,7894=>486,7895=>398,7896=>486,7897=>398,7898=>486,7899=>398,7900=>486,
|
52 |
+
7901=>398,7902=>486,7903=>398,7904=>486,7905=>398,7906=>486,7907=>398,7908=>466,7909=>390,7910=>466,
|
53 |
+
7911=>390,7912=>466,7913=>373,7914=>466,7915=>373,7916=>466,7917=>373,7918=>466,7919=>373,7920=>466,
|
54 |
+
7921=>373,7922=>366,7923=>337,7924=>366,7925=>337,7926=>366,7927=>337,7928=>366,7929=>337,8355=>360,
|
55 |
+
8363=>401,258=>400,259=>344,262=>406,263=>331,268=>406,269=>331,272=>431,273=>401,286=>425,
|
56 |
+
287=>311,296=>147,297=>143,304=>147,350=>357,351=>288,360=>476,361=>405,416=>486,417=>398,
|
57 |
+
431=>466,432=>373,777=>0,771=>0,769=>0,803=>0,768=>0,8539=>536,8540=>536,8541=>536,
|
58 |
+
8542=>536,63616=>443,63617=>575,63618=>621,63259=>425,8531=>536,8532=>536,8533=>536,8534=>536,8535=>536,
|
59 |
+
8536=>536,8537=>536,8538=>536);
|
60 |
+
$enc='';
|
61 |
+
$diff='';
|
62 |
+
$file='thsarabun.z';
|
63 |
+
$ctg='thsarabun.ctg.z';
|
64 |
+
$originalsize=99980;
|
65 |
+
?>
|
includes/lib/tcpdf_min/fonts/thsarabun.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabunb.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabunb.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='THSarabunPSK-Bold';
|
4 |
+
$desc=array('Ascent'=>850,'Descent'=>-250,'CapHeight'=>-1,'Flags'=>32,'FontBBox'=>'[-466 -457 947 844]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600);
|
5 |
+
$up=-35;
|
6 |
+
$ut=30;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>226,33=>168,34=>291,35=>462,36=>367,37=>688,38=>486,39=>169,40=>244,41=>244,
|
10 |
+
42=>343,43=>417,44=>172,45=>226,46=>172,47=>276,48=>378,49=>378,50=>378,51=>378,
|
11 |
+
52=>378,53=>378,54=>378,55=>378,56=>378,57=>378,58=>172,59=>172,60=>417,61=>417,
|
12 |
+
62=>417,63=>289,64=>572,65=>451,66=>396,67=>432,68=>459,69=>358,70=>358,71=>454,
|
13 |
+
72=>472,73=>163,74=>282,75=>411,76=>359,77=>574,78=>472,79=>518,80=>390,81=>518,
|
14 |
+
82=>395,83=>365,84=>421,85=>482,86=>422,87=>612,88=>426,89=>396,90=>451,91=>234,
|
15 |
+
92=>268,93=>234,94=>418,95=>376,96=>210,97=>367,98=>435,99=>347,100=>435,101=>391,
|
16 |
+
102=>254,103=>332,104=>423,105=>163,106=>171,107=>340,108=>213,109=>636,110=>423,111=>412,
|
17 |
+
112=>431,113=>431,114=>246,115=>296,116=>258,117=>418,118=>358,119=>480,120=>349,121=>361,
|
18 |
+
122=>358,123=>255,124=>177,125=>255,126=>422,8364=>518,8218=>253,402=>404,8222=>384,8230=>504,
|
19 |
+
8224=>380,8225=>380,710=>218,8240=>972,352=>365,8249=>234,338=>723,142=>451,8216=>253,8217=>253,
|
20 |
+
8220=>384,8221=>384,8226=>226,8211=>335,8212=>693,732=>259,8482=>608,353=>296,8250=>234,339=>689,
|
21 |
+
158=>358,376=>396,160=>220,161=>168,162=>480,163=>480,164=>480,165=>480,166=>161,167=>380,
|
22 |
+
168=>341,169=>540,170=>252,171=>356,172=>448,174=>540,175=>376,176=>277,177=>440,178=>260,
|
23 |
+
179=>260,180=>259,181=>414,182=>380,183=>172,184=>249,185=>260,186=>294,187=>356,188=>542,
|
24 |
+
189=>542,190=>542,191=>289,192=>451,193=>451,194=>451,195=>451,196=>451,197=>451,198=>583,
|
25 |
+
199=>432,200=>358,201=>358,202=>358,203=>358,204=>163,205=>163,206=>163,207=>163,208=>459,
|
26 |
+
209=>472,210=>518,211=>518,212=>518,213=>518,214=>518,215=>417,216=>518,217=>482,218=>482,
|
27 |
+
219=>482,220=>482,221=>396,222=>394,223=>425,224=>367,225=>367,226=>367,227=>367,228=>367,
|
28 |
+
229=>367,230=>621,231=>347,232=>391,233=>391,234=>391,235=>391,236=>163,237=>163,238=>163,
|
29 |
+
239=>163,240=>378,241=>423,242=>412,243=>412,244=>412,245=>412,246=>412,247=>417,248=>412,
|
30 |
+
249=>418,250=>418,251=>418,252=>418,253=>361,254=>438,255=>361,305=>163,321=>359,322=>217,
|
31 |
+
711=>308,728=>342,729=>193,730=>266,731=>255,733=>359,3584=>0,3585=>391,3586=>415,3587=>431,
|
32 |
+
3588=>403,3589=>403,3590=>453,3591=>318,3592=>390,3593=>405,3594=>415,3595=>431,3596=>565,3597=>565,
|
33 |
+
3598=>425,3599=>425,3600=>372,3601=>492,3602=>551,3603=>576,3604=>405,3605=>405,3606=>391,3607=>438,
|
34 |
+
3608=>358,3609=>433,3610=>445,3611=>445,3612=>414,3613=>414,3614=>482,3615=>482,3616=>425,3617=>417,
|
35 |
+
3618=>386,3619=>329,3620=>391,3621=>399,3622=>425,3623=>379,3624=>403,3625=>461,3626=>399,3627=>438,
|
36 |
+
3628=>468,3629=>394,3630=>385,3631=>380,3632=>340,3633=>0,3634=>336,3635=>336,3636=>0,3637=>0,
|
37 |
+
3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,3647=>389,3648=>208,3649=>395,3650=>252,3651=>269,
|
38 |
+
3652=>252,3653=>209,3654=>437,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,
|
39 |
+
3662=>0,3663=>450,3664=>456,3665=>456,3666=>456,3667=>456,3668=>456,3669=>456,3670=>456,3671=>456,
|
40 |
+
3672=>456,3673=>456,3674=>525,3675=>697,8204=>0,8205=>0,8206=>0,8207=>0,8242=>131,8243=>220,
|
41 |
+
8260=>147,8467=>254,8486=>476,8494=>349,8706=>349,8710=>480,8719=>493,8721=>417,8722=>417,8730=>387,
|
42 |
+
8734=>632,8747=>248,8776=>417,8800=>417,8804=>417,8805=>417,9674=>405,9676=>406,63232=>372,63233=>0,
|
43 |
+
63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,
|
44 |
+
63244=>0,63245=>0,63246=>0,63247=>565,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,
|
45 |
+
63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>425,63261=>475,64257=>405,64258=>455,7840=>451,
|
46 |
+
7841=>367,7842=>451,7843=>367,7844=>451,7845=>367,7846=>451,7847=>367,7848=>451,7849=>367,7850=>451,
|
47 |
+
7851=>367,7852=>451,7853=>367,7854=>451,7855=>367,7856=>451,7857=>367,7858=>451,7859=>367,7860=>451,
|
48 |
+
7861=>367,7862=>451,7863=>367,7864=>358,7865=>391,7866=>358,7867=>391,7868=>358,7869=>391,7870=>358,
|
49 |
+
7871=>391,7872=>358,7873=>391,7874=>358,7875=>391,7876=>358,7877=>391,7878=>358,7879=>391,7880=>163,
|
50 |
+
7881=>163,7882=>163,7883=>163,7884=>518,7885=>412,7886=>518,7887=>412,7888=>518,7889=>432,7890=>518,
|
51 |
+
7891=>432,7892=>518,7893=>432,7894=>518,7895=>432,7896=>518,7897=>412,7898=>518,7899=>432,7900=>518,
|
52 |
+
7901=>432,7902=>518,7903=>432,7904=>518,7905=>432,7906=>518,7907=>432,7908=>482,7909=>418,7910=>482,
|
53 |
+
7911=>418,7912=>482,7913=>414,7914=>482,7915=>414,7916=>482,7917=>414,7918=>482,7919=>414,7920=>482,
|
54 |
+
7921=>414,7922=>396,7923=>361,7924=>396,7925=>361,7926=>396,7927=>361,7928=>396,7929=>361,8355=>393,
|
55 |
+
8363=>435,258=>451,259=>367,262=>432,263=>347,268=>432,269=>347,272=>459,273=>435,286=>454,
|
56 |
+
287=>332,296=>163,297=>163,304=>163,350=>365,351=>296,360=>482,361=>418,416=>518,417=>412,
|
57 |
+
431=>482,432=>414,777=>0,771=>0,769=>0,803=>200,768=>0,8539=>542,8540=>542,8541=>542,
|
58 |
+
8542=>542,63616=>449,63617=>598,63618=>629,63259=>425,8531=>542,8532=>542,8533=>542,8534=>542,8535=>542,
|
59 |
+
8536=>542,8537=>542,8538=>542);
|
60 |
+
$enc='';
|
61 |
+
$diff='';
|
62 |
+
$file='thsarabunb.z';
|
63 |
+
$ctg='thsarabunb.ctg.z';
|
64 |
+
$originalsize=118964;
|
65 |
+
?>
|
includes/lib/tcpdf_min/fonts/thsarabunb.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabunbi.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabunbi.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='THSarabunPSK-BoldItalic';
|
4 |
+
$desc=array('Ascent'=>850,'Descent'=>-250,'CapHeight'=>-45,'Flags'=>96,'FontBBox'=>'[-407 -481 947 844]','ItalicAngle'=>-11.9,'StemV'=>120,'MissingWidth'=>600);
|
5 |
+
$up=-35;
|
6 |
+
$ut=30;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>226,33=>168,34=>291,35=>462,36=>367,37=>688,38=>486,39=>169,40=>244,41=>244,
|
10 |
+
42=>343,43=>417,44=>172,45=>226,46=>172,47=>276,48=>378,49=>378,50=>378,51=>378,
|
11 |
+
52=>378,53=>378,54=>378,55=>378,56=>378,57=>378,58=>172,59=>172,60=>417,61=>417,
|
12 |
+
62=>417,63=>289,64=>572,65=>451,66=>396,67=>432,68=>459,69=>358,70=>358,71=>454,
|
13 |
+
72=>472,73=>163,74=>282,75=>411,76=>359,77=>574,78=>472,79=>518,80=>390,81=>518,
|
14 |
+
82=>395,83=>365,84=>421,85=>482,86=>422,87=>612,88=>426,89=>396,90=>451,91=>234,
|
15 |
+
92=>268,93=>234,94=>418,95=>376,96=>210,97=>431,98=>435,99=>347,100=>435,101=>391,
|
16 |
+
102=>254,103=>332,104=>423,105=>163,106=>171,107=>340,108=>213,109=>636,110=>423,111=>412,
|
17 |
+
112=>431,113=>431,114=>246,115=>296,116=>258,117=>418,118=>358,119=>480,120=>349,121=>361,
|
18 |
+
122=>358,123=>255,124=>177,125=>255,126=>422,8364=>518,8218=>253,402=>404,8222=>384,8230=>504,
|
19 |
+
8224=>380,8225=>380,710=>218,8240=>972,352=>365,8249=>234,338=>723,142=>451,8216=>253,8217=>253,
|
20 |
+
8220=>384,8221=>384,8226=>226,8211=>335,8212=>693,732=>259,8482=>608,353=>296,8250=>234,339=>689,
|
21 |
+
158=>358,376=>396,160=>220,161=>168,162=>480,163=>480,164=>480,165=>480,166=>161,167=>380,
|
22 |
+
168=>341,169=>540,170=>289,171=>356,172=>448,174=>540,175=>376,176=>277,177=>440,178=>260,
|
23 |
+
179=>260,180=>259,181=>414,182=>380,183=>172,184=>249,185=>260,186=>294,187=>356,188=>542,
|
24 |
+
189=>542,190=>542,191=>289,192=>451,193=>451,194=>451,195=>451,196=>451,197=>451,198=>583,
|
25 |
+
199=>432,200=>358,201=>358,202=>358,203=>358,204=>163,205=>163,206=>163,207=>163,208=>459,
|
26 |
+
209=>472,210=>518,211=>518,212=>518,213=>518,214=>518,215=>417,216=>518,217=>482,218=>482,
|
27 |
+
219=>482,220=>482,221=>396,222=>394,223=>425,224=>431,225=>431,226=>431,227=>431,228=>431,
|
28 |
+
229=>431,230=>621,231=>347,232=>391,233=>391,234=>391,235=>391,236=>163,237=>163,238=>163,
|
29 |
+
239=>163,240=>378,241=>423,242=>412,243=>412,244=>412,245=>412,246=>412,247=>417,248=>412,
|
30 |
+
249=>418,250=>418,251=>418,252=>418,253=>361,254=>438,255=>361,305=>163,321=>359,322=>217,
|
31 |
+
711=>308,728=>342,729=>193,730=>266,731=>255,733=>359,3584=>0,3585=>391,3586=>415,3587=>431,
|
32 |
+
3588=>403,3589=>403,3590=>453,3591=>312,3592=>390,3593=>405,3594=>415,3595=>431,3596=>565,3597=>565,
|
33 |
+
3598=>425,3599=>425,3600=>372,3601=>492,3602=>551,3603=>576,3604=>405,3605=>405,3606=>391,3607=>438,
|
34 |
+
3608=>358,3609=>433,3610=>445,3611=>445,3612=>414,3613=>414,3614=>482,3615=>482,3616=>425,3617=>417,
|
35 |
+
3618=>386,3619=>329,3620=>391,3621=>399,3622=>425,3623=>379,3624=>403,3625=>461,3626=>399,3627=>438,
|
36 |
+
3628=>468,3629=>394,3630=>385,3631=>380,3632=>340,3633=>0,3634=>343,3635=>343,3636=>0,3637=>0,
|
37 |
+
3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,3647=>389,3648=>208,3649=>395,3650=>252,3651=>269,
|
38 |
+
3652=>252,3653=>209,3654=>437,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,
|
39 |
+
3662=>0,3663=>450,3664=>456,3665=>456,3666=>456,3667=>456,3668=>456,3669=>456,3670=>456,3671=>456,
|
40 |
+
3672=>456,3673=>456,3674=>525,3675=>697,8204=>0,8205=>0,8206=>0,8207=>0,8242=>131,8243=>220,
|
41 |
+
8260=>147,8467=>254,8486=>476,8494=>349,8706=>349,8710=>480,8719=>493,8721=>417,8722=>417,8730=>387,
|
42 |
+
8734=>632,8747=>248,8776=>417,8800=>417,8804=>417,8805=>417,9674=>405,9676=>406,63232=>372,63233=>0,
|
43 |
+
63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,
|
44 |
+
63244=>0,63245=>0,63246=>0,63247=>565,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,
|
45 |
+
63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>425,63261=>475,64257=>405,64258=>455,7840=>451,
|
46 |
+
7841=>431,7842=>451,7843=>431,7844=>451,7845=>431,7846=>451,7847=>431,7848=>451,7849=>431,7850=>451,
|
47 |
+
7851=>431,7852=>451,7853=>431,7854=>451,7855=>431,7856=>451,7857=>431,7858=>451,7859=>431,7860=>451,
|
48 |
+
7861=>431,7862=>451,7863=>431,7864=>358,7865=>391,7866=>358,7867=>391,7868=>358,7869=>391,7870=>358,
|
49 |
+
7871=>391,7872=>358,7873=>391,7874=>358,7875=>391,7876=>358,7877=>391,7878=>358,7879=>391,7880=>163,
|
50 |
+
7881=>163,7882=>163,7883=>163,7884=>518,7885=>412,7886=>518,7887=>412,7888=>518,7889=>432,7890=>518,
|
51 |
+
7891=>432,7892=>518,7893=>432,7894=>518,7895=>432,7896=>518,7897=>412,7898=>518,7899=>432,7900=>518,
|
52 |
+
7901=>432,7902=>518,7903=>432,7904=>518,7905=>432,7906=>518,7907=>432,7908=>482,7909=>418,7910=>482,
|
53 |
+
7911=>418,7912=>482,7913=>414,7914=>482,7915=>414,7916=>482,7917=>414,7918=>482,7919=>414,7920=>482,
|
54 |
+
7921=>414,7922=>396,7923=>361,7924=>396,7925=>361,7926=>396,7927=>361,7928=>396,7929=>361,8355=>393,
|
55 |
+
8363=>435,258=>451,259=>431,262=>432,263=>347,268=>432,269=>347,272=>459,273=>435,286=>454,
|
56 |
+
287=>332,296=>163,297=>163,304=>163,350=>365,351=>296,360=>482,361=>418,416=>518,417=>412,
|
57 |
+
431=>482,432=>414,777=>0,771=>0,769=>0,803=>0,768=>0,8539=>542,8540=>542,8541=>542,
|
58 |
+
8542=>542,63616=>449,63617=>598,63618=>629,63259=>425,8531=>542,8532=>542,8533=>542,8534=>542,8535=>542,
|
59 |
+
8536=>542,8537=>542,8538=>542);
|
60 |
+
$enc='';
|
61 |
+
$diff='';
|
62 |
+
$file='thsarabunbi.z';
|
63 |
+
$ctg='thsarabunbi.ctg.z';
|
64 |
+
$originalsize=117644;
|
65 |
+
?>
|
includes/lib/tcpdf_min/fonts/thsarabunbi.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabuni.ctg.z
ADDED
Binary file
|
includes/lib/tcpdf_min/fonts/thsarabuni.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$type='TrueTypeUnicode';
|
3 |
+
$name='THSarabunPSK-Italic';
|
4 |
+
$desc=array('Ascent'=>850,'Descent'=>-250,'CapHeight'=>-26,'Flags'=>96,'FontBBox'=>'[-374 -435 947 836]','ItalicAngle'=>-11.9,'StemV'=>70,'MissingWidth'=>600);
|
5 |
+
$up=-35;
|
6 |
+
$ut=30;
|
7 |
+
$dw=600;
|
8 |
+
$cw=array(
|
9 |
+
32=>216,33=>147,34=>208,35=>403,36=>361,37=>585,38=>423,39=>120,40=>190,41=>190,
|
10 |
+
42=>285,43=>411,44=>162,45=>216,46=>162,47=>270,48=>362,49=>362,50=>362,51=>362,
|
11 |
+
52=>362,53=>362,54=>362,55=>362,56=>362,57=>362,58=>162,59=>162,60=>411,61=>411,
|
12 |
+
62=>411,63=>283,64=>536,65=>400,66=>378,67=>406,68=>431,69=>351,70=>351,71=>425,
|
13 |
+
72=>441,73=>147,74=>264,75=>376,76=>353,77=>548,78=>441,79=>486,80=>378,81=>487,
|
14 |
+
82=>379,83=>352,84=>379,85=>466,86=>390,87=>588,88=>418,89=>366,90=>424,91=>196,
|
15 |
+
92=>262,93=>196,94=>412,95=>352,96=>204,97=>398,98=>401,99=>331,100=>401,101=>374,
|
16 |
+
102=>206,103=>311,104=>390,105=>143,106=>155,107=>316,108=>200,109=>601,110=>390,111=>398,
|
17 |
+
112=>401,113=>401,114=>217,115=>282,116=>238,117=>390,118=>341,119=>507,120=>318,121=>337,
|
18 |
+
122=>321,123=>208,124=>153,125=>208,126=>416,8364=>406,8218=>247,402=>398,8222=>370,8230=>479,
|
19 |
+
8224=>374,8225=>374,710=>212,8240=>829,352=>352,8249=>183,338=>711,142=>424,8216=>247,8217=>247,
|
20 |
+
8220=>370,8221=>370,8226=>216,8211=>360,8212=>720,732=>212,8482=>563,353=>282,8250=>183,339=>679,
|
21 |
+
158=>321,376=>382,160=>216,161=>151,162=>411,163=>411,164=>411,165=>411,166=>153,167=>374,
|
22 |
+
168=>212,169=>536,170=>272,171=>298,172=>420,174=>536,175=>352,176=>212,177=>411,178=>254,
|
23 |
+
179=>254,180=>212,181=>406,182=>374,183=>162,184=>212,185=>254,186=>285,187=>294,188=>536,
|
24 |
+
189=>536,190=>536,191=>289,192=>400,193=>400,194=>400,195=>400,196=>400,197=>400,198=>582,
|
25 |
+
199=>406,200=>351,201=>351,202=>351,203=>351,204=>147,205=>147,206=>147,207=>147,208=>431,
|
26 |
+
209=>441,210=>486,211=>486,212=>486,213=>486,214=>486,215=>411,216=>486,217=>466,218=>466,
|
27 |
+
219=>466,220=>466,221=>366,222=>380,223=>392,224=>398,225=>398,226=>398,227=>398,228=>398,
|
28 |
+
229=>398,230=>608,231=>331,232=>374,233=>374,234=>374,235=>374,236=>143,237=>143,238=>143,
|
29 |
+
239=>143,240=>362,241=>390,242=>398,243=>398,244=>398,245=>398,246=>398,247=>411,248=>398,
|
30 |
+
249=>390,250=>390,251=>390,252=>390,253=>337,254=>432,255=>337,305=>143,321=>361,322=>209,
|
31 |
+
711=>212,728=>302,729=>302,730=>302,731=>302,733=>279,3584=>0,3585=>386,3586=>378,3587=>382,
|
32 |
+
3588=>393,3589=>393,3590=>408,3591=>294,3592=>367,3593=>377,3594=>380,3595=>384,3596=>519,3597=>519,
|
33 |
+
3598=>425,3599=>425,3600=>343,3601=>461,3602=>532,3603=>543,3604=>391,3605=>391,3606=>378,3607=>430,
|
34 |
+
3608=>335,3609=>420,3610=>428,3611=>428,3612=>381,3613=>381,3614=>447,3615=>447,3616=>425,3617=>400,
|
35 |
+
3618=>375,3619=>322,3620=>378,3621=>381,3622=>425,3623=>335,3624=>393,3625=>438,3626=>381,3627=>427,
|
36 |
+
3628=>454,3629=>387,3630=>372,3631=>391,3632=>357,3633=>0,3634=>316,3635=>316,3636=>0,3637=>0,
|
37 |
+
3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,3647=>411,3648=>203,3649=>377,3650=>237,3651=>242,
|
38 |
+
3652=>244,3653=>205,3654=>399,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,
|
39 |
+
3662=>0,3663=>450,3664=>449,3665=>449,3666=>449,3667=>449,3668=>449,3669=>449,3670=>449,3671=>449,
|
40 |
+
3672=>449,3673=>449,3674=>522,3675=>697,8204=>0,8205=>0,8206=>0,8207=>0,8242=>125,8243=>214,
|
41 |
+
8260=>162,8467=>209,8486=>453,8494=>313,8706=>317,8710=>474,8719=>446,8721=>411,8722=>411,8730=>350,
|
42 |
+
8734=>618,8747=>242,8776=>411,8800=>411,8804=>411,8805=>411,9674=>386,9676=>400,63232=>336,63233=>0,
|
43 |
+
63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,
|
44 |
+
63244=>0,63245=>0,63246=>0,63247=>512,63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,
|
45 |
+
63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>425,63261=>454,64257=>347,64258=>404,7840=>400,
|
46 |
+
7841=>398,7842=>400,7843=>398,7844=>400,7845=>398,7846=>400,7847=>398,7848=>400,7849=>398,7850=>400,
|
47 |
+
7851=>398,7852=>400,7853=>398,7854=>400,7855=>398,7856=>400,7857=>398,7858=>400,7859=>398,7860=>400,
|
48 |
+
7861=>398,7862=>400,7863=>398,7864=>351,7865=>374,7866=>351,7867=>374,7868=>351,7869=>374,7870=>351,
|
49 |
+
7871=>374,7872=>351,7873=>374,7874=>351,7875=>374,7876=>351,7877=>374,7878=>351,7879=>374,7880=>147,
|
50 |
+
7881=>143,7882=>147,7883=>143,7884=>486,7885=>398,7886=>486,7887=>398,7888=>486,7889=>398,7890=>486,
|
51 |
+
7891=>398,7892=>486,7893=>398,7894=>486,7895=>398,7896=>486,7897=>398,7898=>486,7899=>398,7900=>486,
|
52 |
+
7901=>398,7902=>486,7903=>398,7904=>486,7905=>398,7906=>486,7907=>398,7908=>466,7909=>390,7910=>466,
|
53 |
+
7911=>390,7912=>466,7913=>373,7914=>466,7915=>373,7916=>466,7917=>373,7918=>466,7919=>373,7920=>466,
|
54 |
+
7921=>373,7922=>366,7923=>337,7924=>366,7925=>337,7926=>366,7927=>337,7928=>366,7929=>337,8355=>360,
|
55 |
+
8363=>401,258=>400,259=>401,262=>406,263=>331,268=>406,269=>331,272=>431,273=>401,286=>425,
|
56 |
+
287=>311,296=>147,297=>143,304=>147,350=>357,351=>288,360=>476,361=>405,416=>486,417=>398,
|
57 |
+
431=>466,432=>373,777=>0,771=>0,769=>0,803=>0,768=>0,8539=>536,8540=>536,8541=>536,
|
58 |
+
8542=>536,63616=>443,63617=>575,63618=>621,63259=>425,8531=>536,8532=>536,8533=>536,8534=>536,8535=>536,
|
59 |
+
8536=>536,8537=>536,8538=>536);
|
60 |
+
$enc='';
|
61 |
+
$diff='';
|
62 |
+
$file='thsarabuni.z';
|
63 |
+
$ctg='thsarabuni.ctg.z';
|
64 |
+
$originalsize=104352;
|
65 |
+
?>
|
includes/lib/tcpdf_min/fonts/thsarabuni.z
ADDED
Binary file
|
includes/pdf-invoices/class-wcj-pdf-invoicing-report-tool.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoices Report Tool class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.2.1
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -28,19 +28,23 @@ class WCJ_PDF_Invoicing_Report_Tool {
|
|
28 |
/**
|
29 |
* generate_report_zip.
|
30 |
*
|
31 |
-
* @version 2.
|
32 |
* @since 2.3.10
|
33 |
*/
|
34 |
function generate_report_zip() {
|
35 |
if ( isset( $_POST['get_invoices_report_zip'] ) ) {
|
36 |
-
if (
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
40 |
}
|
|
|
|
|
41 |
}
|
42 |
-
} else {
|
43 |
-
$this->notice = '<div class="error"><p><strong>' . __( 'Please fill year and month values.', 'woocommerce-jetpack' ) . '</strong></p></div>';
|
44 |
}
|
45 |
}
|
46 |
}
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoices Report Tool class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.2.1
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
28 |
/**
|
29 |
* generate_report_zip.
|
30 |
*
|
31 |
+
* @version 2.4.8
|
32 |
* @since 2.3.10
|
33 |
*/
|
34 |
function generate_report_zip() {
|
35 |
if ( isset( $_POST['get_invoices_report_zip'] ) ) {
|
36 |
+
if ( wcj_is_module_enabled( 'general' ) && 'yes' === get_option( 'wcj_general_advanced_disable_save_sys_temp_dir', 'no' ) ) {
|
37 |
+
$this->notice = '<div class="error"><p><strong>' . __( 'This option is disabled in WooCommerce > Settings > Booster > Emails & Misc. > General > Advanced Options > Disable Saving PDFs in PHP directory for temporary files', 'woocommerce-jetpack' ) . '</strong></p></div>';
|
38 |
+
} else {
|
39 |
+
if ( ! empty( $_POST['report_year'] ) && ! empty( $_POST['report_month'] ) && ! empty( $_POST['invoice_type'] ) ) {
|
40 |
+
if ( is_super_admin() || is_shop_manager() ) {
|
41 |
+
if ( false === $this->get_invoices_report_zip( $_POST['report_year'], $_POST['report_month'], $_POST['invoice_type'] ) ) {
|
42 |
+
$this->notice = '<div class="error"><p><strong>' . __( 'Sorry, but something went wrong...', 'woocommerce-jetpack' ) . '</strong></p></div>';
|
43 |
+
}
|
44 |
}
|
45 |
+
} else {
|
46 |
+
$this->notice = '<div class="error"><p><strong>' . __( 'Please fill year and month values.', 'woocommerce-jetpack' ) . '</strong></p></div>';
|
47 |
}
|
|
|
|
|
48 |
}
|
49 |
}
|
50 |
}
|
includes/pdf-invoices/settings/class-wcj-pdf-invoicing-emails.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoicing Emails class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -16,6 +16,8 @@ class WCJ_PDF_Invoicing_Emails extends WCJ_Module {
|
|
16 |
|
17 |
/**
|
18 |
* Constructor.
|
|
|
|
|
19 |
*/
|
20 |
function __construct() {
|
21 |
|
@@ -28,7 +30,9 @@ class WCJ_PDF_Invoicing_Emails extends WCJ_Module {
|
|
28 |
add_filter( 'init', array( $this, 'add_hooks' ) );
|
29 |
|
30 |
if ( $this->is_enabled() ) {
|
31 |
-
|
|
|
|
|
32 |
}
|
33 |
}
|
34 |
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoicing Emails class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
16 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
+
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
function __construct() {
|
23 |
|
30 |
add_filter( 'init', array( $this, 'add_hooks' ) );
|
31 |
|
32 |
if ( $this->is_enabled() ) {
|
33 |
+
if ( ! wcj_is_module_enabled( 'general' ) || 'no' === get_option( 'wcj_general_advanced_disable_save_sys_temp_dir', 'no' ) ) {
|
34 |
+
add_filter( 'woocommerce_email_attachments', array( $this, 'add_pdf_invoice_email_attachment' ), PHP_INT_MAX, 3 );
|
35 |
+
}
|
36 |
}
|
37 |
}
|
38 |
|
includes/pdf-invoices/settings/class-wcj-pdf-invoicing-styling.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoicing Styling class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -30,7 +30,7 @@ class WCJ_PDF_Invoicing_Styling extends WCJ_Module {
|
|
30 |
/**
|
31 |
* get_settings.
|
32 |
*
|
33 |
-
* @version 2.4.
|
34 |
*/
|
35 |
function get_settings() {
|
36 |
|
@@ -69,6 +69,9 @@ class WCJ_PDF_Invoicing_Styling extends WCJ_Module {
|
|
69 |
'helvetica' => 'Helvetica',
|
70 |
'times' => 'Times',
|
71 |
'droidsansfallback' => 'Droid Sans Fallback',
|
|
|
|
|
|
|
72 |
),
|
73 |
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
74 |
);
|
4 |
*
|
5 |
* The WooCommerce Jetpack PDF Invoicing Styling class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
30 |
/**
|
31 |
* get_settings.
|
32 |
*
|
33 |
+
* @version 2.4.8
|
34 |
*/
|
35 |
function get_settings() {
|
36 |
|
69 |
'helvetica' => 'Helvetica',
|
70 |
'times' => 'Times',
|
71 |
'droidsansfallback' => 'Droid Sans Fallback',
|
72 |
+
'angsanaupc' => 'AngsanaUPC',
|
73 |
+
'cordiaupc' => 'CordiaUPC',
|
74 |
+
'thsarabun' => 'THSarabunPSK',
|
75 |
),
|
76 |
'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
|
77 |
);
|
includes/price-by-country/class-wcj-price-by-country-reports.php
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce Jetpack Price By Country Reports
|
4 |
-
*
|
5 |
-
* The WooCommerce Jetpack Price By Country Reports class.
|
6 |
-
*
|
7 |
-
* @version 2.2.0
|
8 |
-
* @author Algoritmika Ltd.
|
9 |
-
*/
|
10 |
-
|
11 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
12 |
-
|
13 |
-
if ( ! class_exists( 'WCJ_Price_By_Country_Reports' ) ) :
|
14 |
-
|
15 |
-
class WCJ_Price_By_Country_Reports {
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Constructor.
|
19 |
-
*/
|
20 |
-
function __construct() {
|
21 |
-
|
22 |
-
add_filter( 'woocommerce_reports_get_order_report_data_args', array( $this, 'filter_reports'), PHP_INT_MAX, 1 );
|
23 |
-
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol_reports'), PHP_INT_MAX, 2 );
|
24 |
-
add_action( 'admin_bar_menu', array( $this, 'add_reports_currency_to_admin_bar' ), PHP_INT_MAX );
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* add_reports_currency_to_admin_bar.
|
29 |
-
*/
|
30 |
-
function add_reports_currency_to_admin_bar( $wp_admin_bar ) {
|
31 |
-
|
32 |
-
if ( isset( $_GET['page'] ) && 'wc-reports' === $_GET['page'] ) {
|
33 |
-
$the_current_code = isset( $_GET['currency'] ) ? $_GET['currency'] : get_woocommerce_currency();
|
34 |
-
$parent = 'reports_currency_select';
|
35 |
-
$args = array(
|
36 |
-
'parent' => false,
|
37 |
-
'id' => $parent,
|
38 |
-
'title' => __( 'Reports currency:', 'woocommerce-jetpack' ) . ' ' . $the_current_code,
|
39 |
-
'href' => false,
|
40 |
-
'meta' => array( 'title' => __( 'Show reports only in', 'woocommerce-jetpack' ) . ' ' . $the_current_code, ),
|
41 |
-
);
|
42 |
-
|
43 |
-
$wp_admin_bar->add_node( $args );
|
44 |
-
|
45 |
-
$currency_symbols = array();
|
46 |
-
$currency_symbols[ $the_current_code ] = '';
|
47 |
-
$currency_symbols[ get_woocommerce_currency() ] = '';
|
48 |
-
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
49 |
-
$currency_symbols[ get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i ) ] = '';
|
50 |
-
}
|
51 |
-
$currency_symbols['merge'] = '';
|
52 |
-
$this->reports_currency_symbols = $currency_symbols;
|
53 |
-
|
54 |
-
foreach ( $this->reports_currency_symbols as $code => $symbol ) {
|
55 |
-
//if ( $code === $the_current_code )
|
56 |
-
// continue;
|
57 |
-
$args = array(
|
58 |
-
'parent' => $parent,
|
59 |
-
'id' => $parent . '_' . $code,
|
60 |
-
'title' => $code,// . ' ' . $symbol,
|
61 |
-
'href' => add_query_arg( 'currency', $code),
|
62 |
-
'meta' => array( 'title' => __( 'Show reports only in', 'woocommerce-jetpack' ) . ' ' . $code, ),
|
63 |
-
);
|
64 |
-
|
65 |
-
$wp_admin_bar->add_node( $args );
|
66 |
-
}
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* change_currency_symbol_reports.
|
72 |
-
*/
|
73 |
-
function change_currency_symbol_reports( $currency_symbol, $currency ) {
|
74 |
-
if ( isset( $_GET['page'] ) && 'wc-reports' === $_GET['page'] ) {
|
75 |
-
if ( isset( $_GET['currency'] ) ) {
|
76 |
-
return ( 'merge' === $_GET['currency'] ) ? '' : wcj_get_currency_symbol( $_GET['currency'] );
|
77 |
-
//return wcj_get_currency_symbol( $_GET['currency'] );
|
78 |
-
}
|
79 |
-
}
|
80 |
-
return $currency_symbol;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* filter_reports.
|
85 |
-
*/
|
86 |
-
function filter_reports( $args ) {
|
87 |
-
//if ( ! isset( $_GET['currency'] ) ) return $args;
|
88 |
-
if ( isset( $_GET['currency'] ) && 'merge' === $_GET['currency'] ) return $args;
|
89 |
-
$args['where_meta'] = array(
|
90 |
-
array(
|
91 |
-
'meta_key' => '_order_currency',
|
92 |
-
'meta_value' => isset( $_GET['currency'] ) ? $_GET['currency'] : get_woocommerce_currency(),
|
93 |
-
//'meta_value' => $_GET['currency'],
|
94 |
-
'operator' => '=',
|
95 |
-
),
|
96 |
-
);
|
97 |
-
return $args;
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
endif;
|
102 |
-
|
103 |
-
return new WCJ_Price_By_Country_Reports();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/reports/class-wcj-currency-reports.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Currency Reports
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Currency Reports class.
|
6 |
+
*
|
7 |
+
* @version 2.4.8
|
8 |
+
* @author Algoritmika Ltd.
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
12 |
+
|
13 |
+
if ( ! class_exists( 'WCJ_Currency_Reports' ) ) :
|
14 |
+
|
15 |
+
class WCJ_Currency_Reports {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Constructor.
|
19 |
+
*/
|
20 |
+
function __construct() {
|
21 |
+
add_filter( 'woocommerce_reports_get_order_report_data_args', array( $this, 'filter_reports'), PHP_INT_MAX, 1 );
|
22 |
+
add_filter( 'woocommerce_currency_symbol', array( $this, 'change_currency_symbol_reports'), PHP_INT_MAX, 2 );
|
23 |
+
add_action( 'admin_bar_menu', array( $this, 'add_reports_currency_to_admin_bar' ), PHP_INT_MAX );
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* add_reports_currency_to_admin_bar.
|
28 |
+
*
|
29 |
+
* @version 2.4.8
|
30 |
+
*/
|
31 |
+
function add_reports_currency_to_admin_bar( $wp_admin_bar ) {
|
32 |
+
|
33 |
+
if ( isset( $_GET['page'] ) && 'wc-reports' === $_GET['page'] ) {
|
34 |
+
|
35 |
+
$the_current_code = isset( $_GET['currency'] ) ? $_GET['currency'] : get_woocommerce_currency();
|
36 |
+
$parent = 'reports_currency_select';
|
37 |
+
$args = array(
|
38 |
+
'parent' => false,
|
39 |
+
'id' => $parent,
|
40 |
+
'title' => __( 'Reports currency:', 'woocommerce-jetpack' ) . ' ' . $the_current_code,
|
41 |
+
'href' => false,
|
42 |
+
'meta' => array( 'title' => __( 'Show reports only in', 'woocommerce-jetpack' ) . ' ' . $the_current_code, ),
|
43 |
+
);
|
44 |
+
$wp_admin_bar->add_node( $args );
|
45 |
+
|
46 |
+
$currency_symbols = array();
|
47 |
+
$currency_symbols[ $the_current_code ] = $the_current_code;
|
48 |
+
$currency_symbols[ get_woocommerce_currency() ] = get_woocommerce_currency();
|
49 |
+
if ( wcj_is_module_enabled( 'price_by_country' ) ) {
|
50 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
|
51 |
+
$the_code = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
|
52 |
+
$currency_symbols[ $the_code ] = $the_code;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
if ( wcj_is_module_enabled( 'multicurrency' ) ) {
|
56 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
|
57 |
+
$the_code = get_option( 'wcj_multicurrency_currency_' . $i );
|
58 |
+
$currency_symbols[ $the_code ] = $the_code;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
|
62 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
|
63 |
+
$the_code = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
64 |
+
$currency_symbols[ $the_code ] = $the_code;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
|
68 |
+
global $woocommerce;
|
69 |
+
$available_gateways = $woocommerce->payment_gateways->payment_gateways();
|
70 |
+
foreach ( $available_gateways as $key => $gateway ) {
|
71 |
+
$the_code = get_option( 'wcj_gateways_currency_' . $key );
|
72 |
+
if ( 'no_changes' != $the_code ) {
|
73 |
+
$currency_symbols[ $the_code ] = $the_code;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
sort( $currency_symbols );
|
78 |
+
$currency_symbols['merge'] = 'merge';
|
79 |
+
|
80 |
+
foreach ( $currency_symbols as $code ) {
|
81 |
+
$args = array(
|
82 |
+
'parent' => $parent,
|
83 |
+
'id' => $parent . '_' . $code,
|
84 |
+
'title' => $code,
|
85 |
+
'href' => add_query_arg( 'currency', $code ),
|
86 |
+
'meta' => array( 'title' => __( 'Show reports only in', 'woocommerce-jetpack' ) . ' ' . $code, ),
|
87 |
+
);
|
88 |
+
$wp_admin_bar->add_node( $args );
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* change_currency_symbol_reports.
|
95 |
+
*/
|
96 |
+
function change_currency_symbol_reports( $currency_symbol, $currency ) {
|
97 |
+
if ( isset( $_GET['page'] ) && 'wc-reports' === $_GET['page'] ) {
|
98 |
+
if ( isset( $_GET['currency'] ) ) {
|
99 |
+
return ( 'merge' === $_GET['currency'] ) ? '' : wcj_get_currency_symbol( $_GET['currency'] );
|
100 |
+
}
|
101 |
+
}
|
102 |
+
return $currency_symbol;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* filter_reports.
|
107 |
+
*/
|
108 |
+
function filter_reports( $args ) {
|
109 |
+
if ( isset( $_GET['currency'] ) && 'merge' === $_GET['currency'] ) {
|
110 |
+
return $args;
|
111 |
+
}
|
112 |
+
$args['where_meta'] = array(
|
113 |
+
array(
|
114 |
+
'meta_key' => '_order_currency',
|
115 |
+
'meta_value' => isset( $_GET['currency'] ) ? $_GET['currency'] : get_woocommerce_currency(),
|
116 |
+
'operator' => '=',
|
117 |
+
),
|
118 |
+
);
|
119 |
+
return $args;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
endif;
|
124 |
+
|
125 |
+
return new WCJ_Currency_Reports();
|
includes/reports/wcj-class-reports-monthly-sales.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Mothly Sales Reports class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @since 2.4.7
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
@@ -41,7 +41,7 @@ class WCJ_Reports_Monthly_Sales {
|
|
41 |
/*
|
42 |
* get_exchange_rate_average.
|
43 |
*
|
44 |
-
* @version 2.4.
|
45 |
* @since 2.4.7
|
46 |
*/
|
47 |
function get_exchange_rate_average( $currency_from, $currency_to, $start_date, $end_date ) {
|
@@ -56,7 +56,7 @@ class WCJ_Reports_Monthly_Sales {
|
|
56 |
. $end_date. '%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=';
|
57 |
ob_start();
|
58 |
$max_execution_time = ini_get( 'max_execution_time' );
|
59 |
-
set_time_limit(
|
60 |
$exchange_rate = json_decode( file_get_contents( $url ) );
|
61 |
set_time_limit( $max_execution_time );
|
62 |
ob_end_clean();
|
@@ -79,7 +79,7 @@ class WCJ_Reports_Monthly_Sales {
|
|
79 |
. $end_date. '%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=';
|
80 |
ob_start();
|
81 |
$max_execution_time = ini_get( 'max_execution_time' );
|
82 |
-
set_time_limit(
|
83 |
$exchange_rate = json_decode( file_get_contents( $url ) );
|
84 |
set_time_limit( $max_execution_time );
|
85 |
ob_end_clean();
|
@@ -100,7 +100,7 @@ class WCJ_Reports_Monthly_Sales {
|
|
100 |
/*
|
101 |
* get_monthly_sales_report.
|
102 |
*
|
103 |
-
* @version 2.4.
|
104 |
* @since 2.4.7
|
105 |
*/
|
106 |
function get_monthly_sales_report() {
|
@@ -108,7 +108,11 @@ class WCJ_Reports_Monthly_Sales {
|
|
108 |
$table_data = array();
|
109 |
$months_array = array( '' );
|
110 |
$total_orders_array = array( __( 'Total Orders', 'woocommerce-jetpack' ) );
|
111 |
-
$total_orders_sum_array = array(
|
|
|
|
|
|
|
|
|
112 |
$order_currencies_array = array(); // TODO
|
113 |
$report_currency = ( isset( $_GET['currency'] ) && 'merge' != $_GET['currency'] ) ? $_GET['currency'] : get_woocommerce_currency();
|
114 |
for ( $i = 1; $i <= 12; $i++ ) {
|
@@ -168,9 +172,15 @@ class WCJ_Reports_Monthly_Sales {
|
|
168 |
//if ( $total_orders_sum != $total_orders_sum_excl_tax) {
|
169 |
$total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $total_orders_sum_excl_tax, 2, '.', ',' );
|
170 |
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
/* $total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $total_orders_sum_excl_tax * 0.965, 2, '.', ',' ); // TODO !!!;
|
172 |
$total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $total_orders_sum_excl_tax * 0.965 * 0.80, 2, '.', ',' ); // TODO !!!; */
|
173 |
-
if ( isset( $_GET['show_rates'] ) ) { // TODO
|
174 |
ksort( $current_months_averages, true );
|
175 |
// $total_orders_result_html .= '<pre style="font-size:8px;">' . print_r( $current_months_averages, true ) . '</pre>';
|
176 |
$total_orders_result_html .= '<pre style="font-size:x-small;">';
|
@@ -180,7 +190,7 @@ class WCJ_Reports_Monthly_Sales {
|
|
180 |
}
|
181 |
}
|
182 |
$total_orders_result_html .= '</pre>';
|
183 |
-
}
|
184 |
$total_orders_sum_array[] = $total_orders_result_html;
|
185 |
}
|
186 |
$table_data[] = $months_array;
|
4 |
*
|
5 |
* The WooCommerce Jetpack Mothly Sales Reports class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @since 2.4.7
|
9 |
* @author Algoritmika Ltd.
|
10 |
*/
|
41 |
/*
|
42 |
* get_exchange_rate_average.
|
43 |
*
|
44 |
+
* @version 2.4.8
|
45 |
* @since 2.4.7
|
46 |
*/
|
47 |
function get_exchange_rate_average( $currency_from, $currency_to, $start_date, $end_date ) {
|
56 |
. $end_date. '%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=';
|
57 |
ob_start();
|
58 |
$max_execution_time = ini_get( 'max_execution_time' );
|
59 |
+
set_time_limit( 5 );
|
60 |
$exchange_rate = json_decode( file_get_contents( $url ) );
|
61 |
set_time_limit( $max_execution_time );
|
62 |
ob_end_clean();
|
79 |
. $end_date. '%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=';
|
80 |
ob_start();
|
81 |
$max_execution_time = ini_get( 'max_execution_time' );
|
82 |
+
set_time_limit( 5 );
|
83 |
$exchange_rate = json_decode( file_get_contents( $url ) );
|
84 |
set_time_limit( $max_execution_time );
|
85 |
ob_end_clean();
|
100 |
/*
|
101 |
* get_monthly_sales_report.
|
102 |
*
|
103 |
+
* @version 2.4.8
|
104 |
* @since 2.4.7
|
105 |
*/
|
106 |
function get_monthly_sales_report() {
|
108 |
$table_data = array();
|
109 |
$months_array = array( '' );
|
110 |
$total_orders_array = array( __( 'Total Orders', 'woocommerce-jetpack' ) );
|
111 |
+
$total_orders_sum_array = array(
|
112 |
+
__( 'Total Sum', 'woocommerce-jetpack' ) . '<br>' .
|
113 |
+
__( 'Total Sum (excl. TAX)', 'woocommerce-jetpack' ) . '<br>' .
|
114 |
+
__( 'Average / Day (excl. TAX)', 'woocommerce-jetpack' )
|
115 |
+
);
|
116 |
$order_currencies_array = array(); // TODO
|
117 |
$report_currency = ( isset( $_GET['currency'] ) && 'merge' != $_GET['currency'] ) ? $_GET['currency'] : get_woocommerce_currency();
|
118 |
for ( $i = 1; $i <= 12; $i++ ) {
|
172 |
//if ( $total_orders_sum != $total_orders_sum_excl_tax) {
|
173 |
$total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $total_orders_sum_excl_tax, 2, '.', ',' );
|
174 |
//}
|
175 |
+
$day_for_average = ( $i == date( 'm' ) ) ? date( 'd' ) : date( 'd', strtotime( $end_date ) );
|
176 |
+
$average_result = $total_orders_sum_excl_tax / $day_for_average;
|
177 |
+
$total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $average_result, 2, '.', ',' );
|
178 |
+
if ( 0 != $average_result ) {
|
179 |
+
$total_orders_result_html .= ' (' . $day_for_average . 'd.)';
|
180 |
+
}
|
181 |
/* $total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $total_orders_sum_excl_tax * 0.965, 2, '.', ',' ); // TODO !!!;
|
182 |
$total_orders_result_html .= '<br>' . $report_currency . ' ' . number_format( $total_orders_sum_excl_tax * 0.965 * 0.80, 2, '.', ',' ); // TODO !!!; */
|
183 |
+
// if ( isset( $_GET['show_rates'] ) ) { // TODO
|
184 |
ksort( $current_months_averages, true );
|
185 |
// $total_orders_result_html .= '<pre style="font-size:8px;">' . print_r( $current_months_averages, true ) . '</pre>';
|
186 |
$total_orders_result_html .= '<pre style="font-size:x-small;">';
|
190 |
}
|
191 |
}
|
192 |
$total_orders_result_html .= '</pre>';
|
193 |
+
// }
|
194 |
$total_orders_sum_array[] = $total_orders_result_html;
|
195 |
}
|
196 |
$table_data[] = $months_array;
|
includes/shipping/class-wc-shipping-wcj-custom.php
CHANGED
@@ -1,98 +1,156 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
*/
|
|
|
5 |
add_action( 'woocommerce_shipping_init', 'init_wc_shipping_wcj_custom_class' );
|
6 |
|
7 |
-
|
8 |
-
if ( ! class_exists( 'WC_Shipping_WCJ_Custom' ) ) {
|
9 |
-
class WC_Shipping_WCJ_Custom extends WC_Shipping_Method {
|
10 |
-
/**
|
11 |
-
* Constructor for your shipping class
|
12 |
-
*
|
13 |
-
* @access public
|
14 |
-
* @return void
|
15 |
-
*/
|
16 |
-
public function __construct() {
|
17 |
-
$this->id = 'jetpack_custom_shipping';
|
18 |
-
//$this->title = __( 'Custom', 'woocommerce-jetpack' );
|
19 |
-
$this->method_title = __( 'Custom Shipping', 'woocommerce-jetpack' );
|
20 |
-
$this->method_description = __( 'WooCommerce Jetpack: Custom Shipping Method', 'woocommerce-jetpack' );
|
21 |
-
//$this->enabled = "yes"; // This can be added as an setting but for this example its forced enabled
|
22 |
-
$this->init();
|
23 |
-
|
24 |
-
$this->enabled = $this->settings['enabled'];//$this->get_option( 'enabled' );
|
25 |
-
$this->title = $this->settings['title'];//$this->get_option( 'title' );
|
26 |
-
|
27 |
-
// Define user set variables
|
28 |
-
//$this->title = $this->get_option( 'title' );
|
29 |
-
////$this->description = $this->get_option( 'description' );
|
30 |
-
////$this->instructions = $this->get_option( 'instructions', $this->description );
|
31 |
-
////$this->icon = $this->get_option( 'icon', '' );//apply_filters( 'woocommerce_wcj_custom_icon', $this->get_option( 'icon', '' ) );
|
32 |
-
}
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Initialise Settings Form Fields
|
51 |
-
*/
|
52 |
-
public function init_form_fields() {
|
53 |
-
|
54 |
-
$this->form_fields = array(
|
55 |
-
'enabled' => array(
|
56 |
-
'title' => __( 'Enable/Disable', 'woocommerce' ),
|
57 |
-
'type' => 'checkbox',
|
58 |
-
'label' => __( 'Enable Custom Shipping', 'woocommerce-jetpack' ),
|
59 |
-
'default' => 'no'
|
60 |
-
),
|
61 |
-
'title' => array(
|
62 |
-
'title' => __( 'Title', 'woocommerce' ),
|
63 |
-
'type' => 'text',
|
64 |
-
'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
|
65 |
-
'default' => __( 'Custom Shipping', 'woocommerce-jetpack' ),
|
66 |
-
'desc_tip' => true,
|
67 |
-
),
|
68 |
-
);
|
69 |
-
}
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
public function
|
79 |
-
|
80 |
-
|
81 |
-
'label' => $this->title,
|
82 |
-
'cost' => '4.99',
|
83 |
-
'calc_tax' => 'per_order'
|
84 |
-
);
|
85 |
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
|
|
89 |
}
|
90 |
}
|
91 |
}
|
92 |
-
|
93 |
-
function add_wc_shipping_wcj_custom_class( $methods ) {
|
94 |
-
$methods[] = 'WC_Shipping_WCJ_Custom';
|
95 |
-
return $methods;
|
96 |
-
}
|
97 |
-
|
98 |
-
add_filter( 'woocommerce_shipping_methods', 'add_wc_shipping_wcj_custom_class' );
|
1 |
<?php
|
2 |
/**
|
3 |
+
* WooCommerce Jetpack Custom Shipping
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Custom Shipping class.
|
6 |
+
*
|
7 |
+
* @version 2.4.8
|
8 |
+
* @since 2.4.8
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
*/
|
11 |
+
|
12 |
add_action( 'woocommerce_shipping_init', 'init_wc_shipping_wcj_custom_class' );
|
13 |
|
14 |
+
if ( ! function_exists( 'init_wc_shipping_wcj_custom_class' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
function init_wc_shipping_wcj_custom_class() {
|
17 |
+
|
18 |
+
if ( class_exists( 'WC_Shipping_Method' ) ) {
|
19 |
+
|
20 |
+
class WC_Shipping_WCJ_Custom_Template extends WC_Shipping_Method {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor shipping class
|
24 |
+
*
|
25 |
+
* @access public
|
26 |
+
* @return void
|
27 |
+
*/
|
28 |
+
function __construct() {
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Init settings
|
33 |
+
*
|
34 |
+
* @access public
|
35 |
+
* @return void
|
36 |
+
*/
|
37 |
+
function init( $id_count ) {
|
38 |
+
|
39 |
+
$this->id = 'booster_custom_shipping_' . $id_count;
|
40 |
+
$this->method_title = get_option( 'wcj_shipping_custom_shipping_admin_title_' . $id_count, __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $id_count );
|
41 |
+
$this->method_description = __( 'Booster: Custom Shipping Method', 'woocommerce-jetpack' ) . ' #' . $id_count;
|
42 |
+
|
43 |
+
// Load the settings.
|
44 |
+
$this->init_form_fields();
|
45 |
+
$this->init_settings();
|
46 |
|
47 |
+
// Define user set variables
|
48 |
+
$this->enabled = $this->get_option( 'enabled' );
|
49 |
+
$this->title = $this->get_option( 'title' );
|
50 |
+
$this->cost = $this->get_option( 'cost' );
|
51 |
+
$this->type = $this->get_option( 'type' );
|
52 |
+
|
53 |
+
// Save settings in admin
|
54 |
+
add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Initialise Settings Form Fields
|
59 |
+
*/
|
60 |
+
function init_form_fields() {
|
61 |
+
$this->form_fields = array(
|
62 |
+
'enabled' => array(
|
63 |
+
'title' => __( 'Enable/Disable', 'woocommerce' ),
|
64 |
+
'type' => 'checkbox',
|
65 |
+
'label' => __( 'Enable Custom Shipping', 'woocommerce-jetpack' ),
|
66 |
+
'default' => 'no',
|
67 |
+
),
|
68 |
+
'title' => array(
|
69 |
+
'title' => __( 'Title', 'woocommerce' ),
|
70 |
+
'type' => 'text',
|
71 |
+
'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
|
72 |
+
'default' => __( 'Custom Shipping', 'woocommerce-jetpack' ),
|
73 |
+
'desc_tip' => true,
|
74 |
+
),
|
75 |
+
'type' => array(
|
76 |
+
'title' => __( 'Type', 'woocommerce' ),
|
77 |
+
'type' => 'select',
|
78 |
+
'description' => __( 'Cost calculation type.', 'woocommerce-jetpack' ),
|
79 |
+
'default' => 'flat_rate',
|
80 |
+
'desc_tip' => true,
|
81 |
+
'options' => array(
|
82 |
+
'flat_rate' => __( 'Flat Rate', 'woocommerce-jetpack' ),
|
83 |
+
'by_total_cart_weight' => __( 'By Total Cart Weight', 'woocommerce-jetpack' ),
|
84 |
+
'by_total_cart_quantity' => __( 'By Total Cart Quantity', 'woocommerce-jetpack' ),
|
85 |
+
),
|
86 |
+
),
|
87 |
+
'cost' => array(
|
88 |
+
'title' => __( 'Cost', 'woocommerce' ),
|
89 |
+
'type' => 'number',
|
90 |
+
'description' => __( 'Cost. If calculating by weight - then cost per one weight unit. If calculating by quantity - then cost per one piece.', 'woocommerce-jetpack' ),
|
91 |
+
'default' => 0,
|
92 |
+
'desc_tip' => true,
|
93 |
+
'custom_attributes' => array( 'step' => '0.000001', 'min' => '0', ),
|
94 |
+
),
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* calculate_shipping function.
|
100 |
+
*
|
101 |
+
* @access public
|
102 |
+
* @param mixed $package
|
103 |
+
* @return void
|
104 |
+
*/
|
105 |
+
function calculate_shipping( $package ) {
|
106 |
+
switch ( $this->type ) {
|
107 |
+
case 'by_total_cart_quantity':
|
108 |
+
$cart_quantity = 0;
|
109 |
+
foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
|
110 |
+
$cart_quantity += $values['quantity'];
|
111 |
+
}
|
112 |
+
$cost = $this->cost * $cart_quantity;
|
113 |
+
break;
|
114 |
+
case 'by_total_cart_weight':
|
115 |
+
$cost = $this->cost * WC()->cart->get_cart_contents_weight();
|
116 |
+
break;
|
117 |
+
default: // 'flat_rate'
|
118 |
+
$cost = $this->cost;
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
$rate = array(
|
122 |
+
'id' => $this->id,
|
123 |
+
'label' => $this->title,
|
124 |
+
'cost' => $cost,
|
125 |
+
'calc_tax' => 'per_order',
|
126 |
+
);
|
127 |
+
// Register the rate
|
128 |
+
$this->add_rate( $rate );
|
129 |
+
}
|
130 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
+
class WC_Shipping_WCJ_Custom_1 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 1 ); } }
|
133 |
+
class WC_Shipping_WCJ_Custom_2 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 2 ); } }
|
134 |
+
class WC_Shipping_WCJ_Custom_3 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 3 ); } }
|
135 |
+
class WC_Shipping_WCJ_Custom_4 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 4 ); } }
|
136 |
+
class WC_Shipping_WCJ_Custom_5 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 5 ); } }
|
137 |
+
class WC_Shipping_WCJ_Custom_6 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 6 ); } }
|
138 |
+
class WC_Shipping_WCJ_Custom_7 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 7 ); } }
|
139 |
+
class WC_Shipping_WCJ_Custom_8 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 8 ); } }
|
140 |
+
class WC_Shipping_WCJ_Custom_9 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 9 ); } }
|
141 |
+
class WC_Shipping_WCJ_Custom_10 extends WC_Shipping_WCJ_Custom_Template { public function __construct() { $this->init( 10 ); } }
|
|
|
|
|
|
|
|
|
142 |
|
143 |
+
/*
|
144 |
+
* add_wc_shipping_wcj_custom_class.
|
145 |
+
*/
|
146 |
+
function add_wc_shipping_wcj_custom_class( $methods ) {
|
147 |
+
$total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_shipping_custom_shipping_total_number', 1 ) );
|
148 |
+
for ( $i = 1; $i <= $total_number; $i++ ) {
|
149 |
+
$methods[] = 'WC_Shipping_WCJ_Custom_' . $i;
|
150 |
+
}
|
151 |
+
return $methods;
|
152 |
}
|
153 |
+
add_filter( 'woocommerce_shipping_methods', 'add_wc_shipping_wcj_custom_class' );
|
154 |
}
|
155 |
}
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/shortcodes/class-wcj-general-shortcodes.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack General Shortcodes class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -34,21 +34,19 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
34 |
'wcj_text',
|
35 |
'wcj_tcpdf_pagebreak',
|
36 |
'wcj_get_left_to_free_shipping',
|
|
|
37 |
);
|
38 |
|
39 |
$this->the_atts = array(
|
40 |
'date_format' => get_option( 'date_format' ),
|
41 |
-
|
42 |
-
'
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'
|
49 |
-
'countries' => '',
|
50 |
-
'currencies' => '',
|
51 |
-
'content' => '',
|
52 |
);
|
53 |
|
54 |
parent::__construct();
|
@@ -80,6 +78,36 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
|
|
80 |
return $shortcode_currencies;
|
81 |
}
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
/**
|
84 |
* wcj_currency_select_link_list.
|
85 |
*
|
4 |
*
|
5 |
* The WooCommerce Jetpack General Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
34 |
'wcj_text',
|
35 |
'wcj_tcpdf_pagebreak',
|
36 |
'wcj_get_left_to_free_shipping',
|
37 |
+
'wcj_wholesale_price_table',
|
38 |
);
|
39 |
|
40 |
$this->the_atts = array(
|
41 |
'date_format' => get_option( 'date_format' ),
|
42 |
+
'lang' => '',
|
43 |
+
'form_method' => 'post',//'get',
|
44 |
+
'class' => '',
|
45 |
+
'style' => '',
|
46 |
+
'countries' => '',
|
47 |
+
'currencies' => '',
|
48 |
+
'content' => '',
|
49 |
+
'heading_format' => 'from %level_qty% pcs.',
|
|
|
|
|
|
|
50 |
);
|
51 |
|
52 |
parent::__construct();
|
78 |
return $shortcode_currencies;
|
79 |
}
|
80 |
|
81 |
+
/**
|
82 |
+
* wcj_wholesale_price_table.
|
83 |
+
*
|
84 |
+
* @version 2.4.8
|
85 |
+
* @since 2.4.8
|
86 |
+
*/
|
87 |
+
function wcj_wholesale_price_table( $atts ) {
|
88 |
+
|
89 |
+
$wholesale_price_levels = array();
|
90 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
|
91 |
+
$level_qty = get_option( 'wcj_wholesale_price_level_min_qty_' . $i, PHP_INT_MAX );
|
92 |
+
$discount_percent = get_option( 'wcj_wholesale_price_level_discount_percent_' . $i, 0 );
|
93 |
+
$wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount_percent' => $discount_percent, );
|
94 |
+
}
|
95 |
+
|
96 |
+
$data_qty = array();
|
97 |
+
$data_discount_percent = array();
|
98 |
+
foreach ( $wholesale_price_levels as $wholesale_price_level ) {
|
99 |
+
$data_qty[] = str_replace( '%level_qty%', $wholesale_price_level['quantity'], $atts['heading_format'] ) ;
|
100 |
+
$data_discount_percent[] = '-' . $wholesale_price_level['discount_percent'] . '%';
|
101 |
+
}
|
102 |
+
|
103 |
+
$table_rows = array( $data_qty, $data_discount_percent, );
|
104 |
+
$columns_styles = array();
|
105 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
|
106 |
+
$columns_styles[] = 'text-align: center;';
|
107 |
+
}
|
108 |
+
return wcj_get_table_html( $table_rows, array( 'columns_styles' => $columns_styles ) );
|
109 |
+
}
|
110 |
+
|
111 |
/**
|
112 |
* wcj_currency_select_link_list.
|
113 |
*
|
includes/shortcodes/class-wcj-order-items-shortcodes.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Order Items Shortcodes class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -126,7 +126,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
|
|
126 |
/**
|
127 |
* wcj_order_items_table.
|
128 |
*
|
129 |
-
* @version 2.4.
|
130 |
*/
|
131 |
function wcj_order_items_table( $atts, $content = '' ) {
|
132 |
|
@@ -209,7 +209,16 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
|
|
209 |
$data[ $item_counter ][] = wcj_get_product_input_fields( $item );
|
210 |
break;
|
211 |
case 'item_key':
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
break;
|
214 |
case 'item_excerpt':
|
215 |
case 'item_description':
|
4 |
*
|
5 |
* The WooCommerce Jetpack Order Items Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
126 |
/**
|
127 |
* wcj_order_items_table.
|
128 |
*
|
129 |
+
* @version 2.4.8
|
130 |
*/
|
131 |
function wcj_order_items_table( $atts, $content = '' ) {
|
132 |
|
209 |
$data[ $item_counter ][] = wcj_get_product_input_fields( $item );
|
210 |
break;
|
211 |
case 'item_key':
|
212 |
+
if ( isset( $item[ $column_param ] ) ) {
|
213 |
+
$maybe_unserialized_value = maybe_unserialize( $item[ $column_param ] );
|
214 |
+
if ( is_array( $maybe_unserialized_value ) ) {
|
215 |
+
$data[ $item_counter ][] = isset( $maybe_unserialized_value['name'] ) ? $maybe_unserialized_value['name'] : '';
|
216 |
+
} else {
|
217 |
+
$data[ $item_counter ][] = $maybe_unserialized_value;
|
218 |
+
}
|
219 |
+
} else {
|
220 |
+
$data[ $item_counter ][] = '';
|
221 |
+
}
|
222 |
break;
|
223 |
case 'item_excerpt':
|
224 |
case 'item_description':
|
includes/shortcodes/class-wcj-orders-shortcodes.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Orders Shortcodes class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_Orders_Shortcodes extends WCJ_Shortcodes {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -51,6 +51,8 @@ class WCJ_Orders_Shortcodes extends WCJ_Shortcodes {
|
|
51 |
'wcj_order_shipping_price',
|
52 |
|
53 |
'wcj_order_total_fees',
|
|
|
|
|
54 |
'wcj_order_fee',
|
55 |
'wcj_order_fees_html',
|
56 |
|
@@ -116,6 +118,18 @@ class WCJ_Orders_Shortcodes extends WCJ_Shortcodes {
|
|
116 |
return ( 'yes' === $atts['hide_if_zero'] && 0 == $raw_price ) ? '' : wcj_price( $raw_price, $this->the_order->get_order_currency(), $atts['hide_currency'] );
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
/**
|
120 |
* wcj_order_total_fees.
|
121 |
*/
|
@@ -128,6 +142,47 @@ class WCJ_Orders_Shortcodes extends WCJ_Shortcodes {
|
|
128 |
return $this->wcj_price_shortcode( $total_fees, $atts );
|
129 |
}
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
/**
|
132 |
* wcj_order_fees_html.
|
133 |
*/
|
4 |
*
|
5 |
* The WooCommerce Jetpack Orders Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
51 |
'wcj_order_shipping_price',
|
52 |
|
53 |
'wcj_order_total_fees',
|
54 |
+
'wcj_order_total_fees_incl_tax',
|
55 |
+
'wcj_order_total_fees_tax',
|
56 |
'wcj_order_fee',
|
57 |
'wcj_order_fees_html',
|
58 |
|
118 |
return ( 'yes' === $atts['hide_if_zero'] && 0 == $raw_price ) ? '' : wcj_price( $raw_price, $this->the_order->get_order_currency(), $atts['hide_currency'] );
|
119 |
}
|
120 |
|
121 |
+
/**
|
122 |
+
* Get order custom field.
|
123 |
+
*
|
124 |
+
* @version 2.4.8
|
125 |
+
* @since 2.4.8
|
126 |
+
* @return string
|
127 |
+
*/
|
128 |
+
function wcj_order_custom_field( $atts ) {
|
129 |
+
$order_custom_fields = get_post_custom( $atts['order_id'] );
|
130 |
+
return ( isset( $order_custom_fields[ $atts['name'] ][0] ) ) ? $order_custom_fields[ $atts['name'] ][0] : '';
|
131 |
+
}
|
132 |
+
|
133 |
/**
|
134 |
* wcj_order_total_fees.
|
135 |
*/
|
142 |
return $this->wcj_price_shortcode( $total_fees, $atts );
|
143 |
}
|
144 |
|
145 |
+
/**
|
146 |
+
* wcj_order_total_fees_tax.
|
147 |
+
*
|
148 |
+
* @version 2.4.8
|
149 |
+
* @since 2.4.8
|
150 |
+
*/
|
151 |
+
function wcj_order_total_fees_tax( $atts ) {
|
152 |
+
$total_fees_tax = 0;
|
153 |
+
$the_fees = $this->the_order->get_fees();
|
154 |
+
foreach ( $the_fees as $the_fee ) {
|
155 |
+
$taxes = maybe_unserialize( $the_fee['line_tax_data'] );
|
156 |
+
if ( ! empty( $taxes ) && is_array( $taxes ) && isset( $taxes['total'] ) && is_array( $taxes['total'] ) ) {
|
157 |
+
foreach ( $taxes['total'] as $tax ) {
|
158 |
+
$total_fees_tax += $tax;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
return $this->wcj_price_shortcode( $total_fees_tax, $atts );
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* wcj_order_total_fees_incl_tax.
|
167 |
+
*
|
168 |
+
* @version 2.4.8
|
169 |
+
* @since 2.4.8
|
170 |
+
*/
|
171 |
+
function wcj_order_total_fees_incl_tax( $atts ) {
|
172 |
+
$total_fees = 0;
|
173 |
+
$the_fees = $this->the_order->get_fees();
|
174 |
+
foreach ( $the_fees as $the_fee ) {
|
175 |
+
$total_fees += $the_fee['line_total'];
|
176 |
+
$taxes = maybe_unserialize( $the_fee['line_tax_data'] );
|
177 |
+
if ( ! empty( $taxes ) && is_array( $taxes ) && isset( $taxes['total'] ) && is_array( $taxes['total'] ) ) {
|
178 |
+
foreach ( $taxes['total'] as $tax ) {
|
179 |
+
$total_fees += $tax;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
return $this->wcj_price_shortcode( $total_fees, $atts );
|
184 |
+
}
|
185 |
+
|
186 |
/**
|
187 |
* wcj_order_fees_html.
|
188 |
*/
|
includes/shortcodes/class-wcj-products-shortcodes.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* The WooCommerce Jetpack Products Shortcodes class.
|
6 |
*
|
7 |
-
* @version 2.4.
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
@@ -17,7 +17,7 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
-
* @version 2.4.
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
@@ -71,6 +71,7 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
71 |
'sep' => ', ',
|
72 |
'add_links' => 'yes',
|
73 |
'add_percent_row' => 'no',
|
|
|
74 |
'show_always' => 'yes',
|
75 |
'hide_if_zero' => 'no',
|
76 |
'reverse' => 'no',
|
@@ -84,16 +85,24 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
84 |
/**
|
85 |
* Inits shortcode atts and properties.
|
86 |
*
|
87 |
-
* @
|
88 |
-
*
|
89 |
-
* @return
|
90 |
*/
|
91 |
function init_atts( $atts ) {
|
92 |
|
93 |
// Atts
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
// Class properties
|
99 |
$this->the_product = wc_get_product( $atts['product_id'] );
|
@@ -210,23 +219,63 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
210 |
/**
|
211 |
* wcj_product_price_excluding_tax.
|
212 |
*
|
213 |
-
* @version 2.4.
|
214 |
* @since 2.4.0
|
215 |
*/
|
216 |
function wcj_product_price_excluding_tax( $atts ) {
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
/**
|
222 |
* wcj_product_price_including_tax.
|
223 |
*
|
224 |
-
* @version 2.4.
|
225 |
* @since 2.4.0
|
226 |
*/
|
227 |
function wcj_product_price_including_tax( $atts ) {
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
231 |
|
232 |
/**
|
@@ -555,6 +604,7 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
555 |
/**
|
556 |
* Returns product (modified) price.
|
557 |
*
|
|
|
558 |
* @todo variable products: a) not range; and b) price by country.
|
559 |
* @return string The product (modified) price
|
560 |
*/
|
@@ -571,7 +621,7 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
571 |
$min = wc_price( $min );
|
572 |
$max = wc_price( $max );
|
573 |
}
|
574 |
-
return sprintf( '%s-%s', $min, $max );
|
575 |
}
|
576 |
// Simple etc.
|
577 |
else {
|
@@ -583,13 +633,14 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
583 |
|
584 |
/**
|
585 |
* wcj_product_wholesale_price_table.
|
|
|
|
|
586 |
*/
|
587 |
function wcj_product_wholesale_price_table( $atts ) {
|
588 |
|
589 |
if ( ! wcj_is_product_wholesale_enabled( $this->the_product->id ) ) return '';
|
590 |
|
591 |
$wholesale_price_levels = array();
|
592 |
-
|
593 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
|
594 |
$level_qty = get_option( 'wcj_wholesale_price_level_min_qty_' . $i, PHP_INT_MAX );
|
595 |
$discount_percent = get_option( 'wcj_wholesale_price_level_discount_percent_' . $i, 0 );
|
@@ -599,13 +650,12 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
599 |
|
600 |
$data_qty = array();
|
601 |
$data_price = array();
|
602 |
-
|
603 |
foreach ( $wholesale_price_levels as $wholesale_price_level ) {
|
604 |
|
605 |
$the_price = '';
|
606 |
-
|
607 |
-
// Variable
|
608 |
if ( $this->the_product->is_type( 'variable' ) ) {
|
|
|
609 |
$min = $this->the_product->get_variation_price( 'min', false );
|
610 |
$max = $this->the_product->get_variation_price( 'max', false );
|
611 |
if ( '' !== $wholesale_price_level['koef'] && is_numeric( $wholesale_price_level['koef'] ) ) {
|
@@ -616,11 +666,10 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
616 |
$min = wc_price( $min );
|
617 |
$max = wc_price( $max );
|
618 |
}
|
619 |
-
$the_price = sprintf( '%s-%s', $min, $max );
|
620 |
-
}
|
621 |
-
|
622 |
-
|
623 |
-
//$the_price = wc_price( round( $this->the_product->get_price() * $wholesale_price_level['koef'], $precision ) );
|
624 |
$the_price = $this->the_product->get_price();
|
625 |
if ( '' !== $wholesale_price_level['koef'] && is_numeric( $wholesale_price_level['koef'] ) ) {
|
626 |
$the_price = $the_price * $wholesale_price_level['koef'];
|
@@ -630,19 +679,27 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
|
|
630 |
}
|
631 |
}
|
632 |
|
633 |
-
$data_qty[]
|
634 |
-
$
|
|
|
|
|
635 |
if ( 'yes' === $atts['add_percent_row'] ) {
|
636 |
$data_discount_percent[] = '-' . $wholesale_price_level['discount_percent'] . '%';
|
637 |
}
|
638 |
}
|
639 |
|
640 |
-
$table_rows = array( $data_qty,
|
|
|
|
|
|
|
641 |
if ( 'yes' === $atts['add_percent_row'] ) {
|
642 |
$table_rows[] = $data_discount_percent;
|
643 |
}
|
644 |
-
$
|
645 |
-
|
|
|
|
|
|
|
646 |
}
|
647 |
|
648 |
/**
|
4 |
*
|
5 |
* The WooCommerce Jetpack Products Shortcodes class.
|
6 |
*
|
7 |
+
* @version 2.4.8
|
8 |
* @author Algoritmika Ltd.
|
9 |
*/
|
10 |
|
17 |
/**
|
18 |
* Constructor.
|
19 |
*
|
20 |
+
* @version 2.4.8
|
21 |
*/
|
22 |
public function __construct() {
|
23 |
|
71 |
'sep' => ', ',
|
72 |
'add_links' => 'yes',
|
73 |
'add_percent_row' => 'no',
|
74 |
+
'add_price_row' => 'yes',
|
75 |
'show_always' => 'yes',
|
76 |
'hide_if_zero' => 'no',
|
77 |
'reverse' => 'no',
|
85 |
/**
|
86 |
* Inits shortcode atts and properties.
|
87 |
*
|
88 |
+
* @version 2.4.8
|
89 |
+
* @param array $atts Shortcode atts.
|
90 |
+
* @return array The (modified) shortcode atts.
|
91 |
*/
|
92 |
function init_atts( $atts ) {
|
93 |
|
94 |
// Atts
|
95 |
+
if ( 0 == $atts['product_id'] ) {
|
96 |
+
global $wcj_product_id_for_shortcode;
|
97 |
+
if ( 0 != $wcj_product_id_for_shortcode ) {
|
98 |
+
$atts['product_id'] = $wcj_product_id_for_shortcode;
|
99 |
+
} else {
|
100 |
+
$atts['product_id'] = get_the_ID();
|
101 |
+
}
|
102 |
+
if ( 0 == $atts['product_id'] ) return false;
|
103 |
+
}
|
104 |
+
$the_post_type = get_post_type( $atts['product_id'] );
|
105 |
+
if ( 'product' !== $the_post_type && 'product_variation' !== $the_post_type ) return false;
|
106 |
|
107 |
// Class properties
|
108 |
$this->the_product = wc_get_product( $atts['product_id'] );
|
219 |
/**
|
220 |
* wcj_product_price_excluding_tax.
|
221 |
*
|
222 |
+
* @version 2.4.8
|
223 |
* @since 2.4.0
|
224 |
*/
|
225 |
function wcj_product_price_excluding_tax( $atts ) {
|
226 |
+
if ( $this->the_product->is_type( 'variable' ) ) {
|
227 |
+
// Variable
|
228 |
+
$prices = $this->the_product->get_variation_prices( false );
|
229 |
+
$min_product_id = key( $prices['price'] );
|
230 |
+
end( $prices['price'] );
|
231 |
+
$max_product_id = key( $prices['price'] );
|
232 |
+
if ( 0 != $min_product_id && 0 != $max_product_id ) {
|
233 |
+
$min_variation_product = wc_get_product( $min_product_id );
|
234 |
+
$max_variation_product = wc_get_product( $max_product_id );
|
235 |
+
$min = $min_variation_product->get_price_excluding_tax();
|
236 |
+
$max = $max_variation_product->get_price_excluding_tax();
|
237 |
+
if ( 'yes' !== $atts['hide_currency'] ) {
|
238 |
+
$min = wc_price( $min );
|
239 |
+
$max = wc_price( $max );
|
240 |
+
}
|
241 |
+
return ( $min != $max ) ? sprintf( '%s-%s', $min, $max ) : $min;
|
242 |
+
}
|
243 |
+
} else {
|
244 |
+
// Simple etc.
|
245 |
+
$the_price = $this->the_product->get_price_excluding_tax();
|
246 |
+
return ( 'yes' === $atts['hide_currency'] ) ? $the_price : wc_price( $the_price );
|
247 |
+
}
|
248 |
}
|
249 |
|
250 |
/**
|
251 |
* wcj_product_price_including_tax.
|
252 |
*
|
253 |
+
* @version 2.4.8
|
254 |
* @since 2.4.0
|
255 |
*/
|
256 |
function wcj_product_price_including_tax( $atts ) {
|
257 |
+
if ( $this->the_product->is_type( 'variable' ) ) {
|
258 |
+
// Variable
|
259 |
+
$prices = $this->the_product->get_variation_prices( false );
|
260 |
+
$min_product_id = key( $prices['price'] );
|
261 |
+
end( $prices['price'] );
|
262 |
+
$max_product_id = key( $prices['price'] );
|
263 |
+
if ( 0 != $min_product_id && 0 != $max_product_id ) {
|
264 |
+
$min_variation_product = wc_get_product( $min_product_id );
|
265 |
+
$max_variation_product = wc_get_product( $max_product_id );
|
266 |
+
$min = $min_variation_product->get_price_including_tax();
|
267 |
+
$max = $max_variation_product->get_price_including_tax();
|
268 |
+
if ( 'yes' !== $atts['hide_currency'] ) {
|
269 |
+
$min = wc_price( $min );
|
270 |
+
$max = wc_price( $max );
|
271 |
+
}
|
272 |
+
return ( $min != $max ) ? sprintf( '%s-%s', $min, $max ) : $min;
|
273 |
+
}
|
274 |
+
} else {
|
275 |
+
// Simple etc.
|
276 |
+
$the_price = $this->the_product->get_price_including_tax();
|
277 |
+
return ( 'yes' === $atts['hide_currency'] ) ? $the_price : wc_price( $the_price );
|
278 |
+
}
|
279 |
}
|
280 |
|
281 |
/**
|
604 |
/**
|
605 |
* Returns product (modified) price.
|
606 |
*
|
607 |
+
* @version 2.4.8
|
608 |
* @todo variable products: a) not range; and b) price by country.
|
609 |
* @return string The product (modified) price
|
610 |
*/
|
621 |
$min = wc_price( $min );
|
622 |
$max = wc_price( $max );
|
623 |
}
|
624 |
+
return ( $min != $max ) ? sprintf( '%s-%s', $min, $max ) : $min;
|
625 |
}
|
626 |
// Simple etc.
|
627 |
else {
|
633 |
|
634 |
/**
|
635 |
* wcj_product_wholesale_price_table.
|
636 |
+
*
|
637 |
+
* @version 2.4.8
|
638 |
*/
|
639 |
function wcj_product_wholesale_price_table( $atts ) {
|
640 |
|
641 |
if ( ! wcj_is_product_wholesale_enabled( $this->the_product->id ) ) return '';
|
642 |
|
643 |
$wholesale_price_levels = array();
|
|
|
644 |
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
|
645 |
$level_qty = get_option( 'wcj_wholesale_price_level_min_qty_' . $i, PHP_INT_MAX );
|
646 |
$discount_percent = get_option( 'wcj_wholesale_price_level_discount_percent_' . $i, 0 );
|
650 |
|
651 |
$data_qty = array();
|
652 |
$data_price = array();
|
653 |
+
$data_discount_percent = array();
|
654 |
foreach ( $wholesale_price_levels as $wholesale_price_level ) {
|
655 |
|
656 |
$the_price = '';
|
|
|
|
|
657 |
if ( $this->the_product->is_type( 'variable' ) ) {
|
658 |
+
// Variable
|
659 |
$min = $this->the_product->get_variation_price( 'min', false );
|
660 |
$max = $this->the_product->get_variation_price( 'max', false );
|
661 |
if ( '' !== $wholesale_price_level['koef'] && is_numeric( $wholesale_price_level['koef'] ) ) {
|
666 |
$min = wc_price( $min );
|
667 |
$max = wc_price( $max );
|
668 |
}
|
669 |
+
$the_price = ( $min != $max ) ? sprintf( '%s-%s', $min, $max ) : $min;
|
670 |
+
} else {
|
671 |
+
// Simple etc.
|
672 |
+
// $the_price = wc_price( round( $this->the_product->get_price() * $wholesale_price_level['koef'], $precision ) );
|
|
|
673 |
$the_price = $this->the_product->get_price();
|
674 |
if ( '' !== $wholesale_price_level['koef'] && is_numeric( $wholesale_price_level['koef'] ) ) {
|
675 |
$the_price = $the_price * $wholesale_price_level['koef'];
|
679 |
}
|
680 |
}
|
681 |
|
682 |
+
$data_qty[] = str_replace( '%level_qty%', $wholesale_price_level['quantity'], $atts['heading_format'] ) ;
|
683 |
+
if ( 'yes' === $atts['add_price_row'] ) {
|
684 |
+
$data_price[] = $the_price;
|
685 |
+
}
|
686 |
if ( 'yes' === $atts['add_percent_row'] ) {
|
687 |
$data_discount_percent[] = '-' . $wholesale_price_level['discount_percent'] . '%';
|
688 |
}
|
689 |
}
|
690 |
|
691 |
+
$table_rows = array( $data_qty, );
|
692 |
+
if ( 'yes' === $atts['add_price_row'] ) {
|
693 |
+
$table_rows[] = $data_price;
|
694 |
+
}
|
695 |
if ( 'yes' === $atts['add_percent_row'] ) {
|
696 |
$table_rows[] = $data_discount_percent;
|
697 |
}
|
698 |
+
$columns_styles = array();
|
699 |
+
for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
|
700 |
+
$columns_styles[] = 'text-align: center;';
|
701 |
+
}
|
702 |
+
return wcj_get_table_html( $table_rows, array( 'columns_styles' => $columns_styles ) );
|
703 |
}
|
704 |
|
705 |
/**
|
includes/templates/wcj-add-to-cart-variable.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Variable product add to cart - radio inputs
|
4 |
+
*
|
5 |
+
* @version 2.4.8
|
6 |
+
* @since 2.4.8
|
7 |
+
* @author Algoritmika Ltd.
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
global $product;
|
15 |
+
|
16 |
+
$attribute_keys = array_keys( $attributes );
|
17 |
+
|
18 |
+
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
|
19 |
+
|
20 |
+
<form class="variations_form cart" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->id ); ?>" data-product_variations="<?php echo esc_attr( json_encode( $available_variations ) ) ?>">
|
21 |
+
<?php do_action( 'woocommerce_before_variations_form' ); ?>
|
22 |
+
|
23 |
+
<?php if ( empty( $available_variations ) && false !== $available_variations ) : ?>
|
24 |
+
<p class="stock out-of-stock"><?php _e( 'This product is currently out of stock and unavailable.', 'woocommerce' ); ?></p>
|
25 |
+
<?php else : ?>
|
26 |
+
<table class="" cellspacing="0">
|
27 |
+
<tbody>
|
28 |
+
<?php foreach ( $available_variations as $variation ) : ?>
|
29 |
+
<tr>
|
30 |
+
<?php wcj_variation_radio_button( $product, $variation ); ?>
|
31 |
+
</tr>
|
32 |
+
<?php endforeach; ?>
|
33 |
+
</tbody>
|
34 |
+
</table>
|
35 |
+
<?php
|
36 |
+
foreach ( $product->get_attributes() as $attribute_name => $options ) {
|
37 |
+
echo '<input type="hidden" name="attribute_' . $attribute_name . '" value="">';
|
38 |
+
}
|
39 |
+
?>
|
40 |
+
|
41 |
+
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
|
42 |
+
|
43 |
+
<div class="single_variation_wrap">
|
44 |
+
<?php
|
45 |
+
/**
|
46 |
+
* woocommerce_before_single_variation Hook
|
47 |
+
*/
|
48 |
+
do_action( 'woocommerce_before_single_variation' );
|
49 |
+
|
50 |
+
/**
|
51 |
+
* woocommerce_single_variation hook. Used to output the cart button and placeholder for variation data.
|
52 |
+
* @since 2.4.0
|
53 |
+
* @hooked woocommerce_single_variation - 10 Empty div for variation data.
|
54 |
+
* @hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
|
55 |
+
*/
|
56 |
+
do_action( 'woocommerce_single_variation' );
|
57 |
+
|
58 |
+
/**
|
59 |
+
* woocommerce_after_single_variation Hook
|
60 |
+
*/
|
61 |
+
do_action( 'woocommerce_after_single_variation' );
|
62 |
+
?>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
|
66 |
+
<?php endif; ?>
|
67 |
+
|
68 |
+
<?php do_action( 'woocommerce_after_variations_form' ); ?>
|
69 |
+
</form>
|
70 |
+
|
71 |
+
<?php do_action( 'woocommerce_after_add_to_cart_form' ); ?>
|
includes/widgets/class-wcj-widget-country-switcher.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce Jetpack Country Switcher Widget
|
4 |
+
*
|
5 |
+
* The WooCommerce Jetpack Country Switcher Widget class.
|
6 |
+
*
|
7 |
+
* @version 2.4.8
|
8 |
+
* @since 2.4.8
|
9 |
+
* @author Algoritmika Ltd.
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WCJ_Widget_Country_Switcher' ) ) :
|
15 |
+
|
16 |
+
class WCJ_Widget_Country_Switcher 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_country_switcher',
|
24 |
+
'description' => __( 'Booster: Country Switcher Widget', 'woocommerce-jetpack' ),
|
25 |
+
);
|
26 |
+
parent::__construct( 'wcj_widget_country_switcher', __( 'Booster - Country Switcher', 'woocommerce-jetpack' ), $widget_ops );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Outputs the content of the widget
|
31 |
+
*
|
32 |
+
* @version 2.4.8
|
33 |
+
* @param array $args
|
34 |
+
* @param array $instance
|
35 |
+
*/
|
36 |
+
public function widget( $args, $instance ) {
|
37 |
+
// outputs the content of the widget
|
38 |
+
echo $args['before_widget'];
|
39 |
+
if ( ! empty( $instance['title'] ) ) {
|
40 |
+
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
|
41 |
+
}
|
42 |
+
echo do_shortcode( '[wcj_country_select_drop_down_list countries="' . $instance['countries'] . '"]' );
|
43 |
+
/* switch ( $instance['switcher_type'] ) {
|
44 |
+
case 'link_list':
|
45 |
+
echo do_shortcode( '[wcj_currency_select_link_list]' );
|
46 |
+
break;
|
47 |
+
case 'radio_list':
|
48 |
+
echo do_shortcode( '[wcj_currency_select_radio_list]' );
|
49 |
+
break;
|
50 |
+
default:
|
51 |
+
echo do_shortcode( '[wcj_currency_select_drop_down_list]' );
|
52 |
+
break;
|
53 |
+
} */
|
54 |
+
echo $args['after_widget'];
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Outputs the options form on admin
|
59 |
+
*
|
60 |
+
* @version 2.4.8
|
61 |
+
* @param array $instance The widget options
|
62 |
+
*/
|
63 |
+
public function form( $instance ) {
|
64 |
+
// outputs the options form on admin
|
65 |
+
$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
|
66 |
+
$countries = ! empty( $instance['countries'] ) ? $instance['countries'] : '';
|
67 |
+
// $switcher_type = ! empty( $instance['switcher_type'] ) ? $instance['switcher_type'] : 'drop_down';
|
68 |
+
?>
|
69 |
+
<p>
|
70 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
71 |
+
<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 ); ?>">
|
72 |
+
</p>
|
73 |
+
<p>
|
74 |
+
<label for="<?php echo $this->get_field_id( 'countries' ); ?>"><?php _e( 'Countries:' ); ?></label>
|
75 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'countries' ); ?>" name="<?php echo $this->get_field_name( 'countries' ); ?>" type="text" value="<?php echo esc_attr( $countries ); ?>">
|
76 |
+
</p>
|
77 |
+
<?php /*<p>
|
78 |
+
<label for="<?php echo $this->get_field_id( 'switcher_type' ); ?>"><?php _e( 'Type:' ); ?></label>
|
79 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'switcher_type' ); ?>" name="<?php echo $this->get_field_name( 'switcher_type' ); ?>">
|
80 |
+
<option value="drop_down" <?php selected( $switcher_type, 'drop_down' ); ?>><?php echo __( 'Drop down', 'woocommerce-jetpack' ); ?>
|
81 |
+
<option value="radio_list" <?php selected( $switcher_type, 'radio_list' ); ?>><?php echo __( 'Radio list', 'woocommerce-jetpack' ); ?>
|
82 |
+
<option value="link_list" <?php selected( $switcher_type, 'link_list' ); ?>><?php echo __( 'Link list', 'woocommerce-jetpack' ); ?>
|
83 |
+
</select>
|
84 |
+
</p>*/ ?>
|
85 |
+
<?php
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Processing widget options on save
|
90 |
+
*
|
91 |
+
* @version 2.4.8
|
92 |
+
* @param array $new_instance The new options
|
93 |
+
* @param array $old_instance The previous options
|
94 |
+
*/
|
95 |
+
public function update( $new_instance, $old_instance ) {
|
96 |
+
// processes widget options to be saved
|
97 |
+
$instance = array();
|
98 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
|
99 |
+
$instance['countries'] = ( ! empty( $new_instance['countries'] ) ) ? $new_instance['countries'] : '';
|
100 |
+
// $instance['switcher_type'] = ( ! empty( $new_instance['switcher_type'] ) ) ? $new_instance['switcher_type'] : 'drop_down';
|
101 |
+
return $instance;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
endif;
|
106 |
+
|
107 |
+
// register WCJ_Widget_Country_Switcher widget
|
108 |
+
if ( ! function_exists( 'register_wcj_widget_country_switcher' ) ) {
|
109 |
+
function register_wcj_widget_country_switcher() {
|
110 |
+
register_widget( 'WCJ_Widget_Country_Switcher' );
|
111 |
+
}
|
112 |
+
}
|
113 |
+
add_action( 'widgets_init', 'register_wcj_widget_country_switcher' );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: algoritmika,anbinder,solovjov
|
|
3 |
Tags: woocommerce,booster for woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,email pdf invoice,pdf invoice,pdf invoices,already in cart,empty cart,redirect to checkout,minimum order amount,customize checkout fields,checkout fields,email,customize product tabs,product tabs,related products number,empty cart,redirect add to cart,redirect to checkout,product already in cart,custom payment gateway,payment gateway icon,auto-complete all orders,custom order statuses,custom order status,remove text from price,custom css,hide categories count,hide subcategories count,hide category count,hide subcategory count,display total sales,custom product tabs,remove product tab,payment gateway fee,vat,gateway by country,price by country,currency switcher
|
4 |
Requires at least: 4.1
|
5 |
Tested up to: 4.5
|
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 |
|
@@ -21,8 +21,10 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
|
|
21 |
* *Currencies* - Add all world currencies to your WooCommerce store; change currency symbol.
|
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 |
-
* *
|
26 |
* *Wholesale Price* - Set WooCommerce wholesale pricing depending on product quantity in cart (buy more pay less).
|
27 |
|
28 |
**Button & Price Labels**
|
@@ -35,7 +37,7 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
|
|
35 |
**Products**
|
36 |
|
37 |
* *Crowdfunding* - Add crowdfunding products to WooCommerce.
|
38 |
-
* *Product Add to Cart* - Set any local url to redirect to on WooCommerce Add to Cart. Automatically add to cart on product visit.
|
39 |
* *Product Cost Price* - Save WooCommerce product purchase costs data for admin reports.
|
40 |
* *Product Images* - Customize WooCommerce products images, thumbnails and sale flashes.
|
41 |
* *Product Info* - Add additional info to WooCommerce category and single product pages.
|
@@ -72,7 +74,7 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
|
|
72 |
* *Order Custom Statuses* - Custom statuses for WooCommerce orders.
|
73 |
* *Order Numbers* - WooCommerce sequential order numbering, custom order number prefix, suffix and number width.
|
74 |
* *Orders* - Minimum WooCommerce order amount; orders auto-complete.
|
75 |
-
* *Shipping* - Hide WooCommerce shipping when free is available.
|
76 |
* *Shipping Calculator* - Customize WooCommerce shipping calculator on cart page.
|
77 |
|
78 |
**PDF Invoicing & Packing Slips**
|
@@ -120,6 +122,71 @@ To unlock all Booster for WooCommerce features, please install additional [Boost
|
|
120 |
|
121 |
== Changelog ==
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
= 2.4.7 - 19/04/2016 =
|
124 |
* Dev - Fixing plugin's performance issue - Version (`booster_for_woocommerce_version`) parameter added.
|
125 |
* Dev - `source` parameter added to documentation link (module and dashboard).
|
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: 4.1
|
5 |
Tested up to: 4.5
|
6 |
+
Stable tag: 2.4.8
|
7 |
License: GNU General Public License v3.0
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
21 |
* *Currencies* - Add all world currencies to your WooCommerce store; change currency symbol.
|
22 |
* *Currency Exchange Rates* - Automatic currency exchange rates for WooCommerce.
|
23 |
* *Currency for External Products* - Set different currency for external WooCommerce products.
|
24 |
+
* *Multicurrency (Currency Switcher)* - Add multiple currencies (currency switcher) to WooCommerce.
|
25 |
+
* *Multicurrency Product Base Price* - Enter prices for WooCommerce products in different currencies.
|
26 |
* *Prices and Currencies by Country* - Change WooCommerce product price and currency automatically by customer's country.
|
27 |
+
* *Product Open Pricing (Name Your Price)* - Let your WooCommerce store customers enter price for the product manually.
|
28 |
* *Wholesale Price* - Set WooCommerce wholesale pricing depending on product quantity in cart (buy more pay less).
|
29 |
|
30 |
**Button & Price Labels**
|
37 |
**Products**
|
38 |
|
39 |
* *Crowdfunding* - Add crowdfunding products to WooCommerce.
|
40 |
+
* *Product Add to Cart* - Set any local url to redirect to on WooCommerce Add to Cart. Automatically add to cart on product visit. Display radio buttons instead of drop box for variable products.
|
41 |
* *Product Cost Price* - Save WooCommerce product purchase costs data for admin reports.
|
42 |
* *Product Images* - Customize WooCommerce products images, thumbnails and sale flashes.
|
43 |
* *Product Info* - Add additional info to WooCommerce category and single product pages.
|
74 |
* *Order Custom Statuses* - Custom statuses for WooCommerce orders.
|
75 |
* *Order Numbers* - WooCommerce sequential order numbering, custom order number prefix, suffix and number width.
|
76 |
* *Orders* - Minimum WooCommerce order amount; orders auto-complete.
|
77 |
+
* *Shipping* - Add multiple custom shipping methods to WooCommerce. Hide WooCommerce shipping when free is available. Display "left to free shipping" info.
|
78 |
* *Shipping Calculator* - Customize WooCommerce shipping calculator on cart page.
|
79 |
|
80 |
**PDF Invoicing & Packing Slips**
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 2.4.8 - 04/05/2016 =
|
126 |
+
* Dev - "Booster - Country Switcher" widget added.
|
127 |
+
* Dev - Currency reports added to Multicurrency and Gateways Currency modules.
|
128 |
+
* Dev - `WCJ_Module` - `create_meta_box` - `select` type added.
|
129 |
+
* Dev - `WCJ_Module` - `create_meta_box` now takes option default value if no post meta is set.
|
130 |
+
* Dev - `wcj_product_id_for_shortcode` added to products shortcodes and to Custom Price Labels module.
|
131 |
+
* Fix - Admin module dashboard - Version display fixed.
|
132 |
+
* Dev - Documentation link and button link modified according to Google URL standards.
|
133 |
+
* Dev - Shortcodes - General - `[wcj_wholesale_price_table]` shortcode added.
|
134 |
+
* Fix - Shortcodes - Orders - `[wcj_order_items_table]` - `item_key` column - `maybe_unserialize` added (this fixes displaying file type product input fields).
|
135 |
+
* Dev - Shortcodes - Orders - `[wcj_order_total_fees_tax]` shortcode added.
|
136 |
+
* Dev - Shortcodes - Orders - `[wcj_order_total_fees_incl_tax]` shortcode added.
|
137 |
+
* Dev - Shortcodes - Orders - `[wcj_order_custom_field]` shortcode added.
|
138 |
+
* Fix - Shortcodes - Products - `[wcj_product_wholesale_price_table]` - Columns styles fixed (now works for more than three levels).
|
139 |
+
* Fix - Shortcodes - Products - `[wcj_product_wholesale_price_table]` - Fix for variable products with same min and max prices.
|
140 |
+
* Dev - Shortcodes - Products - `[wcj_product_wholesale_price_table]` - `add_price_row` shortcode parameter added.
|
141 |
+
* Fix - Shortcodes - Products - Fixed for variable products if min and max are equal (in `[wcj_product_price]` shortcode).
|
142 |
+
* Dev - Shortcodes - Products - Now accepting *product variation* id as `product_id` attribute.
|
143 |
+
* Dev - Shortcodes - Products - Variable products support added to `[wcj_product_price_excluding_tax]` and `[wcj_product_price_including_tax]` shortcodes.
|
144 |
+
* Fix - PRICES & CURRENCIES - Multicurrency - Shipping (taxable) calculation fixed.
|
145 |
+
* Dev - PRICES & CURRENCIES - Multicurrency Product Base Price - Initial module release.
|
146 |
+
* Dev - PRICES & CURRENCIES - Product Open Pricing (Name Your Price) - Initial module release.
|
147 |
+
* Fix - PRICES & CURRENCIES - Wholesale Price - Bug with "PayPal Express Checkout" fixed.
|
148 |
+
* Dev - PRODUCTS - Product Add to Cart - Add to Cart Variable Product - "Display Radio Buttons Instead of Drop Box" option added.
|
149 |
+
* Dev - PRODUCTS - Product Cost Price - Custom Price Fields options added.
|
150 |
+
* Dev - PRODUCTS - Product Info V2 - Single product page add to cart hooks added.
|
151 |
+
* Dev - PRODUCTS - Product Tabs - "Use Visual Editor" option added.
|
152 |
+
* Dev - PRODUCTS - SKU - In variable products now counting *all* variations instead of only *available*.
|
153 |
+
* Dev - CART & CHECKOUT - Checkout Custom Fields - "Conditional visibility by selected product (in cart)" option added.
|
154 |
+
* Dev - PAYMENT GATEWAYS - Custom Gateways - "Admin Title Custom Gateway" options added.
|
155 |
+
* Fix - PAYMENT GATEWAYS - Gateways Currency - Shipping conversion added.
|
156 |
+
* Dev - SHIPPING & ORDERS - Shipping - "Message on Free Shipping Reached" option added.
|
157 |
+
* Dev - SHIPPING & ORDERS - Shipping - Custom shipping added.
|
158 |
+
* Dev - PDF INVOICING & PACKING SLIPS - Styling - Three Thai fonts added.
|
159 |
+
* Dev - EMAILS & MISC. - General - Advanced Options - "Disable Saving PDFs in PHP directory for temporary files" option added.
|
160 |
+
* Dev - EMAILS & MISC. - General - "Export Customers" tool added.
|
161 |
+
* Dev - EMAILS & MISC. - General - "Export Customers" tool renamed to "Export Customers from Orders".
|
162 |
+
* Dev - EMAILS & MISC. - General - "Export Orders" tool added.
|
163 |
+
* Dev - EMAILS & MISC. - Reports - Monthly Sales - `set_time_limit` increased. `show_rates` added.
|
164 |
+
* Dev - EMAILS & MISC. - Reports - Monthly Sales - "Average / Day" row added.
|
165 |
+
* Fix - EMAILS & MISC. - Emails - Custom Emails - Custom statuses added to custom emails actions.
|
166 |
+
* Dev - EMAILS & MISC. - Emails - Custom Emails - Shortcodes can now be used in templates.
|
167 |
+
* Dev - EMAILS & MISC. - Emails - Custom Emails - "Admin Title Custom Email" options added.
|
168 |
+
* Tweak - PRICES & CURRENCIES - Currencies - Documentation link added.
|
169 |
+
* Tweak - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Documentation link added. "Currency Switcher" added to the module name.
|
170 |
+
* Tweak - PRICES & CURRENCIES - Prices and Currencies by Country - Documentation link added. Reset button added. "Countries Selection" default set to "Chosen select".
|
171 |
+
* Tweak - PRICES & CURRENCIES - Wholesale Price - Documentation link added.
|
172 |
+
* Tweak - BUTTON & PRICE LABELS - Add to Cart Labels - Metabox title renamed.
|
173 |
+
* Tweak - BUTTON & PRICE LABELS - Custom Price Labels - Metabox title renamed.
|
174 |
+
* Tweak - BUTTON & PRICE LABELS - More Button Labels - Documentation link added. Reset button added.
|
175 |
+
* Tweak - PRODUCTS - Crowdfunding - Documentation link added.
|
176 |
+
* Tweak - PRODUCTS - Product Add to Cart - Documentation link added. Reset button added.
|
177 |
+
* Tweak - PRODUCTS - Product Images - Documentation link added. Reset button added.
|
178 |
+
* Tweak - PRODUCTS - Product Input Fields - Documentation link added.
|
179 |
+
* Tweak - PRODUCTS - Product Input Fields - Metabox title renamed.
|
180 |
+
* Tweak - PRODUCTS - Product Listings - Documentation link added.
|
181 |
+
* Tweak - PRODUCTS - Product Tabs - Documentation link added.
|
182 |
+
* Tweak - PRODUCTS - Related Products - Documentation link added. Reset button added.
|
183 |
+
* Tweak - PRODUCTS - SKU - Documentation link added.
|
184 |
+
* Tweak - PRODUCTS - Sorting - Documentation link added. Reset button added.
|
185 |
+
* Tweak - CART & CHECKOUT - Checkout Files Upload - Documentation link added.
|
186 |
+
* Tweak - PAYMENT GATEWAYS - Custom Gateways - Documentation link added. Reset button added.
|
187 |
+
* Tweak - SHIPPING & ORDERS - Address Formats - Documentation link added. Reset button added.
|
188 |
+
* Tweak - SHIPPING & ORDERS - Shipping - Documentation link added.
|
189 |
+
|
190 |
= 2.4.7 - 19/04/2016 =
|
191 |
* Dev - Fixing plugin's performance issue - Version (`booster_for_woocommerce_version`) parameter added.
|
192 |
* Dev - `source` parameter added to documentation link (module and dashboard).
|
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 {
|
@@ -32,7 +32,7 @@ final class WC_Jetpack {
|
|
32 |
* @var string
|
33 |
* @since 2.4.7
|
34 |
*/
|
35 |
-
public $version = '2.4.
|
36 |
|
37 |
/**
|
38 |
* @var WC_Jetpack The single instance of the class
|
@@ -338,7 +338,7 @@ final class WC_Jetpack {
|
|
338 |
/**
|
339 |
* Include required core files used in admin and on the frontend.
|
340 |
*
|
341 |
-
* @version 2.4.
|
342 |
*/
|
343 |
private function includes() {
|
344 |
|
@@ -359,6 +359,7 @@ final class WC_Jetpack {
|
|
359 |
|
360 |
// Widgets
|
361 |
include_once( 'includes/widgets/class-wcj-widget-multicurrency.php' );
|
|
|
362 |
include_once( 'includes/widgets/class-wcj-widget-left-to-free-shipping.php' );
|
363 |
|
364 |
// Abstracts
|
@@ -403,7 +404,7 @@ final class WC_Jetpack {
|
|
403 |
/**
|
404 |
* Include modules and submodules
|
405 |
*
|
406 |
-
* @version 2.4.
|
407 |
*/
|
408 |
private function include_modules() {
|
409 |
$settings = array();
|
@@ -422,6 +423,7 @@ final class WC_Jetpack {
|
|
422 |
$settings[] = include_once( 'includes/class-wcj-purchase-data.php' );
|
423 |
$settings[] = include_once( 'includes/class-wcj-crowdfunding.php' );
|
424 |
$settings[] = include_once( 'includes/class-wcj-wholesale-price.php' );
|
|
|
425 |
$settings[] = include_once( 'includes/class-wcj-product-images.php' );
|
426 |
$settings[] = include_once( 'includes/class-wcj-add-to-cart.php' );
|
427 |
$settings[] = include_once( 'includes/class-wcj-more-button-labels.php' );
|
@@ -450,6 +452,7 @@ final class WC_Jetpack {
|
|
450 |
$settings[] = include_once( 'includes/class-wcj-emails.php' );
|
451 |
$settings[] = include_once( 'includes/class-wcj-currencies.php' );
|
452 |
$settings[] = include_once( 'includes/class-wcj-multicurrency.php' );
|
|
|
453 |
$settings[] = include_once( 'includes/class-wcj-currency-external-products.php' );
|
454 |
$settings[] = include_once( 'includes/class-wcj-price-by-country.php' );
|
455 |
$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.8
|
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.8
|
25 |
*/
|
26 |
|
27 |
final class WC_Jetpack {
|
32 |
* @var string
|
33 |
* @since 2.4.7
|
34 |
*/
|
35 |
+
public $version = '2.4.8';
|
36 |
|
37 |
/**
|
38 |
* @var WC_Jetpack The single instance of the class
|
338 |
/**
|
339 |
* Include required core files used in admin and on the frontend.
|
340 |
*
|
341 |
+
* @version 2.4.8
|
342 |
*/
|
343 |
private function includes() {
|
344 |
|
359 |
|
360 |
// Widgets
|
361 |
include_once( 'includes/widgets/class-wcj-widget-multicurrency.php' );
|
362 |
+
include_once( 'includes/widgets/class-wcj-widget-country-switcher.php' );
|
363 |
include_once( 'includes/widgets/class-wcj-widget-left-to-free-shipping.php' );
|
364 |
|
365 |
// Abstracts
|
404 |
/**
|
405 |
* Include modules and submodules
|
406 |
*
|
407 |
+
* @version 2.4.8
|
408 |
*/
|
409 |
private function include_modules() {
|
410 |
$settings = array();
|
423 |
$settings[] = include_once( 'includes/class-wcj-purchase-data.php' );
|
424 |
$settings[] = include_once( 'includes/class-wcj-crowdfunding.php' );
|
425 |
$settings[] = include_once( 'includes/class-wcj-wholesale-price.php' );
|
426 |
+
$settings[] = include_once( 'includes/class-wcj-product-open-pricing.php' );
|
427 |
$settings[] = include_once( 'includes/class-wcj-product-images.php' );
|
428 |
$settings[] = include_once( 'includes/class-wcj-add-to-cart.php' );
|
429 |
$settings[] = include_once( 'includes/class-wcj-more-button-labels.php' );
|
452 |
$settings[] = include_once( 'includes/class-wcj-emails.php' );
|
453 |
$settings[] = include_once( 'includes/class-wcj-currencies.php' );
|
454 |
$settings[] = include_once( 'includes/class-wcj-multicurrency.php' );
|
455 |
+
$settings[] = include_once( 'includes/class-wcj-multicurrency-product-base-price.php' );
|
456 |
$settings[] = include_once( 'includes/class-wcj-currency-external-products.php' );
|
457 |
$settings[] = include_once( 'includes/class-wcj-price-by-country.php' );
|
458 |
$settings[] = include_once( 'includes/class-wcj-currency-exchange-rates.php' );
|