PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.62
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.62
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 3 weeks ago js 3 weeks ago class-css.php 3 weeks ago class-date.php 3 weeks ago class-delivery-type.php 3 weeks ago class-display-field.php 3 weeks ago class-extra-message.php 3 weeks ago class-js.php 3 weeks ago class-main.php 3 weeks ago class-myaccount.php 3 weeks ago class-order.php 3 weeks ago class-pickup-location.php 3 weeks ago class-shipping-method.php 3 weeks ago class-time-range.php 3 weeks ago class-time-slot.php 3 weeks ago class-time.php 3 weeks ago class-validate.php 3 weeks ago class-woo-app.php 3 weeks ago
class-css.php
125 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(is_checkout()){
21 $this->addCssFile();
22 }
23
24 if(is_checkout()){
25 self::inlineCss($this->plugin_name);
26 }
27 }
28
29 function cdnUrl(){
30 $theme = 'ui-lightness';
31 $cdn_url = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/{$theme}/jquery-ui.css";
32 return $cdn_url;
33 }
34
35 function addCssFile(){
36 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/style.css',array(), PISOL_DTT_PLUGIN_VERSION);
37 $jquery_ui = apply_filters('pisol_dtt_jquery_ui_theme',$this->cdnUrl());
38 wp_deregister_style( 'jquery-ui' );
39 wp_register_style( 'jquery-ui', $jquery_ui);
40 wp_enqueue_style('jquery-ui');
41 }
42
43 static function inlineCss($name){
44 $css = "";
45 $css .= self::deliveryTypeButton();
46 $css .= self::extraMessage();
47 wp_add_inline_style( $name, $css);
48 }
49
50 static function deliveryTypeButton(){
51
52 $pi_button_bg_color = pisol_dtt_get_setting('pi_button_bg_color','#cccccc');
53 $pi_active_button_bg_color = pisol_dtt_get_setting('pi_active_button_bg_color','#000000');
54 $pi_button_text_color = pisol_dtt_get_setting('pi_button_text_color','#000000');
55 $pi_active_button_text_color = pisol_dtt_get_setting('pi_active_button_text_color','#ffffff');
56 $css = '
57 .pi_delivery_type .woocommerce-input-wrapper label, .pi_delivery_type .woocommerce-input-wrapper .woocommerce-radio-wrapper label, .pi-dtt-type-label-container label{
58 background-color:'.$pi_button_bg_color.';
59 color:'.$pi_button_text_color.';
60 }
61
62 .pi_delivery_type .input-radio:checked + label,
63 .pi_delivery_type .woocommerce-input-wrapper label.active_type, .pi_delivery_type .woocommerce-input-wrapper .woocommerce-radio-wrapper input:checked + label, .pi-dtt-type-label-container input:checked + label{
64 background-color:'.$pi_active_button_bg_color.';
65 color:'.$pi_active_button_text_color.';
66 }
67 ';
68 return $css;
69 }
70
71 function removeSavedDateTime($order_id){
72 echo '<script>';
73 echo 'jQuery(function($){
74
75 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"];
76 var length = fields.length;
77 for (var i = 0; i < length; i++) {
78 var field = fields[i];
79 var name = "pisol_"+field;
80 localStorage.removeItem(name);
81 }
82 });';
83 echo '</script>';
84 }
85
86 function topMarginFix(){
87 if(function_exists('is_admin_bar_showing') && is_admin_bar_showing() && is_checkout()){
88 echo '
89 <style>
90 html{
91 margin-top:0 !important;
92 }
93 </style>
94 ';
95 }
96 }
97
98 static function extraMessage(){
99
100 $pi_extra_message_bg_color = pisol_dtt_get_setting('pi_extra_message_bg_color','#cccccc');
101 $pi_extra_message_text_color = pisol_dtt_get_setting('pi_extra_message_text_color','#000000');
102 $css = '
103 .pisol-date-time-approx-message{
104 background-color:'.$pi_extra_message_bg_color.';
105 color:'.$pi_extra_message_text_color.';
106 }
107 ';
108 return $css;
109 }
110 }
111
112 add_action('wp_loaded',function(){
113 /**
114 * This filter allow you to hide all the fields added by this plugin
115 * so you can use this to disable the plugin when you have virtual product in
116 * your cart
117 */
118 $pisol_disable_dtt_completely = apply_filters('pisol_disable_dtt_completely',false);
119 if($pisol_disable_dtt_completely){
120 return ;
121 }
122
123 new pi_dtt_css();
124 });
125