Enabled product bundles
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Widget - Country Switcher
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 2.4.8
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'WCJ_Widget_Country_Switcher' ) ) :
|
||||
|
||||
class WCJ_Widget_Country_Switcher extends WCJ_Widget {
|
||||
|
||||
/**
|
||||
* get_data.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_data( $id ) {
|
||||
switch ( $id ) {
|
||||
case 'id_base':
|
||||
return 'wcj_widget_country_switcher';
|
||||
case 'name':
|
||||
return __( 'Booster - Country Switcher', 'woocommerce-jetpack' );
|
||||
case 'description':
|
||||
return __( 'Booster: Country Switcher Widget', 'woocommerce-jetpack' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_content.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_content( $instance ) {
|
||||
if ( ! wcj_is_module_enabled( 'price_by_country' ) ) {
|
||||
return __( 'Prices and Currencies by Country module not enabled!', 'woocommerce-jetpack' );
|
||||
} elseif ( 'by_ip' === get_option( 'wcj_price_by_country_customer_country_detection_method', 'by_ip' ) ) {
|
||||
return __( 'Customer Country Detection Method must include "by user selection"!', 'woocommerce-jetpack' );
|
||||
} else {
|
||||
if ( ! isset( $instance['replace_with_currency'] ) ) {
|
||||
$instance['replace_with_currency'] = 'no';
|
||||
}
|
||||
return do_shortcode( '[wcj_country_select_drop_down_list countries="' . $instance['countries'] . '" replace_with_currency="' . $instance['replace_with_currency'] . '"]' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_options.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
* @todo (maybe) `switcher_type`
|
||||
*/
|
||||
function get_options() {
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'title',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Countries', 'woocommerce-jetpack' ),
|
||||
'id' => 'countries',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Replace with currency', 'woocommerce-jetpack' ),
|
||||
'id' => 'replace_with_currency',
|
||||
'default' => 'no',
|
||||
'type' => 'select',
|
||||
'class' => 'widefat',
|
||||
'options' => array(
|
||||
'no' => __( 'No', 'woocommerce-jetpack' ),
|
||||
'yes' => __( 'Yes', 'woocommerce-jetpack' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'register_wcj_widget_country_switcher' ) ) {
|
||||
/**
|
||||
* Register WCJ_Widget_Country_Switcher widget.
|
||||
*/
|
||||
function register_wcj_widget_country_switcher() {
|
||||
register_widget( 'WCJ_Widget_Country_Switcher' );
|
||||
}
|
||||
}
|
||||
add_action( 'widgets_init', 'register_wcj_widget_country_switcher' );
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Widget - Left to Free Shipping
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 2.4.4
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'WCJ_Widget_Left_to_Free_Shipping' ) ) :
|
||||
|
||||
class WCJ_Widget_Left_to_Free_Shipping extends WCJ_Widget {
|
||||
|
||||
/**
|
||||
* get_data.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_data( $id ) {
|
||||
switch ( $id ) {
|
||||
case 'id_base':
|
||||
return 'wcj_widget_left_to_free_shipping';
|
||||
case 'name':
|
||||
return __( 'Booster - Left to Free Shipping', 'woocommerce-jetpack' );
|
||||
case 'description':
|
||||
return __( 'Booster: Left to Free Shipping Widget', 'woocommerce-jetpack' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_content.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_content( $instance ) {
|
||||
return wcj_get_left_to_free_shipping( $instance['content'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* get_options.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_options() {
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'title',
|
||||
'default' => '', // __( 'Left to Free Shipping', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Content', 'woocommerce-jetpack' ),
|
||||
'id' => 'content',
|
||||
'default' => __( '%left_to_free% left to free shipping', 'woocommerce-jetpack' ),
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'register_wcj_widget_left_to_free_shipping' ) ) {
|
||||
/**
|
||||
* Register WCJ_Widget_Left_to_Free_Shipping widget.
|
||||
*/
|
||||
function register_wcj_widget_left_to_free_shipping() {
|
||||
register_widget( 'WCJ_Widget_Left_to_Free_Shipping' );
|
||||
}
|
||||
}
|
||||
add_action( 'widgets_init', 'register_wcj_widget_left_to_free_shipping' );
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Widget - Multicurrency
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 2.4.3
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'WCJ_Widget_Multicurrency' ) ) :
|
||||
|
||||
class WCJ_Widget_Multicurrency extends WCJ_Widget {
|
||||
|
||||
/**
|
||||
* get_data.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_data( $id ) {
|
||||
switch ( $id ) {
|
||||
case 'id_base':
|
||||
return 'wcj_widget_multicurrency';
|
||||
case 'name':
|
||||
return __( 'Booster - Multicurrency Switcher', 'woocommerce-jetpack' );
|
||||
case 'description':
|
||||
return __( 'Booster: Multicurrency Switcher Widget', 'woocommerce-jetpack' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_content.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_content( $instance ) {
|
||||
if ( ! wcj_is_module_enabled( 'multicurrency' ) ) {
|
||||
return __( 'Multicurrency module not enabled!', 'woocommerce-jetpack' );
|
||||
} else {
|
||||
switch ( $instance['switcher_type'] ) {
|
||||
case 'link_list':
|
||||
return do_shortcode( '[wcj_currency_select_link_list]' );
|
||||
case 'radio_list':
|
||||
return do_shortcode( '[wcj_currency_select_radio_list]' );
|
||||
default: // 'drop_down'
|
||||
return do_shortcode( '[wcj_currency_select_drop_down_list]' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_options.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_options() {
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'title',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Type', 'woocommerce-jetpack' ),
|
||||
'id' => 'switcher_type',
|
||||
'default' => 'drop_down',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'drop_down' => __( 'Drop down', 'woocommerce-jetpack' ),
|
||||
'radio_list' => __( 'Radio list', 'woocommerce-jetpack' ),
|
||||
'link_list' => __( 'Link list', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'class' => 'widefat',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'register_wcj_widget_multicurrency' ) ) {
|
||||
/**
|
||||
* Register WCJ_Widget_Multicurrency widget.
|
||||
*/
|
||||
function register_wcj_widget_multicurrency() {
|
||||
register_widget( 'WCJ_Widget_Multicurrency' );
|
||||
}
|
||||
}
|
||||
add_action( 'widgets_init', 'register_wcj_widget_multicurrency' );
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* Booster for WooCommerce - Widget - Selector
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 3.1.0
|
||||
* @author Algoritmika Ltd.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'WCJ_Widget_Selector' ) ) :
|
||||
|
||||
class WCJ_Widget_Selector extends WCJ_Widget {
|
||||
|
||||
/**
|
||||
* get_data.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_data( $id ) {
|
||||
switch ( $id ) {
|
||||
case 'id_base':
|
||||
return 'wcj_widget_selector';
|
||||
case 'name':
|
||||
return __( 'Booster - Selector', 'woocommerce-jetpack' );
|
||||
case 'description':
|
||||
return __( 'Booster: Selector Widget', 'woocommerce-jetpack' ) . ' (' . __( 'currently for "Product Visibility by Country" module only', 'woocommerce-jetpack' ) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_content.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_content( $instance ) {
|
||||
return do_shortcode( '[wcj_selector selector_type="' . $instance['selector_type'] . '"]' );
|
||||
}
|
||||
|
||||
/**
|
||||
* get_options.
|
||||
*
|
||||
* @version 3.2.4
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function get_options() {
|
||||
return array(
|
||||
array(
|
||||
'title' => __( 'Title', 'woocommerce-jetpack' ),
|
||||
'id' => 'title',
|
||||
'default' => '',
|
||||
'type' => 'text',
|
||||
'class' => 'widefat',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Selector Type', 'woocommerce-jetpack' ),
|
||||
'id' => 'selector_type',
|
||||
'default' => 'country',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'country' => __( 'Countries', 'woocommerce-jetpack' ),
|
||||
'product_custom_visibility' => __( 'Product custom visibility', 'woocommerce-jetpack' ),
|
||||
),
|
||||
'class' => 'widefat',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'register_wcj_widget_selector' ) ) {
|
||||
/**
|
||||
* Register WCJ_Widget_Selector widget.
|
||||
*
|
||||
* @version 3.1.0
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function register_wcj_widget_selector() {
|
||||
register_widget( 'WCJ_Widget_Selector' );
|
||||
}
|
||||
}
|
||||
add_action( 'widgets_init', 'register_wcj_widget_selector' );
|
||||
Reference in New Issue
Block a user