PluginProbe
PostNL for WooCommerce / 2.5.1
PostNL for WooCommerce v2.5.1
5.9.12 5.9.11 5.9.10 5.9.9 5.9.8 5.9.7 5.9.6 trunk 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.1.4 3.1.5 3.1.6 3.1.7 4.0.0 4.0.1 4.0.2 4.3.2 4.3.3 4.4.0 4.4.1 All 72 releases
woo-postnl / includes / views / wcmp-bulk-options-form.php

wcmp-bulk-options-form.php in PostNL for WooCommerce 2.5.1, at includes/views/wcmp-bulk-options-form.php

177 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 use WPO\WC\PostNL\Compatibility\WC_Core as WCX;
3 use WPO\WC\PostNL\Compatibility\Order as WCX_Order;
4 use WPO\WC\PostNL\Compatibility\Product as WCX_Product;
5
6 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
7
8 ?>
9 <!DOCTYPE html>
10 <html xmlns="http://www.w3.org/1999/xhtml">
11 <head>
12 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
13 <?php
14 wp_enqueue_script(
15 'wcpostnl-export',
16 WooCommerce_PostNL()->plugin_url() . '/assets/js/wcmp-admin.js',
17 array( 'jquery', 'thickbox', 'wp-color-picker' ),
18 WC_POSTNL_VERSION
19 );
20 wp_localize_script(
21 'wcpostnl-export',
22 'wc_postnl',
23 array(
24 'ajax_url' => admin_url( 'admin-ajax.php' ),
25 'nonce' => wp_create_nonce('wc_postnl'),
26 'download_display' => isset(WooCommerce_PostNL()->general_settings['download_display'])?WooCommerce_PostNL()->general_settings['download_display']:'',
27 )
28 );
29
30 wp_enqueue_style(
31 'wcmp-admin-styles',
32 WooCommerce_PostNL()->plugin_url() . '/assets/css/wcmp-admin-styles.css',
33 array(),
34 WC_POSTNL_VERSION,
35 'all'
36 );
37
38 // Legacy styles (WC 2.1+ introduced MP6 style with larger buttons)
39 if ( version_compare( WOOCOMMERCE_VERSION, '2.1', '<=' ) ) {
40 wp_enqueue_style(
41 'wcmp-admin-styles-legacy',
42 WooCommerce_PostNL()->plugin_url() . '/assets/css/wcmp-admin-styles-legacy.css',
43 array(),
44 WC_POSTNL_VERSION,
45 'all'
46 );
47 }
48
49 wp_enqueue_style( 'wp-color-picker' );
50 wp_enqueue_style( 'wcpostnl-admin-styles' );
51 wp_enqueue_style( 'colors' );
52 wp_enqueue_style( 'media' );
53 wp_enqueue_script( 'jquery' );
54 do_action('admin_print_styles');
55 do_action('admin_print_scripts');
56 ?>
57 </head>
58 <body>
59 <form method="post" class="page-form wcmp_bulk_options_form" action="<?php echo $target_url; ?>">
60 <table class="widefat">
61 <thead>
62 <tr>
63 <th><?php _e( 'Export options', 'woocommerce-postnl' ); ?></td>
64 </tr>
65 </thead>
66 <tbody>
67 <?php
68 $c = true;
69 foreach ( $order_ids as $order_id) :
70 $order = WCX::get_order( $order_id );
71 // skip non-postnl destinations
72 $shipping_country = WCX_Order::get_prop( $order, 'shipping_country' );
73 if ( !WooCommerce_PostNL()->export->is_postnl_destination( $shipping_country ) ) {
74 continue;
75 }
76 $shipment_options = WooCommerce_PostNL()->export->get_options( $order );
77 $recipient = WooCommerce_PostNL()->export->get_recipient( $order );
78 $postnl_options_extra = WCX_Order::get_meta( $order, '_postnl_shipment_options_extra' );
79 $package_types = WooCommerce_PostNL()->export->get_package_types( $dialog );
80 $parcel_weight = WooCommerce_PostNL()->export->get_parcel_weight( $order );
81 ?>
82 <tr class="order-row <?php echo (($c = !$c)?'alternate':'');?>">
83 <td>
84 <table style="width: 100%">
85 <tr>
86 <td colspan="2"><strong><?php _e( 'Order', 'woocommerce-postnl' ); ?> <?php echo $order->get_order_number(); ?></strong></td>
87 </tr>
88 <tr>
89 <td class="ordercell">
90 <table class="widefat">
91 <thead>
92 <tr>
93 <th>#</th>
94 <th><?php _e( 'Product name', 'woocommerce-postnl' ); ?></th>
95 <th align="right"><?php _e( 'Weight (kg)', 'woocommerce-postnl' ); ?></th>
96 </tr>
97 </thead>
98 <tbody>
99 <?php
100 $items = $order->get_items();
101 foreach ($items as $item_id => $item) {
102 ?>
103 <tr>
104 <td><?php echo $item['qty'].'x'; ?></td>
105 <td><?php echo $this->get_item_display_name ( $item, $order ) ?></td>
106 <td align="right"><?php echo number_format( $this->get_item_weight_kg( $item, $order ), 3, ',', ' '); ?></td>
107 </tr>
108 <?php } ?>
109 <tr>
110 <td>&nbsp;</td>
111 <td><?php _e( 'Empty parcel weight', 'woocommerce-postnl' ); ?></td>
112 <td align="right"><?php echo number_format( ( (isset(WooCommerce_PostNL()->general_settings['empty_parcel_weight'])) ? preg_replace("/\D/","",$this->settings['verpakkingsgewicht'])/1000 : 0 ), 3, ',', ' '); ?></td>
113 </tr>
114 </tbody>
115 <tfoot>
116 <tr>
117 <td>&nbsp;</td>
118 <td><?php _e( 'Total weight', 'woocommerce-postnl' ); ?></td>
119 <td align="right"><?php echo number_format( $parcel_weight, 3, ',', ' ' );?></td>
120 </tr>
121 </tfoot>
122 </table>
123 </td>
124 <td><?php
125 if ( $shipping_country == 'NL' && ( empty($recipient['street']) || empty($recipient['number']) ) ) { ?>
126 <p><span style="color:red"><?php _e( 'This order does not contain valid street and house number data and cannot be exported because of this! This order was probably placed before the PostNL plugin was activated. The address data can still be manually entered in the order screen.', 'woocommerce-postnl' ); ?></span></p>
127 </td>
128 </tr> <!-- last row -->
129 <?php
130 } else { // required address data is available
131 // print address
132 echo '<p>'.$order->get_formatted_shipping_address().'<br/>'.WCX_Order::get_prop( $order, 'billing_phone' ).'<br/>'.WCX_Order::get_prop( $order, 'billing_email' ).'</p>';
133 ?>
134 </td>
135 </tr>
136 <tr>
137 <td colspan="2" class="wcmp_shipment_options">
138 <?php
139 $skip_save = true; // don't show save button for each order
140 if ($dialog == 'shipment') {
141 include('wcmp-order-shipment-options.php');
142 } elseif ($dialog == 'return') {
143 include('wcmp-order-return-shipment-options.php');
144 }
145 ?>
146 </td>
147 </tr>
148 <?php } // end else ?>
149 </table>
150 </td>
151 </tr>
152 <?php endforeach; ?>
153 </tbody>
154 </table>
155 <input type="hidden" name="action" value="wc_postnl">
156 <div class="wcmp_save_shipment_settings">
157 <?php
158 if ($dialog == 'shipment') {
159 $button_text = __( 'Prepare shipment', 'woocommerce-postnl' );
160 }
161 ?>
162
163 <input type="submit" value="<?php echo $button_text; ?>" class="button save wcmp_export">
164 <img src="<?php echo WooCommerce_PostNL()->plugin_url() . '/assets/img/wpspin_light.gif';?>" class="wcmp_spinner"/>
165 </div>
166 </form>
167 <script type="text/javascript">
168 jQuery(document).ready(function($){
169 $('.button-wcpostnl').click(function(){
170 $('.waiting').show();
171 });
172 });
173 </script>
174
175 </body>
176 </html>
177