Enabled product bundles
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Add to Cart Button Visibility
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 3.3.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_button_disable',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'Show', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Single Product Page', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_button_disable_content',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'title' => '',
|
||||
'css' => 'width:100%;',
|
||||
'tooltip' => __( 'Content to replace add to cart button on single product page.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_button_loop_disable',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'Show', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Category/Archives', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_button_loop_disable_content',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'title' => '',
|
||||
'css' => 'width:100%;',
|
||||
'tooltip' => __( 'Content to replace add to cart button on category/archives.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Admin Tools
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 3.3.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) sort `$products` with available variations listed at the top
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$products = wcj_get_product_ids_for_meta_box_options( get_the_ID(), true );
|
||||
$settings = array();
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'title',
|
||||
'title' => sprintf( __( 'Product ID: %s', 'woocommerce-jetpack' ), $product_id ) . $desc,
|
||||
'css' => 'background-color:#cddc39;color:black;',
|
||||
),
|
||||
array(
|
||||
'name' => '_regular_price' . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => __( 'Regular price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_regular_price',
|
||||
),
|
||||
array(
|
||||
'name' => '_sale_price' . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => __( 'Sale price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_sale_price',
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Coupon by User Role
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 3.6.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Invalidate for roles', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Invalidate coupon for selected user roles.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_coupon_by_user_role_invalid',
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'multiple' => 'true',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Crowdfunding
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'name' => 'wcj_crowdfunding_goal_sum',
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Goal', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_crowdfunding_startdate',
|
||||
'default' => '',
|
||||
'type' => 'date',
|
||||
'title' => __( 'Start Date', 'woocommerce-jetpack' )
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_crowdfunding_deadline',
|
||||
'default' => '',
|
||||
'type' => 'date',
|
||||
'title' => __( 'Deadline', 'woocommerce-jetpack' )
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Currency per Product
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$currency_codes = array();
|
||||
$currency_codes[''] = __( 'Default', 'woocommerce-jetpack' );
|
||||
$currency_codes[ get_option( 'woocommerce_currency' ) ] = get_option( 'woocommerce_currency' );
|
||||
$currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_codes[ get_option( 'wcj_currency_per_product_currency_' . $i ) ] = get_option( 'wcj_currency_per_product_currency_' . $i );
|
||||
}
|
||||
$options = array(
|
||||
array(
|
||||
'name' => 'wcj_currency_per_product_currency',
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'title' => __( 'Product Currency', 'woocommerce-jetpack' ),
|
||||
'options' => $currency_codes,
|
||||
'tooltip' => __( 'Update product after you change this field\'s value.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
return $options;
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Custom CSS
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Add CSS', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_css_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'CSS', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_css',
|
||||
'default' => get_option( 'wcj_custom_css_per_product_default_value', '' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;min-height:100px;',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - General
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'PayPal Email', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_paypal_per_product_email',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Max Products per User
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 3.5.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Max Qty', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_max_products_per_user_qty',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'tooltip' => __( 'If set to zero, and "All Products" section is enabled - global maximum quantity will be used; in case if "All Products" section is disabled - no maximum quantity will be used.', 'woocommerce-jetpack' ),
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Multicurrency Product Base Price
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/*
|
||||
$main_product_id = get_the_ID();
|
||||
$_product = wc_get_product( $main_product_id );
|
||||
$products = array();
|
||||
if ( $_product->is_type( 'variable' ) ) {
|
||||
$available_variations = $_product->get_available_variations();
|
||||
foreach ( $available_variations as $variation ) {
|
||||
$variation_product = wc_get_product( $variation['variation_id'] );
|
||||
$products[ $variation['variation_id'] ] = ' (' . wcj_get_product_formatted_variation( $variation_product, true ) . ')';
|
||||
}
|
||||
} else {
|
||||
$products[ $main_product_id ] = '';
|
||||
}
|
||||
$options = array();
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
$currency_codes = array();
|
||||
$currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_codes[ get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ] = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
||||
}
|
||||
$options[] = array(
|
||||
'name' => 'wcj_multicurrency_base_price_currency_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'title' => __( 'Product Currency', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_multicurrency_base_price_currency',
|
||||
'options' => $currency_codes,
|
||||
);
|
||||
}
|
||||
return $options;
|
||||
*/
|
||||
$currency_codes = array();
|
||||
$currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_codes[ get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ] = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
|
||||
}
|
||||
$options = array(
|
||||
array(
|
||||
'name' => 'wcj_multicurrency_base_price_currency',
|
||||
'default' => get_woocommerce_currency(),
|
||||
'type' => 'select',
|
||||
'title' => __( 'Product Currency', 'woocommerce-jetpack' ),
|
||||
'options' => $currency_codes,
|
||||
),
|
||||
);
|
||||
return $options;
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Multicurrency (Currency Switcher)
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$main_product_id = get_the_ID();
|
||||
$_product = wc_get_product( $main_product_id );
|
||||
if ( ! $_product ) {
|
||||
return array();
|
||||
}
|
||||
$products = array();
|
||||
if ( $_product->is_type( 'variable' ) ) {
|
||||
$list_available_variations_only = ( 'yes' === get_option( 'wcj_multicurrency_per_product_list_available_variations_only', 'yes' ) );
|
||||
$available_variations = ( $list_available_variations_only ? $_product->get_available_variations() : $_product->get_children() );
|
||||
foreach ( $available_variations as $variation ) {
|
||||
$variation_id = ( $list_available_variations_only ? $variation['variation_id'] : $variation );
|
||||
$variation_product = wc_get_product( $variation_id );
|
||||
$products[ $variation_id ] = ' (' . wcj_get_product_formatted_variation( $variation_product, true ) . ')';
|
||||
}
|
||||
} else {
|
||||
$products[ $main_product_id ] = '';
|
||||
}
|
||||
$currencies = array();
|
||||
$total_number = apply_filters( 'booster_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_code = get_option( 'wcj_multicurrency_currency_' . $i );
|
||||
$currencies = array_merge( $currencies, array(
|
||||
array(
|
||||
'name' => 'wcj_multicurrency_per_product_regular_price_' . $currency_code . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => '[' . $currency_code . '] ' . __( 'Regular Price', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_multicurrency_per_product_regular_price_' . $currency_code,
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_multicurrency_per_product_sale_price_' . $currency_code . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => '[' . $currency_code . '] ' . __( 'Sale Price', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_multicurrency_per_product_sale_price_' . $currency_code,
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
return $currencies;
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Offer Price
|
||||
*
|
||||
* @version 2.9.0
|
||||
* @since 2.9.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Enable Offer Price', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_offer_price_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Price Step', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Number of decimals', 'woocommerce' ) . '. ' . __( 'Leave blank to use global value.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_offer_price_price_step',
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'placeholder' => get_option( 'wcj_offer_price_price_step', get_option( 'woocommerce_price_num_decimals' ) ),
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Minimal Price', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Leave blank to use global value.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_offer_price_min_price',
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'placeholder' => get_option( 'wcj_offer_price_min_price', 0 ),
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Maximal Price', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Set zero to disable.', 'woocommerce-jetpack' ) . ' ' . __( 'Leave blank to use global value.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_offer_price_max_price',
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'placeholder' => get_option( 'wcj_offer_price_max_price', 0 ),
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Default Price', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Set zero to disable.', 'woocommerce-jetpack' ) . ' ' . __( 'Leave blank to use global value.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_offer_price_default_price',
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'placeholder' => get_option( 'wcj_offer_price_default_price', 0 ),
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Order Numbers
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 3.5.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Number', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_order_number',
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'custom_attributes' => 'required min="1"',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Order Min/Max Quantities
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 3.2.2
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo test "Set 0 to use global settings. Set -1 to disable"
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$main_product_id = get_the_ID();
|
||||
$_product = wc_get_product( $main_product_id );
|
||||
if ( ! $_product ) {
|
||||
return array();
|
||||
}
|
||||
$products = array();
|
||||
if ( $_product->is_type( 'variable' ) ) {
|
||||
$available_variations = $_product->get_available_variations();
|
||||
foreach ( $available_variations as $variation ) {
|
||||
$variation_product = wc_get_product( $variation['variation_id'] );
|
||||
$products[ $variation['variation_id'] ] = ' (' . wcj_get_product_formatted_variation( $variation_product, true ) . ')';
|
||||
}
|
||||
} else {
|
||||
$products[ $main_product_id ] = '';
|
||||
}
|
||||
$quantities = array();
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
if ( $this->is_min_per_product_enabled ) {
|
||||
$quantities = array_merge( $quantities, array(
|
||||
array(
|
||||
'name' => 'wcj_order_quantities_min' . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'title' => __( 'Minimum Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_order_quantities_min',
|
||||
'custom_attributes' => 'min="-1"',
|
||||
'tooltip' => __( 'Set 0 to use global settings. Set -1 to disable.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( $this->is_max_per_product_enabled ) {
|
||||
$quantities = array_merge( $quantities, array(
|
||||
array(
|
||||
'name' => 'wcj_order_quantities_max' . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'title' => __( 'Maximum Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_order_quantities_max',
|
||||
'custom_attributes' => 'min="-1"',
|
||||
'tooltip' => __( 'Set 0 to use global settings. Set -1 to disable.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
if ( $this->is_step_per_product_enabled ) {
|
||||
$quantities = array_merge( $quantities, array(
|
||||
array(
|
||||
'name' => 'wcj_order_quantities_step' . '_' . $main_product_id,
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
'title' => __( 'Quantity Step', 'woocommerce-jetpack' ),
|
||||
'desc' => ( $_product->is_type( 'variable' ) ? __( 'All variations', 'woocommerce-jetpack' ) : '' ),
|
||||
'product_id' => $main_product_id,
|
||||
'meta_name' => '_' . 'wcj_order_quantities_step',
|
||||
'custom_attributes' => 'min="0"',
|
||||
'tooltip' => __( 'Set 0 to use global settings.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $quantities;
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Orders
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$order_id = get_the_ID();
|
||||
$_order = wc_get_order( $order_id );
|
||||
if ( ! $_order ) {
|
||||
return array();
|
||||
}
|
||||
$options = array(
|
||||
array(
|
||||
'title' => __( 'Order Currency', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Save order after you change this field.', 'woocommerce-jetpack' ),
|
||||
'name' => ( 'filter' === get_option( 'wcj_order_admin_currency_method', 'filter' ) ? 'wcj_order_currency' : 'order_currency' ),
|
||||
'default' => wcj_get_order_currency( $_order ),
|
||||
'type' => 'select',
|
||||
'options' => wcj_get_currencies_names_and_symbols( 'names' ),
|
||||
),
|
||||
);
|
||||
return $options;
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - PDF Invoicing
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 3.5.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$order_id = get_the_ID();
|
||||
$_order = wc_get_order( $order_id );
|
||||
if ( ! $_order ) {
|
||||
return array();
|
||||
}
|
||||
$options = array();
|
||||
$invoice_types = wcj_get_enabled_invoice_types();
|
||||
if ( ! empty( $invoice_types ) ) {
|
||||
foreach ( $invoice_types as $invoice_type ) {
|
||||
if ( wcj_is_invoice_created( $order_id, $invoice_type['id'] ) ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'title' => sprintf( __( '%s number', 'woocommerce-jetpack' ), $invoice_type['title'] ),
|
||||
'name' => 'wcj_invoicing_' . $invoice_type['id'] . '_number_id',
|
||||
'default' => '',
|
||||
'type' => 'number',
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Price by Country
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 3.3.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$products = wcj_get_product_ids_for_meta_box_options( get_the_ID() );
|
||||
$groups = array();
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$group_currency_code = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
|
||||
$admin_title = get_option( 'wcj_price_by_country_countries_group_admin_title_' . $i, __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i );
|
||||
$countries = '';
|
||||
switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
|
||||
case 'comma_list':
|
||||
$countries .= get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
|
||||
break;
|
||||
case 'multiselect':
|
||||
$countries .= implode( ',', get_option( 'wcj_price_by_country_countries_group_' . $i ) );
|
||||
break;
|
||||
case 'chosen_select':
|
||||
$countries .= implode( ',', get_option( 'wcj_price_by_country_countries_group_chosen_select_' . $i ) );
|
||||
break;
|
||||
}
|
||||
$admin_title = '<details>' . '<summary>' . $admin_title . ' [' . $group_currency_code . ']' . '</summary>' .
|
||||
'<p>' . $countries . ' (' . count( explode( ',', $countries ) ) . ')' . '</p>' . '</details>';
|
||||
$groups = array_merge( $groups, array(
|
||||
array(
|
||||
'type' => 'title',
|
||||
'title' => $admin_title,
|
||||
'css' => 'background-color:#cddc39;color:black;',
|
||||
),
|
||||
) );
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
$groups = array_merge( $groups, array(
|
||||
array(
|
||||
'name' => 'wcj_price_by_country_regular_price_local_' . $i . '_' . $product_id,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Regular price', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_country_regular_price_local_' . $i,
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_price_by_country_sale_price_local_' . $i . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => __( 'Sale price', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_country_sale_price_local_' . $i,
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_price_by_country_make_empty_price_local_' . $i . '_' . $product_id,
|
||||
'default' => 'off',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'off' => __( 'No', 'woocommerce-jetpack' ),
|
||||
'on' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Make empty price', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_country_make_empty_price_local_' . $i,
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
return $groups;
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Price based on User Role
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) add option to disable "Copy to ..." buttons
|
||||
* @todo (maybe) "Copy to ..." for "Make Empty Price"
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$main_product_id = get_the_ID();
|
||||
$_product = wc_get_product( $main_product_id );
|
||||
$products = array();
|
||||
if ( $_product->is_type( 'variable' ) ) {
|
||||
$available_variations = $_product->get_available_variations();
|
||||
foreach ( $available_variations as $variation ) {
|
||||
$variation_product = wc_get_product( $variation['variation_id'] );
|
||||
$products[ $variation['variation_id'] ] = ' (' . wcj_get_product_formatted_variation( $variation_product, true ) . ')';
|
||||
}
|
||||
} else {
|
||||
$products[ $main_product_id ] = '';
|
||||
}
|
||||
$options = array(
|
||||
array(
|
||||
'type' => 'title',
|
||||
'title' => __( 'Per Product Settings (press Update after changing)', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_price_by_user_role_per_product_settings_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
if ( 'yes' === get_post_meta( wcj_get_product_id( $_product ), '_' . 'wcj_price_by_user_role_per_product_settings_enabled', true ) ) {
|
||||
$visible_roles = get_option( 'wcj_price_by_user_role_per_product_show_roles', '' );
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
foreach ( wcj_get_user_roles() as $role_key => $role_data ) {
|
||||
if ( ! empty( $visible_roles ) ) {
|
||||
if ( ! in_array( $role_key, $visible_roles ) ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// "Copy price to all user roles" buttons
|
||||
$roles_for_copy = ( ! empty( $visible_roles ) ? array_flip( $visible_roles ) : wcj_get_user_roles() );
|
||||
unset( $roles_for_copy[ $role_key ] );
|
||||
$roles_for_copy = array_keys( $roles_for_copy );
|
||||
if ( ! empty( $roles_for_copy ) ) {
|
||||
$copy_to_roles_regular = $this->get_admin_settings_copy_link( 'copy_to_roles', 'regular', $product_id, $role_key, $roles_for_copy, array() );
|
||||
$copy_to_roles_sale = $this->get_admin_settings_copy_link( 'copy_to_roles', 'sale', $product_id, $role_key, $roles_for_copy, array() );
|
||||
} else {
|
||||
$copy_to_roles_regular = '';
|
||||
$copy_to_roles_sale = '';
|
||||
}
|
||||
// "Copy price to all variations" buttons
|
||||
$products_for_copy = $products;
|
||||
unset( $products_for_copy[ $product_id ] );
|
||||
$products_for_copy = array_keys( $products_for_copy );
|
||||
if ( ! empty( $products_for_copy ) ) {
|
||||
$copy_to_variations_regular = $this->get_admin_settings_copy_link( 'copy_to_variations', 'regular', $product_id, $role_key, array(), $products_for_copy );
|
||||
$copy_to_variations_sale = $this->get_admin_settings_copy_link( 'copy_to_variations', 'sale', $product_id, $role_key, array(), $products_for_copy );
|
||||
} else {
|
||||
$copy_to_variations_regular = '';
|
||||
$copy_to_variations_sale = '';
|
||||
}
|
||||
// "Copy price to all user roles & variations" buttons
|
||||
if ( ! empty( $roles_for_copy ) && ! empty( $products_for_copy ) ) {
|
||||
$copy_to_roles_and_variations_regular = $this->get_admin_settings_copy_link( 'copy_to_roles_and_variations', 'regular', $product_id, $role_key,
|
||||
$roles_for_copy, $products_for_copy );
|
||||
$copy_to_roles_and_variations_sale = $this->get_admin_settings_copy_link( 'copy_to_roles_and_variations', 'sale', $product_id, $role_key,
|
||||
$roles_for_copy, $products_for_copy );
|
||||
} else {
|
||||
$copy_to_roles_and_variations_regular = '';
|
||||
$copy_to_roles_and_variations_sale = '';
|
||||
}
|
||||
$copy_buttons_regular = $copy_to_roles_regular . $copy_to_variations_regular . $copy_to_roles_and_variations_regular;
|
||||
$copy_buttons_sale = $copy_to_roles_sale . $copy_to_variations_sale . $copy_to_roles_and_variations_sale;
|
||||
// Settings
|
||||
if ( 'fixed' === get_option( 'wcj_price_by_user_role_per_product_type', 'fixed' ) ) {
|
||||
$prices_or_multiplier = array(
|
||||
array(
|
||||
'name' => 'wcj_price_by_user_role_regular_price_' . $role_key . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => __( 'Regular Price', 'woocommerce-jetpack' ) . $copy_buttons_regular,
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_user_role_regular_price_' . $role_key,
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_price_by_user_role_sale_price_' . $role_key . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => __( 'Sale Price', 'woocommerce-jetpack' ) . $copy_buttons_sale,
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_user_role_sale_price_' . $role_key,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
$prices_or_multiplier = array(
|
||||
array(
|
||||
'name' => 'wcj_price_by_user_role_multiplier_' . $role_key . '_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'title' => __( 'Multiplier', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_user_role_multiplier_' . $role_key,
|
||||
),
|
||||
);
|
||||
}
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'type' => 'title',
|
||||
'title' => '<em>' . $role_data['name'] . '</em>',
|
||||
),
|
||||
),
|
||||
$prices_or_multiplier,
|
||||
array(
|
||||
array(
|
||||
'name' => 'wcj_price_by_user_role_empty_price_' . $role_key . '_' . $product_id,
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Make Empty Price', 'woocommerce-jetpack' ),
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_price_by_user_role_empty_price_' . $role_key,
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Add To Cart
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$options = array();
|
||||
if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_add_to_cart_redirect_per_product_enabled', 'no' ) ) ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_redirect_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Add to Cart Local Redirect', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_redirect_url',
|
||||
'tooltip' => __( 'Redirect URL. Leave empty to redirect to checkout page (skipping the cart page).', 'woocommerce-jetpack' ),
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'title' => __( 'Add to Cart Local Redirect URL', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( 'per_product' === get_option( 'wcj_add_to_cart_on_visit_enabled', 'no' ) ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_on_visit_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_add_to_cart_button_custom_loop_url_per_product_enabled', 'no' ) ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_button_loop_custom_url',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'title' => __( 'Custom Add to Cart Button URL (Category/Archives)', 'woocommerce-jetpack' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_add_to_cart_button_ajax_per_product_enabled', 'no' ) ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'name' => 'wcj_add_to_cart_button_ajax_disable',
|
||||
'default' => 'as_shop_default',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'as_shop_default' => __( 'As shop default (no changes)', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Disable Add to Cart Button AJAX', 'woocommerce-jetpack' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Addons
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$options = array(
|
||||
array(
|
||||
'name' => 'wcj_product_addons_per_product_settings_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_addons_per_product_total_number',
|
||||
'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ),
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'title' => __( 'Product Addons Total Number', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
$total_number = get_post_meta( get_the_ID(), '_' . 'wcj_product_addons_per_product_total_number', true );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'title' => __( 'Product Addon', 'woocommerce-jetpack' ) . ' #' . $i . ' - ' . __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_enabled_' . $i,
|
||||
'default' => 'yes',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_type_' . $i,
|
||||
'default' => 'checkbox',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'checkbox' => __( 'Checkbox', 'woocommerce-jetpack' ),
|
||||
'radio' => __( 'Radio Buttons', 'woocommerce-jetpack' ),
|
||||
'select' => __( 'Select Box', 'woocommerce-jetpack' ),
|
||||
'text' => __( 'Text', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_title_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label(s)', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'For radio and select enter one value per line.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_label_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Price(s)', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'For radio and select enter one value per line.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_price_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'textarea',
|
||||
'css' => 'height:100px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Tooltip(s)', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'For radio enter one value per line.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_tooltip_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Default Value', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'For checkbox use \'checked\'; for radio and select enter default label. Leave blank for no default value.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_default_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Placeholder', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'For "Select Box" type only.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_placeholder_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'HTML Class', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_class_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Is required', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_required_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Quantity', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Leave empty to disable quantity calculation for the addon. When set to zero - addon will be disabled.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_addons_per_product_qty_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Bookings
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_bookings_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Visibility by Condition
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 3.6.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$option_styling = ( 'standard' === get_option( 'wcj_' . $this->id . '_select_style', 'chosen_select' ) ?
|
||||
array(
|
||||
'tooltip' => __( 'Use "Control" key to select/deselect multiple options. Hold "Control" and "A" to select all options. Leave empty to disable.', 'woocommerce-jetpack' ),
|
||||
'css' => 'height:200px;',
|
||||
'class' => 'widefat',
|
||||
'show_value' => true,
|
||||
) :
|
||||
array(
|
||||
'css' => 'width:100%;',
|
||||
'class' => 'chosen_select',
|
||||
)
|
||||
);
|
||||
$all_options = $this->get_options_list();
|
||||
$options = array();
|
||||
if ( 'invisible' != apply_filters( 'booster_option', 'visible', get_option( 'wcj_' . $this->id . '_visibility_method', 'visible' ) ) ) {
|
||||
$options = array_merge( $options, array( array_merge(
|
||||
array(
|
||||
'title' => __( 'Visible', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_' . $this->id . '_visible',
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'options' => $all_options,
|
||||
'multiple' => true,
|
||||
), $option_styling )
|
||||
) );
|
||||
}
|
||||
if ( 'visible' != apply_filters( 'booster_option', 'visible', get_option( 'wcj_' . $this->id . '_visibility_method', 'visible' ) ) ) {
|
||||
$options = array_merge( $options, array( array_merge(
|
||||
array(
|
||||
'title' => __( 'Invisible', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_' . $this->id . '_invisible',
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'options' => $all_options,
|
||||
'multiple' => true,
|
||||
), $option_styling )
|
||||
) );
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Availability by Date
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.9.1
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) Direct Date: all products
|
||||
* @todo (maybe) Direct Date: option to disable months in admin product edit page
|
||||
* @todo (maybe) Direct Date: add time also
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Enable/Disable per Product Settings', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_by_date_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no' => __( 'Disabled', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
),
|
||||
// 'tooltip' => __( 'Date formats:', 'woocommerce-jetpack' ) . ' ' . '<code>DD-DD</code>' . ', ' . '<code>DD-DD,DD-DD</code>' . ', ' . '<code>-</code>' . '.',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Direct Date', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_by_date_direct_date',
|
||||
'default' => '',
|
||||
'type' => 'date',
|
||||
'tooltip' => __( 'Fill this if you want to set one date from which the product will be available.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'If this field is filled in, monthly settings fields are ignored.', 'woocommerce-jetpack' ),
|
||||
'custom_attributes' => ( '' != ( $format = get_option( 'wcj_product_by_date_direct_date_format', '' ) ) ?
|
||||
'dateformat="' . wcj_date_format_php_to_js( $format ) . '"' : '' ),
|
||||
),
|
||||
);
|
||||
$_timestamp = 1; // January 1 1970
|
||||
for ( $i = 1; $i <= 12; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => date_i18n( 'F', $_timestamp ),
|
||||
'name' => 'wcj_product_by_date_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:300px;',
|
||||
),
|
||||
) );
|
||||
$_timestamp = strtotime( '+1 month', $_timestamp );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Availability by Time
|
||||
*
|
||||
* @version 2.9.1
|
||||
* @since 2.9.1
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Enable/Disable per Product Settings', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_by_time_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no' => __( 'Disabled', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
),
|
||||
// 'tooltip' => __( 'Time formats:', 'woocommerce-jetpack' ) . ' ' . '<code>HH:MM-HH:MM</code>' . ', ' . '<code>HH:MM-HH:MM,HH:MM-HH:MM</code>' . ', ' . '<code>-</code>' . '.',
|
||||
),
|
||||
);
|
||||
$_timestamp = strtotime( 'next Sunday' );
|
||||
for ( $i = 0; $i < 7; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => date_i18n( 'l', $_timestamp ),
|
||||
'name' => 'wcj_product_by_time_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:300px;',
|
||||
),
|
||||
) );
|
||||
$_timestamp = strtotime( '+1 day', $_timestamp );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Images
|
||||
*
|
||||
* @version 2.9.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'name' => 'wcj_product_images_meta_custom_on_single',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'title' => __( 'Replace image with custom HTML on single product page', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'You can use shortcodes here.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_images_meta_custom_on_archives',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'title' => __( 'Replace image with custom HTML on archives', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'You can use shortcodes here.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_images_hide_image_on_single',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Hide Image on Single', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_images_hide_thumb_on_single',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Hide Thumbnails on Single', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_images_hide_image_on_archives',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Hide Image on Archives', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product MSRP
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 3.6.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) `wcj_product_msrp_variable_as_simple_enabled`
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$main_product_id = get_the_ID();
|
||||
$_product = wc_get_product( $main_product_id );
|
||||
if ( ! $_product ) {
|
||||
return array();
|
||||
}
|
||||
$products = array();
|
||||
if ( $_product->is_type( 'variable' ) && 'no' === get_option( 'wcj_product_msrp_variable_as_simple_enabled', 'no' ) ) {
|
||||
$available_variations = $_product->get_available_variations();
|
||||
foreach ( $available_variations as $variation ) {
|
||||
$variation_product = wc_get_product( $variation['variation_id'] );
|
||||
$products[ $variation['variation_id'] ] = ' (' . wcj_get_product_formatted_variation( $variation_product, true ) . ')';
|
||||
}
|
||||
} else {
|
||||
$products[ $main_product_id ] = '';
|
||||
}
|
||||
|
||||
$options = array();
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
$options[] = array(
|
||||
'name' => 'wcj_msrp_' . $product_id,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'MSRP', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_msrp',
|
||||
);
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Custom CSS
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_open_price_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Default Price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'name' => 'wcj_product_open_price_default_price',
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Min Price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'name' => 'wcj_product_open_price_min_price',
|
||||
'default' => 1,
|
||||
'type' => 'price',
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Max Price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'name' => 'wcj_product_open_price_max_price',
|
||||
'default' => '',
|
||||
'type' => 'price',
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Price by Formula
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$options = array(
|
||||
array(
|
||||
'name' => 'wcj_product_price_by_formula_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( '\'Enabled\' option is ignored if \'Enable Price Calculation By Formula For All Products\' option is checked in module\'s settings.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_price_by_formula_calculation',
|
||||
'default' => 'per_product',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'per_product' => __( 'Use values below', 'woocommerce-jetpack' ),
|
||||
'global' => __( 'Use default values', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Calculation', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_price_by_formula_eval',
|
||||
'default' => get_option( 'wcj_product_price_by_formula_eval', '' ),
|
||||
'type' => 'text',
|
||||
'title' => __( 'Formula', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_product_price_by_formula_total_params',
|
||||
'default' => get_option( 'wcj_product_price_by_formula_total_params', 1 ),
|
||||
'type' => 'number',
|
||||
'title' => __( 'Number of Parameters', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
$total_params = get_post_meta( get_the_ID(), '_' . 'wcj_product_price_by_formula_total_params', false );
|
||||
if ( empty( $total_params ) ) {
|
||||
$total_params = get_option( 'wcj_product_price_by_formula_total_params', 1 );
|
||||
} else {
|
||||
$total_params = $total_params[0];
|
||||
}
|
||||
for ( $i = 1; $i <= $total_params; $i++ ) {
|
||||
$options[] = array(
|
||||
'name' => 'wcj_product_price_by_formula_param_' . $i,
|
||||
'default' => get_option( 'wcj_product_price_by_formula_param_' . $i, '' ),
|
||||
'type' => 'text',
|
||||
'title' => 'p' . $i,
|
||||
);
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Product Cost Price
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo wcj_purchase_price_currency
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$main_product_id = get_the_ID();
|
||||
$_product = wc_get_product( $main_product_id );
|
||||
if ( ! $_product ) {
|
||||
return array();
|
||||
}
|
||||
$products = array();
|
||||
if ( $_product->is_type( 'variable' ) && 'no' === get_option( 'wcj_purchase_data_variable_as_simple_enabled', 'no' ) ) {
|
||||
$available_variations = $_product->get_available_variations();
|
||||
foreach ( $available_variations as $variation ) {
|
||||
$variation_product = wc_get_product( $variation['variation_id'] );
|
||||
$products[ $variation['variation_id'] ] = ' (' . wcj_get_product_formatted_variation( $variation_product, true ) . ')';
|
||||
}
|
||||
} else {
|
||||
$products[ $main_product_id ] = '';
|
||||
}
|
||||
$options = array();
|
||||
foreach ( $products as $product_id => $desc ) {
|
||||
$product_options = array(
|
||||
array(
|
||||
'name' => 'wcj_purchase_price_' . $product_id,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Product cost (purchase) price', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_price',
|
||||
'enabled' => get_option( 'wcj_purchase_price_enabled', 'yes' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_purchase_price_extra_' . $product_id,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Extra expenses (shipping etc.)', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_price_extra',
|
||||
'enabled' => get_option( 'wcj_purchase_price_extra_enabled', 'yes' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_purchase_price_affiliate_commission_' . $product_id,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Affiliate commission', 'woocommerce-jetpack' ) . ' (' . get_woocommerce_currency_symbol() . ')',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_price_affiliate_commission',
|
||||
'enabled' => get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$the_title = get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' );
|
||||
if ( '' == $the_title ) {
|
||||
continue;
|
||||
}
|
||||
$the_type = get_option( 'wcj_purchase_data_custom_price_field_type_' . $i, 'fixed' );
|
||||
$the_default_value = get_option( 'wcj_purchase_data_custom_price_field_default_value_' . $i, 0 );
|
||||
$the_title .= ( 'fixed' === $the_type ) ? ' (' . get_woocommerce_currency_symbol() . ')' : ' (' . '%' . ')';
|
||||
$product_options[] = array(
|
||||
'name' => 'wcj_purchase_price_custom_field_' . $i . '_' . $product_id,
|
||||
'default' => $the_default_value,
|
||||
'type' => 'price',
|
||||
'title' => $the_title,
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_price_custom_field_' . $i,
|
||||
'enabled' => 'yes',
|
||||
);
|
||||
}
|
||||
$product_options = array_merge( $product_options, array(
|
||||
array(
|
||||
'name' => 'wcj_purchase_date_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'date',
|
||||
'title' => '<em>' . __( '(Last) Purchase date', 'woocommerce-jetpack' ) . '</em>',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_date',
|
||||
'enabled' => get_option( 'wcj_purchase_date_enabled', 'yes' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_purchase_partner_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'title' => '<em>' . __( 'Seller', 'woocommerce-jetpack' ) . '</em>',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_partner',
|
||||
'enabled' => get_option( 'wcj_purchase_partner_enabled', 'yes' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_purchase_info_' . $product_id,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'title' => '<em>' . __( 'Purchase info', 'woocommerce-jetpack' ) . '</em>',
|
||||
'desc' => $desc,
|
||||
'product_id' => $product_id,
|
||||
'meta_name' => '_' . 'wcj_purchase_info',
|
||||
'enabled' => get_option( 'wcj_purchase_info_enabled', 'yes' ),
|
||||
),
|
||||
) );
|
||||
$product_options = apply_filters( 'wcj_purchase_data_product_options', $product_options, $product_id, $desc );
|
||||
$options = array_merge( $options, $product_options );
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Related Products
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_id = get_the_ID();
|
||||
$products = wcj_get_products( array(), 'publish' );
|
||||
unset( $products[ $product_id ] );
|
||||
$options = array(
|
||||
array(
|
||||
'title' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'If enabled and no products selected - will hide related products section on frontend for current product.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_info_related_products_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Related Products', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Hold Control (Ctrl) key to select multiple products.', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_product_info_related_products_ids',
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'options' => $products,
|
||||
'multiple' => true,
|
||||
'css' => 'height:300px;',
|
||||
),
|
||||
);
|
||||
return $options;
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Sale Flash
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 3.2.4
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_sale_flash_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'HTML', 'woocommerce-jetpack' ),
|
||||
'name' => 'wcj_sale_flash',
|
||||
'default' => '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;min-height:100px;',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings Meta Box - Wholesale Price
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_id = get_the_ID();
|
||||
$_product = wc_get_product( $product_id );
|
||||
if ( ! $_product ) {
|
||||
return array();
|
||||
}
|
||||
$discount_type_options = array(
|
||||
'percent' => __( 'Percent', 'woocommerce-jetpack' ),
|
||||
'fixed' => __( 'Fixed', 'woocommerce-jetpack' ),
|
||||
'price_directly' => __( 'Price directly', 'woocommerce-jetpack' ),
|
||||
);
|
||||
if ( $_product->is_type( 'variable' ) ) {
|
||||
unset( $discount_type_options['price_directly'] );
|
||||
}
|
||||
$options = array(
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_per_product_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'title' => __( 'Enable per Product Levels', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_discount_type',
|
||||
'default' => 'percent',
|
||||
'type' => 'select',
|
||||
'options' => $discount_type_options,
|
||||
'title' => __( 'Discount Type', 'woocommerce-jetpack' ),
|
||||
// 'tooltip' => __( '\'Price directly\' option is only available for simple (i.e. non variable) product type.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_levels_number',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'title' => __( 'Number of levels', 'woocommerce-jetpack' ),
|
||||
'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ) . apply_filters( 'booster_option', ' ' . __( 'Free Booster\'s version is limited to one level maximum. Please visit https://booster.io to get full version.', 'woocommerce-jetpack' ), '' ),
|
||||
'custom_attributes' => 'min="0" max="' . apply_filters( 'booster_option', 1, 1000 ) . '"',
|
||||
),
|
||||
);
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number', true ) ); $i++ ) {
|
||||
$options = array_merge( $options, array(
|
||||
/*
|
||||
array(
|
||||
'type' => 'title',
|
||||
'title' => __( 'Level', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_level_min_qty_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'title' => __( 'Level', 'woocommerce-jetpack' ) . ' #' . $i . ' ' . __( 'Min quantity', 'woocommerce-jetpack' ),
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_level_discount_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Level', 'woocommerce-jetpack' ) . ' #' . $i . ' ' . ( 'price_directly' === get_post_meta( $product_id, '_' . 'wcj_wholesale_price_discount_type', true ) ? __( 'Price', 'woocommerce-jetpack' ) : __( 'Discount', 'woocommerce-jetpack' ) ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$user_roles = get_option( 'wcj_wholesale_price_by_user_role_roles', '' );
|
||||
if ( ! empty( $user_roles ) ) {
|
||||
foreach ( $user_roles as $user_role_key ) {
|
||||
$options = array_merge( $options, array(
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_levels_number_' . $user_role_key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'title' => __( 'Number of levels', 'woocommerce-jetpack' ) . ' [' . $user_role_key . ']',
|
||||
'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ) . apply_filters( 'booster_option', ' ' . __( 'Free Booster\'s version is limited to one level maximum. Please visit https://booster.io to get full version.', 'woocommerce-jetpack' ), '' ),
|
||||
'custom_attributes' => 'min="0" max="' . apply_filters( 'booster_option', 1, 1000 ) . '"',
|
||||
),
|
||||
) );
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number_' . $user_role_key, true ) ); $i++ ) {
|
||||
$options = array_merge( $options, array(
|
||||
/*
|
||||
array(
|
||||
'type' => 'title',
|
||||
'title' => __( 'Level', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_level_min_qty_' . $user_role_key . '_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'title' => __( 'Level', 'woocommerce-jetpack' ) . ' #' . $i . ' ' . __( 'Min quantity', 'woocommerce-jetpack' ) . ' [' . $user_role_key . ']',
|
||||
'custom_attributes' => 'min="0"',
|
||||
),
|
||||
array(
|
||||
'name' => 'wcj_wholesale_price_level_discount_' . $user_role_key . '_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'price',
|
||||
'title' => __( 'Level', 'woocommerce-jetpack' ) . ' #' . $i . ' ' . __( 'Discount', 'woocommerce-jetpack' ) . ' [' . $user_role_key . ']',
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
@@ -0,0 +1,33 @@
|
||||
<h1>Credit Note</h1>
|
||||
<p>
|
||||
<table class="pdf_invoice_heading_table">
|
||||
<tbody>
|
||||
<tr><th>Credit Note Nr.</th><td>[wcj_credit_note_number]</td></tr>
|
||||
<tr><th>Credit Note Date</th><td>[wcj_credit_note_date]</td></tr>
|
||||
<tr><th>Invoice Nr.</th><td>[wcj_invoice_number]</td></tr>
|
||||
<tr><th>Order Nr.</th><td>[wcj_order_number]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<table class="pdf_invoice_seller_buyer_table">
|
||||
<tbody>
|
||||
<tr><th>Seller</th><th>Buyer</th></tr>
|
||||
<tr><td>COMPANY NAME<br>COMPANY ADDRESS 1<br>COMPANY ADDRESS 2<br></td><td>[wcj_order_billing_address]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
[wcj_order_items_table table_class="pdf_invoice_items_table" price_prefix="-"
|
||||
columns="item_number|item_name|item_quantity|line_total_tax_excl"
|
||||
columns_titles="|Product|Qty|Total"
|
||||
columns_styles="width:5%;|width:75%;|width:5%;|width:15%;text-align:right;"]
|
||||
<table class="pdf_invoice_totals_table">
|
||||
<tbody>
|
||||
<tr><th>Total (excl. TAX)</th><td>-[wcj_order_total_excl_tax]</td></tr>
|
||||
<tr><th>Taxes</th><td>-[wcj_order_total_tax hide_if_zero="no"]</td></tr>
|
||||
<tr><th>Order Total</th><td>-[wcj_order_total]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>Payment method: [wcj_order_payment_method]</p>
|
||||
@@ -0,0 +1,34 @@
|
||||
<h1>Custom Document</h1>
|
||||
<p>
|
||||
<table class="pdf_invoice_heading_table">
|
||||
<tbody>
|
||||
<tr><th>Custom Document Nr.</th><td>[wcj_custom_doc_number]</td></tr>
|
||||
<tr><th>Custom Document Date</th><td>[wcj_custom_doc_date]</td></tr>
|
||||
<tr><th>Invoice Nr.</th><td>[wcj_invoice_number]</td></tr>
|
||||
<tr><th>Invoice Date</th><td>[wcj_invoice_date]</td></tr>
|
||||
<tr><th>Order Nr.</th><td>[wcj_order_number]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<table class="pdf_invoice_seller_buyer_table">
|
||||
<tbody>
|
||||
<tr><th>Seller</th><th>Buyer</th></tr>
|
||||
<tr><td>COMPANY NAME<br>COMPANY ADDRESS 1<br>COMPANY ADDRESS 2<br></td><td>[wcj_order_billing_address]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
[wcj_order_items_table table_class="pdf_invoice_items_table"
|
||||
columns="item_number|item_name|item_quantity|line_total_tax_excl"
|
||||
columns_titles="|Product|Qty|Total"
|
||||
columns_styles="width:5%;|width:75%;|width:5%;|width:15%;text-align:right;"]
|
||||
<table class="pdf_invoice_totals_table">
|
||||
<tbody>
|
||||
<tr><th>Total (excl. TAX)</th><td>[wcj_order_total_excl_tax]</td></tr>
|
||||
<tr><th>Taxes</th><td>[wcj_order_total_tax hide_if_zero="no"]</td></tr>
|
||||
<tr><th>Order Total</th><td>[wcj_order_total]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>Payment method: [wcj_order_payment_method]</p>
|
||||
@@ -0,0 +1,32 @@
|
||||
<h1>Invoice</h1>
|
||||
<p>
|
||||
<table class="pdf_invoice_heading_table">
|
||||
<tbody>
|
||||
<tr><th>Invoice Nr.</th><td>[wcj_invoice_number]</td></tr>
|
||||
<tr><th>Invoice Date</th><td>[wcj_invoice_date]</td></tr>
|
||||
<tr><th>Order Nr.</th><td>[wcj_order_number]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<table class="pdf_invoice_seller_buyer_table">
|
||||
<tbody>
|
||||
<tr><th>Seller</th><th>Buyer</th></tr>
|
||||
<tr><td>COMPANY NAME<br>COMPANY ADDRESS 1<br>COMPANY ADDRESS 2<br></td><td>[wcj_order_billing_address]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
[wcj_order_items_table table_class="pdf_invoice_items_table"
|
||||
columns="item_number|item_name|item_quantity|line_total_tax_excl"
|
||||
columns_titles="|Product|Qty|Total"
|
||||
columns_styles="width:5%;|width:75%;|width:5%;|width:15%;text-align:right;"]
|
||||
<table class="pdf_invoice_totals_table">
|
||||
<tbody>
|
||||
<tr><th>Total (excl. TAX)</th><td>[wcj_order_total_excl_tax]</td></tr>
|
||||
<tr><th>Taxes</th><td>[wcj_order_total_tax hide_if_zero="no"]</td></tr>
|
||||
<tr><th>Order Total</th><td>[wcj_order_total]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>Payment method: [wcj_order_payment_method]</p>
|
||||
@@ -0,0 +1,27 @@
|
||||
<h1>Packing Slip</h1>
|
||||
<p>
|
||||
<table class="pdf_invoice_heading_table">
|
||||
<tbody>
|
||||
<tr><th>Shipping method</th><td>[wcj_order_shipping_method]</td></tr>
|
||||
<tr><th>Proforma Invoice Nr.</th><td>[wcj_proforma_invoice_number]</td></tr>
|
||||
<tr><th>Invoice Nr.</th><td>[wcj_invoice_number]</td></tr>
|
||||
<tr><th>Order Nr.</th><td>[wcj_order_number]</td></tr>
|
||||
<tr><th>Order Date</th><td>[wcj_order_date]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<h2>Shipping address</h2>
|
||||
<p>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><td>[wcj_order_shipping_address]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<h2>Items</h2>
|
||||
<p>
|
||||
[wcj_order_items_table table_class="pdf_invoice_items_table"
|
||||
columns="item_number|item_name|item_quantity"
|
||||
columns_titles="|Item|Qty"
|
||||
columns_styles="width:5%;|width:80%;|width:15%;text-align:right;"]
|
||||
</p>
|
||||
@@ -0,0 +1,32 @@
|
||||
<h1>Proforma Invoice</h1>
|
||||
<p>
|
||||
<table class="pdf_invoice_heading_table">
|
||||
<tbody>
|
||||
<tr><th>Proforma Invoice Nr.</th><td>[wcj_proforma_invoice_number]</td></tr>
|
||||
<tr><th>Proforma Invoice Date</th><td>[wcj_proforma_invoice_date]</td></tr>
|
||||
<tr><th>Order Nr.</th><td>[wcj_order_number]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
<table class="pdf_invoice_seller_buyer_table">
|
||||
<tbody>
|
||||
<tr><th>Seller</th><th>Buyer</th></tr>
|
||||
<tr><td>COMPANY NAME<br>COMPANY ADDRESS 1<br>COMPANY ADDRESS 2<br></td><td>[wcj_order_billing_address]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p>
|
||||
[wcj_order_items_table table_class="pdf_invoice_items_table"
|
||||
columns="item_number|item_name|item_quantity|line_total_tax_excl"
|
||||
columns_titles="|Product|Qty|Total"
|
||||
columns_styles="width:5%;|width:75%;|width:5%;|width:15%;text-align:right;"
|
||||
discount_as_item="Discount"]
|
||||
<table class="pdf_invoice_totals_table">
|
||||
<tbody>
|
||||
<tr><th>Total (excl. TAX)</th><td>[wcj_order_total_excl_tax]</td></tr>
|
||||
<tr><th>Taxes</th><td>[wcj_order_total_tax hide_if_zero="no"]</td></tr>
|
||||
<tr><th>Order Total</th><td>[wcj_order_total]</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
@@ -0,0 +1,31 @@
|
||||
.pdf_invoice_heading_table {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.pdf_invoice_seller_buyer_table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
/* pdf_invoice_items_table */
|
||||
.pdf_invoice_items_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_items_table th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
.pdf_invoice_items_table td {
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
/* pdf_invoice_totals_table */
|
||||
.pdf_invoice_totals_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_totals_table th {
|
||||
width: 85%;
|
||||
text-align: right;
|
||||
}
|
||||
.pdf_invoice_totals_table td {
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
.pdf_invoice_heading_table {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.pdf_invoice_seller_buyer_table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
/* pdf_invoice_items_table */
|
||||
.pdf_invoice_items_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_items_table th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
.pdf_invoice_items_table td {
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
/* pdf_invoice_totals_table */
|
||||
.pdf_invoice_totals_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_totals_table th {
|
||||
width: 85%;
|
||||
text-align: right;
|
||||
}
|
||||
.pdf_invoice_totals_table td {
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
.pdf_invoice_heading_table {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.pdf_invoice_seller_buyer_table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
/* pdf_invoice_items_table */
|
||||
.pdf_invoice_items_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_items_table th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
.pdf_invoice_items_table td {
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
/* pdf_invoice_totals_table */
|
||||
.pdf_invoice_totals_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_totals_table th {
|
||||
width: 85%;
|
||||
text-align: right;
|
||||
}
|
||||
.pdf_invoice_totals_table td {
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
.pdf_invoice_heading_table {
|
||||
width: 50%;
|
||||
}
|
||||
.pdf_invoice_items_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_items_table th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
.pdf_invoice_items_table td {
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
.pdf_invoice_heading_table {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.pdf_invoice_seller_buyer_table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
/* pdf_invoice_items_table */
|
||||
.pdf_invoice_items_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_items_table th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
.pdf_invoice_items_table td {
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
/* pdf_invoice_totals_table */
|
||||
.pdf_invoice_totals_table {
|
||||
padding: 5px;
|
||||
}
|
||||
.pdf_invoice_totals_table th {
|
||||
width: 85%;
|
||||
text-align: right;
|
||||
}
|
||||
.pdf_invoice_totals_table td {
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
border: 1px solid #F0F0F0;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Add to Cart Button Visibility
|
||||
*
|
||||
* @version 3.4.0
|
||||
* @since 3.3.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo "Per Tag"
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$products_cats = wcj_get_terms( 'product_cat' );
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'All Products', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_add_to_cart_button_visibility_global_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'All Products', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_add_to_cart_button_global_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Buttons on Category/Archives Pages', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_disable_archives',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Content to replace with on archives (can be empty). You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_archives_content',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Buttons on Single Product Pages', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_disable_single',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Content to replace with on single product pages (can be empty). You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_single_content',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_add_to_cart_button_visibility_global_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_add_to_cart_button_visibility_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => __( 'This will add meta box to each product\'s edit page', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_per_product_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_add_to_cart_button_visibility_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Category', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_add_to_cart_button_visibility_per_category_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Category', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_add_to_cart_button_per_category_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Buttons on Category/Archives Pages', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_per_category_disable_loop',
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $products_cats,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Content to replace with on archives (can be empty). You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_per_category_content_loop',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Buttons on Single Product Pages', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_per_category_disable_single',
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $products_cats,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Content to replace with on single product pages (can be empty). You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_button_per_category_content_single',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_add_to_cart_button_visibility_per_category_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Add to Cart
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Per Category Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This sections lets you set Add to Cart button text on per category basis.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_category_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Category Labels', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable Section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => '',
|
||||
'id' => 'wcj_add_to_cart_per_category_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Category Groups Number', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Click "Save changes" after you change this number.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_category_total_groups_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '1' )
|
||||
),
|
||||
'css' => 'width:100px;',
|
||||
),
|
||||
);
|
||||
$product_cats = array();
|
||||
$product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
|
||||
if ( ! empty( $product_categories ) && ! is_wp_error( $product_categories ) ){
|
||||
foreach ( $product_categories as $product_category ) {
|
||||
$product_cats[ $product_category->term_id ] = $product_category->name;
|
||||
}
|
||||
}
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_add_to_cart_per_category_total_groups_number', 1 ) ); $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_category_enabled_group_' . $i,
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( '', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_category_ids_group_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Button text - single product view', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_category_text_single_group_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:20%;min-width:200px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Button text - product archive (category) view', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_category_text_archive_group_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:20%;min-width:200px;',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_add_to_cart_per_category_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you set Add to Cart button text on per product basis. When enabled, label for each product can be changed in "Edit Product".', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product Labels', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable Section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => '',
|
||||
'id' => 'wcj_add_to_cart_per_product_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_add_to_cart_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product Type 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',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product Type Labels', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable Section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_add_to_cart_text_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
) );
|
||||
$groups_by_product_type = array(
|
||||
array(
|
||||
'id' => 'simple',
|
||||
'title' => __( 'Simple product', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'Add to cart', 'woocommerce' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'variable',
|
||||
'title' => __( 'Variable product', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'Select options', 'woocommerce' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'external',
|
||||
'title' => __( 'External product', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'Buy product', 'woocommerce' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'grouped',
|
||||
'title' => __( 'Grouped product', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'View products', 'woocommerce' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'other',
|
||||
'title' => __( 'Other product', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'Read more', 'woocommerce' ),
|
||||
),
|
||||
);
|
||||
foreach ( $groups_by_product_type as $group_by_product_type ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $group_by_product_type['title'],
|
||||
'id' => 'wcj_add_to_cart_text_on_single_' . $group_by_product_type['id'],
|
||||
'desc' => __( 'Single product view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable.', 'woocommerce-jetpack' ) . ' ' . __( 'Default: ', 'woocommerce-jetpack' ) . $group_by_product_type['default'],
|
||||
'default' => $group_by_product_type['default'],
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_add_to_cart_text_on_archives_' . $group_by_product_type['id'],
|
||||
'desc' => __( 'Product category (archive) view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable.', 'woocommerce-jetpack' ) . ' ' . __( 'Default: ', 'woocommerce-jetpack' ) . $group_by_product_type['default'],
|
||||
'default' => $group_by_product_type['default'],
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
) );
|
||||
if ( 'variable' !== $group_by_product_type['id'] )
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'desc' => __( 'Products on sale. Single product view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable. Default: Add to cart', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_text_on_single_sale_' . $group_by_product_type['id'],
|
||||
'default' => __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Products on sale. Product category (archive) view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable. Default: Add to cart', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_text_on_archives_sale_' . $group_by_product_type['id'],
|
||||
'default' => __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Products with price set to 0 (i.e. free). Single product view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable. Default: Add to cart', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_text_on_single_zero_price_' . $group_by_product_type['id'],
|
||||
'default' => __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Products with price set to 0 (i.e. free). Product category (archive) view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable. Default: Add to cart', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_text_on_archives_zero_price_' . $group_by_product_type['id'],
|
||||
'default' => __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Products with empty price. Product category (archive) view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable. Default: Read More', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_add_to_cart_text_on_archives_no_price_' . $group_by_product_type['id'],
|
||||
'default' => __( 'Read More', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
) );
|
||||
if ( 'external' === $group_by_product_type['id'] ) {
|
||||
continue;
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'id' => 'wcj_add_to_cart_text_on_single_in_cart_' . $group_by_product_type['id'],
|
||||
'desc' => __( 'Already in cart. Single product view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Try: ', 'woocommerce-jetpack' ) . __( 'Already in cart - Add Again?', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Default: ', 'woocommerce-jetpack' ) . __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_add_to_cart_text_on_archives_in_cart_' . $group_by_product_type['id'],
|
||||
'desc' => __( 'Already in cart. Product category (archive) view.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Try: ', 'woocommerce-jetpack' ) . __( 'Already in cart - Add Again?', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Default: ', 'woocommerce-jetpack' ) . __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'default' => __( 'Add to cart', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:30%;min-width:300px;',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_add_to_cart_text_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Address Formats
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Force Base Country Display', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_address_formats_force_country_display_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Force Base Country Display', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_address_formats_force_country_display',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_address_formats_force_country_display_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Address Formats by Country', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_address_formats_country_options',
|
||||
),
|
||||
);
|
||||
$formats = $this->get_default_address_formats(); // WC()->countries->get_address_formats();
|
||||
foreach ( $formats as $country_code => $format ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => ( 'default' === $country_code ) ? $country_code : $country_code . ' - ' . wcj_get_country_name_by_code( $country_code ),
|
||||
'id' => 'wcj_address_formats_country_' . $country_code,
|
||||
'default' => $format,
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:300px;height:200px;',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_address_formats_country_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Admin Bar
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 2.9.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_admin_bar_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"WooCommerce" Admin Bar', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_bar_wc_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Booster" Admin Bar', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_bar_booster_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Booster: Active" Admin Bar', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_bar_booster_active_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_admin_bar_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Admin Orders List
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 3.2.4
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Custom Columns', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you add custom columns to WooCommerce orders list.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Columns', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_admin_list_custom_columns_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Billing Country', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add column and filtering', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_country',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency Code', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add column and filtering', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_currency',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Columns Total Number', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '0', )
|
||||
),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Custom Column', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Key:', 'woocommerce-jetpack' ) . ' <code>' . 'wcj_orders_custom_column_' . $i . '</code>',
|
||||
'id' => 'wcj_orders_list_custom_columns_enabled_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_label_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use shortcodes and/or HTML here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_value_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Sortable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_sortable_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
'meta_value' => __( 'By meta (as text)', 'woocommerce-jetpack' ),
|
||||
'meta_value_num' => __( 'By meta (as numbers)', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Key (if sortable)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_list_custom_columns_sortable_key_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_orders_list_custom_columns_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Multiple Status', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_admin_list_multiple_status_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Multiple Status', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_admin_list_multiple_status_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Multiple Status Filtering', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_multiple_status_filter',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no' => __( 'Do not add', 'woocommerce-jetpack' ),
|
||||
'multiple_select' => __( 'Add as multiple select', 'woocommerce-jetpack' ),
|
||||
'checkboxes' => __( 'Add as checkboxes', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Default Statuses Menu', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_hide_default_statuses_menu',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add "Not Completed" Status Link to Default Statuses Menu', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_multiple_status_not_completed_link',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Presets to Admin Menu', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Add presets', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => __( 'To add presets, "Multiple Status Filtering" option must be enabled (as multiple select or as checkboxes).', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_multiple_status_admin_menu',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Add order counter', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_multiple_status_admin_menu_counter',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Remove original "Orders" menu', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_multiple_status_admin_menu_remove_original',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Presets', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_list_multiple_status_presets_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
) );
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_order_admin_list_multiple_status_presets_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'desc' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Must be not empty.', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_order_admin_list_multiple_status_presets_titles[$i]",
|
||||
'default' => __( 'Preset', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Statuses', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Must be not empty.', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_order_admin_list_multiple_status_presets_statuses[$i]",
|
||||
'default' => array(),
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_order_statuses( false ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_admin_list_multiple_status_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Columns Order', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_admin_list_columns_order_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Columns Order', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_admin_list_columns_order_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_order_admin_list_columns_order',
|
||||
'desc_tip' => __( 'Default columns order', 'woocommerce-jetpack' ) . ':<br>' . str_replace( PHP_EOL, '<br>', $this->get_orders_default_columns_in_order() ),
|
||||
'default' => $this->get_orders_default_columns_in_order(),
|
||||
'type' => 'textarea',
|
||||
'css' => 'height:300px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_admin_list_columns_order_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Admin Products List
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 3.2.4
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Custom Columns', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_products_admin_list_custom_columns_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable/Disable', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_products_admin_list_custom_columns_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Columns Total Number', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Save module\'s settings after changing this option to see new settings fields.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_products_admin_list_custom_columns_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '0', )
|
||||
),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_products_admin_list_custom_columns_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Custom Column', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Key:', 'woocommerce-jetpack' ) . ' <code>' . 'wcj_products_custom_column_' . $i . '</code>',
|
||||
'id' => 'wcj_products_admin_list_custom_columns_enabled_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_products_admin_list_custom_columns_label_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use shortcodes and/or HTML here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_products_admin_list_custom_columns_value_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_products_admin_list_custom_columns_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Columns Order', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_products_admin_list_columns_order_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable/Disable', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_products_admin_list_columns_order_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_products_admin_list_columns_order',
|
||||
'desc_tip' => __( 'Default columns order', 'woocommerce-jetpack' ) . ':<br>' . str_replace( PHP_EOL, '<br>', $this->get_products_default_columns_in_order() ),
|
||||
'default' => $this->get_products_default_columns_in_order(),
|
||||
'type' => 'textarea',
|
||||
'css' => 'height:300px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_products_admin_list_columns_order_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Admin Tools
|
||||
*
|
||||
* @version 3.5.3
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Admin Tools Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_admin_tools_module_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Show Booster Menus Only to Admin', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_tools_show_menus_to_admin_only',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Log', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_logging_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'WooCommerce Log', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_wc_logging_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Debug', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_debuging_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'PHP Memory Limit', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'megabytes.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set zero to disable.', 'woocommerce-jetpack' ) . $this->current_php_memory_limit,
|
||||
'id' => 'wcj_admin_tools_php_memory_limit',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'PHP Time Limit', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'seconds.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set zero to disable.', 'woocommerce-jetpack' ) . $this->current_php_time_limit,
|
||||
'id' => 'wcj_admin_tools_php_time_limit',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'title' => __( 'Custom Shortcode', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_shortcode_1',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'title' => __( 'System Info', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_tools_system_info',
|
||||
'default' => '',
|
||||
'type' => 'custom_link',
|
||||
'link' => '<pre>' . wcj_get_table_html( $this->get_system_info_table_array(), array( 'columns_styles' => array( 'padding:0;', 'padding:0;' ), 'table_heading_type' => 'vertical' ) ) . '</pre>',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Show Order Meta', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_tools_show_order_meta_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Show Product Meta', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_tools_show_product_meta_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Show Variable Product Pricing Table', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_admin_tools_variable_product_pricing_table_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_admin_tools_module_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Breadcrumbs
|
||||
*
|
||||
* @version 2.9.0
|
||||
* @since 2.9.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_breadcrumbs_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Change Breadcrumbs Home URL', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_breadcrumbs_change_home_url_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Home URL', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_breadcrumbs_home_url',
|
||||
'default' => home_url(),
|
||||
'type' => 'text',
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Breadcrumbs', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_breadcrumbs_hide',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_breadcrumbs_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Call for Price
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Call for Price Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'Leave price empty when adding or editing products. Then set the options here.', 'woocommerce-jetpack' ) .
|
||||
' ' . __( 'You can use shortcodes in options.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_call_for_price_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label to Show on Single', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_call_for_price_text',
|
||||
'default' => '<strong>Call for price</strong>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label to Show on Archives', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_call_for_price_text_on_archive',
|
||||
'default' => '<strong>Call for price</strong>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label to Show on Homepage', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_call_for_price_text_on_home',
|
||||
'default' => '<strong>Call for price</strong>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label to Show on Related', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_call_for_price_text_on_related',
|
||||
'default' => '<strong>Call for price</strong>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label to Show for Variations', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_call_for_price_text_variation',
|
||||
'default' => '<strong>Call for price</strong>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Sale! Tag', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide the tag', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_call_for_price_hide_sale_sign',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Make All Products Call for Price', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this to make all products prices empty. When checkbox disabled, all prices go back to normal.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_call_for_price_make_all_empty',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_call_for_price_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Cart Customization
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_cart_customization_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Coupon on Cart Page', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_hide_coupon',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Item Remove Link', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_hide_item_remove_link',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Change Empty Cart "Return to shop" Button Text', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_customization_return_to_shop_button_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Method', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_customization_return_to_shop_button_text_method',
|
||||
'default' => 'js',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'js' => __( 'Use JavaScript', 'woocommerce-jetpack' ),
|
||||
'template' => __( 'Replace empty cart template', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Text', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_customization_return_to_shop_button_text',
|
||||
'default' => __( 'Return to shop', 'woocommerce' ),
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Change Empty Cart "Return to shop" Button Link', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_customization_return_to_shop_button_link_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Link', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_customization_return_to_shop_button_link',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:300px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_cart_customization_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Cart Custom Info
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) 'Hide "Note: Shipping and taxes are estimated..." message on Cart page' - `wcj_cart_hide_shipping_and_taxes_estimated_message`
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
// Cart Custom Info Options
|
||||
array(
|
||||
'title' => __( 'Cart Custom Info Blocks', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_cart_custom_info_options',
|
||||
'desc' => __( 'This feature allows you to add a final checkpoint for your customers before they proceed to payment.', 'woocommerce-jetpack' ) . '<br>' .
|
||||
__( 'Show custom information at on the cart page using Booster\'s various shortcodes and give your customers a seamless cart experience.', 'woocommerce-jetpack' ) . '<br>' .
|
||||
__( 'For example, show them the total weight of their items, any additional fees or taxes, or a confirmation of the address their products are being sent to.', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Blocks', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_custom_info_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_cart_custom_info_options',
|
||||
),
|
||||
);
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) ); $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Info Block', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_cart_custom_info_options_' . $i,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_custom_info_content_' . $i,
|
||||
'default' => '[wcj_cart_items_total_weight before="Total weight: " after=" kg"]',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:200px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_custom_info_hook_' . $i,
|
||||
'default' => 'woocommerce_after_cart_totals',
|
||||
'type' => 'select',
|
||||
'options' => wcj_get_cart_filters(),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position Order (i.e. Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_custom_info_priority_' . $i,
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_cart_custom_info_options_' . $i,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
// Cart Items Table Custom Info Options
|
||||
array(
|
||||
'title' => __( 'Cart Items Table Custom Info', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_cart_custom_info_item_options',
|
||||
'desc' => '',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add to Each Item Name', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use shortcodes here. E.g.: [wcj_product_sku]. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_cart_custom_info_item',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_cart_custom_info_item_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Checkout Core Fields
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_cats = wcj_get_terms( 'product_cat' );
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_core_fields_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Override Default Address Fields', 'woocommerce-jetpack' ),
|
||||
'type' => 'select',
|
||||
'id' => 'wcj_checkout_core_fields_override_default_address_fields',
|
||||
'default' => 'billing',
|
||||
'options' => array(
|
||||
'billing' => __( 'Override with billing fields', 'woocommerce-jetpack' ),
|
||||
'shipping' => __( 'Override with shipping fields', 'woocommerce-jetpack' ),
|
||||
'disable' => __( 'Do not override', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Override Country Locale Fields', 'woocommerce-jetpack' ),
|
||||
'type' => 'select',
|
||||
'id' => 'wcj_checkout_core_fields_override_country_locale_fields',
|
||||
'default' => 'billing',
|
||||
'options' => array(
|
||||
'billing' => __( 'Override with billing fields', 'woocommerce-jetpack' ),
|
||||
'shipping' => __( 'Override with shipping fields', 'woocommerce-jetpack' ),
|
||||
'disable' => __( 'Do not override', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Force Fields Sort by Priority', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this if you are having theme related issues with "priority (i.e. order)" options.', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_checkout_core_fields_force_sort_by_priority',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_core_fields_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Fields Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_core_fields_options',
|
||||
),
|
||||
);
|
||||
foreach ( $this->woocommerce_core_checkout_fields as $field ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => ucwords( str_replace( '_', ' ', $field ) ),
|
||||
'desc' => __( 'enabled', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'is_enabled',
|
||||
'default' => 'default',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'default' => __( 'Default', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'Disabled', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'required', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'is_required',
|
||||
'default' => 'default',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'default' => __( 'Default', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Required', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'Not Required', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'desc' => __( 'label', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank for WooCommerce defaults.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'label',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'placeholder', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank for WooCommerce defaults.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'placeholder',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'description', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank for WooCommerce defaults.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'description',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'class', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'class',
|
||||
'default' => 'default',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'default' => __( 'Default', 'woocommerce-jetpack' ),
|
||||
'form-row-first' => __( 'Align Left', 'woocommerce-jetpack' ),
|
||||
'form-row-last' => __( 'Align Right', 'woocommerce-jetpack' ),
|
||||
'form-row-full' => __( 'Full Row', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'priority (i.e. order)', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave zero for WooCommerce defaults.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc_no_link' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'priority',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'include product categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If not empty - selected categories products must be in cart for current field to appear.', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc_no_link' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'cats_incl',
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
'options' => $product_cats,
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'exclude product categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If not empty - current field is hidden, if selected categories products are in cart.', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc_no_link' ),
|
||||
'id' => 'wcj_checkout_fields_' . $field . '_' . 'cats_excl',
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
'options' => $product_cats,
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_core_fields_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,377 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Checkout Custom Fields
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_cats = wcj_get_terms( 'product_cat' );
|
||||
$products = wcj_get_products();
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_custom_fields_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add All Fields to Admin Emails', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_email_all_to_admin',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add All Fields to Customers Emails', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_email_all_to_customer',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Emails Fields Template', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Before the fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_emails_template_before',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Each field', 'woocommerce-jetpack' ) . '. ' . wcj_message_replaced_values( array( '%label%', '%value%' ) ),
|
||||
'id' => 'wcj_checkout_custom_fields_emails_template_field',
|
||||
'default' => '<p><strong>%label%:</strong> %value%</p>',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'After the fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_emails_template_after',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add All Fields to "Order Received" (i.e. "Thank You") and "View Order" Pages', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_add_to_order_received',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Order Received" Fields Template', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Before the fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_order_received_template_before',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Each field', 'woocommerce-jetpack' ) . '. ' . wcj_message_replaced_values( array( '%label%', '%value%' ) ),
|
||||
'id' => 'wcj_checkout_custom_fields_order_received_template_field',
|
||||
'default' => '<p><strong>%label%:</strong> %value%</p>',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'After the fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_order_received_template_after',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Fields Number', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Click Save changes after you change this number.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_fields_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '1' )
|
||||
),
|
||||
'css' => 'width:100px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_custom_fields_options',
|
||||
),
|
||||
);
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
|
||||
$settings = array_merge( $settings,
|
||||
array(
|
||||
array(
|
||||
'title' => __( 'Custom Field', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_custom_fields_options_' . $i,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable/Disable', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => __( 'Key', 'woocommerce-jetpack' ) . ': ' .
|
||||
'<code>' . get_option( 'wcj_checkout_custom_field_section_' . $i, 'billing' ) . '_' . 'wcj_checkout_field_' . $i . '</code>',
|
||||
'id' => 'wcj_checkout_custom_field_enabled_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_type_' . $i,
|
||||
'default' => 'text',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'text' => __( 'Text', 'woocommerce-jetpack' ),
|
||||
'textarea' => __( 'Textarea', 'woocommerce-jetpack' ),
|
||||
'number' => __( 'Number', 'woocommerce-jetpack' ),
|
||||
'checkbox' => __( 'Checkbox', 'woocommerce-jetpack' ),
|
||||
'datepicker' => __( 'Datepicker', 'woocommerce-jetpack' ),
|
||||
'weekpicker' => __( 'Weekpicker', 'woocommerce-jetpack' ),
|
||||
'timepicker' => __( 'Timepicker', 'woocommerce-jetpack' ),
|
||||
'select' => __( 'Select', 'woocommerce-jetpack' ),
|
||||
'radio' => __( 'Radio', 'woocommerce-jetpack' ),
|
||||
'password' => __( 'Password', 'woocommerce-jetpack' ),
|
||||
'country' => __( 'Country', 'woocommerce-jetpack' ),
|
||||
'state' => __( 'State', 'woocommerce-jetpack' ),
|
||||
'email' => __( 'Email', 'woocommerce-jetpack' ),
|
||||
'tel' => __( 'Phone', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Required', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_required_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_label_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Placeholder', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_placeholder_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Priority (i.e. Order)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_priority_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Section', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_section_' . $i,
|
||||
'default' => 'billing',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'billing' => __( 'Billing', 'woocommerce-jetpack' ),
|
||||
'shipping' => __( 'Shipping', 'woocommerce-jetpack' ),
|
||||
'order' => __( 'Order Notes', 'woocommerce-jetpack' ),
|
||||
'account' => __( 'Account', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Class', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_class_' . $i,
|
||||
'default' => 'form-row-wide',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'form-row-wide' => __( 'Wide', 'woocommerce-jetpack' ),
|
||||
'form-row-first' => __( 'First', 'woocommerce-jetpack' ),
|
||||
'form-row-last' => __( 'Last', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Clear', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_clear_' . $i,
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customer Meta Fields', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_customer_meta_fields_' . $i,
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Select/Radio: Options', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'One option per line', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_select_options_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'min-width:300px;height:150px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Select: Use select2 Library', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_select_select2_' . $i,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'select2: min input length', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'select2: Number of characters necessary to start a search.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Ignored if set to zero.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_select_select2_min_input_length' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'select2: max input length', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'select2: Maximum number of characters that can be entered for an input.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Ignored if set to zero.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_select_select2_max_input_length' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_custom_field_checkbox_yes_' . $i,
|
||||
'title' => __( 'Checkbox: Value for ON', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'default' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_custom_field_checkbox_no_' . $i,
|
||||
'title' => __( 'Checkbox: Value for OFF', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'default' => __( 'No', 'woocommerce-jetpack' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_custom_field_checkbox_default_' . $i,
|
||||
'title' => __( 'Checkbox: Default Value', 'woocommerce-jetpack' ),
|
||||
'type' => 'select',
|
||||
'default' => 'no',
|
||||
'options' => array(
|
||||
'no' => __( 'Not Checked', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Checked', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker: Date Format', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Visit <a href="https://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">documentation on date and time formatting</a> for valid date formats', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to use your current WordPress format', 'woocommerce-jetpack' ) . ': ' . get_option( 'date_format' ),
|
||||
'id' => 'wcj_checkout_custom_field_datepicker_format_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker: Min Date', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'days', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_datepicker_mindate_' . $i,
|
||||
'type' => 'number',
|
||||
'default' => -365,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker: Max Date', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'days', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_datepicker_maxdate_' . $i,
|
||||
'type' => 'number',
|
||||
'default' => 365,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker: Add Year Selector', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_datepicker_changeyear_' . $i,
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker: Year Selector: Year Range', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'The range of years displayed in the year drop-down: either relative to today\'s year ("-nn:+nn"), relative to the currently selected year ("c-nn:c+nn"), absolute ("nnnn:nnnn"), or combinations of these formats ("nnnn:-nn"). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_datepicker_yearrange_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => 'c-10:c+10',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker: First Week Day', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_datepicker_firstday_' . $i,
|
||||
'type' => 'select',
|
||||
'default' => 0,
|
||||
'options' => array(
|
||||
__( 'Sunday', 'woocommerce-jetpack' ),
|
||||
__( 'Monday', 'woocommerce-jetpack' ),
|
||||
__( 'Tuesday', 'woocommerce-jetpack' ),
|
||||
__( 'Wednesday', 'woocommerce-jetpack' ),
|
||||
__( 'Thursday', 'woocommerce-jetpack' ),
|
||||
__( 'Friday', 'woocommerce-jetpack' ),
|
||||
__( 'Saturday', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Timepicker: Time Format', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Visit <a href="http://timepicker.co/options/" target="_blank">timepicker options page</a> for valid time formats', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_timepicker_format_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => 'hh:mm p',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Timepicker: Interval', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'minutes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_timepicker_interval_' . $i,
|
||||
'type' => 'number',
|
||||
'default' => 15,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hide this field if there is a product of selected category in cart.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_categories_ex_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Include Categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Show this field only if there is a product of selected category in cart.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_categories_in_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Products', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hide this field if there is a selected product in cart.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_products_ex_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $products,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Include Products', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Show this field only if there is a selected product in cart.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_products_in_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $products,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Min Cart Amount', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Show this field only if cart total is at least this amount. Set zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_min_cart_amount_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0, 'step' => wcj_get_wc_price_step() ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Max Cart Amount', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Show this field only if cart total is not more than this amount. Set zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_field_max_cart_amount_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0, 'step' => wcj_get_wc_price_step() ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_custom_fields_options_' . $i,
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Checkout Custom Info
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Checkout Custom Info Blocks', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_custom_info_blocks_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Blocks', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_info_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_custom_info_blocks_options',
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Info Block', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_custom_info_options_' . $i,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_info_content_' . $i,
|
||||
'default' => '[wcj_cart_items_total_weight before="Total weight: " after=" kg"]',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:200px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_info_hook_' . $i,
|
||||
'default' => 'woocommerce_checkout_after_order_review',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
|
||||
'woocommerce_before_checkout_form' => __( 'Before checkout form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_before_customer_details' => __( 'Before customer details', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_billing' => __( 'Billing', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_shipping' => __( 'Shipping', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_after_customer_details' => __( 'After customer details', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_before_order_review' => __( 'Before order review', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_order_review' => __( 'Order review', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
|
||||
/*
|
||||
'woocommerce_before_checkout_shipping_form' => __( 'woocommerce_before_checkout_shipping_form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_shipping_form' => __( 'woocommerce_after_checkout_shipping_form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_order_notes' => __( 'woocommerce_before_order_notes', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_order_notes' => __( 'woocommerce_after_order_notes', 'woocommerce-jetpack' ),
|
||||
|
||||
'woocommerce_before_checkout_billing_form' => __( 'woocommerce_before_checkout_billing_form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_billing_form' => __( 'woocommerce_after_checkout_billing_form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_checkout_registration_form' => __( 'woocommerce_before_checkout_registration_form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_registration_form' => __( 'woocommerce_after_checkout_registration_form', 'woocommerce-jetpack' ),
|
||||
|
||||
'woocommerce_review_order_before_cart_contents' => __( 'woocommerce_review_order_before_cart_contents', 'woocommerce-jetpack' ),
|
||||
'woocommerce_review_order_after_cart_contents' => __( 'woocommerce_review_order_after_cart_contents', 'woocommerce-jetpack' ),
|
||||
'woocommerce_review_order_before_shipping' => __( 'woocommerce_review_order_before_shipping', 'woocommerce-jetpack' ),
|
||||
'woocommerce_review_order_after_shipping' => __( 'woocommerce_review_order_after_shipping', 'woocommerce-jetpack' ),
|
||||
'woocommerce_review_order_before_order_total' => __( 'woocommerce_review_order_before_order_total', 'woocommerce-jetpack' ),
|
||||
'woocommerce_review_order_after_order_total' => __( 'woocommerce_review_order_after_order_total', 'woocommerce-jetpack' ),
|
||||
*/
|
||||
'woocommerce_thankyou' => __( 'Order Received (Thank You) page', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position Order (i.e. Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_custom_info_priority_' . $i,
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_custom_info_options_' . $i,
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Checkout Customization
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Restrict Countries by Customer\'s IP', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_restrict_countries_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Restrict Billing Countries by Customer\'s IP', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_restrict_countries_by_customer_ip_billing',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Restrict Shipping Countries by Customer\'s IP', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => sprintf( __( 'To restrict shipping countries, "Shipping location(s)" option in %s must be set to "Ship to specific countries only" (and you can leave "Ship to specific countries" option empty there).', 'woocommerce-jetpack' ),
|
||||
'<a target="_blank" href="' . admin_url( 'admin.php?page=wc-settings&tab=general' ) . '">' .
|
||||
__( 'WooCommerce > Settings > General', 'woocommerce-jetpack' ) . '</a>' ) . '<br>' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_checkout_restrict_countries_by_customer_ip_shipping',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_restrict_countries_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Create an account?" Checkbox Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_create_account_checkbox_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Create an account?" Checkbox', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( '"Create an account?" checkbox default value', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_create_account_default_checked',
|
||||
'default' => 'default',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'default' => __( 'WooCommerce default', 'woocommerce-jetpack' ),
|
||||
'checked' => __( 'Checked', 'woocommerce-jetpack' ),
|
||||
'not_checked' => __( 'Not checked', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_create_account_checkbox_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Order Again" Button Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_order_again_button_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide "Order Again" Button on "View Order" Page', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_hide_order_again',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_order_again_button_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Fields on Checkout for Logged Users', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_customization_disable_fields_for_logged_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Fields to Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_customization_disable_fields_for_logged',
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => array(
|
||||
'billing_country' => __( 'Billing country', 'woocommerce-jetpack' ),
|
||||
'billing_first_name' => __( 'Billing first name', 'woocommerce-jetpack' ),
|
||||
'billing_last_name' => __( 'Billing last name', 'woocommerce-jetpack' ),
|
||||
'billing_company' => __( 'Billing company', 'woocommerce-jetpack' ),
|
||||
'billing_address_1' => __( 'Billing address 1', 'woocommerce-jetpack' ),
|
||||
'billing_address_2' => __( 'Billing address 2', 'woocommerce-jetpack' ),
|
||||
'billing_city' => __( 'Billing city', 'woocommerce-jetpack' ),
|
||||
'billing_state' => __( 'Billing state', 'woocommerce-jetpack' ),
|
||||
'billing_postcode' => __( 'Billing postcode', 'woocommerce-jetpack' ),
|
||||
'billing_email' => __( 'Billing email', 'woocommerce-jetpack' ),
|
||||
'billing_phone' => __( 'Billing phone', 'woocommerce-jetpack' ),
|
||||
'shipping_country' => __( 'Shipping country', 'woocommerce-jetpack' ),
|
||||
'shipping_first_name' => __( 'Shipping first name', 'woocommerce-jetpack' ),
|
||||
'shipping_last_name' => __( 'Shipping last name', 'woocommerce-jetpack' ),
|
||||
'shipping_company' => __( 'Shipping company', 'woocommerce-jetpack' ),
|
||||
'shipping_address_1' => __( 'Shipping address 1', 'woocommerce-jetpack' ),
|
||||
'shipping_address_2' => __( 'Shipping address 2', 'woocommerce-jetpack' ),
|
||||
'shipping_city' => __( 'Shipping city', 'woocommerce-jetpack' ),
|
||||
'shipping_state' => __( 'Shipping state', 'woocommerce-jetpack' ),
|
||||
'shipping_postcode' => __( 'Shipping postcode', 'woocommerce-jetpack' ),
|
||||
'order_comments' => __( 'Order comments', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Message for logged users', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use HTML here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_customization_disable_fields_for_logged_message',
|
||||
'default' => '<em>' . __( 'This field can not be changed', 'woocommerce-jetpack' ) . '</em>',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Advanced: Custom fields (readonly).', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => sprintf( __( 'Comma separated list of fields ids, e.g.: %s.', 'woocommerce-jetpack' ), '<em>billing_wcj_checkout_field_1, billing_wcj_checkout_field_2</em>' ),
|
||||
'id' => 'wcj_checkout_customization_disable_fields_for_logged_custom_r',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Advanced: Custom fields (disabled).', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => sprintf( __( 'Comma separated list of fields ids, e.g.: %s.', 'woocommerce-jetpack' ), '<em>billing_wcj_checkout_field_1, billing_wcj_checkout_field_2</em>' ),
|
||||
'id' => 'wcj_checkout_customization_disable_fields_for_logged_custom_d',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_customization_disable_fields_for_logged_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Order received" Message Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_customization_order_received_message_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customize Message', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_customization_order_received_message_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc_tip' => __( 'You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_customization_order_received_message',
|
||||
'default' => __( 'Thank you. Your order has been received.', 'woocommerce' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_customization_order_received_message_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Returning customer?" Message Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_customization_checkout_login_message_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customize Message', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_customization_checkout_login_message_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_customization_checkout_login_message',
|
||||
'default' => __( 'Returning customer?', 'woocommerce' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_customization_checkout_login_message_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Checkout Fees
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 3.7.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Fees', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_fees_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Fees', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_fees_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_fees_general_options',
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_fees_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Fee', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => "wcj_checkout_fees_data_options[$i]",
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable/Disable', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_checkout_fees_data_enabled[$i]",
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_checkout_fees_data_titles[$i]",
|
||||
'default' => __( 'Fee', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_checkout_fees_data_types[$i]",
|
||||
'default' => 'fixed',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'fixed' => __( 'Fixed', 'woocommerce-jetpack' ),
|
||||
'percent' => __( 'Percent', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_checkout_fees_data_values[$i]",
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => 0.000001 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Taxable', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_checkout_fees_data_taxable[$i]",
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => "wcj_checkout_fees_data_options[$i]",
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Checkout Files Upload
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_tags_options = wcj_get_terms( 'product_tag' );
|
||||
$product_cats_options = wcj_get_terms( 'product_cat' );
|
||||
$products_options = wcj_get_products();
|
||||
$user_roles_options = wcj_get_user_roles_options();
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_files_upload_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Files', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '1', )
|
||||
),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'File', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_checkout_files_upload_enabled_' . $i,
|
||||
'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'yes',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_files_upload_required_' . $i,
|
||||
'desc' => __( 'Required', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_files_upload_hook_' . $i,
|
||||
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'default' => 'woocommerce_before_checkout_form',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'woocommerce_before_checkout_form' => __( 'Before checkout form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
|
||||
'disable' => __( 'Do not add on checkout', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position order', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_hook_priority_' . $i,
|
||||
'default' => 20,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => '0' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_files_upload_add_to_thankyou_' . $i,
|
||||
'desc' => __( 'Add to Thank You page', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_files_upload_add_to_myaccount_' . $i,
|
||||
'desc' => __( 'Add to My Account page', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to disable label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_label_' . $i,
|
||||
'default' => __( 'Please select file to upload', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Accepted file types', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Accepted file types. E.g.: ".jpg,.jpeg,.png". Leave blank to accept all files', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_file_accept_' . $i,
|
||||
'default' => '.jpg,.jpeg,.png',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Label: Upload button', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_label_upload_button_' . $i,
|
||||
'default' => __( 'Upload', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Label: Remove button', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_label_remove_button_' . $i,
|
||||
'default' => __( 'Remove', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice: Wrong file type', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( '%s will be replaced with file name', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_notice_wrong_file_type_' . $i,
|
||||
'default' => __( 'Wrong file type: "%s"!', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice: File is required', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_notice_required_' . $i,
|
||||
'default' => __( 'File is required!', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice: File was successfully uploaded', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( '%s will be replaced with file name', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_notice_success_upload_' . $i,
|
||||
'default' => __( 'File "%s" was successfully uploaded.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice: No file selected', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_notice_upload_no_file_' . $i,
|
||||
'default' => __( 'Please select file to upload!', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice: File was successfully removed', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( '%s will be replaced with file name', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_notice_success_remove_' . $i,
|
||||
'default' => __( 'File "%s" was successfully removed.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'PRODUCTS to show this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'To show this field only if at least one selected product is in cart, enter products here. Leave blank to show for all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_show_products_in_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $products_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'CATEGORIES to show this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'To show this field only if at least one product of selected category is in cart, enter categories here. Leave blank to show for all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_show_cats_in_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_cats_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'TAGS to show this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'To show this field only if at least one product of selected tag is in cart, enter tags here. Leave blank to show for all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_show_tags_in_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_tags_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'USER ROLES to show this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to show for all user roles.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_show_user_roles_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $user_roles_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'PRODUCTS to hide this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'To hide this field if at least one selected product is in cart, enter products here. Leave blank to show for all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_hide_products_in_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $products_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'CATEGORIES to hide this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'To hide this field if at least one product of selected category is in cart, enter categories here. Leave blank to show for all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_hide_cats_in_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_cats_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'TAGS to hide this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'To hide this field if at least one product of selected tag is in cart, enter tags here. Leave blank to show for all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_hide_tags_in_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_tags_options,
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'USER ROLES to hide this field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Leave blank to show for all user roles.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_hide_user_roles_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $user_roles_options,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_files_upload_options',
|
||||
),
|
||||
) );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_files_upload_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Remove All Uploaded Files on Empty Cart', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_remove_on_empty_cart',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Add notice', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_remove_on_empty_cart_add_notice',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_checkout_files_upload_notice_remove_on_empty_cart',
|
||||
'default' => __( 'Files were successfully removed.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_files_upload_general_options',
|
||||
),
|
||||
) );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Emails Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_files_upload_emails_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Attach Files to Admin\'s New Order Emails', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Attach', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_attach_to_admin_new_order',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Attach Files to Customer\'s Processing Order Emails', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Attach', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_attach_to_customer_processing_order',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_files_upload_emails_options',
|
||||
),
|
||||
) );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Form Template Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_files_upload_form_template_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Before', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_form_template_before',
|
||||
'default' => '<table>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Replaced values: %field_id%, %field_label%, %required_html%.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_form_template_label',
|
||||
'default' => '<tr><td colspan="2"><label for="%field_id%">%field_label%</label>%required_html%</td></tr>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Field', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Replaced values: %field_html%, %button_html%.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_form_template_field',
|
||||
'default' => '<tr><td style="width:50%;">%field_html%</td><td style="width:50%;">%button_html%</td></tr>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'After', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_form_template_after',
|
||||
'default' => '</table>',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Show images in field', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_form_template_field_show_images',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Image style', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_form_template_field_image_style',
|
||||
'default' => 'width:64px;',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_files_upload_form_template_options',
|
||||
),
|
||||
) );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Advanced Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_files_upload_advanced_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Block Potentially Harmful Files', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_files_upload_block_files_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Potentially Harmful File Extensions', 'woocommerce-jetpack' ),
|
||||
'desc' => sprintf( __( 'List of file extensions separated by vertical bar %s.', 'woocommerce-jetpack' ), '<code>|</code>' ),
|
||||
'id' => 'wcj_checkout_files_upload_block_files_exts',
|
||||
'default' => 'bat|exe|cmd|sh|php|php0|php1|php2|php3|php4|php5|php6|php7|php8|php9|ph|ph0|ph1|ph2|ph3|ph4|ph5|ph6|ph7|ph8|ph9|pl|cgi|386|dll|com|torrent|js|app|jar|pif|vb|vbscript|wsf|asp|cer|csr|jsp|drv|sys|ade|adp|bas|chm|cpl|crt|csh|fxp|hlp|hta|inf|ins|isp|jse|htaccess|htpasswd|ksh|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|ops|pcd|prg|reg|scr|sct|shb|shs|url|vbe|vbs|wsc|wsf|wsh|html|htm',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_files_upload_advanced_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Coupon by User Role
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 3.6.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'All Coupons', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_coupon_by_user_role_all_coupons_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable All Coupons for Selected User Roles', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will disable all coupons for selected user roles. Coupons will be disabled completely, including coupon code input on the cart page.', 'woocommerce-jetpack' ),
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'default' => '',
|
||||
'id' => 'wcj_coupon_by_user_role_disabled',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Invalidate All Coupons for Selected User Roles', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will invalidate all coupons for selected user roles. Coupon code input will still be available on the cart page.', 'woocommerce-jetpack' ),
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'default' => '',
|
||||
'id' => 'wcj_coupon_by_user_role_invalid',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_coupon_by_user_role_all_coupons_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Coupon', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_coupon_by_user_role_per_coupon_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Invalidate per Coupon', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add "Booster: Coupon by User Role" meta box to each coupon\'s admin edit page.', 'woocommerce-jetpack' ) . '<br>' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
'id' => 'wcj_coupon_by_user_role_invalid_per_coupon',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_coupon_by_user_role_per_coupon_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_coupon_by_user_role_messages_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Coupon is not valid" Message', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Message that will be displayed for invalid coupons by user role.', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Coupon is not valid for your user role.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_coupon_by_user_role_invalid_message',
|
||||
'css' => 'width:100%;',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_coupon_by_user_role_messages_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Coupon Code Generator
|
||||
*
|
||||
* @version 3.2.3
|
||||
* @since 3.2.3
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
$algorithms = array(
|
||||
'crc32' => __( 'Hash', 'woocommerce-jetpack' ) . ': ' . 'crc32' . ' (' . sprintf( __( 'length %d', 'woocommerce-jetpack' ), 8 ) . ')',
|
||||
'md5' => __( 'Hash', 'woocommerce-jetpack' ) . ': ' . 'md5' . ' (' . sprintf( __( 'length %d', 'woocommerce-jetpack' ), 32 ) . ')',
|
||||
'sha1' => __( 'Hash', 'woocommerce-jetpack' ) . ': ' . 'sha1' . ' (' . sprintf( __( 'length %d', 'woocommerce-jetpack' ), 40 ) . ')',
|
||||
'random_letters_and_numbers' => __( 'Random letters and numbers', 'woocommerce-jetpack' ) . ' (' . sprintf( __( 'length %d', 'woocommerce-jetpack' ), 32 ) . ')',
|
||||
'random_letters' => __( 'Random letters', 'woocommerce-jetpack' ) . ' (' . sprintf( __( 'length %d', 'woocommerce-jetpack' ), 32 ) . ')',
|
||||
'random_numbers' => __( 'Random numbers', 'woocommerce-jetpack' ) . ' (' . sprintf( __( 'length %d', 'woocommerce-jetpack' ), 32 ) . ')',
|
||||
);
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_coupon_code_generator_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Generate Coupon Code Automatically', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'When enabled, this will generate coupon code automatically when adding new coupon.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_coupons_code_generator_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Algorithm', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_coupons_code_generator_algorithm',
|
||||
'default' => 'crc32',
|
||||
'type' => 'select',
|
||||
'options' => $algorithms,
|
||||
'desc_tip' => sprintf( __( 'Algorithms: %s.', 'woocommerce-jetpack' ), implode( '; ', $algorithms ) ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Length', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Length value will be ignored if set above the maximum length for selected algorithm. Set to zero to use full length for selected algorithm.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_coupons_code_generator_length',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_coupon_code_generator_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Cross-sells
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 3.5.3
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_cross_sells_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Cross-sells Total', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set to zero for WooCommerce default.', 'woocommerce-jetpack' ) . ' ' . __( 'Set to -1 for unlimited.', 'woocommerce-jetpack' ),
|
||||
'type' => 'number',
|
||||
'id' => 'wcj_cross_sells_total',
|
||||
'default' => 0,
|
||||
'custom_attributes' => array( 'min' => -1 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Cross-sells Columns', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set to zero for WooCommerce default.', 'woocommerce-jetpack' ),
|
||||
'type' => 'number',
|
||||
'id' => 'wcj_cross_sells_columns',
|
||||
'default' => 0,
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Cross-sells Order By', 'woocommerce-jetpack' ),
|
||||
'type' => 'select',
|
||||
'id' => 'wcj_cross_sells_orderby',
|
||||
'default' => 'no_changes',
|
||||
'options' => array(
|
||||
'no_changes' => __( 'No changes (default behaviour)', 'woocommerce-jetpack' ),
|
||||
'rand' => __( 'Random', 'woocommerce-jetpack' ),
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => __( 'ID', 'woocommerce-jetpack' ),
|
||||
'date' => __( 'Date', 'woocommerce-jetpack' ),
|
||||
'modified' => __( 'Modified', 'woocommerce-jetpack' ),
|
||||
'menu_order' => __( 'Menu order', 'woocommerce-jetpack' ),
|
||||
'price' => __( 'Price', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
if ( ! WCJ_IS_WC_VERSION_BELOW_3_3_0 ) {
|
||||
$settings[] = array(
|
||||
'title' => __( 'Cross-sells Order', 'woocommerce-jetpack' ),
|
||||
'type' => 'select',
|
||||
'id' => 'wcj_cross_sells_order',
|
||||
'default' => 'no_changes',
|
||||
'options' => array(
|
||||
'no_changes' => __( 'No changes (default behaviour)', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Descending', 'woocommerce-jetpack' ),
|
||||
'asc' => __( 'Ascending', 'woocommerce-jetpack' ),
|
||||
),
|
||||
);
|
||||
};
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Cross-sells Position', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Cross-sells position in cart.', 'woocommerce-jetpack' ),
|
||||
'type' => 'select',
|
||||
'id' => 'wcj_cross_sells_position',
|
||||
'default' => 'no_changes',
|
||||
'options' => array(
|
||||
'no_changes' => __( 'No changes (default)', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_cart' => __( 'Before cart', 'woocommerce-jetpack' ),
|
||||
'woocommerce_cart_collaterals' => __( 'Cart collaterals', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_cart' => __( 'After cart', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position priority', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Ignored if "Cross-sells Position" option above is set to "No changes (default)".', 'woocommerce-jetpack' ),
|
||||
'type' => 'number',
|
||||
'id' => 'wcj_cross_sells_position_priority',
|
||||
'default' => 10,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Cross-sells', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_cross_sells_hide',
|
||||
'default' => 'no',
|
||||
),
|
||||
) );
|
||||
if ( ! WCJ_IS_WC_VERSION_BELOW_3 ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Global Cross-sells', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this section if you want to add same cross-sells to all products.', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_cross_sells_global_enabled',
|
||||
'default' => 'no',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Global cross-sells', 'woocommerce-jetpack' ),
|
||||
'type' => 'multiselect',
|
||||
'id' => 'wcj_cross_sells_global_ids',
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_products(),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_cross_sells_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Currency Exchange Rates
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo add "rounding" and "fixed offset" options for each pair separately (and option to enable/disable these per pair extra settings)
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$desc = '';
|
||||
if ( $this->is_enabled() ) {
|
||||
if ( '' != get_option( 'wcj_currency_exchange_rate_cron_time', '' ) ) {
|
||||
$scheduled_time_diff = get_option( 'wcj_currency_exchange_rate_cron_time', '' ) - time();
|
||||
if ( $scheduled_time_diff > 60 ) {
|
||||
$desc = '<br><em>' . sprintf( __( '%s till next update.', 'woocommerce-jetpack' ), human_time_diff( 0, $scheduled_time_diff ) ) . '</em>';
|
||||
} elseif ( $scheduled_time_diff > 0 ) {
|
||||
$desc = '<br><em>' . sprintf( __( '%s seconds till next update.', 'woocommerce-jetpack' ), $scheduled_time_diff ) . '</em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_exchange_rates_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_auto',
|
||||
'default' => 'daily',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'minutely' => __( 'Update Every Minute', 'woocommerce-jetpack' ),
|
||||
'hourly' => __( 'Update Hourly', 'woocommerce-jetpack' ),
|
||||
'twicedaily' => __( 'Update Twice Daily', 'woocommerce-jetpack' ),
|
||||
'daily' => __( 'Update Daily', 'woocommerce-jetpack' ),
|
||||
'weekly' => __( 'Update Weekly', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => ( $this->is_enabled() ?
|
||||
$desc . ' ' . '<a href="' . add_query_arg( 'wcj_currency_exchange_rates_update_now', '1' ) . '">' . __( 'Update all rates now', 'woocommerce-jetpack' ) . '</a>' : '' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Server', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_server',
|
||||
'default' => 'ecb',
|
||||
'type' => 'select',
|
||||
'options' => wcj_get_currency_exchange_rate_servers(),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Rounding', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_rounding_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Number of decimals', 'woocommerce' ) . ' (' . __( 'i.e. rounding precision', 'woocommerce-jetpack' ) . ')',
|
||||
'desc_tip' => __( 'Rounding precision sets number of decimal digits to round to.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_rounding_precision',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => '0' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Offset - Percent', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If both percent and fixed offsets are set - percent offset is applied first and fixed offset after that.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_offset_percent',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '0.001' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Offset - Fixed', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If both percent and fixed offsets are set - percent offset is applied first and fixed offset after that.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_offset_fixed',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '0.000001' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Calculate with Inversion', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If your currency pair have very small exchange rate, you may want to invert currencies before calculating the rate.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_calculate_by_invert',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Always Use cURL', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If for some reason currency exchange rates are not updating, try enabling this option.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_always_curl',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'title' => __( 'Logging', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_logging_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_exchange_rates_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Currencies Options', 'woocommerce-jetpack' ),
|
||||
'desc' => sprintf(
|
||||
__( 'You can add more currencies in this section. E.g. this can be used to display exchange rates with %s shortcodes.', 'woocommerce-jetpack' ),
|
||||
'<code>[wcj_currency_exchange_rate]</code>, <code>[wcj_currency_exchange_rates_table]</code>'
|
||||
),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_exchange_custom_currencies_options',
|
||||
),
|
||||
);
|
||||
// Additional (custom) currencies
|
||||
$all_currencies = wcj_get_currencies_names_and_symbols();
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Total Custom Currencies', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_custom_currencies_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
) );
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_currency_exchange_custom_currencies_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Custom Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_currency_exchange_custom_currencies_' . $i,
|
||||
'default' => 'disabled',
|
||||
'type' => 'select',
|
||||
'options' => array_merge( array( 'disabled' => __( 'Disabled', 'woocommerce-jetpack' ) ), $all_currencies ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_exchange_custom_currencies_options',
|
||||
),
|
||||
) );
|
||||
// Exchange rates
|
||||
$exchange_rate_settings = $this->get_all_currencies_exchange_rates_settings( true );
|
||||
if ( ! empty( $exchange_rate_settings ) ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Exchange Rates', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'All currencies from all <strong>enabled</strong> modules (with "Exchange Rates Updates" set to "Automatically via Currency Exchange Rates module") will be automatically added to the list.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_exchange_rates_rates',
|
||||
),
|
||||
) );
|
||||
$settings = array_merge( $settings, $exchange_rate_settings );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_exchange_rates_rates',
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Currency for External Products
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Currency for External Products Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => '',
|
||||
'id' => 'wcj_currency_external_products_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set currency for all external products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_external_products_symbol', // mislabeled, should be 'wcj_currency_external_products_code'
|
||||
'default' => 'EUR',
|
||||
'type' => 'select',
|
||||
'options' => wcj_get_currencies_names_and_symbols(),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_external_products_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Currency per Product
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$currency_from = get_woocommerce_currency();
|
||||
$all_currencies = wcj_get_currencies_names_and_symbols();
|
||||
/*
|
||||
foreach ( $all_currencies as $currency_key => $currency_name ) {
|
||||
if ( $currency_from == $currency_key ) {
|
||||
unset( $all_currencies[ $currency_key ] );
|
||||
}
|
||||
}
|
||||
*/
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Cart and Checkout Behaviour Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_per_product_cart_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Cart and Checkout Behaviour', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_cart_checkout',
|
||||
'default' => 'convert_shop_default',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'convert_shop_default' => __( 'Convert to shop default currency', 'woocommerce-jetpack' ),
|
||||
'leave_one_product' => __( 'Leave product currency (allow only one product to be added to cart)', 'woocommerce-jetpack' ),
|
||||
'leave_same_currency' => __( 'Leave product currency (allow only same currency products to be added to cart)', 'woocommerce-jetpack' ),
|
||||
'convert_last_product' => __( 'Convert to currency of last product in cart', 'woocommerce-jetpack' ),
|
||||
'convert_first_product' => __( 'Convert to currency of first product in cart', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message', 'woocommerce-jetpack' ) . ': ' . __( 'Leave product currency (allow only one product to be added to cart)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_cart_checkout_leave_one_product',
|
||||
'default' => __( 'Only one product can be added to the cart. Clear the cart or finish the order, before adding another product to the cart.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'min-width:300px;width:66%',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message', 'woocommerce-jetpack' ) . ': ' . __( 'Leave product currency (allow only same currency products to be added to cart)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_cart_checkout_leave_same_currency',
|
||||
'default' => __( 'Only products with same currency can be added to the cart. Clear the cart or finish the order, before adding products with another currency to the cart.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'min-width:300px;width:66%',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_per_product_cart_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_per_product_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency per Product', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add meta box to each product\'s edit page', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_per_product',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_per_product_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Additional Options', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Save module\'s settings after changing this options to see new settings fields.', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_per_product_additional_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency per Product Authors', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_by_users_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency per Product Authors User Roles', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_by_user_roles_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency per Product Categories', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_by_product_cats_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency per Product Tags', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_by_product_tags_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_per_product_additional_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Updates Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_per_product_exchange_rate_update_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_exchange_rate_update',
|
||||
'default' => 'manual',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
|
||||
'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => ( '' == apply_filters( 'booster_message', '', 'desc' ) ) ?
|
||||
__( '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>'
|
||||
:
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_per_product_exchange_rate_update_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Exchange rates for currencies won\'t be used for products if "Cart and Checkout Behaviour" is set to one of "Leave product currency ..." options. However it may be used for shipping price conversion.', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_per_product_currencies_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Currencies', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '1', )
|
||||
),
|
||||
),
|
||||
);
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_users_enabled', 'no' ) ) {
|
||||
$users_as_options = wcj_get_users_as_options();
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_user_roles_enabled', 'no' ) ) {
|
||||
$user_roles_as_options = wcj_get_user_roles_options();
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_product_cats_enabled', 'no' ) ) {
|
||||
$product_cats_as_options = wcj_get_terms( 'product_cat' );
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_product_tags_enabled', 'no' ) ) {
|
||||
$product_tags_as_options = wcj_get_terms( 'product_tag' );
|
||||
}
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_to = get_option( 'wcj_currency_per_product_currency_' . $i, $currency_from );
|
||||
$custom_attributes = array(
|
||||
'currency_from' => $currency_from,
|
||||
'currency_to' => $currency_to,
|
||||
'multiply_by_field_id' => 'wcj_currency_per_product_exchange_rate_' . $i,
|
||||
);
|
||||
if ( $currency_from == $currency_to ) {
|
||||
$custom_attributes['disabled'] = 'disabled';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_currency_per_product_currency_' . $i,
|
||||
'default' => $currency_from,
|
||||
'type' => 'select',
|
||||
'options' => $all_currencies,
|
||||
'css' => 'width:250px;',
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'id' => 'wcj_currency_per_product_exchange_rate_' . $i,
|
||||
'default' => 1,
|
||||
'type' => 'exchange_rate',
|
||||
'custom_attributes_button' => $custom_attributes,
|
||||
'value' => $currency_from . '/' . $currency_to,
|
||||
),
|
||||
) );
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_users_enabled', 'no' ) ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'desc' => __( 'Product Authors', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_users_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'options' => $users_as_options,
|
||||
'class' => 'chosen_select',
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_user_roles_enabled', 'no' ) ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'desc' => __( 'Product Authors User Roles', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_user_roles_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'options' => $user_roles_as_options,
|
||||
'class' => 'chosen_select',
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_product_cats_enabled', 'no' ) ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'desc' => __( 'Product Categories', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_product_cats_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_cats_as_options,
|
||||
'class' => 'chosen_select',
|
||||
),
|
||||
) );
|
||||
}
|
||||
if ( 'yes' === get_option( 'wcj_currency_per_product_by_product_tags_enabled', 'no' ) ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'desc' => __( 'Product Tags', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_product_tags_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_tags_as_options,
|
||||
'class' => 'chosen_select',
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_per_product_currencies_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_per_product_advanced_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced: Save Calculated Products Prices', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This may help if you are experiencing compatibility issues with other plugins.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_per_product_save_prices',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_per_product_advanced_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Currencies
|
||||
*
|
||||
* @version 2.9.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo add virtual currencies to "All Currencies for WC" plugin
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Currency Symbol Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_all_currencies_list_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Hide Currency Symbol', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Default: no.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_hide_symbol',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
);
|
||||
$currency_names = wcj_get_currencies_names_and_symbols( 'names', 'no_custom' );
|
||||
$currency_symbols = wcj_get_currencies_names_and_symbols( 'symbols', 'no_custom' );
|
||||
$countries = wcj_get_currency_countries();
|
||||
foreach ( $currency_names as $currency_code => $currency_name ) {
|
||||
$country_flag = ( 'EUR' === $currency_code ?
|
||||
wcj_get_country_flag_by_code( 'EU' ) :
|
||||
( isset( $countries[ $currency_code ] ) ? wcj_get_country_flag_by_code( $countries[ $currency_code ][0] ) : '' )
|
||||
);
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $currency_name . ' [' . $currency_code . ']',
|
||||
'desc' => $country_flag,
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc_no_link' ),
|
||||
'id' => 'wcj_currency_' . $currency_code,
|
||||
'default' => $currency_symbols[ $currency_code ],
|
||||
'type' => 'text',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_all_currencies_list_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Currencies', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_currency_custom_currency_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Custom Currencies', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_custom_currency_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
) );
|
||||
$custom_currency_total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $custom_currency_total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Custom Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'desc' => __( 'Currency Name (required)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_custom_currency_name_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'desc' => __( 'Currency Code (required)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_custom_currency_code_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'desc' => __( 'Currency Symbol', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_currency_custom_currency_symbol_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_currency_custom_currency_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - Custom CSS
|
||||
*
|
||||
* @version 3.4.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_custom_css_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom CSS - Front end (Customers)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_custom_css',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;min-height:300px;font-family:monospace;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom CSS - Back end (Admin)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_custom_admin_css',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;min-height:300px;font-family:monospace;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom CSS on per Product Basis', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set product specific CSS to be loaded only on specific product\'s single page.', 'woocommerce-jetpack' ) .
|
||||
' ' . __( 'This will add meta box to each product\'s edit page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_css_per_product',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom CSS on per Product Basis - Default Field Value', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_css_per_product_default_value',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;min-height:100px;font-family:monospace;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_custom_css_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - Custom JS
|
||||
*
|
||||
* @version 3.4.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_custom_js_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom JS - Front end (Customers)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_js_frontend',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;min-height:300px;font-family:monospace;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom JS - Back end (Admin)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_js_backend',
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;min-height:300px;font-family:monospace;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_custom_js_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Email Options
|
||||
*
|
||||
* @version 2.9.1
|
||||
* @since 2.9.1
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Product Info in Item Name', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_product_info_in_email_order_item_name_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Product Info to Item Name', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_product_info_in_email_order_item_name_enabled',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Info', 'woocommerce-jetpack' ),
|
||||
'desc' => sprintf( __( 'You can use <a target="_blank" href="%s">Booster\'s products shortcodes</a> here.', 'woocommerce-jetpack' ), 'https://booster.io/category/shortcodes/products-shortcodes/' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_product_info_in_email_order_item_name',
|
||||
'default' => '[wcj_product_categories strip_tags="yes" before="<hr><em>" after="</em>"]',
|
||||
'css' => 'width:66%;min-width:300px;height:150px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_product_info_in_email_order_item_name_options',
|
||||
),
|
||||
);
|
||||
$settings = array_merge( $settings, $this->get_emails_forwarding_settings() );
|
||||
return $settings;
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Email Verification
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_emails_verification_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Skip Email Verification for User Roles', 'woocommerce-jetpack' ),
|
||||
'type' => 'multiselect',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
'id' => 'wcj_emails_verification_skip_user_roles',
|
||||
'default' => array( 'administrator' ),
|
||||
'class' => 'chosen_select',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Email Verification for Already Registered Users', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If enabled, all your current users will have to verify their emails when logging to your site.', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_emails_verification_already_registered_enabled',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Redirect to "My Account" Page After Successful Verification', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_emails_verification_redirect_on_success',
|
||||
'default' => 'yes',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_emails_verification_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Messages', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_emails_verification_messages_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Success', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_success_message',
|
||||
'default' => __( '<strong>Success:</strong> Your account has been activated!', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Error', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => sprintf( __( 'Replaced value: %s', 'woocommerce-jetpack' ), '%resend_verification_url%' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_error_message',
|
||||
'default' => __( 'Your account has to be activated before you can login. You can resend email with verification link by clicking <a href="%resend_verification_url%">here</a>.', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Failed', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => sprintf( __( 'Replaced value: %s', 'woocommerce-jetpack' ), '%resend_verification_url%' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_failed_message',
|
||||
'default' => __( '<strong>Error:</strong> Activation failed, please contact our administrator. You can resend email with verification link by clicking <a href="%resend_verification_url%">here</a>.', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Activate', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_activation_message',
|
||||
'default' => __( 'Thank you for your registration. Your account has to be activated before you can login. Please check your email.', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Resend', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_email_resend_message',
|
||||
'default' => __( '<strong>Success:</strong> Your activation email has been resend. Please check your email.', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_emails_verification_messages_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_emails_verification_email_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Subject', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_email_subject',
|
||||
'default' => __( 'Please activate your account', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => sprintf( __( 'Replaced value: %s', 'woocommerce-jetpack' ), '%verification_url%' ),
|
||||
'type' => 'custom_textarea',
|
||||
'id' => 'wcj_emails_verification_email_content',
|
||||
'default' => __( 'Please click the following link to verify your email:<br><br><a href="%verification_url%">%verification_url%</a>', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;height:150px;',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Template', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Possible values: Plain, WooCommerce.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_emails_verification_email_template',
|
||||
'type' => 'select',
|
||||
'default' => 'plain',
|
||||
'options' => array(
|
||||
'plain' => __( 'Plain', 'woocommerce-jetpack' ),
|
||||
'wc' => __( 'WooCommerce', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'desc_tip' => __( 'If WooCommerce template is selected, set email heading here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_emails_verification_email_template_wc_heading',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Activate your account', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_emails_verification_email_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Custom Emails
|
||||
*
|
||||
* @version 2.9.1
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Custom Emails', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_emails_custom_emails_options',
|
||||
'desc' => sprintf(
|
||||
__( 'This section lets you set number of custom emails to add. After setting the number, visit <a href="%s">WooCommerce > Settings > Emails</a> to set each email options.', 'woocommerce-jetpack' ),
|
||||
admin_url( 'admin.php?page=wc-settings&tab=email' )
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Emails Number', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_emails_custom_emails_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Admin Title Custom Email', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_emails_custom_emails_admin_title_' . $i,
|
||||
'default' => __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'text',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_emails_custom_emails_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - Empty Cart Button
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'You can also use <strong>[wcj_empty_cart_button]</strong> shortcode to place the button anywhere on your site.', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_empty_cart_customization_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Empty Cart Button Text', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_text',
|
||||
'default' => 'Empty Cart',
|
||||
'type' => 'text',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Wrapping DIV style', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Style for the button\'s div. Default is "float: right;"', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_div_style',
|
||||
'default' => 'float: right;',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Button HTML Class', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_button_class',
|
||||
'default' => 'button',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Button position on the Cart page', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_position',
|
||||
'default' => 'woocommerce_after_cart',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'disable' => __( 'Do not add', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_cart' => __( 'Before cart', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_cart_totals' => __( 'Cart totals: Before cart totals', 'woocommerce-jetpack' ),
|
||||
'woocommerce_cart_totals_before_shipping' => __( 'Cart totals: Before shipping', 'woocommerce-jetpack' ),
|
||||
'woocommerce_cart_totals_after_shipping' => __( 'Cart totals: After shipping', 'woocommerce-jetpack' ),
|
||||
'woocommerce_cart_totals_before_order_total' => __( 'Cart totals: Before order total', 'woocommerce-jetpack' ),
|
||||
'woocommerce_cart_totals_after_order_total' => __( 'Cart totals: After order total', 'woocommerce-jetpack' ),
|
||||
'woocommerce_proceed_to_checkout' => __( 'Cart totals: After proceed to checkout button', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_cart_totals' => __( 'Cart totals: After cart totals', 'woocommerce-jetpack' ),
|
||||
'woocommerce_cart_collaterals' => __( 'After cart collaterals', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_cart' => __( 'After cart', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Button position on the Checkout page', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_checkout_position',
|
||||
'default' => 'disable',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'disable' => __( 'Do not add', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_checkout_form' => __( 'Before checkout form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Confirmation', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_confirmation',
|
||||
'default' => 'no_confirmation',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no_confirmation' => __( 'No confirmation', 'woocommerce-jetpack' ),
|
||||
'confirm_with_pop_up_box' => __( 'Confirm by pop up box', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Confirmation Text (if enabled)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_empty_cart_confirmation_text',
|
||||
'default' => __( 'Are you sure?', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_empty_cart_customization_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - EU VAT Number
|
||||
*
|
||||
* @version 3.2.2
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo set default value for "wcj_eu_vat_number_add_progress_text" to "yes"
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_eu_vat_number_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Field Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_label',
|
||||
'default' => __( 'EU VAT Number', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Placeholder', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_placeholder',
|
||||
'default' => __( 'EU VAT Number', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Description', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_description',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'title' => __( 'Require Country Code in VAT Number', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_require_country_code',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'title' => __( 'Required', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_required',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Clear', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_clear',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Class', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_field_class',
|
||||
'default' => 'form-row-wide',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'form-row-wide' => __( 'Wide', 'woocommerce-jetpack' ),
|
||||
'form-row-first' => __( 'First', 'woocommerce-jetpack' ),
|
||||
'form-row-last' => __( 'Last', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Validate', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_validate',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Message on not valid', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_not_valid_message',
|
||||
'default' => __( '<strong>EU VAT Number</strong> is not valid.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'First Validation Method', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Change this if you are having issues when validating VAT. This only selects first method to try - if not succeeded, remaining methods will be used for validation.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_first_method',
|
||||
'default' => 'soap',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'soap' => __( 'SOAP', 'woocommerce-jetpack' ),
|
||||
'curl' => __( 'cURL', 'woocommerce-jetpack' ),
|
||||
'file_get_contents' => __( 'Simple', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exempt VAT for Valid Numbers', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_disable_for_valid',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Preserve VAT in Base Country', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => sprintf( __( 'This will validate the VAT, but won\'t exempt VAT for base country VAT numbers. Base (i.e. store) country is set in %s.', 'woocommerce-jetpack' ),
|
||||
'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=general' ) . '">' . __( 'WooCommerce > Settings > General', 'woocommerce-jetpack' ) . '</a>' ) . '<br>' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_preserve_in_base_country',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'desc' => __( 'Message if customer is in base country and VAT is NOT exempted.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_preserve_in_base_country_message',
|
||||
'default' => __( 'EU VAT Number is valid, however VAT is not exempted.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'title' => __( 'Check for IP Location Country', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will check if customer\'s country (located by customer\'s IP) matches the country in entered VAT number.', 'woocommerce-jetpack' ) . '<br>' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_check_ip_location_country',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'desc' => __( 'Message if customer\'s check for IP location country has failed.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_check_ip_location_country_message',
|
||||
'default' => __( 'IP must be from same country as VAT ID.', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
*/
|
||||
array(
|
||||
'title' => __( 'Display', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_display_position',
|
||||
'default' => 'after_order_table',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'after_order_table' => __( 'After order table', 'woocommerce-jetpack' ),
|
||||
'in_billing_address' => __( 'In billing address', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Progress Messages', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_add_progress_text',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Progress Message: Validating', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_progress_text_validating',
|
||||
'default' => __( 'Validating VAT. Please wait...', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Progress Message: Valid', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_progress_text_valid',
|
||||
'default' => __( 'VAT is valid.', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Progress Message: Not Valid', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_progress_text_not_valid',
|
||||
'default' => __( 'VAT is not valid.', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Progress Message: Validation Failed', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Message on VAT validation server timeout etc.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_progress_text_validation_failed',
|
||||
'default' => __( 'Validation failed. Please try again.', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add EU VAT Number Summary Meta Box to Admin Order Edit Page', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_eu_vat_number_add_order_edit_metabox',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_eu_vat_number_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_eu_vat_number_advanced_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Skip VAT Validation for Selected Countries', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'List all countries you want VAT validation to be skipped for (i.e. VAT always valid). Ignored if empty.', 'woocommerce-jetpack' ),
|
||||
'desc' => sprintf( __( 'Enter country codes as comma separated list, e.g. %s.', 'woocommerce-jetpack' ), '<code>IT,NL</code>' ),
|
||||
'id' => 'wcj_eu_vat_number_advanced_skip_countries',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_eu_vat_number_advanced_options',
|
||||
),
|
||||
);
|
||||
return $settings;
|
||||
@@ -0,0 +1,292 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Export
|
||||
*
|
||||
* @version 3.2.1
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo add "Additional Export Fields" for "Customers from Orders" and (maybe) "Customers"
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Export Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_export_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'CSV Separator', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_csv_separator',
|
||||
'default' => ',',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'UTF-8 BOM', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Add UTF-8 BOM sequence', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_csv_add_utf_8_bom',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_export_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Orders Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_export_orders_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Orders Fields', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_fields',
|
||||
'default' => $this->fields_helper->get_order_export_default_fields_ids(),
|
||||
'type' => 'multiselect',
|
||||
'options' => $this->fields_helper->get_order_export_fields(),
|
||||
'css' => 'height:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Additional Export Orders Fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_fields_additional_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ?
|
||||
apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '0', )
|
||||
),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_export_orders_fields_additional_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Field', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_export_orders_fields_additional_enabled_' . $i,
|
||||
'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_fields_additional_title_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_fields_additional_type_' . $i,
|
||||
'type' => 'select',
|
||||
'default' => 'meta',
|
||||
'options' => array(
|
||||
'meta' => __( 'Order Meta', 'woocommerce-jetpack' ),
|
||||
'shortcode' => __( 'Order Shortcode', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter order meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ) .
|
||||
' ' . __( 'If it\'s set to "Shortcode", use Booster\'s Orders shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_fields_additional_value_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_export_orders_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Orders Items Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_export_orders_items_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Orders Items Fields', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_items_fields',
|
||||
'default' => $this->fields_helper->get_order_items_export_default_fields_ids(),
|
||||
'type' => 'multiselect',
|
||||
'options' => $this->fields_helper->get_order_items_export_fields(),
|
||||
'css' => 'height:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Additional Export Orders Items Fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_items_fields_additional_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ?
|
||||
apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '0', )
|
||||
),
|
||||
),
|
||||
) );
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_export_orders_items_fields_additional_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Field', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_export_orders_items_fields_additional_enabled_' . $i,
|
||||
'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_items_fields_additional_title_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_items_fields_additional_type_' . $i,
|
||||
'type' => 'select',
|
||||
'default' => 'meta',
|
||||
'options' => array(
|
||||
'meta' => __( 'Order Meta', 'woocommerce-jetpack' ),
|
||||
'item_meta' => __( 'Order Item Meta', 'woocommerce-jetpack' ),
|
||||
'shortcode' => __( 'Order Shortcode', 'woocommerce-jetpack' ),
|
||||
'meta_product' => __( 'Product Meta', 'woocommerce-jetpack' ),
|
||||
'shortcode_product' => __( 'Product Shortcode', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter order/product meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ) .
|
||||
' ' . __( 'If it\'s set to "Shortcode", use Booster\'s Orders/Products shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_orders_items_fields_additional_value_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_export_orders_items_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Products Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_export_products_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Products Fields', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_products_fields',
|
||||
'default' => $this->fields_helper->get_product_export_default_fields_ids(),
|
||||
'type' => 'multiselect',
|
||||
'options' => $this->fields_helper->get_product_export_fields(),
|
||||
'css' => 'height:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Variable Products', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_products_variable',
|
||||
'default' => 'variable_only',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'variable_only' => __( 'Export variable (main) product only', 'woocommerce-jetpack' ),
|
||||
'variations_only' => __( 'Export variation products only', 'woocommerce-jetpack' ),
|
||||
'variable_and_variations' => __( 'Export variable (main) and variation products', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Additional Export Products Fields', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_products_fields_additional_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ?
|
||||
apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '0', )
|
||||
),
|
||||
),
|
||||
) );
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Field', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_export_products_fields_additional_enabled_' . $i,
|
||||
'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_products_fields_additional_title_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_products_fields_additional_type_' . $i,
|
||||
'type' => 'select',
|
||||
'default' => 'meta',
|
||||
'options' => array(
|
||||
'meta' => __( 'Product Meta', 'woocommerce-jetpack' ),
|
||||
'shortcode' => __( 'Product Shortcode', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter product meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ) .
|
||||
' ' . __( 'If it\'s set to "Shortcode", use Booster\'s Products shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_products_fields_additional_value_' . $i,
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_export_products_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Customers Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_export_customers_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Customers Fields', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_customers_fields',
|
||||
'default' => $this->fields_helper->get_customer_export_default_fields_ids(),
|
||||
'type' => 'multiselect',
|
||||
'options' => $this->fields_helper->get_customer_export_fields(),
|
||||
'css' => 'height:150px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_export_customers_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Customers from Orders Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_export_customers_from_orders_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Export Customers from Orders Fields', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_export_customers_from_orders_fields',
|
||||
'default' => $this->fields_helper->get_customer_from_order_export_default_fields_ids(),
|
||||
'type' => 'multiselect',
|
||||
'options' => $this->fields_helper->get_customer_from_order_export_fields(),
|
||||
'css' => 'height:150px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_export_customers_from_orders_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Free Price
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_types = array(
|
||||
'simple' => __( 'Simple and Custom Products', 'woocommerce-jetpack' ),
|
||||
'variable' => __( 'Variable Products', 'woocommerce-jetpack' ),
|
||||
'grouped' => __( 'Grouped Products', 'woocommerce-jetpack' ),
|
||||
'external' => __( 'External Products', 'woocommerce-jetpack' ),
|
||||
);
|
||||
$views = array(
|
||||
'single' => __( 'Single Product Page', 'woocommerce-jetpack' ),
|
||||
'related' => __( 'Related Products', 'woocommerce-jetpack' ),
|
||||
'home' => __( 'Homepage', 'woocommerce-jetpack' ),
|
||||
'page' => __( 'Pages (e.g. Shortcodes)', 'woocommerce-jetpack' ),
|
||||
'archive' => __( 'Archives (Product Categories)', 'woocommerce-jetpack' ),
|
||||
);
|
||||
$settings = array();
|
||||
foreach ( $product_types as $product_type => $product_type_desc ) {
|
||||
$default_value = ( 'simple' === $product_type || 'external' === $product_type ) ? '<span class="amount">' . __( 'Free!', 'woocommerce' ) . '</span>' : __( 'Free!', 'woocommerce' );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $product_type_desc,
|
||||
'desc' => __( 'Labels can contain shortcodes.', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_free_price_' . $product_type . 'options',
|
||||
),
|
||||
) );
|
||||
$current_views = $views;
|
||||
if ( 'variable' === $product_type ) {
|
||||
$current_views['variation'] = __( 'Variations', 'woocommerce-jetpack' );
|
||||
}
|
||||
foreach ( $current_views as $view => $view_desc ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $view_desc,
|
||||
'id' => 'wcj_free_price_' . $product_type . '_' . $view,
|
||||
'default' => $default_value,
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:30%;min-width:300px;min-height:50px;',
|
||||
'desc' => ( 'variable' === $product_type ) ? apply_filters( 'booster_message', '', 'desc' ) : '',
|
||||
'custom_attributes' => ( 'variable' === $product_type ) ? apply_filters( 'booster_message', '', 'readonly' ) : '',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_free_price_' . $product_type . 'options',
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - General
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo add link to Booster's shortcodes list
|
||||
* @todo clean up
|
||||
* @todo (maybe) move `wcj_general_advanced_disable_save_sys_temp_dir` to "PDF Invoicing" module
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/*
|
||||
$links_html = '';
|
||||
if ( class_exists( 'RecursiveIteratorIterator' ) && class_exists( 'RecursiveDirectoryIterator' ) ) {
|
||||
$dir = untrailingslashit( realpath( plugin_dir_path( __FILE__ ) . '/../../woocommerce/templates' ) );
|
||||
$rii = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir ) );
|
||||
foreach ( $rii as $file ) {
|
||||
$the_name = str_replace( $dir, '', $file->getPathname() );
|
||||
$the_name_link = str_replace( DIRECTORY_SEPARATOR, '%2F', $the_name );
|
||||
if ( $file->isDir() ) {
|
||||
/* $links_html .= '<strong>' . $the_name . '</strong>' . PHP_EOL; *//*
|
||||
} else {
|
||||
$links_html .= '<a href="' . get_admin_url( null, 'plugin-editor.php?file=woocommerce' . '%2F' . 'templates' . $the_name_link . '&plugin=woocommerce' ) . '">' .
|
||||
'templates' . $the_name . '</a>' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$links_html = __( 'PHP 5 is required.', 'woocommerce-jetpack' );
|
||||
}
|
||||
*/
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Shortcodes Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_general_shortcodes_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable All Shortcodes in WordPress Text Widgets', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will enable all (including non Booster\'s) shortcodes in WordPress text widgets.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_shortcodes_in_text_widgets_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Booster\'s Shortcodes', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Disable all Booster\'s shortcodes (for memory saving).', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_shortcodes_disable_booster_shortcodes',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_general_shortcodes_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Product Revisions', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_product_revisions_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Product Revisions', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_product_revisions_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_product_revisions_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_general_advanced_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Recalculate Cart Totals on Every Page Load', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_recalculate_cart_totals',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Session Type in Booster', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_session_type',
|
||||
'default' => 'standard',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'standard' => __( 'Standard PHP sessions', 'woocommerce-jetpack' ),
|
||||
'wc' => __( 'WC sessions', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Loading Datepicker/Weekpicker CSS', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_disable_datepicker_css',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Datepicker/Weekpicker CSS', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_datepicker_css',
|
||||
'default' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/base/jquery-ui.css',
|
||||
'type' => 'text',
|
||||
'css' => 'width:66%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Loading Datepicker/Weekpicker JavaScript', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_disable_datepicker_js',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Loading Timepicker CSS', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_disable_timepicker_css',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Loading Timepicker JavaScript', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_disable_timepicker_js',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Saving PDFs in PHP directory for temporary files', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_advanced_disable_save_sys_temp_dir',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_general_advanced_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'PayPal Email per Product Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_paypal_email_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'PayPal Email per Product', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add new meta box to each product\'s edit page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_paypal_email_per_product_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_paypal_email_per_product_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Session Expiration Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_session_expiration_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Session Expiration', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable Section', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_session_expiration_section_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Session Expiring', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'In seconds. Default: 47 hours (60 * 60 * 47)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_session_expiring',
|
||||
'default' => 47 * 60 * 60,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Session Expiration', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'In seconds. Default: 48 hours (60 * 60 * 48)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_session_expiration',
|
||||
'default' => 48 * 60 * 60,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_session_expiration_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Booster User Roles Changer Options', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'This will add user roles changer tool to admin bar.', 'woocommerce-jetpack' )/* . ' ' .
|
||||
__( 'You will be able to change user roles for Booster modules (e.g. when creating orders manually by admin for "Price based on User Role" module).', 'woocommerce-jetpack' ) */,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_general_user_role_changer_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Booster User Roles Changer', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_user_role_changer_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enabled for', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_user_role_changer_enabled_for',
|
||||
'default' => array( 'administrator', 'shop_manager' ),
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_general_user_role_changer_options',
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'title' => __( 'WooCommerce Templates Editor Links', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_general_wc_templates_editor_links_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Templates', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_general_wc_templates_editor_links',
|
||||
'type' => 'custom_link',
|
||||
'link' => '<pre>' . $links_html . '</pre>',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_general_wc_templates_editor_links_options',
|
||||
),
|
||||
*/
|
||||
);
|
||||
return $settings;
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Global Discount
|
||||
*
|
||||
* @version 3.1.3
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$is_multiselect_products = ( 'yes' === get_option( 'wcj_list_for_products', 'yes' ) );
|
||||
$products = ( $is_multiselect_products ? wcj_get_products() : false );
|
||||
$product_cats = wcj_get_terms( 'product_cat' );
|
||||
$product_tags = wcj_get_terms( 'product_tag' );
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_global_discount_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Groups', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_groups_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc_tip' => __( 'Press Save changes after you change this number.', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ?
|
||||
apply_filters( 'booster_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1', ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_global_discount_options',
|
||||
),
|
||||
);
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) ); $i++ ) {
|
||||
wcj_maybe_convert_and_update_option_value( array(
|
||||
array( 'id' => 'wcj_global_discount_sale_products_incl_' . $i, 'default' => '' ),
|
||||
array( 'id' => 'wcj_global_discount_sale_products_excl_' . $i, 'default' => '' ),
|
||||
), $is_multiselect_products );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Discount Group', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_global_discount_options_' . $i,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enabled', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enabled/disables the discount group.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_enabled_' . $i,
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Can be fixed or percent.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_coefficient_type_' . $i,
|
||||
'default' => 'percent',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'percent' => __( 'Percent', 'woocommerce-jetpack' ),
|
||||
'fixed' => __( 'Fixed', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Must be negative number.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_coefficient_' . $i,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'max' => 0, 'step' => 0.0001 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Product Scope', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Possible values: all products, only products that are already on sale, only products that are not on sale.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_product_scope_' . $i,
|
||||
'default' => 'all',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'all' => __( 'All products', 'woocommerce-jetpack' ),
|
||||
'only_on_sale' => __( 'Only products that are already on sale', 'woocommerce-jetpack' ),
|
||||
'only_not_on_sale' => __( 'Only products that are not on sale', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Include Product Categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set this field to apply discount to selected product categories only. Leave blank to apply to all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_categories_incl_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Product Categories', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set this field to NOT apply discount to selected product categories. Leave blank to apply to all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_categories_excl_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Include Product Tags', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set this field to apply discount to selected product tags only. Leave blank to apply to all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_tags_incl_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_tags,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Product Tags', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set this field to NOT apply discount to selected product tags. Leave blank to apply to all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_tags_excl_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'type' => 'multiselect',
|
||||
'options' => $product_tags,
|
||||
),
|
||||
wcj_get_settings_as_multiselect_or_text(
|
||||
array(
|
||||
'title' => __( 'Include Products', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set this field to apply discount to selected products only. Leave blank to apply to all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_products_incl_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
$products,
|
||||
$is_multiselect_products
|
||||
),
|
||||
wcj_get_settings_as_multiselect_or_text(
|
||||
array(
|
||||
'title' => __( 'Exclude Products', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set this field to NOT apply discount to selected products. Leave blank to apply to all products.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_global_discount_sale_products_excl_' . $i,
|
||||
'default' => '',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
$products,
|
||||
$is_multiselect_products
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_global_discount_options_' . $i,
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Left to Free Shipping
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Left to Free Shipping Info Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you enable info on cart, mini cart and checkout pages.', 'woocommerce-jetpack' ) . '<br>' . '<br>' .
|
||||
sprintf( __( 'You can also use <em>Booster - Left to Free Shipping</em> widget, %s shortcode or %s function.', 'woocommerce-jetpack' ),
|
||||
'<code>[wcj_get_left_to_free_shipping content=""]</code>',
|
||||
'<code>wcj_get_left_to_free_shipping( $content );</code>' ) . '<br>' . '<br>' .
|
||||
sprintf( __( 'In content replaced values are: %s, %s and %s.', 'woocommerce-jetpack' ),
|
||||
'<code>%left_to_free%</code>',
|
||||
'<code>%free_shipping_min_amount%</code>',
|
||||
'<code>%cart_total%</code>' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Info on Cart', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_enabled_cart',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use HTML and/or shortcodes (e.g. [wcj_wpml]) here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_content_cart',
|
||||
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Please note, that depending on the "Position" you select, your customer may have to reload the cart page to see the updated left to free shipping value. For example, if you select "After cart totals" position, then left to free shipping value will be updated as soon as customer updates the cart. However if you select "After cart" position instead – message will not be updated, and customer will have to reload the page. In other words, message position should be inside that page part that is automatically updated on cart update.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_position_cart',
|
||||
'default' => 'woocommerce_after_cart_totals',
|
||||
'type' => 'select',
|
||||
'options' => wcj_get_cart_filters(),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position Order (Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_priority_cart',
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Info on Mini Cart', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_enabled_mini_cart',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use HTML and/or shortcodes (e.g. [wcj_wpml]) here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_content_mini_cart',
|
||||
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_position_mini_cart',
|
||||
'default' => 'woocommerce_after_mini_cart',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'woocommerce_before_mini_cart' => __( 'Before mini cart', 'woocommerce-jetpack' ),
|
||||
'woocommerce_widget_shopping_cart_before_buttons' => __( 'Before buttons', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_mini_cart' => __( 'After mini cart', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position Order (Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_priority_mini_cart',
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Info on Checkout', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_enabled_checkout',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use HTML and/or shortcodes (e.g. [wcj_wpml]) here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_content_checkout',
|
||||
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_position_checkout',
|
||||
'default' => 'woocommerce_checkout_after_order_review',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'woocommerce_before_checkout_form' => __( 'Before checkout form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_before_customer_details' => __( 'Before customer details', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_billing' => __( 'Billing', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_shipping' => __( 'Shipping', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_after_customer_details' => __( 'After customer details', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_before_order_review' => __( 'Before order review', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_order_review' => __( 'Order review', 'woocommerce-jetpack' ),
|
||||
'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position Order (Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_priority_checkout',
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message on Free Shipping Reached', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use HTML and/or shortcodes (e.g. [wcj_wpml]) here.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Set empty to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_shipping_left_to_free_info_content_reached',
|
||||
'default' => __( 'You have Free delivery', 'woocommerce-jetpack' ),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_shipping_left_to_free_info_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Max Products per User
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 3.5.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'All Products', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_max_products_per_user_global_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'All Products', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_max_products_per_user_global_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Maximum Allowed Each Product\'s Quantity per User', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_max_products_per_user_global_max_qty',
|
||||
'default' => 1,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 1 ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_max_products_per_user_global_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_max_products_per_user_local_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Product', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => __( 'This will add new meta box to each product\'s edit page.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_max_products_per_user_local_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_max_products_per_user_local_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_max_products_per_user_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customer Message', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%max_qty%', '%product_title%', '%qty_already_bought%', '%remaining_qty%' ) ),
|
||||
'id' => 'wcj_max_products_per_user_message',
|
||||
'default' => __( 'You can only buy maximum %max_qty% pcs. of %product_title% (you already bought %qty_already_bought% pcs.).', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Block Checkout Page', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will stop customer from accessing the checkout page on exceeded quantities. Customer will be redirected to the cart page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_max_products_per_user_stop_from_seeing_checkout',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Calculate Data', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_max_products_per_user_calculate_data',
|
||||
'default' => '',
|
||||
'type' => 'custom_link',
|
||||
'link' => '<a class="button" href="' .
|
||||
add_query_arg( 'wcj_max_products_per_user_calculate_data', '1', remove_query_arg( 'wcj_max_products_per_user_calculate_data_finished' ) ) . '">' .
|
||||
__( 'Calculate Data', 'woocommerce-jetpack' ) .
|
||||
'</a>',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_max_products_per_user_general_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Mini Cart Custom Info
|
||||
*
|
||||
* @version 3.5.1
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Mini Cart Custom Info Blocks', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_mini_cart_custom_info_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Blocks', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_mini_cart_custom_info_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_mini_cart_custom_info_options',
|
||||
),
|
||||
);
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) ); $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Info Block', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_mini_cart_custom_info_options_' . $i,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_mini_cart_custom_info_content_' . $i,
|
||||
'default' => '[wcj_cart_items_total_weight before="Total weight: " after=" kg"]',
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_mini_cart_custom_info_hook_' . $i,
|
||||
'default' => 'woocommerce_after_mini_cart',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'woocommerce_before_mini_cart' => __( 'Before mini cart', 'woocommerce-jetpack' ),
|
||||
'woocommerce_widget_shopping_cart_before_buttons' => __( 'Before buttons', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_mini_cart' => __( 'After mini cart', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position Order (i.e. Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_mini_cart_custom_info_priority_' . $i,
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_mini_cart_custom_info_options_' . $i,
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Modules By User Roles
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 3.3.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$user_roles = wcj_get_user_roles_options();
|
||||
$modules = array();
|
||||
foreach ( WCJ()->modules as $module_id => $module_obj ) {
|
||||
$modules[ $module_id ] = $module_obj->short_desc;
|
||||
}
|
||||
unset( $modules['modules_by_user_roles'] );
|
||||
|
||||
$settings = array ();
|
||||
foreach ( $user_roles as $role_id => $role_desc ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $role_desc,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_modules_by_user_roles_' . $role_id,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Modules', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Select modules which should be enabled for current user role. All other modules will be disabled. Ignored if left empty.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_modules_by_user_roles_incl_' . $role_id,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $modules,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Disable Modules', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Select modules which should be disabled for current user role. All other modules will be enabled. Ignored if left empty.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_modules_by_user_roles_excl_' . $role_id,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $modules,
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_modules_by_user_roles_' . $role_id,
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - More Button Labels
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Place order (Order now) Button', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_checkout_place_order_button_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Text', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Leave blank for WooCommerce default.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Button on the checkout page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_place_order_button_text',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Override Default Text', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this if button text is not changing for some payment gateway (e.g. PayPal).', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_checkout_place_order_button_override',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_checkout_place_order_button_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Multicurrency Product Base Price
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) `if ( isset( $all_currencies[ $currency_from ] ) ) { unset( $all_currencies[ $currency_from ] ); }`
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$currency_from = get_woocommerce_currency();
|
||||
$all_currencies = wcj_get_currencies_names_and_symbols();
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_multicurrency_base_price_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_base_price_exchange_rate_update',
|
||||
'default' => 'manual',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
|
||||
'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => ( '' == apply_filters( 'booster_message', '', 'desc' ) ) ?
|
||||
__( '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>'
|
||||
:
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Round Prices', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_base_price_round_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'rounding precision', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Number of decimals.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_base_price_round_precision',
|
||||
'default' => get_option( 'woocommerce_price_num_decimals' ),
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Convert Product Prices in Admin Products List', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_base_price_do_convert_in_back_end',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced: Save Calculated Products Prices', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This may help if you are experiencing compatibility issues with other plugins.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_base_price_save_prices',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_multicurrency_base_price_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_multicurrency_base_price_currencies_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Currencies', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_base_price_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '1', )
|
||||
),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i, $currency_from );
|
||||
$custom_attributes = array(
|
||||
'currency_from' => $currency_from,
|
||||
'currency_to' => $currency_to,
|
||||
'multiply_by_field_id' => 'wcj_multicurrency_base_price_exchange_rate_' . $i,
|
||||
);
|
||||
if ( $currency_from == $currency_to ) {
|
||||
$custom_attributes['disabled'] = 'disabled';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_multicurrency_base_price_currency_' . $i,
|
||||
'default' => $currency_from,
|
||||
'type' => 'select',
|
||||
'options' => $all_currencies,
|
||||
'css' => 'width:250px;',
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'id' => 'wcj_multicurrency_base_price_exchange_rate_' . $i,
|
||||
'default' => 1,
|
||||
'type' => 'exchange_rate',
|
||||
'custom_attributes_button' => $custom_attributes,
|
||||
'value' => $currency_from . '/' . $currency_to,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_multicurrency_base_price_currencies_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Multicurrency (Currency Switcher)
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo "pretty prices"
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$currency_from = get_woocommerce_currency();
|
||||
$all_currencies = wcj_get_currencies_names_and_symbols();
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_multicurrency_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Select how you want currency exchange rates to be updated. Possible options are: manually or automatically via Currency Exchange Rates module.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_exchange_rate_update_auto',
|
||||
'default' => 'manual',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
|
||||
'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => ( '' == apply_filters( 'booster_message', '', 'desc' ) ) ?
|
||||
__( '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>'
|
||||
:
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Multicurrency on per Product Basis', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If you enable this option, you will be able to enter prices for products in different currencies directly (i.e. without exchange rates). This will add meta boxes in product edit.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_per_product_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Variable products: list available/active variations only', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Defines which variations are listed on admin product edit page in Multicurrency meta box. Ignored if "Multicurrency on per Product Basis" option is disabled.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_per_product_list_available_variations_only',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Revert Currency to Default on Checkout', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this if you want prices to revert back to your shop\'s default currency, when customer reaches the checkout page.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_revert',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Rounding', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If using exchange rates, choose rounding here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_rounding',
|
||||
'default' => 'no_round',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no_round' => __( 'No rounding', 'woocommerce-jetpack' ),
|
||||
'round' => __( 'Round', 'woocommerce-jetpack' ),
|
||||
'round_up' => __( 'Round up', 'woocommerce-jetpack' ),
|
||||
'round_down' => __( 'Round down', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Rounding Precision', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If rounding is enabled, set rounding precision here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_rounding_precision',
|
||||
'default' => absint( get_option( 'woocommerce_price_num_decimals', 2 ) ),
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currency Switcher Template', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set how you want currency switcher to be displayed on frontend.', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%currency_name%', '%currency_symbol%', '%currency_code%' ) ),
|
||||
'id' => 'wcj_multicurrency_switcher_template',
|
||||
'default' => '%currency_name% (%currency_symbol%)',
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced: Additional Price Filters', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Add additional price filters here. One per line. Leave blank if not sure.' ),
|
||||
'desc' => sprintf( __( 'E.g.: %s' ), '<code>' . 'woocommerce_subscriptions_product_price' . '</code>' . ', ' .'<code>' . 'woocommerce_get_price' . '</code>' . '.' ),
|
||||
'id' => 'wcj_multicurrency_switcher_additional_price_filters',
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'min-width:300px;height:150px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced: Price Filters Priority', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Priority for all module\'s price filters. Set to zero to use default priority.' ),
|
||||
'id' => 'wcj_multicurrency_advanced_price_hooks_priority',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_multicurrency_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Currencies Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'One currency probably should be set to current (original) shop currency with an exchange rate of 1.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_currencies_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Currencies', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Press Save changes after setting this option, so new settings fields will be added.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_multicurrency_total_number',
|
||||
'default' => 2,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => array_merge(
|
||||
is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ? apply_filters( 'booster_message', '', 'readonly' ) : array(),
|
||||
array( 'step' => '1', 'min' => '2', )
|
||||
),
|
||||
),
|
||||
);
|
||||
$total_number = apply_filters( 'booster_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_to = get_option( 'wcj_multicurrency_currency_' . $i, $currency_from );
|
||||
$custom_attributes = array(
|
||||
'currency_from' => $currency_from,
|
||||
'currency_to' => $currency_to,
|
||||
'multiply_by_field_id' => 'wcj_multicurrency_exchange_rate_' . $i,
|
||||
);
|
||||
if ( $currency_from == $currency_to ) {
|
||||
$custom_attributes['disabled'] = 'disabled';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Currency', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_multicurrency_currency_' . $i,
|
||||
'default' => $currency_from,
|
||||
'type' => 'select',
|
||||
'options' => $all_currencies,
|
||||
'css' => 'width:250px;',
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'id' => 'wcj_multicurrency_exchange_rate_' . $i,
|
||||
'default' => 1,
|
||||
'type' => 'exchange_rate',
|
||||
'custom_attributes_button' => $custom_attributes,
|
||||
'value' => $currency_from . '/' . $currency_to,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_multicurrency_currencies_options',
|
||||
),
|
||||
) );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Role Defaults', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => sprintf( __( 'Custom roles can be added via "Add/Manage Custom Roles" tool in Booster\'s <a href="%s">General</a> module.', 'woocommerce-jetpack' ),
|
||||
admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=emails_and_misc§ion=general' ) ),
|
||||
'id' => 'wcj_multicurrency_role_defaults_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Roles', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Save settings after you change this option. Leave blank to disable.', 'woocommerce-jetpack' ),
|
||||
'type' => 'multiselect',
|
||||
'id' => 'wcj_multicurrency_role_defaults_roles',
|
||||
'default' => '',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
) );
|
||||
$module_currencies = array();
|
||||
for ( $i = 1; $i <= $total_number; $i++ ) {
|
||||
$currency_code = get_option( 'wcj_multicurrency_currency_' . $i, $currency_from );
|
||||
$module_currencies[ $currency_code ] = $all_currencies[ $currency_code ];
|
||||
}
|
||||
$module_currencies = array_unique( $module_currencies );
|
||||
$module_roles = get_option( 'wcj_multicurrency_role_defaults_roles', '' );
|
||||
if ( ! empty( $module_roles ) ) {
|
||||
foreach ( $module_roles as $role_key ) { // wcj_get_user_roles() as $role_key => $role_data
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $role_key, // $role_data['name'],
|
||||
'id' => 'wcj_multicurrency_role_defaults_' . $role_key,
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'options' => array_merge( array( '' => __( 'No default currency', 'woocommerce-jetpack' ) ), $module_currencies ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_multicurrency_role_defaults_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - My Account
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.9.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_my_account_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Order Status Actions', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Let your customers change order status manually.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_add_order_status_actions',
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_order_statuses(),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add User Role Selection to Registration Form', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Let your customers choose their user role manually.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_registration_extra_fields_user_role_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Default user role', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_registration_extra_fields_user_role_default',
|
||||
'default' => 'customer',
|
||||
'type' => 'select',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'User roles options', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_registration_extra_fields_user_role_options',
|
||||
'default' => array( 'customer' ),
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => wcj_get_user_roles_options(),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_my_account_options',
|
||||
),
|
||||
);
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Custom Info Blocks', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_my_account_custom_info_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Custom Info Blocks', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_my_account_custom_info_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Total Blocks', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_custom_info_total_number',
|
||||
'default' => 1,
|
||||
'type' => 'custom_number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_my_account_custom_info_options',
|
||||
),
|
||||
) );
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_my_account_custom_info_total_number', 1 ) ); $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Info Block', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_my_account_custom_info_options_' . $i,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can use HTML and/or shortcodes here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_custom_info_content_' . $i,
|
||||
'default' => '',
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;height:100px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_custom_info_hook_' . $i,
|
||||
'default' => 'woocommerce_account_dashboard',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'woocommerce_account_content' => __( 'Account content', 'woocommerce-jetpack' ),
|
||||
'woocommerce_account_dashboard' => __( 'Account dashboard', 'woocommerce-jetpack' ),
|
||||
'woocommerce_account_navigation' => __( 'Account navigation', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_account_downloads' => __( 'After account downloads', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_account_navigation' => __( 'After account navigation', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_account_orders' => __( 'After account orders', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_account_payment_methods' => __( 'After account payment methods', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_available_downloads' => __( 'After available downloads', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_customer_login_form' => __( 'After customer login form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_edit_account_address_form' => __( 'After edit account address form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_edit_account_form' => __( 'After edit account form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_my_account' => __( 'After my account', 'woocommerce-jetpack' ),
|
||||
'woocommerce_available_download_end' => __( 'Available download end', 'woocommerce-jetpack' ),
|
||||
'woocommerce_available_download_start' => __( 'Available download start', 'woocommerce-jetpack' ),
|
||||
'woocommerce_available_downloads' => __( 'Available downloads', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_account_downloads' => __( 'Before account downloads', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_account_navigation' => __( 'Before account navigation', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_account_orders' => __( 'Before account orders', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_account_orders_pagination' => __( 'Before account orders pagination', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_account_payment_methods' => __( 'Before account payment methods', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_available_downloads' => __( 'Before Available downloads', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_customer_login_form' => __( 'Before customer login form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_edit_account_address_form' => __( 'Before edit account address form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_edit_account_form' => __( 'Before edit account form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_my_account' => __( 'Before my account', 'woocommerce-jetpack' ),
|
||||
'woocommerce_edit_account_form' => __( 'Edit account form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_edit_account_form_end' => __( 'Edit account form end', 'woocommerce-jetpack' ),
|
||||
'woocommerce_edit_account_form_start' => __( 'Edit account form start', 'woocommerce-jetpack' ),
|
||||
'woocommerce_login_form' => __( 'Login form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_login_form_end' => __( 'Login form end', 'woocommerce-jetpack' ),
|
||||
'woocommerce_login_form_start' => __( 'Login form start', 'woocommerce-jetpack' ),
|
||||
'woocommerce_lostpassword_form' => __( 'Lost password form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_register_form' => __( 'Register form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_register_form_end' => __( 'Register form end', 'woocommerce-jetpack' ),
|
||||
'woocommerce_register_form_start' => __( 'Register form start', 'woocommerce-jetpack' ),
|
||||
'woocommerce_resetpassword_form' => __( 'Reset password form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_view_order' => __( 'View order', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position Order (i.e. Priority)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_my_account_custom_info_priority_' . $i,
|
||||
'default' => 10,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_my_account_custom_info_options_' . $i,
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Offer Price
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.9.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_general_options',
|
||||
'type' => 'title',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Possible values: Enable for all products; Enable for all products with empty price; Enable per product; Enable per product category.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'If Enable per product is selected, this will add new meta box to each product\'s edit page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_enabled_type',
|
||||
'type' => 'select',
|
||||
'default' => 'all_products',
|
||||
'options' => array(
|
||||
'all_products' => __( 'Enable for all products', 'woocommerce-jetpack' ),
|
||||
'empty_prices' => __( 'Enable for all products with empty price', 'woocommerce-jetpack' ),
|
||||
'per_product' => __( 'Enable per product', 'woocommerce-jetpack' ),
|
||||
'per_category' => __( 'Enable per product category', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Product categories', 'woocommerce-jetpack' ) . '<br>' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Ignored if "Enable per product category" option is not selected above.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_enabled_cats',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'default' => array(),
|
||||
'options' => wcj_get_terms( 'product_cat' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_offer_price_general_options',
|
||||
'type' => 'sectionend',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Button Options', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_options',
|
||||
'type' => 'title',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_label',
|
||||
'type' => 'text',
|
||||
'default' => __( 'Make an offer', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'CSS Class', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_class',
|
||||
'type' => 'text',
|
||||
'default' => 'button',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'CSS Style', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_style',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'css' => 'width:100%;',
|
||||
'desc' => sprintf( __( 'E.g.: %s', 'woocommerce-jetpack' ), '<code>background-color: #333333; border-color: #333333; color: #ffffff;</code>' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position On Single Product Page', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_position',
|
||||
'type' => 'select',
|
||||
'default' => 'woocommerce_single_product_summary',
|
||||
'options' => array(
|
||||
'disable' => __( 'Do not add', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_single_product' => __( 'Before single product', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_single_product_summary' => __( 'Before single product summary', 'woocommerce-jetpack' ),
|
||||
'woocommerce_single_product_summary' => __( 'Inside single product summary', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_add_to_cart_form' => __( 'Before add to cart form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_add_to_cart_form' => __( 'After add to cart form', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_single_product_summary' => __( 'After single product summary', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_single_product' => __( 'After single product', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position Priority (i.e. Order)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_position_priority',
|
||||
'type' => 'number',
|
||||
'default' => 31,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Position On Archive Pages', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Possible values: Do not add; Before product; After product.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_position_archives',
|
||||
'type' => 'select',
|
||||
'default' => 'disable',
|
||||
'options' => array(
|
||||
'disable' => __( 'Do not add', 'woocommerce-jetpack' ),
|
||||
'woocommerce_before_shop_loop_item' => __( 'Before product', 'woocommerce-jetpack' ),
|
||||
'woocommerce_after_shop_loop_item' => __( 'After product', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Position Priority (i.e. Order)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_button_position_priority_archives',
|
||||
'type' => 'number',
|
||||
'default' => 10,
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_offer_price_button_options',
|
||||
'type' => 'sectionend',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Form and Notice Options', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_form_options',
|
||||
'type' => 'title',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Price Input', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ) .
|
||||
'. ' . wcj_message_replaced_values( array( '%currency_symbol%' ) ),
|
||||
'id' => 'wcj_offer_price_price_label',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => sprintf( __( 'Your price (%s)', 'woocommerce-jetpack' ), '%currency_symbol%' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Price Step', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Number of decimals', 'woocommerce' ),
|
||||
'id' => 'wcj_offer_price_price_step',
|
||||
'type' => 'number',
|
||||
'default' => get_option( 'woocommerce_price_num_decimals' ),
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Minimal Price', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_min_price',
|
||||
'type' => 'number',
|
||||
'default' => 0,
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Maximal Price', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_max_price',
|
||||
'type' => 'number',
|
||||
'default' => 0,
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Default Price', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_default_price',
|
||||
'type' => 'number',
|
||||
'default' => 0,
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customer Email', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_customer_email',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Your email', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customer Name', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_customer_name',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Your name', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customer Message', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_customer_message',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Your message', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Send a Copy to Customer Checkbox', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_customer_copy',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Send a copy to your email', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Form Header', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%product_title%' ) ),
|
||||
'id' => 'wcj_offer_price_form_header_template',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => '<h3>' . sprintf( __( 'Suggest your price for %s', 'woocommerce-jetpack' ), '%product_title%' ) . '</h3>',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Form Button Label', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_form_button_label',
|
||||
'type' => 'text',
|
||||
'default' => __( 'Send', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Form Footer', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_form_footer_template',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => '',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Required HTML', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_form_required_html',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => ' <abbr class="required" title="required">*</abbr>',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Customer Notice', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_customer_notice',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => __( 'Your price offer has been sent.', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_offer_price_form_options',
|
||||
'type' => 'sectionend',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Styling Options', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_styling_options',
|
||||
'type' => 'title',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Form Width', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_offer_price_styling[form_content_width]",
|
||||
'type' => 'text',
|
||||
'default' => '80%',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Header Background Color', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_offer_price_styling[form_header_back_color]",
|
||||
'type' => 'color',
|
||||
'default' => '#5cb85c',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Header Text Color', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_offer_price_styling[form_header_text_color]",
|
||||
'type' => 'color',
|
||||
'default' => '#ffffff',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Footer Background Color', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_offer_price_styling[form_footer_back_color]",
|
||||
'type' => 'color',
|
||||
'default' => '#5cb85c',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Footer Text Color', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_offer_price_styling[form_footer_text_color]",
|
||||
'type' => 'color',
|
||||
'default' => '#ffffff',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_offer_price_styling_options',
|
||||
'type' => 'sectionend',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Options', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_email_options',
|
||||
'type' => 'title',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Recipient', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Can be comma separated list.', 'woocommerce-jetpack' ) . ' ' .
|
||||
sprintf(
|
||||
__( 'Use %s to send to administrator email: %s.',
|
||||
'woocommerce-jetpack' ), '<code>' . '%admin_email%' . '</code>',
|
||||
'<code>' . get_option( 'admin_email' ) . '</code>'
|
||||
) . ' ' .
|
||||
wcj_message_replaced_values( array( '%admin_email%', '%product_author_email%' ) ),
|
||||
'id' => 'wcj_offer_price_email_address',
|
||||
'type' => 'custom_textarea',
|
||||
'default' => '%admin_email%',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Subject', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_offer_price_email_subject',
|
||||
'type' => 'text',
|
||||
'default' => __( 'Price Offer', 'woocommerce-jetpack' ),
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Email Template', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%product_title%', '%offered_price%', '%customer_name%', '%customer_email%', '%customer_message%' ) ),
|
||||
'id' => 'wcj_offer_price_email_template',
|
||||
'type' => 'custom_textarea',
|
||||
'default' =>
|
||||
sprintf( __( 'Product: %s', 'woocommerce-jetpack' ), '%product_title%' ) . '<br>' . PHP_EOL .
|
||||
sprintf( __( 'Offered price: %s', 'woocommerce-jetpack' ), '%offered_price%' ) . '<br>' . PHP_EOL .
|
||||
sprintf( __( 'From: %s %s', 'woocommerce-jetpack' ), '%customer_name%', '%customer_email%' ) . '<br>' . PHP_EOL .
|
||||
sprintf( __( 'Message: %s', 'woocommerce-jetpack' ), '%customer_message%' ),
|
||||
'css' => 'width:100%;height:200px;',
|
||||
),
|
||||
array(
|
||||
'id' => 'wcj_offer_price_email_options',
|
||||
'type' => 'sectionend',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - Order Custom Statuses
|
||||
*
|
||||
* @version 3.6.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Custom Statuses', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_orders_custom_statuses_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Default Order Status', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable the module to add custom statuses to the list.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'You can change the default order status here. However payment gateways can change this status immediately on order creation. E.g. BACS gateway will change status to On-hold.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_custom_statuses_default_status',
|
||||
'default' => 'wcj_no_changes',
|
||||
'type' => 'select',
|
||||
'options' => array_merge( array( 'wcj_no_changes' => __( 'No changes', 'woocommerce-jetpack' ) ), wcj_get_order_statuses() ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add All Statuses to Admin Order Bulk Actions', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If you wish to add custom statuses to admin Orders page bulk actions, enable the checkbox here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_custom_statuses_add_to_bulk_actions',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Custom Statuses to Admin Reports', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If you wish to add custom statuses to admin reports, enable the checkbox here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_custom_statuses_add_to_reports',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Make Custom Status Orders Editable', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'By default orders with custom statuses are not editable (same like with standard WooCommerce Completed status). If you wish to make custom status orders editable, enable the checkbox here.', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_orders_custom_statuses_is_order_editable',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Processing" and "Complete" Action Buttons', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'By default, when order has custom status, "Processing" and "Complete" action buttons are hidden. You can enable it here. Possible values are: Show both; Show "Processing" only; Show "Complete" only; Hide (default).', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_custom_statuses_processing_and_completed_actions',
|
||||
'default' => 'hide',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'show_both' => __( 'Show both', 'woocommerce-jetpack' ),
|
||||
'show_processing' => __( 'Show "Processing" only', 'woocommerce-jetpack' ),
|
||||
'show_complete' => __( 'Show "Complete" only', 'woocommerce-jetpack' ),
|
||||
'hide' => __( 'Hide', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Custom Statuses to Admin Order List Action Buttons', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If you wish to add custom statuses buttons to the admin Orders page action buttons (Actions column), enable the checkbox here.', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_orders_custom_statuses_add_to_order_list_actions',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Enable Colors', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Choose if you want the buttons to have colors.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_orders_custom_statuses_add_to_order_list_actions_colored',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Colors in Status Column', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this if you want the statuses in Status column to have colors.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_orders_custom_statuses_column_colored',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_orders_custom_statuses_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Order Minimum Amount
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Order Minimum Amount', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you set minimum order amount.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Amount', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Minimum order amount. Set to 0 to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '0.0001', 'min' => '0' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Shipping from Cart Total', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Exclude', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_exclude_shipping',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Discounts from Cart Total', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Exclude', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_exclude_discounts',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Error message', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Message to customer if order is below minimum amount. Default: You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_error_message',
|
||||
'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
|
||||
'type' => 'textarea',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
'css' => 'width:50%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add notice to cart page also', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_cart_notice_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message on cart page', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Message to customer if order is below minimum amount. Default: You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_cart_notice_message',
|
||||
'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
|
||||
'type' => 'textarea',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
'css' => 'width:50%;min-width:300px;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Cart notice method', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_cart_notice_function',
|
||||
'default' => 'wc_print_notice',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'wc_print_notice' => __( 'Print notice', 'woocommerce-jetpack' ),
|
||||
'wc_add_notice' => __( 'Add notice', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Cart notice type', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_cart_notice_type',
|
||||
'default' => 'notice',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'notice' => __( 'Notice', 'woocommerce-jetpack' ),
|
||||
'error' => __( 'Error', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Stop customer from seeing the Checkout page if minimum amount not reached', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Redirect back to Cart page', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_minimum_amount_stop_from_seeing_checkout',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_minimum_amount_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Order Minimum Amount by User Role', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_minimum_amount_by_ser_role_options',
|
||||
'desc' => sprintf( __( 'Custom roles can be added via "Add/Manage Custom Roles" tool in Booster\'s <a href="%s">General</a> module.', 'woocommerce-jetpack' ),
|
||||
admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=emails_and_misc§ion=general' ) ),
|
||||
),
|
||||
);
|
||||
$c = array( 'guest', 'administrator', 'customer' );
|
||||
$is_r = apply_filters( 'booster_message', '', 'readonly' );
|
||||
if ( '' == $is_r ) {
|
||||
$is_r = array();
|
||||
}
|
||||
foreach ( wcj_get_user_roles() as $role_key => $role_data ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $role_data['name'],
|
||||
'id' => 'wcj_order_minimum_amount_by_user_role_' . $role_key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => ( ! in_array( $role_key, $c ) ? array_merge( array( 'step' => '0.0001', 'min' => '0', ), $is_r ) : array( 'step' => '0.0001', 'min' => '0', ) ),
|
||||
'desc_tip' => ( ! in_array( $role_key, $c ) ? apply_filters( 'booster_message', '', 'desc_no_link' ) : '' ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_minimum_amount_by_ser_role_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Order Numbers
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) add `wcj_order_number_counter_previous_order_date` as `hidden` field (for proper module reset)
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Order Numbers', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you enable sequential order numbering, set custom number prefix, suffix and width.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_numbers_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Number Generation', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_sequential_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'yes' => __( 'Sequential', 'woocommerce-jetpack' ),
|
||||
'no' => __( 'Order ID', 'woocommerce-jetpack' ),
|
||||
'hash_crc32' => __( 'Pseudorandom - Hash (max 10 digits)', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Sequential: Next Order Number', 'woocommerce-jetpack' ),
|
||||
'desc' => '<br>' . __( 'Next new order will be given this number.', 'woocommerce-jetpack' ) . ' ' . __( 'Use Renumerate Orders tool for existing orders.', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will be ignored if sequential order numbering is disabled.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_counter',
|
||||
'default' => 1,
|
||||
'type' => 'number',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Sequential: Reset Counter', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will be ignored if sequential order numbering is disabled.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_counter_reset_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'no' => __( 'Disabled', 'woocommerce-jetpack' ),
|
||||
'daily' => __( 'Daily', 'woocommerce-jetpack' ),
|
||||
'monthly' => __( 'Monthly', 'woocommerce-jetpack' ),
|
||||
'yearly' => __( 'Yearly', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Order Number Custom Prefix', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Prefix before order number (optional). This will change the prefixes for all existing orders.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_prefix',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Order Number Date Prefix', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Date prefix before order number (optional). This will change the prefixes for all existing orders. Value is passed directly to PHP `date` function, so most of PHP date formats can be used. The only exception is using `\` symbol in date format, as this symbol will be excluded from date. Try: Y-m-d- or mdy.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_date_prefix',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Order Number Width', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Minimum width of number without prefix (zeros will be added to the left side). This will change the minimum width of order number for all existing orders. E.g. set to 5 to have order number displayed as 00001 instead of 1. Leave zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_min_width',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Order Number Custom Suffix', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Suffix after order number (optional). This will change the suffixes for all existing orders.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_suffix',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Order Number Date Suffix', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Date suffix after order number (optional). This will change the suffixes for all existing orders. Value is passed directly to PHP `date` function, so most of PHP date formats can be used. The only exception is using `\` symbol in date format, as this symbol will be excluded from date. Try: Y-m-d- or mdy.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_date_suffix',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'readonly' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Use MySQL Transaction', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This should be enabled if you have a lot of simultaneous orders in your shop - to prevent duplicate order numbers (sequential).', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_use_mysql_transaction_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Order Tracking by Custom Number', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_order_tracking_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Order Admin Search by Custom Number', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_search_by_custom_number_enabled',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Editable Order Number Meta Box', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_number_editable_order_number_meta_box_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Minimal Order ID', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If you wish to disable order numbering for some (older) orders, you can set order ID to start here.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Set to zero to enable numbering for all orders.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_numbers_min_order_id',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_numbers_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Orders Renumerate Tool Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_numbers_renumerate_tool_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Sort by', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_numbers_renumerate_tool_orderby',
|
||||
'default' => 'date',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'ID' => __( 'ID', 'woocommerce-jetpack' ),
|
||||
'date' => __( 'Date', 'woocommerce-jetpack' ),
|
||||
'modified' => __( 'Last modified date', 'woocommerce-jetpack' ),
|
||||
'rand' => __( 'Random', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Sort Ascending or Descending', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_numbers_renumerate_tool_order',
|
||||
'default' => 'ASC',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'ASC' => __( 'Ascending', 'woocommerce-jetpack' ),
|
||||
'DESC' => __( 'Descending', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_numbers_renumerate_tool_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Order Min/Max Quantities
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.9.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) generate settings in loop ( min / max )
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Minimum Quantity Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_quantities_min_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Minimum Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_quantities_min_section_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Cart Total Quantity', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set to zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_min_cart_total_quantity',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Cart Total Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%min_cart_total_quantity%', '%cart_total_quantity%' ) ),
|
||||
'id' => 'wcj_order_quantities_min_cart_total_message',
|
||||
'default' => __( 'Minimum allowed order quantity is %min_cart_total_quantity%. Your current order quantity is %cart_total_quantity%.', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Item Quantity', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set to zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_min_per_item_quantity',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => ( '' === apply_filters( 'booster_message', '', 'readonly' ) ? array( 'min' => 0 ) : apply_filters( 'booster_message', '', 'readonly' ) ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Item Quantity on Per Product Basis', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add meta box to each product\'s edit page.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_order_quantities_min_per_item_quantity_per_product',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Per Item Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%product_title%', '%min_per_item_quantity%', '%item_quantity%' ) ),
|
||||
'id' => 'wcj_order_quantities_min_per_item_message',
|
||||
'default' => __( 'Minimum allowed quantity for %product_title% is %min_per_item_quantity%. Your current item quantity is %item_quantity%.', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_quantities_min_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Maximum Quantity Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_quantities_max_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Maximum Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_quantities_max_section_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Cart Total Quantity', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set to zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_max_cart_total_quantity',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 0 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Cart Total Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%max_cart_total_quantity%', '%cart_total_quantity%' ) ),
|
||||
'id' => 'wcj_order_quantities_max_cart_total_message',
|
||||
'default' => __( 'Maximum allowed order quantity is %max_cart_total_quantity%. Your current order quantity is %cart_total_quantity%.', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Item Quantity', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Set to zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_max_per_item_quantity',
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => ( '' === apply_filters( 'booster_message', '', 'readonly' ) ? array( 'min' => 0 ) : apply_filters( 'booster_message', '', 'readonly' ) ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per Item Quantity on Per Product Basis', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add meta box to each product\'s edit page.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_order_quantities_max_per_item_quantity_per_product',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message - Per Item Quantity', 'woocommerce-jetpack' ),
|
||||
'desc' => wcj_message_replaced_values( array( '%product_title%', '%max_per_item_quantity%', '%item_quantity%' ) ),
|
||||
'id' => 'wcj_order_quantities_max_per_item_message',
|
||||
'default' => __( 'Maximum allowed quantity for %product_title% is %max_per_item_quantity%. Your current item quantity is %item_quantity%.', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_quantities_max_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_quantities_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable Cart Notices', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_cart_notice_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Stop Customer from Seeing Checkout on Wrong Quantities', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Will be redirected to cart page', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_stop_from_seeing_checkout',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Variable Products', 'woocommerce-jetpack' ),
|
||||
'desc' => '<br>' . __( 'Action on variation change', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_variable_variation_change',
|
||||
'default' => 'do_nothing',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'do_nothing' => __( 'Do nothing', 'woocommerce-jetpack' ),
|
||||
'reset_to_min' => __( 'Reset to min quantity', 'woocommerce-jetpack' ),
|
||||
'reset_to_max' => __( 'Reset to max quantity', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Force on add to cart', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Force quantity correction on add to cart button click', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_variable_force_on_add_to_cart',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_quantities_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Quantity Step Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_quantities_step_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Quantity Step', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_quantities_step_section_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Step', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Ignored if set to zero.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_step',
|
||||
'default' => 1,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'min' => 1 ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Per product', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add meta box to each product\'s edit page.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_order_quantities_step_per_product',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_quantities_step_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( '"Single Item Cart" Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_quantities_single_item_cart_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Enable "Single Item Cart" Mode', 'woocommerce-jetpack' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'desc_tip' => __( 'When enabled, only one item will be allowed to be added to the cart (quantity is not checked).', 'woocommerce-jetpack' ) . ' ' .
|
||||
apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_order_quantities_single_item_cart_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Message', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_quantities_single_item_cart_message',
|
||||
'default' => __( 'Only one item can be added to the cart. Clear the cart or finish the order, before adding another item to the cart.', 'woocommerce-jetpack' ),
|
||||
'type' => 'custom_textarea',
|
||||
'css' => 'width:100%;',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_quantities_single_item_cart_options',
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - Orders
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$bulk_regenerate_download_permissions_all_orders_cron_desc = '';
|
||||
if ( $this->is_enabled() && 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_order_bulk_regenerate_download_permissions_enabled', 'no' ) ) ) {
|
||||
$bulk_regenerate_download_permissions_all_orders_cron_desc = wcj_crons_get_next_event_time_message( 'wcj_bulk_regenerate_download_permissions_all_orders_cron_time' );
|
||||
}
|
||||
|
||||
$payment_gateways_options = array();
|
||||
if ( function_exists( 'WC' ) && is_callable( array( WC()->payment_gateways, 'payment_gateways' ) ) ) {
|
||||
foreach ( WC()->payment_gateways->payment_gateways() as $payment_gateway_key => $payment_gateway_data ) {
|
||||
$payment_gateways_options[ $payment_gateway_key ] = $payment_gateway_data->title;
|
||||
}
|
||||
}
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Admin Order Currency', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_admin_currency_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Admin Order Currency', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'When enabled this will add "Booster: Orders" metabox to each order\'s edit page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_currency',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Admin Order Currency Method', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Choose if you want changed order currency to be saved directly to DB, or if you want to use filter. When using <em>filter</em> method, changes will be active only when "Admin Order Currency" section is enabled. When using <em>directly to DB</em> method, changes will be permanent, that is even if Booster plugin is removed.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_admin_currency_method',
|
||||
'default' => 'filter',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'filter' => __( 'Filter', 'woocommerce-jetpack' ),
|
||||
'db' => __( 'Directly to DB', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_admin_currency_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Admin Order Navigation', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_orders_navigation_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Admin Order Navigation', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'When enabled, this will add "Booster: Order Navigation" metabox to each order\'s admin edit page.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Metabox will contain "Previous order" and "Next order" links.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_navigation_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_orders_navigation_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Orders Auto-Complete', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you enable orders auto-complete function.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_auto_complete_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Auto-complete all WooCommerce orders', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'E.g. if you sell digital products then you are not shipping anything and you may want auto-complete all your orders.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_auto_complete_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Payment methods', 'woocommerce-jetpack' ) . '<br>' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Fill this, if you want orders to be auto-completed for selected payment methods only. Leave blank to auto-complete all orders.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_auto_complete_payment_methods',
|
||||
'default' => array(),
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $payment_gateways_options,
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_auto_complete_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Country by IP', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_orders_country_by_ip_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Add Country by IP Meta Box', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'When enabled this will add "Booster: Country by IP" metabox to each order\'s edit page.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_orders_country_by_ip_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_orders_country_by_ip_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Bulk Regenerate Download Permissions for Orders', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_order_bulk_regenerate_download_permissions_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Bulk Regenerate Download Permissions', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc' => '<strong>' . __( 'Enable section', 'woocommerce-jetpack' ) . '</strong>',
|
||||
'id' => 'wcj_order_bulk_regenerate_download_permissions_enabled',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Bulk Actions', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'When enabled this will add "Regenerate download permissions" action to "Bulk Actions" select box on admin orders page.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc' => __( 'Add', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_bulk_regenerate_download_permissions_actions',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'All Orders - Now', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Check this box and press "Save changes" button to start regeneration. Please note that both module and current section must be enabled before that.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc' => __( 'Regenerate now', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_order_bulk_regenerate_download_permissions_all_orders',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'All Orders - Periodically', 'woocommerce-jetpack' ),
|
||||
'desc' => $bulk_regenerate_download_permissions_all_orders_cron_desc . ' ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'id' => 'wcj_order_bulk_regenerate_download_permissions_all_orders_cron',
|
||||
'default' => 'disabled',
|
||||
'type' => 'select',
|
||||
'options' => array_merge( array( 'disabled' => __( 'Disabled', 'woocommerce-jetpack' ) ),
|
||||
wcj_crons_get_all_intervals( __( 'Regenerate', 'woocommerce-jetpack' ), array( 'minutely' ) ) ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_order_bulk_regenerate_download_permissions_options',
|
||||
),
|
||||
);
|
||||
return $settings;
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways by Country or State
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo change `textarea` to `readonly`
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_gateways_by_location_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Detect Country by', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_by_location_country_type',
|
||||
'type' => 'select',
|
||||
'default' => 'billing',
|
||||
'options' => array(
|
||||
'billing' => __( 'Billing country', 'woocommerce-jetpack' ),
|
||||
'shipping' => __( 'Shipping country', 'woocommerce-jetpack' ),
|
||||
'by_ip' => __( 'Country by IP', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Detect State by', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_by_location_state_type',
|
||||
'type' => 'select',
|
||||
'default' => 'billing',
|
||||
'options' => array(
|
||||
'billing' => __( 'Billing state', 'woocommerce-jetpack' ),
|
||||
'shipping' => __( 'Shipping state', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Detect Postcode by', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_by_location_postcodes_type',
|
||||
'type' => 'select',
|
||||
'default' => 'billing',
|
||||
'options' => array(
|
||||
'billing' => __( 'Billing postcode', 'woocommerce-jetpack' ),
|
||||
'shipping' => __( 'Shipping postcode', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_gateways_by_location_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'If any field is left empty - it\'s ignored.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_by_country_gateways_options',
|
||||
),
|
||||
);
|
||||
$countries = wcj_get_countries();
|
||||
$states = wcj_get_states();
|
||||
$gateways = WC()->payment_gateways->payment_gateways();
|
||||
foreach ( $gateways as $key => $gateway ) {
|
||||
$default_gateways = array( 'bacs' );
|
||||
if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
|
||||
$custom_attributes = apply_filters( 'booster_message', '', 'disabled' );
|
||||
if ( '' == $custom_attributes ) {
|
||||
$custom_attributes = array();
|
||||
}
|
||||
$desc_tip = apply_filters( 'booster_message', '', 'desc_no_link' );
|
||||
} else {
|
||||
$custom_attributes = array();
|
||||
$desc_tip = '';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Include Countries', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_countries_include_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $countries,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Exclude Countries', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_countries_exclude_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $countries,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Include States (Base Country)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_states_include_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $states,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Exclude States (Base Country)', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_states_exclude_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $states,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Include Postcodes (one per line)', 'woocommerce-jetpack' ) . '<br>' .
|
||||
'<em>' . __( 'Postcodes containing wildcards (e.g. CB23*) and fully numeric ranges (e.g. <code>90210...99000</code>) are also supported.', 'woocommerce' ) . '</em>',
|
||||
'id' => 'wcj_gateways_postcodes_include_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'height:200px;',
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Exclude Postcodes (one per line)', 'woocommerce-jetpack' ) . '<br>' .
|
||||
'<em>' . __( 'Postcodes containing wildcards (e.g. CB23*) and fully numeric ranges (e.g. <code>90210...99000</code>) are also supported.', 'woocommerce' ) . '</em>',
|
||||
'id' => 'wcj_gateways_postcodes_exclude_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'textarea',
|
||||
'css' => 'height:200px;',
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_by_country_gateways_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways by Currency
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 3.0.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'Leave empty to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_by_currency_gateways_options',
|
||||
),
|
||||
);
|
||||
$currencies = wcj_get_currencies_names_and_symbols();
|
||||
$gateways = WC()->payment_gateways->payment_gateways();
|
||||
$paypal_allowed_currencies = array( 'AUD', 'BRL', 'CAD', 'MXN', 'NZD', 'HKD', 'SGD', 'USD', 'EUR', 'JPY', 'TRY', 'NOK', 'CZK', 'DKK', 'HUF', 'ILS', 'MYR', 'PHP', 'PLN', 'SEK', 'CHF', 'TWD', 'THB', 'GBP', 'RMB', 'RUB' );
|
||||
$paypal_allowed_currencies_and_names = array();
|
||||
foreach ( $paypal_allowed_currencies as $paypal_allowed_currency ) {
|
||||
$paypal_allowed_currencies_and_names[] = $currencies[ $paypal_allowed_currency ];
|
||||
}
|
||||
$paypal_tip = sprintf( __( 'PayPal allows only these currencies: %s.', 'woocommerce-jetpack' ), '<br>' . implode( '<br>', $paypal_allowed_currencies_and_names ) );
|
||||
foreach ( $gateways as $key => $gateway ) {
|
||||
$default_gateways = array( 'bacs' );
|
||||
if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
|
||||
$custom_attributes = apply_filters( 'booster_message', '', 'disabled' );
|
||||
if ( '' == $custom_attributes ) {
|
||||
$custom_attributes = array();
|
||||
}
|
||||
$desc_tip = apply_filters( 'booster_message', '', 'desc_no_link' );
|
||||
} else {
|
||||
$custom_attributes = array();
|
||||
$desc_tip = '';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc_tip' => $desc_tip . ( 'paypal' == $key ? ' ' . $paypal_tip : '' ),
|
||||
'desc' => __( 'Allowed Currencies', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_by_currency_allowed_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $currencies,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Denied Currencies', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_by_currency_denied_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $currencies,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_by_currency_gateways_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce Settings - Payment Gateways by Shipping
|
||||
*
|
||||
* @version 3.5.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo (maybe) remove COD, Custom Booster Payment Gateways (and maybe other payment gateways) that already have `enable_for_methods` option
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$use_shipping_instance = ( 'yes' === get_option( 'wcj_payment_gateways_by_shipping_use_shipping_instance', 'no' ) );
|
||||
$shipping_methods = ( $use_shipping_instance ? wcj_get_shipping_methods_instances() : wcj_get_shipping_methods() );
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_payment_gateways_by_shipping_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Use Shipping Instances', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Enable', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Enable this if you want to use shipping methods instances instead of shipping methods.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Save changes after enabling this option.', 'woocommerce-jetpack' ),
|
||||
'type' => 'checkbox',
|
||||
'id' => 'wcj_payment_gateways_by_shipping_use_shipping_instance',
|
||||
'default' => 'no',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_by_shipping_general_options',
|
||||
),
|
||||
);
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'If payment gateway is only available for certain methods, set it up here. Leave blank to enable for all methods.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_by_shipping_options',
|
||||
),
|
||||
) );
|
||||
$gateways = WC()->payment_gateways->payment_gateways();
|
||||
foreach ( $gateways as $key => $gateway ) {
|
||||
if ( ! in_array( $key, array( 'bacs', 'cod' ) ) ) {
|
||||
$custom_attributes = apply_filters( 'booster_message', '', 'disabled' );
|
||||
if ( '' == $custom_attributes ) {
|
||||
$custom_attributes = array();
|
||||
}
|
||||
$desc_tip = apply_filters( 'booster_message', '', 'desc_no_link' );
|
||||
} else {
|
||||
$custom_attributes = array();
|
||||
$desc_tip = '';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Enable for shipping methods', 'woocommerce' ),
|
||||
'id' => ( $use_shipping_instance ? 'wcj_gateways_by_shipping_enable_instance_' . $key : 'wcj_gateways_by_shipping_enable_' . $key ),
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $shipping_methods,
|
||||
'custom_attributes' => array_merge( array( 'data-placeholder' => __( 'Select shipping methods', 'woocommerce' ) ), $custom_attributes ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_by_shipping_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways by User Role
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'Leave empty to disable.', 'woocommerce-jetpack' ) . ' ' .
|
||||
sprintf( __( 'Custom roles can be added via "Add/Manage Custom Roles" tool in Booster\'s <a href="%s">General</a> module', 'woocommerce-jetpack' ),
|
||||
admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=emails_and_misc§ion=general' ) ),
|
||||
'id' => 'wcj_payment_gateways_by_user_role_gateways_options',
|
||||
),
|
||||
);
|
||||
$user_roles = wcj_get_user_roles_options();
|
||||
$gateways = WC()->payment_gateways->payment_gateways();
|
||||
foreach ( $gateways as $key => $gateway ) {
|
||||
$default_gateways = array( 'bacs' );
|
||||
if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
|
||||
$custom_attributes = apply_filters( 'booster_message', '', 'disabled' );
|
||||
if ( '' == $custom_attributes ) {
|
||||
$custom_attributes = array();
|
||||
}
|
||||
$desc_tip = apply_filters( 'booster_message', '', 'desc_no_link' );
|
||||
} else {
|
||||
$custom_attributes = array();
|
||||
$desc_tip = '';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Include User Roles', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_user_roles_include_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $user_roles,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Exclude User Roles', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_user_roles_exclude_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $user_roles,
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_by_user_role_gateways_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways Currency
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Payment Gateways Currency Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'This section lets you set different currency for each payment gateway.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_currency_options',
|
||||
),
|
||||
);
|
||||
$currency_from = get_woocommerce_currency();
|
||||
global $woocommerce;
|
||||
$available_gateways = $woocommerce->payment_gateways->payment_gateways();
|
||||
foreach ( $available_gateways as $key => $gateway ) {
|
||||
$currency_to = get_option( 'wcj_gateways_currency_' . $key, get_woocommerce_currency() );
|
||||
$custom_attributes = array(
|
||||
'currency_from' => $currency_from,
|
||||
'currency_to' => $currency_to,
|
||||
'multiply_by_field_id' => 'wcj_gateways_currency_exchange_rate_' . $key,
|
||||
);
|
||||
if ( $currency_from == $currency_to ) {
|
||||
$custom_attributes['disabled'] = 'disabled';
|
||||
}
|
||||
if ( 'no_changes' == $currency_to ) {
|
||||
$custom_attributes['disabled'] = 'disabled';
|
||||
$currency_to = $currency_from;
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
// 'desc' => __( 'currency', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_currency_' . $key,
|
||||
'default' => 'no_changes', // get_woocommerce_currency(),
|
||||
'type' => 'select',
|
||||
'options' => array_merge( array( 'no_changes' => __( 'No changes', 'woocommerce-jetpack' ) ), wcj_get_currencies_names_and_symbols() ),
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
// 'desc' => __( 'exchange rate', 'woocommerce-jetpack' ) . ' ' . $currency_from . ' / ' . $currency_to,
|
||||
'id' => 'wcj_gateways_currency_exchange_rate_' . $key,
|
||||
'default' => 1,
|
||||
'type' => 'exchange_rate',
|
||||
'custom_attributes_button' => $custom_attributes,
|
||||
'value' => $currency_from . '/' . $currency_to,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Exchange Rates Updates', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_currency_exchange_rate_update_auto',
|
||||
'default' => 'manual',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
|
||||
'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'desc' => ( '' == apply_filters( 'booster_message', '', 'desc' ) ) ?
|
||||
__( '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>'
|
||||
: apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_currency_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways Fees and Discounts
|
||||
*
|
||||
* @version 3.7.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$products = wcj_get_products();
|
||||
$settings = array();
|
||||
$available_gateways = WC()->payment_gateways->payment_gateways();
|
||||
foreach ( $available_gateways as $key => $gateway ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title . ( $gateway->is_available() ? ' ✓' : '' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_gateways_fees_options_' . $key,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Fee (or Discount) Title', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Fee (or discount) title to show to customer.', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_text_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Fee (or Discount) Type', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Percent or fixed value.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_type_' . $key,
|
||||
'default' => 'fixed',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'fixed' => __( 'Fixed', 'woocommerce-jetpack' ),
|
||||
'percent' => __( 'Percent', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Fee (or Discount) Value', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'The value. For discount enter a negative number.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_value_' . $key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '0.01' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Minimum Cart Amount', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Minimum cart amount for adding the fee (or discount).', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Set 0 to disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_min_cart_amount_' . $key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '0.01', 'min' => '0' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Maximum Cart Amount', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Maximum cart amount for adding the fee (or discount).', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Set 0 to disable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_max_cart_amount_' . $key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '0.01', 'min' => '0' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Rounding', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Round the fee (or discount) value before adding to the cart', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_round_' . $key,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Rounding Precision', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If Rounding is enabled, set precision (i.e. number of decimals) here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_round_precision_' . $key,
|
||||
'default' => get_option( 'woocommerce_price_num_decimals', 2 ),
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array( 'step' => '1', 'min' => '0' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Taxing', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Taxable', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_is_taxable_' . $key,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Tax Class', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'If Taxing is enabled, set tax class here.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_tax_class_id_' . $key,
|
||||
'default' => '',
|
||||
'type' => 'select',
|
||||
'options' => array_merge( array( __( 'Standard Rate', 'woocommerce-jetpack' ) ), WC_Tax::get_tax_classes() ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Shipping when Calculating Total Cart Amount', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Exclude', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This affects "Percent" type fees and "Minimum/Maximum Cart Amount" options.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_fees_exclude_shipping_' . $key,
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Require Products', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Require at least one of selected products to be in cart for fee to be applied.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Ignored if empty.', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_gateways_fees_include_products[$key]",
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $products,
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Products', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Do not apply fee, if at least one of selected products is in cart.', 'woocommerce-jetpack' ) . ' ' .
|
||||
__( 'Ignored if empty.', 'woocommerce-jetpack' ),
|
||||
'id' => "wcj_gateways_fees_exclude_products[$key]",
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'options' => $products,
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_gateways_fees_options_' . $key,
|
||||
),
|
||||
) );
|
||||
}
|
||||
return $settings;
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways Icons
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'If you want to show an image next to the gateway\'s name on the frontend, enter a URL to an image.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_icons_options',
|
||||
),
|
||||
);
|
||||
$available_gateways = WC()->payment_gateways->payment_gateways();
|
||||
foreach ( $available_gateways as $key => $gateway ) {
|
||||
$default_gateways = array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' );
|
||||
if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
|
||||
$custom_attributes = apply_filters( 'booster_message', '', 'disabled' );
|
||||
$desc_tip = apply_filters( 'booster_message', '', 'desc' );
|
||||
} else {
|
||||
$custom_attributes = array();
|
||||
$desc_tip = '';
|
||||
}
|
||||
$current_icon_url = get_option( 'wcj_gateways_icons_' . $key . '_icon', '' );
|
||||
$desc = ( '' != $current_icon_url ) ? '<img width="16" src="' . $current_icon_url . '" alt="' . $gateway->title . '" title="' . $gateway->title . '" />' : '';
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc_tip' => __( 'Leave blank to set WooCommerce default value', 'woocommerce-jetpack' ),
|
||||
'desc' => ( '' != $desc_tip ) ? $desc_tip : $desc,
|
||||
'id' => 'wcj_gateways_icons_' . $key . '_icon',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'css' => 'min-width:300px;width:50%;',
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Remove Icon', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_icons_' . $key . '_icon_remove',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
'custom_attributes' => $custom_attributes,
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_icons_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways Min/Max Amounts
|
||||
*
|
||||
* @version 2.8.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
* @todo checkout notices - add %diff_amount% and %total_in_cart% replaced values (wc_has_notice won't work then?, probably will need to use wc_clear_notices)
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'General Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_payment_gateways_min_max_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Exclude Shipping', 'woocommerce-jetpack'),
|
||||
'desc' => __( 'Exclude shipping from total cart sum, when comparing with min/max amounts.', 'woocommerce-jetpack'),
|
||||
'id' => 'wcj_payment_gateways_min_max_exclude_shipping',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Notices on Checkout', 'woocommerce-jetpack'),
|
||||
'desc' => __( 'Enable Notices', 'woocommerce-jetpack'),
|
||||
'id' => 'wcj_payment_gateways_min_max_notices_enable',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice Template (Minimum Amount)', 'woocommerce-jetpack'),
|
||||
'desc_tip' => __( 'Replaced values: %gateway_title%, %min_amount%.', 'woocommerce-jetpack'),
|
||||
'id' => 'wcj_payment_gateways_min_max_notices_template_min',
|
||||
'default' => __( 'Minimum amount for %gateway_title% is %min_amount%', 'woocommerce-jetpack'),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:90%;min-width:300px',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice Template (Maximum Amount)', 'woocommerce-jetpack'),
|
||||
'desc_tip' => __( 'Replaced values: %gateway_title%, %max_amount%.', 'woocommerce-jetpack'),
|
||||
'id' => 'wcj_payment_gateways_min_max_notices_template_max',
|
||||
'default' => __( 'Maximum amount for %gateway_title% is %max_amount%', 'woocommerce-jetpack'),
|
||||
'type' => 'textarea',
|
||||
'css' => 'width:90%;min-width:300px',
|
||||
),
|
||||
array(
|
||||
'desc' => __( 'Notice Styling', 'woocommerce-jetpack'),
|
||||
'id' => 'wcj_payment_gateways_min_max_notices_type',
|
||||
'default' => 'notice',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'notice' => __( 'Notice', 'woocommerce-jetpack'),
|
||||
'error' => __( 'Error', 'woocommerce-jetpack'),
|
||||
'success' => __( 'Success', 'woocommerce-jetpack'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_min_max_general_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'desc' => __( 'Leave zero to disable.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_min_max_gateways_options',
|
||||
),
|
||||
);
|
||||
$gateways = WC()->payment_gateways->payment_gateways();
|
||||
foreach ( $gateways as $key => $gateway ) {
|
||||
$default_gateways = array( 'bacs' );
|
||||
if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
|
||||
$custom_attributes = apply_filters( 'booster_message', '', 'disabled' );
|
||||
if ( '' == $custom_attributes ) {
|
||||
$custom_attributes = array();
|
||||
}
|
||||
$desc_tip = apply_filters( 'booster_message', '', 'desc_no_link' );
|
||||
} else {
|
||||
$custom_attributes = array();
|
||||
$desc_tip = '';
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Min', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_min_' . $key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array_merge( array( 'step' => '0.000001', 'min' => '0' ), $custom_attributes ),
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'desc_tip' => $desc_tip,
|
||||
'desc' => __( 'Max', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_payment_gateways_max_' . $key,
|
||||
'default' => 0,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array_merge( array( 'step' => '0.000001', 'min' => '0' ), $custom_attributes ),
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_payment_gateways_min_max_gateways_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Gateways per Product or Category
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$product_cats = wcj_get_terms( 'product_cat' );
|
||||
$is_multiselect_products = ( 'yes' === get_option( 'wcj_list_for_products', 'yes' ) );
|
||||
$products = ( $is_multiselect_products ? wcj_get_products() : false );
|
||||
$available_gateways = WC()->payment_gateways->payment_gateways();
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_gateways_per_category_options',
|
||||
),
|
||||
);
|
||||
foreach ( $available_gateways as $gateway_id => $gateway ) {
|
||||
wcj_maybe_convert_and_update_option_value( array(
|
||||
array( 'id' => 'wcj_gateways_per_products_' . $gateway_id, 'default' => '' ),
|
||||
array( 'id' => 'wcj_gateways_per_products_excl_' . $gateway_id, 'default' => '' ),
|
||||
), $is_multiselect_products );
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => $gateway->title,
|
||||
'desc' => __( 'Product Categories - Include', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Show gateway only if there is product of selected category in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_per_category_' . $gateway_id,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
array(
|
||||
'title' => '',
|
||||
'desc' => __( 'Product Categories - Exclude', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'Hide gateway if there is product of selected category in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_per_category_excl_' . $gateway_id,
|
||||
'default' => '',
|
||||
'type' => 'multiselect',
|
||||
'class' => 'chosen_select',
|
||||
'css' => 'width: 450px;',
|
||||
'options' => $product_cats,
|
||||
),
|
||||
wcj_get_settings_as_multiselect_or_text(
|
||||
array(
|
||||
'title' => '',
|
||||
'desc' => __( 'Products - Include', 'woocommerce-jetpack' ) . '. ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Show gateway only if there is selected products in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_per_products_' . $gateway_id,
|
||||
'default' => '',
|
||||
'css' => 'width: 450px;',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
$products,
|
||||
$is_multiselect_products
|
||||
),
|
||||
wcj_get_settings_as_multiselect_or_text(
|
||||
array(
|
||||
'title' => '',
|
||||
'desc' => __( 'Products - Exclude', 'woocommerce-jetpack' ) . '. ' . apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Hide gateway if there is selected products in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_gateways_per_products_excl_' . $gateway_id,
|
||||
'default' => '',
|
||||
'css' => 'width: 450px;',
|
||||
'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
|
||||
),
|
||||
$products,
|
||||
$is_multiselect_products
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_gateways_per_category_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Settings - Custom Gateways
|
||||
*
|
||||
* @version 3.3.0
|
||||
* @since 2.8.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$wocommerce_checkout_settings_url = admin_url( 'admin.php?page=wc-settings&tab=checkout' );
|
||||
$wocommerce_checkout_settings_url = '<a href="' . $wocommerce_checkout_settings_url . '">' . __( 'WooCommerce > Settings > Checkout', 'woocommerce-jetpack' ) . '</a>';
|
||||
$settings = array(
|
||||
array(
|
||||
'title' => __( 'Custom Payment Gateways Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_custom_payment_gateways_options',
|
||||
'desc' => __( 'This section lets you set number of custom payment gateways to add.', 'woocommerce-jetpack' )
|
||||
. ' ' . sprintf( __( 'After setting the number, visit %s to set each gateway options.', 'woocommerce-jetpack' ), $wocommerce_checkout_settings_url ),
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Number of Gateways', 'woocommerce-jetpack' ),
|
||||
'desc' => apply_filters( 'booster_message', '', 'desc' ),
|
||||
'desc_tip' => __( 'Number of custom payments gateways to be added. All settings for each new gateway are in WooCommerce > Settings > Checkout.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_payment_gateways_number',
|
||||
'default' => 1,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => is_array( apply_filters( 'booster_message', '', 'readonly' ) ) ?
|
||||
apply_filters( 'booster_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1' ),
|
||||
),
|
||||
);
|
||||
for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_custom_payment_gateways_number', 1 ) ); $i++ ) {
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'title' => __( 'Admin Title Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'id' => 'wcj_custom_payment_gateways_admin_title_' . $i,
|
||||
'default' => __( 'Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $i,
|
||||
'type' => 'text',
|
||||
),
|
||||
) );
|
||||
}
|
||||
$settings = array_merge( $settings, array(
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_custom_payment_gateways_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Advanced Options', 'woocommerce-jetpack' ),
|
||||
'type' => 'title',
|
||||
'id' => 'wcj_custom_payment_gateways_advanced_options',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Gateways Input Fields', 'woocommerce-jetpack' ),
|
||||
'desc' => __( 'Add "Delete" button', 'woocommerce-jetpack' ),
|
||||
'desc_tip' => __( 'This will add "Delete" button to custom payment gateways input fields admin order meta box.', 'woocommerce-jetpack' ),
|
||||
'id' => 'wcj_custom_payment_gateways_input_fields_delete_button',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array(
|
||||
'type' => 'sectionend',
|
||||
'id' => 'wcj_custom_payment_gateways_advanced_options',
|
||||
),
|
||||
) );
|
||||
return $settings;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user