<?php
/**
* The public-facing functionality of the plugin.
*
* @link https://themehigh.com
* @since 2.3.0
*
* @package woocommerce-extra-product-options-pro
* @subpackage woocommerce-extra-product-options-pro/public
*/
if(!defined('WPINC')){ die; }
if(!class_exists('THWEPO_Public')):
class THWEPO_Public {
private $plugin_name;
private $version;
private $price;
private $file;
private $sections_extra;
public function __construct( $plugin_name, $version ) {
$this->plugin_name = $plugin_name;
$this->version = $version;
$this->price = new THWEPO_Price(); //THWEPO_Price::instance();
$this->file = new THWEPO_File(); //THWEPO_File::instance();
add_action('after_setup_theme', array($this, 'define_public_hooks'));
}
public function define_public_hooks(){
$this->hooks_override_add_to_cart_link();
$this->hooks_render_product_fields();
$this->hooks_process_product_fields();
$this->hooks_display_item_meta();
$this->price->define_hooks();
$this->file->define_hooks();
}
public function enqueue_styles_and_scripts() {
global $wp_scripts;
$is_quick_view = THWEPO_Utils::is_quick_view_plugin_active();
if(is_product() || ( $is_quick_view && (is_shop() || is_product_category()) ) || apply_filters('thwepo_enqueue_public_scripts', false)){
$debug_mode = apply_filters('thwepo_debug_mode', false);
$suffix = $debug_mode ? '' : '.min';
$jquery_version = isset($wp_scripts->registered['jquery-ui-core']->ver) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
$this->enqueue_styles($suffix, $jquery_version);
$this->enqueue_scripts($suffix, $jquery_version, $is_quick_view);
}
}
private function enqueue_styles($suffix, $jquery_version) {
//wp_register_style('select2', THWEPO_WOO_ASSETS_URL.'/css/select2.css');
wp_enqueue_style('select2');
if(apply_filters('thwepo_display_password_view_option', true)){
wp_enqueue_style( 'dashicons' );
}
wp_enqueue_style('jquery-ui-style', THWEPO_ASSETS_URL_PUBLIC.'css/jquery-ui/jquery-ui.css');
wp_enqueue_style('thwepo-timepicker-style', THWEPO_ASSETS_URL_PUBLIC.'js/timepicker/jquery.timepicker.css');
wp_enqueue_style('thwepo-daterange-style', THWEPO_ASSETS_URL_PUBLIC.'js/date-range-picker/daterangepicker.css');
wp_enqueue_style('thwepo-public-style', THWEPO_ASSETS_URL_PUBLIC . 'css/thwepo-public'. $suffix .'.css', $this->version);
wp_enqueue_style('wp-color-picker');
$settings = THWEPO_Utils::get_advanced_settings();
$display_styles = THWEPO_Utils::get_setting_value($settings, 'display_styles');
$active_color = THWEPO_Utils::get_setting_value($settings, 'active_color');
$active_color = $active_color ? $active_color : '#000';
$plugin_style = '';
if($display_styles && 'default_style' !== $display_styles){
$plugin_style .= "
.thwepo-section-title.active *{
color: $active_color !important;
}
";
}
wp_add_inline_style( 'thwepo-public-style', $plugin_style );
}
private function enqueue_scripts($suffix, $jquery_version, $is_quick_view) {
$in_footer = apply_filters( 'thwepo_enqueue_script_in_footer', true );
$deps = array();
wp_register_script('thwepo-timepicker-script', THWEPO_ASSETS_URL_PUBLIC.'js/timepicker/jquery.timepicker.min.js', array('jquery'), '1.0.1');
wp_register_script('thwepo-input-mask', THWEPO_ASSETS_URL_PUBLIC.'js/inputmask-js/jquery.inputmask.min.js', array('jquery'), '5.0.6');
wp_register_script('thwepo-moment', THWEPO_ASSETS_URL_PUBLIC.'js/date-range-picker/moment.min.js', array('jquery'), '2.29.1');
wp_register_script('thwepo-daterange', THWEPO_ASSETS_URL_PUBLIC.'js/date-range-picker/daterangepicker.min.js', array('jquery', 'thwepo-moment'), '3.1.0');
if(apply_filters('thwepo_include_jquery_ui_i18n', true)){
//wp_register_script('jquery-ui-i18n', '//ajax.googleapis.com/ajax/libs/jqueryui/'.$jquery_version.'/i18n/jquery-ui-i18n.min.js', array('jquery','jquery-ui-datepicker'), $in_footer);
wp_register_script('jquery-ui-i18n', THWEPO_ASSETS_URL_PUBLIC.'js/jquery-ui-i18n.min.js', array('jquery','jquery-ui-datepicker'), $in_footer);
$deps[] = 'jquery-ui-i18n';
}else{
$deps[] = 'jquery';
$deps[] = 'jquery-ui-datepicker';
}
if(THWEPO_Utils::get_settings('disable_select2_for_select_fields') != 'yes'){
$deps[] = 'selectWoo';
$select2_languages = apply_filters( 'thwepo_select2_i18n_languages', false);
if(is_array($select2_languages)){
foreach($select2_languages as $lang){
$handle = 'select2_i18n_'.$lang;
wp_register_script($handle, '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/i18n/'.$lang.'.js', array('jquery','selectWoo'));
$deps[] = $handle;
}
}
}
if(THWEPO_Utils::check_specific_field_type_in_settings('daterangepicker') && apply_filters('thwepo_enqueue_date_range_js', true)){
$current_language = THWEPO_Utils::get_locale_code();
wp_enqueue_script('thwepo-moment');
wp_enqueue_script('thwepo-daterange');
$current_language = THWEPO_Utils::get_locale_code();
if($current_language !== 'en'){
$daterange_locale = 'thwepo_daterange_i18_'.$current_language;
wp_register_script($daterange_locale, '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/locale/'.$current_language.'.js', array('jquery','thwepo-moment', 'thwepo-daterange'));
wp_enqueue_script($daterange_locale);
}
}
wp_enqueue_script('iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1);
wp_register_script('thwepo-public-script', THWEPO_ASSETS_URL_PUBLIC . 'js/thwepo-public'. $suffix .'.js', $deps, $this->version, true );
wp_enqueue_script('thwepo-timepicker-script');
if(apply_filters('thwepo_enable_input_mask_enqueue', true)){
wp_enqueue_script('thwepo-input-mask');
}
wp_enqueue_script('thwepo-public-script');
$display_style = THWEPO_Utils::get_settings('display_styles');
$wepo_var = array(
'lang' => array(
'am' => __('am', 'woocommerce-extra-product-options-pro'),
'pm' => __('pm', 'woocommerce-extra-product-options-pro'),
'AM' => __('AM', 'woocommerce-extra-product-options-pro'),
'PM' => __('PM', 'woocommerce-extra-product-options-pro'),
'decimal' => __('.', 'woocommerce-extra-product-options-pro'),
'mins' => __('mins', 'woocommerce-extra-product-options-pro'),
'hr' => __('hr', 'woocommerce-extra-product-options-pro'),
'hrs' => __('hrs', 'woocommerce-extra-product-options-pro'),
),
'language' => THWEPO_Utils::get_locale_code(),
'date_format' => THWEPO_Utils::get_jquery_date_format(wc_date_format()),
'readonly_date_field' => apply_filters('thwepo_date_picker_field_readonly', true),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'price_ph_simple' => apply_filters('thwepo_product_price_placeholder', ''),
'price_ph_variable' => apply_filters('thwepo_variable_product_price_placeholder', ''),
'is_quick_view' => $is_quick_view,
'change_event_disabled_fields' => apply_filters('thwepo_change_event_disabled_fields', ''),
'thwepo_select2_auto_width' => apply_filters('thwepo_select2_auto_width', false),
'price_symbol' => get_woocommerce_currency_symbol(),
'wp_max_file_upload_size' => wp_max_upload_size(),
'thwepo_extra_cost_nonce' => wp_create_nonce('thwepo-extra-cost'),
'file_upload_error' => __('Maximum upload size exceeded.', 'woocommerce-extra-product-options-pro'),
'range_picker_time_format' => apply_filters('thwepo_range_picker_time_format', true),
'range_picker_time_increment' => apply_filters('thwepo_range_picker_time_increment', '1'),
'show_dropdown_year' => apply_filters('thwepo_show_dropdown_year', true),
'start_of_week' => get_option('start_of_week'),
'price_data' => array(
'currency' => get_woocommerce_currency(),
'currency_symbol' => get_woocommerce_currency_symbol(),
'decimal_separator' => wc_get_price_decimal_separator(),
'thousand_separator' => wc_ge
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件3.1.9.0n.zip
共100个文件
php:66个
png:14个
js:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 108 浏览量
2022-04-03
05:20:12
上传
评论
收藏 330KB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件3.1.9.0n WooCommerce Extra Product Options Pro By ThemeHigh Woocommerce额外的产品选项Pro由主题" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件3.1.9.0n.zip (100个子文件)
jquery-ui.css 36KB
thwepo-admin.min.css 22KB
thwepo-public.min.css 16KB
spectrum.css 15KB
daterangepicker.css 7KB
jquery.timepicker.css 2KB
jquery.inputmask.min.js 141KB
spectrum.js 77KB
thwepo-admin.min.js 68KB
jquery-ui-i18n.min.js 67KB
moment.min.js 57KB
thwepo-public.min.js 52KB
daterangepicker.min.js 32KB
jquery.timepicker.min.js 14KB
class-thwepo-public.php 69KB
class-thwepo-utils-field.php 66KB
class-thwepo-admin-form-field.php 65KB
class-thwepo-price.php 37KB
class-thwepo-admin-form.php 32KB
class-thwepo-admin-settings-general.php 31KB
class-thwepo-admin-settings-advanced.php 29KB
class-thwepo-license-manager.php 26KB
class-thwepo-utils.php 20KB
class-thwepo-utils-section.php 19KB
class-thwepo-activator.php 15KB
class-thwepo-admin-settings-import-export.php 13KB
class-thwepo-admin-settings.php 13KB
class-thwepo-admin-form-section.php 12KB
class-thwepo-admin-utils.php 8KB
class-thwepo-admin.php 8KB
class-thwepo.php 8KB
class-thwepo-utils-condition.php 7KB
class-wepo-woocs-currency-switcher-handler.php 7KB
class-thwepo-file.php 7KB
class-wepo-aelia-currency-switcher-handler.php 6KB
class-thwepo-autoloader.php 5KB
class-thwepo-loader.php 5KB
class-thwepo-data.php 4KB
woocommerce-extra-product-options-pro.php 4KB
class-wepo-wpml-currency-switcher-handler.php 3KB
class-thwepo-i18n.php 3KB
class-wepo-condition.php 3KB
class-wepo-field.php 2KB
class-wepo-rule-set.php 2KB
class-wepo-rule.php 2KB
class-wepo-condition-set.php 2KB
class-wepo-field-factory.php 2KB
class-wepo-section.php 1KB
class-thwepo-admin-settings-license.php 1KB
class-wepo-field-daterangepicker.php 1KB
class-wepo-field-datepicker.php 1KB
uninstall.php 759B
class-wepo-field-imagegroup.php 727B
class-wepo-field-colorpalette.php 686B
class-thwepo-utils-core.php 610B
class-wepo-field-colorpicker.php 609B
class-wepo-field-file.php 591B
class-wepo-field-timepicker.php 579B
class-wepo-field-checkboxgroup.php 560B
class-wepo-field-radio.php 527B
class-wepo-field-textarea.php 511B
class-wepo-field-password.php 509B
class-wepo-field-inputtext.php 502B
class-wepo-field-checkbox.php 497B
class-wepo-field-number.php 482B
class-wepo-field-multiselect.php 481B
class-wepo-field-range.php 479B
class-wepo-field-heading.php 465B
class-wepo-field-email.php 464B
class-wepo-field-select.php 461B
class-wepo-field-hidden.php 461B
class-wepo-field-url.php 458B
class-wepo-field-label.php 457B
class-wepo-field-tel.php 455B
class-wepo-field-html.php 453B
class-thwepo-deactivator.php 418B
index.php 26B
index.php 26B
index.php 26B
index.php 26B
ui-icons_888888_256x240.png 7KB
ui-icons_454545_256x240.png 7KB
ui-icons_222222_256x240.png 7KB
ui-icons_cd0a0a_256x240.png 5KB
ui-icons_2e83ff_256x240.png 5KB
delete.png 494B
ui-bg_glass_55_fbf9ee_1x400.png 393B
ui-bg_glass_95_fef1ec_1x400.png 390B
ui-bg_highlight-soft_75_cccccc_1x100.png 325B
ui-bg_glass_75_e6e6e6_1x400.png 324B
ui-bg_glass_75_dadada_1x400.png 323B
edit.png 312B
help.png 310B
ui-bg_glass_65_ffffff_1x400.png 265B
woocommerce-extra-product-options-pro.pot 33KB
arrow_down.svg 6KB
placeholder.svg 1KB
magnifier.svg 1KB
arrow_up.svg 1KB
upload.svg 862B
共 100 条
- 1
资源评论
Lee达森
- 粉丝: 966
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功