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 / public / class-myaccount.php
pi-woocommerce-order-date-time-and-type / public Last commit date
css 3 weeks ago js 3 weeks ago class-css.php 3 weeks ago class-date.php 3 weeks ago class-delivery-type.php 3 weeks ago class-display-field.php 3 weeks ago class-extra-message.php 3 weeks ago class-js.php 3 weeks ago class-main.php 3 weeks ago class-myaccount.php 3 weeks ago class-order.php 3 weeks ago class-pickup-location.php 3 weeks ago class-shipping-method.php 3 weeks ago class-time-range.php 3 weeks ago class-time-slot.php 3 weeks ago class-time.php 3 weeks ago class-validate.php 3 weeks ago class-woo-app.php 3 weeks ago
class-myaccount.php
77 lines
1 <?php
2
3 if ( ! defined( 'WPINC' ) ) {
4 die;
5 }
6
7 class pisol_dtt_MyAccount{
8 static $instance = null;
9
10 public static function get_instance(){
11 if(is_null(self::$instance)){
12 self::$instance = new self();
13 }
14 return self::$instance;
15 }
16
17 function __construct(){
18 add_action('woocommerce_account_orders_columns', array($this,'addOrderColumn'));
19 add_action('woocommerce_my_account_my_orders_column_pi_dtt', array(__CLASS__,'addOrderColumnContent'), 10, 1);
20 }
21
22 function addOrderColumn($columns){
23 $my_account_column_name = __('Order detail','pisol-dtt');
24 if (array_key_exists('order-actions', $columns)) {
25 // Insert the new column just before the "Actions" column
26 $new_columns = array();
27 foreach ($columns as $key => $value) {
28 if ($key === 'order-actions') {
29 $new_columns['pi_dtt'] = $my_account_column_name; // Add custom column before 'order-actions'
30 }
31 $new_columns[$key] = $value; // Add current column
32 }
33 }else{
34 $new_columns = $columns;
35 $new_columns['pi_dtt'] = $my_account_column_name;
36 }
37
38 return $new_columns;
39 }
40
41 static function addOrderColumnContent($order){
42 $order_id = $order->get_id();
43 $order = wc_get_order($order_id);
44 $type = $order->get_meta( 'pi_delivery_type', true );
45
46 $delivery_type_label = esc_html__('Delivery type','pisol-dtt');
47
48 if($type == 'delivery'){
49 $delivery_type = pisol_dtt_get_setting('pi_delivery_label', __('Delivery','pisol-dtt'));
50 }elseif($type == 'pickup'){
51 $delivery_type = pisol_dtt_get_setting('pi_pickup_label', __('Pickup','pisol-dtt'));
52 }elseif($type == 'non-deliverable'){
53 $delivery_type = '';
54 }
55
56 $dateLabel = __('Date','pisol-dtt');
57 $timeLabel = __('Time','pisol-dtt');
58
59 $pickup_location_label = pisol_dtt_get_setting('pi_dtt_co_label_pickup_location_email', __('Pickup location','pisol-dtt'));
60
61 $date = $order->get_meta( 'pi_system_delivery_date', true );
62 $time = $order->get_meta( 'pi_delivery_time', true );
63
64 $location = $order->get_meta( 'pickup_location', true );
65
66 $html = '';
67 $html .= $delivery_type ? '<div class="pi-delivery-type"><small><b>'.$delivery_type_label.'</b>: '.$delivery_type.'</small></div>' : '';
68 $html .= $date ? '<div class="pi-delivery-date"><small><b>'.$dateLabel.'</b>: '.\pi_dtt_date::translatedDate($date).'</small></div>' : '';
69 $html .= $time ? '<div class="pi-delivery-time"><small><b>'.$timeLabel.'</b>: '.\pisol_dtt_time::formatTimeForDisplay($time).'</small></div>' : '';
70 $html .= $type == 'pickup' && $location ? '<div class="pi-delivery-location"><small><b>'.$pickup_location_label.'</b>: <span>'.$location.'</span></small></div>' : '';
71
72 $final_html = $html ? sprintf('<div class="pi-detail-container" style="margin-top:10px; margin-bottom:10px;">%s</div>', $html) : '-';
73 echo wp_kses_post( apply_filters('pi_dtt_my_account_order_detail_col_content', $final_html, $order) );
74 }
75 }
76
77 pisol_dtt_MyAccount::get_instance();