PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.20
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.20
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 1 year ago js 1 year ago class-css.php 1 year ago class-date.php 1 year ago class-delivery-type.php 1 year ago class-display-field.php 1 year ago class-js.php 1 year ago class-main.php 1 year ago class-order.php 1 year ago class-pickup-location.php 1 year ago class-shipping-method.php 1 year ago class-time-range.php 1 year ago class-time-slot.php 1 year ago class-time.php 1 year ago class-validate.php 1 year ago class-woo-app.php 1 year ago
class-css.php
111 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 wp_add_inline_style( $name, $css);
47 }
48
49 static function deliveryTypeButton(){
50
51 $pi_button_bg_color = pisol_dtt_get_setting('pi_button_bg_color','#cccccc');
52 $pi_active_button_bg_color = pisol_dtt_get_setting('pi_active_button_bg_color','#000000');
53 $pi_button_text_color = pisol_dtt_get_setting('pi_button_text_color','#000000');
54 $pi_active_button_text_color = pisol_dtt_get_setting('pi_active_button_text_color','#ffffff');
55 $css = '
56 .pi_delivery_type .woocommerce-input-wrapper label, .pi_delivery_type .woocommerce-input-wrapper .woocommerce-radio-wrapper label, .pi-dtt-type-label-container label{
57 background-color:'.$pi_button_bg_color.';
58 color:'.$pi_button_text_color.';
59 }
60
61 .pi_delivery_type .input-radio:checked + label,
62 .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{
63 background-color:'.$pi_active_button_bg_color.';
64 color:'.$pi_active_button_text_color.';
65 }
66 ';
67 return $css;
68 }
69
70 function removeSavedDateTime($order_id){
71 echo '<script>';
72 echo 'jQuery(function($){
73
74 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"];
75 var length = fields.length;
76 for (var i = 0; i < length; i++) {
77 var field = fields[i];
78 var name = "pisol_"+field;
79 localStorage.removeItem(name);
80 }
81 });';
82 echo '</script>';
83 }
84
85 function topMarginFix(){
86 if(function_exists('is_admin_bar_showing') && is_admin_bar_showing() && is_checkout()){
87 echo '
88 <style>
89 html{
90 margin-top:0 !important;
91 }
92 </style>
93 ';
94 }
95 }
96 }
97
98 add_action('wp_loaded',function(){
99 /**
100 * This filter allow you to hide all the fields added by this plugin
101 * so you can use this to disable the plugin when you have virtual product in
102 * your cart
103 */
104 $pisol_disable_dtt_completely = apply_filters('pisol_disable_dtt_completely',false);
105 if($pisol_disable_dtt_completely){
106 return ;
107 }
108
109 new pi_dtt_css();
110 });
111