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-woo-app.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-woo-app.php
62 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3
4 class pisol_dtt_woo_mobile_app_support{
5
6 protected $post_type = 'shop_order';
7
8 function __construct(){
9 $add_to_order_note = pisol_dtt_get_setting('pi_enable_woocommerce_app_support', 0);
10
11 if(empty($add_to_order_note)) return;
12
13 add_action( 'woocommerce_checkout_update_order_meta', [$this,'addDataInNote'], PHP_INT_MAX, 1 );
14
15 add_action( 'save_post', array($this,'savePostTimeSlot'), PHP_INT_MAX, 2 );
16 }
17
18 function savePostTimeSlot( $post_id, $post ){
19
20 if(!apply_filters( 'pisol_dtt_order_note_on_edit', true )) return;
21
22 if ( ( empty( $post_id ) || empty( $post ) || ( $this->post_type !== get_post_type( $post ) ) )
23 || ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id )
24 || ( ! current_user_can( 'edit_post', $post_id ) ) ) {
25 return;
26 }
27
28
29 $this->addDataInNote( $post_id );
30 }
31
32 function addDataInNote( $order_id ){
33 $order = wc_get_order($order_id);
34
35 $type = $order->get_meta( 'pi_delivery_type', true ); // delivery type 'delivery' or 'pickup'
36
37 $date = $order->get_meta( 'pi_system_delivery_date', true ); // date in yyyy/mm/dd format
38 if(class_exists('pi_dtt_date')){
39 $date = pi_dtt_date::translatedDate($date);
40 }
41
42 $time = $order->get_meta( 'pi_delivery_time', true ); // delivery time
43 if(class_exists("pisol_dtt_time")){
44 $time = pisol_dtt_time::formatTimeForDisplay($time);
45 }
46
47 $location = $order->get_meta( 'pickup_location', true ); // pickup location
48
49 $note = __('Delivery Type:', 'pisol-dtt').' '.$type;
50 $note .= '<br>'.__('Data:','pisol-dtt').' '.$date;
51 $note .= '<br>'.__('Time:','pisol-dtt').' '.$time;
52 if(!empty($location)){
53 $note .= '<br>'.__('Location:','pisol-dtt').' '.$location;
54 }
55
56 $note = apply_filters('pisol_dtt_order_note_filter', $note, $order);
57
58 $order->add_order_note( $note );
59 }
60
61 }
62 new pisol_dtt_woo_mobile_app_support();