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 / class-pi-dtt-labels.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
class-pi-dtt-labels.php
129 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 option','pisol-dtt'), 'type'=>'switch', 'default'=>1),
31
32
33 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'),
34 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),
35
36 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),
37
38
39 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'),
40 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),
41 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),
42
43 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'),
44 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'=>"" , 'pro'=>true),
45 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'=>"", 'pro'=>true),
46
47 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 option','pisol-dtt'),'after'=>__('After date and time option','pisol-dtt')), 'pro'=>true),
48
49 array('field'=>'pi_extra_message_bg_color', 'default'=>'#cccccc', 'type'=>'color', 'label'=>__('Message box background color','pisol-dtt'),'desc'=>'', 'pro'=>true),
50 array('field'=>'pi_extra_message_text_color', 'default'=>'#000000', 'type'=>'color', 'label'=>__('Message box text color','pisol-dtt'),'desc'=>'', 'pro'=>true),
51
52
53
54 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'),
55 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'),
56 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'),
57 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')),
58 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')),
59
60 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')),
61 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')),
62
63
64 );
65
66
67 if($this->this_tab == $this->active_tab){
68 add_action('pisol_dtt_tab_content', array($this,'tab_content'));
69 }
70
71 add_action('pisol_dtt_tab', array($this,'tab'),3);
72
73 $this->register_settings();
74
75 }
76
77 function calendarStyles(){
78 $result = array();
79 foreach($this->calendar_themes as $theme){
80 $result[$theme] = ucfirst($theme);
81 }
82 return $result;
83 }
84
85 function register_settings(){
86
87 foreach($this->settings as $setting){
88 pisol_class_form::register_setting( $this->setting_key, $setting);
89 }
90
91 }
92
93 function delete_settings(){
94 foreach($this->settings as $setting){
95 delete_option( $setting['field'] );
96 }
97 }
98
99 function tab(){
100 $this->tab_name = __('Labels', 'pisol-dtt');
101 ?>
102 <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) )); ?>">
103 <span class="dashicons dashicons-tag"></span> <?php echo esc_html($this->tab_name); ?>
104 </a>
105 <?php
106 }
107
108 function tab_content(){
109 ?>
110 <form method="post" action="options.php" class="pisol-setting-form">
111 <?php settings_fields( $this->setting_key ); ?>
112 <?php
113 foreach($this->settings as $setting){
114 new pisol_class_form($setting, $this->setting_key);
115 }
116 ?>
117 <input type="submit" name="submit" id="submit" class="btn btn-primary btn-md my-3" value="<?php echo esc_attr__('Save Changes','pisol-dtt'); ?>">
118 </form>
119 <?php
120 }
121
122
123 }
124
125 add_action('init', function(){
126 new pisol_dtt_option_label();
127 });
128
129