PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.91
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.91
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 4 months ago img 4 months ago js 4 months ago partials 4 months ago class-adv-order-filter.php 4 months ago class-analytics.php 4 months ago class-order-tip-promotion.php 4 months ago class-pi-dtt-labels.php 4 months ago class-pi-dtt-order-table.php 4 months ago conflict-fixer.php 4 months ago menu.php 4 months ago options-addons.php 4 months ago options-date.php 4 months ago options-limit.php 4 months ago options-pickup.php 4 months ago options-time-slot.php 4 months ago options-time.php 4 months ago options.php 4 months ago
options.php
296 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3
4 class pisol_dtt_option{
5
6 private $settings = array();
7
8 private $active_tab;
9
10 private $this_tab = 'default';
11
12 private $tab_name = "General setting";
13
14 private $setting_key = 'pisol_dtt_default';
15
16 private $pro_version = false;
17
18 public $billing_fields = array(
19 'billing_first_name'=>'Billing First Name',
20 'billing_last_name'=>'Billing Last Name',
21 'billing_address_1'=>'Billing Address 1',
22 'billing_address_2'=>'Billing Address 2',
23 'billing_country'=>'Billing Country',
24 'billing_city'=>'Billing City',
25 'billing_state'=>'Billing State',
26 'billing_postcode'=>'Billing Postcode',
27 'billing_company'=>'Billing Company',
28 'billing_phone'=>'Billing Phone'
29 );
30
31 public $tab;
32
33 public $preparation_days;
34
35 function __construct(){
36
37 $this->pro_version = pi_dtt_pro_check();
38
39 $this->preparation_days = range(0, 100);
40
41 $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab'));
42 $this->active_tab = $this->tab != "" ? $this->tab : 'default';
43
44 $this->migrationScript();
45
46 $this->settings = array(
47
48 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' => [
49 [
50 "name" => "Know more about this ?",
51 "url" => "https://www.piwebsolution.com/user-documentation/#Order_Fulfillment_Type_Settings"
52 ]
53 ]),
54
55 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"),
56
57 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'),
58
59 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' => [
60 [
61 "name" => "Know more about this ?",
62 "url" => "https://www.piwebsolution.com/user-documentation/#Date_and_time_setting"
63 ]
64 ]),
65
66 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"),
67
68 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' => [
69 [
70 "name" => "Know more about this ?",
71 "url" => "https://www.piwebsolution.com/user-documentation/#Enable_Time_Selection"
72 ]
73 ]),
74
75 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' => [
76 [
77 "name" => "Know how it works with order preparation days ?",
78 "url" => "https://www.piwebsolution.com/user-documentation/#Preorder_Days"
79 ]
80 ]),
81
82 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')),
83
84 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' => [
85 [
86 "name" => "Know how it works with order preparation days ?",
87 "url" => "https://www.piwebsolution.com/user-documentation/#Set_Different_Preparation_Time_for_Pickup_Delivery_Order"
88 ]
89 ]),
90
91 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),
92 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),
93
94
95
96 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' => [
97 [
98 "name" => "Know more about this ?",
99 "url" => "https://www.piwebsolution.com/user-documentation/#Time_setting"
100 ]
101 ]),
102
103 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>
104 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' => [
105 [
106 "name" => "What is Time slot and Single time ?",
107 "url" => "https://www.piwebsolution.com/user-documentation/#DeliveryPickup_Time_Selection_Style"
108 ]
109 ]),
110
111
112 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'),
113
114 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')),
115
116 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'),
117
118 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' => [
119 [
120 "name" => "Want to know more about this ?",
121 "url" => "https://www.piwebsolution.com/user-documentation/#Enable_WooCommerce_App_Support"
122 ]
123 ]),
124
125
126
127 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' => [
128 [
129 "name" => "Know more about this ?",
130 "url" => "https://www.piwebsolution.com/user-documentation/#Checkout_Setting"
131 ]
132 ]),
133
134 array('field'=>"pi_date_time_location",'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'),
135 'woocommerce_before_checkout_billing_form' =>__('Above Billing Details Section','pisol-dtt'),
136 'woocommerce_after_checkout_billing_form' =>__('After Billing Details Section','pisol-dtt'),
137 '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'))),
138
139 array('field'=>'pi_time_required-pro', 'default'=>'1', 'type'=>'radio', 'label'=>__('Require Delivery Time at Checkout', 'pisol-dtt'),'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),
140
141 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),
142
143 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),
144
145 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),
146
147 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' => [
148 [
149 "name" => "Know more about this ?",
150 "url" => "https://www.piwebsolution.com/user-documentation/#Same-Day_DeliveryPickup_Cutoff_Time"
151 ]
152 ]),
153
154 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),
155
156 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),
157
158 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' => [
159 [
160 "name" => "Know more about this ?",
161 "url" => "https://www.piwebsolution.com/user-documentation/#Next-Day_DeliveryPickup_Cutoff_Time"
162 ]
163 ]),
164
165 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),
166
167 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),
168
169
170
171 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' => [
172 [
173 "name" => "Watch video for explanation",
174 "url" => "https://www.youtube.com/watch?v=7RxtizKSSTw"
175 ],
176 [
177 "name" => "Read more about this",
178 "url" => "https://www.piwebsolution.com/user-documentation/#Shipping_Method_Settings_for_Pickup"
179 ]
180 ]),
181
182 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),
183
184 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),
185
186
187 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),
188
189 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),
190
191 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' => [
192 [
193 "name" => "Read more about this",
194 "url" => "https://www.piwebsolution.com/user-documentation/#Disable_Plugin_for_Virtual_Products_in_Cart"
195 ]
196 ]),
197
198 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),
199
200 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' => [
201 [
202 "name" => "Read more about this",
203 "url" => "https://www.piwebsolution.com/user-documentation/#Payment_Method_Options"
204 ]
205 ]),
206
207 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),
208
209 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),
210
211 );
212
213
214 if($this->this_tab == $this->active_tab){
215 add_action('pisol_dtt_tab_content', array($this,'tab_content'));
216 }
217
218 add_action('pisol_dtt_tab', array($this,'tab'),1);
219
220 $this->register_settings();
221
222 if(PISOL_DTT_FREE_RESET_SETTING){
223 $this->delete_settings();
224 }
225
226 }
227
228 function delete_settings(){
229 foreach($this->settings as $setting){
230 delete_option( $setting['field'] );
231 }
232 }
233
234 function paymentMethods(){
235 $gateways = WC()->payment_gateways->get_available_payment_gateways();
236 $enabled_gateways = [];
237
238 if( !empty($gateways) ) {
239 foreach( $gateways as $gateway ) {
240
241 if( $gateway->enabled == 'yes' ) {
242
243 $enabled_gateways[$gateway->id] = $gateway->title;
244
245 }
246 }
247 }
248 return $enabled_gateways;
249 }
250
251 function register_settings(){
252
253 foreach($this->settings as $setting){
254 pisol_class_form::register_setting( $this->setting_key, $setting);
255 }
256
257 }
258
259 function tab(){
260 $page = sanitize_text_field(filter_input( INPUT_GET, 'page'));
261 $this->tab_name = __('General setting','pisol-dtt');
262 ?>
263 <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 ) ); ?>">
264 <span class="dashicons dashicons-admin-home"></span> <?php echo esc_html($this->tab_name); ?>
265 </a>
266 <?php
267 }
268
269 function tab_content(){
270 ?>
271 <form method="post" action="options.php" class="pisol-setting-form">
272 <?php settings_fields( $this->setting_key ); ?>
273 <?php
274 foreach($this->settings as $setting){
275 new pisol_class_form($setting, $this->setting_key);
276 }
277 ?>
278 <input type="submit" name="submit" id="submit" class="btn btn-primary btn-md my-3" value="<?php echo esc_attr__('Save Changes','pisol-dtt'); ?>">
279 </form>
280 <?php
281 }
282
283 function migrationScript(){
284 $date_time = get_option('pi_datetime', 'enable-both');
285
286 if($date_time == '0') update_option('pi_datetime', 'disable-both');
287
288 if($date_time == '1') update_option('pi_datetime', 'enable-both');
289 }
290
291 }
292
293 add_action('wp_loaded',function(){
294 new pisol_dtt_option();
295 });
296