Version Description
- 06/08/2014 =
- Feature Upgraded - Custom Price Labels - more visibility options added: hide for main variable product price or for each variation.
- Feature - Custom Payment Gateway (offline).
- Dev - Move needed functions from Plus to standard version.
- Fix - Custom Price Labels - Bug with main enable/disable checkbox, fixed.
- Fix - Checkout - Bug with default values, fixed.
- Dev - Enable/disable checkbox added to Add to cart feature.
- Dev - Function wcj_get_option removed.
Download this release
Release Info
Developer | algoritmika |
Plugin | Booster for WooCommerce |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- includes/class-wc-gateway-wcj-custom.php +133 -0
- includes/class-wcj-add-to-cart.php +46 -6
- includes/class-wcj-call-for-price.php +17 -2
- includes/class-wcj-cart.php +2 -2
- includes/class-wcj-checkout.php +8 -3
- includes/class-wcj-currencies.php +330 -330
- includes/class-wcj-emails.php +1 -1
- includes/class-wcj-orders.php +15 -3
- includes/class-wcj-pdf-invoices.php +14 -22
- includes/class-wcj-price-labels.php +114 -61
- includes/class-wcj-product-info.php +3 -3
- includes/class-wcj-sorting.php +2 -2
- readme.txt +16 -6
- woocommerce-jetpack.php +10 -26
includes/class-wc-gateway-wcj-custom.php
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* class WC_Gateway_WCJ_Custom
|
4 |
+
*/
|
5 |
+
add_action( 'plugins_loaded', 'init_wcj_custom_gateway_class' );
|
6 |
+
|
7 |
+
function init_wcj_custom_gateway_class() {
|
8 |
+
|
9 |
+
class WC_Gateway_WCJ_Custom extends WC_Payment_Gateway {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Constructor.
|
13 |
+
*/
|
14 |
+
public function __construct() {
|
15 |
+
|
16 |
+
$this->id = 'jetpack_custom';
|
17 |
+
//$this->icon = ''; //If you want to show an image next to the gateway�s name on the frontend, enter a URL to an image.
|
18 |
+
$this->has_fields = false;
|
19 |
+
$this->method_title = __( 'Custom', 'woocommerce-jetpack' );
|
20 |
+
$this->method_description = __( 'WooCommerce Jetpack: Custom Payment Gateway', 'woocommerce-jetpack' );
|
21 |
+
|
22 |
+
// Load the settings.
|
23 |
+
$this->init_form_fields();
|
24 |
+
$this->init_settings();
|
25 |
+
|
26 |
+
// Define user set variables
|
27 |
+
$this->title = $this->get_option( 'title' );
|
28 |
+
$this->description = $this->get_option( 'description' );
|
29 |
+
$this->instructions = $this->get_option( 'instructions', $this->description );
|
30 |
+
|
31 |
+
// Actions
|
32 |
+
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
|
33 |
+
add_action( 'woocommerce_thankyou_wcj_custom', array( $this, 'thankyou_page' ) );
|
34 |
+
|
35 |
+
// Customer Emails
|
36 |
+
add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Initialise Gateway Settings Form Fields
|
41 |
+
*/
|
42 |
+
public function init_form_fields() {
|
43 |
+
|
44 |
+
$this->form_fields = array(
|
45 |
+
'enabled' => array(
|
46 |
+
'title' => __( 'Enable/Disable', 'woocommerce' ),
|
47 |
+
'type' => 'checkbox',
|
48 |
+
'label' => __( 'Enable Custom Payment', 'woocommerce' ),
|
49 |
+
'default' => 'no'
|
50 |
+
),
|
51 |
+
'title' => array(
|
52 |
+
'title' => __( 'Title', 'woocommerce' ),
|
53 |
+
'type' => 'text',
|
54 |
+
'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
|
55 |
+
'default' => __( 'Custom Payment', 'woocommerce' ),
|
56 |
+
'desc_tip' => true,
|
57 |
+
),
|
58 |
+
'description' => array(
|
59 |
+
'title' => __( 'Description', 'woocommerce' ),
|
60 |
+
'type' => 'textarea',
|
61 |
+
'description' => __( 'Payment method description that the customer will see on your checkout.', 'woocommerce' ),
|
62 |
+
'default' => __( 'Custom Payment Description.', 'woocommerce' ),
|
63 |
+
'desc_tip' => true,
|
64 |
+
),
|
65 |
+
'instructions' => array(
|
66 |
+
'title' => __( 'Instructions', 'woocommerce' ),
|
67 |
+
'type' => 'textarea',
|
68 |
+
'description' => __( 'Instructions that will be added to the thank you page and emails.', 'woocommerce' ),
|
69 |
+
'default' => '',
|
70 |
+
'desc_tip' => true,
|
71 |
+
),
|
72 |
+
);
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Output for the order received page.
|
78 |
+
*/
|
79 |
+
public function thankyou_page() {
|
80 |
+
if ( $this->instructions )
|
81 |
+
echo wpautop( wptexturize( $this->instructions ) );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Add content to the WC emails.
|
86 |
+
*
|
87 |
+
* @access public
|
88 |
+
* @param WC_Order $order
|
89 |
+
* @param bool $sent_to_admin
|
90 |
+
* @param bool $plain_text
|
91 |
+
*/
|
92 |
+
public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {
|
93 |
+
if ( $this->instructions && ! $sent_to_admin && 'jetpack_custom' === $order->payment_method && 'on-hold' === $order->status ) {
|
94 |
+
echo wpautop( wptexturize( $this->instructions ) ) . PHP_EOL;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Process the payment and return the result
|
100 |
+
*
|
101 |
+
* @param int $order_id
|
102 |
+
* @return array
|
103 |
+
*/
|
104 |
+
public function process_payment( $order_id ) {
|
105 |
+
|
106 |
+
$order = new WC_Order( $order_id );
|
107 |
+
|
108 |
+
// Mark as on-hold (we're awaiting the payment)
|
109 |
+
$order->update_status( 'on-hold', __( 'Awaiting payment', 'woocommerce' ) );
|
110 |
+
|
111 |
+
// Reduce stock levels
|
112 |
+
$order->reduce_order_stock();
|
113 |
+
|
114 |
+
// Remove cart
|
115 |
+
WC()->cart->empty_cart();
|
116 |
+
|
117 |
+
// Return thankyou redirect
|
118 |
+
return array(
|
119 |
+
'result' => 'success',
|
120 |
+
'redirect' => $this->get_return_url( $order )
|
121 |
+
);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
function add_wcj_custom_gateway_class( $methods ) {
|
128 |
+
|
129 |
+
$methods[] = 'WC_Gateway_WCJ_Custom';
|
130 |
+
return $methods;
|
131 |
+
}
|
132 |
+
add_filter( 'woocommerce_payment_gateways', 'add_wcj_custom_gateway_class' );
|
133 |
+
}
|
includes/class-wcj-add-to-cart.php
CHANGED
@@ -17,16 +17,18 @@ class WCJ_Add_to_cart {
|
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
|
20 |
-
// HOOKS
|
21 |
-
|
22 |
// Main hooks
|
23 |
if ( get_option( 'wcj_add_to_cart_enabled' ) == 'yes' ) {
|
24 |
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
|
28 |
if ( get_option( 'wcj_add_to_cart_redirect_enabled' ) == 'yes' )
|
29 |
add_action( 'add_to_cart_redirect', array( $this, 'redirect_to_url' ), 100 );
|
|
|
|
|
30 |
}
|
31 |
|
32 |
// Settings hooks
|
@@ -34,6 +36,34 @@ class WCJ_Add_to_cart {
|
|
34 |
add_filter( 'wcj_settings_add_to_cart', array( $this, 'get_settings' ), 100 );
|
35 |
add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
/**
|
39 |
* add_enabled_option.
|
@@ -113,13 +143,15 @@ class WCJ_Add_to_cart {
|
|
113 |
'id' => 'wcj_add_to_cart_enabled',
|
114 |
'default' => 'yes',
|
115 |
'type' => 'checkbox',
|
|
|
|
|
116 |
),
|
117 |
|
118 |
array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_options' ),
|
119 |
);
|
120 |
|
121 |
//ADD TO CART REDIRECT
|
122 |
-
$settings[] = array( 'title' => __( 'Add to Cart Redirect Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set any url to redirect to after successfully adding product to cart. Leave empty to redirect to checkout page.', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_redirect_options' );
|
123 |
|
124 |
$settings[] = array(
|
125 |
'title' => __( 'Redirect', 'woocommerce-jetpack' ),
|
@@ -140,9 +172,17 @@ class WCJ_Add_to_cart {
|
|
140 |
|
141 |
$settings[] = array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_redirect_options' );
|
142 |
|
143 |
-
//ADD TO CART TEXT
|
144 |
$settings[] = array( 'title' => __( 'Add to Cart Button Text Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => 'This sections lets you set text for add to cart button for various products types and various conditions.', 'id' => 'wcj_add_to_cart_text_options' );
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
$groups_by_product_type = array(
|
147 |
|
148 |
array(
|
17 |
*/
|
18 |
public function __construct() {
|
19 |
|
|
|
|
|
20 |
// Main hooks
|
21 |
if ( get_option( 'wcj_add_to_cart_enabled' ) == 'yes' ) {
|
22 |
|
23 |
+
if ( get_option( 'wcj_add_to_cart_text_enabled' ) == 'yes' ) {
|
24 |
+
add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'custom_add_to_cart_button_text' ), 100 );
|
25 |
+
add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'custom_add_to_cart_button_text' ), 100 );
|
26 |
+
}
|
27 |
|
28 |
if ( get_option( 'wcj_add_to_cart_redirect_enabled' ) == 'yes' )
|
29 |
add_action( 'add_to_cart_redirect', array( $this, 'redirect_to_url' ), 100 );
|
30 |
+
|
31 |
+
//add_action( 'admin_head', array( $this, 'hook_javascript' ) );
|
32 |
}
|
33 |
|
34 |
// Settings hooks
|
36 |
add_filter( 'wcj_settings_add_to_cart', array( $this, 'get_settings' ), 100 );
|
37 |
add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
|
38 |
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* hook_javascript.
|
42 |
+
*
|
43 |
+
function hook_javascript() {
|
44 |
+
|
45 |
+
//$output='<script> alert("Page is loading..."); </script>';
|
46 |
+
|
47 |
+
//echo $output;
|
48 |
+
|
49 |
+
?><script type="text/javascript">
|
50 |
+
function toggle_visibility( class_name, start_element ) {
|
51 |
+
|
52 |
+
var elements = document.getElementsByClassName( class_name );
|
53 |
+
|
54 |
+
for ( var i = start_element; i < elements.length; i++ ) {
|
55 |
+
|
56 |
+
var e = elements[i];
|
57 |
+
|
58 |
+
if ( ( e.style.display == '' ) || ( e.style.display == 'table' ) )
|
59 |
+
e.style.display = 'none';
|
60 |
+
else
|
61 |
+
e.style.display = 'table';
|
62 |
+
}
|
63 |
+
}
|
64 |
+
</script><?php
|
65 |
+
|
66 |
+
}
|
67 |
|
68 |
/**
|
69 |
* add_enabled_option.
|
143 |
'id' => 'wcj_add_to_cart_enabled',
|
144 |
'default' => 'yes',
|
145 |
'type' => 'checkbox',
|
146 |
+
/*'custom_attributes' =>
|
147 |
+
array( 'onclick' => "toggle_visibility('form-table',1);", ),*/
|
148 |
),
|
149 |
|
150 |
array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_options' ),
|
151 |
);
|
152 |
|
153 |
//ADD TO CART REDIRECT
|
154 |
+
$settings[] = array( 'title' => __( 'Add to Cart Redirect Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set any url to redirect to after successfully adding product to cart. Leave empty to redirect to checkout page (skipping the cart page).', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_redirect_options' );
|
155 |
|
156 |
$settings[] = array(
|
157 |
'title' => __( 'Redirect', 'woocommerce-jetpack' ),
|
172 |
|
173 |
$settings[] = array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_redirect_options' );
|
174 |
|
175 |
+
//ADD TO CART TEXT
|
176 |
$settings[] = array( 'title' => __( 'Add to Cart Button Text Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => 'This sections lets you set text for add to cart button for various products types and various conditions.', 'id' => 'wcj_add_to_cart_text_options' );
|
177 |
|
178 |
+
$settings[] = array(
|
179 |
+
'title' => __( 'Add to cart text', 'woocommerce-jetpack' ),
|
180 |
+
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
181 |
+
'id' => 'wcj_add_to_cart_text_enabled',
|
182 |
+
'default' => 'no',
|
183 |
+
'type' => 'checkbox',
|
184 |
+
);
|
185 |
+
|
186 |
$groups_by_product_type = array(
|
187 |
|
188 |
array(
|
includes/class-wcj-call-for-price.php
CHANGED
@@ -51,7 +51,7 @@ class WCJ_Call_For_Price {
|
|
51 |
*/
|
52 |
public function hide_sales_flash( $post, $product ) {
|
53 |
|
54 |
-
if ( get_option('wcj_call_for_price_hide_sale_sign') ===
|
55 |
|
56 |
$current_product = get_product( $product->ID );
|
57 |
if ( $current_product->get_price() == '' ) return false;
|
@@ -62,7 +62,7 @@ class WCJ_Call_For_Price {
|
|
62 |
|
63 |
/**
|
64 |
* on_empty_price.
|
65 |
-
|
66 |
public function on_empty_price( $price ) {
|
67 |
|
68 |
if ( ( get_option('wcj_call_for_price_show_on_single') == 'yes' ) && is_single() ) return $this->default_empty_price_text;
|
@@ -73,6 +73,21 @@ class WCJ_Call_For_Price {
|
|
73 |
return $price;
|
74 |
}
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
/**
|
77 |
* get_settings.
|
78 |
*/
|
51 |
*/
|
52 |
public function hide_sales_flash( $post, $product ) {
|
53 |
|
54 |
+
if ( get_option('wcj_call_for_price_hide_sale_sign') === 'yes' ) {
|
55 |
|
56 |
$current_product = get_product( $product->ID );
|
57 |
if ( $current_product->get_price() == '' ) return false;
|
62 |
|
63 |
/**
|
64 |
* on_empty_price.
|
65 |
+
*
|
66 |
public function on_empty_price( $price ) {
|
67 |
|
68 |
if ( ( get_option('wcj_call_for_price_show_on_single') == 'yes' ) && is_single() ) return $this->default_empty_price_text;
|
73 |
return $price;
|
74 |
}
|
75 |
|
76 |
+
/**
|
77 |
+
* On empty price.
|
78 |
+
*/
|
79 |
+
public function on_empty_price( $price ) {
|
80 |
+
|
81 |
+
$updated_price = get_option('wcj_call_for_price_text');
|
82 |
+
|
83 |
+
if ( ( get_option('wcj_call_for_price_show_on_single') == 'yes' ) && is_single() ) return apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, $updated_price );
|
84 |
+
if ( ( get_option('wcj_call_for_price_show_on_archive') == 'yes' ) && is_archive() ) return apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, $updated_price );
|
85 |
+
if ( ( get_option('wcj_call_for_price_show_on_home') == 'yes' ) && is_front_page() ) return apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, $updated_price );
|
86 |
+
|
87 |
+
// No changes
|
88 |
+
return $price;
|
89 |
+
}
|
90 |
+
|
91 |
/**
|
92 |
* get_settings.
|
93 |
*/
|
includes/class-wcj-cart.php
CHANGED
@@ -78,7 +78,7 @@ class WCJ_Cart {
|
|
78 |
*/
|
79 |
public function add_empty_cart_link() {
|
80 |
|
81 |
-
echo '<div style="' . apply_filters( '
|
82 |
}
|
83 |
|
84 |
/**
|
@@ -116,7 +116,7 @@ class WCJ_Cart {
|
|
116 |
array(
|
117 |
'title' => __( 'Cart', 'woocommerce-jetpack' ),
|
118 |
'desc' => __( 'Enable the Cart feature', 'woocommerce-jetpack' ),
|
119 |
-
'desc_tip' => __( 'Add empty cart button,
|
120 |
'id' => 'wcj_cart_enabled',
|
121 |
'default' => 'yes',
|
122 |
'type' => 'checkbox',
|
78 |
*/
|
79 |
public function add_empty_cart_link() {
|
80 |
|
81 |
+
echo '<div style="' . apply_filters( 'wcj_get_option_filter', 'float: right;', get_option( 'wcj_empty_cart_div_style' ) ) . '"><form action="" method="post"><input type="submit" class="button" name="empty_cart" value="' . apply_filters( 'wcj_get_option_filter', 'Empty Cart', get_option( 'wcj_empty_cart_text' ) ) . '"></form></div>';
|
82 |
}
|
83 |
|
84 |
/**
|
116 |
array(
|
117 |
'title' => __( 'Cart', 'woocommerce-jetpack' ),
|
118 |
'desc' => __( 'Enable the Cart feature', 'woocommerce-jetpack' ),
|
119 |
+
'desc_tip' => __( 'Add empty cart button, automatically add to cart on product visit.', 'woocommerce-jetpack' ),
|
120 |
'id' => 'wcj_cart_enabled',
|
121 |
'default' => 'yes',
|
122 |
'type' => 'checkbox',
|
includes/class-wcj-checkout.php
CHANGED
@@ -137,7 +137,7 @@ class WCJ_Checkout {
|
|
137 |
'desc' => __( 'Enable the Checkout feature', 'woocommerce-jetpack' ),
|
138 |
'desc_tip' => __( 'Customize checkout fields. Disable/enable fields, set required, change labels and/or placeholders.', 'woocommerce-jetpack' ),
|
139 |
'id' => 'wcj_checkout_enabled',
|
140 |
-
'default' => '
|
141 |
'type' => 'checkbox',
|
142 |
),
|
143 |
|
@@ -201,7 +201,8 @@ class WCJ_Checkout {
|
|
201 |
|
202 |
//$field_parts = explode( "_", $field, 2 );
|
203 |
|
204 |
-
$default_value = $default_values[$
|
|
|
205 |
//if ( $item_type == 'checkbox' ) $default_value = 'yes';
|
206 |
|
207 |
$item_title = $field;// . ' ' . $item_key;
|
@@ -215,7 +216,7 @@ class WCJ_Checkout {
|
|
215 |
//'title' => $item_title,
|
216 |
//'desc' => $item_id,//__( 'Enable the Checkout feature', 'woocommerce-jetpack' ),
|
217 |
'desc' => $item_key,
|
218 |
-
'desc_tip' => $item_desc_tip,
|
219 |
'id' => $item_id,
|
220 |
'default' => $default_value,
|
221 |
'type' => $item_type,
|
@@ -229,6 +230,10 @@ class WCJ_Checkout {
|
|
229 |
}
|
230 |
else if ( 'required' == $item_key ) $settings_to_add['checkboxgroup'] = 'end';
|
231 |
|
|
|
|
|
|
|
|
|
232 |
$settings[] = $settings_to_add;
|
233 |
}
|
234 |
}
|
137 |
'desc' => __( 'Enable the Checkout feature', 'woocommerce-jetpack' ),
|
138 |
'desc_tip' => __( 'Customize checkout fields. Disable/enable fields, set required, change labels and/or placeholders.', 'woocommerce-jetpack' ),
|
139 |
'id' => 'wcj_checkout_enabled',
|
140 |
+
'default' => 'no',
|
141 |
'type' => 'checkbox',
|
142 |
),
|
143 |
|
201 |
|
202 |
//$field_parts = explode( "_", $field, 2 );
|
203 |
|
204 |
+
$default_value = $default_values[$item_key];//'';
|
205 |
+
//echo '<pre>' . $item_key . ':' . $item_type . ':' . $default_value . '</pre>';
|
206 |
//if ( $item_type == 'checkbox' ) $default_value = 'yes';
|
207 |
|
208 |
$item_title = $field;// . ' ' . $item_key;
|
216 |
//'title' => $item_title,
|
217 |
//'desc' => $item_id,//__( 'Enable the Checkout feature', 'woocommerce-jetpack' ),
|
218 |
'desc' => $item_key,
|
219 |
+
'desc_tip' => $item_desc_tip,// . __( 'Default: ', 'woocommerce-jetpack' ) . $default_value,
|
220 |
'id' => $item_id,
|
221 |
'default' => $default_value,
|
222 |
'type' => $item_type,
|
230 |
}
|
231 |
else if ( 'required' == $item_key ) $settings_to_add['checkboxgroup'] = 'end';
|
232 |
|
233 |
+
//echo '<pre>';
|
234 |
+
//print_r( $settings_to_add );
|
235 |
+
//echo '</pre>';
|
236 |
+
|
237 |
$settings[] = $settings_to_add;
|
238 |
}
|
239 |
}
|
includes/class-wcj-currencies.php
CHANGED
@@ -15,337 +15,337 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
15 |
if ( ! class_exists( 'WCJ_Currencies' ) ) :
|
16 |
|
17 |
class WCJ_Currencies {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
public function __construct() {
|
20 |
|
21 |
-
$this->currencies_list = array(
|
22 |
-
"AFN" => "Afghan afghani",
|
23 |
-
"ALL" => "Albanian lek",
|
24 |
-
"DZD" => "Algerian dinar",
|
25 |
-
"AOA" => "Angolan kwanza",
|
26 |
-
"ARS" => "Argentine peso",
|
27 |
-
"AMD" => "Armenian dram",
|
28 |
-
"AWG" => "Aruban florin",
|
29 |
-
"AUD" => "Australian dollar",
|
30 |
-
"AZN" => "Azerbaijani manat",
|
31 |
-
"BSD" => "Bahamian dollar",
|
32 |
-
"BHD" => "Bahraini dinar",
|
33 |
-
"BDT" => "Bangladeshi taka",
|
34 |
-
"BBD" => "Barbadian dollar",
|
35 |
-
"BYR" => "Belarusian ruble",
|
36 |
-
"BZD" => "Belize dollar",
|
37 |
-
"BTN" => "Bhutanese ngultrum",
|
38 |
-
"BOB" => "Bolivian boliviano",
|
39 |
-
"BAM" => "Bosnia and Herzegovina konvertibilna marka",
|
40 |
-
"BWP" => "Botswana pula",
|
41 |
-
"BRL" => "Brazilian real",
|
42 |
-
"GBP" => "British pound",
|
43 |
-
"BND" => "Brunei dollar",
|
44 |
-
"BGN" => "Bulgarian lev",
|
45 |
-
"BIF" => "Burundi franc",
|
46 |
-
"KYD" => "Cayman Islands dollar",
|
47 |
-
"KHR" => "Cambodian riel",
|
48 |
-
"CAD" => "Canadian dollar",
|
49 |
-
"CVE" => "Cape Verdean escudo",
|
50 |
-
"XAF" => "Central African CFA franc",
|
51 |
-
"GQE" => "Central African CFA franc",
|
52 |
-
"XPF" => "CFP franc",
|
53 |
-
"CLP" => "Chilean peso",
|
54 |
-
"CNY" => "Chinese renminbi",
|
55 |
-
"COP" => "Colombian peso",
|
56 |
-
"KMF" => "Comorian franc",
|
57 |
-
"CDF" => "Congolese franc",
|
58 |
-
"CRC" => "Costa Rican colon",
|
59 |
-
"HRK" => "Croatian kuna",
|
60 |
-
"CUC" => "Cuban peso",
|
61 |
-
"CZK" => "Czech koruna",
|
62 |
-
"DKK" => "Danish krone",
|
63 |
-
"DJF" => "Djiboutian franc",
|
64 |
-
"DOP" => "Dominican peso",
|
65 |
-
"XCD" => "East Caribbean dollar",
|
66 |
-
"EGP" => "Egyptian pound",
|
67 |
-
"ERN" => "Eritrean nakfa",
|
68 |
-
"EEK" => "Estonian kroon",
|
69 |
-
"ETB" => "Ethiopian birr",
|
70 |
-
"EUR" => "European euro",
|
71 |
-
"FKP" => "Falkland Islands pound",
|
72 |
-
"FJD" => "Fijian dollar",
|
73 |
-
"GMD" => "Gambian dalasi",
|
74 |
-
"GEL" => "Georgian lari",
|
75 |
-
"GHS" => "Ghanaian cedi",
|
76 |
-
"GIP" => "Gibraltar pound",
|
77 |
-
"GTQ" => "Guatemalan quetzal",
|
78 |
-
"GNF" => "Guinean franc",
|
79 |
-
"GYD" => "Guyanese dollar",
|
80 |
-
"HTG" => "Haitian gourde",
|
81 |
-
"HNL" => "Honduran lempira",
|
82 |
-
"HKD" => "Hong Kong dollar",
|
83 |
-
"HUF" => "Hungarian forint",
|
84 |
-
"ISK" => "Icelandic króna",
|
85 |
-
"INR" => "Indian rupee",
|
86 |
-
"IDR" => "Indonesian rupiah",
|
87 |
-
"IRR" => "Iranian rial",
|
88 |
-
"IQD" => "Iraqi dinar",
|
89 |
-
"ILS" => "Israeli new sheqel",
|
90 |
-
"YER" => "Yemeni rial",
|
91 |
-
"JMD" => "Jamaican dollar",
|
92 |
-
"JPY" => "Japanese yen",
|
93 |
-
"JOD" => "Jordanian dinar",
|
94 |
-
"KZT" => "Kazakhstani tenge",
|
95 |
-
"KES" => "Kenyan shilling",
|
96 |
-
"KGS" => "Kyrgyzstani som",
|
97 |
-
"KWD" => "Kuwaiti dinar",
|
98 |
-
"LAK" => "Lao kip",
|
99 |
-
"LVL" => "Latvian lats",
|
100 |
-
"LBP" => "Lebanese lira",
|
101 |
-
"LSL" => "Lesotho loti",
|
102 |
-
"LRD" => "Liberian dollar",
|
103 |
-
"LYD" => "Libyan dinar",
|
104 |
-
"LTL" => "Lithuanian litas",
|
105 |
-
"MOP" => "Macanese pataca",
|
106 |
-
"MKD" => "Macedonian denar",
|
107 |
-
"MGA" => "Malagasy ariary",
|
108 |
-
"MYR" => "Malaysian ringgit",
|
109 |
-
"MWK" => "Malawian kwacha",
|
110 |
-
"MVR" => "Maldivian rufiyaa",
|
111 |
-
"MRO" => "Mauritanian ouguiya",
|
112 |
-
"MUR" => "Mauritian rupee",
|
113 |
-
"MXN" => "Mexican peso",
|
114 |
-
"MMK" => "Myanma kyat",
|
115 |
-
"MDL" => "Moldovan leu",
|
116 |
-
"MNT" => "Mongolian tugrik",
|
117 |
-
"MAD" => "Moroccan dirham",
|
118 |
-
"MZM" => "Mozambican metical",
|
119 |
-
"NAD" => "Namibian dollar",
|
120 |
-
"NPR" => "Nepalese rupee",
|
121 |
-
"ANG" => "Netherlands Antillean gulden",
|
122 |
-
"TWD" => "New Taiwan dollar",
|
123 |
-
"NZD" => "New Zealand dollar",
|
124 |
-
"NIO" => "Nicaraguan cordoba",
|
125 |
-
"NGN" => "Nigerian naira",
|
126 |
-
"KPW" => "North Korean won",
|
127 |
-
"NOK" => "Norwegian krone",
|
128 |
-
"OMR" => "Omani rial",
|
129 |
-
"TOP" => "Paanga",
|
130 |
-
"PKR" => "Pakistani rupee",
|
131 |
-
"PAB" => "Panamanian balboa",
|
132 |
-
"PGK" => "Papua New Guinean kina",
|
133 |
-
"PYG" => "Paraguayan guarani",
|
134 |
-
"PEN" => "Peruvian nuevo sol",
|
135 |
-
"PHP" => "Philippine peso",
|
136 |
-
"PLN" => "Polish zloty",
|
137 |
-
"QAR" => "Qatari riyal",
|
138 |
-
"RON" => "Romanian leu",
|
139 |
-
"RUB" => "Russian ruble",
|
140 |
-
"RWF" => "Rwandan franc",
|
141 |
-
"SHP" => "Saint Helena pound",
|
142 |
-
"WST" => "Samoan tala",
|
143 |
-
"STD" => "Sao Tome and Principe dobra",
|
144 |
-
"SAR" => "Saudi riyal",
|
145 |
-
"SCR" => "Seychellois rupee",
|
146 |
-
"RSD" => "Serbian dinar",
|
147 |
-
"SLL" => "Sierra Leonean leone",
|
148 |
-
"SGD" => "Singapore dollar",
|
149 |
-
"SYP" => "Syrian pound",
|
150 |
-
"SKK" => "Slovak koruna",
|
151 |
-
"SBD" => "Solomon Islands dollar",
|
152 |
-
"SOS" => "Somali shilling",
|
153 |
-
"ZAR" => "South African rand",
|
154 |
-
"KRW" => "South Korean won",
|
155 |
-
"XDR" => "Special Drawing Rights",
|
156 |
-
"LKR" => "Sri Lankan rupee",
|
157 |
-
"SDG" => "Sudanese pound",
|
158 |
-
"SRD" => "Surinamese dollar",
|
159 |
-
"SZL" => "Swazi lilangeni",
|
160 |
-
"SEK" => "Swedish krona",
|
161 |
-
"CHF" => "Swiss franc",
|
162 |
-
"TJS" => "Tajikistani somoni",
|
163 |
-
"TZS" => "Tanzanian shilling",
|
164 |
-
"THB" => "Thai baht",
|
165 |
-
"TTD" => "Trinidad and Tobago dollar",
|
166 |
-
"TND" => "Tunisian dinar",
|
167 |
-
"TRY" => "Turkish new lira",
|
168 |
-
"TMM" => "Turkmen manat",
|
169 |
-
"AED" => "UAE dirham",
|
170 |
-
"UGX" => "Ugandan shilling",
|
171 |
-
"UAH" => "Ukrainian hryvnia",
|
172 |
-
"USD" => "United States dollar",
|
173 |
-
"UYU" => "Uruguayan peso",
|
174 |
-
"UZS" => "Uzbekistani som",
|
175 |
-
"VUV" => "Vanuatu vatu",
|
176 |
-
"VEB" => "Venezuelan bolivar",
|
177 |
-
"VND" => "Vietnamese dong",
|
178 |
-
"XOF" => "West African CFA franc",
|
179 |
-
"ZMK" => "Zambian kwacha",
|
180 |
-
"ZWD" => "Zimbabwean dollar",
|
181 |
-
|
182 |
-
"RMB" => "Chinese Yuan",
|
183 |
-
);
|
184 |
-
|
185 |
-
$this->currencies_symbols_list = array(
|
186 |
-
"AFN" => "AFN",
|
187 |
-
"ALL" => "ALL",
|
188 |
-
"DZD" => "DZD",
|
189 |
-
"AOA" => "AOA",
|
190 |
-
"ARS" => "ARS",
|
191 |
-
"AMD" => "AMD",
|
192 |
-
"AWG" => "AWG",
|
193 |
-
"AUD" => "$",
|
194 |
-
"AZN" => "AZN",
|
195 |
-
"BSD" => "BSD",
|
196 |
-
"BHD" => "BHD",
|
197 |
-
"BDT" => "BDT",
|
198 |
-
"BBD" => "BBD",
|
199 |
-
"BYR" => "BYR",
|
200 |
-
"BZD" => "BZD",
|
201 |
-
"BTN" => "BTN",
|
202 |
-
"BOB" => "BOB",
|
203 |
-
"BAM" => "BAM",
|
204 |
-
"BWP" => "BWP",
|
205 |
-
"BRL" => "R$",
|
206 |
-
"GBP" => "£",
|
207 |
-
"BND" => "BND",
|
208 |
-
"BGN" => "BGN",
|
209 |
-
"BIF" => "BIF",
|
210 |
-
"KYD" => "KYD",
|
211 |
-
"KHR" => "KHR",
|
212 |
-
"CAD" => "CAD",
|
213 |
-
"CVE" => "CVE",
|
214 |
-
"XAF" => "XAF",
|
215 |
-
"GQE" => "GQE",
|
216 |
-
"XPF" => "XPF",
|
217 |
-
"CLP" => "CLP",
|
218 |
-
"CNY" => "¥",
|
219 |
-
"COP" => "COP",
|
220 |
-
"KMF" => "KMF",
|
221 |
-
"CDF" => "CDF",
|
222 |
-
"CRC" => "CRC",
|
223 |
-
"HRK" => "HRK",
|
224 |
-
"CUC" => "CUC",
|
225 |
-
"CZK" => "Kč",
|
226 |
-
"DKK" => "kr",
|
227 |
-
"DJF" => "DJF",
|
228 |
-
"DOP" => "DOP",
|
229 |
-
"XCD" => "XCD",
|
230 |
-
"EGP" => "EGP",
|
231 |
-
"ERN" => "ERN",
|
232 |
-
"EEK" => "EEK",
|
233 |
-
"ETB" => "ETB",
|
234 |
-
"EUR" => "€",
|
235 |
-
"FKP" => "FKP",
|
236 |
-
"FJD" => "FJD",
|
237 |
-
"GMD" => "GMD",
|
238 |
-
"GEL" => "GEL",
|
239 |
-
"GHS" => "GHS",
|
240 |
-
"GIP" => "GIP",
|
241 |
-
"GTQ" => "GTQ",
|
242 |
-
"GNF" => "GNF",
|
243 |
-
"GYD" => "GYD",
|
244 |
-
"HTG" => "HTG",
|
245 |
-
"HNL" => "HNL",
|
246 |
-
"HKD" => "$",
|
247 |
-
"HUF" => "Ft",
|
248 |
-
"ISK" => "ISK",
|
249 |
-
"INR" => "₹",
|
250 |
-
"IDR" => "Rp",
|
251 |
-
"IRR" => "IRR",
|
252 |
-
"IQD" => "IQD",
|
253 |
-
"ILS" => "₪",
|
254 |
-
"YER" => "YER",
|
255 |
-
"JMD" => "JMD",
|
256 |
-
"JPY" => "¥",
|
257 |
-
"JOD" => "JOD",
|
258 |
-
"KZT" => "KZT",
|
259 |
-
"KES" => "KES",
|
260 |
-
"KGS" => "KGS",
|
261 |
-
"KWD" => "KWD",
|
262 |
-
"LAK" => "LAK",
|
263 |
-
"LVL" => "LVL",
|
264 |
-
"LBP" => "LBP",
|
265 |
-
"LSL" => "LSL",
|
266 |
-
"LRD" => "LRD",
|
267 |
-
"LYD" => "LYD",
|
268 |
-
"LTL" => "LTL",
|
269 |
-
"MOP" => "MOP",
|
270 |
-
"MKD" => "MKD",
|
271 |
-
"MGA" => "MGA",
|
272 |
-
"MYR" => "RM",
|
273 |
-
"MWK" => "MWK",
|
274 |
-
"MVR" => "MVR",
|
275 |
-
"MRO" => "MRO",
|
276 |
-
"MUR" => "MUR",
|
277 |
-
"MXN" => "$",
|
278 |
-
"MMK" => "MMK",
|
279 |
-
"MDL" => "MDL",
|
280 |
-
"MNT" => "MNT",
|
281 |
-
"MAD" => "MAD",
|
282 |
-
"MZM" => "MZM",
|
283 |
-
"NAD" => "NAD",
|
284 |
-
"NPR" => "NPR",
|
285 |
-
"ANG" => "ANG",
|
286 |
-
"TWD" => "NT$",
|
287 |
-
"NZD" => "$",
|
288 |
-
"NIO" => "NIO",
|
289 |
-
"NGN" => "NGN",
|
290 |
-
"KPW" => "KPW",
|
291 |
-
"NOK" => "kr",
|
292 |
-
"OMR" => "OMR",
|
293 |
-
"TOP" => "TOP",
|
294 |
-
"PKR" => "PKR",
|
295 |
-
"PAB" => "PAB",
|
296 |
-
"PGK" => "PGK",
|
297 |
-
"PYG" => "PYG",
|
298 |
-
"PEN" => "PEN",
|
299 |
-
"PHP" => "₱",
|
300 |
-
"PLN" => "zł",
|
301 |
-
"QAR" => "QAR",
|
302 |
-
"RON" => "lei",
|
303 |
-
"RUB" => "RUB",
|
304 |
-
"RWF" => "RWF",
|
305 |
-
"SHP" => "SHP",
|
306 |
-
"WST" => "WST",
|
307 |
-
"STD" => "STD",
|
308 |
-
"SAR" => "SAR",
|
309 |
-
"SCR" => "SCR",
|
310 |
-
"RSD" => "RSD",
|
311 |
-
"SLL" => "SLL",
|
312 |
-
"SGD" => "$",
|
313 |
-
"SYP" => "SYP",
|
314 |
-
"SKK" => "SKK",
|
315 |
-
"SBD" => "SBD",
|
316 |
-
"SOS" => "SOS",
|
317 |
-
"ZAR" => "R",
|
318 |
-
"KRW" => "₩",
|
319 |
-
"XDR" => "XDR",
|
320 |
-
"LKR" => "LKR",
|
321 |
-
"SDG" => "SDG",
|
322 |
-
"SRD" => "SRD",
|
323 |
-
"SZL" => "SZL",
|
324 |
-
"SEK" => "kr",
|
325 |
-
"CHF" => "CHF",
|
326 |
-
"TJS" => "TJS",
|
327 |
-
"TZS" => "TZS",
|
328 |
-
"THB" => "฿",
|
329 |
-
"TTD" => "TTD",
|
330 |
-
"TND" => "TND",
|
331 |
-
"TRY" => "TL",
|
332 |
-
"TMM" => "TMM",
|
333 |
-
"AED" => "AED",
|
334 |
-
"UGX" => "UGX",
|
335 |
-
"UAH" => "UAH",
|
336 |
-
"USD" => "$",
|
337 |
-
"UYU" => "UYU",
|
338 |
-
"UZS" => "UZS",
|
339 |
-
"VUV" => "VUV",
|
340 |
-
"VEB" => "VEB",
|
341 |
-
"VND" => "VND",
|
342 |
-
"XOF" => "XOF",
|
343 |
-
"ZMK" => "ZMK",
|
344 |
-
"ZWD" => "ZWD",
|
345 |
-
|
346 |
-
"RMB" => "¥",
|
347 |
-
);
|
348 |
-
|
349 |
//$this->items = array();
|
350 |
|
351 |
// Hooks
|
@@ -442,7 +442,7 @@ class WCJ_Currencies {
|
|
442 |
|
443 |
function settings_section( $sections ) {
|
444 |
|
445 |
-
$sections['currencies'] = 'Currencies';
|
446 |
|
447 |
return $sections;
|
448 |
}
|
@@ -459,7 +459,7 @@ class WCJ_Currencies {
|
|
459 |
|
460 |
function add_currency_symbol( $currency_symbol, $currency ) {
|
461 |
|
462 |
-
return $this->currencies_symbols_list[$currency]
|
463 |
}
|
464 |
|
465 |
/*public function check_wooallcurpro_fields($input) {
|
15 |
if ( ! class_exists( 'WCJ_Currencies' ) ) :
|
16 |
|
17 |
class WCJ_Currencies {
|
18 |
+
|
19 |
+
public $currencies_list = array(
|
20 |
+
"AFN" => "Afghan afghani",
|
21 |
+
"ALL" => "Albanian lek",
|
22 |
+
"DZD" => "Algerian dinar",
|
23 |
+
"AOA" => "Angolan kwanza",
|
24 |
+
"ARS" => "Argentine peso",
|
25 |
+
"AMD" => "Armenian dram",
|
26 |
+
"AWG" => "Aruban florin",
|
27 |
+
"AUD" => "Australian dollar",
|
28 |
+
"AZN" => "Azerbaijani manat",
|
29 |
+
"BSD" => "Bahamian dollar",
|
30 |
+
"BHD" => "Bahraini dinar",
|
31 |
+
"BDT" => "Bangladeshi taka",
|
32 |
+
"BBD" => "Barbadian dollar",
|
33 |
+
"BYR" => "Belarusian ruble",
|
34 |
+
"BZD" => "Belize dollar",
|
35 |
+
"BTN" => "Bhutanese ngultrum",
|
36 |
+
"BOB" => "Bolivian boliviano",
|
37 |
+
"BAM" => "Bosnia and Herzegovina konvertibilna marka",
|
38 |
+
"BWP" => "Botswana pula",
|
39 |
+
"BRL" => "Brazilian real",
|
40 |
+
"GBP" => "British pound",
|
41 |
+
"BND" => "Brunei dollar",
|
42 |
+
"BGN" => "Bulgarian lev",
|
43 |
+
"BIF" => "Burundi franc",
|
44 |
+
"KYD" => "Cayman Islands dollar",
|
45 |
+
"KHR" => "Cambodian riel",
|
46 |
+
"CAD" => "Canadian dollar",
|
47 |
+
"CVE" => "Cape Verdean escudo",
|
48 |
+
"XAF" => "Central African CFA franc",
|
49 |
+
"GQE" => "Central African CFA franc",
|
50 |
+
"XPF" => "CFP franc",
|
51 |
+
"CLP" => "Chilean peso",
|
52 |
+
"CNY" => "Chinese renminbi",
|
53 |
+
"COP" => "Colombian peso",
|
54 |
+
"KMF" => "Comorian franc",
|
55 |
+
"CDF" => "Congolese franc",
|
56 |
+
"CRC" => "Costa Rican colon",
|
57 |
+
"HRK" => "Croatian kuna",
|
58 |
+
"CUC" => "Cuban peso",
|
59 |
+
"CZK" => "Czech koruna",
|
60 |
+
"DKK" => "Danish krone",
|
61 |
+
"DJF" => "Djiboutian franc",
|
62 |
+
"DOP" => "Dominican peso",
|
63 |
+
"XCD" => "East Caribbean dollar",
|
64 |
+
"EGP" => "Egyptian pound",
|
65 |
+
"ERN" => "Eritrean nakfa",
|
66 |
+
"EEK" => "Estonian kroon",
|
67 |
+
"ETB" => "Ethiopian birr",
|
68 |
+
"EUR" => "European euro",
|
69 |
+
"FKP" => "Falkland Islands pound",
|
70 |
+
"FJD" => "Fijian dollar",
|
71 |
+
"GMD" => "Gambian dalasi",
|
72 |
+
"GEL" => "Georgian lari",
|
73 |
+
"GHS" => "Ghanaian cedi",
|
74 |
+
"GIP" => "Gibraltar pound",
|
75 |
+
"GTQ" => "Guatemalan quetzal",
|
76 |
+
"GNF" => "Guinean franc",
|
77 |
+
"GYD" => "Guyanese dollar",
|
78 |
+
"HTG" => "Haitian gourde",
|
79 |
+
"HNL" => "Honduran lempira",
|
80 |
+
"HKD" => "Hong Kong dollar",
|
81 |
+
"HUF" => "Hungarian forint",
|
82 |
+
"ISK" => "Icelandic króna",
|
83 |
+
"INR" => "Indian rupee",
|
84 |
+
"IDR" => "Indonesian rupiah",
|
85 |
+
"IRR" => "Iranian rial",
|
86 |
+
"IQD" => "Iraqi dinar",
|
87 |
+
"ILS" => "Israeli new sheqel",
|
88 |
+
"YER" => "Yemeni rial",
|
89 |
+
"JMD" => "Jamaican dollar",
|
90 |
+
"JPY" => "Japanese yen",
|
91 |
+
"JOD" => "Jordanian dinar",
|
92 |
+
"KZT" => "Kazakhstani tenge",
|
93 |
+
"KES" => "Kenyan shilling",
|
94 |
+
"KGS" => "Kyrgyzstani som",
|
95 |
+
"KWD" => "Kuwaiti dinar",
|
96 |
+
"LAK" => "Lao kip",
|
97 |
+
"LVL" => "Latvian lats",
|
98 |
+
"LBP" => "Lebanese lira",
|
99 |
+
"LSL" => "Lesotho loti",
|
100 |
+
"LRD" => "Liberian dollar",
|
101 |
+
"LYD" => "Libyan dinar",
|
102 |
+
"LTL" => "Lithuanian litas",
|
103 |
+
"MOP" => "Macanese pataca",
|
104 |
+
"MKD" => "Macedonian denar",
|
105 |
+
"MGA" => "Malagasy ariary",
|
106 |
+
"MYR" => "Malaysian ringgit",
|
107 |
+
"MWK" => "Malawian kwacha",
|
108 |
+
"MVR" => "Maldivian rufiyaa",
|
109 |
+
"MRO" => "Mauritanian ouguiya",
|
110 |
+
"MUR" => "Mauritian rupee",
|
111 |
+
"MXN" => "Mexican peso",
|
112 |
+
"MMK" => "Myanma kyat",
|
113 |
+
"MDL" => "Moldovan leu",
|
114 |
+
"MNT" => "Mongolian tugrik",
|
115 |
+
"MAD" => "Moroccan dirham",
|
116 |
+
"MZM" => "Mozambican metical",
|
117 |
+
"NAD" => "Namibian dollar",
|
118 |
+
"NPR" => "Nepalese rupee",
|
119 |
+
"ANG" => "Netherlands Antillean gulden",
|
120 |
+
"TWD" => "New Taiwan dollar",
|
121 |
+
"NZD" => "New Zealand dollar",
|
122 |
+
"NIO" => "Nicaraguan cordoba",
|
123 |
+
"NGN" => "Nigerian naira",
|
124 |
+
"KPW" => "North Korean won",
|
125 |
+
"NOK" => "Norwegian krone",
|
126 |
+
"OMR" => "Omani rial",
|
127 |
+
"TOP" => "Paanga",
|
128 |
+
"PKR" => "Pakistani rupee",
|
129 |
+
"PAB" => "Panamanian balboa",
|
130 |
+
"PGK" => "Papua New Guinean kina",
|
131 |
+
"PYG" => "Paraguayan guarani",
|
132 |
+
"PEN" => "Peruvian nuevo sol",
|
133 |
+
"PHP" => "Philippine peso",
|
134 |
+
"PLN" => "Polish zloty",
|
135 |
+
"QAR" => "Qatari riyal",
|
136 |
+
"RON" => "Romanian leu",
|
137 |
+
"RUB" => "Russian ruble",
|
138 |
+
"RWF" => "Rwandan franc",
|
139 |
+
"SHP" => "Saint Helena pound",
|
140 |
+
"WST" => "Samoan tala",
|
141 |
+
"STD" => "Sao Tome and Principe dobra",
|
142 |
+
"SAR" => "Saudi riyal",
|
143 |
+
"SCR" => "Seychellois rupee",
|
144 |
+
"RSD" => "Serbian dinar",
|
145 |
+
"SLL" => "Sierra Leonean leone",
|
146 |
+
"SGD" => "Singapore dollar",
|
147 |
+
"SYP" => "Syrian pound",
|
148 |
+
"SKK" => "Slovak koruna",
|
149 |
+
"SBD" => "Solomon Islands dollar",
|
150 |
+
"SOS" => "Somali shilling",
|
151 |
+
"ZAR" => "South African rand",
|
152 |
+
"KRW" => "South Korean won",
|
153 |
+
"XDR" => "Special Drawing Rights",
|
154 |
+
"LKR" => "Sri Lankan rupee",
|
155 |
+
"SDG" => "Sudanese pound",
|
156 |
+
"SRD" => "Surinamese dollar",
|
157 |
+
"SZL" => "Swazi lilangeni",
|
158 |
+
"SEK" => "Swedish krona",
|
159 |
+
"CHF" => "Swiss franc",
|
160 |
+
"TJS" => "Tajikistani somoni",
|
161 |
+
"TZS" => "Tanzanian shilling",
|
162 |
+
"THB" => "Thai baht",
|
163 |
+
"TTD" => "Trinidad and Tobago dollar",
|
164 |
+
"TND" => "Tunisian dinar",
|
165 |
+
"TRY" => "Turkish new lira",
|
166 |
+
"TMM" => "Turkmen manat",
|
167 |
+
"AED" => "UAE dirham",
|
168 |
+
"UGX" => "Ugandan shilling",
|
169 |
+
"UAH" => "Ukrainian hryvnia",
|
170 |
+
"USD" => "United States dollar",
|
171 |
+
"UYU" => "Uruguayan peso",
|
172 |
+
"UZS" => "Uzbekistani som",
|
173 |
+
"VUV" => "Vanuatu vatu",
|
174 |
+
"VEF" => "Venezuelan bolivar",
|
175 |
+
"VND" => "Vietnamese dong",
|
176 |
+
"XOF" => "West African CFA franc",
|
177 |
+
"ZMK" => "Zambian kwacha",
|
178 |
+
"ZWD" => "Zimbabwean dollar",
|
179 |
+
|
180 |
+
"RMB" => "Chinese Yuan",
|
181 |
+
);
|
182 |
+
|
183 |
+
public $currencies_symbols_list = array(
|
184 |
+
"AFN" => "AFN",
|
185 |
+
"ALL" => "ALL",
|
186 |
+
"DZD" => "DZD",
|
187 |
+
"AOA" => "AOA",
|
188 |
+
"ARS" => "ARS",
|
189 |
+
"AMD" => "AMD",
|
190 |
+
"AWG" => "AWG",
|
191 |
+
"AUD" => "$",
|
192 |
+
"AZN" => "AZN",
|
193 |
+
"BSD" => "BSD",
|
194 |
+
"BHD" => "BHD",
|
195 |
+
"BDT" => "BDT",
|
196 |
+
"BBD" => "BBD",
|
197 |
+
"BYR" => "BYR",
|
198 |
+
"BZD" => "BZD",
|
199 |
+
"BTN" => "BTN",
|
200 |
+
"BOB" => "BOB",
|
201 |
+
"BAM" => "BAM",
|
202 |
+
"BWP" => "BWP",
|
203 |
+
"BRL" => "R$",
|
204 |
+
"GBP" => "£",
|
205 |
+
"BND" => "BND",
|
206 |
+
"BGN" => "BGN",
|
207 |
+
"BIF" => "BIF",
|
208 |
+
"KYD" => "KYD",
|
209 |
+
"KHR" => "KHR",
|
210 |
+
"CAD" => "CAD",
|
211 |
+
"CVE" => "CVE",
|
212 |
+
"XAF" => "XAF",
|
213 |
+
"GQE" => "GQE",
|
214 |
+
"XPF" => "XPF",
|
215 |
+
"CLP" => "CLP",
|
216 |
+
"CNY" => "¥",
|
217 |
+
"COP" => "COP",
|
218 |
+
"KMF" => "KMF",
|
219 |
+
"CDF" => "CDF",
|
220 |
+
"CRC" => "CRC",
|
221 |
+
"HRK" => "HRK",
|
222 |
+
"CUC" => "CUC",
|
223 |
+
"CZK" => "Kč",
|
224 |
+
"DKK" => "kr",
|
225 |
+
"DJF" => "DJF",
|
226 |
+
"DOP" => "DOP",
|
227 |
+
"XCD" => "XCD",
|
228 |
+
"EGP" => "EGP",
|
229 |
+
"ERN" => "ERN",
|
230 |
+
"EEK" => "EEK",
|
231 |
+
"ETB" => "ETB",
|
232 |
+
"EUR" => "€",
|
233 |
+
"FKP" => "FKP",
|
234 |
+
"FJD" => "FJD",
|
235 |
+
"GMD" => "GMD",
|
236 |
+
"GEL" => "GEL",
|
237 |
+
"GHS" => "GHS",
|
238 |
+
"GIP" => "GIP",
|
239 |
+
"GTQ" => "GTQ",
|
240 |
+
"GNF" => "GNF",
|
241 |
+
"GYD" => "GYD",
|
242 |
+
"HTG" => "HTG",
|
243 |
+
"HNL" => "HNL",
|
244 |
+
"HKD" => "$",
|
245 |
+
"HUF" => "Ft",
|
246 |
+
"ISK" => "ISK",
|
247 |
+
"INR" => "₹",
|
248 |
+
"IDR" => "Rp",
|
249 |
+
"IRR" => "IRR",
|
250 |
+
"IQD" => "IQD",
|
251 |
+
"ILS" => "₪",
|
252 |
+
"YER" => "YER",
|
253 |
+
"JMD" => "JMD",
|
254 |
+
"JPY" => "¥",
|
255 |
+
"JOD" => "JOD",
|
256 |
+
"KZT" => "KZT",
|
257 |
+
"KES" => "KES",
|
258 |
+
"KGS" => "KGS",
|
259 |
+
"KWD" => "KWD",
|
260 |
+
"LAK" => "LAK",
|
261 |
+
"LVL" => "LVL",
|
262 |
+
"LBP" => "LBP",
|
263 |
+
"LSL" => "LSL",
|
264 |
+
"LRD" => "LRD",
|
265 |
+
"LYD" => "LYD",
|
266 |
+
"LTL" => "LTL",
|
267 |
+
"MOP" => "MOP",
|
268 |
+
"MKD" => "MKD",
|
269 |
+
"MGA" => "MGA",
|
270 |
+
"MYR" => "RM",
|
271 |
+
"MWK" => "MWK",
|
272 |
+
"MVR" => "MVR",
|
273 |
+
"MRO" => "MRO",
|
274 |
+
"MUR" => "MUR",
|
275 |
+
"MXN" => "$",
|
276 |
+
"MMK" => "MMK",
|
277 |
+
"MDL" => "MDL",
|
278 |
+
"MNT" => "MNT",
|
279 |
+
"MAD" => "MAD",
|
280 |
+
"MZM" => "MZM",
|
281 |
+
"NAD" => "NAD",
|
282 |
+
"NPR" => "NPR",
|
283 |
+
"ANG" => "ANG",
|
284 |
+
"TWD" => "NT$",
|
285 |
+
"NZD" => "$",
|
286 |
+
"NIO" => "NIO",
|
287 |
+
"NGN" => "NGN",
|
288 |
+
"KPW" => "KPW",
|
289 |
+
"NOK" => "kr",
|
290 |
+
"OMR" => "OMR",
|
291 |
+
"TOP" => "TOP",
|
292 |
+
"PKR" => "PKR",
|
293 |
+
"PAB" => "PAB",
|
294 |
+
"PGK" => "PGK",
|
295 |
+
"PYG" => "PYG",
|
296 |
+
"PEN" => "PEN",
|
297 |
+
"PHP" => "₱",
|
298 |
+
"PLN" => "zł",
|
299 |
+
"QAR" => "QAR",
|
300 |
+
"RON" => "lei",
|
301 |
+
"RUB" => "RUB",
|
302 |
+
"RWF" => "RWF",
|
303 |
+
"SHP" => "SHP",
|
304 |
+
"WST" => "WST",
|
305 |
+
"STD" => "STD",
|
306 |
+
"SAR" => "SAR",
|
307 |
+
"SCR" => "SCR",
|
308 |
+
"RSD" => "RSD",
|
309 |
+
"SLL" => "SLL",
|
310 |
+
"SGD" => "$",
|
311 |
+
"SYP" => "SYP",
|
312 |
+
"SKK" => "SKK",
|
313 |
+
"SBD" => "SBD",
|
314 |
+
"SOS" => "SOS",
|
315 |
+
"ZAR" => "R",
|
316 |
+
"KRW" => "₩",
|
317 |
+
"XDR" => "XDR",
|
318 |
+
"LKR" => "LKR",
|
319 |
+
"SDG" => "SDG",
|
320 |
+
"SRD" => "SRD",
|
321 |
+
"SZL" => "SZL",
|
322 |
+
"SEK" => "kr",
|
323 |
+
"CHF" => "CHF",
|
324 |
+
"TJS" => "TJS",
|
325 |
+
"TZS" => "TZS",
|
326 |
+
"THB" => "฿",
|
327 |
+
"TTD" => "TTD",
|
328 |
+
"TND" => "TND",
|
329 |
+
"TRY" => "TL",
|
330 |
+
"TMM" => "TMM",
|
331 |
+
"AED" => "AED",
|
332 |
+
"UGX" => "UGX",
|
333 |
+
"UAH" => "UAH",
|
334 |
+
"USD" => "$",
|
335 |
+
"UYU" => "UYU",
|
336 |
+
"UZS" => "UZS",
|
337 |
+
"VUV" => "VUV",
|
338 |
+
"VEF" => "VEF",
|
339 |
+
"VND" => "VND",
|
340 |
+
"XOF" => "XOF",
|
341 |
+
"ZMK" => "ZMK",
|
342 |
+
"ZWD" => "ZWD",
|
343 |
+
|
344 |
+
"RMB" => "¥",
|
345 |
+
);
|
346 |
|
347 |
public function __construct() {
|
348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
//$this->items = array();
|
350 |
|
351 |
// Hooks
|
442 |
|
443 |
function settings_section( $sections ) {
|
444 |
|
445 |
+
$sections['currencies'] = __( 'Currencies', 'woocommerce-jetpack' );
|
446 |
|
447 |
return $sections;
|
448 |
}
|
459 |
|
460 |
function add_currency_symbol( $currency_symbol, $currency ) {
|
461 |
|
462 |
+
return apply_filters( 'wcj_get_option_filter', $this->currencies_symbols_list[$currency], get_option( 'wcj_currency_' . $currency, $currency_symbol ) );
|
463 |
}
|
464 |
|
465 |
/*public function check_wooallcurpro_fields($input) {
|
includes/class-wcj-emails.php
CHANGED
@@ -165,7 +165,7 @@ class WCJ_Emails {
|
|
165 |
*/
|
166 |
function settings_section( $sections ) {
|
167 |
|
168 |
-
$sections['emails'] = 'Emails';
|
169 |
|
170 |
return $sections;
|
171 |
}
|
165 |
*/
|
166 |
function settings_section( $sections ) {
|
167 |
|
168 |
+
$sections['emails'] = __( 'Emails', 'woocommerce-jetpack' );
|
169 |
|
170 |
return $sections;
|
171 |
}
|
includes/class-wcj-orders.php
CHANGED
@@ -53,7 +53,7 @@ class WCJ_Orders {
|
|
53 |
if ( 'yes' === get_option( 'wcj_order_minimum_amount_cart_notice_enabled' ) ) {
|
54 |
|
55 |
wc_print_notice(
|
56 |
-
sprintf( apply_filters( '
|
57 |
woocommerce_price( $minimum ),
|
58 |
woocommerce_price( WC()->cart->total )
|
59 |
), 'notice'
|
@@ -63,7 +63,7 @@ class WCJ_Orders {
|
|
63 |
} else {
|
64 |
|
65 |
wc_add_notice(
|
66 |
-
sprintf( apply_filters( '
|
67 |
woocommerce_price( $minimum ),
|
68 |
woocommerce_price( WC()->cart->total )
|
69 |
), 'error'
|
@@ -114,7 +114,7 @@ class WCJ_Orders {
|
|
114 |
|
115 |
/**
|
116 |
* Display order number.
|
117 |
-
|
118 |
public function display_order_number( $order_number, $order ) {
|
119 |
|
120 |
$order_number_meta = get_post_meta( $order->id, '_wcj_order_number', true );
|
@@ -124,6 +124,18 @@ class WCJ_Orders {
|
|
124 |
return $order_number;
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
/**
|
128 |
* Renumerate orders function.
|
129 |
*/
|
53 |
if ( 'yes' === get_option( 'wcj_order_minimum_amount_cart_notice_enabled' ) ) {
|
54 |
|
55 |
wc_print_notice(
|
56 |
+
sprintf( apply_filters( 'wcj_get_option_filter', 'You must have an order with a minimum of %s to place your order, your current order total is %s.', get_option( 'wcj_order_minimum_amount_cart_notice_message' ) ),
|
57 |
woocommerce_price( $minimum ),
|
58 |
woocommerce_price( WC()->cart->total )
|
59 |
), 'notice'
|
63 |
} else {
|
64 |
|
65 |
wc_add_notice(
|
66 |
+
sprintf( apply_filters( 'wcj_get_option_filter', 'You must have an order with a minimum of %s to place your order, your current order total is %s.', get_option( 'wcj_order_minimum_amount_error_message' ) ),
|
67 |
woocommerce_price( $minimum ),
|
68 |
woocommerce_price( WC()->cart->total )
|
69 |
), 'error'
|
114 |
|
115 |
/**
|
116 |
* Display order number.
|
117 |
+
*
|
118 |
public function display_order_number( $order_number, $order ) {
|
119 |
|
120 |
$order_number_meta = get_post_meta( $order->id, '_wcj_order_number', true );
|
124 |
return $order_number;
|
125 |
}
|
126 |
|
127 |
+
/**
|
128 |
+
* Display order number.
|
129 |
+
*/
|
130 |
+
public function display_order_number( $order_number, $order ) {
|
131 |
+
|
132 |
+
$order_number_meta = get_post_meta( $order->id, '_wcj_order_number', true );
|
133 |
+
if ( $order_number_meta !== '' )
|
134 |
+
$order_number = apply_filters( 'wcj_get_option_filter', '#' . $order_number_meta, sprintf( '%s%0' . get_option( 'wcj_order_number_min_width', 0 ) . 'd', get_option( 'wcj_order_number_prefix', '' ), $order_number_meta ) );
|
135 |
+
|
136 |
+
return $order_number;
|
137 |
+
}
|
138 |
+
|
139 |
/**
|
140 |
* Renumerate orders function.
|
141 |
*/
|
includes/class-wcj-pdf-invoices.php
CHANGED
@@ -274,7 +274,7 @@ class WCJ_PDF_Invoices {
|
|
274 |
'desc' => __( 'Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="/wp-admin/media-new.php">media uploader</a>.', 'woocommerce-jetpack' ),
|
275 |
'desc_tip' => __( 'Header image', 'woocommerce-jetpack' ),
|
276 |
'id' => 'wcj_pdf_invoices_seller_logo_url',
|
277 |
-
|
278 |
'type' => 'text',
|
279 |
'css' => 'width:33%;min-width:300px;',
|
280 |
),
|
@@ -283,7 +283,7 @@ class WCJ_PDF_Invoices {
|
|
283 |
'title' => __( 'Header Text', 'woocommerce-jetpack' ),
|
284 |
'desc_tip' => __( 'Header text', 'woocommerce-jetpack' ),
|
285 |
'id' => 'wcj_pdf_invoices_header_text',
|
286 |
-
'default' => __( 'INVOICE' ),
|
287 |
'type' => 'text',
|
288 |
'css' => 'width:33%;min-width:300px;',
|
289 |
),
|
@@ -292,7 +292,7 @@ class WCJ_PDF_Invoices {
|
|
292 |
'title' => __( 'Invoice Number Text', 'woocommerce-jetpack' ),
|
293 |
'desc_tip' => __( 'Invoice number text', 'woocommerce-jetpack' ),
|
294 |
'id' => 'wcj_pdf_invoices_invoice_number_text',
|
295 |
-
'default' => __( 'Invoice number' ),
|
296 |
'type' => 'text',
|
297 |
'css' => 'width:33%;min-width:300px;',
|
298 |
),
|
@@ -301,7 +301,7 @@ class WCJ_PDF_Invoices {
|
|
301 |
'title' => __( 'Invoice Date Text', 'woocommerce-jetpack' ),
|
302 |
'desc_tip' => __( 'Invoice date text', 'woocommerce-jetpack' ),
|
303 |
'id' => 'wcj_pdf_invoices_invoice_date_text',
|
304 |
-
'default' => __( 'Invoice date' ),
|
305 |
'type' => 'text',
|
306 |
'css' => 'width:33%;min-width:300px;',
|
307 |
),
|
@@ -310,7 +310,7 @@ class WCJ_PDF_Invoices {
|
|
310 |
'title' => __( 'Seller Text', 'woocommerce-jetpack' ),
|
311 |
'desc_tip' => __( 'Seller text', 'woocommerce-jetpack' ),
|
312 |
'id' => 'wcj_pdf_invoices_seller_text',
|
313 |
-
'default' => __( 'Seller' ),
|
314 |
'type' => 'text',
|
315 |
'css' => 'width:33%;min-width:300px;',
|
316 |
),
|
@@ -319,16 +319,8 @@ class WCJ_PDF_Invoices {
|
|
319 |
'title' => __( 'Your business information', 'woocommerce-jetpack' ),
|
320 |
'desc_tip' => __( 'Seller information', 'woocommerce-jetpack' ),
|
321 |
'id' => 'wcj_pdf_invoices_seller_info',
|
322 |
-
'default' =>
|
323 |
-
'
|
324 |
-
Address
|
325 |
-
City
|
326 |
-
ZIP code
|
327 |
-
Country
|
328 |
-
|
329 |
-
Phone:
|
330 |
-
Email:',
|
331 |
-
'type' => 'textarea',
|
332 |
'css' => 'width:33%;min-width:300px;min-height:300px;',
|
333 |
),
|
334 |
|
@@ -336,7 +328,7 @@ Email:',
|
|
336 |
'title' => __( 'Buyer Text', 'woocommerce-jetpack' ),
|
337 |
'desc_tip' => __( 'Buyer text', 'woocommerce-jetpack' ),
|
338 |
'id' => 'wcj_pdf_invoices_buyer_text',
|
339 |
-
'default' => __( 'Buyer' ),
|
340 |
'type' => 'text',
|
341 |
'css' => 'width:33%;min-width:300px;',
|
342 |
),
|
@@ -345,7 +337,7 @@ Email:',
|
|
345 |
'title' => __( 'Items Text', 'woocommerce-jetpack' ),
|
346 |
'desc_tip' => __( 'Items text', 'woocommerce-jetpack' ),
|
347 |
'id' => 'wcj_pdf_invoices_items_text',
|
348 |
-
'default' => __( 'Items' ),
|
349 |
'type' => 'text',
|
350 |
'css' => 'width:33%;min-width:300px;',
|
351 |
),
|
@@ -354,7 +346,7 @@ Email:',
|
|
354 |
'title' => __( 'Column - Nr. Text', 'woocommerce-jetpack' ),
|
355 |
'desc_tip' => __( 'Nr. text', 'woocommerce-jetpack' ),
|
356 |
'id' => 'wcj_pdf_invoices_column_nr_text',
|
357 |
-
'default' => __( 'Nr.' ),
|
358 |
'type' => 'text',
|
359 |
'css' => 'width:33%;min-width:300px;',
|
360 |
),
|
@@ -363,7 +355,7 @@ Email:',
|
|
363 |
'title' => __( 'Column - Item Name Text', 'woocommerce-jetpack' ),
|
364 |
'desc_tip' => __( 'Item name text', 'woocommerce-jetpack' ),
|
365 |
'id' => 'wcj_pdf_invoices_column_item_name_text',
|
366 |
-
'default' => __( 'Item Name' ),
|
367 |
'type' => 'text',
|
368 |
'css' => 'width:33%;min-width:300px;',
|
369 |
),
|
@@ -372,7 +364,7 @@ Email:',
|
|
372 |
'title' => __( 'Column - Qty Text', 'woocommerce-jetpack' ),
|
373 |
'desc_tip' => __( 'Qty text', 'woocommerce-jetpack' ),
|
374 |
'id' => 'wcj_pdf_invoices_column_qty_text',
|
375 |
-
'default' => __( 'Qty' ),
|
376 |
'type' => 'text',
|
377 |
'css' => 'width:33%;min-width:300px;',
|
378 |
),
|
@@ -381,7 +373,7 @@ Email:',
|
|
381 |
'title' => __( 'Column - Price Text', 'woocommerce-jetpack' ),
|
382 |
'desc_tip' => __( 'Price text', 'woocommerce-jetpack' ),
|
383 |
'id' => 'wcj_pdf_invoices_column_price_text',
|
384 |
-
'default' => __( 'Price' ),
|
385 |
'type' => 'text',
|
386 |
'css' => 'width:33%;min-width:300px;',
|
387 |
),
|
@@ -390,7 +382,7 @@ Email:',
|
|
390 |
'title' => __( 'Order Total Text', 'woocommerce-jetpack' ),
|
391 |
'desc_tip' => __( 'Order Total text', 'woocommerce-jetpack' ),
|
392 |
'id' => 'wcj_pdf_invoices_order_total_text',
|
393 |
-
'default' => __( 'Order Total' ),
|
394 |
'type' => 'text',
|
395 |
'css' => 'width:33%;min-width:300px;',
|
396 |
),
|
274 |
'desc' => __( 'Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="/wp-admin/media-new.php">media uploader</a>.', 'woocommerce-jetpack' ),
|
275 |
'desc_tip' => __( 'Header image', 'woocommerce-jetpack' ),
|
276 |
'id' => 'wcj_pdf_invoices_seller_logo_url',
|
277 |
+
'default' => '',
|
278 |
'type' => 'text',
|
279 |
'css' => 'width:33%;min-width:300px;',
|
280 |
),
|
283 |
'title' => __( 'Header Text', 'woocommerce-jetpack' ),
|
284 |
'desc_tip' => __( 'Header text', 'woocommerce-jetpack' ),
|
285 |
'id' => 'wcj_pdf_invoices_header_text',
|
286 |
+
'default' => __( 'INVOICE', 'woocommerce-jetpack' ),
|
287 |
'type' => 'text',
|
288 |
'css' => 'width:33%;min-width:300px;',
|
289 |
),
|
292 |
'title' => __( 'Invoice Number Text', 'woocommerce-jetpack' ),
|
293 |
'desc_tip' => __( 'Invoice number text', 'woocommerce-jetpack' ),
|
294 |
'id' => 'wcj_pdf_invoices_invoice_number_text',
|
295 |
+
'default' => __( 'Invoice number', 'woocommerce-jetpack' ),
|
296 |
'type' => 'text',
|
297 |
'css' => 'width:33%;min-width:300px;',
|
298 |
),
|
301 |
'title' => __( 'Invoice Date Text', 'woocommerce-jetpack' ),
|
302 |
'desc_tip' => __( 'Invoice date text', 'woocommerce-jetpack' ),
|
303 |
'id' => 'wcj_pdf_invoices_invoice_date_text',
|
304 |
+
'default' => __( 'Invoice date', 'woocommerce-jetpack' ),
|
305 |
'type' => 'text',
|
306 |
'css' => 'width:33%;min-width:300px;',
|
307 |
),
|
310 |
'title' => __( 'Seller Text', 'woocommerce-jetpack' ),
|
311 |
'desc_tip' => __( 'Seller text', 'woocommerce-jetpack' ),
|
312 |
'id' => 'wcj_pdf_invoices_seller_text',
|
313 |
+
'default' => __( 'Seller', 'woocommerce-jetpack' ),
|
314 |
'type' => 'text',
|
315 |
'css' => 'width:33%;min-width:300px;',
|
316 |
),
|
319 |
'title' => __( 'Your business information', 'woocommerce-jetpack' ),
|
320 |
'desc_tip' => __( 'Seller information', 'woocommerce-jetpack' ),
|
321 |
'id' => 'wcj_pdf_invoices_seller_info',
|
322 |
+
'default' => __( '<strong>Company Name</strong>', 'woocommerce-jetpack' ),
|
323 |
+
'type' => 'textarea',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
'css' => 'width:33%;min-width:300px;min-height:300px;',
|
325 |
),
|
326 |
|
328 |
'title' => __( 'Buyer Text', 'woocommerce-jetpack' ),
|
329 |
'desc_tip' => __( 'Buyer text', 'woocommerce-jetpack' ),
|
330 |
'id' => 'wcj_pdf_invoices_buyer_text',
|
331 |
+
'default' => __( 'Buyer', 'woocommerce-jetpack' ),
|
332 |
'type' => 'text',
|
333 |
'css' => 'width:33%;min-width:300px;',
|
334 |
),
|
337 |
'title' => __( 'Items Text', 'woocommerce-jetpack' ),
|
338 |
'desc_tip' => __( 'Items text', 'woocommerce-jetpack' ),
|
339 |
'id' => 'wcj_pdf_invoices_items_text',
|
340 |
+
'default' => __( 'Items', 'woocommerce-jetpack' ),
|
341 |
'type' => 'text',
|
342 |
'css' => 'width:33%;min-width:300px;',
|
343 |
),
|
346 |
'title' => __( 'Column - Nr. Text', 'woocommerce-jetpack' ),
|
347 |
'desc_tip' => __( 'Nr. text', 'woocommerce-jetpack' ),
|
348 |
'id' => 'wcj_pdf_invoices_column_nr_text',
|
349 |
+
'default' => __( 'Nr.', 'woocommerce-jetpack' ),
|
350 |
'type' => 'text',
|
351 |
'css' => 'width:33%;min-width:300px;',
|
352 |
),
|
355 |
'title' => __( 'Column - Item Name Text', 'woocommerce-jetpack' ),
|
356 |
'desc_tip' => __( 'Item name text', 'woocommerce-jetpack' ),
|
357 |
'id' => 'wcj_pdf_invoices_column_item_name_text',
|
358 |
+
'default' => __( 'Item Name', 'woocommerce-jetpack' ),
|
359 |
'type' => 'text',
|
360 |
'css' => 'width:33%;min-width:300px;',
|
361 |
),
|
364 |
'title' => __( 'Column - Qty Text', 'woocommerce-jetpack' ),
|
365 |
'desc_tip' => __( 'Qty text', 'woocommerce-jetpack' ),
|
366 |
'id' => 'wcj_pdf_invoices_column_qty_text',
|
367 |
+
'default' => __( 'Qty', 'woocommerce-jetpack' ),
|
368 |
'type' => 'text',
|
369 |
'css' => 'width:33%;min-width:300px;',
|
370 |
),
|
373 |
'title' => __( 'Column - Price Text', 'woocommerce-jetpack' ),
|
374 |
'desc_tip' => __( 'Price text', 'woocommerce-jetpack' ),
|
375 |
'id' => 'wcj_pdf_invoices_column_price_text',
|
376 |
+
'default' => __( 'Price', 'woocommerce-jetpack' ),
|
377 |
'type' => 'text',
|
378 |
'css' => 'width:33%;min-width:300px;',
|
379 |
),
|
382 |
'title' => __( 'Order Total Text', 'woocommerce-jetpack' ),
|
383 |
'desc_tip' => __( 'Order Total text', 'woocommerce-jetpack' ),
|
384 |
'id' => 'wcj_pdf_invoices_order_total_text',
|
385 |
+
'default' => __( 'Order Total', 'woocommerce-jetpack' ),
|
386 |
'type' => 'text',
|
387 |
'css' => 'width:33%;min-width:300px;',
|
388 |
),
|
includes/class-wcj-price-labels.php
CHANGED
@@ -14,6 +14,28 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
14 |
if ( ! class_exists( 'WCJ_Price_Labels' ) ) :
|
15 |
|
16 |
class WCJ_Price_Labels {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
/**
|
19 |
* Constructor.
|
@@ -22,60 +44,63 @@ class WCJ_Price_Labels {
|
|
22 |
|
23 |
// HOOKS
|
24 |
// Main hooks
|
25 |
-
|
26 |
-
add_action( 'add_meta_boxes', array( $this, 'add_price_label_meta_box' ) );
|
27 |
-
// Custom Price Labels - cart item price hooks
|
28 |
-
//add_filter( 'woocommerce_cart_item_price_html', array( $this, 'custom_price' ), 999, 2 ); // depreciated?
|
29 |
-
//add_filter( 'woocommerce_cart_item_price', array( $this, 'custom_price' ), 999, 2 );
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
// Settings hooks
|
58 |
add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
|
59 |
add_filter( 'wcj_settings_price_labels', array( $this, 'get_settings' ), 100 );
|
60 |
add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
|
61 |
-
|
62 |
-
// Custom Price Labels - fields array
|
63 |
-
$this->custom_tab_group_name = 'wcj_price_labels';// for compatibility with Custom Price Label Pro plugin should use 'simple_is_custom_pricing_label'
|
64 |
-
$this->custom_tab_sections = array ( '_instead', '_before', '_between', '_after', );
|
65 |
-
$this->custom_tab_sections_titles = array (
|
66 |
-
'_instead' => 'Instead of the price',// for compatibility with Custom Price Label Pro plugin should use ''
|
67 |
-
'_before' => 'Before the price',
|
68 |
-
'_between' => 'Between the regular and sale price',
|
69 |
-
'_after' => 'After the price',
|
70 |
-
);
|
71 |
-
$this->custom_tab_section_variations = array ( '_text', '_enabled', '_home', '_products', '_single', );
|
72 |
-
$this->custom_tab_section_variations_titles = array (
|
73 |
-
'_text' => 'The label',
|
74 |
-
'_enabled' => 'Enable',// for compatibility with Custom Price Label Pro plugin should use ''
|
75 |
-
'_home' => 'Hide on home page',
|
76 |
-
'_products' => 'Hide on products page',
|
77 |
-
'_single' => 'Hide on single',
|
78 |
-
);
|
79 |
}
|
80 |
|
81 |
/*public function custom_price1( $price, $product ) {
|
@@ -165,7 +190,7 @@ class WCJ_Price_Labels {
|
|
165 |
//if ( $disabled_if_no_plus != '' ) $disabled_if_no_plus = 'disabled';
|
166 |
|
167 |
echo '<li><input class="checkbox" type="checkbox" ' . $disabled_if_no_plus . ' name="' . $option_name . '" id="' . $option_name . '" ' .
|
168 |
-
checked( get_post_meta($current_post_id, '_' . $option_name, true), 'on', false ) . ' /> ' . $this->custom_tab_section_variations_titles[ $custom_tab_section_variation ] . '</li>';
|
169 |
}
|
170 |
}
|
171 |
|
@@ -173,6 +198,9 @@ class WCJ_Price_Labels {
|
|
173 |
}
|
174 |
}
|
175 |
|
|
|
|
|
|
|
176 |
public function customize_price( $price, $custom_tab_section, $custom_label ) {
|
177 |
|
178 |
switch ( $custom_tab_section ) {
|
@@ -182,21 +210,21 @@ class WCJ_Price_Labels {
|
|
182 |
break;
|
183 |
|
184 |
case '_before':
|
185 |
-
$price = apply_filters( '
|
186 |
break;
|
187 |
|
188 |
case '_between':
|
189 |
-
$price = apply_filters( '
|
190 |
break;
|
191 |
|
192 |
case '_after':
|
193 |
-
$price = apply_filters( '
|
194 |
break;
|
195 |
}
|
196 |
|
197 |
return $price;
|
198 |
}
|
199 |
-
|
200 |
/*
|
201 |
* front end
|
202 |
*/
|
@@ -210,7 +238,7 @@ class WCJ_Price_Labels {
|
|
210 |
|
211 |
//$option_name = $this->custom_tab_group_name;
|
212 |
$option_name = $this->custom_tab_group_name . $custom_tab_section . $custom_tab_section_variation;
|
213 |
-
$labels_array[ 'variation' . $custom_tab_section_variation ] = get_post_meta($product->post->ID, '_' . $option_name, true );
|
214 |
|
215 |
/*if ( $custom_tab_section_variation == '_text' ) {
|
216 |
|
@@ -224,16 +252,41 @@ class WCJ_Price_Labels {
|
|
224 |
}*/
|
225 |
|
226 |
//$price .= print_r( $labels_array );
|
227 |
-
}
|
228 |
-
|
229 |
-
|
230 |
|
231 |
if ( $labels_array[ 'variation_enabled' ] == 'on' ) {
|
232 |
|
233 |
-
if (
|
234 |
-
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
|
239 |
//unset( $labels_array );
|
@@ -265,7 +318,7 @@ class WCJ_Price_Labels {
|
|
265 |
|
266 |
function settings_section( $sections ) {
|
267 |
|
268 |
-
$sections['price_labels'] = 'Custom Price Labels';
|
269 |
|
270 |
return $sections;
|
271 |
}
|
14 |
if ( ! class_exists( 'WCJ_Price_Labels' ) ) :
|
15 |
|
16 |
class WCJ_Price_Labels {
|
17 |
+
|
18 |
+
// Custom Price Labels - fields array
|
19 |
+
public $custom_tab_group_name = 'wcj_price_labels';// for compatibility with Custom Price Label Pro plugin should use 'simple_is_custom_pricing_label'
|
20 |
+
public $custom_tab_sections = array ( '_instead', '_before', '_between', '_after', );
|
21 |
+
public $custom_tab_sections_titles = array (
|
22 |
+
'_instead' => 'Instead of the price',// for compatibility with Custom Price Label Pro plugin should use ''
|
23 |
+
'_before' => 'Before the price',
|
24 |
+
'_between' => 'Between the regular and sale price',
|
25 |
+
'_after' => 'After the price',
|
26 |
+
);
|
27 |
+
public $custom_tab_section_variations = array ( '_text', '_enabled', '_home', '_products', '_single', /*'_simple',*/ '_variable', '_variation', /*'_grouped',*/ );
|
28 |
+
public $custom_tab_section_variations_titles = array (
|
29 |
+
'_text' => 'The label',
|
30 |
+
'_enabled' => 'Enable',// for compatibility with Custom Price Label Pro plugin should use ''
|
31 |
+
'_home' => 'Hide on home page',
|
32 |
+
'_products' => 'Hide on products page',
|
33 |
+
'_single' => 'Hide on single',
|
34 |
+
//'_simple' => 'Hide for simple product',
|
35 |
+
'_variable' => 'Hide for variable product (main price) - ignored if product type is not variable',
|
36 |
+
'_variation' => 'Hide for each variation of variable product - ignored if product type is not variable',
|
37 |
+
//'_grouped' => 'Hide for grouped product',
|
38 |
+
);
|
39 |
|
40 |
/**
|
41 |
* Constructor.
|
44 |
|
45 |
// HOOKS
|
46 |
// Main hooks
|
47 |
+
if ( get_option( 'wcj_price_labels_enabled' ) == 'yes' ) {
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
// Custom Price Labels hooks
|
50 |
+
add_action( 'add_meta_boxes', array( $this, 'add_price_label_meta_box' ) );
|
51 |
+
|
52 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
53 |
+
// Custom Price Labels - cart item price hooks
|
54 |
+
//add_filter( 'woocommerce_cart_item_price_html', array( $this, 'custom_price' ), 999, 2 ); // depreciated?
|
55 |
+
//add_filter( 'woocommerce_cart_item_price', array( $this, 'custom_price' ), 999, 2 );
|
56 |
|
57 |
+
//add_filter( 'woocommerce_get_price_html', array( $this, 'custom_price' ), 100, 2 );
|
58 |
+
|
59 |
+
//if ( $labels_array[ 'variation_simple' ] == 'off' ) {
|
60 |
+
|
61 |
+
// Custom Price Labels - price hooks
|
62 |
+
add_filter( 'woocommerce_empty_price_html', array( $this, 'custom_price' ), 100, 2 );
|
63 |
+
add_filter( 'woocommerce_free_price_html', array( $this, 'custom_price' ), 100, 2 );
|
64 |
+
add_filter( 'woocommerce_free_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
|
65 |
+
add_filter( 'woocommerce_price_html', array( $this, 'custom_price' ), 100, 2 );
|
66 |
+
add_filter( 'woocommerce_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
|
67 |
+
//}
|
68 |
+
|
69 |
+
//if ( $labels_array[ 'variation_grouped' ] == 'off' ) {
|
70 |
+
|
71 |
+
// Custom Price Labels - price hooks
|
72 |
+
add_filter( 'woocommerce_grouped_price_html', array( $this, 'custom_price' ), 100, 2 );
|
73 |
+
//}
|
74 |
+
|
75 |
+
//if ( $labels_array[ 'variation_variable' ] == 'off' ) {
|
76 |
+
|
77 |
+
// Custom Price Labels - price hooks
|
78 |
+
add_filter( 'woocommerce_variable_empty_price_html', array( $this, 'custom_price' ), 100, 2 );
|
79 |
+
add_filter( 'woocommerce_variable_free_price_html', array( $this, 'custom_price' ), 100, 2 );
|
80 |
+
add_filter( 'woocommerce_variable_free_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
|
81 |
+
add_filter( 'woocommerce_variable_price_html', array( $this, 'custom_price' ), 100, 2 );
|
82 |
+
add_filter( 'woocommerce_variable_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
|
83 |
+
//}
|
84 |
+
|
85 |
+
//if ( $labels_array[ 'variation_variation' ] == 'off' ) {
|
86 |
+
|
87 |
+
// Custom Price Labels - price hooks
|
88 |
+
add_filter( 'woocommerce_variation_empty_price_html', array( $this, 'custom_price' ), 100, 2 );
|
89 |
+
add_filter( 'woocommerce_variation_free_price_html', array( $this, 'custom_price' ), 100, 2 );
|
90 |
+
//woocommerce_variation_option_name
|
91 |
+
add_filter( 'woocommerce_variation_price_html', array( $this, 'custom_price' ), 100, 2 );
|
92 |
+
add_filter( 'woocommerce_variation_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
|
93 |
+
//}
|
94 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
95 |
+
|
96 |
+
// Custom Price Labels - save post hook
|
97 |
+
add_action( 'save_post', array( $this, 'save_custom_price_labels' ), 999, 2 );
|
98 |
+
}
|
99 |
|
100 |
// Settings hooks
|
101 |
add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
|
102 |
add_filter( 'wcj_settings_price_labels', array( $this, 'get_settings' ), 100 );
|
103 |
add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
|
106 |
/*public function custom_price1( $price, $product ) {
|
190 |
//if ( $disabled_if_no_plus != '' ) $disabled_if_no_plus = 'disabled';
|
191 |
|
192 |
echo '<li><input class="checkbox" type="checkbox" ' . $disabled_if_no_plus . ' name="' . $option_name . '" id="' . $option_name . '" ' .
|
193 |
+
checked( get_post_meta( $current_post_id, '_' . $option_name, true ), 'on', false ) . ' /> ' . $this->custom_tab_section_variations_titles[ $custom_tab_section_variation ] . '</li>';
|
194 |
}
|
195 |
}
|
196 |
|
198 |
}
|
199 |
}
|
200 |
|
201 |
+
/*
|
202 |
+
* customize_price
|
203 |
+
*/
|
204 |
public function customize_price( $price, $custom_tab_section, $custom_label ) {
|
205 |
|
206 |
switch ( $custom_tab_section ) {
|
210 |
break;
|
211 |
|
212 |
case '_before':
|
213 |
+
$price = apply_filters( 'wcj_get_option_filter', $price, $custom_label . $price );
|
214 |
break;
|
215 |
|
216 |
case '_between':
|
217 |
+
$price = apply_filters( 'wcj_get_option_filter', $price, str_replace( '</del> <ins>', '</del>' . $custom_label . '<ins>', $price ) );
|
218 |
break;
|
219 |
|
220 |
case '_after':
|
221 |
+
$price = apply_filters( 'wcj_get_option_filter', $price, $price . $custom_label );
|
222 |
break;
|
223 |
}
|
224 |
|
225 |
return $price;
|
226 |
}
|
227 |
+
|
228 |
/*
|
229 |
* front end
|
230 |
*/
|
238 |
|
239 |
//$option_name = $this->custom_tab_group_name;
|
240 |
$option_name = $this->custom_tab_group_name . $custom_tab_section . $custom_tab_section_variation;
|
241 |
+
$labels_array[ 'variation' . $custom_tab_section_variation ] = get_post_meta( $product->post->ID, '_' . $option_name, true );
|
242 |
|
243 |
/*if ( $custom_tab_section_variation == '_text' ) {
|
244 |
|
252 |
}*/
|
253 |
|
254 |
//$price .= print_r( $labels_array );
|
255 |
+
}
|
|
|
|
|
256 |
|
257 |
if ( $labels_array[ 'variation_enabled' ] == 'on' ) {
|
258 |
|
259 |
+
if (
|
260 |
+
( ( $labels_array['variation_home'] == 'off' ) && ( is_front_page() ) ) ||
|
261 |
+
( ( $labels_array['variation_products'] == 'off' ) && ( is_archive() ) ) ||
|
262 |
+
( ( $labels_array['variation_single'] == 'off' ) && ( is_single() ) )
|
263 |
+
)
|
264 |
+
{
|
265 |
+
$current_filter_name = current_filter();
|
266 |
+
|
267 |
+
$variable_filters_array = array(
|
268 |
+
'woocommerce_variable_empty_price_html',
|
269 |
+
'woocommerce_variable_free_price_html',
|
270 |
+
'woocommerce_variable_free_sale_price_html',
|
271 |
+
'woocommerce_variable_price_html',
|
272 |
+
'woocommerce_variable_sale_price_html',
|
273 |
+
);
|
274 |
+
|
275 |
+
$variation_filters_array = array(
|
276 |
+
'woocommerce_variation_empty_price_html',
|
277 |
+
'woocommerce_variation_free_price_html',
|
278 |
+
//woocommerce_variation_option_name
|
279 |
+
'woocommerce_variation_price_html',
|
280 |
+
'woocommerce_variation_sale_price_html',
|
281 |
+
);
|
282 |
+
|
283 |
+
if (
|
284 |
+
( in_array( $current_filter_name, $variable_filters_array ) && ( $labels_array['variation_variable'] == 'off' ) ) ||
|
285 |
+
( in_array( $current_filter_name, $variation_filters_array ) && ( $labels_array['variation_variation'] == 'off' ) ) ||
|
286 |
+
( ! in_array( $current_filter_name, $variable_filters_array ) && ! in_array( $current_filter_name, $variation_filters_array ) )
|
287 |
+
)
|
288 |
+
$price = $this->customize_price( $price, $custom_tab_section, $labels_array['variation_text'] );
|
289 |
+
}
|
290 |
}
|
291 |
|
292 |
//unset( $labels_array );
|
318 |
|
319 |
function settings_section( $sections ) {
|
320 |
|
321 |
+
$sections['price_labels'] = __( 'Custom Price Labels', 'woocommerce-jetpack' );
|
322 |
|
323 |
return $sections;
|
324 |
}
|
includes/class-wcj-product-info.php
CHANGED
@@ -75,17 +75,17 @@ class WCJ_Product_Info {
|
|
75 |
|
76 |
// Priority and Title
|
77 |
if ( isset( $tabs['description'] ) ) {
|
78 |
-
$tabs['description']['priority'] = apply_filters( '
|
79 |
if ( get_option( 'wcj_product_info_product_tabs_description_title' ) !== '' )
|
80 |
$tabs['description']['title'] = get_option( 'wcj_product_info_product_tabs_description_title' );
|
81 |
}
|
82 |
if ( isset( $tabs['reviews'] ) ) {
|
83 |
-
$tabs['reviews']['priority'] = apply_filters( '
|
84 |
if ( get_option( 'wcj_product_info_product_tabs_reviews_title' ) !== '' )
|
85 |
$tabs['reviews']['title'] = get_option( 'wcj_product_info_product_tabs_reviews_title' );
|
86 |
}
|
87 |
if ( isset( $tabs['additional_information'] ) ) {
|
88 |
-
$tabs['additional_information']['priority'] = apply_filters( '
|
89 |
if ( get_option( 'wcj_product_info_product_tabs_additional_information_title' ) !== '' )
|
90 |
$tabs['additional_information']['title'] = get_option( 'wcj_product_info_product_tabs_additional_information_title' );
|
91 |
}
|
75 |
|
76 |
// Priority and Title
|
77 |
if ( isset( $tabs['description'] ) ) {
|
78 |
+
$tabs['description']['priority'] = apply_filters( 'wcj_get_option_filter', 10, get_option( 'wcj_product_info_product_tabs_description_priority' ) );
|
79 |
if ( get_option( 'wcj_product_info_product_tabs_description_title' ) !== '' )
|
80 |
$tabs['description']['title'] = get_option( 'wcj_product_info_product_tabs_description_title' );
|
81 |
}
|
82 |
if ( isset( $tabs['reviews'] ) ) {
|
83 |
+
$tabs['reviews']['priority'] = apply_filters( 'wcj_get_option_filter', 20, get_option( 'wcj_product_info_product_tabs_reviews_priority' ) );
|
84 |
if ( get_option( 'wcj_product_info_product_tabs_reviews_title' ) !== '' )
|
85 |
$tabs['reviews']['title'] = get_option( 'wcj_product_info_product_tabs_reviews_title' );
|
86 |
}
|
87 |
if ( isset( $tabs['additional_information'] ) ) {
|
88 |
+
$tabs['additional_information']['priority'] = apply_filters( 'wcj_get_option_filter', 30, get_option( 'wcj_product_info_product_tabs_additional_information_priority' ) );
|
89 |
if ( get_option( 'wcj_product_info_product_tabs_additional_information_title' ) !== '' )
|
90 |
$tabs['additional_information']['title'] = get_option( 'wcj_product_info_product_tabs_additional_information_title' );
|
91 |
}
|
includes/class-wcj-sorting.php
CHANGED
@@ -29,7 +29,7 @@ class WCJ_Sorting {
|
|
29 |
add_filter( 'woocommerce_get_catalog_ordering_args', array( $this, 'custom_woocommerce_get_catalog_ordering_args' ), 100 ); // Sorting
|
30 |
add_filter( 'woocommerce_catalog_orderby', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 ); // Front end
|
31 |
add_filter( 'woocommerce_default_catalog_orderby_options', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 ); // Back end (default sorting)
|
32 |
-
add_action( 'init', array( $this, 'custom_init' ), 100 ); // Remove sorting
|
33 |
}
|
34 |
|
35 |
// Settings hooks
|
@@ -81,7 +81,7 @@ class WCJ_Sorting {
|
|
81 |
|
82 |
/*
|
83 |
* Custom Init - remove all sorting action
|
84 |
-
|
85 |
function custom_init() {
|
86 |
|
87 |
if ( get_option( 'wcj_sorting_remove_all_enabled' ) )
|
29 |
add_filter( 'woocommerce_get_catalog_ordering_args', array( $this, 'custom_woocommerce_get_catalog_ordering_args' ), 100 ); // Sorting
|
30 |
add_filter( 'woocommerce_catalog_orderby', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 ); // Front end
|
31 |
add_filter( 'woocommerce_default_catalog_orderby_options', array( $this, 'custom_woocommerce_catalog_orderby' ), 100 ); // Back end (default sorting)
|
32 |
+
//add_action( 'init', array( $this, 'custom_init' ), 100 ); // Remove sorting
|
33 |
}
|
34 |
|
35 |
// Settings hooks
|
81 |
|
82 |
/*
|
83 |
* Custom Init - remove all sorting action
|
84 |
+
*
|
85 |
function custom_init() {
|
86 |
|
87 |
if ( get_option( 'wcj_sorting_remove_all_enabled' ) )
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== WooCommerce Jetpack ===
|
2 |
Contributors: algoritmika
|
3 |
Donate link: http://algoritmika.com/donate/
|
4 |
-
Tags: woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,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
|
5 |
Requires at least: 3.9.1
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GNU General Public License v3.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -16,19 +16,20 @@ WooCommerce Jetpack is a WordPress plugin that supercharges your site with aweso
|
|
16 |
|
17 |
= Features =
|
18 |
|
|
|
19 |
* Orders - Set minimum order amount.
|
20 |
* Checkout - Customize checkout fields: disable/enable fields, set required, change labels and/or placeholders.
|
21 |
* Shipping - Hide shipping when free is available.
|
22 |
* Emails - Add another email recipient(s) to all WooCommerce emails.
|
23 |
* Product Info - Customize single product tabs. Change related products number.
|
24 |
-
* Cart - Add "Empty Cart" button to cart page,
|
25 |
* Custom Price Labels - Create any custom price label for any product.
|
26 |
* Call for Price - Create any custom price label, like "Call for price", for all products with empty price.
|
27 |
* Currencies - Add all world currencies, change currency symbol.
|
28 |
* Order Numbers - Sequential order numbering, custom order number prefix and number width.
|
29 |
* PDF Invoices - Add PDF invoices for store owners and for customers.
|
30 |
* More Sorting Options - Add more sorting options or remove sorting at all (including WooCommerce default).
|
31 |
-
* Add to Cart - Change text for add to cart buttons for each product type. Display "Product already in cart" instead of "Add to cart" button.
|
32 |
* Old Slugs - Remove old product slugs.
|
33 |
|
34 |
= Feedback =
|
@@ -57,6 +58,15 @@ To unlock all WooCommerce Jetpack features, please install additional <a href="h
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
= 1.1.0 - 24/07/2014 =
|
61 |
* Dev - Orders Numbers feature moved to Orders feature.
|
62 |
* Dev - PDF Invoices - Icons instead of text at orders list.
|
@@ -66,8 +76,8 @@ To unlock all WooCommerce Jetpack features, please install additional <a href="h
|
|
66 |
* Feature - Shipping - Hide shipping when free is available.
|
67 |
* Feature - Emails - Add another email recipient(s) to all WooCommerce emails.
|
68 |
* Feature - Product Info - Customize single product tabs. Change related products number.
|
69 |
-
* Feature - Cart - Add "Empty Cart" button to cart page,
|
70 |
-
* Feature Upgraded - Add to Cart - Display "Product already in cart" instead of "Add to cart" button.
|
71 |
|
72 |
= 1.0.6 - 15/07/2014 =
|
73 |
* Feature - PDF Invoices.
|
1 |
=== WooCommerce Jetpack ===
|
2 |
Contributors: algoritmika
|
3 |
Donate link: http://algoritmika.com/donate/
|
4 |
+
Tags: woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,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
|
5 |
Requires at least: 3.9.1
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.1.1
|
8 |
License: GNU General Public License v3.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
16 |
|
17 |
= Features =
|
18 |
|
19 |
+
* Custom Payment Gateway - Add and customize simple custom offline payment gateway.
|
20 |
* Orders - Set minimum order amount.
|
21 |
* Checkout - Customize checkout fields: disable/enable fields, set required, change labels and/or placeholders.
|
22 |
* Shipping - Hide shipping when free is available.
|
23 |
* Emails - Add another email recipient(s) to all WooCommerce emails.
|
24 |
* Product Info - Customize single product tabs. Change related products number.
|
25 |
+
* Cart - Add "Empty Cart" button to cart page, automatically add product to cart on visit.
|
26 |
* Custom Price Labels - Create any custom price label for any product.
|
27 |
* Call for Price - Create any custom price label, like "Call for price", for all products with empty price.
|
28 |
* Currencies - Add all world currencies, change currency symbol.
|
29 |
* Order Numbers - Sequential order numbering, custom order number prefix and number width.
|
30 |
* PDF Invoices - Add PDF invoices for store owners and for customers.
|
31 |
* More Sorting Options - Add more sorting options or remove sorting at all (including WooCommerce default).
|
32 |
+
* Add to Cart - Change text for add to cart buttons for each product type. Display "Product already in cart" instead of "Add to cart" button. Redirect add to cart button to any url (e.g. checkout page).
|
33 |
* Old Slugs - Remove old product slugs.
|
34 |
|
35 |
= Feedback =
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= 1.1.1 - 06/08/2014 =
|
62 |
+
* Feature Upgraded - Custom Price Labels - more visibility options added: hide for main variable product price or for each variation.
|
63 |
+
* Feature - Custom Payment Gateway (offline).
|
64 |
+
* Dev - Move needed functions from Plus to standard version.
|
65 |
+
* Fix - Custom Price Labels - Bug with main enable/disable checkbox, fixed.
|
66 |
+
* Fix - Checkout - Bug with default values, fixed.
|
67 |
+
* Dev - Enable/disable checkbox added to Add to cart feature.
|
68 |
+
* Dev - Function wcj_get_option removed.
|
69 |
+
|
70 |
= 1.1.0 - 24/07/2014 =
|
71 |
* Dev - Orders Numbers feature moved to Orders feature.
|
72 |
* Dev - PDF Invoices - Icons instead of text at orders list.
|
76 |
* Feature - Shipping - Hide shipping when free is available.
|
77 |
* Feature - Emails - Add another email recipient(s) to all WooCommerce emails.
|
78 |
* Feature - Product Info - Customize single product tabs. Change related products number.
|
79 |
+
* Feature - Cart - Add "Empty Cart" button to cart page, automatically add product to cart on visit.
|
80 |
+
* Feature Upgraded - Add to Cart - Display "Product already in cart" instead of "Add to cart" button. Redirect add to cart button to any url (e.g. checkout page).
|
81 |
|
82 |
= 1.0.6 - 15/07/2014 =
|
83 |
* Feature - PDF Invoices.
|
woocommerce-jetpack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WooCommerce Jetpack
|
4 |
Plugin URI: http://woojetpack.com
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features.
|
6 |
-
Version: 1.1.
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: http://www.algoritmika.com
|
9 |
Copyright: © 2014 Algoritmika Ltd.
|
@@ -75,7 +75,7 @@ final class WC_Jetpack {
|
|
75 |
//add_action( 'admin_init', array( $this, 'install' ) );
|
76 |
add_action( 'init', array( $this, 'init' ), 0 );
|
77 |
|
78 |
-
add_filter( '
|
79 |
|
80 |
// Settings
|
81 |
if ( is_admin() ) {
|
@@ -89,13 +89,16 @@ final class WC_Jetpack {
|
|
89 |
}
|
90 |
|
91 |
/**
|
92 |
-
*
|
93 |
-
|
94 |
-
public function
|
95 |
|
96 |
return $value;
|
97 |
}
|
98 |
|
|
|
|
|
|
|
99 |
public function display_get_wcj_plus_message( $value, $message_type ) {
|
100 |
|
101 |
switch ( $message_type ) {
|
@@ -132,27 +135,6 @@ final class WC_Jetpack {
|
|
132 |
return $value;
|
133 |
}
|
134 |
|
135 |
-
/**
|
136 |
-
* Add options.
|
137 |
-
*
|
138 |
-
function install() {
|
139 |
-
|
140 |
-
$settings = array();
|
141 |
-
$settings[] = include( 'includes/class-wcj-currencies.php' );
|
142 |
-
$settings[] = include( 'includes/class-wcj-price-labels.php' );
|
143 |
-
$settings[] = include( 'includes/class-wcj-sorting.php' );
|
144 |
-
$settings[] = include( 'includes/class-wcj-product-info.php' );
|
145 |
-
|
146 |
-
foreach ( $settings as $section ) {
|
147 |
-
foreach ( $section->get_settings() as $value ) {
|
148 |
-
if ( isset( $value['default'] ) && isset( $value['id'] ) ) {
|
149 |
-
$autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true;
|
150 |
-
add_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) );
|
151 |
-
}
|
152 |
-
}
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
/**
|
157 |
* Include required core files used in admin and on the frontend.
|
158 |
*/
|
@@ -176,6 +158,8 @@ final class WC_Jetpack {
|
|
176 |
$settings[] = include_once( 'includes/class-wcj-pdf-invoices.php' );
|
177 |
$settings[] = include_once( 'includes/class-wcj-old-slugs.php' );
|
178 |
|
|
|
|
|
179 |
// Add options
|
180 |
if ( is_admin() ) {
|
181 |
foreach ( $settings as $section ) {
|
3 |
Plugin Name: WooCommerce Jetpack
|
4 |
Plugin URI: http://woojetpack.com
|
5 |
Description: Supercharge your WooCommerce site with these awesome powerful features.
|
6 |
+
Version: 1.1.1
|
7 |
Author: Algoritmika Ltd
|
8 |
Author URI: http://www.algoritmika.com
|
9 |
Copyright: © 2014 Algoritmika Ltd.
|
75 |
//add_action( 'admin_init', array( $this, 'install' ) );
|
76 |
add_action( 'init', array( $this, 'init' ), 0 );
|
77 |
|
78 |
+
//add_filter( 'wcj_get_option_filter', array( $this, 'wcj_get_option' ), 100 );
|
79 |
|
80 |
// Settings
|
81 |
if ( is_admin() ) {
|
89 |
}
|
90 |
|
91 |
/**
|
92 |
+
* wcj_get_option.
|
93 |
+
*
|
94 |
+
public function wcj_get_option( $value ) {
|
95 |
|
96 |
return $value;
|
97 |
}
|
98 |
|
99 |
+
/**
|
100 |
+
* display_get_wcj_plus_message.
|
101 |
+
*/
|
102 |
public function display_get_wcj_plus_message( $value, $message_type ) {
|
103 |
|
104 |
switch ( $message_type ) {
|
135 |
return $value;
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
/**
|
139 |
* Include required core files used in admin and on the frontend.
|
140 |
*/
|
158 |
$settings[] = include_once( 'includes/class-wcj-pdf-invoices.php' );
|
159 |
$settings[] = include_once( 'includes/class-wcj-old-slugs.php' );
|
160 |
|
161 |
+
include_once( 'includes/class-wc-gateway-wcj-custom.php' );
|
162 |
+
|
163 |
// Add options
|
164 |
if ( is_admin() ) {
|
165 |
foreach ( $settings as $section ) {
|