PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.69
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.69
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.php
pi-woocommerce-order-date-time-and-type / admin Last commit date
css 9 months ago img 9 months ago js 9 months ago partials 9 months ago class-adv-order-filter.php 9 months ago class-analytics.php 9 months ago class-order-tip-promotion.php 9 months ago class-pi-dtt-labels.php 9 months ago class-pi-dtt-order-table.php 9 months ago conflict-fixer.php 9 months ago menu.php 9 months ago options-addons.php 9 months ago options-date.php 9 months ago options-limit.php 9 months ago options-pickup.php 9 months ago options-time-slot.php 9 months ago options-time.php 9 months ago options.php 9 months ago
options.php
290 lines
1 <?php
2
3 class pisol_dtt_option{
4
5 private $settings = array();
6
7 private $active_tab;
8
9 private $this_tab = 'default';
10
11 private $tab_name = "General setting";
12
13 private $setting_key = 'pisol_dtt_default';
14
15 private $pro_version = false;
16
17 public $billing_fields = array(
18 'billing_first_name'=>'Billing First Name',
19 'billing_last_name'=>'Billing Last Name',
20 'billing_address_1'=>'Billing Address 1',
21 'billing_address_2'=>'Billing Address 2',
22 'billing_country'=>'Billing Country',
23 'billing_city'=>'Billing City',
24 'billing_state'=>'Billing State',
25 'billing_postcode'=>'Billing Postcode',
26 'billing_company'=>'Billing Company',
27 'billing_phone'=>'Billing Phone'
28 );
29
30 public $tab;
31
32 public $preparation_days;
33
34 function __construct(){
35
36 $this->pro_version = pi_dtt_pro_check();
37
38 $this->preparation_days = range(0, 100);
39
40 $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab'));
41 $this->active_tab = $this->tab != "" ? $this->tab : 'default';
42
43 $this->migrationScript();
44
45 $this->settings = array(
46
47 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label' => __('&#128230; Order Fulfillment Type Settings','pisol-dtt'), 'type'=>'setting_category', 'links' => [
48 [
49 "name" => "Know more about this ?",
50 "url" => "https://www.piwebsolution.com/user-documentation/#Order_Fulfillment_Type_Settings"
51 ]
52 ]),
53
54 array('field'=>'pi_type', 'label'=>__('Enable Delivery, Pickup, or Both','pisol-dtt'),'desc'=> __('Choose whether to allow Delivery only, Pickup only, or let the customer choose between Delivery and Pickup during checkout.','pisol-dtt'), 'type'=>'radio', 'value'=>array('Both'=>__('Allow customer to choose: Delivery or Pickup','pisol-dtt'), 'Delivery' =>__('Only Delivery available','pisol-dtt'), 'Pickup'=>__('Only Pickup available','pisol-dtt')), 'default'=>"Both"),
55
56 array('field'=>'pi_default_type', 'label'=>__('Default Fulfillment Type','pisol-dtt'),'desc'=>__('Choose whether "Delivery" or "Pickup" is pre-selected by default at checkout. This setting only applies when both options are enabled.','pisol-dtt'), 'type'=>'radio', 'value'=>array('delivery' =>__('Delivery','pisol-dtt'), 'pickup'=>__('Pickup','pisol-dtt')), 'default'=>'delivery'),
57
58 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label' => __('&#128197; Date and Time Setting','pisol-dtt'), 'type'=>'setting_category', 'links' => [
59 [
60 "name" => "Know more about this ?",
61 "url" => "https://www.piwebsolution.com/user-documentation/#Date_and_time_setting"
62 ]
63 ]),
64
65 array('field'=>'pi_datetime', 'label'=>__('Enable Date Selection','pisol-dtt'),'desc'=>__('Show date fields for delivery, pickup, or both during checkout.','pisol-dtt'), 'type'=>'radio', 'value'=>array('disable-both'=>__('Disabled for both Delivery and Pickup','pisol-dtt'), 'enable-both'=>__('Enabled for both Delivery and Pickup','pisol-dtt'), 'pickup-only'=>__("Enabled only for Pickup",'pisol-dtt'), 'delivery-only'=>__("Enabled only for Delivery",'pisol-dtt')), 'default'=>"enable-both"),
66
67 array('field'=>'pi_enable_delivery_time', 'label'=>__('Enable Time Selection','pisol-dtt'),'desc'=> __('Show time selection for delivery, pickup, or both. <br><b>Note:</b> This will only work if Date selection is also enabled for the fulfillment type.','pisol-dtt'), 'type'=>'radio', 'value'=>array('enable-both'=>__('Enabled for both Delivery and Pickup','pisol-dtt'),'disable-both' =>__('Disabled for both Delivery and Pickup','pisol-dtt'), 'only-pickup'=>__('Enabled only for Pickup','pisol-dtt'),'only-delivery'=>__('Enabled only for Delivery','pisol-dtt') ), 'default'=>"enable-both", 'links' => [
68 [
69 "name" => "Know more about this ?",
70 "url" => "https://www.piwebsolution.com/user-documentation/#Enable_Time_Selection"
71 ]
72 ]),
73
74 array('field'=>'pi_preorder_days', 'label'=>__('Preorder days','pisol-dtt'), 'desc'=>__('Set how many days in advance customers are allowed to schedule a delivery or pickup.<br><b>Example:</b> If set to 7, customers can select a date up to 7 days from today.','pisol-dtt'), 'type'=>'number', 'default'=>10, 'min'=> 0, 'links' => [
75 [
76 "name" => "Know how it works with order preparation days ?",
77 "url" => "https://www.piwebsolution.com/user-documentation/#Preorder_Days"
78 ]
79 ]),
80
81 array('field'=>'pi_enable_different_preparation_time-pro', 'class'=> 'bg-dark opacity-75 text-light free-version force-white-text', 'default'=>0, 'type'=>'switch_category', 'label'=>__('Set different preparation time for Pickup & Delivery order','pisol-dtt'),'desc'=>__('Allow you to set different preparation time for pickup order','pisol-dtt')),
82
83 array('field'=>'shop-preparation-time', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Use Same Preparation Time for Delivery and Pickup','pisol-dtt'), 'type'=>'setting_category', 'links' => [
84 [
85 "name" => "Know how it works with order preparation days ?",
86 "url" => "https://www.piwebsolution.com/user-documentation/#Set_Different_Preparation_Time_for_Pickup_Delivery_Order"
87 ]
88 ]),
89
90 array('field'=>'pi_order_preparation_days', 'label'=>__('Order Preparation (Days)','pisol-dtt'), 'desc'=>__('Set the number of days needed to prepare an order before it can be delivered or picked up.','pisol-dtt'), 'type'=>'select', 'default'=> 1, 'value'=>$this->preparation_days),
91 array('field'=>'pi_order_preparation_hours', 'label'=>__('Order Preparation (Minutes)','pisol-dtt'), 'desc'=>__('Specify preparation time in minutes, only when "Order Preparation Days" is set to 0. Maximum allowed is 1439 minutes (i.e., less than a full day).','pisol-dtt'), 'type'=>'number', 'min'=> 0,'max'=>1439, 'default'=> 60),
92
93
94
95 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('&#128336; Time setting','pisol-dtt'), 'type'=>'setting_category', 'links' => [
96 [
97 "name" => "Know more about this ?",
98 "url" => "https://www.piwebsolution.com/user-documentation/#Time_setting"
99 ]
100 ]),
101
102 array('field'=>'pi_use_time_slot', 'label'=>__('Delivery/Pickup Time Selection Style','pisol-dtt'),'desc'=> __('Choose how customers should select the delivery or pickup time: <br>Time Slot – Customers select from predefined time ranges (e.g., 2 PM – 3 PM, 3 PM – 4 PM).<br>
103 Single Time – Customers select a specific time point (e.g., 2 PM, 3 PM, 4 PM).','pisol-dtt'), 'type'=>'radio', 'value'=>array('all_slot'=>__('Use Time Slots for Both Delivery and Pickup','pisol-dtt'), 'all_range' =>__('Use Single Time Selection for Both Delivery and Pickup','pisol-dtt'), 'pickup_slot_delivery_range'=>__('Time Slots for Pickup, Single Time for Delivery','pisol-dtt'), 'delivery_slot_pickup_range'=>__('Time Slots for Delivery, Single Time for Pickup','pisol-dtt')), 'default'=>"all_slot", 'links' => [
104 [
105 "name" => "What is Time slot and Single time ?",
106 "url" => "https://www.piwebsolution.com/user-documentation/#DeliveryPickup_Time_Selection_Style"
107 ]
108 ]),
109
110
111 array('field'=>'pi_time_format', 'label'=>__('Time Display Format','pisol-dtt'),'desc'=>__('Choose whether to display time in 12-hour format (e.g., 2:00 PM) or 24-hour format (e.g., 14:00).','pisol-dtt'), 'type'=>'radio', 'value'=>array('h:mm p' =>__('12HR (1:30 PM)','pisol-dtt'), 'H:mm'=>__('24HR (13:30)','pisol-dtt'), 'H:mm p'=>__('24HR with AM PM (13:30 PM)','pisol-dtt')), 'default'=>'h:mm p'),
112
113 array('field'=>'pi_time_interval', 'label'=>__('Time Interval (in Minutes)','pisol-dtt'), 'type'=>'select', 'value'=>array(5 =>__('5 minutes','pisol-dtt'), 10 =>__('10 minutes','pisol-dtt'), 15 =>__('15 minutes','pisol-dtt'), 20=>__('20 minutes','pisol-dtt'), 30=>__('30 minutes','pisol-dtt'), 40=>__('40 minutes','pisol-dtt'), 50=>__('50 minutes','pisol-dtt'), 60=>__('1 hr','pisol-dtt'), 120=>__('2 hour','pisol-dtt'), 180=>__('3 hour','pisol-dtt'), 240=>__('4 hour','pisol-dtt'), 300=>__('5 hour','pisol-dtt'), 360=>__('6 hour','pisol-dtt')), 'default'=>15,'desc'=>__('Set the gap between two time ranges when using the Time Range method. This setting does not apply to the Time Slot method.','pisol-dtt')),
114
115 array('field'=>'color-setting1002', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('&#128241; WooCommerce mobile app support','pisol-dtt'), 'type'=>'setting_category'),
116
117 array('field'=>'pi_enable_woocommerce_app_support', 'default'=> 1, 'type'=>'switch', 'label'=>__('Enable WooCommerce App Support','pisol-dtt'),'desc'=>__('Adds delivery date, time, and pickup location details to the order note so they are visible in the WooCommerce mobile app.','pisol-dtt'), 'links' => [
118 [
119 "name" => "Want to know more about this ?",
120 "url" => "https://www.piwebsolution.com/user-documentation/#Enable_WooCommerce_App_Support"
121 ]
122 ]),
123
124 array('field'=>'same-day-cutoff-section', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h6', 'label'=>__('&#128336; Same day Delivery/Pickup Cutoff time (Only useful when order preparation days is 0)','pisol-dtt'), 'type'=>'setting_category', 'links' => [
125 [
126 "name" => "Know more about this ?",
127 "url" => "https://www.piwebsolution.com/user-documentation/#Same-Day_DeliveryPickup_Cutoff_Time"
128 ]
129 ]),
130
131 array('field'=>'pi_same_day_delivery_cutoff_time-pro', 'label'=>__('Same Day delivery cutoff time','pisol-dtt'), 'desc'=>__('Once this time goes by today, user cant place a delivery order for today date','pisol-dtt'), 'type'=>'text', 'pro'=>true),
132
133 array('field'=>'pi_same_day_pickup_cutoff_time-pro', 'label'=>__('Same Day pickup cutoff time','pisol-dtt'), 'desc'=>__('Once this time goes by today, user cant place a pickup order for today date','pisol-dtt'), 'type'=>'text', 'pro'=>true),
134
135 array('field'=>'next-day-cutoff-section', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h6', 'label'=>__('&#128336; Next day Delivery/Pickup Cutoff time (Only useful when order preparation days is less then 2)','pisol-dtt'), 'type'=>'setting_category', 'links' => [
136 [
137 "name" => "Know more about this ?",
138 "url" => "https://www.piwebsolution.com/user-documentation/#Next-Day_DeliveryPickup_Cutoff_Time"
139 ]
140 ]),
141
142 array('field'=>'pi_next_day_delivery_cutoff_time-pro', 'label'=>__('Next Day delivery cutoff time','pisol-dtt'), 'desc'=>__('Once this time goes by today, user cant place a delivery order for tomorrows date','pisol-dtt'), 'type'=>'text', 'pro'=>true),
143
144 array('field'=>'pi_next_day_pickup_cutoff_time-pro', 'label'=>__('Next Day pickup cutoff time','pisol-dtt'), 'desc'=>__('Once this time goes by today, user cant place a pickup order for tomorrows date','pisol-dtt'), 'type'=>'text', 'pro'=>true),
145
146 array('field'=>'color-setting1', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('&#128722; Checkout Setting','pisol-dtt'), 'type'=>'setting_category', 'links' => [
147 [
148 "name" => "Know more about this ?",
149 "url" => "https://www.piwebsolution.com/user-documentation/#Checkout_Setting"
150 ]
151 ]),
152
153 array('field'=>"pi_date_time_location-pro",'type'=>'radio', 'label'=>__('Position of Delivery Options on Checkout Page','pisol-dtt'), 'desc'=>__('Choose where the delivery/pickup, date, time, and location fields should appear in the checkout form layout.<br><b>&#9888; Note:</b> This setting only applies to classic checkout pages rendered using the [woocommerce_checkout] shortcode. It does not work with block-based checkout pages','pisol-dtt'), 'default'=>'woocommerce_checkout_before_customer_details', 'value'=>array('woocommerce_checkout_before_customer_details'=>__('Above Customer Details Section','pisol-dtt'), 'woocommerce_checkout_after_customer_details'=>__('Below Customer Details Section','pisol-dtt'), 'woocommerce_after_order_notes'=> __('Below Order Notes','pisol-dtt'), 'woocommerce_before_order_notes'=> __('Above Order Notes','pisol-dtt')), 'pro'=>true),
154
155 array('field'=>'pi_time_required-pro', 'default'=>'1', 'type'=>'radio', 'label'=>__('Require Delivery Time at Checkout'),'desc'=>__('Make the time field mandatory during checkout. <br>Note: If the date is not required, time will remain optional.','pisol-dtt'),'value'=>array('0'=>__('Non required in pickup and delivery','pisol-dtt'), '1'=>__('Required in pickup and delivery','pisol-dtt'), 'pickup-required'=>__('Required in pickup','pisol-dtt'), 'delivery-required'=>__('Required in delivery','pisol-dtt')), 'pro'=>true),
156
157 array('field'=>'pi_date_required-pro', 'default'=>'1', 'type'=>'radio', 'label'=>__('Require Delivery Date at Checkout','pisol-dtt'),'desc'=>__('Make the date field mandatory during checkout. <br>Note: If date is not required, time will also be optional by default.','pisol-dtt'),'value'=>array('0'=>__('Non required in pickup and delivery','pisol-dtt'), '1'=>__('Required in pickup and delivery','pisol-dtt'), 'pickup-required'=>__('Required in pickup','pisol-dtt'), 'delivery-required'=>__('Required in delivery','pisol-dtt')), 'pro'=>true),
158
159 array('field'=>'pi_dtt_remove_billing_when_pickup-pro','desc'=>'Select fields you want to remove from checkout When delivery type is Pickup (This option does not work if your checkout page is made using WooCommerce checkout Block)', 'label'=>__('Remove checkout fields when Pickup','pi-dcw'),'type'=>'multiselect','default'=>array_keys($this->billing_fields), 'value'=>$this->billing_fields,'pro'=>true),
160
161 array('field'=>'pi_dtt_remove_billing_when_delivery-pro','desc'=>'Select fields you want to remove from checkout When delivery type is Delivery (This option does not work if your checkout page is made using WooCommerce checkout Block)', 'label'=>__('Remove checkout fields when Delivery','pi-dcw'),'type'=>'multiselect','default'=>array_keys($this->billing_fields), 'value'=>$this->billing_fields,'pro'=>true),
162
163
164
165 array('field'=>'color-setting1', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Shipping method option for pickup type','pisol-dtt'), 'type'=>'setting_category', 'links' => [
166 [
167 "name" => "Watch video for explanation",
168 "url" => "https://www.youtube.com/watch?v=7RxtizKSSTw"
169 ],
170 [
171 "name" => "Read more about this",
172 "url" => "https://www.piwebsolution.com/user-documentation/#Shipping_Method_Settings_for_Pickup"
173 ]
174 ]),
175
176 array('field'=>'pi_remove_shipping_method-pro', 'label'=>__('Remove shipping method','pisol-dtt'),'desc'=> __('If enabled it will remove all shipping method when pickup delivery type is selected, if disabled it will try to select the WooCommerce "local pickup" shipping method (provided it is available) , if local pickup is available it will be selected and other method will not be allowed to select','pisol-dtt'), 'type'=>'switch', 'default'=>1, 'pro'=>true),
177
178 array('field'=>'pi_show_as_dropdown-pro', 'default'=>0, 'type'=>'switch', 'label'=>__('Show pickup location as Dropdown','pisol-dtt'),'desc'=>__('If you have large number of pickup location then you can show then as dropdown instead of showing them as full address as radio button','pisol-dtt'),'pro'=>true),
179
180
181 array('field'=>'pi_first_day_in_calender-pro', 'label'=>__('First day in calender','pisol-dtt'), 'type'=>'select', 'value'=>array(1 =>__('Monday','pisol-dtt'), 2=>__('Tuesday','pisol-dtt'), 3=>__('Wednesday','pisol-dtt'), 4=>__('Thursday','pisol-dtt'), 5=>__('Friday','pisol-dtt'), 6=>__('Saturday','pisol-dtt'), 7=>__('Sunday','pisol-dtt')), 'default'=>1,'desc'=>__('Using this you can change the order of the Week on the front end calender, when you select "monday" calender will start from monday, when you select sunday calender will start from sunday as first day of the week','pisol-dtt'), 'pro'=>true),
182
183 array('field'=>'pi_enable_zone_for_location-pro', 'default'=>0, 'type'=>'switch', 'label'=>__('Enable shipping zone option for pickup location','pisol-dtt'),'desc'=>__('you can assign shipping zone to pickup location, so the buyer will only see those pickup location that you have assigned for there shipping zones, E.g: if you have pickup location in all the states in your country so instead of showing all you will assign each pickup location a shipping zone (zones will be based on city) so the buyer will only see the pickup location near to there city','pisol-dtt'),'pro'=>true),
184
185 array('field'=>'color-setting1', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Remove plugin fields if virtual product in cart','pisol-dtt'), 'type'=>'setting_category', 'links' => [
186 [
187 "name" => "Read more about this",
188 "url" => "https://www.piwebsolution.com/user-documentation/#Disable_Plugin_for_Virtual_Products_in_Cart"
189 ]
190 ]),
191
192 array('field'=>'pi_virtual_product_disable_plugin-pro', 'label'=>__('Disable plugin if there is any virtual product in customer cart','pisol-dtt'),'desc'=> __('you can either do nothing and leave the plugin active, or you can deactivate plugin setting if there is even single virtual product present in the customer cart, or if there are more virtual product in cart then physical product','pisol-dtt'), 'type'=>'select', 'value'=>array('dont_disable'=>__('Don\'t disable','pisol-dtt'), 'virtual_present' =>__('If there is even single virtual product in cart','pisol-dtt'), 'large_no_virtual'=>__('Disable if there are more virtual product then normal product','pisol-dtt'), 'all_virtual'=>__('Disable if all are virtual product in cart','pisol-dtt')), 'default'=>"dont_disable", 'pro'=>true),
193
194 array('field'=>'color-setting100', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Payment method options (control which payment method to show for which delivery type)','pisol-dtt'), 'type'=>'setting_category', 'links' => [
195 [
196 "name" => "Read more about this",
197 "url" => "https://www.piwebsolution.com/user-documentation/#Payment_Method_Options"
198 ]
199 ]),
200
201 array('field'=>'pi_remove_payment_methods_for_delivery-pro','desc'=>__('Select payment methods you want to remove for delivery','pisol-dtt'), 'label'=>__('Remove Payment methods for Delivery order','pisol-dtt'),'type'=>'multiselect','default'=>array(), 'value'=>$this->paymentMethods(),'pro'=>true),
202
203 array('field'=>'pi_remove_payment_methods_for_pickup-pro','desc'=>__('Select payment methods you want to remove for pickup','pisol-dtt'), 'label'=>__('Remove Payment methods for Pickup order','pisol-dtt'),'type'=>'multiselect','default'=>array(), 'value'=>$this->paymentMethods(), 'pro'=>true),
204
205 );
206
207
208 if($this->this_tab == $this->active_tab){
209 add_action('pisol_dtt_tab_content', array($this,'tab_content'));
210 }
211
212 add_action('pisol_dtt_tab', array($this,'tab'),1);
213
214 $this->register_settings();
215
216 if(PISOL_DTT_FREE_RESET_SETTING){
217 $this->delete_settings();
218 }
219
220 }
221
222 function delete_settings(){
223 foreach($this->settings as $setting){
224 delete_option( $setting['field'] );
225 }
226 }
227
228 function paymentMethods(){
229 $gateways = WC()->payment_gateways->get_available_payment_gateways();
230 $enabled_gateways = [];
231
232 if( !empty($gateways) ) {
233 foreach( $gateways as $gateway ) {
234
235 if( $gateway->enabled == 'yes' ) {
236
237 $enabled_gateways[$gateway->id] = $gateway->title;
238
239 }
240 }
241 }
242 return $enabled_gateways;
243 }
244
245 function register_settings(){
246
247 foreach($this->settings as $setting){
248 pisol_class_form::register_setting( $this->setting_key, $setting);
249 }
250
251 }
252
253 function tab(){
254 $page = sanitize_text_field(filter_input( INPUT_GET, 'page'));
255 $this->tab_name = __('General setting','pisol-dtt');
256 ?>
257 <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 ) ); ?>">
258 <span class="dashicons dashicons-admin-home"></span> <?php echo esc_html($this->tab_name); ?>
259 </a>
260 <?php
261 }
262
263 function tab_content(){
264 ?>
265 <form method="post" action="options.php" class="pisol-setting-form">
266 <?php settings_fields( $this->setting_key ); ?>
267 <?php
268 foreach($this->settings as $setting){
269 new pisol_class_form($setting, $this->setting_key);
270 }
271 ?>
272 <input type="submit" name="submit" id="submit" class="btn btn-primary btn-md my-3" value="<?php echo esc_attr__('Save Changes','pisol-dtt'); ?>">
273 </form>
274 <?php
275 }
276
277 function migrationScript(){
278 $date_time = get_option('pi_datetime', 'enable-both');
279
280 if($date_time == '0') update_option('pi_datetime', 'disable-both');
281
282 if($date_time == '1') update_option('pi_datetime', 'enable-both');
283 }
284
285 }
286
287 add_action('wp_loaded',function(){
288 new pisol_dtt_option();
289 });
290