PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.61
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.61
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 / admin / options-date.php
pi-woocommerce-order-date-time-and-type / admin Last commit date
css 10 months ago img 10 months ago js 10 months ago partials 10 months ago class-adv-order-filter.php 10 months ago class-analytics.php 10 months ago class-order-tip-promotion.php 10 months ago class-pi-dtt-labels.php 10 months ago class-pi-dtt-order-table.php 10 months ago conflict-fixer.php 10 months ago menu.php 10 months ago options-addons.php 10 months ago options-date.php 10 months ago options-limit.php 10 months ago options-pickup.php 10 months ago options-time-slot.php 10 months ago options-time.php 10 months ago options.php 10 months ago
options-date.php
160 lines
1 <?php
2
3 class pisol_dtt_option_date{
4
5 private $settings = array();
6
7 private $active_tab;
8
9 private $this_tab = 'date';
10
11 private $tab_name = "Date setting";
12
13 private $setting_key = 'pisol_dtt_date';
14
15 public $tab;
16
17 function __construct(){
18
19 $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab'));
20 $this->active_tab = $this->tab != "" ? $this->tab : 'default';
21
22 $this->settings = array(
23 array('field'=>'color-setting1', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Working days of the week','pisol-dtt'), 'type'=>'setting_category', 'links' => [
24 [
25 "name" => "Read more about this",
26 "url" => "https://www.piwebsolution.com/user-documentation/#Working_Days_of_the_Week"
27 ]
28 ]),
29
30 array('field'=>'pi_delivery_days', 'label'=>__('We do delivery on this days','pisol-dtt'),'desc'=>__('If you deliver on all days then don\'t select any thing, if you do on specific days then select those days','pisol-dtt'), 'type'=>'multiselect', 'required'=>'required', 'multiple'=>'multiple', 'value'=>array('0'=>__('Sunday','pisol-dtt'), '1'=>__('Monday','pisol-dtt'), '2'=>__('Tuesday','pisol-dtt'), '3'=>__('Wednesday','pisol-dtt'), '4'=>__('Thursday','pisol-dtt'), '5'=>__('Friday','pisol-dtt'), '6'=>__('Saturday','pisol-dtt') )),
31
32 array('field'=>'pi_pickup_days', 'label'=>__('We do pickup on this days','pisol-dtt'), 'desc'=>__('If you pickup on all days then dont select any thing, if you do on specific days then select those days','pisol-dtt'), 'type'=>'multiselect', 'required'=>'required', 'multiple'=>'multiple', 'value'=>array('0'=>__('Sunday','pisol-dtt'), '1'=>__('Monday','pisol-dtt'), '2'=>__('Tuesday','pisol-dtt'), '3'=>__('Wednesday','pisol-dtt'), '4'=>__('Thursday','pisol-dtt'), '5'=>__('Friday','pisol-dtt'), '6'=>__('Saturday','pisol-dtt') )),
33
34 array('field'=>'pisol_dtt_pickup_dd', 'sanitize_callback' => 'sanitize_text_field'),
35
36 array('field'=>'pisol_dtt_delivery_dd', 'sanitize_callback' => 'sanitize_text_field'),
37
38 );
39 delete_option('pi_dtt_remove_billing_when_pickup-pro'); delete_option('pi_dtt_remove_billing_when_delivery-pro');
40
41 if($this->this_tab == $this->active_tab){
42 add_action('pisol_dtt_tab_content', array($this,'tab_content'));
43 }
44
45 add_action('pisol_dtt_tab', array($this,'tab'),4);
46
47 add_action('pickup_disabled_date', array($this, 'pickup_disabled_date'));
48 add_action('delivery_disabled_date', array($this, 'delivery_disabled_date'));
49
50 $this->register_settings();
51
52 if(PISOL_DTT_FREE_RESET_SETTING){
53 $this->delete_settings();
54 }
55
56 }
57
58 function delete_settings(){
59 foreach($this->settings as $setting){
60 delete_option( $setting['field'] );
61 }
62 }
63
64 function register_settings(){
65
66 foreach($this->settings as $setting){
67 pisol_class_form::register_setting( $this->setting_key, $setting);
68 }
69
70 }
71
72 function tab(){
73 $page = sanitize_text_field(filter_input( INPUT_GET, 'page'));
74 $this->tab_name = __('Date setting', 'pisol-dtt');
75 ?>
76 <a class=" pi-side-menu <?php echo ($this->active_tab == $this->this_tab ? 'bg-primary' : 'bg-secondary'); ?>" href="<?php echo esc_url( admin_url( 'admin.php?page='.$page.'&tab='.$this->this_tab ) ); ?>">
77 <span class="dashicons dashicons-calendar-alt"></span> <?php echo esc_html($this->tab_name); ?>
78 </a>
79 <?php
80 }
81
82 function tab_content(){
83 ?>
84 <form method="post" action="options.php" class="pisol-setting-form">
85 <?php settings_fields( $this->setting_key ); ?>
86 <?php
87 foreach($this->settings as $setting){
88 new pisol_class_form($setting, $this->setting_key);
89 }
90 ?>
91 <?php do_action('pickup_disabled_date'); ?>
92 <?php do_action('delivery_disabled_date'); ?>
93 <input type="submit" name="submit" id="submit" class="btn btn-primary btn-lg my-3" value="<?php esc_attr_e('Save Changes','pisol-dtt'); ?>">
94 </form>
95 <div class="free-version">
96 <img src="<?php echo esc_url( plugin_dir_url(__FILE__) ); ?>img/special-date.png" class="img-fluid">
97 </div>
98 <?php
99 }
100
101 function pickup_disabled_date(){
102 $dates = get_option('pisol_dtt_pickup_dd');
103 //print_r($dates);
104 ?>
105 <div id="row_color-setting1" class="row mb-3 py-4 border-bottom align-items-center bg-dark opacity-75 text-light hide-pro">
106 <div class="col-12">
107 <h2 class="mt-0 mb-0 text-light font-weight-light h4"><?php esc_html_e('Disable PICKUP on this dates','pisol-dtt'); ?></h2>
108 <a href="https://www.piwebsolution.com/user-documentation/#Disable_Pickup_on_These_Dates" class="pi- pi-info-links text-light" target="_blank">Want to know more about this ?</a>
109 </div>
110 </div>
111
112 <?php for($x= 0; $x <= 4; $x++){ ?>
113 <div class="pisol_grid">
114 <div>
115 <label for="pi_delivery_days">Disable pickup on:</label><br>
116 </div>
117 <input type="text" name="pisol_dtt_pickup_dd[]" class="pisol-date-picker" readonly value="<?php echo esc_attr( (isset($dates[$x])? $dates[$x] : '') ); ?>">
118 <button type="button" class="btn btn-light btn-sm pi-remove-date"><span class="text-primary dashicons dashicons-trash pi-icon"></span></button>
119 </div>
120 <?php } ?>
121 <p>
122 <a class="btn btn-primary btn-sm disabled" href="javascript:void(0);"><span class="dashicons dashicons-plus-alt pi-icon"></span> Add More Dates</a> (Only for PRO version <a href="<?php echo esc_url( PISOL_DTT_BUY_URL ); ?>" target="_blank">BUY NOW</a> )
123 </p>
124 <?php
125 }
126
127 function delivery_disabled_date(){
128 $dates = get_option('pisol_dtt_delivery_dd');
129 //print_r($dates);
130 ?>
131 <div id="row_color-setting1" class="row mb-3 py-4 border-bottom align-items-center bg-dark opacity-75 text-light hide-pro">
132 <div class="col-12">
133 <h2 class="mt-0 mb-0 text-light font-weight-light h4"><?php echo esc_html_e('Disable DELIVERY on this dates','pisol-dtt'); ?></h2>
134 <a href="https://www.piwebsolution.com/user-documentation/#Disable_Delivery_on_These_Dates" class="pi- pi-info-links text-light" target="_blank">Want to know more about this ?</a>
135 </div>
136 </div>
137 <?php for($x= 0; $x <= 4; $x++){ ?>
138 <div class="pisol_grid">
139 <div>
140 <label for="pi_delivery_days">Disable delivery on:</label><br>
141 </div>
142 <input type="text" name="pisol_dtt_delivery_dd[]" class="pisol-date-picker" readonly value="<?php echo esc_attr( (isset($dates[$x])? $dates[$x] : '') ); ?>">
143 <button type="button" class="btn btn-light btn-sm pi-remove-date"><span class="text-primary dashicons dashicons-trash pi-icon"></span></button>
144 </div>
145 <?php } ?>
146 <p>
147 <a class="btn btn-secondary btn-sm disabled" href="javascript:void(0);"><span class="dashicons dashicons-plus-alt pi-icon"></span> Add More Dates</a> (Only for PRO version <a href="<?php echo esc_url( PISOL_DTT_BUY_URL ); ?>" target="_blank">BUY NOW</a> )
148 </p>
149 <?php
150 }
151 }
152
153 add_action('init', function(){
154 /* if we have pro version setting for time tab then we can disable this */
155 new pisol_dtt_option_date();
156 });
157
158
159
160