/** * Constructor. */ public function __construct() { $this->id = 'general'; $this->label = __('General', 'woocommerce'); add_filter('woocommerce_settings_tabs_array', array($this, 'add_settings_page'), 20); add_action('woocommerce_settings_' . $this->id, array($this, 'output')); add_action('woocommerce_settings_save_' . $this->id, array($this, 'save')); if (($styles = WC_Frontend_Scripts::get_styles()) && array_key_exists('woocommerce-general', $styles)) { add_action('woocommerce_admin_field_frontend_styles', array($this, 'frontend_styles_setting')); } }
/** * Constructor. */ public function __construct() { $this->id = 'frontend'; $this->label = __('Frontend', 'opentickets-community-edition'); add_filter('qsot_settings_tabs_array', array($this, 'add_settings_page'), 20); add_action('qsot_settings_' . $this->id, array($this, 'output')); add_action('qsot_settings_save_' . $this->id, array($this, 'save')); if (($styles = WC_Frontend_Scripts::get_styles()) && array_key_exists('woocommerce-general', $styles)) { add_action('woocommerce_admin_field_qsot_frontend_styles', array($this, 'frontend_styles_setting')); } add_action('woocommerce_admin_field_qsot-image-ids', array($this, 'image_ids_setting'), 1000, 1); }
break; case 'wc-cart': return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'update_shipping_method_nonce' => wp_create_nonce("update-shipping-method")); break; case 'wc-cart-fragments': return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'fragment_name' => apply_filters('woocommerce_cart_fragment_name', 'wc_fragments')); break; case 'wc-add-to-cart': return array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'i18n_view_cart' => esc_attr__('View Cart', 'woocommerce'), 'cart_url' => apply_filters('woocommerce_add_to_cart_redirect', WC()->cart->get_cart_url()), 'is_cart' => is_cart(), 'cart_redirect_after_add' => get_option('woocommerce_cart_redirect_after_add')); break; case 'wc-add-to-cart-variation': return array('i18n_no_matching_variations_text' => esc_attr__('Sorry, no products matched your selection. Please choose a different combination.', 'woocommerce'), 'i18n_unavailable_text' => esc_attr__('Sorry, this product is unavailable. Please choose a different combination.', 'woocommerce')); break; case 'wc-country-select': return array('countries' => json_encode(array_merge(WC()->countries->get_allowed_country_states(), WC()->countries->get_shipping_country_states())), 'i18n_select_state_text' => esc_attr__('Select an option…', 'woocommerce'), 'i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce')); break; } return false; } /** * Localize scripts only when enqueued. */ public static function localize_printed_scripts() { foreach (self::$scripts as $handle) { self::localize_script($handle); } } } WC_Frontend_Scripts::init();
/** * Checks if there is any change in woocommerce_frontend_css_colors * * @return bool */ public function has_frontend_colors() { $styles = (array) WC_Frontend_Scripts::get_styles(); if (!array_key_exists('woocommerce-general', $styles)) { return false; } $colors = get_option('woocommerce_frontend_css_colors'); $default = array('primary' => '#ad74a2', 'secondary' => '#f7f6f7', 'highlight' => '#85ad74', 'content_bg' => '#ffffff', 'subtext' => '#777777'); if (!$colors || $colors === $default) { return false; } return true; }
<meta name="keywords" content="<?php bloginfo('name'); ?> " /> <meta name="robots" content="INDEX,FOLLOW" /> <script type="text/javascript" src="<?php echo $site_url; ?> /wp-includes/js/jquery/jquery.js"></script> <script src="<?php echo WOOCP_JS_URL; ?> /jquery.printElement.js"></script> <?php do_action('woocp_comparison_page_header'); $wc_frontend_scripts_class = new WC_Frontend_Scripts(); $wc_frontend_scripts_class->load_scripts(); ?> </head> <body> <?php $print_button_class = 'compare_print_button_type'; $print_custom_class = ''; $print_button_text = $woo_compare_print_page_settings['button_text']; $close_button_class = 'compare_close_button_type'; $close_custom_class = ''; $close_button_text = $woo_compare_close_window_button_style['button_text']; ?> <div class="compare_print_container"><div id="compare_popup_container" class="compare_popup_container"> <link type="text/css" href="<?php echo WOOCP_JS_URL;
/** * Enqueue scripts on administration comment page * * @param $hook */ function enqueue_admin_styles_scripts($hook) { /** Add Woocommerce.css file */ $styles = (array) WC_Frontend_Scripts::get_styles(); if (array_key_exists('woocommerce-general', $styles)) { wp_enqueue_style('woocommerce-general', $styles['woocommerce-general']['src']); } wp_enqueue_style('yith-google-fonts', '//fonts.googleapis.com/css?family=Raleway:500,700,800,400'); wp_enqueue_style('yit-style', YITH_YWAR_ASSETS_URL . '/css/yit-advanced-reviews.css'); wp_register_script("ajax-back-end-script", YITH_YWAR_URL . 'assets/js/ywar-back-end.js', array('jquery', 'jquery-blockui')); $loader = apply_filters('yith_advanced_reviews_loader_gif', YITH_YWAR_ASSETS_URL . '/images/loading.gif'); wp_localize_script('ajax-back-end-script', 'ywar', array('loader' => $loader, 'ajax_url' => admin_url('admin-ajax.php'))); wp_enqueue_script("ajax-back-end-script"); }
/** * Enqueue scripts on administration comment page * * @param $hook */ function enqueue_admin_styles_scripts($hook) { if ('toplevel_page_Reviews' != get_current_screen()->id) { return; } /** Add Woocommerce.css file */ $styles = (array) WC_Frontend_Scripts::get_styles(); if (array_key_exists('woocommerce-general', $styles)) { wp_enqueue_style('woocommerce-general', $styles['woocommerce-general']['src']); } wp_enqueue_style('yit-style', YITH_YWAR_ASSETS_URL . '/css/yit-advanced-reviews.css'); wp_register_script("ajax-back-end-script", YITH_YWAR_URL . 'assets/js/ywar-back-end.js', array('jquery', 'jquery-blockui')); $loader = apply_filters('yith_advanced_reviews_loader_gif', YITH_YWAR_ASSETS_URL . '/images/loading.gif'); wp_localize_script('ajax-back-end-script', 'ywar', array('loader' => $loader, 'ajax_url' => admin_url('admin-ajax.php'))); wp_enqueue_script("ajax-back-end-script"); }