PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.3
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.3
3.0.63 3.0.62 3.0.61 3.0.60 3.0.49.49 3.0.49.6 3.0.49.60 3.0.49.61 3.0.49.62 3.0.49.63 3.0.49.64 3.0.49.66 3.0.49.67 3.0.49.69 3.0.49.7 3.0.49.70 3.0.49.72 3.0.49.73 3.0.49.74 3.0.49.76 3.0.49.77 3.0.49.79 3.0.49.9 3.0.49.90 3.0.49.91 3.0.49.92 3.0.49.93 3.0.49.94 3.0.49.96 3.0.49.97 3.0.49.99 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 2.9.17 3.0.47 3.0.49 3.0.49.1 3.0.49.10 3.0.49.11 3.0.49.12 3.0.49.13 3.0.49.16 3.0.49.17 3.0.49.19 3.0.49.2 3.0.49.20 3.0.49.21 3.0.49.22 3.0.49.23 3.0.49.24 3.0.49.26 3.0.49.27 3.0.49.29 3.0.49.3 3.0.49.30 3.0.49.31 3.0.49.32 3.0.49.33 3.0.49.34 3.0.49.36 3.0.49.37 3.0.49.39 3.0.49.4 3.0.49.40 3.0.49.41 3.0.49.42 3.0.49.43 3.0.49.44 3.0.49.46 3.0.49.47
pi-woocommerce-order-date-time-and-type / public / class-css.php
pi-woocommerce-order-date-time-and-type / public Last commit date
css 2 years ago js 2 years ago class-css.php 2 years ago class-date.php 2 years ago class-delivery-type.php 2 years ago class-display-field.php 2 years ago class-js.php 2 years ago class-main.php 2 years ago class-order.php 2 years ago class-pickup-location.php 2 years ago class-shipping-method.php 2 years ago class-time-range.php 2 years ago class-time-slot.php 2 years ago class-time.php 2 years ago class-validate.php 2 years ago class-woo-app.php 2 years ago
class-css.php
108 lines
1 <?php
2 if ( ! defined( 'WPINC' ) ) {
3 die;
4 }
5 class pi_dtt_css{
6
7 public $plugin_name;
8
9 function __construct(){
10 $this->plugin_name = 'pi-woocommerce-order-date-time-and-type';
11
12 add_action( 'wp_enqueue_scripts', array($this,'addCss') );
13
14 add_action('woocommerce_thankyou', array($this,'removeSavedDateTime'));
15
16 add_action('wp_head', array($this, 'topMarginFix'),1000);
17 }
18
19 function addCss(){
20 if(function_exists('is_checkout') && is_checkout()){
21 $this->addCssFile();
22 $this->inlineCss();
23 }
24 }
25
26 function cdnUrl(){
27 $theme = 'ui-lightness';
28 $cdn_url = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/{$theme}/jquery-ui.css";
29 return $cdn_url;
30 }
31
32 function addCssFile(){
33 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/style.css',array(), PISOL_DTT_PLUGIN_VERSION);
34 $jquery_ui = apply_filters('pisol_dtt_jquery_ui_theme',$this->cdnUrl());
35 wp_deregister_style( 'jquery-ui' );
36 wp_register_style( 'jquery-ui', $jquery_ui);
37 wp_enqueue_style('jquery-ui');
38 }
39
40 function inlineCss(){
41 $css = "";
42 $css .= $this->deliveryTypeButton();
43 wp_add_inline_style( $this->plugin_name, $css);
44 }
45
46 function deliveryTypeButton(){
47
48 $pi_button_bg_color = pisol_dtt_get_setting('pi_button_bg_color','#cccccc');
49 $pi_active_button_bg_color = pisol_dtt_get_setting('pi_active_button_bg_color','#000000');
50 $pi_button_text_color = pisol_dtt_get_setting('pi_button_text_color','#000000');
51 $pi_active_button_text_color = pisol_dtt_get_setting('pi_active_button_text_color','#ffffff');
52 $css = '
53 .pi_delivery_type .woocommerce-input-wrapper label, .pi_delivery_type .woocommerce-input-wrapper .woocommerce-radio-wrapper label{
54 background-color:'.$pi_button_bg_color.';
55 color:'.$pi_button_text_color.';
56 }
57
58 .pi_delivery_type .input-radio:checked + label,
59 .pi_delivery_type .woocommerce-input-wrapper label.active_type, .pi_delivery_type .woocommerce-input-wrapper .woocommerce-radio-wrapper input:checked + label{
60 background-color:'.$pi_active_button_bg_color.';
61 color:'.$pi_active_button_text_color.';
62 }
63 ';
64 return $css;
65 }
66
67 function removeSavedDateTime($order_id){
68 echo '<script>';
69 echo 'jQuery(function($){
70
71 var fields = ["pi_system_delivery_date", "pi_delivery_time", "billing_email", "billing_first_name", "billing_last_name", "billing_phone", "billing_company", "shipping_first_name", "shipping_last_name", "shipping_company", "order_comments", "createaccount", "ship-to-different-address-checkbox"];
72 var length = fields.length;
73 for (var i = 0; i < length; i++) {
74 var field = fields[i];
75 var name = "pisol_"+field;
76 localStorage.removeItem(name);
77 }
78 });';
79 echo '</script>';
80 }
81
82 function topMarginFix(){
83 if(function_exists('is_admin_bar_showing') && is_admin_bar_showing() && is_checkout()){
84 echo '
85 <style>
86 html{
87 margin-top:0 !important;
88 }
89 </style>
90 ';
91 }
92 }
93 }
94
95 add_action('wp_loaded',function(){
96 /**
97 * This filter allow you to hide all the fields added by this plugin
98 * so you can use this to disable the plugin when you have virtual product in
99 * your cart
100 */
101 $pisol_disable_dtt_completely = apply_filters('pisol_disable_dtt_completely',false);
102 if($pisol_disable_dtt_completely){
103 return ;
104 }
105
106 new pi_dtt_css();
107 });
108