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 / admin / class-pi-dtt-labels.php
pi-woocommerce-order-date-time-and-type / admin Last commit date
css 3 weeks ago img 3 weeks ago js 3 weeks ago partials 3 weeks ago class-accesscontrol.php 3 weeks ago class-adv-order-filter.php 3 weeks ago class-analytics.php 3 weeks ago class-order-tip-promotion.php 3 weeks ago class-pi-dtt-labels.php 3 weeks ago class-pi-dtt-order-table.php 3 weeks ago conflict-fixer.php 3 weeks ago menu.php 3 weeks ago options-accesscontrol.php 3 weeks ago options-addons.php 3 weeks ago options-date.php 3 weeks ago options-limit.php 3 weeks ago options-pickup.php 3 weeks ago options-time-slot.php 3 weeks ago options-time.php 3 weeks ago options.php 3 weeks ago
class-pi-dtt-labels.php
146 lines
1 <?php
2 if ( ! defined( 'WPINC' ) ) {
3 die;
4 }
5 class pisol_dtt_option_label{
6
7 private $settings = array();
8
9 private $active_tab;
10
11 private $this_tab = 'label';
12
13 private $tab_name = "Labels";
14
15 private $setting_key = 'pisol_dtt_label';
16
17 private $calendar_themes = array(
18 'black-tie', 'blitzer', 'cupertino', 'dark-hive', 'dot-luv', 'eggplant', 'excite-bike', 'flick', 'hot-sneaks', 'humanity', 'le-frog', 'mint-choc', 'overcast', 'pepper-grinder', 'redmond', 'smoothness', 'south-street', 'start', 'sunny', 'swanky-purse', 'trontastic', 'ui-darkness', 'ui-lightness', 'vader'
19 );
20
21
22 function __construct(){
23
24 $this->active_tab = (isset($_GET['tab'])) ? sanitize_text_field($_GET['tab']) : 'default';
25
26 $this->settings = array(
27
28 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Checkout form labels','pisol-dtt'), 'type'=>'setting_category'),
29
30 array('field'=>'pi_show_delivery_type_label', 'label'=>__('Show "Delivery type" label','pisol-dtt'),'desc'=>__('Using this you can show or hide the "Delivery type *" shown on top of the delivery type selection options','pisol-dtt'), 'type'=>'switch', 'default'=>1),
31
32 array('field'=>'pi_dtt_co_label_delivery_type', 'label'=>__('Delivery type label','pisol-dtt'), 'desc'=>__('This label is shown above the Pickup/Delivery button on the checkout page','pisol-dtt'), 'type'=>'text', 'default'=>__('Delivery Type','pisol-dtt')),
33
34 array('field'=>'pi_dtt_co_label_date', 'label'=>__('Date field label','pisol-dtt'), 'desc'=>__('This label is shown above the date selector field','pisol-dtt'), 'type'=>'text', 'default'=>__('Date', 'pisol-dtt')),
35
36 array('field'=>'pi_dtt_co_label_time', 'label'=>__('Time field label','pisol-dtt'), 'desc'=>__('This label is shown above the time selector field','pisol-dtt'), 'type'=>'text', 'default'=>__('Time', 'pisol-dtt')),
37
38 array('field'=>'pi_dtt_co_label_pickup_location', 'label'=>__('Select pickup location field label','pisol-dtt'), 'desc'=>__('This label is shown above pickup location fields','pisol-dtt'), 'type'=>'text', 'default'=>__("Select a pickup location",'pisol-dtt')),
39
40 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Delivery type button on checkout form','pisol-dtt'), 'type'=>'setting_category'),
41 array('field'=>'pi_pickup_label', 'label'=>__('Pickup label','pisol-dtt'), 'desc'=>__('The text that will be shown on the pickup button on the checkout page','pisol-dtt'), 'type'=>'text', 'default'=>'Pickup'),
42 array('field'=>'pi_delivery_label', 'label'=>__('Delivery label','pisol-dtt'), 'desc'=>__('The text that will be shown on the delivery button on the checkout page','pisol-dtt'), 'type'=>'text', 'default'=>'Delivery'),
43 array('field'=>'pi_button_bg_color', 'default'=>'#cccccc', 'type'=>'color', 'label'=>__('Pickup / Delivery button background color','pisol-dtt'),'desc'=>__('Background color when the delivery type is not selected','pisol-dtt')),
44 array('field'=>'pi_active_button_bg_color', 'default'=>'#000000', 'type'=>'color', 'label'=>__('Pickup / Delivery active button background color','pisol-dtt'),'desc'=>__('Background color when the particular delivery type is selected','pisol-dtt')),
45
46 array('field'=>'pi_button_text_color', 'default'=>'#000000', 'type'=>'color', 'label'=>__('Pickup / Delivery button text color','pisol-dtt'),'desc'=>__('Text color when the delivery type is not selected','pisol-dtt')),
47 array('field'=>'pi_active_button_text_color', 'default'=>'#ffffff', 'type'=>'color', 'label'=>__('Pickup / Delivery active button text color','pisol-dtt'),'desc'=>__('Text color when the particular delivery type is selected','pisol-dtt')),
48
49 array('field'=>'color-setting1', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Extra message that you can show for Date and time field','pisol-dtt'), 'type'=>'setting_category','links' => [
50 [
51 "name" => "Want to know more about this?",
52 "url" => "https://www.piwebsolution.com/user-documentation/#Extra_Message_for_Date_and_Time_Fields"
53 ]
54 ]),
55 array('field'=>'pi_extra_message_delivery', 'label'=>__('Message shown when delivery type is selected','pisol-dtt'), 'desc'=>__('Message shown when delivery type is selected, Leave empty if you don\'t want to show message','pisol-dtt'), 'type'=>'text', 'default'=>"" ),
56 array('field'=>'pi_extra_message_pickup', 'label'=>__('Message shown when pickup type is selected','pisol-dtt'), 'desc'=>__('Message shown when pickup type is selected, Leave empty if you don\'t want to show message','pisol-dtt'), 'type'=>'text', 'default'=>""),
57
58 array('field'=>"pi_extra_message_position",'type'=>'select', 'label'=>__('Position of the message','pisol-dtt'), 'desc'=>__('Position of the message can be above the delivery type button or below the date and time option','pisol-dtt'), 'default'=>'before', 'value'=>array('before'=>__('Before delivery type selection option','pisol-dtt'), 'between'=>__('Between delivery type and date time selection options','pisol-dtt'),'after'=>__('After date and time option','pisol-dtt'))),
59
60 array('field'=>'pi_extra_message_bg_color', 'default'=>'#cccccc', 'type'=>'color', 'label'=>__('Message box background color','pisol-dtt'),'desc'=>''),
61 array('field'=>'pi_extra_message_text_color', 'default'=>'#000000', 'type'=>'color', 'label'=>__('Message box text color','pisol-dtt'),'desc'=>''),
62
63
64
65 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Date and time label for email/order success page/backend (when delivery method: pickup)','pisol-dtt'), 'type'=>'setting_category'),
66 array('field'=>'pi_date_field_label_pickup', 'label'=>__('Date field label','pisol-dtt'), 'desc'=>__('This label is used for email, order detail page','pisol-dtt'), 'type'=>'text', 'default'=>__('Pickup Date','pisol-dtt'), 'pro'=>true),
67
68 array('field'=>'pi_time_field_label_pickup', 'label'=>__('Time field label','pisol-dtt'), 'desc'=>__('This label is used for email, order detail page','pisol-dtt'), 'type'=>'text', 'default'=>__('Pickup Time','pisol-dtt'), 'pro'=>true),
69
70
71 array('field'=>'color-setting', 'class'=> 'bg-dark opacity-75 text-light hide-pro', 'class_title'=>'text-light font-weight-light h4', 'label'=>__('Date and time label for email/order success page/backend (when delivery method: delivery)','pisol-dtt'), 'type'=>'setting_category'),
72 array('field'=>'pi_date_field_label_delivery', 'label'=>__('Date field label','pisol-dtt'), 'desc'=>__('This label is used for email, order detail page','pisol-dtt'), 'type'=>'text', 'default'=>__('Delivery Date','pisol-dtt'), 'pro'=>true),
73 array('field'=>'pi_time_field_label_delivery', 'label'=>__('Time field label','pisol-dtt'), 'desc'=>__('This label is used for email, order detail page','pisol-dtt'), 'type'=>'text', 'default'=>__('Delivery Time','pisol-dtt'), 'pro'=>true),
74
75
76
77
78
79
80
81 );
82
83
84 if($this->this_tab == $this->active_tab){
85 add_action('pisol_dtt_tab_content', array($this,'tab_content'));
86 }
87
88 add_action('pisol_dtt_tab', array($this,'tab'),3);
89
90 $this->register_settings();
91
92 }
93
94 function calendarStyles(){
95 $result = array();
96 foreach($this->calendar_themes as $theme){
97 $result[$theme] = ucfirst($theme);
98 }
99 return $result;
100 }
101
102 function register_settings(){
103
104 foreach($this->settings as $setting){
105 pisol_class_form::register_setting( $this->setting_key, $setting);
106 }
107
108 }
109
110 function delete_settings(){
111 foreach($this->settings as $setting){
112 delete_option( $setting['field'] );
113 }
114 }
115
116 function tab(){
117 $this->tab_name = __('Labels', 'pisol-dtt');
118 ?>
119 <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='.esc_attr($_GET['page']).'&tab='.esc_attr($this->this_tab) )); ?>">
120 <span class="dashicons dashicons-tag"></span> <?php echo esc_html($this->tab_name); ?>
121 </a>
122 <?php
123 }
124
125 function tab_content(){
126 ?>
127 <form method="post" action="options.php" class="pisol-setting-form">
128 <?php settings_fields( $this->setting_key ); ?>
129 <?php
130 foreach($this->settings as $setting){
131 new pisol_class_form($setting, $this->setting_key);
132 }
133 ?>
134 <input type="submit" name="submit" id="submit" class="btn btn-primary btn-md my-3" value="<?php echo esc_attr__('Save Changes','pisol-dtt'); ?>">
135 </form>
136 <?php
137 }
138
139
140 }
141
142 add_action('init', function(){
143 new pisol_dtt_option_label();
144 });
145
146