WooCommerce Print Invoice & Delivery Note - Version 3.0.6

Version Description

  • Fixed the known issue where the print button stopped working becuse of SSL
  • Fixed an issue where the print page was redirected to the account page
Download this release

Release Info

Developer chabis
Plugin Icon 128x128 WooCommerce Print Invoice & Delivery Note
Version 3.0.6
Comparing to
See all releases

Code changes from version 2.0.2 to 3.0.6

classes/class-wcdn-print.php DELETED
@@ -1,210 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Print class
5
- */
6
- if ( ! class_exists( 'WooCommerce_Delivery_Notes_Print' ) ) {
7
-
8
- class WooCommerce_Delivery_Notes_Print {
9
-
10
- private $template_directory_name;
11
- private $template_path;
12
- private $template_default_path;
13
- private $template_default_uri;
14
-
15
- private $order;
16
-
17
- public $template_type;
18
- public $order_id;
19
-
20
- /**
21
- * Constructor
22
- */
23
- public function __construct() {
24
- global $woocommerce;
25
- $this->order = new WC_Order();
26
- $this->template_directory_name = 'print';
27
- $this->template_path = $woocommerce->template_url . $this->template_directory_name . '/';
28
- $this->template_default_path = WooCommerce_Delivery_Notes::$plugin_path . 'templates/' . $this->template_directory_name . '/';
29
- $this->template_default_uri = WooCommerce_Delivery_Notes::$plugin_url . 'templates/' . $this->template_directory_name . '/';
30
- }
31
-
32
- /**
33
- * Load the class
34
- */
35
- public function load() {
36
- add_action( 'admin_init', array( $this, 'load_hooks' ) );
37
- }
38
-
39
- /**
40
- * Load the admin hooks
41
- */
42
- public function load_hooks() {
43
- add_action('wp_ajax_generate_print_content', array($this, 'generate_print_content_ajax'));
44
- }
45
-
46
- /**
47
- * Generate the template output
48
- */
49
- public function generate_print_content( $template_type, $order_id ) {
50
- $this->template_type = $template_type;
51
- $this->order_id = $order_id;
52
- $this->order->get_order( $this->order_id );
53
- $this->get_template( apply_filters( 'wcdn_template_file_name', 'print-' . $this->template_type . '.php', $template_type, $order_id, $this ) );
54
- do_action( 'wcdn_generate_print_content' );
55
- }
56
-
57
- /**
58
- * Load and generate the template output with ajax
59
- */
60
- public function generate_print_content_ajax() {
61
- // Let the backend only access the page
62
- if( !is_admin() ) {
63
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
64
- }
65
-
66
- // Check the user privileges
67
- if( !current_user_can( 'manage_woocommerce_orders' ) && !current_user_can( 'edit_shop_orders' ) ) {
68
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
69
- }
70
-
71
- // Check the nonce
72
- if( empty( $_GET['action'] ) || !check_admin_referer( $_GET['action'] ) ) {
73
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
74
- }
75
-
76
- // Check if all parameters are set
77
- if( empty( $_GET['template_type'] ) || empty( $_GET['order_id'] ) ) {
78
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
79
- }
80
-
81
- // Generate the output
82
- $this->generate_print_content( $_GET['template_type'], $_GET['order_id'] );
83
-
84
- exit;
85
- }
86
-
87
- /**
88
- * Get the template url for a file. locate by file existience
89
- * and then return the corresponding url.
90
- */
91
- public function get_template_url( $name ) {
92
- global $woocommerce;
93
-
94
- $uri = $this->template_default_uri . $name;
95
- $child_theme_path = get_stylesheet_directory() . '/' . $this->template_path;
96
- $child_theme_uri = get_stylesheet_directory_uri() . '/' . $this->template_path;
97
- $theme_path = get_template_directory() . '/' . $this->template_path;
98
- $theme_uri = get_template_directory_uri() . '/' . $this->template_path;
99
-
100
- if( file_exists( $child_theme_path . $name ) ) {
101
- $uri = $child_theme_uri . $name;
102
- } elseif( file_exists( $theme_path . $name ) ) {
103
- $uri = $theme_uri . $name;
104
- }
105
-
106
- return $uri;
107
- }
108
-
109
- /**
110
- * Load the template file content
111
- */
112
- public function get_template( $name ) {
113
- woocommerce_get_template( $name, null, $this->template_path, $this->template_default_path );
114
- }
115
-
116
- /**
117
- * Get the current order
118
- */
119
- public function get_order() {
120
- return $this->order;
121
- }
122
-
123
- /**
124
- * Get the current order items
125
- */
126
- public function get_order_items() {
127
- global $woocommerce;
128
- global $_product;
129
-
130
- $items = $this->order->get_items();
131
- $data_list = array();
132
-
133
- if( sizeof( $items ) > 0 ) {
134
- foreach ( $items as $item ) {
135
- // Array with data for the printing template
136
- $data = array();
137
-
138
- // Set the id
139
- $data['product_id'] = $item['product_id'];
140
- $data['variation_id'] = $item['variation_id'];
141
-
142
- // Set item name
143
- $data['name'] = $item['name'];
144
-
145
- // Set item quantity
146
- $data['quantity'] = $item['qty'];
147
-
148
- // Set the subtotal for the number of products
149
- $data['line_total'] = $item['line_total'];
150
- $data['line_tax'] = $item['line_tax'];
151
-
152
- // Set the final subtotal for all products
153
- $data['line_subtotal'] = $item['line_subtotal'];
154
- $data['line_subtotal_tax'] = $item['line_subtotal_tax'];
155
- $data['formatted_line_subtotal'] = $this->order->get_formatted_line_subtotal( $item );
156
- $data['price'] = $data['formatted_line_subtotal'];
157
-
158
- // Set item meta and replace it when it is empty
159
- $meta = new WC_Order_Item_Meta( $item['item_meta'] );
160
- $data['meta'] = $meta->display( false, true );
161
-
162
- // Pass complete item array
163
- $data['item'] = $item;
164
-
165
- // Create the product to display more info
166
- $data['product'] = null;
167
-
168
- $product = $this->order->get_product_from_item( $item );
169
-
170
- // Checking fo existance, thanks to MDesigner0
171
- if(!empty($product)) {
172
- // Set the single price
173
- $data['single_price'] = $product->get_price();
174
-
175
- // Set item SKU
176
- $data['sku'] = $product->get_sku();
177
-
178
- // Set item weight
179
- $data['weight'] = $product->get_weight();
180
-
181
-
182
- // Set item dimensions
183
- $data['dimensions'] = $product->get_dimensions();
184
-
185
- // Pass complete product object
186
- $data['product'] = $product;
187
-
188
- }
189
-
190
- $data_list[] = apply_filters( 'wcdn_order_item_data', $data );
191
- }
192
- }
193
-
194
- return apply_filters( 'wcdn_order_items_data', $data_list );
195
- }
196
-
197
- /**
198
- * Get order custom field
199
- */
200
- public function get_order_field( $field ) {
201
- if( isset( $this->get_order()->order_custom_fields[$field] ) ) {
202
- return $this->get_order()->order_custom_fields[$field][0];
203
- }
204
- return;
205
- }
206
- }
207
-
208
- }
209
-
210
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/class-wcdn-settings.php DELETED
@@ -1,364 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Settings class
5
- */
6
- if ( ! class_exists( 'WooCommerce_Delivery_Notes_Settings' ) ) {
7
-
8
- class WooCommerce_Delivery_Notes_Settings {
9
-
10
- public $tab_name;
11
- public $hidden_submit;
12
-
13
- /**
14
- * Constructor
15
- */
16
- public function __construct() {
17
- $this->tab_name = 'woocommerce-delivery-notes';
18
- $this->hidden_submit = WooCommerce_Delivery_Notes::$plugin_prefix . 'submit';
19
- }
20
-
21
- /**
22
- * Load the class
23
- */
24
- public function load() {
25
- add_action( 'admin_init', array( $this, 'load_hooks' ) );
26
- }
27
-
28
- /**
29
- * Load the admin hooks
30
- */
31
- public function load_hooks() {
32
- add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_tab' ) );
33
- add_action( 'woocommerce_settings_tabs_' . $this->tab_name, array( $this, 'create_settings_page' ) );
34
- add_action( 'woocommerce_update_options_' . $this->tab_name, array( $this, 'save_settings_page' ) );
35
- add_action( 'current_screen', array( $this, 'load_screen_hooks' ) );
36
- add_action( 'wp_ajax_load_thumbnail', array( $this, 'load_thumbnail_ajax' ) );
37
- }
38
-
39
- /**
40
- * Add the scripts
41
- */
42
- public function load_screen_hooks() {
43
- $screen = get_current_screen();
44
-
45
- if( $this->is_settings_page() ) {
46
- add_action( 'admin_print_styles', array( $this, 'add_styles' ) );
47
- add_action( 'admin_print_scripts', array( $this, 'add_scripts' ) );
48
- add_action( 'load-' . $screen->id, array( $this, 'add_help_tabs' ) );
49
- }
50
-
51
- if( $this->is_media_uploader_page() ) {
52
- add_filter( 'media_upload_tabs', array( $this, 'remove_media_tabs' ) );
53
- }
54
- }
55
-
56
- /**
57
- * Add the styles
58
- */
59
- public function add_styles() {
60
- wp_enqueue_style( 'thickbox' );
61
- wp_enqueue_style( 'woocommerce-delivery-notes', WooCommerce_Delivery_Notes::$plugin_url . 'css/style.css' );
62
- }
63
-
64
- /**
65
- * Add the scripts
66
- */
67
- public function add_scripts() {
68
- ?>
69
- <script type="text/javascript">
70
- var show_print_preview = 'yes';
71
- </script>
72
- <?php
73
- wp_enqueue_script( 'media-upload' );
74
- wp_enqueue_script( 'thickbox' );
75
- wp_enqueue_script( 'woocommerce-delivery-notes', WooCommerce_Delivery_Notes::$plugin_url . 'js/script.js', array( 'jquery', 'media-upload', 'thickbox' ) );
76
- }
77
-
78
- /**
79
- * Check if we are on settings page
80
- */
81
- public function is_settings_page() {
82
- if( isset( $_GET['page'] ) && isset( $_GET['tab'] ) && $_GET['tab'] == $this->tab_name ) {
83
- return true;
84
- } else {
85
- return false;
86
- }
87
- }
88
-
89
- /**
90
- * Check if we are on media uploader page
91
- */
92
- public function is_media_uploader_page() {
93
- if( isset( $_GET['post_id'] ) && isset( $_GET['company_logo_image'] ) && $_GET['post_id'] == '0' && $_GET['company_logo_image'] == 'true' ) {
94
- return true;
95
- } else {
96
- return false;
97
- }
98
- }
99
-
100
- /**
101
- * Check if sequential order plugin is activated
102
- */
103
- public function is_woocommerce_sequential_order_numbers_activated() {
104
- if ( in_array( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
105
- return true;
106
- } else {
107
- return false;
108
- }
109
- }
110
-
111
- /**
112
- * Remove the media uploader tabs
113
- */
114
- public function remove_media_tabs( $tabs ) {
115
- unset( $tabs['type_url'] );
116
- return $tabs;
117
- }
118
-
119
- /**
120
- * Add the help tabs
121
- */
122
- public function add_help_tabs() {
123
- // Check current admin screen
124
- $screen = get_current_screen();
125
-
126
- // Remove all existing tabs
127
- $screen->remove_help_tabs();
128
-
129
- // Create arrays with help tab titles
130
- $screen->add_help_tab(array(
131
- 'id' => 'woocommerce-delivery-notes-usage',
132
- 'title' => __( 'About the Plugin', 'woocommerce-delivery-notes' ),
133
- 'content' =>
134
- '<h3>' . __( 'Plugin: WooCommerce Print Invoices & Delivery Notes', 'woocommerce-delivery-notes' ) . '</h3>' .
135
- '<h4>' . __( 'About the Plugin', 'woocommerce-delivery-notes' ) . '</h4>' .
136
- '<p>' . __( 'This plugin enables you to add a Invoice or simple Delivery Note page for printing for your orders in WooCommerce shop plugin. You can add your company postal address, further add personal notes, refund or other policies and a footer note/branding. This helps speed up your daily shop and order management. In some countries (e.g. in the European Union) it is also required to advice the customer with proper refund policies so this little plugin might help you a bit with that too.', 'woocommerce-delivery-notes' ) . '</p>' .
137
- '<p>' . sprintf( __( 'Just look under <a href="%1$s">WooCommerce > Orders</a> and there go to a single order view. On the right side you will see the Order Print meta box. Click one of the buttons and you get the invoice or delivery note printing page. Yes, it is that easy :-).', 'woocommerce-delivery-notes' ), admin_url( 'edit.php?post_type=shop_order' ) ) . '</p>'
138
- ) );
139
-
140
- // Create help sidebar
141
- $screen->set_help_sidebar(
142
- '<p><strong>' . __( 'For more information:', 'woocommerce-delivery-notes' ) . '</strong></p>'.
143
- '<p><a href="http://wordpress.org/extend/plugins/woocommerce-delivery-notes/faq/" target="_blank">' . __( 'Frequently Asked Questions', 'woocommerce-delivery-notes' ) . '</a></p>' .
144
- '<p><a href="http://wordpress.org/support/plugin/woocommerce-delivery-notes" target="_blank">' . __( 'Get Community Support', 'woocommerce-delivery-notes' ) . '</a></p>' .
145
- '<p><a href="http://wordpress.org/extend/plugins/woocommerce-delivery-notes/" target="_blank">' . __( 'Project on WordPress.org', 'woocommerce-delivery-notes' ) . '</a></p>' .
146
- '<p><a href="https://github.com/deckerweb/woocommerce-delivery-notes" target="_blank">' . __( 'Project on GitHub', 'woocommerce-delivery-notes' ) . '</a></p>'
147
- );
148
- }
149
-
150
- /**
151
- * Add a tab to the settings page
152
- */
153
- public function add_settings_tab($tabs) {
154
- $tabs[$this->tab_name] = __( 'Print', 'woocommerce-delivery-notes' );
155
-
156
- return $tabs;
157
- }
158
-
159
- /**
160
- * Load thumbnail with ajax
161
- */
162
- public function load_thumbnail_ajax() {
163
- $attachment_id = (int)$_POST['attachment_id'];
164
-
165
- // Verify the id
166
- if( !$attachment_id ) {
167
- die();
168
- }
169
-
170
- // create the thumbnail
171
- $this->create_thumbnail( $attachment_id );
172
-
173
- exit;
174
- }
175
-
176
- /**
177
- * Create the thumbnail
178
- */
179
- public function create_thumbnail( $attachment_id ) {
180
- $attachment_src = wp_get_attachment_image_src( $attachment_id, 'full', false );
181
-
182
- // resize the image to a 1/4 of the original size
183
- // to have a printing point density of about 288ppi.
184
- ?>
185
- <img src="<?php echo $attachment_src[0]; ?>" width="<?php echo $attachment_src[1] / 4; ?>" height="<?php echo $attachment_src[2] / 4; ?>" alt="" />
186
- <?php
187
- }
188
-
189
- /**
190
- * Create the settings page content
191
- */
192
- public function create_settings_page() {
193
- ?>
194
- <h3><?php _e( 'Invoices and Delivery Notes', 'woocommerce-delivery-notes' ); ?></h3>
195
- <table class="form-table">
196
- <tbody>
197
- <tr class="hide-if-no-js">
198
- <?php
199
- $attachment_id = get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'company_logo_image_id' );
200
- ?>
201
- <th>
202
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_logo_image_id"><?php _e( 'Company/Shop Logo', 'woocommerce-delivery-notes' ); ?></label>
203
- </th>
204
- <td>
205
- <input id="company-logo-image-id" type="hidden" name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_logo_image_id" rows="2" class="regular-text" value="<?php echo $attachment_id ?>" />
206
- <span id="company-logo-placeholder"><?php if( !empty( $attachment_id ) ) : ?><?php $this->create_thumbnail( $attachment_id ); ?><?php endif; ?></span>
207
- <a href="#" id="company-logo-remove-button" <?php if( empty( $attachment_id ) ) : ?>style="display: none;"<?php endif; ?>><?php _e( 'Remove Logo', 'woocommerce-delivery-notes' ); ?></a>
208
- <a href="#" <?php if( !empty( $attachment_id ) ) : ?>style="display: none;"<?php endif; ?> id="company-logo-add-button"><?php _e( 'Set Logo', 'woocommerce-delivery-notes' ); ?></a>
209
- <span class="description">
210
- <?php _e( 'A company/shop logo representing your business.', 'woocommerce-delivery-notes' ); ?>
211
- <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
212
- <?php _e( 'When the image is printed, its pixel density will automatically be eight times higher than the original. This means, 1 printed inch will correspond to about 288 pixels on the screen. Example: an image with a width of 576 pixels and a height of 288 pixels will have a printed size of about 2 inches to 1 inch.', 'woocommerce-delivery-notes' ); ?>
213
- </span>
214
- </td>
215
- </tr>
216
- <tr>
217
- <th>
218
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>custom_company_name"><?php _e( 'Company/Shop Name', 'woocommerce-delivery-notes' ); ?></label>
219
- </th>
220
- <td>
221
- <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>custom_company_name" rows="2" class="large-text"><?php echo wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'custom_company_name' ) ); ?></textarea>
222
- <span class="description">
223
- <?php _e( 'Your company/shop name for the Delivery Note.', 'woocommerce-delivery-notes' ); ?>
224
- <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
225
- <?php _e( 'Leave blank to use the default Website/ Blog title defined in WordPress settings.', 'woocommerce-delivery-notes' ); ?>
226
- </span>
227
- </td>
228
- </tr>
229
- <tr>
230
- <th>
231
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_address"><?php _e( 'Company/Shop Address', 'woocommerce-delivery-notes' ); ?></label>
232
- </th>
233
- <td>
234
- <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_address" rows="5" class="large-text"><?php echo wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'company_address' ) ); ?></textarea>
235
- <span class="description">
236
- <?php _e( 'The postal address of the company/shop, which gets printed right of the company/shop name, above the order listings.', 'woocommerce-delivery-notes' ); ?>
237
- <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
238
- <?php _e('Leave blank to not print an address.', 'woocommerce-delivery-notes' ); ?>
239
- </span>
240
- </td>
241
- </tr>
242
- <tr>
243
- <th>
244
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>personal_notes"><?php _e( 'Personal Notes', 'woocommerce-delivery-notes' ); ?></label>
245
- </th>
246
- <td>
247
- <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>personal_notes" rows="5" class="large-text"><?php echo wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'personal_notes' ) ); ?></textarea>
248
- <span class="description">
249
- <?php _e( 'Add some personal notes, or season greetings or whatever (e.g. Thank You for Your Order!, Merry Christmas!, etc.).', 'woocommerce-delivery-notes' ); ?>
250
- <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
251
- <?php _e('Leave blank to not print any personal notes.', 'woocommerce-delivery-notes' ); ?>
252
- </span>
253
- </td>
254
- </tr>
255
- <tr>
256
- <th>
257
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>policies_conditions"><?php _e( 'Returns Policy, Conditions, etc.:', 'woocommerce-delivery-notes' ); ?></label>
258
- </th>
259
- <td>
260
- <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>policies_conditions" rows="5" class="large-text"><?php echo wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'policies_conditions' ) ); ?></textarea>
261
- <span class="description">
262
- <?php _e( 'Here you can add some more policies, conditions etc. For example add a returns policy in case the client would like to send back some goods. In some countries (e.g. in the European Union) this is required so please add any required info in accordance with the statutory regulations.', 'woocommerce-delivery-notes' ); ?>
263
- <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
264
- <?php _e('Leave blank to not print any policies or conditions.', 'woocommerce-delivery-notes' ); ?>
265
- </span>
266
- </td>
267
- </tr>
268
- <tr>
269
- <th>
270
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>footer_imprint"><?php _e( 'Footer Imprint', 'woocommerce-delivery-notes' ); ?></label>
271
- </th>
272
- <td>
273
- <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>footer_imprint" rows="5" class="large-text"><?php echo wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'footer_imprint' ) ); ?></textarea>
274
- <span class="description">
275
- <?php _e( 'Add some further footer imprint, copyright notes etc. to get the printed sheets a bit more branded to your needs.', 'woocommerce-delivery-notes' ); ?>
276
- <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
277
- <?php _e('Leave blank to not print a footer.', 'woocommerce-delivery-notes' ); ?>
278
- </span>
279
- </td>
280
- </tr>
281
- <tr>
282
- <th>
283
- </th>
284
- <td>
285
- <?php
286
- // show template preview links when an order is available
287
- $args = array(
288
- 'post_type' => 'shop_order',
289
- 'posts_per_page' => 1
290
- );
291
- $query = new WP_Query( $args );
292
-
293
- if($query->have_posts()) : ?>
294
- <?php
295
- $results = $query->get_posts();
296
- $test_id = $results[0]->ID;
297
- $invoice_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_print_content&template_type=invoice&order_id=' . $test_id ), 'generate_print_content' );
298
- $note_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_print_content&template_type=delivery-note&order_id=' . $test_id ), 'generate_print_content' );
299
- ?>
300
- <span class="description">
301
- <?php printf( __( 'You can <a href="%1$s" target="%3$s" class="%4$s">preview the invoice template</a> or <a href="%2$s" target="%3$s" class="%4$s">the delivery note template</a>.', 'woocommerce-delivery-notes' ), $invoice_url, $note_url, '_blank', 'print-preview-button' ); ?>
302
- <?php _e( 'For more advanced control copy <code>woocommerce-delivery-notes/templates/print/style.css</code> to <code>your-theme-name/woocommerce/print/style.css</code>.', 'woocommerce-delivery-notes' ); ?>
303
- </span>
304
- <?php endif; ?>
305
- </td>
306
- </tr>
307
- </tbody>
308
- </table>
309
- <h3><?php _e( 'Order Numbering Options', 'woocommerce-delivery-notes' ); ?></h3>
310
- <table class="form-table">
311
- <tbody>
312
- <tr>
313
- <th>
314
- <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>order_number_offset"><?php _e( 'Sequential order number', 'woocommerce-delivery-notes' ); ?></label>
315
- </th>
316
- <td>
317
- <?php if( $this->is_woocommerce_sequential_order_numbers_activated() ) : ?>
318
- <?php _e( 'Sequential numbering is enabled.', 'woocommerce-delivery-notes' ); ?>
319
- <?php else : ?>
320
- <?php printf( __( 'Install and activate the free <a href="%s">WooCommerce Sequential Order Numbers</a> Plugin.', 'woocommerce-delivery-notes' ), 'http://wordpress.org/extend/plugins/woocommerce-sequential-order-numbers/' ); ?>
321
- <?php endif; ?>
322
- </td>
323
- </tr>
324
- </tbody>
325
- </table>
326
-
327
- <input type="hidden" name="<?php echo $this->hidden_submit; ?>" value="submitted">
328
- <?php
329
- }
330
-
331
- /**
332
- * Get the content for an option
333
- */
334
- public function get_setting( $name ) {
335
- return get_option( WooCommerce_Delivery_Notes::$plugin_prefix . $name );
336
- }
337
-
338
- /**
339
- * Save all settings
340
- */
341
- public function save_settings_page() {
342
- if ( isset( $_POST[ $this->hidden_submit ] ) && $_POST[ $this->hidden_submit ] == 'submitted' ) {
343
- foreach ( $_POST as $key => $value ) {
344
- if ( $key != $this->hidden_submit && strpos( $key, WooCommerce_Delivery_Notes::$plugin_prefix ) !== false ) {
345
- if ( empty( $value ) ) {
346
- delete_option( $key );
347
- } else {
348
- if ( get_option( $key ) && get_option( $key ) != $value ) {
349
- update_option( $key, $value );
350
- }
351
- else {
352
- add_option( $key, $value );
353
- }
354
- }
355
- }
356
- }
357
- }
358
- }
359
-
360
- }
361
-
362
- }
363
-
364
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/class-wcdn-writepanel.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Writepanel class
5
- */
6
- if ( !class_exists( 'WooCommerce_Delivery_Notes_Writepanel' ) ) {
7
-
8
- class WooCommerce_Delivery_Notes_Writepanel {
9
-
10
- /**
11
- * Constructor
12
- */
13
- public function __construct() {
14
- }
15
-
16
- /**
17
- * Load the class
18
- */
19
- public function load() {
20
- add_action( 'admin_init', array( $this, 'load_hooks' ) );
21
- }
22
-
23
- /**
24
- * Load the admin hooks
25
- */
26
- public function load_hooks() {
27
- add_action( 'woocommerce_admin_order_actions_end', array( $this, 'add_listing_actions' ) );
28
- add_action( 'add_meta_boxes_shop_order', array( $this, 'add_box' ) );
29
- add_action( 'admin_print_scripts', array( $this, 'add_scripts' ) );
30
- add_action( 'admin_print_styles', array( $this, 'add_styles' ) );
31
- }
32
-
33
- /**
34
- * Add the styles
35
- */
36
- public function add_styles() {
37
- if( $this->is_order_edit_page() ) {
38
- wp_enqueue_style( 'thickbox' );
39
- wp_enqueue_style( 'woocommerce-delivery-notes', WooCommerce_Delivery_Notes::$plugin_url . 'css/style.css' );
40
- }
41
- }
42
-
43
- /**
44
- * Add the scripts
45
- */
46
- public function add_scripts() {
47
- if( $this->is_order_edit_page() ) {
48
- ?>
49
- <script type="text/javascript">
50
- var show_print_preview = 'no';
51
- </script>
52
- <?php
53
- wp_enqueue_script( 'media-upload' );
54
- wp_enqueue_script( 'thickbox' );
55
- wp_enqueue_script( 'woocommerce-delivery-notes', WooCommerce_Delivery_Notes::$plugin_url . 'js/script.js', array( 'jquery', 'media-upload', 'thickbox' ) );
56
- }
57
- }
58
-
59
- /**
60
- * Is order page
61
- */
62
- public function is_order_edit_page() {
63
- global $post_type;
64
- if( $post_type == 'shop_order' ) {
65
- return true;
66
- } else {
67
- return false;
68
- }
69
- }
70
-
71
- /**
72
- * Add print actions to the orders listing
73
- */
74
- public function add_listing_actions( $order ) {
75
- ?>
76
- <a href="<?php echo wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_print_content&template_type=invoice&order_id=' . $order->id ), 'generate_print_content' ); ?>" class="button tips print-preview-button" target="_blank" alt="<?php esc_attr_e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>" data-tip="<?php esc_attr_e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>">
77
- <span><?php _e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?></span>
78
- <img src="<?php echo WooCommerce_Delivery_Notes::$plugin_url . 'images/print-invoice.png'; ?>" alt="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>" width="14">
79
- </a>
80
- <a href="<?php echo wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_print_content&template_type=delivery-note&order_id=' . $order->id ), 'generate_print_content' ); ?>" class="button tips print-preview-button" target="_blank" alt="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>" data-tip="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>">
81
- <span><?php _e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?></span>
82
- <img src="<?php echo WooCommerce_Delivery_Notes::$plugin_url . 'images/print-delivery-note.png'; ?>" alt="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>" width="14">
83
- </a>
84
- <img src="<?php echo admin_url( 'images/wpspin_light.gif' ); ?>" class="loading" alt="">
85
- <?php
86
- }
87
-
88
- /**
89
- * Add the meta box on the single order page
90
- */
91
- public function add_box() {
92
- add_meta_box( 'woocommerce-delivery-notes-box', __( 'Order Print', 'woocommerce-delivery-notes' ), array( $this, 'create_box_content' ), 'shop_order', 'side', 'default' );
93
- }
94
-
95
- /**
96
- * Create the meta box content on the single order page
97
- */
98
- public function create_box_content() {
99
- global $post_id;
100
- ?>
101
- <ul class="woocommerce-delivery-notes-actions">
102
- <li><a href="<?php echo wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_print_content&template_type=invoice&order_id=' . $post_id ), 'generate_print_content' ); ?>" class="button print-preview-button" target="_blank" alt="<?php esc_attr_e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>"><?php _e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?></a></li>
103
- <li><a href="<?php echo wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_print_content&template_type=delivery-note&order_id=' . $post_id ), 'generate_print_content' ); ?>" class="button print-preview-button" target="_blank" alt="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>"><?php _e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?></a></li>
104
- </ul>
105
- <img src="<?php echo admin_url( 'images/wpspin_light.gif' ); ?>" class="loading" alt="">
106
- <?php
107
- }
108
-
109
- }
110
-
111
- }
112
-
113
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/admin.css ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Icons */
2
+
3
+ @font-face {
4
+ font-family: 'icons';
5
+ src: url('../fonts/icons.eot?99179621');
6
+ src: url('../fonts/icons.eot?99179621#iefix') format('embedded-opentype'),
7
+ url('../fonts/icons.woff?99179621') format('woff'),
8
+ url('../fonts/icons.ttf?99179621') format('truetype'),
9
+ url('../fonts/icons.svg?99179621#icons') format('svg');
10
+ font-weight: normal;
11
+ font-style: normal;
12
+ }
13
+
14
+ /* Edit order */
15
+
16
+ #woocommerce-delivery-notes-box .button {
17
+ overflow: hidden;
18
+ max-width: 100%;
19
+ text-overflow: ellipsis;
20
+ margin-top: 0.65em;
21
+ margin-bottom: 0.35em;
22
+ }
23
+
24
+ #woocommerce-delivery-notes-box span.print-preview-loading {
25
+ position: absolute;
26
+ right: 2.5em;
27
+ top: -2.8em;
28
+ }
29
+
30
+ #woocommerce-delivery-notes-box span.print-preview-loading,
31
+ .type-shop_order .column-order_actions span.print-preview-loading {
32
+ display: none;
33
+ vertical-align: middle;
34
+ }
35
+
36
+ /* All orders */
37
+ .type-shop_order .column-order_actions .print-preview-button {
38
+ display: block;
39
+ text-indent: -9999px;
40
+ position: relative;
41
+ height: 1em;
42
+ width: 1em;
43
+ padding: 0 !important;
44
+ height: 2em !important;
45
+ width: 2em;
46
+ }
47
+
48
+ .type-shop_order .column-order_actions .print-preview-button:before {
49
+ font-family: "icons";
50
+ speak: none;
51
+ font-weight: normal;
52
+ font-variant: normal;
53
+ text-transform: none;
54
+ -webkit-font-smoothing: antialiased;
55
+ margin: 0;
56
+ text-indent: 0;
57
+ position: absolute;
58
+ top: 0;
59
+ left: 0;
60
+ width: 100%;
61
+ height: 100%;
62
+ text-align: center;
63
+ content: "";
64
+ line-height: 1.85;
65
+ }
66
+
67
+ .type-shop_order .column-order_actions .print-preview-button.invoice:before {
68
+ content: "\e801";
69
+ }
70
+
71
+ .type-shop_order .column-order_actions .print-preview-button.delivery-note:before {
72
+ content: "\e800";
73
+ }
74
+
75
+ .type-shop_order .column-order_actions span.print-preview-loading {
76
+ float: left;
77
+ margin-top: 3px;
78
+ }
79
+
80
+ .type-shop_order .column-order_actions .print-preview-button span {
81
+ display: none;
82
+ }
83
+
84
+ /* Settings */
85
+
86
+ #company-logo-placeholder {
87
+ }
88
+
89
+ #company-logo-placeholder img {
90
+ cursor: pointer;
91
+ max-width: 200px;
92
+ height: auto;
93
+ }
94
+
95
+ #company-logo-loader.spinner {
96
+ float: none;
97
+ }
98
+
99
+ #company-logo-loader.print-preview-loading {
100
+ display: inline-block;
101
+ }
css/style.css DELETED
@@ -1,40 +0,0 @@
1
- #woocommerce-delivery-notes-box .inside {
2
- text-align: left;
3
- position: relative;
4
- }
5
- #woocommerce-delivery-notes-box .inside ul {
6
- overflow: hidden;
7
- margin: 0px;
8
- }
9
- #woocommerce-delivery-notes-box .inside ul li {
10
- float: left;
11
- margin: 3px;
12
- }
13
- #woocommerce-delivery-notes-box .inside img.loading {
14
- position: absolute;
15
- right: 7px;
16
- top: 0px;
17
- }
18
- #woocommerce-delivery-notes-box .inside img.loading,
19
- .type-shop_order .column-order_actions img.loading {
20
- display: none;
21
- vertical-align: middle;
22
- }
23
- .type-shop_order .column-order_actions img.loading {
24
- float: left;
25
- margin-top: 3px;
26
- }
27
- .type-shop_order .column-order_actions .print-preview-button span {
28
- display: none;
29
- }
30
- #company-logo-placeholder {
31
- display: block;
32
- }
33
- #company-logo-placeholder.loading {
34
- background-image: url("../../../../wp-admin/images/wpspin_light.gif");
35
- background-repeat: no-repeat;
36
- height: 20px;
37
- }
38
- #company-logo-placeholder img {
39
- cursor: pointer;
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fonts/icons.eot ADDED
Binary file
fonts/icons.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="icons" horiz-adv-x="1000" >
7
+ <font-face font-family="icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="delivery-note" unicode="&#xe800;" d="m701 850h-581v-1000h760v825l-179 175z m119-940h-640v880h490v-150h150v-730z m-540 500h440v60h-440v-60z m0-160h440v60h-440v-60z m0-160h440v60h-440v-60z" horiz-adv-x="1000" />
10
+ <glyph glyph-name="invoice" unicode="&#xe801;" d="m701 850h-581v-1000h760v825l-179 175z m119-940h-640v880h490v-150h150v-730z m-310 449v164c30-9 51-24 66-52l55 32c-26 47-61 76-121 81v66h-30v-66c-70-5-127-69-127-138c0-68 46-100 101-128l26-13v-210c-60 8-89 40-101 99l-63-13c13-81 84-146 164-147v-64h30v64c80 10 137 88 137 164c0 86-67 130-137 161z m-30 16c-40 14-65 35-65 76c0 37 25 67 65 72v-148z m30-275v189c40-20 74-47 74-94c0-45-24-86-74-95z" horiz-adv-x="1000" />
11
+ </font>
12
+ </defs>
13
+ </svg>
fonts/icons.ttf ADDED
Binary file
fonts/icons.woff ADDED
Binary file
images/print-delivery-note.png DELETED
Binary file
images/print-invoice.png DELETED
Binary file
includes/class-wcdn-print.php ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Print class
5
+ */
6
+ if ( ! class_exists( 'WooCommerce_Delivery_Notes_Print' ) ) {
7
+
8
+ class WooCommerce_Delivery_Notes_Print {
9
+
10
+ public $template_directory_name;
11
+ public $template_path_theme;
12
+ public $template_path_plugin;
13
+ public $template_url_plugin;
14
+
15
+ public $api_endpoints;
16
+ public $query_vars;
17
+ public $template_types;
18
+ public $template_type;
19
+
20
+ public $order_ids;
21
+ public $order_email;
22
+ public $orders;
23
+
24
+ /**
25
+ * Constructor
26
+ */
27
+ public function __construct() {
28
+ // Set the default variables
29
+ $this->template_types = array(
30
+ 'invoice',
31
+ 'delivery-note',
32
+ 'order'
33
+ );
34
+
35
+ $this->api_endpoints = array(
36
+ 'print-order' => get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'print_order_page_endpoint', 'print-order' )
37
+
38
+ );
39
+
40
+ $this->query_vars = array(
41
+ 'print-order-type',
42
+ 'print-order-email'
43
+ );
44
+
45
+ // Load the hooks
46
+ add_action( 'init', array( $this, 'load_hooks' ) );
47
+ add_filter( 'query_vars', array( $this, 'add_query_vars' ) );
48
+ add_action( 'parse_request', array( $this, 'parse_request' ) );
49
+ add_action( 'template_redirect', array( $this, 'template_redirect_theme' ) );
50
+ add_action( 'wp_ajax_print_order', array( $this, 'template_redirect_admin' ) );
51
+ }
52
+
53
+ /**
54
+ * Load the init hooks
55
+ */
56
+ public function load_hooks() {
57
+ // Define default variables
58
+ $this->template_directory_name = 'print-order';
59
+ $this->template_path_theme = WC_TEMPLATE_PATH . $this->template_directory_name . '/';
60
+ $this->template_path_plugin = WooCommerce_Delivery_Notes::$plugin_path . 'templates/' . $this->template_directory_name . '/';
61
+ $this->template_url_plugin = WooCommerce_Delivery_Notes::$plugin_url . 'templates/' . $this->template_directory_name . '/';
62
+
63
+ // Add the endpoints
64
+ $this->add_endpoints();
65
+ }
66
+
67
+ /**
68
+ * Add endpoints for query vars.
69
+ * the endpoint is used in the front-end to
70
+ * generate the print template and link.
71
+ */
72
+ public function add_endpoints() {
73
+ foreach( $this->api_endpoints as $var ) {
74
+ add_rewrite_endpoint( $var, EP_PAGES );
75
+ }
76
+
77
+ // Flush the rules when the transient is set.
78
+ // This is important to make the endpoint work.
79
+ if( get_transient( WooCommerce_Delivery_Notes::$plugin_prefix . 'flush_rewrite_rules' ) == true ) {
80
+ delete_transient( WooCommerce_Delivery_Notes::$plugin_prefix . 'flush_rewrite_rules' );
81
+ flush_rewrite_rules();
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Add the query vars when no permalink structures aren't supported.
87
+ */
88
+ public function add_query_vars( $vars ) {
89
+ foreach( $this->query_vars as $var ) {
90
+ $vars[] = $var;
91
+ }
92
+ return $vars;
93
+ }
94
+
95
+ /**
96
+ * Parse the query variables
97
+ */
98
+ public function parse_request( $wp ) {
99
+ // Map endpoint keys to their query var keys, or get them if there is no permalink structure.
100
+ foreach( $this->api_endpoints as $key => $var ) {
101
+ if( isset( $_GET[$var] ) ) {
102
+ $wp->query_vars[$key] = $_GET[$var];
103
+ } elseif ( isset( $wp->query_vars[$var] ) ) {
104
+ $wp->query_vars[$key] = $wp->query_vars[$var];
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Template handling in the front-end
111
+ */
112
+ public function template_redirect_theme() {
113
+ global $wp;
114
+ // Check the page url and display the template when on my-account page
115
+ if( !empty( $wp->query_vars['print-order'] ) && is_account_page() ) {
116
+ $type = !empty( $wp->query_vars['print-order-type'] ) ? $wp->query_vars['print-order-type'] : null;
117
+ $email = !empty( $wp->query_vars['print-order-email'] ) ? $wp->query_vars['print-order-email'] : null;
118
+ $this->generate_template( $wp->query_vars['print-order'], $type, $email );
119
+ exit;
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Template handling in the back-end
125
+ */
126
+ public function template_redirect_admin() {
127
+ // Let the backend only access the page
128
+ if( is_admin() && !empty( $_REQUEST['print-order'] ) && !empty( $_REQUEST['action'] ) ) {
129
+ $type = !empty( $_REQUEST['print-order-type'] ) ? $_REQUEST['print-order-type'] : null;
130
+ $email = !empty( $_REQUEST['print-order-email'] ) ? $_REQUEST['print-order-email'] : null;
131
+ $this->generate_template( $_GET['print-order'], $type, $email );
132
+ exit;
133
+ }
134
+ exit;
135
+ }
136
+
137
+ /**
138
+ * Generate the template
139
+ */
140
+ public function generate_template( $order_ids, $template_type = 'order', $order_email = null ) {
141
+ global $post, $wp;
142
+
143
+ // Explode the ids when needed
144
+ if( !is_array( $order_ids ) ) {
145
+ $this->order_ids = array_filter( explode('-', $order_ids ) );
146
+ }
147
+
148
+ // Default type
149
+ if( empty( $template_type ) || !in_array( $template_type, $this->template_types ) ) {
150
+ $this->template_type = 'order';
151
+ } else {
152
+ $this->template_type = $template_type;
153
+ }
154
+
155
+ // Default email
156
+ if( empty( $order_email ) ) {
157
+ $this->order_email = null;
158
+ } else {
159
+ $this->order_email = strtolower( $order_email );
160
+ }
161
+
162
+ // Create the orders and check permissions
163
+ $populated = $this->populate_orders();
164
+
165
+ // Only continue if the orders are populated
166
+ if( !$populated ) {
167
+ die();
168
+ }
169
+
170
+ // Load the print template html
171
+ wc_get_template( 'print-order.php', null, $this->template_path_theme, $this->template_path_plugin );
172
+ exit;
173
+ }
174
+
175
+ /**
176
+ * Get print page url
177
+ */
178
+ public function get_print_page_url( $order_ids, $template_type = 'order', $order_email = null ) {
179
+ // Explode the ids when needed
180
+ if( !is_array( $order_ids ) ) {
181
+ $order_ids = array_filter( explode( '-', $order_ids ) );
182
+ }
183
+
184
+ // Default args
185
+ $args = array();
186
+
187
+ if( in_array( $template_type, $this->template_types ) && $template_type != 'order' ) {
188
+ $args = wp_parse_args( array( 'print-order-type' => $template_type ), $args );
189
+ }
190
+
191
+ if( !empty( $order_email ) ) {
192
+ $args = wp_parse_args( array( 'print-order-email' => $order_email ), $args );
193
+ }
194
+
195
+ // Generate the url
196
+ $order_ids_slug = implode( '-', $order_ids );
197
+
198
+ // Create another url depending on where the user prints. This
199
+ // prevents some issues with ssl when the my-account page is
200
+ // secured with ssl but the admin isn't.
201
+ // wp_nonce_url( admin_url( 'admin-ajax.php?action=print_order_admin&template_type=invoice&order_id=' . $post_id ), 'generate_print_content' );
202
+ if( is_admin() ) {
203
+ // For the admin
204
+ $args = wp_parse_args( array( 'action' => 'print_order' ), $args );
205
+ $base_url = admin_url( 'admin-ajax.php' );
206
+ $endpoint = 'print-order';
207
+
208
+ // Add the order ids and create the url
209
+ $url = add_query_arg( $endpoint, $order_ids_slug, $base_url );
210
+ } else {
211
+ // For the theme
212
+ $base_url = get_permalink( wc_get_page_id( 'myaccount' ) );
213
+ $endpoint = $this->api_endpoints['print-order'];
214
+
215
+ // Add the order ids and create the url
216
+ if( get_option( 'permalink_structure' ) ) {
217
+ $url = trailingslashit( trailingslashit( $base_url ) . $endpoint . '/' . $order_ids_slug );
218
+ } else {
219
+ $url = add_query_arg( $endpoint, $order_ids_slug, $base_url );
220
+ }
221
+ }
222
+
223
+ // Add all other args
224
+ $url = add_query_arg( $args, $url );
225
+
226
+ return $url;
227
+ }
228
+
229
+ /**
230
+ * Get the template url for a file. locate by file existence
231
+ * and then return the corresponding url.
232
+ */
233
+ public function get_template_url( $name ) {
234
+ $child_theme_path = get_stylesheet_directory() . '/' . $this->template_path_theme;
235
+ $child_theme_uri = get_stylesheet_directory_uri() . '/' . $this->template_path_theme;
236
+ $theme_path = get_template_directory() . '/' . $this->template_path_theme;
237
+ $theme_uri = get_template_directory_uri() . '/' . $this->template_path_theme;
238
+
239
+ // buld the url depenind on where the file is
240
+ if( file_exists( $child_theme_path . $name ) ) {
241
+ $uri = $child_theme_uri . $name;
242
+ } elseif( file_exists( $theme_path . $name ) ) {
243
+ $uri = $theme_uri . $name;
244
+ } else {
245
+ $uri = $this->template_url_plugin . $name;
246
+ }
247
+
248
+ return $uri;
249
+ }
250
+
251
+ /**
252
+ * Create the orders list and check the permissions
253
+ */
254
+ private function populate_orders() {
255
+ $this->orders = array();
256
+
257
+ // Get the orders
258
+ $args = array(
259
+ 'posts_per_page' => -1,
260
+ 'post_type' => 'shop_order',
261
+ 'post_status' => 'publish',
262
+ 'post__in' => $this->order_ids,
263
+ 'orderby' => 'post__in'
264
+ );
265
+ $posts = get_posts( $args );
266
+
267
+ // All orders should exist
268
+ if( count( $posts ) !== count( $this->order_ids ) ) {
269
+ $this->orders = null;
270
+ return false;
271
+ }
272
+
273
+ // Check permissons of the user to determine
274
+ // if the orders should be populated.
275
+ foreach( $posts as $post ) {
276
+ $order = new WC_Order( $post->ID );
277
+
278
+ // Logged in users
279
+ if( is_user_logged_in() && ( !current_user_can( 'edit_shop_orders' ) && !current_user_can( 'view_order', $order->id ) ) ) {
280
+ $this->orders = null;
281
+ return false;
282
+ }
283
+
284
+ // An email is required for not logged in users
285
+ if( !is_user_logged_in() && ( empty( $this->order_email ) || strtolower( $order->billing_email ) != $this->order_email ) ) {
286
+ $this->orders = null;
287
+ return false;
288
+ }
289
+
290
+ // Save the order to get it without an additional database call
291
+ $this->orders[$post->ID] = $order;
292
+ }
293
+ return true;
294
+ }
295
+
296
+ /**
297
+ * Get the order
298
+ */
299
+ public function get_order( $order_id ) {
300
+ if( isset( $this->orders[$order_id] ) ) {
301
+ return $this->orders[$order_id];
302
+ }
303
+ return;
304
+ }
305
+
306
+ }
307
+
308
+ }
309
+
310
+ ?>
includes/class-wcdn-settings.php ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Settings class
5
+ */
6
+ if ( !class_exists( 'WooCommerce_Delivery_Notes_Settings' ) ) {
7
+
8
+ class WooCommerce_Delivery_Notes_Settings {
9
+
10
+ public $tab_name;
11
+ public $hidden_submit;
12
+
13
+ /**
14
+ * Constructor
15
+ */
16
+ public function __construct() {
17
+ // Define default variables
18
+ $this->tab_name = 'woocommerce-delivery-notes';
19
+ $this->hidden_submit = WooCommerce_Delivery_Notes::$plugin_prefix . 'submit';
20
+
21
+ // Load the hooks
22
+ add_action( 'admin_init', array( $this, 'load_admin_hooks' ) );
23
+ }
24
+
25
+ /**
26
+ * Load the admin hooks
27
+ */
28
+ public function load_admin_hooks() {
29
+ add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_tab' ), 100 );
30
+ add_action( 'woocommerce_settings_tabs_' . $this->tab_name, array( $this, 'create_settings_page' ) );
31
+ add_action( 'woocommerce_update_options_' . $this->tab_name, array( $this, 'save_settings_page' ) );
32
+ add_action( 'current_screen', array( $this, 'load_screen_hooks' ) );
33
+ add_action( 'wp_ajax_load_thumbnail', array( $this, 'load_thumbnail_ajax' ) );
34
+ }
35
+
36
+ /**
37
+ * Add the scripts
38
+ */
39
+ public function load_screen_hooks() {
40
+ $screen = get_current_screen();
41
+
42
+ if( $this->is_settings_page() ) {
43
+ add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts' ) );
44
+ add_action( 'admin_enqueue_scripts', array( $this, 'add_styles' ) );
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Add the styles
50
+ */
51
+ public function add_styles() {
52
+ wp_enqueue_style( 'woocommerce-delivery-notes-admin', WooCommerce_Delivery_Notes::$plugin_url . 'css/admin.css' );
53
+ }
54
+
55
+ /**
56
+ * Add the scripts
57
+ */
58
+ public function add_scripts() {
59
+ wp_enqueue_media();
60
+ wp_enqueue_script( 'woocommerce-delivery-notes-print-link', WooCommerce_Delivery_Notes::$plugin_url . 'js/jquery.print-link.js', array( 'jquery' ) );
61
+ wp_enqueue_script( 'woocommerce-delivery-notes-admin', WooCommerce_Delivery_Notes::$plugin_url . 'js/admin.js', array( 'jquery', 'custom-header', 'woocommerce-delivery-notes-print-link' ) );
62
+ }
63
+
64
+ /**
65
+ * Check if we are on settings page
66
+ */
67
+ public function is_settings_page() {
68
+ if( isset( $_GET['page'] ) && isset( $_GET['tab'] ) && $_GET['tab'] == $this->tab_name ) {
69
+ return true;
70
+ } else {
71
+ return false;
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Check if sequential order plugin is activated
77
+ */
78
+ public function is_woocommerce_sequential_order_numbers_activated() {
79
+ if ( in_array( 'woocommerce-sequential-order-numbers/woocommerce-sequential-order-numbers.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
80
+ return true;
81
+ } else {
82
+ return false;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Add a tab to the settings page
88
+ */
89
+ public function add_settings_tab( $tabs ) {
90
+ $tabs[$this->tab_name] = __( 'Print', 'woocommerce-delivery-notes' );
91
+
92
+ return $tabs;
93
+ }
94
+
95
+ /**
96
+ * Load thumbnail with ajax
97
+ */
98
+ public function load_thumbnail_ajax() {
99
+ $attachment_id = (int)$_POST['attachment_id'];
100
+
101
+ // Verify the id
102
+ if( !$attachment_id ) {
103
+ die();
104
+ }
105
+
106
+ // create the thumbnail
107
+ $this->create_thumbnail( $attachment_id );
108
+
109
+ exit;
110
+ }
111
+
112
+ /**
113
+ * Create the thumbnail
114
+ */
115
+ public function create_thumbnail( $attachment_id ) {
116
+ $attachment_src = wp_get_attachment_image_src( $attachment_id, 'medium', false );
117
+
118
+ ?>
119
+ <img src="<?php echo $attachment_src[0]; ?>" alt="" />
120
+ <?php
121
+ }
122
+
123
+ /**
124
+ * Create the settings page content
125
+ */
126
+ public function create_settings_page() {
127
+ ?>
128
+ <h3><?php _e( 'Print Order', 'woocommerce-delivery-notes' ); ?></h3>
129
+ <p>
130
+ <?php
131
+ // show template preview links when an order is available
132
+ $args = array(
133
+ 'post_type' => 'shop_order',
134
+ 'posts_per_page' => 1
135
+ );
136
+ $query = new WP_Query( $args );
137
+
138
+ if($query->have_posts()) : ?>
139
+ <?php
140
+ $results = $query->get_posts();
141
+ $test_id = $results[0]->ID;
142
+ $invoice_url = wcdn_get_print_link( $test_id, 'invoice' );
143
+ $note_url = wcdn_get_print_link( $test_id, 'delivery-note' );
144
+ ?>
145
+ <input type="hidden" id="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>show_print_preview" />
146
+ <span class="description">
147
+ <?php printf( __( 'You can preview the <a href="%1$s" target="%3$s" class="%4$s">invoice template</a> or <a href="%2$s" target="%3$s" class="%4$s">delivery note template</a>.', 'woocommerce-delivery-notes' ), $invoice_url, $note_url, '_blank', '' ); ?>
148
+ <?php _e( 'With the FAQ in the readme file you can learn how to customize the template.', 'woocommerce-delivery-notes' ); ?>
149
+ </span>
150
+ <?php endif; ?>
151
+ </p>
152
+ <table class="form-table">
153
+ <tbody>
154
+ <tr class="hide-if-no-js">
155
+ <?php
156
+ $attachment_id = get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'company_logo_image_id' );
157
+ ?>
158
+ <th>
159
+ <label><?php _e( 'Company/Shop Logo', 'woocommerce-delivery-notes' ); ?></label>
160
+ </th>
161
+ <td>
162
+ <input id="company-logo-image-id" type="hidden" name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_logo_image_id" class="regular-text" value="<?php echo $attachment_id ?>" />
163
+ <div id="company-logo-placeholder"><?php if( !empty( $attachment_id ) ) : ?><?php $this->create_thumbnail( $attachment_id ); ?><?php endif; ?></div>
164
+ <div id="company-logo-buttons">
165
+ <a href="#" id="company-logo-remove-button" class="button" <?php if( empty( $attachment_id ) ) : ?>style="display: none;"<?php endif; ?>><?php _e( 'Remove Logo', 'woocommerce-delivery-notes' ); ?></a>
166
+ <a href="#" id="company-logo-add-button" class="button" <?php if( !empty( $attachment_id ) ) : ?>style="display: none;"<?php endif; ?> data-uploader-title="<?php echo esc_attr( __( 'Set Logo', 'woocommerce-delivery-notes' ) ); ?>" data-uploader-button-title="<?php echo esc_attr( __( 'Set Logo', 'woocommerce-delivery-notes' ) ); ?>"><?php _e( 'Set Logo', 'woocommerce-delivery-notes' ); ?></a>
167
+ <span id="company-logo-loader" class="spinner"></span>
168
+ </div>
169
+ <span class="description">
170
+ <?php _e( 'A company/shop logo representing your business.', 'woocommerce-delivery-notes' ); ?>
171
+ <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
172
+ <?php _e( 'When the image is printed, its pixel density will automatically be eight times higher than the original. This means, 1 printed inch will correspond to about 288 pixels on the screen. Example: an image with a width of 576 pixels and a height of 288 pixels will have a printed size of about 2 inches to 1 inch.', 'woocommerce-delivery-notes' ); ?>
173
+ </span>
174
+ </td>
175
+ </tr>
176
+ <tr>
177
+ <th>
178
+ <label><?php _e( 'Company/Shop Name', 'woocommerce-delivery-notes' ); ?></label>
179
+ </th>
180
+ <td>
181
+ <input type="text" name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>custom_company_name" class="large-text" value="<?php echo stripslashes( wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'custom_company_name' ) ) ); ?>" />
182
+ <span class="description">
183
+ <?php _e( 'Your company/shop name for the Delivery Note.', 'woocommerce-delivery-notes' ); ?>
184
+ <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
185
+ <?php _e( 'Leave blank to use the default Website/Blog title defined in WordPress settings. The name will be ignored when a Logo is set.', 'woocommerce-delivery-notes' ); ?>
186
+ </span>
187
+ </td>
188
+ </tr>
189
+ <tr>
190
+ <th>
191
+ <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_address"><?php _e( 'Company/Shop Address', 'woocommerce-delivery-notes' ); ?></label>
192
+ </th>
193
+ <td>
194
+ <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>company_address" rows="5" class="large-text"><?php echo stripslashes( wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'company_address' ) ) ); ?></textarea>
195
+ <span class="description">
196
+ <?php _e( 'The postal address of the company/shop or even e-mail or telephone, which gets printed right after the company/shop name.', 'woocommerce-delivery-notes' ); ?>
197
+ <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
198
+ <?php _e('Leave blank to not print an address.', 'woocommerce-delivery-notes' ); ?>
199
+ </span>
200
+ </td>
201
+ </tr>
202
+ <tr>
203
+ <th>
204
+ <label><?php _e( 'Complimentary close', 'woocommerce-delivery-notes' ); ?></label>
205
+ </th>
206
+ <td>
207
+ <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>personal_notes" rows="5" class="large-text"><?php echo stripslashes( wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'personal_notes' ) ) ); ?></textarea>
208
+ <span class="description">
209
+ <?php _e( 'Add some personal notes, or season greetings or whatever (e.g. Thank You for Your Order!, Merry Christmas!, etc.).', 'woocommerce-delivery-notes' ); ?>
210
+ <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
211
+ <?php _e('Leave blank to not print any personal notes.', 'woocommerce-delivery-notes' ); ?>
212
+ </span>
213
+ </td>
214
+ </tr>
215
+ <tr>
216
+ <th>
217
+ <label><?php _e( 'Returns Policy, Conditions, etc', 'woocommerce-delivery-notes' ); ?></label>
218
+ </th>
219
+ <td>
220
+ <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>policies_conditions" rows="5" class="large-text"><?php echo stripslashes( wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'policies_conditions' ) ) ); ?></textarea>
221
+ <span class="description">
222
+ <?php _e( 'Here you can add some more policies, conditions etc. For example add a returns policy in case the client would like to send back some goods. In some countries (e.g. in the European Union) this is required so please add any required info in accordance with the statutory regulations.', 'woocommerce-delivery-notes' ); ?>
223
+ <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
224
+ <?php _e('Leave blank to not print any policies or conditions.', 'woocommerce-delivery-notes' ); ?>
225
+ </span>
226
+ </td>
227
+ </tr>
228
+ <tr>
229
+ <th>
230
+ <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>footer_imprint"><?php _e( 'Footer', 'woocommerce-delivery-notes' ); ?></label>
231
+ </th>
232
+ <td>
233
+ <textarea name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>footer_imprint" rows="5" class="large-text"><?php echo stripslashes( wp_kses_stripslashes( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'footer_imprint' ) ) ); ?></textarea>
234
+ <span class="description">
235
+ <?php _e( 'Add some further footer imprint, e-mail, telephone, copyright notes etc. This makes the printed sheets a bit more branded.', 'woocommerce-delivery-notes' ); ?>
236
+ <strong><?php _e( 'Note:', 'woocommerce-delivery-notes' ); ?></strong>
237
+ <?php _e('Leave blank to not print a footer.', 'woocommerce-delivery-notes' ); ?>
238
+ </span>
239
+ </td>
240
+ </tr>
241
+ </tbody>
242
+ </table>
243
+
244
+ <h3><?php _e( 'Options', 'woocommerce-delivery-notes' ); ?></h3>
245
+ <table class="form-table">
246
+ <tbody>
247
+ <tr>
248
+ <th>
249
+ <label><?php _e( 'Print Page Endpoint', 'woocommerce-delivery-notes' ); ?></label>
250
+ </th>
251
+ <td>
252
+ <p>
253
+ <input type="text" name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>print_order_page_endpoint" value="<?php echo get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'print_order_page_endpoint' ); ?>" />
254
+ </p>
255
+ <span class="description">
256
+ <?php _e( 'The endpoint is appended to the accounts page URL to print the order. It should be unique.', 'woocommerce-delivery-notes' ); ?>
257
+ </span>
258
+ </td>
259
+ </tr>
260
+ <tr>
261
+ <th>
262
+ <?php _e( 'Theme Print Buttons', 'woocommerce-delivery-notes' ); ?>
263
+ </th>
264
+ <td>
265
+ <fieldset>
266
+ <label>
267
+ <input name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>print_button_on_view_order_page" type="hidden" value="" />
268
+ <input name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>print_button_on_view_order_page" type="checkbox" value="1" <?php checked( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'print_button_on_view_order_page' ), 1 ); ?> />
269
+ <?php _e( 'Show print button on the "View Order" page', 'woocommerce-delivery-notes' ); ?>
270
+ </label>
271
+ </fieldset>
272
+ <fieldset>
273
+ <label>
274
+ <input name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>print_button_on_my_account_page" type="hidden" value="" />
275
+ <input name="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>print_button_on_my_account_page" type="checkbox" value="1" <?php checked( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'print_button_on_my_account_page' ), 1 ); ?> />
276
+ <?php _e( 'Show print buttons on the "My Account" page', 'woocommerce-delivery-notes' ); ?>
277
+ </label>
278
+ </fieldset>
279
+ </td>
280
+ </tr>
281
+ </tbody>
282
+ </table>
283
+
284
+ <h3><?php _e( 'Order Numbering', 'woocommerce-delivery-notes' ); ?></h3>
285
+ <table class="form-table">
286
+ <tbody>
287
+ <tr>
288
+ <th>
289
+ <label for="<?php echo WooCommerce_Delivery_Notes::$plugin_prefix; ?>order_number_offset"><?php _e( 'Sequential order number', 'woocommerce-delivery-notes' ); ?></label>
290
+ </th>
291
+ <td>
292
+ <?php if( $this->is_woocommerce_sequential_order_numbers_activated() ) : ?>
293
+ <?php _e( 'Sequential numbering is enabled.', 'woocommerce-delivery-notes' ); ?>
294
+ <?php else : ?>
295
+ <?php printf( __( 'Install and activate the free <a href="%s">WooCommerce Sequential Order Numbers</a> Plugin.', 'woocommerce-delivery-notes' ), 'http://wordpress.org/extend/plugins/woocommerce-sequential-order-numbers/' ); ?>
296
+ <?php endif; ?>
297
+ </td>
298
+ </tr>
299
+ </tbody>
300
+ </table>
301
+
302
+ <input type="hidden" name="<?php echo $this->hidden_submit; ?>" value="submitted">
303
+ <?php
304
+ }
305
+
306
+ /**
307
+ * Save all settings
308
+ */
309
+ public function save_settings_page() {
310
+ if ( isset( $_POST[ $this->hidden_submit ] ) && $_POST[ $this->hidden_submit ] == 'submitted' ) {
311
+
312
+ // Save settings
313
+ foreach ( $_POST as $key => $value ) {
314
+ if ( $key != $this->hidden_submit && strpos( $key, WooCommerce_Delivery_Notes::$plugin_prefix ) !== false ) {
315
+ // set a default values
316
+ if ( empty( $value ) ) {
317
+ if ( $key == WooCommerce_Delivery_Notes::$plugin_prefix . 'print_order_page_endpoint' ) {
318
+ $value = 'print-order';
319
+ }
320
+ }
321
+
322
+ // sanitize values
323
+ if ( $key == WooCommerce_Delivery_Notes::$plugin_prefix . 'print_order_page_endpoint' ) {
324
+ $value = sanitize_title( $value );
325
+ }
326
+
327
+ // update the value
328
+ if ( empty( $value ) ) {
329
+ delete_option( $key );
330
+ } else {
331
+ if ( get_option( $key ) && get_option( $key ) != $value ) {
332
+ update_option( $key, $value );
333
+ }
334
+ else {
335
+ add_option( $key, $value );
336
+ }
337
+ }
338
+ }
339
+ }
340
+
341
+ // Flush permalink structs with
342
+ set_transient( WooCommerce_Delivery_Notes::$plugin_prefix . 'flush_rewrite_rules', true );
343
+ }
344
+ }
345
+
346
+ }
347
+
348
+ }
349
+
350
+ ?>
includes/class-wcdn-theme.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Frontend Theme class
5
+ */
6
+ if ( !class_exists( 'WooCommerce_Delivery_Notes_Theme' ) ) {
7
+
8
+ class WooCommerce_Delivery_Notes_Theme {
9
+
10
+ public $template_type;
11
+
12
+ /**
13
+ * Constructor
14
+ */
15
+ public function __construct() {
16
+ // Load the hooks
17
+ add_action( 'wp_loaded', array( $this, 'load_hooks' ) );
18
+ }
19
+
20
+ /**
21
+ * Load the hooks at the end when
22
+ * the theme and plugins are ready.
23
+ */
24
+ public function load_hooks() {
25
+ // Define defaults
26
+ $this->template_type = apply_filters( 'wcdn_theme_print_button_template_type', 'invoice' );
27
+
28
+ // hooks
29
+ add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'create_print_button_account_page' ), 10, 2 );
30
+ add_action( 'woocommerce_view_order', array( $this, 'create_print_button_order_page' ) );
31
+ add_action( 'woocommerce_thankyou', array( $this, 'create_print_button_order_page' ) );
32
+ add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts' ) );
33
+ }
34
+
35
+ /**
36
+ * Add the scripts
37
+ */
38
+ public function add_scripts() {
39
+ if ( is_account_page() || is_order_received_page() || $this->is_woocommerce_tracking_page() ) {
40
+ wp_enqueue_script( 'woocommerce-delivery-notes-print-link', WooCommerce_Delivery_Notes::$plugin_url . 'js/jquery.print-link.js', array( 'jquery' ) );
41
+ wp_enqueue_script( 'woocommerce-delivery-notes-theme', WooCommerce_Delivery_Notes::$plugin_url . 'js/theme.js', array( 'jquery', 'woocommerce-delivery-notes-print-link' ) );
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Create a print button for the 'My Account' page
47
+ */
48
+ public function create_print_button_account_page( $actions, $order ) {
49
+ if( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'print_button_on_my_account_page' ) ) {
50
+ $actions['print'] = array(
51
+ 'url' => wcdn_get_print_link( $order->id, $this->template_type ),
52
+ 'name' => __( 'Print', 'woocommerce-delivery-notes' )
53
+ );
54
+ }
55
+ return $actions;
56
+ }
57
+
58
+ /**
59
+ * Create a print button for the 'View Order' page
60
+ */
61
+ public function create_print_button_order_page( $order_id ) {
62
+ if( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'print_button_on_view_order_page' ) ) {
63
+ $print_url = wcdn_get_print_link( $order_id, $this->template_type );
64
+
65
+ // use a different url for the tracking page
66
+ if( $this->is_woocommerce_tracking_page() ) {
67
+ $print_url = wcdn_get_print_link( $order_id, $this->template_type, $_REQUEST['order_email'] );
68
+ }
69
+ ?>
70
+ <p class="order-print">
71
+ <a href="<?php echo $print_url; ?>" class="button print"><?php _e( 'Print', 'woocommerce-delivery-notes' ); ?></a>
72
+ </p>
73
+ <?php
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Is WooCommerce 'Order Tracking' page
79
+ */
80
+ public function is_woocommerce_tracking_page() {
81
+ return ( is_page( wc_get_page_id( 'order_tracking' ) ) && isset( $_REQUEST['order_email'] ) ) ? true : false;
82
+ }
83
+
84
+ }
85
+
86
+ }
87
+
88
+ ?>
includes/class-wcdn-writepanel.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Writepanel class
5
+ */
6
+ if ( !class_exists( 'WooCommerce_Delivery_Notes_Writepanel' ) ) {
7
+
8
+ class WooCommerce_Delivery_Notes_Writepanel {
9
+
10
+ /**
11
+ * Constructor
12
+ */
13
+ public function __construct() {
14
+ // Load the hooks
15
+ add_action( 'admin_init', array( $this, 'load_admin_hooks' ) );
16
+ }
17
+
18
+ /**
19
+ * Load the admin hooks
20
+ */
21
+ public function load_admin_hooks() {
22
+ add_action( 'woocommerce_admin_order_actions_end', array( $this, 'add_listing_actions' ) );
23
+ add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts' ) );
24
+ add_action( 'admin_enqueue_scripts', array( $this, 'add_styles' ) );
25
+
26
+ add_action( 'add_meta_boxes_shop_order', array( $this, 'add_box' ) );
27
+
28
+ add_action( 'admin_footer-edit.php', array( $this, 'add_bulk_actions' ) );
29
+ add_action( 'load-edit.php', array( $this, 'load_bulk_actions' ) );
30
+ add_action( 'admin_notices', array( $this, 'confirm_bulk_actions' ) );
31
+ }
32
+
33
+ /**
34
+ * Add the styles
35
+ */
36
+ public function add_styles() {
37
+ if( $this->is_order_edit_page() || $this->is_order_post_page() ) {
38
+ wp_enqueue_style('thickbox');
39
+ wp_enqueue_style( 'woocommerce-delivery-notes-admin', WooCommerce_Delivery_Notes::$plugin_url . 'css/admin.css' );
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Add the scripts
45
+ */
46
+ public function add_scripts() {
47
+ if( $this->is_order_edit_page() || $this->is_order_post_page() ) {
48
+ wp_enqueue_script( 'thickbox' );
49
+ wp_enqueue_script( 'woocommerce-delivery-notes-print-link', WooCommerce_Delivery_Notes::$plugin_url . 'js/jquery.print-link.js', array( 'jquery' ) );
50
+ wp_enqueue_script( 'woocommerce-delivery-notes-admin', WooCommerce_Delivery_Notes::$plugin_url . 'js/admin.js', array( 'jquery', 'woocommerce-delivery-notes-print-link', 'thickbox' ) );
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Is order edit page
56
+ */
57
+ public function is_order_edit_page() {
58
+ global $typenow, $pagenow;
59
+ if( $typenow == 'shop_order' && $pagenow == 'edit.php' ) {
60
+ return true;
61
+ } else {
62
+ return false;
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Is order edit page
68
+ */
69
+ public function is_order_post_page() {
70
+ global $typenow, $pagenow;
71
+ if( $typenow == 'shop_order' && ( $pagenow == 'post.php' || $pagenow == 'post-new.php' ) ) {
72
+ return true;
73
+ } else {
74
+ return false;
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Add print actions to the orders listing
80
+ */
81
+ public function add_listing_actions( $order ) {
82
+ ?>
83
+ <a href="<?php echo wcdn_get_print_link( $order->id, 'invoice' ); ?>" class="button tips print-preview-button invoice" target="_blank" alt="<?php esc_attr_e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>" data-tip="<?php esc_attr_e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>">
84
+ <?php _e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>
85
+ </a>
86
+ <a href="<?php echo wcdn_get_print_link( $order->id, 'delivery-note' ); ?>" class="button tips print-preview-button delivery-note" target="_blank" alt="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>" data-tip="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>">
87
+ <?php _e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>
88
+ </a>
89
+ <span class="print-preview-loading spinner"></span>
90
+ <?php
91
+ }
92
+
93
+ /**
94
+ * Add bulk actions with javascript to the dropdown.
95
+ * This is not so pretty but WordPress does not yet
96
+ * offer any better solution. The JS code is inline
97
+ * because we can't determine the page without
98
+ * checking the post_type.
99
+ * https://core.trac.wordpress.org/ticket/16031
100
+ */
101
+ public function add_bulk_actions() {
102
+ if( $this->is_order_edit_page() ) : ?>
103
+ <script type="text/javascript">
104
+ jQuery(document).ready(function($) {
105
+ $('<option>').val('wcdn_print_invoice').attr('title', 'invoice').text('<?php echo esc_js( __( 'Print Invoice', 'woocommerce-delivery-notes' ) ); ?>').appendTo('select[name="action"]');
106
+ $('<option>').val('wcdn_print_invoice').attr('title', 'invoice').text('<?php echo esc_js( __( 'Print Invoice', 'woocommerce-delivery-notes' ) ); ?>').appendTo('select[name="action2"]');
107
+
108
+ $('<option>').val('wcdn_print_delivery_note').attr('title', 'delivery-note').text('<?php echo esc_js( __( 'Print Delivery Note', 'woocommerce-delivery-notes' ) ); ?>').appendTo('select[name="action"]');
109
+ $('<option>').val('wcdn_print_delivery_note').attr('title', 'delivery-note').text('<?php echo esc_js( __( 'Print Delivery Note', 'woocommerce-delivery-notes' ) ); ?>').appendTo('select[name="action2"]');
110
+ });
111
+ </script>
112
+ <?php endif;
113
+ }
114
+
115
+ /**
116
+ * Add bulk print actions to the orders listing
117
+ */
118
+ public function load_bulk_actions() {
119
+ if( $this->is_order_edit_page() ) {
120
+ // get the action staht should be started
121
+ $wp_list_table = _get_list_table('WP_Posts_List_Table');
122
+ $action = $wp_list_table->current_action();
123
+
124
+ // stop if there are no post ids
125
+ if( !isset( $_REQUEST['post'] ) ) {
126
+ return;
127
+ }
128
+
129
+ // only for specified actions
130
+ switch ( $action ) {
131
+ case 'wcdn_print_invoice':
132
+ $template_type = 'invoice';
133
+ $report_action = 'printed_invoice';
134
+ break;
135
+ case 'wcdn_print_delivery_note':
136
+ $template_type = 'delivery-note';
137
+ $report_action = 'printed_delivery_note';
138
+ break;
139
+ default:
140
+ return;
141
+ }
142
+
143
+ // do the action
144
+ $post_ids = array_map( 'absint', (array) $_REQUEST['post'] );
145
+ $total = count( $post_ids );
146
+ $url = wcdn_get_print_link( $post_ids , $template_type );
147
+ $sendback = add_query_arg( array( 'post_type' => 'shop_order', $report_action => true, 'total' => $total, 'print_url' => urlencode( $url ) ), '' );
148
+
149
+ wp_redirect( $sendback );
150
+ exit;
151
+ }
152
+ }
153
+
154
+ /**
155
+ * Show confirmation message that orders are printed
156
+ */
157
+ public function confirm_bulk_actions() {
158
+ if( $this->is_order_edit_page() ) {
159
+ if ( isset( $_REQUEST['printed_delivery_note'] ) || isset( $_REQUEST['printed_invoice'] ) ) {
160
+ $total = isset( $_REQUEST['total'] ) ? absint( $_REQUEST['total'] ) : 0;
161
+
162
+ // Confirmation message
163
+ if( isset( $_REQUEST['printed_invoice'] ) ) {
164
+ $message = sprintf( _n( 'Invoice created.', '%s invoices created.', $total, 'woocommerce-delivery-notes' ), number_format_i18n( $total ) );
165
+ } elseif( isset( $_REQUEST['printed_delivery_note'] ) ) {
166
+ $message = sprintf( _n( 'Delivery note created.', '%s delivery notes created.', $total, 'woocommerce-delivery-notes' ), number_format_i18n( $total ) );
167
+ }
168
+ ?>
169
+ <div id="woocommerce-delivery-notes-bulk-print-message" class="updated">
170
+ <p><?php echo $message; ?> <a href="<?php echo urldecode( $_REQUEST['print_url'] ); ?>" target="_blank" class="print-preview-button" id="woocommerce-delivery-notes-bulk-print-button"><?php _e( 'Print now', 'woocommerce-delivery-notes' ) ?></a> <span class="print-preview-loading spinner"></span></p>
171
+ </div>
172
+ <?php
173
+ }
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Add the meta box on the single order page
179
+ */
180
+ public function add_box() {
181
+ add_meta_box( 'woocommerce-delivery-notes-box', __( 'Order Printing', 'woocommerce-delivery-notes' ), array( $this, 'create_box_content' ), 'shop_order', 'side', 'low' );
182
+ }
183
+
184
+ /**
185
+ * Create the meta box content on the single order page
186
+ */
187
+ public function create_box_content() {
188
+ global $post_id;
189
+ ?>
190
+ <a href="<?php echo wcdn_get_print_link( $post_id, 'invoice' ); ?>" class="button print-preview-button" target="_blank" alt="<?php esc_attr_e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?>"><?php _e( 'Print Invoice', 'woocommerce-delivery-notes' ); ?></a>
191
+ <a href="<?php echo wcdn_get_print_link( $post_id, 'delivery-note' ); ?>" class="button print-preview-button" target="_blank" alt="<?php esc_attr_e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?>"><?php _e( 'Print Delivery Note', 'woocommerce-delivery-notes' ); ?></a>
192
+ <span class="print-preview-loading spinner"></span>
193
+ <?php
194
+ }
195
+
196
+ }
197
+
198
+ }
199
+
200
+ ?>
includes/wcdn-template-functions.php ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Output the template part
5
+ */
6
+ function wcdn_get_template_content( $name, $args = null ) {
7
+ global $wcdn;
8
+ wc_get_template( $name, $args, $wcdn->print->template_path_theme, $wcdn->print->template_path_plugin );
9
+ }
10
+
11
+ /**
12
+ * Return Type of the print template
13
+ */
14
+ function wcdn_get_template_type() {
15
+ global $wcdn;
16
+ return apply_filters( 'wcdn_template_type', $wcdn->print->template_type );
17
+ }
18
+
19
+ /**
20
+ * Return print page link
21
+ */
22
+ function wcdn_get_print_link( $order_ids, $template_type = 'order', $order_email = null ) {
23
+ global $wcdn;
24
+ return $wcdn->print->get_print_page_url( $order_ids, $template_type, $order_email );
25
+ }
26
+
27
+ /**
28
+ * Output the document title depending on type
29
+ */
30
+ function wcdn_document_title() {
31
+ if( wcdn_get_template_type() == 'invoice' ) {
32
+ echo apply_filters( 'wcdn_document_title', __( 'Invoice', 'woocommerce-delivery-notes' ) );
33
+ } elseif( wcdn_get_template_type() == 'delivery-note' ) {
34
+ echo apply_filters( 'wcdn_document_title', __( 'Delivery Note', 'woocommerce-delivery-notes' ) );
35
+ } else {
36
+ echo apply_filters( 'wcdn_document_title', __( 'Order', 'woocommerce-delivery-notes' ) );
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Output the print navigation style
42
+ */
43
+ function wcdn_navigation_style() {
44
+ ?>
45
+ <style>
46
+ #navigation {
47
+ font-family: sans-serif;
48
+ background-color: #f1f1f1;
49
+ z-index: 200;
50
+ border-bottom: 1px solid #dfdfdf;
51
+ left: 0;
52
+ right: 0;
53
+ bottom: 0;
54
+ position: fixed;
55
+ padding: 6px 8px;
56
+ text-align: right;
57
+ }
58
+
59
+ #navigation .button {
60
+ transition-property: border, background, color;
61
+ display: inline-block;
62
+ font-size: 13px;
63
+ line-height: 26px;
64
+ height: 28px;
65
+ margin: 0;
66
+ padding: 0 10px 1px;
67
+ cursor: pointer;
68
+ border-width: 1px;
69
+ border-style: solid;
70
+ -webkit-border-radius: 3px;
71
+ -webkit-appearance: none;
72
+ border-radius: 3px;
73
+ white-space: nowrap;
74
+ -webkit-box-sizing: border-box;
75
+ -moz-box-sizing: border-box;
76
+ box-sizing: border-box;
77
+
78
+ background: #2ea2cc;
79
+ border-color: #0074a2;
80
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15);
81
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15);
82
+ color: #fff;
83
+ text-decoration: none;
84
+ }
85
+
86
+ #navigation .button:hover,
87
+ #navigation .button:focus {
88
+ background: #1e8cbe;
89
+ border-color: #0074a2;
90
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
91
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
92
+ color: #fff;
93
+ }
94
+
95
+ #navigation .button:active {
96
+ background: #1b7aa6;
97
+ border-color: #005684;
98
+ color: rgba(255,255,255,0.95);
99
+ -webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
100
+ box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
101
+ }
102
+
103
+ @media print {
104
+ #navigation {
105
+ display: none;
106
+ }
107
+ }
108
+ </style>
109
+ <?php
110
+ }
111
+
112
+ /**
113
+ * Create print navigation
114
+ */
115
+ function wcdn_navigation() {
116
+ ?>
117
+ <div id="navigation">
118
+ <a href="#" class="button" onclick="window.print();return false;"><?php _e( 'Print', 'woocommerce-delivery-notes' ); ?></a>
119
+ </div><!-- #navigation -->
120
+ <?php
121
+ }
122
+
123
+ /**
124
+ * Output template stylesheet
125
+ */
126
+ function wcdn_template_stylesheet() {
127
+ global $wcdn;
128
+ $name = apply_filters( 'wcdn_template_stylesheet_name', 'style.css' );
129
+ ?>
130
+ <link rel="stylesheet" href="<?php echo $wcdn->print->get_template_url( $name ); ?>" type="text/css" media="screen,print" />
131
+ <?php
132
+ }
133
+
134
+ /**
135
+ * Return logo id
136
+ */
137
+ function wcdn_get_company_logo_id() {
138
+ global $wcdn;
139
+ return apply_filters( 'wcdn_company_logo_id', get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'company_logo_image_id' ) );
140
+ }
141
+
142
+ /**
143
+ * Show logo html
144
+ */
145
+ function wcdn_company_logo() {
146
+ global $wcdn;
147
+ $attachment_id = wcdn_get_company_logo_id();
148
+ $company = get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'custom_company_name' );
149
+ if( $attachment_id ) {
150
+ $attachment_src = wp_get_attachment_image_src( $attachment_id, 'full', false );
151
+
152
+ // resize the image to a 1/4 of the original size
153
+ // to have a printing point density of about 288ppi.
154
+ ?>
155
+ <img src="<?php echo $attachment_src[0]; ?>" width="<?php echo $attachment_src[1] / 4; ?>" height="<?php echo $attachment_src[2] / 4; ?>" alt="<?php echo esc_attr( $company ); ?>" />
156
+ <?php
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Return default title name of Delivery Note
162
+ */
163
+ function wcdn_company_name() {
164
+ global $wcdn;
165
+ $name = trim( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'custom_company_name' ) );
166
+ if( !empty( $name ) ) {
167
+ echo apply_filters( 'wcdn_company_name', stripslashes( wptexturize( $name ) ) );
168
+ } else {
169
+ echo apply_filters( 'wcdn_company_name', get_bloginfo( 'name' ) );
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Return shop/company info if provided
175
+ */
176
+ function wcdn_company_info() {
177
+ global $wcdn;
178
+ echo wpautop( wptexturize( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'company_address' ) ) );
179
+ }
180
+
181
+ /**
182
+ * Get orders as array. Every order is a normal WC_Order instance.
183
+ */
184
+ function wcdn_get_orders() {
185
+ global $wcdn;
186
+ return $wcdn->print->orders;
187
+ }
188
+
189
+ /**
190
+ * Get an order
191
+ */
192
+ function wcdn_get_order( $order_id ) {
193
+ return $wcdn->print->get_order( $order_id );
194
+ }
195
+
196
+ /**
197
+ * Get the order info fields
198
+ */
199
+ function wcdn_get_order_info( $order ) {
200
+ $fields = array(
201
+ 'order_number' => array(
202
+ 'label' => __( 'Order Number', 'woocommerce-delivery-notes' ),
203
+ 'value' => $order->get_order_number()
204
+ ),
205
+ 'order_date' => array(
206
+ 'label' => __( 'Order Date', 'woocommerce-delivery-notes' ),
207
+ 'value' => date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) )
208
+ ),
209
+ 'payment_method' => array(
210
+ 'label' => __( 'Payment Method', 'woocommerce-delivery-notes' ),
211
+ 'value' => __( $order->payment_method_title, 'woocommerce' )
212
+ )
213
+ );
214
+
215
+ if( $order->billing_email ) {
216
+ $fields['billing_email'] = array(
217
+ 'label' => __( 'Email', 'woocommerce-delivery-notes' ),
218
+ 'value' => $order->billing_email
219
+ );
220
+ }
221
+
222
+ if( $order->billing_phone ) {
223
+ $fields['billing_phone'] = array(
224
+ 'label' => __( 'Telephone', 'woocommerce-delivery-notes' ),
225
+ 'value' => $order->billing_phone
226
+ );
227
+ }
228
+
229
+ return $fields;
230
+ }
231
+
232
+ /**
233
+ * Additional fields for the product
234
+ */
235
+ function wcdn_additional_product_fields( $fields = null, $product = null, $order ) {
236
+ $new_fields = array();
237
+
238
+ // Stock keeping unit
239
+ if( $product && $product->exists() && $product->get_sku() ) {
240
+ $fields[] = array(
241
+ 'label' => __( 'SKU:', 'woocommerce-delivery-notes' ),
242
+ 'value' => $product->get_sku()
243
+ );
244
+ }
245
+ return array_merge( $fields, $new_fields );
246
+ }
247
+
248
+ /**
249
+ * Remove the semicolon from the output
250
+ */
251
+ function wcdn_remove_semicolon_from_totals( $total_rows, $order ) {
252
+ foreach( $total_rows as $key => $row ) {
253
+ $label = $row['label'];
254
+ $colon = strrpos( $label, ':' );
255
+ if( $colon !== false ) {
256
+ $label = substr_replace( $label, '', $colon, 1 );
257
+ }
258
+ $total_rows[$key]['label'] = $label;
259
+ }
260
+ return $total_rows;
261
+ }
262
+
263
+ /**
264
+ * Return customer notes
265
+ */
266
+ function wcdn_get_customer_notes( $order ) {
267
+ global $wcdn;
268
+ return wpautop( wptexturize( $order->customer_note ) );
269
+ }
270
+
271
+ /**
272
+ * Show customer notes
273
+ */
274
+ function wcdn_customer_notes( $order ) {
275
+ global $wcdn;
276
+ echo wcdn_get_customer_notes( $order );
277
+ }
278
+
279
+ /**
280
+ * Return has customer notes
281
+ */
282
+ function wcdn_has_customer_notes( $order ) {
283
+ global $wcdn;
284
+ if( wcdn_get_customer_notes( $order ) ) {
285
+ return true;
286
+ } else {
287
+ return false;
288
+ }
289
+ }
290
+
291
+ /**
292
+ * Return personal notes, season greetings etc.
293
+ */
294
+ function wcdn_get_personal_notes() {
295
+ global $wcdn;
296
+ return wpautop( wptexturize( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'personal_notes' ) ) );
297
+ }
298
+
299
+ /**
300
+ * Show personal notes, season greetings etc.
301
+ */
302
+ function wcdn_personal_notes() {
303
+ global $wcdn;
304
+ echo wcdn_get_personal_notes();
305
+ }
306
+
307
+ /**
308
+ * Return policy for returns
309
+ */
310
+ function wcdn_get_policies_conditions() {
311
+ global $wcdn;
312
+ return wpautop( wptexturize( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'policies_conditions' ) ) );
313
+ }
314
+
315
+ /**
316
+ * Show policy for returns
317
+ */
318
+ function wcdn_policies_conditions() {
319
+ global $wcdn;
320
+ echo wcdn_get_policies_conditions();
321
+ }
322
+
323
+ /**
324
+ * Return shop/company footer imprint, copyright etc.
325
+ */
326
+ function wcdn_get_imprint() {
327
+ global $wcdn;
328
+ return wpautop( wptexturize( get_option( WooCommerce_Delivery_Notes::$plugin_prefix . 'footer_imprint' )) );
329
+ }
330
+
331
+ /**
332
+ * Show shop/company footer imprint, copyright etc.
333
+ */
334
+ function wcdn_imprint() {
335
+ global $wcdn;
336
+ echo wcdn_get_imprint();
337
+ }
338
+
339
+
340
+ ?>
includes/wcdn-template-hooks.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Header
5
+ */
6
+ add_action( 'wcdn_head', 'wcdn_navigation_style' );
7
+ add_action( 'wcdn_head', 'wcdn_template_stylesheet' );
8
+
9
+ /**
10
+ * Before page
11
+ */
12
+ add_action( 'wcdn_before_page', 'wcdn_navigation' );
13
+
14
+ /**
15
+ * Content
16
+ */
17
+ add_filter( 'woocommerce_get_order_item_totals', 'wcdn_remove_semicolon_from_totals', 10, 2 );
18
+ add_filter( 'wcdn_order_item_fields', 'wcdn_additional_product_fields', 10, 3);
19
+
20
+ ?>
js/admin.js ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ /*
4
+ * Print button
5
+ */
6
+
7
+ // Button on list and edit screen
8
+ $('.print-preview-button').printLink();
9
+ $('.print-preview-button').on('printLinkInit', function(event) {
10
+ $(this).parent().find('.print-preview-loading').show();
11
+ });
12
+ $('.print-preview-button').on('printLinkComplete', function(event) {
13
+ $('.print-preview-loading').hide();
14
+ });
15
+ $('.print-preview-button').on('printLinkError', function(event) {
16
+ $('.print-preview-loading').hide();
17
+ tb_show('', $(this).attr('href') + '&amp;TB_iframe=true&amp;width=800&amp;height=500');
18
+ });
19
+
20
+ /*
21
+ * Bulk actions print button in the confirm message
22
+ */
23
+ $(window).on('load', function(event) {
24
+ var bulkButton = $('#woocommerce-delivery-notes-bulk-print-button');
25
+ if( bulkButton.length > 0 ) {
26
+ bulkButton.trigger('click');
27
+ }
28
+ });
29
+
30
+ /*
31
+ * Settings
32
+ */
33
+
34
+ // Media managment
35
+ var media_modal;
36
+
37
+ // Button to open the media uploader
38
+ $('#company-logo-add-button, #company-logo-placeholder').on('click', function(event) {
39
+ event.preventDefault();
40
+
41
+ // If the modal already exists, reopen it.
42
+ if(media_modal) {
43
+ media_modal.open();
44
+ return;
45
+ }
46
+
47
+ // Create the modal.
48
+ media_modal = wp.media.frames.media_modal = wp.media({
49
+ title: $('#company-logo-add-button').data( 'uploader-title' ),
50
+ button: {
51
+ text: $('#company-logo-add-button').data( 'uploader-button-title' ),
52
+ },
53
+ multiple: false
54
+ });
55
+
56
+ // Open the modal.
57
+ media_modal.open();
58
+
59
+ // When an image is selected, run a callback.
60
+ media_modal.on( 'select', function(event) {
61
+ // We set multiple to false so only get one image from the uploader
62
+ var attachment = media_modal.state().get('selection').first().toJSON();
63
+
64
+ // Do something with attachment.id and/or attachment.url here
65
+ addImage(attachment.id);
66
+ });
67
+ });
68
+
69
+ // Button to remove the media
70
+ $('#company-logo-remove-button').on('click', function(event) {
71
+ event.preventDefault();
72
+ removeImage();
73
+ });
74
+
75
+ // add media
76
+ function addImage(id) {
77
+ removeImage();
78
+ $('#company-logo-loader').addClass('loading');
79
+
80
+ // load the image
81
+ var data = {
82
+ attachment_id: id,
83
+ action: 'load_thumbnail'
84
+ }
85
+
86
+ $.post(ajaxurl, data, function(response) {
87
+ $('#company-logo-image-id').val(data.attachment_id);
88
+ $('#company-logo-placeholder').html(response);
89
+ $('#company-logo-loader').removeClass('loading');
90
+ $('#company-logo-add-button').hide();
91
+ $('#company-logo-remove-button').show();
92
+ }).error(function() {
93
+ removeImage();
94
+ });
95
+
96
+ }
97
+
98
+ // remove media
99
+ function removeImage() {
100
+ $('#company-logo-image-id').val('');
101
+ $('#company-logo-placeholder').empty();
102
+ $('#company-logo-loader').removeClass('loading');
103
+ $('#company-logo-add-button').show();
104
+ $('#company-logo-remove-button').hide();
105
+ }
106
+
107
+ });
108
+
js/jquery.print-link.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+
3
+ $.fn.printLink = function(options) {
4
+ var iframe = null;
5
+ var settings = $.extend({
6
+ url: null
7
+ }, options);
8
+
9
+ // Apply to all elements
10
+ return this.each(function() {
11
+
12
+ // Click handler on the link
13
+ $(this).on('click', function(event) {
14
+ event.preventDefault();
15
+
16
+ // Target element
17
+ var element = $(this);
18
+
19
+ // Get the url from the anchor or overwrite it
20
+ var url = element.attr('href');
21
+ if(settings.url) {
22
+ url = settings.url;
23
+ }
24
+
25
+ // Open the url directly when an iframe printing is not supported.
26
+ if(navigator.userAgent.match(/opera/i) || navigator.userAgent.match(/trident/i) || (navigator.userAgent.match(/msie/i) && window.addEventListener)) {
27
+ element.trigger('printLinkError');
28
+ return false;
29
+ }
30
+
31
+ // Trigger load
32
+ element.trigger('printLinkInit');
33
+
34
+ // Print the url with a hidden iframe
35
+ if(!$('#printLinkIframe')[0]) {
36
+ // Create a new iframe
37
+ var iframe = '<iframe id="printLinkIframe" name="printLinkIframe" src=' + url + ' style="position:absolute;top:-9999px;left:-9999px;border:0px;overfow:none; z-index:-1"></iframe>';
38
+ $('body').append(iframe);
39
+
40
+ // Start the printing when the url is loaded
41
+ $('#printLinkIframe').on('load',function() {
42
+ element.trigger('printLinkComplete');
43
+ frames['printLinkIframe'].focus();
44
+ frames['printLinkIframe'].print();
45
+ });
46
+ } else {
47
+ // Change the iframe src in case the iframe already exists
48
+ $('#printLinkIframe').attr('src', url);
49
+ }
50
+ });
51
+
52
+ });
53
+
54
+ return this;
55
+ };
56
+
57
+ }(jQuery));
js/script.js DELETED
@@ -1,97 +0,0 @@
1
- jQuery(document).ready(function($) {
2
-
3
- // click print button
4
- $('.print-preview-button').on('click', function(event) {
5
-
6
- var iframe = null;
7
- var url = $(this).attr('href');
8
-
9
- // just open the href link when iframe printing is not supported
10
- if($.browser.opera || ($.browser.msie && parseInt($.browser.version) > 9)) {
11
- return;
12
- }
13
-
14
- // otherwise continue with the cool iframe printing
15
- if(show_print_preview == 'yes') {
16
- // show the print settings preview in thickbox
17
- tb_show('', url + '&TB_iframe=true&width=720&height=460');
18
-
19
- return false;
20
- } else {
21
- // create the iframe and print dialogue
22
- $('#woocommerce-delivery-notes-box .loading').show();
23
- $(this).parent().find('.loading').show();
24
-
25
- // print the page with a hidden preview window
26
- if(!$('#printPreview')[0]) {
27
- // create a new iframe
28
- var iframe = '<iframe id="printPreview" name="printPreview" src=' + url + ' style="position:absolute;top:-9999px;left:-9999px;border:0px;overfow:none; z-index:-1"></iframe>';
29
- $('body').append(iframe);
30
-
31
- // print when the iframe is loaded
32
- $('#printPreview').on('load',function() {
33
- $('#woocommerce-delivery-notes-box .loading').hide();
34
- $(this).parent().find('.loading').hide();
35
- frames['printPreview'].focus();
36
- frames['printPreview'].print();
37
- });
38
- } else {
39
- // change the iframe src when the iframe is already appended
40
- $('#printPreview').attr('src', url);
41
- }
42
-
43
- return false;
44
- }
45
-
46
- return false;
47
- });
48
-
49
- // button to open the media uploader
50
- $('#company-logo-add-button, #company-logo-placeholder').on('click', function(event) {
51
- tb_show('', 'media-upload.php?post_id=0&company_logo_image=true&type=image&TB_iframe=true');
52
- event.preventDefault();
53
- });
54
-
55
- // button to remove the media
56
- $('#company-logo-remove-button').on('click', function(event) {
57
- removeImage();
58
- event.preventDefault();
59
- });
60
-
61
- // called when the "Insert into post" button is clicked
62
- window.send_to_editor = function(html) {
63
- removeImage();
64
- tb_remove();
65
-
66
- // find the attachment id
67
- var tag = $('<div></div>');
68
- tag.append(html);
69
- var imgClass = $('img', tag).attr('class');
70
- var imgID = parseInt(imgClass.replace(/\D/g, ''), 10);
71
-
72
- // load the image
73
- var data = {
74
- attachment_id: imgID,
75
- action: 'load_thumbnail'
76
- }
77
-
78
- $.post(ajaxurl, data, function(response) {
79
- $('#company-logo-image-id').val(data.attachment_id);
80
- $('#company-logo-placeholder').removeClass('loading').html(response);
81
- $('#company-logo-add-button').hide();
82
- $('#company-logo-remove-button').show();
83
- }).error(function() {
84
- removeImage();
85
- });
86
- }
87
-
88
- // remove media
89
- function removeImage() {
90
- $('#company-logo-image-id').val('');
91
- $('#company-logo-placeholder').removeClass('loading').empty();
92
- $('#company-logo-add-button').show();
93
- $('#company-logo-remove-button').hide();
94
- }
95
-
96
- });
97
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/theme.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ /*
4
+ * Print button
5
+ */
6
+ $('.woocommerce .button.print').printLink();
7
+
8
+ });
languages/woocommerce-delivery-notes-de_DE.mo CHANGED
Binary file
languages/woocommerce-delivery-notes-de_DE.po CHANGED
@@ -1,183 +1,95 @@
1
- # This German Language File: Copyright (C) 2012 by David Decker of deckerweb.de & genesisthemes.de
2
  # This file is distributed under the same license as the WooCommerce Print Invoices & Delivery Notes Plugin package.
3
  #
4
- # Weitere deutsche Sprachdateien fuer WooCommerce und WordPress sind hier zu finden:
 
5
  # --> http://deckerweb.de/sprachdateien/
6
  #
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: WooCommerce Print Invoices & Delivery Notes\n"
10
- "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2013-06-16 14:03+0100\n"
12
- "PO-Revision-Date: 2013-06-16 14:06+0100\n"
13
- "Last-Translator: \n"
14
- "Language-Team: DECKERWEB <deckerweb.mobil@googlemail.com>\n"
15
  "Language: de_DE\n"
16
  "MIME-Version: 1.0\n"
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
  "Content-Transfer-Encoding: 8bit\n"
19
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
20
- "X-Poedit-SourceCharset: utf-8\n"
 
21
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
22
- "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
23
- "X-Textdomain-Support: yes\n"
24
  "X-Poedit-Basepath: .\n"
25
- "X-Generator: Poedit 1.5.5\n"
26
-
27
- # @ woocommerce-delivery-notes
28
- #: ../woocommerce-delivery-notes.php:124
29
- msgid "FAQ"
30
- msgstr "FAQ - Häufige Fragen"
31
-
32
- # @ woocommerce-delivery-notes
33
- #: ../woocommerce-delivery-notes.php:125
34
- msgid "Support"
35
- msgstr "Hilfe und Unterstützung (Support)"
36
-
37
- # @ woocommerce-delivery-notes
38
- #: ../woocommerce-delivery-notes.php:134
39
- msgid "Go to the settings page"
40
- msgstr "Zur Einstellungsseite des Plugins"
41
-
42
- # @ woocommerce-delivery-notes
43
- #: ../woocommerce-delivery-notes.php:134
44
- msgid "Settings"
45
- msgstr "Einstellungen"
46
-
47
- # @ woocommerce-delivery-notes
48
- #: ../woocommerce-delivery-notes.php:201
49
- msgid "Invoice"
50
- msgstr "Rechnung"
51
-
52
- # @ woocommerce-delivery-notes
53
- #: ../woocommerce-delivery-notes.php:203
54
- msgid "Delivery Note"
55
- msgstr "Lieferschein"
56
 
57
  # @ woocommerce-delivery-notes
58
- #: ../woocommerce-delivery-notes.php:302
59
- #: ../classes/class-wcdn-settings.php:154
 
60
  msgid "Print"
61
  msgstr "Drucken"
62
 
63
- # @ woocommerce
64
- #: ../woocommerce-delivery-notes.php:391 ../woocommerce-delivery-notes.php:405
65
- msgid "N/A"
66
- msgstr "k.A."
67
-
68
- #: ../classes/class-wcdn-print.php:63 ../classes/class-wcdn-print.php:68
69
- #: ../classes/class-wcdn-print.php:73 ../classes/class-wcdn-print.php:78
70
- msgid "You do not have sufficient permissions to access this page."
71
- msgstr "Sie haben nicht genügend Rechte für den Zugriff auf diese Seite."
72
-
73
  # @ woocommerce-delivery-notes
74
- #: ../classes/class-wcdn-settings.php:132
75
- #: ../classes/class-wcdn-settings.php:135
76
- msgid "About the Plugin"
77
- msgstr "Über das Plugin"
78
-
79
- # @ woocommerce-delivery-notes
80
- #: ../classes/class-wcdn-settings.php:134
81
- msgid "Plugin: WooCommerce Print Invoices & Delivery Notes"
82
- msgstr "Plugin: WooCommerce Rechnungen & Lieferscheine drucken"
83
 
84
  # @ woocommerce-delivery-notes
85
- #: ../classes/class-wcdn-settings.php:136
86
- msgid ""
87
- "This plugin enables you to add a Invoice or simple Delivery Note page for "
88
- "printing for your orders in WooCommerce shop plugin. You can add your "
89
- "company postal address, further add personal notes, refund or other policies "
90
- "and a footer note/branding. This helps speed up your daily shop and order "
91
- "management. In some countries (e.g. in the European Union) it is also "
92
- "required to advice the customer with proper refund policies so this little "
93
- "plugin might help you a bit with that too."
94
- msgstr ""
95
- "Dieses Plugin ermöglicht es, eine einfache Rechnung oder einen einfachen "
96
- "Lieferschein zum Ausdrucken für das WooCommerce Shop-Plugin zu erhalten. Sie "
97
- "können Ihre Firmen-/ Shop-Informationen, ebenso persönliche Anmerkungen, "
98
- "weiterhin Bedingungen/ Widerrufsbelehrung u.Ä. sowie eine Fußzeile "
99
- "(Impressum/ Branding) hinzufügen. Damit beschleunigen Sie die tägliche Shop-"
100
- "Verwaltung. Da in Ländern der Europäischen Union oftmals vorgeschrieben ist, "
101
- "Widerrufsbelehrungen u.Ä. der Bestellung beizulegen, können Sie dies hiermit "
102
- "besser erfüllen und außerdem Ihren Kunden bequem die Bestell-Infos in die "
103
- "Hand geben."
104
-
105
- # @ woocommerce-delivery-notes
106
- #: ../classes/class-wcdn-settings.php:137
107
  #, php-format
108
  msgid ""
109
- "Just look under <a href=\"%1$s\">WooCommerce > Orders</a> and there go to a "
110
- "single order view. On the right side you will see the Order Print meta box. "
111
- "Click one of the buttons and you get the invoice or delivery note printing "
112
- "page. Yes, it is that easy :-)."
113
  msgstr ""
114
- "Schauen Sie einfach unter <a href=\"%1$s\">WooCommerce > Bestellungen</a> "
115
- "und rufen Sie dort eine einzelne Bestellung auf. Auf rechten Seite erscheint "
116
- "die <em>Bestellung drucken</em> Metabox. Klicken Sie dort und es öffnet sich "
117
- "die Rechnung oder der Lieferschein zum Ausdrucken. Das ist schon alles :-)."
118
-
119
- # @ woocommerce-delivery-notes
120
- #: ../classes/class-wcdn-settings.php:142
121
- msgid "For more information:"
122
- msgstr "Weitere Informationen:"
123
-
124
- # @ woocommerce-delivery-notes
125
- #: ../classes/class-wcdn-settings.php:143
126
- msgid "Frequently Asked Questions"
127
- msgstr "Häufige Fragen (FAQ)"
128
-
129
- # @ woocommerce-delivery-notes
130
- #: ../classes/class-wcdn-settings.php:144
131
- msgid "Get Community Support"
132
- msgstr "Community-Support erhalten"
133
-
134
- # @ woocommerce-delivery-notes
135
- #: ../classes/class-wcdn-settings.php:145
136
- msgid "Project on WordPress.org"
137
- msgstr "Projekt bei WordPress.org"
138
-
139
- # @ woocommerce-delivery-notes
140
- #: ../classes/class-wcdn-settings.php:146
141
- msgid "Project on GitHub"
142
- msgstr "Projekt bei GitHub"
143
 
144
- # @ woocommerce-delivery-notes
145
- #: ../classes/class-wcdn-settings.php:194
146
- msgid "Invoices and Delivery Notes"
147
- msgstr "Rechnungen und Lieferscheine"
 
 
148
 
149
  # @ woocommerce-delivery-notes
150
- #: ../classes/class-wcdn-settings.php:202
151
  msgid "Company/Shop Logo"
152
  msgstr "Firmen-/ Shop-Logo"
153
 
154
  # @ woocommerce-delivery-notes
155
- #: ../classes/class-wcdn-settings.php:207
156
  msgid "Remove Logo"
157
  msgstr "Logo entfernen"
158
 
159
  # @ woocommerce-delivery-notes
160
- #: ../classes/class-wcdn-settings.php:208
161
  msgid "Set Logo"
162
  msgstr "Logo festlegen"
163
 
164
  # @ woocommerce-delivery-notes
165
- #: ../classes/class-wcdn-settings.php:210
166
  msgid "A company/shop logo representing your business."
167
  msgstr "Ein Firmen-/ Shop-Logo, welches Ihr Geschäft repräsentiert."
168
 
169
  # @ woocommerce-delivery-notes
170
- #: ../classes/class-wcdn-settings.php:211
171
- #: ../classes/class-wcdn-settings.php:224
172
- #: ../classes/class-wcdn-settings.php:237
173
- #: ../classes/class-wcdn-settings.php:250
174
- #: ../classes/class-wcdn-settings.php:263
175
- #: ../classes/class-wcdn-settings.php:276
176
  msgid "Note:"
177
  msgstr "Hinweis:"
178
 
179
  # @ woocommerce-delivery-notes
180
- #: ../classes/class-wcdn-settings.php:212
181
  msgid ""
182
  "When the image is printed, its pixel density will automatically be eight "
183
  "times higher than the original. This means, 1 printed inch will correspond "
@@ -193,50 +105,49 @@ msgstr ""
193
  "(ca. 5.08 cm x 2.54cm)."
194
 
195
  # @ woocommerce-delivery-notes
196
- #: ../classes/class-wcdn-settings.php:218
197
  msgid "Company/Shop Name"
198
  msgstr "Firmen-/ Shopname"
199
 
200
  # @ woocommerce-delivery-notes
201
- #: ../classes/class-wcdn-settings.php:223
202
  msgid "Your company/shop name for the Delivery Note."
203
  msgstr "Ihr Firmen-/ Shop-Name für den Lieferschein/ die Rechnung."
204
 
205
  # @ woocommerce-delivery-notes
206
- #: ../classes/class-wcdn-settings.php:225
207
  msgid ""
208
- "Leave blank to use the default Website/ Blog title defined in WordPress "
209
- "settings."
210
  msgstr ""
211
  "Leer lassen, um den standardmäßigen Webseiten- bzw. Blogtitel zu verwenden, "
212
  "der in den WordPress-Einstellungen festgelegt wird."
213
 
214
  # @ woocommerce-delivery-notes
215
- #: ../classes/class-wcdn-settings.php:231
216
  msgid "Company/Shop Address"
217
  msgstr "Firmen-/ Shop-Anschrift"
218
 
219
  # @ woocommerce-delivery-notes
220
- #: ../classes/class-wcdn-settings.php:236
221
  msgid ""
222
- "The postal address of the company/shop, which gets printed right of the "
223
- "company/shop name, above the order listings."
224
  msgstr ""
225
  "Die Postanschrift der Firma bzw. des Shops, welche rechts neben dem Firmen-/ "
226
  "Shopname ausgegeben wird, über den Bestelldaten."
227
 
228
  # @ woocommerce-delivery-notes
229
- #: ../classes/class-wcdn-settings.php:238
230
  msgid "Leave blank to not print an address."
231
  msgstr "Leer lassen, um keine Anschrift mit auszudrucken."
232
 
233
- # @ woocommerce-delivery-notes
234
- #: ../classes/class-wcdn-settings.php:244
235
- msgid "Personal Notes"
236
- msgstr "Persönliche Anmerkungen"
237
 
238
  # @ woocommerce-delivery-notes
239
- #: ../classes/class-wcdn-settings.php:249
240
  msgid ""
241
  "Add some personal notes, or season greetings or whatever (e.g. Thank You for "
242
  "Your Order!, Merry Christmas!, etc.)."
@@ -245,17 +156,17 @@ msgstr ""
245
  "hinzu (z.B.: Danke für Ihre Bestellung!, Frohe Weihnachten!, etc.)."
246
 
247
  # @ woocommerce-delivery-notes
248
- #: ../classes/class-wcdn-settings.php:251
249
  msgid "Leave blank to not print any personal notes."
250
  msgstr "Leer lassen, um keine persönlichen Anmerkungen mit auszudrucken."
251
 
252
  # @ woocommerce-delivery-notes
253
- #: ../classes/class-wcdn-settings.php:257
254
- msgid "Returns Policy, Conditions, etc.:"
255
  msgstr "Rückgabe- und sonstige Bedingungen:"
256
 
257
  # @ woocommerce-delivery-notes
258
- #: ../classes/class-wcdn-settings.php:262
259
  msgid ""
260
  "Here you can add some more policies, conditions etc. For example add a "
261
  "returns policy in case the client would like to send back some goods. In "
@@ -268,68 +179,75 @@ msgstr ""
268
  "entsprechenden gesetzlichen Bestimmungen für Ihr Land."
269
 
270
  # @ woocommerce-delivery-notes
271
- #: ../classes/class-wcdn-settings.php:264
272
  msgid "Leave blank to not print any policies or conditions."
273
  msgstr "Leer lassen, um keine Bedingungen mit auszudrucken."
274
 
275
  # @ woocommerce-delivery-notes
276
- #: ../classes/class-wcdn-settings.php:270
277
- msgid "Footer Imprint"
278
- msgstr "Fußzeile Impressum"
279
 
280
  # @ woocommerce-delivery-notes
281
- #: ../classes/class-wcdn-settings.php:275
282
  msgid ""
283
- "Add some further footer imprint, copyright notes etc. to get the printed "
284
- "sheets a bit more branded to your needs."
285
  msgstr ""
286
  "Fügen Sie Impressumangaben in der Fußzeile hinzu. Damit können die Ausdrucke "
287
- "noch stärker an Ihr CI bzw. rechtliche Anforderungen angepasst werden."
288
 
289
  # @ woocommerce-delivery-notes
290
- #: ../classes/class-wcdn-settings.php:277
291
  msgid "Leave blank to not print a footer."
292
  msgstr ""
293
  "Leer lassen, um keine Impressumangaben in der Fußzeile mit auszudrucken."
294
 
295
- #: ../classes/class-wcdn-settings.php:301
296
- #, php-format
297
- msgid ""
298
- "You can <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s\">preview the invoice "
299
- "template</a> or <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s\">the delivery "
300
- "note template</a>."
301
- msgstr ""
302
- "Sie können eine Vorschau der <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s"
303
- "\">Rechnung</a> oder des <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s"
304
- "\">Lieferscheins</a> anzeigen."
305
 
306
- #: ../classes/class-wcdn-settings.php:302
307
  msgid ""
308
- "For more advanced control copy <code>woocommerce-delivery-notes/templates/"
309
- "print/style.css</code> to <code>your-theme-name/woocommerce/print/style.css</"
310
- "code>."
311
  msgstr ""
312
- "Kopieren Sie für erweiterte Anpassungen <code>woocommerce-delivery-notes/"
313
- "templates/print/style.css</code> nach <code>ihr-theme-name/woocommerce/print/"
314
- "style.css</code>."
 
 
 
 
 
 
 
 
 
 
 
315
 
316
  # @ woocommerce-delivery-notes
317
- #: ../classes/class-wcdn-settings.php:309
318
- msgid "Order Numbering Options"
319
- msgstr "Bestellnummern-Optionen"
320
 
321
  # @ woocommerce-delivery-notes
322
- #: ../classes/class-wcdn-settings.php:314
323
  msgid "Sequential order number"
324
  msgstr "Fortlaufende Bestellnummer"
325
 
326
  # @ woocommerce-delivery-notes
327
- #: ../classes/class-wcdn-settings.php:318
328
  msgid "Sequential numbering is enabled."
329
  msgstr "Fortlaufende Nummerierung ist aktiviert."
330
 
331
  # @ woocommerce-delivery-notes
332
- #: ../classes/class-wcdn-settings.php:320
333
  #, php-format
334
  msgid ""
335
  "Install and activate the free <a href=\"%s\">WooCommerce Sequential Order "
@@ -339,85 +257,137 @@ msgstr ""
339
  "\">WooCommerce Sequential Order Numbers</a>."
340
 
341
  # @ woocommerce-delivery-notes
342
- #: ../classes/class-wcdn-writepanel.php:76
343
- #: ../classes/class-wcdn-writepanel.php:77
344
- #: ../classes/class-wcdn-writepanel.php:102
 
 
345
  msgid "Print Invoice"
346
  msgstr "Rechnung drucken"
347
 
348
- # @ woocommerce-invoice
349
  # @ woocommerce-delivery-notes
350
- #: ../classes/class-wcdn-writepanel.php:78
351
- #: ../classes/class-wcdn-writepanel.php:80
352
- #: ../classes/class-wcdn-writepanel.php:81
353
- #: ../classes/class-wcdn-writepanel.php:82
354
- #: ../classes/class-wcdn-writepanel.php:103
355
  msgid "Print Delivery Note"
356
  msgstr "Lieferschein drucken"
357
 
358
  # @ woocommerce-delivery-notes
359
- #: ../classes/class-wcdn-writepanel.php:92
360
- msgid "Order Print"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  msgstr "Bestellung drucken"
362
 
363
  # @ woocommerce-delivery-notes
364
- #: ../templates/print/print-delivery-note.php:23
365
- msgid "Recipient"
366
- msgstr "Empfänger"
367
 
368
  # @ woocommerce-delivery-notes
369
- #: ../templates/print/print-delivery-note.php:40
370
- msgid "Order Date"
371
- msgstr "Bestelldatum"
 
 
 
 
 
372
 
373
  # @ woocommerce-delivery-notes
374
- #: ../templates/print/print-delivery-note.php:44
375
  msgid "Order Number"
376
  msgstr "Bestellnummer"
377
 
378
- #: ../templates/print/print-delivery-note.php:48
 
 
 
 
 
 
379
  msgid "Payment Method"
380
  msgstr "Zahlungsart"
381
 
382
- #: ../templates/print/print-delivery-note.php:52
 
383
  msgid "Email"
384
  msgstr "E-Mail"
385
 
386
- #: ../templates/print/print-delivery-note.php:56
387
- msgid "Phone"
388
  msgstr "Telefon"
389
 
390
- # @ woocommerce
391
- #: ../templates/print/print-delivery-note.php:65
392
- msgid "Product"
393
- msgstr "Produkt"
394
 
395
- # @ woocommerce
396
- #: ../templates/print/print-delivery-note.php:66
397
- msgid "Quantity"
398
- msgstr "Menge"
399
 
400
- # @ woocommerce
401
- #: ../templates/print/print-delivery-note.php:67
402
- msgid "Totals"
403
- msgstr "Gesamt"
 
404
 
405
  # @ woocommerce-delivery-notes
406
- #: ../templates/print/print-delivery-note.php:75
407
- msgid "SKU:"
408
- msgstr "Art.-Nr.:"
409
 
410
  # @ woocommerce-delivery-notes
411
- #: ../templates/print/print-delivery-note.php:76
412
- msgid "Weight:"
413
- msgstr "Gewicht:"
414
 
415
  # @ woocommerce-delivery-notes
416
- #: ../templates/print/print-delivery-note.php:81
 
 
 
 
417
  msgid "Download:"
418
- msgstr "Download:"
 
 
 
 
 
419
 
420
  # @ woocommerce-delivery-notes
421
- #: ../templates/print/print-delivery-note.php:109
422
- msgid "Customer Notes"
423
  msgstr "Kundennotizen"
 
 
 
 
 
 
 
 
 
 
1
+ # This German Language File: Copyright (C) 2011-2013 by David Decker of deckerweb.de & genesisthemes.de
2
  # This file is distributed under the same license as the WooCommerce Print Invoices & Delivery Notes Plugin package.
3
  #
4
+ # Weitere deutsche Sprachdateien fuer WooCommerce und Extensions (Erweiterungen)
5
+ # sowie fuer WordPress-Plugins und -Themes finden Sie unter:
6
  # --> http://deckerweb.de/sprachdateien/
7
  #
8
  msgid ""
9
  msgstr ""
10
+ "Project-Id-Version: WooCommerce Print Invoice & Delivery Note\n"
11
+ "Report-Msgid-Bugs-To: http://deckerweb.de/kontakt/\n"
12
+ "POT-Creation-Date: 2014-04-10 20:39+0100\n"
13
+ "PO-Revision-Date: 2014-04-10 20:39+0100\n"
14
+ "Last-Translator: David Decker <deckerweb.mobil@googlemail.com>\n"
15
+ "Language-Team: \n"
16
  "Language: de_DE\n"
17
  "MIME-Version: 1.0\n"
18
  "Content-Type: text/plain; charset=UTF-8\n"
19
  "Content-Transfer-Encoding: 8bit\n"
20
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
21
+ "X-Generator: Poedit 1.6.4\n"
22
+ "X-Poedit-SourceCharset: UTF-8\n"
23
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
24
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
25
+ "esc_attr_e;esc_attr__\n"
26
  "X-Poedit-Basepath: .\n"
27
+ "X-Textdomain-Support: yes\n"
28
+ "X-Poedit-SearchPath-0: ..\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  # @ woocommerce-delivery-notes
31
+ #: ../includes/class-wcdn-settings.php:90 ../includes/class-wcdn-theme.php:52
32
+ #: ../includes/class-wcdn-theme.php:71
33
+ #: ../includes/wcdn-template-functions.php:118
34
  msgid "Print"
35
  msgstr "Drucken"
36
 
 
 
 
 
 
 
 
 
 
 
37
  # @ woocommerce-delivery-notes
38
+ #: ../includes/class-wcdn-settings.php:128
39
+ msgid "Print Order"
40
+ msgstr "Bestellung drucken"
 
 
 
 
 
 
41
 
42
  # @ woocommerce-delivery-notes
43
+ #: ../includes/class-wcdn-settings.php:147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  #, php-format
45
  msgid ""
46
+ "You can preview the <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s\">invoice "
47
+ "template</a> or <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s\">delivery "
48
+ "note template</a>."
 
49
  msgstr ""
50
+ "Sie können eine Vorschau der <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s"
51
+ "\">Rechnung</a> oder des <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s"
52
+ "\">Lieferscheins</a> anzeigen."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
+ #: ../includes/class-wcdn-settings.php:148
55
+ msgid ""
56
+ "With the FAQ in the readme file you can learn how to customize the template."
57
+ msgstr ""
58
+ "Mit den häufig gestellten Fragen in der Liesmich-Datei erfahren Sie, wie Sie "
59
+ "die Vorlage anpassen können."
60
 
61
  # @ woocommerce-delivery-notes
62
+ #: ../includes/class-wcdn-settings.php:159
63
  msgid "Company/Shop Logo"
64
  msgstr "Firmen-/ Shop-Logo"
65
 
66
  # @ woocommerce-delivery-notes
67
+ #: ../includes/class-wcdn-settings.php:165
68
  msgid "Remove Logo"
69
  msgstr "Logo entfernen"
70
 
71
  # @ woocommerce-delivery-notes
72
+ #: ../includes/class-wcdn-settings.php:166
73
  msgid "Set Logo"
74
  msgstr "Logo festlegen"
75
 
76
  # @ woocommerce-delivery-notes
77
+ #: ../includes/class-wcdn-settings.php:170
78
  msgid "A company/shop logo representing your business."
79
  msgstr "Ein Firmen-/ Shop-Logo, welches Ihr Geschäft repräsentiert."
80
 
81
  # @ woocommerce-delivery-notes
82
+ #: ../includes/class-wcdn-settings.php:171
83
+ #: ../includes/class-wcdn-settings.php:184
84
+ #: ../includes/class-wcdn-settings.php:197
85
+ #: ../includes/class-wcdn-settings.php:210
86
+ #: ../includes/class-wcdn-settings.php:223
87
+ #: ../includes/class-wcdn-settings.php:236
88
  msgid "Note:"
89
  msgstr "Hinweis:"
90
 
91
  # @ woocommerce-delivery-notes
92
+ #: ../includes/class-wcdn-settings.php:172
93
  msgid ""
94
  "When the image is printed, its pixel density will automatically be eight "
95
  "times higher than the original. This means, 1 printed inch will correspond "
105
  "(ca. 5.08 cm x 2.54cm)."
106
 
107
  # @ woocommerce-delivery-notes
108
+ #: ../includes/class-wcdn-settings.php:178
109
  msgid "Company/Shop Name"
110
  msgstr "Firmen-/ Shopname"
111
 
112
  # @ woocommerce-delivery-notes
113
+ #: ../includes/class-wcdn-settings.php:183
114
  msgid "Your company/shop name for the Delivery Note."
115
  msgstr "Ihr Firmen-/ Shop-Name für den Lieferschein/ die Rechnung."
116
 
117
  # @ woocommerce-delivery-notes
118
+ #: ../includes/class-wcdn-settings.php:185
119
  msgid ""
120
+ "Leave blank to use the default Website/Blog title defined in WordPress "
121
+ "settings. The name will be ignored when a Logo is set."
122
  msgstr ""
123
  "Leer lassen, um den standardmäßigen Webseiten- bzw. Blogtitel zu verwenden, "
124
  "der in den WordPress-Einstellungen festgelegt wird."
125
 
126
  # @ woocommerce-delivery-notes
127
+ #: ../includes/class-wcdn-settings.php:191
128
  msgid "Company/Shop Address"
129
  msgstr "Firmen-/ Shop-Anschrift"
130
 
131
  # @ woocommerce-delivery-notes
132
+ #: ../includes/class-wcdn-settings.php:196
133
  msgid ""
134
+ "The postal address of the company/shop or even e-mail or telephone, which "
135
+ "gets printed right after the company/shop name."
136
  msgstr ""
137
  "Die Postanschrift der Firma bzw. des Shops, welche rechts neben dem Firmen-/ "
138
  "Shopname ausgegeben wird, über den Bestelldaten."
139
 
140
  # @ woocommerce-delivery-notes
141
+ #: ../includes/class-wcdn-settings.php:198
142
  msgid "Leave blank to not print an address."
143
  msgstr "Leer lassen, um keine Anschrift mit auszudrucken."
144
 
145
+ #: ../includes/class-wcdn-settings.php:204
146
+ msgid "Complimentary close"
147
+ msgstr "Schlussformel"
 
148
 
149
  # @ woocommerce-delivery-notes
150
+ #: ../includes/class-wcdn-settings.php:209
151
  msgid ""
152
  "Add some personal notes, or season greetings or whatever (e.g. Thank You for "
153
  "Your Order!, Merry Christmas!, etc.)."
156
  "hinzu (z.B.: Danke für Ihre Bestellung!, Frohe Weihnachten!, etc.)."
157
 
158
  # @ woocommerce-delivery-notes
159
+ #: ../includes/class-wcdn-settings.php:211
160
  msgid "Leave blank to not print any personal notes."
161
  msgstr "Leer lassen, um keine persönlichen Anmerkungen mit auszudrucken."
162
 
163
  # @ woocommerce-delivery-notes
164
+ #: ../includes/class-wcdn-settings.php:217
165
+ msgid "Returns Policy, Conditions, etc"
166
  msgstr "Rückgabe- und sonstige Bedingungen:"
167
 
168
  # @ woocommerce-delivery-notes
169
+ #: ../includes/class-wcdn-settings.php:222
170
  msgid ""
171
  "Here you can add some more policies, conditions etc. For example add a "
172
  "returns policy in case the client would like to send back some goods. In "
179
  "entsprechenden gesetzlichen Bestimmungen für Ihr Land."
180
 
181
  # @ woocommerce-delivery-notes
182
+ #: ../includes/class-wcdn-settings.php:224
183
  msgid "Leave blank to not print any policies or conditions."
184
  msgstr "Leer lassen, um keine Bedingungen mit auszudrucken."
185
 
186
  # @ woocommerce-delivery-notes
187
+ #: ../includes/class-wcdn-settings.php:230
188
+ msgid "Footer"
189
+ msgstr "Fußzeile"
190
 
191
  # @ woocommerce-delivery-notes
192
+ #: ../includes/class-wcdn-settings.php:235
193
  msgid ""
194
+ "Add some further footer imprint, e-mail, telephone, copyright notes etc. "
195
+ "This makes the printed sheets a bit more branded."
196
  msgstr ""
197
  "Fügen Sie Impressumangaben in der Fußzeile hinzu. Damit können die Ausdrucke "
198
+ "noch stärker an Ihr CI angepasst werden."
199
 
200
  # @ woocommerce-delivery-notes
201
+ #: ../includes/class-wcdn-settings.php:237
202
  msgid "Leave blank to not print a footer."
203
  msgstr ""
204
  "Leer lassen, um keine Impressumangaben in der Fußzeile mit auszudrucken."
205
 
206
+ #: ../includes/class-wcdn-settings.php:244
207
+ msgid "Options"
208
+ msgstr "Optionen"
209
+
210
+ #: ../includes/class-wcdn-settings.php:249
211
+ msgid "Print Page Endpoint"
212
+ msgstr "Bestellung Drucken Endpunkt"
 
 
 
213
 
214
+ #: ../includes/class-wcdn-settings.php:256
215
  msgid ""
216
+ "The endpoint is appended to the accounts page URL to print the order. It "
217
+ "should be unique."
 
218
  msgstr ""
219
+ "Der Endpunkt wird der Konto-URL angehängt, um die Bestellung zu drucken. Sie "
220
+ "sollte eindeutig sein."
221
+
222
+ #: ../includes/class-wcdn-settings.php:262
223
+ msgid "Theme Print Buttons"
224
+ msgstr "Drucken im Theme"
225
+
226
+ #: ../includes/class-wcdn-settings.php:269
227
+ msgid "Show print button on the \"View Order\" page"
228
+ msgstr "Drucken Knopf auf der \"Bestellung anzeigen\" Seite zeigen"
229
+
230
+ #: ../includes/class-wcdn-settings.php:276
231
+ msgid "Show print buttons on the \"My Account\" page"
232
+ msgstr "Drucken Knopf auf der \"Konto bearbeiten\" Seite zeigen"
233
 
234
  # @ woocommerce-delivery-notes
235
+ #: ../includes/class-wcdn-settings.php:284
236
+ msgid "Order Numbering"
237
+ msgstr "Bestellnummer"
238
 
239
  # @ woocommerce-delivery-notes
240
+ #: ../includes/class-wcdn-settings.php:289
241
  msgid "Sequential order number"
242
  msgstr "Fortlaufende Bestellnummer"
243
 
244
  # @ woocommerce-delivery-notes
245
+ #: ../includes/class-wcdn-settings.php:293
246
  msgid "Sequential numbering is enabled."
247
  msgstr "Fortlaufende Nummerierung ist aktiviert."
248
 
249
  # @ woocommerce-delivery-notes
250
+ #: ../includes/class-wcdn-settings.php:295
251
  #, php-format
252
  msgid ""
253
  "Install and activate the free <a href=\"%s\">WooCommerce Sequential Order "
257
  "\">WooCommerce Sequential Order Numbers</a>."
258
 
259
  # @ woocommerce-delivery-notes
260
+ #: ../includes/class-wcdn-writepanel.php:83
261
+ #: ../includes/class-wcdn-writepanel.php:84
262
+ #: ../includes/class-wcdn-writepanel.php:105
263
+ #: ../includes/class-wcdn-writepanel.php:106
264
+ #: ../includes/class-wcdn-writepanel.php:190
265
  msgid "Print Invoice"
266
  msgstr "Rechnung drucken"
267
 
 
268
  # @ woocommerce-delivery-notes
269
+ #: ../includes/class-wcdn-writepanel.php:86
270
+ #: ../includes/class-wcdn-writepanel.php:87
271
+ #: ../includes/class-wcdn-writepanel.php:108
272
+ #: ../includes/class-wcdn-writepanel.php:109
273
+ #: ../includes/class-wcdn-writepanel.php:191
274
  msgid "Print Delivery Note"
275
  msgstr "Lieferschein drucken"
276
 
277
  # @ woocommerce-delivery-notes
278
+ #: ../includes/class-wcdn-writepanel.php:164
279
+ #, php-format
280
+ msgid "Invoice created."
281
+ msgid_plural "%s invoices created."
282
+ msgstr[0] "Rechnung erstellt."
283
+ msgstr[1] "%s Rechnungen erstellt."
284
+
285
+ # @ woocommerce-delivery-notes
286
+ #: ../includes/class-wcdn-writepanel.php:166
287
+ #, php-format
288
+ msgid "Delivery note created."
289
+ msgid_plural "%s delivery notes created."
290
+ msgstr[0] "Lieferschein erstellt."
291
+ msgstr[1] "%s Lieferscheine erstellt."
292
+
293
+ # @ woocommerce-delivery-notes
294
+ #: ../includes/class-wcdn-writepanel.php:170
295
+ msgid "Print now"
296
+ msgstr "Jetzt drucken"
297
+
298
+ # @ woocommerce-delivery-notes
299
+ #: ../includes/class-wcdn-writepanel.php:181
300
+ msgid "Order Printing"
301
  msgstr "Bestellung drucken"
302
 
303
  # @ woocommerce-delivery-notes
304
+ #: ../includes/wcdn-template-functions.php:32
305
+ msgid "Invoice"
306
+ msgstr "Rechnung"
307
 
308
  # @ woocommerce-delivery-notes
309
+ #: ../includes/wcdn-template-functions.php:34
310
+ msgid "Delivery Note"
311
+ msgstr "Lieferschein"
312
+
313
+ # @ woocommerce-delivery-notes
314
+ #: ../includes/wcdn-template-functions.php:36
315
+ msgid "Order"
316
+ msgstr "Bestellung"
317
 
318
  # @ woocommerce-delivery-notes
319
+ #: ../includes/wcdn-template-functions.php:202
320
  msgid "Order Number"
321
  msgstr "Bestellnummer"
322
 
323
+ # @ woocommerce-delivery-notes
324
+ #: ../includes/wcdn-template-functions.php:206
325
+ msgid "Order Date"
326
+ msgstr "Bestelldatum"
327
+
328
+ # @ woocommerce-delivery-notes
329
+ #: ../includes/wcdn-template-functions.php:210
330
  msgid "Payment Method"
331
  msgstr "Zahlungsart"
332
 
333
+ # @ woocommerce-delivery-notes
334
+ #: ../includes/wcdn-template-functions.php:217
335
  msgid "Email"
336
  msgstr "E-Mail"
337
 
338
+ #: ../includes/wcdn-template-functions.php:224
339
+ msgid "Telephone"
340
  msgstr "Telefon"
341
 
342
+ #: ../includes/wcdn-template-functions.php:241
343
+ msgid "SKU:"
344
+ msgstr "Art.-Nr.:"
 
345
 
346
+ #: ../templates/print-order/print-content.php:28
347
+ msgid "Billing Address"
348
+ msgstr "Rechnungsadresse"
 
349
 
350
+ # @ woocommerce-delivery-notes
351
+ #: ../templates/print-order/print-content.php:31
352
+ #: ../templates/print-order/print-content.php:42
353
+ msgid "N/A"
354
+ msgstr "k.A."
355
 
356
  # @ woocommerce-delivery-notes
357
+ #: ../templates/print-order/print-content.php:39
358
+ msgid "Shipping Address"
359
+ msgstr "Lieferadresse"
360
 
361
  # @ woocommerce-delivery-notes
362
+ #: ../templates/print-order/print-content.php:74
363
+ msgid "Product"
364
+ msgstr "Produkt"
365
 
366
  # @ woocommerce-delivery-notes
367
+ #: ../templates/print-order/print-content.php:75
368
+ msgid "Total"
369
+ msgstr "Summe"
370
+
371
+ #: ../templates/print-order/print-content.php:100
372
  msgid "Download:"
373
+ msgstr "Download: "
374
+
375
+ #: ../templates/print-order/print-content.php:101
376
+ #, php-format
377
+ msgid "%s Files"
378
+ msgstr "%s Dateien"
379
 
380
  # @ woocommerce-delivery-notes
381
+ #: ../templates/print-order/print-content.php:144
382
+ msgid "Customer Note"
383
  msgstr "Kundennotizen"
384
+
385
+ # @ woocommerce-delivery-notes
386
+ #: ../woocommerce-delivery-notes.php:144
387
+ msgid "Go to the settings page"
388
+ msgstr "Zur Einstellungsseite des Plugins"
389
+
390
+ # @ woocommerce-delivery-notes
391
+ #: ../woocommerce-delivery-notes.php:144
392
+ msgid "Settings"
393
+ msgstr "Einstellungen"
languages/woocommerce-delivery-notes.mo DELETED
Binary file
languages/woocommerce-delivery-notes.po DELETED
@@ -1,280 +0,0 @@
1
- # This file is distributed under the same license as the WooCommerce Print Invoices & Delivery Notes package.
2
- msgid ""
3
- msgstr ""
4
- "PO-Revision-Date: 2013-03-11 13:33:23+0000\n"
5
- "MIME-Version: 1.0\n"
6
- "Content-Type: text/plain; charset=UTF-8\n"
7
- "Content-Transfer-Encoding: 8bit\n"
8
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
9
- "X-Generator: GlotPress/0.1\n"
10
- "Project-Id-Version: WooCommerce Print Invoices & Delivery Notes\n"
11
-
12
- #: classes/class-wcdn-settings.php:301
13
- msgid "You can <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s\">preview the invoice template</a> or <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s\">the delivery note template</a>."
14
- msgstr ""
15
-
16
- #: classes/class-wcdn-settings.php:302
17
- msgid "For more advanced control copy <code>woocommerce-delivery-notes/templates/print/style.css</code> to <code>your-theme-name/woocommerce/print/style.css</code>."
18
- msgstr ""
19
-
20
- #: templates/print/print-delivery-note.php:38
21
- msgid "Billing Date"
22
- msgstr ""
23
-
24
- #: templates/print/print-delivery-note.php:40
25
- msgid "Shipping Date"
26
- msgstr ""
27
-
28
- #: templates/print/print-delivery-note.php:45
29
- msgid "Order Number"
30
- msgstr ""
31
-
32
- #: templates/print/print-delivery-note.php:49
33
- msgid "Payment Method"
34
- msgstr ""
35
-
36
- #: woocommerce-delivery-notes.php:0
37
- msgid "2.0"
38
- msgstr ""
39
-
40
- #: classes/class-wcdn-settings.php:144
41
- msgid "Get Community Support"
42
- msgstr ""
43
-
44
- #: classes/class-wcdn-settings.php:212
45
- msgid "When the image is printed, its pixel density will automatically be eight times higher than the original. This means, 1 printed inch will correspond to about 288 pixels on the screen. Example: an image with a width of 576 pixels and a height of 288 pixels will have a printed size of about 2 inches to 1 inch."
46
- msgstr ""
47
-
48
- #: templates/print/print-delivery-note.php:58
49
- msgid "Product"
50
- msgstr ""
51
-
52
- #: templates/print/print-delivery-note.php:60
53
- msgid "Totals"
54
- msgstr ""
55
-
56
- #: templates/print/print-delivery-note.php:70
57
- msgid "Download:"
58
- msgstr ""
59
-
60
- #: woocommerce-delivery-notes.php:291 woocommerce-delivery-notes.php:305
61
- msgid "N/A"
62
- msgstr ""
63
-
64
- #: classes/class-wcdn-settings.php:202
65
- msgid "Company/Shop Logo"
66
- msgstr ""
67
-
68
- #: classes/class-wcdn-settings.php:207
69
- msgid "Remove Logo"
70
- msgstr ""
71
-
72
- #: classes/class-wcdn-settings.php:208
73
- msgid "Set Logo"
74
- msgstr ""
75
-
76
- #: classes/class-wcdn-settings.php:210
77
- msgid "A company/shop logo representing your business."
78
- msgstr ""
79
-
80
- #: classes/class-wcdn-settings.php:223
81
- msgid "Your company/shop name for the Delivery Note."
82
- msgstr ""
83
-
84
- #: classes/class-wcdn-settings.php:314
85
- msgid "Sequential order number"
86
- msgstr ""
87
-
88
- #: classes/class-wcdn-settings.php:318
89
- msgid "Sequential numbering is enabled."
90
- msgstr ""
91
-
92
- #: classes/class-wcdn-settings.php:320
93
- msgid "Install and activate the free <a href=\"%s\">WooCommerce Sequential Order Numbers</a> Plugin."
94
- msgstr ""
95
-
96
- #: woocommerce-delivery-notes.php:0
97
- msgid "https://github.com/piffpaffpuff/woocommerce-delivery-notes"
98
- msgstr ""
99
-
100
- #: woocommerce-delivery-notes.php:203
101
- msgid "Delivery Note"
102
- msgstr ""
103
-
104
- #: templates/print/print-delivery-note.php:59
105
- msgid "Quantity"
106
- msgstr ""
107
-
108
- #: classes/class-wcdn-print.php:63 classes/class-wcdn-print.php:68
109
- #: classes/class-wcdn-print.php:73 classes/class-wcdn-print.php:78
110
- msgid "You do not have sufficient permissions to access this page."
111
- msgstr ""
112
-
113
- #: woocommerce-delivery-notes.php:134
114
- msgid "Go to the settings page"
115
- msgstr ""
116
-
117
- #: woocommerce-delivery-notes.php:134
118
- msgid "Settings"
119
- msgstr ""
120
-
121
- #: woocommerce-delivery-notes.php:124
122
- msgid "FAQ"
123
- msgstr ""
124
-
125
- #: woocommerce-delivery-notes.php:125
126
- msgid "Support"
127
- msgstr ""
128
-
129
- #: classes/class-wcdn-settings.php:257
130
- msgid "Returns Policy, Conditions, etc.:"
131
- msgstr ""
132
-
133
- #: templates/print/print-delivery-note.php:68
134
- msgid "SKU:"
135
- msgstr ""
136
-
137
- #: templates/print/print-delivery-note.php:69
138
- msgid "Weight:"
139
- msgstr ""
140
-
141
- #: classes/class-wcdn-settings.php:134
142
- msgid "Plugin: WooCommerce Print Invoices & Delivery Notes"
143
- msgstr ""
144
-
145
- #: classes/class-wcdn-settings.php:211 classes/class-wcdn-settings.php:224
146
- #: classes/class-wcdn-settings.php:237 classes/class-wcdn-settings.php:250
147
- #: classes/class-wcdn-settings.php:263 classes/class-wcdn-settings.php:276
148
- msgid "Note:"
149
- msgstr ""
150
-
151
- #: classes/class-wcdn-settings.php:236
152
- msgid "The postal address of the company/shop, which gets printed right of the company/shop name, above the order listings."
153
- msgstr ""
154
-
155
- #: classes/class-wcdn-settings.php:249
156
- msgid "Add some personal notes, or season greetings or whatever (e.g. Thank You for Your Order!, Merry Christmas!, etc.)."
157
- msgstr ""
158
-
159
- #: classes/class-wcdn-settings.php:275
160
- msgid "Add some further footer imprint, copyright notes etc. to get the printed sheets a bit more branded to your needs."
161
- msgstr ""
162
-
163
- #: classes/class-wcdn-settings.php:132 classes/class-wcdn-settings.php:135
164
- msgid "About the Plugin"
165
- msgstr ""
166
-
167
- #: classes/class-wcdn-settings.php:142
168
- msgid "For more information:"
169
- msgstr ""
170
-
171
- #: classes/class-wcdn-settings.php:143
172
- msgid "Frequently Asked Questions"
173
- msgstr ""
174
-
175
- #: classes/class-wcdn-settings.php:145
176
- msgid "Project on WordPress.org"
177
- msgstr ""
178
-
179
- #: classes/class-wcdn-settings.php:146
180
- msgid "Project on GitHub"
181
- msgstr ""
182
-
183
- #: classes/class-wcdn-settings.php:154
184
- msgid "Print"
185
- msgstr ""
186
-
187
- #: classes/class-wcdn-settings.php:194
188
- msgid "Invoices and Delivery Notes"
189
- msgstr ""
190
-
191
- #: classes/class-wcdn-settings.php:218
192
- msgid "Company/Shop Name"
193
- msgstr ""
194
-
195
- #: classes/class-wcdn-settings.php:225
196
- msgid "Leave blank to use the default Website/ Blog title defined in WordPress settings."
197
- msgstr ""
198
-
199
- #: classes/class-wcdn-settings.php:231
200
- msgid "Company/Shop Address"
201
- msgstr ""
202
-
203
- #: classes/class-wcdn-settings.php:238
204
- msgid "Leave blank to not print an address."
205
- msgstr ""
206
-
207
- #: classes/class-wcdn-settings.php:244
208
- msgid "Personal Notes"
209
- msgstr ""
210
-
211
- #: classes/class-wcdn-settings.php:251
212
- msgid "Leave blank to not print any personal notes."
213
- msgstr ""
214
-
215
- #: classes/class-wcdn-settings.php:262
216
- msgid "Here you can add some more policies, conditions etc. For example add a returns policy in case the client would like to send back some goods. In some countries (e.g. in the European Union) this is required so please add any required info in accordance with the statutory regulations."
217
- msgstr ""
218
-
219
- #: classes/class-wcdn-settings.php:264
220
- msgid "Leave blank to not print any policies or conditions."
221
- msgstr ""
222
-
223
- #: classes/class-wcdn-settings.php:270
224
- msgid "Footer Imprint"
225
- msgstr ""
226
-
227
- #: classes/class-wcdn-settings.php:277
228
- msgid "Leave blank to not print a footer."
229
- msgstr ""
230
-
231
- #: classes/class-wcdn-settings.php:309
232
- msgid "Order Numbering Options"
233
- msgstr ""
234
-
235
- #: classes/class-wcdn-writepanel.php:92
236
- msgid "Order Print"
237
- msgstr ""
238
-
239
- #: classes/class-wcdn-writepanel.php:76 classes/class-wcdn-writepanel.php:77
240
- #: classes/class-wcdn-writepanel.php:102
241
- msgid "Print Invoice"
242
- msgstr ""
243
-
244
- #: classes/class-wcdn-writepanel.php:78 classes/class-wcdn-writepanel.php:80
245
- #: classes/class-wcdn-writepanel.php:81 classes/class-wcdn-writepanel.php:82
246
- #: classes/class-wcdn-writepanel.php:103
247
- msgid "Print Delivery Note"
248
- msgstr ""
249
-
250
- #: woocommerce-delivery-notes.php:201
251
- msgid "Invoice"
252
- msgstr ""
253
-
254
- #: templates/print/print-delivery-note.php:20
255
- msgid "Recipient"
256
- msgstr ""
257
-
258
- #: templates/print/print-delivery-note.php:96
259
- msgid "Customer Notes"
260
- msgstr ""
261
-
262
- #: woocommerce-delivery-notes.php:0
263
- msgid "WooCommerce Print Invoices & Delivery Notes"
264
- msgstr ""
265
-
266
- #: woocommerce-delivery-notes.php:0
267
- msgid "Print order invoices & delivery notes for WooCommerce shop plugin. You can add company/shop info as well as personal notes & policies to print pages."
268
- msgstr ""
269
-
270
- #: woocommerce-delivery-notes.php:0
271
- msgid "Steve Clark, Triggvy Gunderson, David Decker"
272
- msgstr ""
273
-
274
- #: classes/class-wcdn-settings.php:136
275
- msgid "This plugin enables you to add a Invoice or simple Delivery Note page for printing for your orders in WooCommerce shop plugin. You can add your company postal address, further add personal notes, refund or other policies and a footer note/branding. This helps speed up your daily shop and order management. In some countries (e.g. in the European Union) it is also required to advice the customer with proper refund policies so this little plugin might help you a bit with that too."
276
- msgstr ""
277
-
278
- #: classes/class-wcdn-settings.php:137
279
- msgid "Just look under <a href=\"%1$s\">WooCommerce > Orders</a> and there go to a single order view. On the right side you will see the Order Print meta box. Click one of the buttons and you get the invoice or delivery note printing page. Yes, it is that easy :-)."
280
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/woocommerce-delivery-notes.pot CHANGED
@@ -1,138 +1,91 @@
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WooCommerce Print Invoices & Delivery Notes\n"
4
- "POT-Creation-Date: 2013-06-16 14:03+0100\n"
5
- "PO-Revision-Date: 2013-06-16 14:03+0100\n"
6
- "Last-Translator: \n"
 
7
  "Language-Team: \n"
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.5\n"
12
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;"
13
- "_ex:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;"
14
- "esc_html_x:1,2c\n"
15
- "X-Poedit-Basepath: .\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
 
 
 
 
 
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
- #: ../woocommerce-delivery-notes.php:124
20
- msgid "FAQ"
21
- msgstr ""
22
-
23
- #: ../woocommerce-delivery-notes.php:125
24
- msgid "Support"
25
- msgstr ""
26
-
27
- #: ../woocommerce-delivery-notes.php:134
28
- msgid "Go to the settings page"
29
- msgstr ""
30
-
31
- #: ../woocommerce-delivery-notes.php:134
32
- msgid "Settings"
33
- msgstr ""
34
-
35
- #: ../woocommerce-delivery-notes.php:201
36
- msgid "Invoice"
37
- msgstr ""
38
-
39
- #: ../woocommerce-delivery-notes.php:203
40
- msgid "Delivery Note"
41
- msgstr ""
42
-
43
- #: ../woocommerce-delivery-notes.php:302
44
- #: ../classes/class-wcdn-settings.php:154
45
  msgid "Print"
46
  msgstr ""
47
 
48
- #: ../woocommerce-delivery-notes.php:391 ../woocommerce-delivery-notes.php:405
49
- msgid "N/A"
50
- msgstr ""
51
-
52
- #: ../classes/class-wcdn-print.php:63 ../classes/class-wcdn-print.php:68
53
- #: ../classes/class-wcdn-print.php:73 ../classes/class-wcdn-print.php:78
54
- msgid "You do not have sufficient permissions to access this page."
55
  msgstr ""
56
 
57
- #: ../classes/class-wcdn-settings.php:132
58
- #: ../classes/class-wcdn-settings.php:135
59
- msgid "About the Plugin"
60
- msgstr ""
61
-
62
- #: ../classes/class-wcdn-settings.php:134
63
- msgid "Plugin: WooCommerce Print Invoices & Delivery Notes"
64
- msgstr ""
65
-
66
- #: ../classes/class-wcdn-settings.php:136
67
- msgid ""
68
- "This plugin enables you to add a Invoice or simple Delivery Note page for "
69
- "printing for your orders in WooCommerce shop plugin. You can add your "
70
- "company postal address, further add personal notes, refund or other policies "
71
- "and a footer note/branding. This helps speed up your daily shop and order "
72
- "management. In some countries (e.g. in the European Union) it is also "
73
- "required to advice the customer with proper refund policies so this little "
74
- "plugin might help you a bit with that too."
75
- msgstr ""
76
-
77
- #: ../classes/class-wcdn-settings.php:137
78
  #, php-format
79
  msgid ""
80
- "Just look under <a href=\"%1$s\">WooCommerce > Orders</a> and there go to a "
81
- "single order view. On the right side you will see the Order Print meta box. "
82
- "Click one of the buttons and you get the invoice or delivery note printing "
83
- "page. Yes, it is that easy :-)."
84
- msgstr ""
85
-
86
- #: ../classes/class-wcdn-settings.php:142
87
- msgid "For more information:"
88
- msgstr ""
89
-
90
- #: ../classes/class-wcdn-settings.php:143
91
- msgid "Frequently Asked Questions"
92
- msgstr ""
93
-
94
- #: ../classes/class-wcdn-settings.php:144
95
- msgid "Get Community Support"
96
- msgstr ""
97
-
98
- #: ../classes/class-wcdn-settings.php:145
99
- msgid "Project on WordPress.org"
100
- msgstr ""
101
-
102
- #: ../classes/class-wcdn-settings.php:146
103
- msgid "Project on GitHub"
104
  msgstr ""
105
 
106
- #: ../classes/class-wcdn-settings.php:194
107
- msgid "Invoices and Delivery Notes"
 
 
108
  msgstr ""
109
 
110
- #: ../classes/class-wcdn-settings.php:202
 
111
  msgid "Company/Shop Logo"
112
  msgstr ""
113
 
114
- #: ../classes/class-wcdn-settings.php:207
 
115
  msgid "Remove Logo"
116
  msgstr ""
117
 
118
- #: ../classes/class-wcdn-settings.php:208
 
119
  msgid "Set Logo"
120
  msgstr ""
121
 
122
- #: ../classes/class-wcdn-settings.php:210
 
123
  msgid "A company/shop logo representing your business."
124
  msgstr ""
125
 
126
- #: ../classes/class-wcdn-settings.php:211
127
- #: ../classes/class-wcdn-settings.php:224
128
- #: ../classes/class-wcdn-settings.php:237
129
- #: ../classes/class-wcdn-settings.php:250
130
- #: ../classes/class-wcdn-settings.php:263
131
- #: ../classes/class-wcdn-settings.php:276
 
132
  msgid "Note:"
133
  msgstr ""
134
 
135
- #: ../classes/class-wcdn-settings.php:212
 
136
  msgid ""
137
  "When the image is printed, its pixel density will automatically be eight "
138
  "times higher than the original. This means, 1 printed inch will correspond "
@@ -141,53 +94,64 @@ msgid ""
141
  "to 1 inch."
142
  msgstr ""
143
 
144
- #: ../classes/class-wcdn-settings.php:218
 
145
  msgid "Company/Shop Name"
146
  msgstr ""
147
 
148
- #: ../classes/class-wcdn-settings.php:223
 
149
  msgid "Your company/shop name for the Delivery Note."
150
  msgstr ""
151
 
152
- #: ../classes/class-wcdn-settings.php:225
 
153
  msgid ""
154
- "Leave blank to use the default Website/ Blog title defined in WordPress "
155
- "settings."
156
  msgstr ""
157
 
158
- #: ../classes/class-wcdn-settings.php:231
 
159
  msgid "Company/Shop Address"
160
  msgstr ""
161
 
162
- #: ../classes/class-wcdn-settings.php:236
 
163
  msgid ""
164
- "The postal address of the company/shop, which gets printed right of the "
165
- "company/shop name, above the order listings."
166
  msgstr ""
167
 
168
- #: ../classes/class-wcdn-settings.php:238
 
169
  msgid "Leave blank to not print an address."
170
  msgstr ""
171
 
172
- #: ../classes/class-wcdn-settings.php:244
173
- msgid "Personal Notes"
 
174
  msgstr ""
175
 
176
- #: ../classes/class-wcdn-settings.php:249
 
177
  msgid ""
178
  "Add some personal notes, or season greetings or whatever (e.g. Thank You for "
179
  "Your Order!, Merry Christmas!, etc.)."
180
  msgstr ""
181
 
182
- #: ../classes/class-wcdn-settings.php:251
 
183
  msgid "Leave blank to not print any personal notes."
184
  msgstr ""
185
 
186
- #: ../classes/class-wcdn-settings.php:257
187
- msgid "Returns Policy, Conditions, etc.:"
 
188
  msgstr ""
189
 
190
- #: ../classes/class-wcdn-settings.php:262
 
191
  msgid ""
192
  "Here you can add some more policies, conditions etc. For example add a "
193
  "returns policy in case the client would like to send back some goods. In "
@@ -195,124 +159,219 @@ msgid ""
195
  "any required info in accordance with the statutory regulations."
196
  msgstr ""
197
 
198
- #: ../classes/class-wcdn-settings.php:264
 
199
  msgid "Leave blank to not print any policies or conditions."
200
  msgstr ""
201
 
202
- #: ../classes/class-wcdn-settings.php:270
203
- msgid "Footer Imprint"
 
204
  msgstr ""
205
 
206
- #: ../classes/class-wcdn-settings.php:275
 
207
  msgid ""
208
- "Add some further footer imprint, copyright notes etc. to get the printed "
209
- "sheets a bit more branded to your needs."
210
  msgstr ""
211
 
212
- #: ../classes/class-wcdn-settings.php:277
 
213
  msgid "Leave blank to not print a footer."
214
  msgstr ""
215
 
216
- #: ../classes/class-wcdn-settings.php:301
217
- #, php-format
218
- msgid ""
219
- "You can <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s\">preview the invoice "
220
- "template</a> or <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s\">the delivery "
221
- "note template</a>."
222
  msgstr ""
223
 
224
- #: ../classes/class-wcdn-settings.php:302
 
 
 
 
 
 
225
  msgid ""
226
- "For more advanced control copy <code>woocommerce-delivery-notes/templates/"
227
- "print/style.css</code> to <code>your-theme-name/woocommerce/print/style.css</"
228
- "code>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  msgstr ""
230
 
231
- #: ../classes/class-wcdn-settings.php:309
232
- msgid "Order Numbering Options"
 
233
  msgstr ""
234
 
235
- #: ../classes/class-wcdn-settings.php:314
 
236
  msgid "Sequential order number"
237
  msgstr ""
238
 
239
- #: ../classes/class-wcdn-settings.php:318
 
240
  msgid "Sequential numbering is enabled."
241
  msgstr ""
242
 
243
- #: ../classes/class-wcdn-settings.php:320
 
244
  #, php-format
245
  msgid ""
246
  "Install and activate the free <a href=\"%s\">WooCommerce Sequential Order "
247
  "Numbers</a> Plugin."
248
  msgstr ""
249
 
250
- #: ../classes/class-wcdn-writepanel.php:76
251
- #: ../classes/class-wcdn-writepanel.php:77
252
- #: ../classes/class-wcdn-writepanel.php:102
 
 
 
253
  msgid "Print Invoice"
254
  msgstr ""
255
 
256
- #: ../classes/class-wcdn-writepanel.php:78
257
- #: ../classes/class-wcdn-writepanel.php:80
258
- #: ../classes/class-wcdn-writepanel.php:81
259
- #: ../classes/class-wcdn-writepanel.php:82
260
- #: ../classes/class-wcdn-writepanel.php:103
 
261
  msgid "Print Delivery Note"
262
  msgstr ""
263
 
264
- #: ../classes/class-wcdn-writepanel.php:92
265
- msgid "Order Print"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  msgstr ""
267
 
268
- #: ../templates/print/print-delivery-note.php:23
269
- msgid "Recipient"
 
270
  msgstr ""
271
 
272
- #: ../templates/print/print-delivery-note.php:40
273
- msgid "Order Date"
 
 
 
 
 
 
 
 
 
 
 
274
  msgstr ""
275
 
276
- #: ../templates/print/print-delivery-note.php:44
 
277
  msgid "Order Number"
278
  msgstr ""
279
 
280
- #: ../templates/print/print-delivery-note.php:48
 
 
 
 
 
 
281
  msgid "Payment Method"
282
  msgstr ""
283
 
284
- #: ../templates/print/print-delivery-note.php:52
 
285
  msgid "Email"
286
  msgstr ""
287
 
288
- #: ../templates/print/print-delivery-note.php:56
289
- msgid "Phone"
 
290
  msgstr ""
291
 
292
- #: ../templates/print/print-delivery-note.php:65
293
- msgid "Product"
294
  msgstr ""
295
 
296
- #: ../templates/print/print-delivery-note.php:66
297
- msgid "Quantity"
 
298
  msgstr ""
299
 
300
- #: ../templates/print/print-delivery-note.php:67
301
- msgid "Totals"
 
 
302
  msgstr ""
303
 
304
- #: ../templates/print/print-delivery-note.php:75
305
- msgid "SKU:"
 
 
 
 
 
 
306
  msgstr ""
307
 
308
- #: ../templates/print/print-delivery-note.php:76
309
- msgid "Weight:"
 
310
  msgstr ""
311
 
312
- #: ../templates/print/print-delivery-note.php:81
 
313
  msgid "Download:"
314
  msgstr ""
315
 
316
- #: ../templates/print/print-delivery-note.php:109
317
- msgid "Customer Notes"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  msgstr ""
1
+ # This German Language File: Copyright (C) 2011-2013 by David Decker of deckerweb.de & genesisthemes.de
2
+ # This file is distributed under the same license as the WooCommerce Print Invoices & Delivery Notes Plugin package.
3
+ #
4
+ # Weitere deutsche Sprachdateien fuer WooCommerce und Extensions (Erweiterungen)
5
+ # sowie fuer WordPress-Plugins und -Themes finden Sie unter:
6
+ # --> http://deckerweb.de/sprachdateien/
7
+ #
8
  msgid ""
9
  msgstr ""
10
+ "Project-Id-Version: WooCommerce Print Invoice & Delivery Note\n"
11
+ "Report-Msgid-Bugs-To: http://deckerweb.de/kontakt/\n"
12
+ "POT-Creation-Date: 2014-04-10 20:36+0100\n"
13
+ "PO-Revision-Date: 2014-04-10 20:36+0100\n"
14
+ "Last-Translator: David Decker <deckerweb.mobil@googlemail.com>\n"
15
  "Language-Team: \n"
16
+ "Language: en\n"
17
  "MIME-Version: 1.0\n"
18
  "Content-Type: text/plain; charset=UTF-8\n"
19
  "Content-Transfer-Encoding: 8bit\n"
20
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
21
+ "X-Generator: Poedit 1.6.4\n"
 
 
 
22
  "X-Poedit-SourceCharset: UTF-8\n"
23
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
24
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
25
+ "esc_attr_e;esc_attr__\n"
26
+ "X-Poedit-Basepath: .\n"
27
+ "X-Textdomain-Support: yes\n"
28
  "X-Poedit-SearchPath-0: ..\n"
29
 
30
+ # @ woocommerce-delivery-notes
31
+ #: ../includes/class-wcdn-settings.php:90 ../includes/class-wcdn-theme.php:52
32
+ #: ../includes/class-wcdn-theme.php:71
33
+ #: ../includes/wcdn-template-functions.php:118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  msgid "Print"
35
  msgstr ""
36
 
37
+ # @ woocommerce-delivery-notes
38
+ #: ../includes/class-wcdn-settings.php:128
39
+ msgid "Print Order"
 
 
 
 
40
  msgstr ""
41
 
42
+ # @ woocommerce-delivery-notes
43
+ #: ../includes/class-wcdn-settings.php:147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  #, php-format
45
  msgid ""
46
+ "You can preview the <a href=\"%1$s\" target=\"%3$s\" class=\"%4$s\">invoice "
47
+ "template</a> or <a href=\"%2$s\" target=\"%3$s\" class=\"%4$s\">delivery "
48
+ "note template</a>."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  msgstr ""
50
 
51
+ # @ woocommerce-delivery-notes
52
+ #: ../includes/class-wcdn-settings.php:148
53
+ msgid ""
54
+ "With the FAQ in the readme file you can learn how to customize the template."
55
  msgstr ""
56
 
57
+ # @ woocommerce-delivery-notes
58
+ #: ../includes/class-wcdn-settings.php:159
59
  msgid "Company/Shop Logo"
60
  msgstr ""
61
 
62
+ # @ woocommerce-delivery-notes
63
+ #: ../includes/class-wcdn-settings.php:165
64
  msgid "Remove Logo"
65
  msgstr ""
66
 
67
+ # @ woocommerce-delivery-notes
68
+ #: ../includes/class-wcdn-settings.php:166
69
  msgid "Set Logo"
70
  msgstr ""
71
 
72
+ # @ woocommerce-delivery-notes
73
+ #: ../includes/class-wcdn-settings.php:170
74
  msgid "A company/shop logo representing your business."
75
  msgstr ""
76
 
77
+ # @ woocommerce-delivery-notes
78
+ #: ../includes/class-wcdn-settings.php:171
79
+ #: ../includes/class-wcdn-settings.php:184
80
+ #: ../includes/class-wcdn-settings.php:197
81
+ #: ../includes/class-wcdn-settings.php:210
82
+ #: ../includes/class-wcdn-settings.php:223
83
+ #: ../includes/class-wcdn-settings.php:236
84
  msgid "Note:"
85
  msgstr ""
86
 
87
+ # @ woocommerce-delivery-notes
88
+ #: ../includes/class-wcdn-settings.php:172
89
  msgid ""
90
  "When the image is printed, its pixel density will automatically be eight "
91
  "times higher than the original. This means, 1 printed inch will correspond "
94
  "to 1 inch."
95
  msgstr ""
96
 
97
+ # @ woocommerce-delivery-notes
98
+ #: ../includes/class-wcdn-settings.php:178
99
  msgid "Company/Shop Name"
100
  msgstr ""
101
 
102
+ # @ woocommerce-delivery-notes
103
+ #: ../includes/class-wcdn-settings.php:183
104
  msgid "Your company/shop name for the Delivery Note."
105
  msgstr ""
106
 
107
+ # @ woocommerce-delivery-notes
108
+ #: ../includes/class-wcdn-settings.php:185
109
  msgid ""
110
+ "Leave blank to use the default Website/Blog title defined in WordPress "
111
+ "settings. The name will be ignored when a Logo is set."
112
  msgstr ""
113
 
114
+ # @ woocommerce-delivery-notes
115
+ #: ../includes/class-wcdn-settings.php:191
116
  msgid "Company/Shop Address"
117
  msgstr ""
118
 
119
+ # @ woocommerce-delivery-notes
120
+ #: ../includes/class-wcdn-settings.php:196
121
  msgid ""
122
+ "The postal address of the company/shop or even e-mail or telephone, which "
123
+ "gets printed right after the company/shop name."
124
  msgstr ""
125
 
126
+ # @ woocommerce-delivery-notes
127
+ #: ../includes/class-wcdn-settings.php:198
128
  msgid "Leave blank to not print an address."
129
  msgstr ""
130
 
131
+ # @ woocommerce-delivery-notes
132
+ #: ../includes/class-wcdn-settings.php:204
133
+ msgid "Complimentary close"
134
  msgstr ""
135
 
136
+ # @ woocommerce-delivery-notes
137
+ #: ../includes/class-wcdn-settings.php:209
138
  msgid ""
139
  "Add some personal notes, or season greetings or whatever (e.g. Thank You for "
140
  "Your Order!, Merry Christmas!, etc.)."
141
  msgstr ""
142
 
143
+ # @ woocommerce-delivery-notes
144
+ #: ../includes/class-wcdn-settings.php:211
145
  msgid "Leave blank to not print any personal notes."
146
  msgstr ""
147
 
148
+ # @ woocommerce-delivery-notes
149
+ #: ../includes/class-wcdn-settings.php:217
150
+ msgid "Returns Policy, Conditions, etc"
151
  msgstr ""
152
 
153
+ # @ woocommerce-delivery-notes
154
+ #: ../includes/class-wcdn-settings.php:222
155
  msgid ""
156
  "Here you can add some more policies, conditions etc. For example add a "
157
  "returns policy in case the client would like to send back some goods. In "
159
  "any required info in accordance with the statutory regulations."
160
  msgstr ""
161
 
162
+ # @ woocommerce-delivery-notes
163
+ #: ../includes/class-wcdn-settings.php:224
164
  msgid "Leave blank to not print any policies or conditions."
165
  msgstr ""
166
 
167
+ # @ woocommerce-delivery-notes
168
+ #: ../includes/class-wcdn-settings.php:230
169
+ msgid "Footer"
170
  msgstr ""
171
 
172
+ # @ woocommerce-delivery-notes
173
+ #: ../includes/class-wcdn-settings.php:235
174
  msgid ""
175
+ "Add some further footer imprint, e-mail, telephone, copyright notes etc. "
176
+ "This makes the printed sheets a bit more branded."
177
  msgstr ""
178
 
179
+ # @ woocommerce-delivery-notes
180
+ #: ../includes/class-wcdn-settings.php:237
181
  msgid "Leave blank to not print a footer."
182
  msgstr ""
183
 
184
+ # @ woocommerce-delivery-notes
185
+ #: ../includes/class-wcdn-settings.php:244
186
+ msgid "Options"
 
 
 
187
  msgstr ""
188
 
189
+ # @ woocommerce-delivery-notes
190
+ #: ../includes/class-wcdn-settings.php:249
191
+ msgid "Print Page Endpoint"
192
+ msgstr ""
193
+
194
+ # @ woocommerce-delivery-notes
195
+ #: ../includes/class-wcdn-settings.php:256
196
  msgid ""
197
+ "The endpoint is appended to the accounts page URL to print the order. It "
198
+ "should be unique."
199
+ msgstr ""
200
+
201
+ # @ woocommerce-delivery-notes
202
+ #: ../includes/class-wcdn-settings.php:262
203
+ msgid "Theme Print Buttons"
204
+ msgstr ""
205
+
206
+ # @ woocommerce-delivery-notes
207
+ #: ../includes/class-wcdn-settings.php:269
208
+ msgid "Show print button on the \"View Order\" page"
209
+ msgstr ""
210
+
211
+ # @ woocommerce-delivery-notes
212
+ #: ../includes/class-wcdn-settings.php:276
213
+ msgid "Show print buttons on the \"My Account\" page"
214
  msgstr ""
215
 
216
+ # @ woocommerce-delivery-notes
217
+ #: ../includes/class-wcdn-settings.php:284
218
+ msgid "Order Numbering"
219
  msgstr ""
220
 
221
+ # @ woocommerce-delivery-notes
222
+ #: ../includes/class-wcdn-settings.php:289
223
  msgid "Sequential order number"
224
  msgstr ""
225
 
226
+ # @ woocommerce-delivery-notes
227
+ #: ../includes/class-wcdn-settings.php:293
228
  msgid "Sequential numbering is enabled."
229
  msgstr ""
230
 
231
+ # @ woocommerce-delivery-notes
232
+ #: ../includes/class-wcdn-settings.php:295
233
  #, php-format
234
  msgid ""
235
  "Install and activate the free <a href=\"%s\">WooCommerce Sequential Order "
236
  "Numbers</a> Plugin."
237
  msgstr ""
238
 
239
+ # @ woocommerce-delivery-notes
240
+ #: ../includes/class-wcdn-writepanel.php:83
241
+ #: ../includes/class-wcdn-writepanel.php:84
242
+ #: ../includes/class-wcdn-writepanel.php:105
243
+ #: ../includes/class-wcdn-writepanel.php:106
244
+ #: ../includes/class-wcdn-writepanel.php:190
245
  msgid "Print Invoice"
246
  msgstr ""
247
 
248
+ # @ woocommerce-delivery-notes
249
+ #: ../includes/class-wcdn-writepanel.php:86
250
+ #: ../includes/class-wcdn-writepanel.php:87
251
+ #: ../includes/class-wcdn-writepanel.php:108
252
+ #: ../includes/class-wcdn-writepanel.php:109
253
+ #: ../includes/class-wcdn-writepanel.php:191
254
  msgid "Print Delivery Note"
255
  msgstr ""
256
 
257
+ # @ woocommerce-delivery-notes
258
+ #: ../includes/class-wcdn-writepanel.php:164
259
+ #, php-format
260
+ msgid "Invoice created."
261
+ msgid_plural "%s invoices created."
262
+ msgstr[0] ""
263
+ msgstr[1] ""
264
+
265
+ # @ woocommerce-delivery-notes
266
+ #: ../includes/class-wcdn-writepanel.php:166
267
+ #, php-format
268
+ msgid "Delivery note created."
269
+ msgid_plural "%s delivery notes created."
270
+ msgstr[0] ""
271
+ msgstr[1] ""
272
+
273
+ # @ woocommerce-delivery-notes
274
+ #: ../includes/class-wcdn-writepanel.php:170
275
+ msgid "Print now"
276
  msgstr ""
277
 
278
+ # @ woocommerce-delivery-notes
279
+ #: ../includes/class-wcdn-writepanel.php:181
280
+ msgid "Order Printing"
281
  msgstr ""
282
 
283
+ # @ woocommerce-delivery-notes
284
+ #: ../includes/wcdn-template-functions.php:32
285
+ msgid "Invoice"
286
+ msgstr ""
287
+
288
+ # @ woocommerce-delivery-notes
289
+ #: ../includes/wcdn-template-functions.php:34
290
+ msgid "Delivery Note"
291
+ msgstr ""
292
+
293
+ # @ woocommerce-delivery-notes
294
+ #: ../includes/wcdn-template-functions.php:36
295
+ msgid "Order"
296
  msgstr ""
297
 
298
+ # @ woocommerce-delivery-notes
299
+ #: ../includes/wcdn-template-functions.php:202
300
  msgid "Order Number"
301
  msgstr ""
302
 
303
+ # @ woocommerce-delivery-notes
304
+ #: ../includes/wcdn-template-functions.php:206
305
+ msgid "Order Date"
306
+ msgstr ""
307
+
308
+ # @ woocommerce-delivery-notes
309
+ #: ../includes/wcdn-template-functions.php:210
310
  msgid "Payment Method"
311
  msgstr ""
312
 
313
+ # @ woocommerce-delivery-notes
314
+ #: ../includes/wcdn-template-functions.php:217
315
  msgid "Email"
316
  msgstr ""
317
 
318
+ # @ woocommerce-delivery-notes
319
+ #: ../includes/wcdn-template-functions.php:224
320
+ msgid "Telephone"
321
  msgstr ""
322
 
323
+ #: ../includes/wcdn-template-functions.php:241
324
+ msgid "SKU:"
325
  msgstr ""
326
 
327
+ # @ woocommerce-delivery-notes
328
+ #: ../templates/print-order/print-content.php:28
329
+ msgid "Billing Address"
330
  msgstr ""
331
 
332
+ # @ woocommerce-delivery-notes
333
+ #: ../templates/print-order/print-content.php:31
334
+ #: ../templates/print-order/print-content.php:42
335
+ msgid "N/A"
336
  msgstr ""
337
 
338
+ # @ woocommerce-delivery-notes
339
+ #: ../templates/print-order/print-content.php:39
340
+ msgid "Shipping Address"
341
+ msgstr ""
342
+
343
+ # @ woocommerce-delivery-notes
344
+ #: ../templates/print-order/print-content.php:74
345
+ msgid "Product"
346
  msgstr ""
347
 
348
+ # @ woocommerce-delivery-notes
349
+ #: ../templates/print-order/print-content.php:75
350
+ msgid "Total"
351
  msgstr ""
352
 
353
+ # @ woocommerce-delivery-notes
354
+ #: ../templates/print-order/print-content.php:100
355
  msgid "Download:"
356
  msgstr ""
357
 
358
+ # @ woocommerce-delivery-notes
359
+ #: ../templates/print-order/print-content.php:101
360
+ #, php-format
361
+ msgid "%s Files"
362
+ msgstr ""
363
+
364
+ # @ woocommerce-delivery-notes
365
+ #: ../templates/print-order/print-content.php:144
366
+ msgid "Customer Note"
367
+ msgstr ""
368
+
369
+ # @ woocommerce-delivery-notes
370
+ #: ../woocommerce-delivery-notes.php:144
371
+ msgid "Go to the settings page"
372
+ msgstr ""
373
+
374
+ # @ woocommerce-delivery-notes
375
+ #: ../woocommerce-delivery-notes.php:144
376
+ msgid "Settings"
377
  msgstr ""
readme.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WooCommerce Print Invoice & Delivery Note
2
+
3
+ This is the WooCommerce Print Invoice & Delivery Note repository on GitHub. Here you can browse the source, look at open issues and keep track of development.
4
+
5
+ ## Support
6
+
7
+ This repository is not suitable for support. Please don't use the issue tracker for support requests, but for source code issues only. Support can take place in the [public support forums](http://wordpress.org/support/plugin/woocommerce-delivery-notes) on WordPress.org, where the community can help each other out.
8
+
9
+ ## Contributing
10
+
11
+ If you have a patch, or stumbled upon an issue with the source code that isn't a [WooCommerce issue](https://github.com/woothemes/woocommerce/issues?labels=Bug&milestone=22&state=open), you can contribute this back to the code. Make sure you have a [GitHub](https://github.com/signup/free) account. Then [submit a ticket](https://github.com/piffpaffpuff/woocommerce-delivery-notes/issues) for your issue and clearly describe the steps to reproduce the bug.
12
+
13
+ To correct the issue by your own, you can fork the repository and send a pull request to include your changes.
14
+
15
+ ## Translating
16
+
17
+ Contribute and update your translations with the [GlotPress repository](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes). Make sure you have [registred an account](http://translate.wpautobahn.com/home/). Translations will be included when a new plugin release is imminent.
readme.txt CHANGED
@@ -1,251 +1,244 @@
1
- === WooCommerce Print Invoices & Delivery Notes ===
2
- Contributors: chabis, daveshine
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=wartamau%40gmail%2ecom&lc=US&item_name=piffpaffpuff&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
- Tags: delivery notes, delivery, shipping, print, order, invoice, invoices, woocommerce, woothemes, shop, shop manager, deckerweb
5
- Requires at least: 3.5 and WooCommerce 2.0
6
- Tested up to: 3.5.1 and WooCommerce 2.0.8
 
7
  Stable tag: trunk
8
  License: GPLv3 or later
9
  License URI: http://www.opensource.org/licenses/gpl-license.php
10
 
11
- Print order invoices & delivery notes for WooCommerce shop. You can add company/shop info as well as personal notes & policies to print pages.
12
 
13
  == Description ==
14
 
15
- With this plugin you can print out **simple invoices and delivery notes** for the orders **via the WooCommerce Shop Plugin**. You can edit the Company/Shop name, Company/Shop postal address and also add personal notes, conditions/policies (like a refund policy) and a footer imprint/branding.
 
 
16
 
17
- The plugin adds a new side panel on the order page to allow shop administrators to print out delivery notes. This is useful for a lot of shops that sell goods which need delivery notes for shipping or with added refund policies etc. In some countries (e.g. in the European Union) such refund policies are required so this plugin could help to combine this with the order info for the customer.
18
 
19
- = Features =
20
- * The plugin comes with an attached template for the invoice and delivery note (printing) page - you could also copy this to your theme and customize it to your needs! The plugin will recognize the new place. (See under [FAQ here](http://wordpress.org/extend/plugins/woocommerce-delivery-notes/faq/))
21
- * All setting fields on the plugin's settings pages are optional - you can leave them empty to not use them at all or only apply what you need.
22
- * If the company/shop name field is left empty then the regular website/blog title is used (defined via regular WordPress options)
23
- * If there are added "Customer Notes" (regular WooCommerce feature) for an order these will automatically displayed at the bottom of the delivery note.
24
- * Custom order numbering via the free [WooCommerce Sequential Order Numbers](http://wordpress.org/extend/plugins/woocommerce-sequential-order-numbers/) plugin.
25
- * Included help tab system.
26
- * Localized in English, German, Dutch, Swedish, Spanish, French, Italian, Polish, Russian, Turkish, Slovakian, Finnish and Portuguese (BR). (thanks to all translators, submit your translation) - some of them only partial yet (we'd love to see you [complete them](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes) :).
27
 
28
- Credit where credit is due: This plugin here is inspired and based on the work of Steve Clark, Trigvvy Gunderson and the awesome "Jigoshop Delivery Notes" plugin! See below how you can contribute to the further development of both:
29
 
30
- = Translations =
31
- * Translate and submit files with our [GlotPress](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes) tool. Read to the [translation](http://wordpress.org/extend/plugins/woocommerce-delivery-notes/other_notes/) section to learn more.
32
 
33
- = Feedback =
34
- * We are open for your suggestions and feedback! Use the [plugin's forum](http://wordpress.org/tags/woocommerce-delivery-notes?forum_id=10).
35
 
 
36
 
37
  == Installation ==
38
 
39
- 1. Upload the entire `woocommerce-delivery-notes` folder to the `/wp-content/plugins/` directory
40
- 2. Activate the plugin through the 'Plugins' menu in WordPress
41
- 3. Look under the regular WooCommerce settings menu: "WooCommerce > Settings > Tab "Print" and adjust them to your needs
42
- 4. On single order pages you'll find a new meta box on the right side where it says "Order Print" you can open the invoice or delivery note for the actual order and print it out directly
43
- 5. Go and manage your orders - good luck with sales :)
44
 
45
  == Frequently Asked Questions ==
46
 
47
- = Why is my company logo not displayed at the size I've uploaded it? =
48
- Printed paper needs a higher pixel density for images than the screen. To make your printed logo look nice and crisp it will be resized via CSS to a fourth of the uploaded pixel size. This means: An image of 400p x 400px will be displayed as a 100px x 100px image but will be printed with the original amount of pixels. With the resizing, 288 pixels of the original image width correspond to about 1 printed inch.
 
 
 
 
 
 
 
 
 
49
 
50
- = How can I change the address format of the recipient? =
51
- WooCommerce includes address formats for many different countries. But maybe your country format isn't included. For such cases you can define your own format with a filter in your `functions.php` if you know your country code (ie `LI`).
 
 
 
 
 
 
 
 
 
52
 
53
  `
54
- function custom_localisation_address_formats($formats) {
55
- $formats['LI'] = "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}";
56
- return $formats;
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
- add_filter('woocommerce_localisation_address_formats', 'custom_localisation_address_formats');
59
  `
60
 
61
- = How can I use a custom CSS file for the printing page without copying and editing the template files? =
62
- Copy the `style.css` (and no other file) from the `/wp-content/plugins/woocommerce-delivery-notes/templates/print` folder and paste it inside your `/wp-content/themes/your-theme-name/woocommerce/print` folder (if not there just create it). You can modify CSS to fit your own needs.
63
 
64
- *Note:* There is automatically a class assigned to the html tag that helps you to target the template-type in your CSS.
65
 
66
- = How can I use a custom template for the printing page? =
67
- If you want to use your own template then all you need to do is copy the the files you want to edit from `/wp-content/plugins/woocommerce-delivery-notes/templates/print` folder and paste them inside your `/wp-content/themes/your-theme-name/woocommerce/print` folder (if not there just create it). The folder from the plugin comes with the default templates and the basic CSS files. You can modifiy those to fit your own needs.
68
 
69
- = What template functions can I use? =
70
- All WordPress and all functions from other plugins and themes can be used. There are also many many specific template functions. Open the `/wp-content/plugins/woocommerce-delivery-notes/woocommerce-delivery-notes.php` file to see all of them.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
- = How do I add more info or custom fields to the templates? =
73
- Create a custom template (see questions above). Then edit the file to your needs. You can use all functions that are available in WordPress or any activated plugin or theme.
74
 
75
- Example: Show an order custom field that was added by another plugin (e.g. `'_my_custom_field'`)
76
 
77
- `echo wcdn_get_order_custom_field('_my_custom_field');`
78
 
79
- = What will actually get printed out? =
80
- The page will be printed as you see it in your browser when you enabled the preview.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
- Beyond the styling of the template be aware of any special features of the used browser. They may not print websites properly or add a pagination or website url. Use a "Print Preview" feature of your browser which all current versions of Firefox, Chrome, Safari and Opera support.
83
 
84
- = How can I translate the plugin with my own wording? =
85
- For custom and update-secure language files please upload them to `/wp-content/languages/woocommerce-delivery-notes/` (just create this folder) - This enables you to use fully custom translations that won't be overridden on plugin updates. Also, complete custom English wording is possible with that, just use a language file like `woocommerce-delivery-notes-en_US.mo/.po` to achieve that (for creating one see the tools on "Other Notes"). And finally contact one of the developers if you would like to add your translation to the standard distribution.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  == Screenshots ==
88
 
89
- 1. Plugin's settings page where you can set up to five fields for the delivery note. [Click for larger image view](http://www.wordpress.org/extend/plugins/woocommerce-delivery-notes/screenshot-1.png)
90
- 2. Single Order Edit page with the meta box and the print buttons.
91
- 3. Invoice printing page with default template - and the five custom sections. [Click for larger image view](http://www.wordpress.org/extend/plugins/woocommerce-delivery-notes/screenshot-3.png)
92
- 4. Delivery Note printing page with default template - and the five custom sections. [Click for larger image view](http://www.wordpress.org/extend/plugins/woocommerce-delivery-notes/screenshot-4.png)
93
- 5. Help tabs on the plugin's settings page with some info and important plugin links. [Click for larger image view](http://www.wordpress.org/extend/plugins/woocommerce-delivery-notes/screenshot-5.png)
 
94
 
95
  == Changelog ==
96
 
97
- = 2.0.2 =
98
- * FIX: The print data is now generated with the order metadata. This solves a problem where the items weren't displayed when the product was deleted. (thanks MDesigner0)
99
- * UPDATE: Added some missing translations to the pot.
100
- * NEW: Added the telephone and email to the template.
101
- * DELETE: Removed the possibility to show the download links because the urls are always so long that most probably no one will ever use them.
102
-
103
- = 2.0.1 =
104
- * FIX: Updated print functionality for better cross-browser support.
105
-
106
- = 2.0 =
107
- * FIX: Print privileges for WooCommerce 2.0.
108
- * FIX: The Hi-DPI resizing of the company logo is working better now.
109
- * FIX: Plugin activates correctly on a multisite installation.
110
- * UPDATE: More stable cross-browser print support.
111
- * UPDATE: Printing without thickbox.
112
- * UPDATE: Removed the thickbox preview
113
- * NEW: Template preview links in the settings page (only visible when there is at least one order).
114
- * NEW: Many template functions can now be filtered with `add_filter`.
115
- * NEW: In the template the payment method is now displayed via the `wcdn_payment_method` function.
116
- * NEW: In the template the today's date is now used as default instead of the order date.
117
-
118
- = 1.4.6 =
119
- * FIX: Child theme template files are better loaded.
120
- * UPDATE: Translations are better loaded.
121
-
122
- = 1.4.5 =
123
- * UPDATE: Better order number support for the sequential order numbers plugin. (thanks FoxRunSoftware)
124
- * NEW: Danish localization. (thanks brandt)
125
- * FIX: Logo uploader "Insert into Post" button works again.
126
-
127
- = 1.4.4 =
128
- * FIX: Product variations are returned instead of echoed.
129
- * UPDATE: Better product meta data display.
130
-
131
- = 1.4.3 =
132
- * FIX: Logo uploader tabs.
133
-
134
- = 1.4.2 =
135
- * FIX: Display Product variations.
136
- * NEW: Icon buttons for the order actions.
137
-
138
- = 1.4.1 =
139
- * FIX: Logo uploader button.
140
- * UPDATE: Indicate when the print page is loading.
141
-
142
- = 1.4 =
143
- * ATTENTION: For custom template creators: This update breaks your custom template because of some new features. Please update your template PHP code and CSS.
144
- * NEW: Print buttons on the orders list page.
145
- * NEW: Print preview window opens in lightbox.
146
- * NEW: Print immediately, without preview window.
147
- * FIX: Order totals are now properly displayed again.
148
- * FIX: Close unclosed `<tr>` tag in the template.
149
-
150
- = 1.2.4 =
151
- * ATTENTION: This update breaks your custom template because many functions were renamed or removed. Please update your custom template.
152
- * NEW: The custom `style.css` is now loaded even when there is no `print.php` in your theme folder `yourthemename/woocommerce/delivery-notes`. Like this the look of the default template can be changed without editing the `print.php` file.
153
- * NEW: The company logo isn't resized anymore. Instead it is loaded with the original pixel dimensions but is then resized via CSS to a fourth. Make sure that your original image file has the desired pixel dimensions!
154
- * NEW: Removed the custom/sequential order number settings. They are now fully handled by the additional plugin.
155
- * UPDATE: Renamed or removed many template functions. Please update your custom template.
156
- * UPDATE: The print navigation is now separated from the template file. Please update your custom template.
157
-
158
- = 1.2.3 =
159
- * UPDATE: Order totals are now displayed the same way as when the customer reviews the order online (Update custom template to use the feature).
160
- * UPDATE: Variations and Attributes are now properly displayed (Update custom template to use the feature).
161
-
162
- = 1.2.2 =
163
- * FIX: The media management button "Insert into Post" is now visible again. It was hidden by a the css.
164
-
165
- = 1.2.1 =
166
- * NEW: Company logo upload.
167
- * NEW: Order numbering supports the sequential order numbers plugin. The offset field was removed because the plugin is much better. (thanks FoxRunSoftware, welovewordpress).
168
- * FIX: Print page doesn't block the user when get vars aren't set.
169
- * UPDATE: Template shows customer phone number (thanks welovewordpress).
170
- * UPDATE: Template item list contains more data fields (thanks welovewordpress).
171
-
172
- = 1.2 =
173
- * IMPORTANT CHANGE: New main development and authorship now: [WordPress.org user "chabis"](http://profiles.wordpress.org/chabis/) - with daveshine (David Decker) remaining as a co-author.
174
- * *New features:*
175
- * NEW: Basic invoice template support.
176
- * NEW: Custom order number.
177
- * NEW: New cleaner looking print template.
178
- * CODE: Restructured classes - plugin now completely relies on classes!
179
- * CODE: General code cleanup and numerous improvements.
180
- * UPDATE: Settings are now part of the "WooCommerce" settings, now see: WooCommerce > Settings > Tab "Print"
181
- * UPDATE - IMPORTANT CHANGE: Template folder renaming -- custom templates must be renamed in order to work! -- See [FAQ section here](http://wordpress.org/extend/plugins/woocommerce-delivery-notes/faq/) for more info on that...
182
- * UPDATE: Updated all existing screenshots and added two new ones.
183
- * UPDATE: Updated readme.txt here with changed documentation and all other important new stuff, regarding authorship, plugin links etc.
184
- * NEW: Added new partial translations for: Dutch, French, Spanish - all user-submitted! Big thanks to Ramon, Olivier and @JAVidania
185
- * UPDATE: Updated German translations and also the .pot file for all translators!
186
- * UPDATE: Extended GPL License info in readme.txt as well as main plugin file.
187
- * NEW: Added banner image on WordPress.org for better plugin branding :)
188
- * NEW: Easy plugin translation platform with GlotPress tool: [Translate "WooCommerce Print Invoices & Delivery Notes"...](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes)
189
-
190
- = 1.1 =
191
- * *Maintenance release*
192
- * UPDATE: Changed product price calculation due to changes in WooCommerce itself -- this led to **new required versions** for this plugin: **at least WordPress 3.3 and WooCommerce 1.4** or higher (Note: If you still have WooCommerc 1.3.x running then use version 1.0 of the Delivery Notes plugin!)
193
- * UPDATE: Custom fields on settings page now accept proper `img` tags, so you can add logo images or such via HTML IMG tag (for example: `<img src="your-image-url" width="100" height="100" alt="Logo" title="My Shop" />`)
194
- * UPDATE: Corrected readme.txt file
195
- * NEW: Added Swedish translation - Thanx to Christopher Anderton
196
- * UPDATE: Updated German translations and also the .pot file for all translators!
197
-
198
- = 1.0 =
199
- * Initial release
200
- * Forked and extended from original plugin for Jigoshop ("Jigoshop Delivery Notes" at GitHub)
201
 
202
- == Upgrade Notice ==
 
203
 
204
- = 1.5 =
205
- Update your custom style.css. Remove any width and height CSS properties that were assigned to the img tag.
206
 
207
- = 1.2.4 =
208
- Many template functions were updated. Please update your custom template too or everything breaks!
209
 
210
- = 1.2.1 =
211
- The sequential order numbers plugin requires at least WooCommerce 1.5.3.
 
212
 
213
- = 1.2 =
214
- Major additions & improvements: Now with basic invoice support. Code cleanup & improvements. Added new partial translations, updated German translations plus .pot file for translators. Also, new plugin authorship!
215
 
216
- = 1.1 =
217
- Several changes: Changed price calculation due to WC 1.4+ changes. Added img tag support for fields on settings page. Corrected readme.txt file, added Swedish translations, also updated .pot file together with German translations.
218
 
219
- = 1.0 =
220
- Just released into the wild.
221
 
222
- == Plugin Links ==
223
- * [Translations (GlotPress)](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes)
224
- * [User support forums](http://wordpress.org/tags/woocommerce-delivery-notes?forum_id=10)
225
 
226
- == Translations ==
 
 
 
 
227
 
228
- * English - default, always included
229
- * German (de_DE): Deutsch - immer dabei! [Download auch via deckerweb.de](http://deckerweb.de/material/sprachdateien/woocommerce-und-extensions/#woocommerce-delivery-notes)
230
- * Dutch (nl_NL): Nederlands - user-submitted by [Ramon van Belzen](http://profiles.wordpress.org/Ramoonus/)
231
- * Swedish (sv_SE): Svenska - user-submitted by [Christopher Anderton](http://www.deluxive.se/)
232
- * Spanish (es_ES): Español - user-submitted by @JAVidania
233
- * French (fr_FR): Français - user-submitted by Olivier
234
- * Danish (da_DK): Dansk - user-submitted by [boldt](http://boldt.325.dk/)
235
- * Polish (pl_PL): Polski - user-submitted
236
- * Russian (ru_RU): русский - user-submitted
237
- * Finnish (fi): Suomi - user-submitted
238
- * Italian (it_IT): Italiano - user-submitted
239
- * Portuguse, Brazilian (pt_BR): Português - user-submitted
240
- * Slovakian (sk_SK): Slovenčina - user-submitted
241
- * Turkish (tr_TR): Türk - user-submitted
242
- * For custom and update-secure language files please upload them to `/wp-content/languages/woocommerce-delivery-notes/` (just create this folder) - This enables you to use fully custom translations that won't be overridden on plugin updates. Also, complete custom English wording is possible with that as well, just use a language file like `woocommerce-delivery-notes-en_US.mo/.po` to achieve that.
243
 
244
- **Easy plugin translation platform with GlotPress tool:** [Translate the plugin here](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes)
245
 
246
- **Made your own translation?:** [Just send it in](http://genesisthemes.de/en/contact/)
247
 
248
- *Note:* All my plugins are internationalized/ translateable by default. This is very important for all users worldwide. So please contribute your language to the plugin to make it even more useful. For translating I recommend the awesome ["Codestyling Localization" plugin](http://wordpress.org/extend/plugins/codestyling-localization/) and for validating the ["Poedit Editor"](http://www.poedit.net/), which works fine on Windows, Mac and Linux.
249
 
250
- == Credits ==
251
- Thanks to WooThemes company and WooCommerce team for promoting this plugin on their official homepage as well as on the download page here on wordpress.org! ;-)
 
1
+ === WooCommerce Print Invoice & Delivery Note ===
2
+
3
+ Contributors: piffpaffpuff
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=K2JKYEASQBBSQ&lc=US&item_name=WooCommerce%20Print%20Invoice%20%26%20Delivery%20Note&item_number=WCDN&amount=20%2e00&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest
5
+ Tags: delivery note, packing slip, invoice, delivery, shipping, print, order, woocommerce, woothemes, shop
6
+ Requires at least: 3.8 and WooCommerce 2.1
7
+ Tested up to: WordPress 3.9 Beta and WooCommerce 2.1.7
8
  Stable tag: trunk
9
  License: GPLv3 or later
10
  License URI: http://www.opensource.org/licenses/gpl-license.php
11
 
12
+ Print invoices and delivery notes for WooCommerce orders.
13
 
14
  == Description ==
15
 
16
+ You can print out invoices and delivery notes for the [WooCommerce](http://wordpress.org/plugins/woocommerce/) orders. You can edit the Company/Shop name, Company/Shop postal address and also add personal notes, conditions/policies (like a refund policy) and a footer imprint.
17
+
18
+ The plugin adds a new side panel on the order page to allow shop administrators to print out the invoice or delivery note. Registered customers can also can also print their order with a button that is added to the order screen.
19
 
20
+ = Support =
21
 
22
+ Support can take place in the [public support forums](http://wordpress.org/support/plugin/woocommerce-delivery-notes), where the community can help each other out.
 
 
 
 
 
 
 
23
 
24
+ = Contributing =
25
 
26
+ If you have a patch, or stumbled upon an issue with the source code that isn't a [WooCommerce issue](https://github.com/woothemes/woocommerce/issues?labels=Bug&milestone=22&state=open), you can contribute this [back on GitHub](https://github.com/piffpaffpuff/woocommerce-delivery-notes).
 
27
 
28
+ = Translating =
 
29
 
30
+ When your language is missing you can contribute a translation to the [GlotPress repository](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes).
31
 
32
  == Installation ==
33
 
34
+ 1. Upload the entire `woocommerce-delivery-notes` folder to the `/wp-content/plugins/` directory.
35
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
36
+ 3. Choose 'WooCommerce' then 'Settings' and the tab 'Print' to adjust the settings to your need.
37
+ 4. Print the order with the side panel on the actual order page.
 
38
 
39
  == Frequently Asked Questions ==
40
 
41
+ = How to prevent that the Website URL and page numbers are printed? =
42
+
43
+ You can find an option in the print window of your browser to hide those. This is a browser specific option that can't be controlled by the plugin. Please read the browser help for more information.
44
+
45
+ = Why are my bulk printed orders not splited to separate pages? =
46
+
47
+ Your browser is to old to create the page breaks correctly. Try to update it to the latest version or use another browser.
48
+
49
+ = Even though the shipping and billing address is the same, both are still shown, why? =
50
+
51
+ It depends on your WooCommerce settings. Addresses are displayed the same way as on the WooCommerce account page. Only one address is printed in case you disabled alternative shipping addresses or the whole shipping. In all other cases both addresses are shown.
52
 
53
+ = It prints the 404 page instead of the order, how to correct that? =
54
+
55
+ This is most probably due to the permalink settings. Go either to the WordPress Permalink or the WooCommerce Print Settings and save them again.
56
+
57
+ If that didn't help, go to the WooCommerce 'Accounts' settings tab and make sure that for 'My Account Page' a page is selected.
58
+
59
+ = How do I quickly change the font of the invoice and delivery note? =
60
+
61
+ You can change the font with CSS. Use the `wcdn_head` hook and then write your own CSS code. It's best to place the code in the `functions.php` file of your theme.
62
+
63
+ An example that changes the font and makes the addresses very large. Paste the code in the `functions.php` file of your theme:
64
 
65
  `
66
+ function my_serif_font_and_large_address() {
67
+ ?>
68
+ <style>
69
+ #page {
70
+ font-size: 1em;
71
+ font-family: Georgia, serif;
72
+ }
73
+
74
+ .order-addresses address {
75
+ font-size: 2.5em;
76
+ line-height: 125%;
77
+ }
78
+ </style>
79
+ <?php
80
  }
81
+ add_action( 'wcdn_head', 'my_serif_font_and_large_address', 20 );
82
  `
83
 
84
+ = Can I hide the prices on the delivery note? =
 
85
 
86
+ Sure, the easiest way is to hide them with some CSS that is hooked in with `wcdn_head`.
87
 
88
+ An example that hides the whole price column. Paste the code in the `functions.php` file of your theme:
 
89
 
90
+ `
91
+ function my_price_free_delivery_note() {
92
+ ?>
93
+ <style>
94
+ .delivery-note .total-heading span,
95
+ .delivery-note .product-price span {
96
+ display: none;
97
+ }
98
+ </style>
99
+ <?php
100
+ }
101
+ add_action( 'wcdn_head', 'my_price_free_delivery_note', 20 );
102
+ `
103
+
104
+ = Is it possible to remove a field from the order info section? =
105
+
106
+ Yes, use the `wcdn_order_info_fields` filter hook. It returns all the fields as array. Unset or rearrange the values as you like.
107
+
108
+ An example that removes the 'Payment Method' field. Paste the code in the `functions.php` file of your theme:
109
+
110
+ `
111
+ function my_removed_payment_method( $fields ) {
112
+ unset( $fields['payment_method'] );
113
+ return $fields;
114
+ }
115
+ add_filter( 'wcdn_order_info_fields', 'my_removed_payment_method' );
116
+ `
117
 
118
+ = How can I add some more fields to the order info section? =
 
119
 
120
+ Use the `wcdn_order_info_fields` filter hook. It returns all the fields as array. Read the WooCommerce documentation to learn how you get custom checkout and order fields. Tip: To get custom meta field values you will most probably need the `get_post_meta( $order->id, 'your_meta_field_name', true);` function and of course the `your_meta_field_name`.
121
 
122
+ An example that adds a 'VAT' and 'Customer Number' field to the end of the list. Paste the code in the `functions.php` file of your theme:
123
 
124
+ `
125
+ function my_custom_order_fields( $fields, $order ) {
126
+ $new_fields = array();
127
+
128
+ if( get_post_meta( $order->id, 'your_meta_field_name', true ) ) {
129
+ $new_fields['your_meta_field_name'] = array(
130
+ 'label' => 'VAT',
131
+ 'value' => get_post_meta( $order->id, 'your_meta_field_name', true )
132
+ );
133
+ }
134
+
135
+ if( get_post_meta( $order->id, 'your_meta_field_name', true ) ) {
136
+ $new_fields['your_meta_field_name'] = array(
137
+ 'label' => 'Customer Number',
138
+ 'value' => get_post_meta( $order->id, 'your_meta_field_name', true )
139
+ );
140
+ }
141
+
142
+ return array_merge( $fields, $new_fields );
143
+ }
144
+ add_filter( 'wcdn_order_info_fields', 'my_custom_order_fields', 10, 2 );
145
+ `
146
 
147
+ = What about the product image, can I add it to the invoice and delivery note? =
148
 
149
+ Yes, use the `wcdn_order_item_before` action hook. It allows you to add html content before the item name.
150
+
151
+ An example that adds a 40px large product image. Paste the code in the `functions.php` file of your theme:
152
+
153
+ `
154
+ function my_product_image( $product ) {
155
+ if( isset( $product->id ) && has_post_thumbnail( $product->id ) ) {
156
+ echo get_the_post_thumbnail( $product->id, array( 40, 40 ) );
157
+ }
158
+ }
159
+ add_action( 'wcdn_order_item_before', 'my_product_image' );
160
+ `
161
+
162
+ = How do I customize the look of the invoice and delivery note? =
163
+
164
+ You can use the techniques from the questions above. Or you consider the `wcdn_head` hook to enqueue your own stylesheet. Or for full control, copy the file `style.css` from `woocommerce-delivery-notes/templates/print-order` to `yourtheme/woocommerce/print-order` and start editing it.
165
+
166
+ Note: Create the `woocommerce` and `print-order` folders if they do not exist. This way your changes won't be overridden on plugin updates.
167
+
168
+ = I would like to move the logo to the bottom, put the products between the shipping and billing address and rotate it by 90 degrees, how can I do that? =
169
+
170
+ Well, first try it with CSS and some filter/action hooks, maybe the questions above can help you. If this isn't enough, you are free to edit the HTML and CSS of the template. Consider this solution only, if you really know some HTML, CSS and PHP! Most probably you want to edit the `print-content.php` and `style.css`. Copy the files from `woocommerce-delivery-notes/templates/print-order` to `yourtheme/woocommerce/print-order` and start editing them.
171
+
172
+ Note: Create the `woocommerce` and `print-order` folders if they do not exists. This way your changes won't be overridden on plugin updates.
173
+
174
+ = Is there a list of all action and filter hooks? =
175
+
176
+ Unfortunately there isn't yet. But you can look directly at the template files to see what is available.
177
+
178
+ = Which template functions are available? =
179
+
180
+ You can use the functions from WordPress, WooCommerce and every installed plugin or activated theme. You can find all plugin specific functions in the `wcdn-template-functions.php` file. In addition the `$order`variable in the template is just a normal `WC_Order` instance.
181
+
182
+ = Can I download the order as PDF instead of printing it out? =
183
+
184
+ No, this isn't possible. Look for another plugin that can do this.
185
+
186
+ = I need some more content on the order, how can I add it? =
187
+
188
+ The plugin uses the exact same content as WooCommerce. If the content isn't available in WooCommerce, then it will neither be in the delivery note and invoice. In case you have some special needs, you first have to enhance WooCommerce to solve your issue. Afterwards you can integrate the solution into the invoice and delivery note template via hooks.
189
+
190
+ = How can I translate the plugin? =
191
+
192
+ Upload your language file to `/wp-content/languages/plugins/` (create this folder if it doesn't exist). WordPress will then load the language. Make sure you use the same locale as in your configuration and the correct plugin locale i.e. `woocommerce-delivery-notes-it_IT.mo/.po`.
193
+
194
+ Please [contribute your translation](http://translate.wpautobahn.com/projects/wordpress-plugins-deckerweb/woocommerce-delivery-notes) to include it in the distribution.
195
 
196
  == Screenshots ==
197
 
198
+ 1. The clean invoice print view.
199
+ 2. Print panel.
200
+ 3. Quick print actions.
201
+ 4. Bulk print orders.
202
+ 5. Enter company and contact information.
203
+ 6. Customers can also print the order.
204
 
205
  == Changelog ==
206
 
207
+ = 3.0.6 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
+ * Fixed the known issue where the print button stopped working becuse of SSL
210
+ * Fixed an issue where the print page was redirected to the account page
211
 
212
+ = 3.0.5 =
 
213
 
214
+ **Known issue: Printing won't work when your account uses SSL and the rest of the page doesn't. The issue will be fixed in a future version.**
 
215
 
216
+ * Added SKU to the template
217
+ * Modified the alignment of product attributes in the template
218
+ * Print buttons in the theme will print the invoice (can be changed with hook)
219
 
220
+ = 3.0.4 =
 
221
 
222
+ * Save the endpoint at activation to not print a 404 page. (Note: Try to resave the print settings if the issue persists after the update.)
 
223
 
224
+ = 3.0.3 =
 
225
 
226
+ **Attention: This update works only with WooCommerce 2.1 (or later) and Wordpress 3.8 (or later). Install it only if your system meets the requirements.**
 
 
227
 
228
+ * Supports only WooCommerce 2.1 (or later)
229
+ * Bulk print actions
230
+ * Print buttons in the front-end
231
+ * Redesigned template look
232
+ * New template structure and action hooks
233
 
234
+ == Upgrade Notice ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
 
236
+ = 3.0.6 =
237
 
238
+ Thanks everybody to help fixing the SSL issue. Please report to the support forums if you still have SSL problems after the update.
239
 
240
+ = 3.0.3 =
241
 
242
+ * This update works only with WooCommerce 2.1 (or later) and Wordpress 3.8 (or later). Install it only if your system meets the requirements.
243
+ * Prior print templates aren't compatible. Read the [FAQ](http://wordpress.org/plugins/woocommerce-delivery-notes/faq/) to customize the new template.
244
+ * Translations aren't updated, except German.
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png CHANGED
Binary file
screenshot-6.png ADDED
Binary file
templates/print-order/print-content.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Print order content. Copy this file to your themes
4
+ * directory /woocommerce/print-order to customize it.
5
+ *
6
+ * @package WooCommerce Print Invoice & Delivery Note/Templates
7
+ */
8
+
9
+ if ( !defined( 'ABSPATH' ) ) exit;
10
+ ?>
11
+
12
+ <div class="order-branding">
13
+ <div class="company-logo">
14
+ <?php if( wcdn_get_company_logo_id() ) : ?><?php wcdn_company_logo(); ?><?php endif; ?>
15
+ </div>
16
+
17
+ <div class="company-info">
18
+ <?php if( !wcdn_get_company_logo_id() ) : ?><h1 class="company-name"><?php wcdn_company_name(); ?></h1><?php endif; ?>
19
+ <div class="company-address"><?php wcdn_company_info(); ?></div>
20
+ </div>
21
+
22
+ <?php do_action( 'wcdn_after_branding', $order ); ?>
23
+ </div><!-- .order-branding -->
24
+
25
+
26
+ <div class="order-addresses">
27
+ <div class="billing-address">
28
+ <h3><?php _e( 'Billing Address', 'woocommerce-delivery-notes' ); ?></h3>
29
+ <address>
30
+
31
+ <?php if( !$order->get_formatted_billing_address() ) _e( 'N/A', 'woocommerce' ); else echo apply_filters( 'wcdn_address_invoice', $order->get_formatted_billing_address(), $order ); ?>
32
+
33
+ </address>
34
+ </div>
35
+
36
+ <?php if( get_option( 'woocommerce_ship_to_billing_address_only' ) === 'no' && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?>
37
+
38
+ <div class="shipping-address">
39
+ <h3><?php _e( 'Shipping Address', 'woocommerce-delivery-notes' ); ?></h3>
40
+ <address>
41
+
42
+ <?php if( !$order->get_formatted_shipping_address() ) _e( 'N/A', 'woocommerce' ); else echo apply_filters( 'wcdn_address_invoice', $order->get_formatted_shipping_address(), $order ); ?>
43
+
44
+ </address>
45
+ </div>
46
+
47
+ <?php endif; ?>
48
+
49
+ <?php do_action( 'wcdn_after_addresses', $order ); ?>
50
+ </div><!-- .order-addresses -->
51
+
52
+
53
+ <div class="order-info">
54
+ <h2><?php wcdn_document_title(); ?></h2>
55
+
56
+ <ul class="info-list">
57
+ <?php $fields = apply_filters( 'wcdn_order_info_fields', wcdn_get_order_info( $order ), $order ); ?>
58
+ <?php foreach( $fields as $field ) : ?>
59
+ <li>
60
+ <strong><?php echo apply_filters( 'wcdn_order_info_name', $field['label'], $field ); ?></strong>
61
+ <span><?php echo apply_filters( 'wcdn_order_info_content', $field['value'], $field ); ?></span>
62
+ </li>
63
+ <?php endforeach; ?>
64
+ </ul>
65
+
66
+ <?php do_action( 'wcdn_after_info', $order ); ?>
67
+ </div><!-- .order-info -->
68
+
69
+
70
+ <div class="order-items">
71
+ <table>
72
+ <thead>
73
+ <tr>
74
+ <th class="product-heading"><span><?php _e('Product', 'woocommerce-delivery-notes'); ?></span></th>
75
+ <th class="total-heading"><span><?php _e('Total', 'woocommerce-delivery-notes'); ?></span></th>
76
+ </tr>
77
+ </thead>
78
+
79
+ <tbody>
80
+ <?php if( sizeof( $order->get_items() ) > 0 ) : ?>
81
+ <?php foreach( $order->get_items() as $item ) : ?>
82
+
83
+ <?php
84
+ $product = apply_filters( 'wcdn_order_item_product', $order->get_product_from_item( $item ), $item );
85
+ $item_meta = new WC_Order_Item_Meta( $item['item_meta'], $product );
86
+ ?>
87
+
88
+ <tr>
89
+ <td class="product-name">
90
+ <?php do_action( 'wcdn_order_item_before', $product, $order ); ?>
91
+
92
+ <span class="name"><?php echo apply_filters( 'wcdn_order_item_name', $item['name'], $item ); ?></span>
93
+ <span class="quantity"><?php echo apply_filters( 'wcdn_order_item_quantity', sprintf( '&times; %s', $item['qty'] ), $item ); ?></span>
94
+
95
+ <?php $item_meta->display(); ?>
96
+
97
+ <dl class="extras">
98
+ <?php if( $product && $product->exists() && $product->is_downloadable() && $order->is_download_permitted() ) : ?>
99
+
100
+ <dt><?php _e( 'Download:', 'woocommerce-delivery-notes' ); ?></dt>
101
+ <dd><?php printf( __( '%s Files', 'woocommerce-delivery-notes' ), count( $order->get_item_downloads( $item ) ) ); ?></dd>
102
+
103
+ <?php endif; ?>
104
+
105
+ <?php
106
+ $fields = apply_filters( 'wcdn_order_item_fields', array(), $product, $order );
107
+ foreach ( $fields as $field ) :
108
+ ?>
109
+
110
+ <dt><?php echo $field['label']; ?></dt>
111
+ <dd><?php echo $field['value']; ?></dd>
112
+
113
+ <?php endforeach; ?>
114
+ </dl>
115
+ </td>
116
+ <td class="product-price">
117
+ <span><?php echo $order->get_formatted_line_subtotal( $item ); ?></span>
118
+ </td>
119
+ </tr>
120
+ <?php endforeach; ?>
121
+ <?php endif; ?>
122
+ </tbody>
123
+
124
+ <tfoot>
125
+ <?php if( $totals = $order->get_order_item_totals() ) : ?>
126
+ <?php foreach ( $totals as $total ) : ?>
127
+
128
+ <tr>
129
+ <td class="total-name"><?php echo $total['label']; ?></td>
130
+ <td class="total-price"><?php echo $total['value']; ?></td>
131
+ </tr>
132
+
133
+ <?php endforeach; ?>
134
+ <?php endif; ?>
135
+ </tfoot>
136
+ </table>
137
+
138
+ <?php do_action( 'wcdn_after_items', $order ); ?>
139
+ </div><!-- .order-items -->
140
+
141
+
142
+ <div class="order-notes">
143
+ <?php if( wcdn_has_customer_notes( $order ) ) : ?>
144
+ <h4><?php _e( 'Customer Note', 'woocommerce-delivery-notes' ); ?></h4>
145
+ <?php wcdn_customer_notes( $order ); ?>
146
+ <?php endif; ?>
147
+
148
+ <?php do_action( 'wcdn_after_notes', $order ); ?>
149
+ </div><!-- .order-notes -->
150
+
151
+
152
+ <div class="order-thanks">
153
+ <?php wcdn_personal_notes(); ?>
154
+
155
+ <?php do_action( 'wcdn_after_thanks', $order ); ?>
156
+ </div><!-- .order-thanks -->
157
+
158
+
159
+ <div class="order-colophon">
160
+ <div class="colophon-policies">
161
+ <?php wcdn_policies_conditions(); ?>
162
+ </div>
163
+
164
+ <div class="colophon-imprint">
165
+ <?php wcdn_imprint(); ?>
166
+ </div>
167
+
168
+ <?php do_action( 'wcdn_after_colophon', $order ); ?>
169
+ </div><!-- .order-colophon -->
170
+
templates/print-order/print-footer.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Print order footer
4
+ *
5
+ * @package WooCommerce Print Invoice & Delivery Note/Templates
6
+ */
7
+
8
+ if ( !defined( 'ABSPATH' ) ) exit;
9
+ ?>
10
+
11
+ </div><!-- #page -->
12
+
13
+ <?php
14
+ // wcdn_head hook
15
+ do_action( 'wcdn_after_page' );
16
+ ?>
17
+
18
+ </div><!-- #container -->
19
+
20
+ </body>
21
+
22
+ </html>
templates/print-order/print-header.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Print order header
4
+ *
5
+ * @package WooCommerce Print Invoice & Delivery Note/Templates
6
+ */
7
+
8
+ if ( !defined( 'ABSPATH' ) ) exit;
9
+ ?>
10
+
11
+ <!DOCTYPE html>
12
+ <html>
13
+
14
+ <head>
15
+ <meta charset="utf-8">
16
+ <title><?php wcdn_document_title(); ?></title>
17
+
18
+ <?php
19
+ // wcdn_head hook
20
+ do_action( 'wcdn_head' );
21
+ ?>
22
+ </head>
23
+
24
+ <body class="<?php echo wcdn_get_template_type(); ?>">
25
+
26
+ <div id="container">
27
+
28
+ <?php
29
+ // wcdn_head hook
30
+ do_action( 'wcdn_before_page' );
31
+ ?>
32
+
33
+ <div id="page">
templates/print-order/print-order.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Print order template. This is the main file. Most
4
+ * probably it is easier to edit one of the content by
5
+ * copying it to your theme /woocommerce/print
6
+ *
7
+ * @package WooCommerce Print Invoice & Delivery Note/Templates
8
+ */
9
+
10
+ if ( !defined( 'ABSPATH' ) ) exit;
11
+ ?>
12
+
13
+ <?php wcdn_get_template_content( 'print-header.php' ); ?>
14
+
15
+ <?php
16
+ // wcdn_before_content hook
17
+ do_action( 'wcdn_before_content' );
18
+ ?>
19
+
20
+ <?php if( $orders = wcdn_get_orders() ) : ?>
21
+
22
+ <?php
23
+ // wcdn_before_loop hook
24
+ do_action( 'wcdn_before_loop' );
25
+ ?>
26
+
27
+ <?php foreach( $orders as $order ) : ?>
28
+
29
+ <article class="content">
30
+
31
+ <?php wcdn_get_template_content( 'print-content.php', array( 'order' => $order ) ); ?>
32
+
33
+ </article><!-- .content -->
34
+
35
+ <?php endforeach; ?>
36
+
37
+ <?php
38
+ // wcdn_after_loop hook
39
+ do_action( 'wcdn_after_loop' );
40
+ ?>
41
+
42
+ <?php endif; ?>
43
+
44
+ <?php
45
+ // wcdn_after_content hook
46
+ do_action( 'wcdn_after_content' );
47
+ ?>
48
+
49
+ <?php wcdn_get_template_content( 'print-footer.php' ); ?>
templates/print-order/style.css ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Simple CSS Reset and Print options
2
+ ------------------------------------------*/
3
+
4
+
5
+ html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, table, ol, ul, dl, li, dt, dd {
6
+ border: 0 none;
7
+ font: inherit;
8
+ margin: 0;
9
+ padding: 0;
10
+ vertical-align: baseline;
11
+ }
12
+
13
+ body {
14
+ line-height: 1;
15
+ }
16
+
17
+ ol,
18
+ ul {
19
+ list-style: none;
20
+ }
21
+
22
+ table {
23
+ border-collapse: collapse;
24
+ border-spacing: 0;
25
+ }
26
+
27
+
28
+ /* Template Page Layout
29
+ ------------------------------------------*/
30
+
31
+
32
+ /* Main Body */
33
+ body {
34
+ background: #fff;
35
+ color: #000;
36
+ font-family: "HelveticaNeue", Helvetica, Arial, sans-serif;
37
+ font-size: 100%;
38
+ line-height: 1.25em;
39
+ }
40
+
41
+ h1,
42
+ h2,
43
+ h3,
44
+ h4 {
45
+ font-weight: bold;
46
+ margin-bottom: 1.25em;
47
+ }
48
+
49
+ ul {
50
+ margin-bottom: 1.25em;
51
+ }
52
+
53
+ li,
54
+ dt,
55
+ dd {
56
+ padding: 0.375em 0;
57
+ }
58
+
59
+ dt {
60
+ font-weight: bold;
61
+ }
62
+
63
+ p + p {
64
+ margin-top: 1.25em;
65
+ }
66
+
67
+ address {
68
+ font-style: normal;
69
+ }
70
+
71
+ /* Basic Table Styling */
72
+ table {
73
+ page-break-inside: auto;
74
+ width: 100%;
75
+ }
76
+
77
+ tr {
78
+ page-break-inside: avoid;
79
+ page-break-after: auto;
80
+ border-bottom: 0.12em solid #bbb;
81
+ }
82
+
83
+ td,
84
+ th {
85
+ padding: 0.375em 0;
86
+ vertical-align: middle;
87
+ }
88
+
89
+ td img,
90
+ th img {
91
+ vertical-align: middle;
92
+ }
93
+
94
+ th {
95
+ color: black;
96
+ font-weight: bold;
97
+ text-align: left;
98
+ padding-bottom: 1.25em;
99
+ }
100
+
101
+ /* Page Margins & Basic Stylings */
102
+ #page {
103
+ margin-left: auto;
104
+ margin-right: auto;
105
+ text-align: left;
106
+ font-size: 0.875em;
107
+ }
108
+
109
+ .content {
110
+ padding-left: 10%;
111
+ padding-right: 10%;
112
+ padding-top: 5%;
113
+ padding-bottom: 5%;
114
+ page-break-after: always;
115
+ }
116
+
117
+ h1,
118
+ h2 {
119
+ font-size: 1.572em;
120
+ }
121
+
122
+ .order-branding,
123
+ .order-addresses,
124
+ .order-info,
125
+ .order-items,
126
+ .order-notes,
127
+ .order-thanks,
128
+ .order-colophon {
129
+ margin-bottom: 3em;
130
+ }
131
+
132
+ .order-items {
133
+ page-break-before: auto;
134
+ page-break-after: auto;
135
+ }
136
+
137
+ /* Order Branding */
138
+ .order-branding .company-logo {
139
+ margin-bottom: 1em;
140
+ }
141
+
142
+ /* Order Addresses */
143
+ .order-addresses {
144
+ margin-bottom: 6em;
145
+ }
146
+
147
+ .order-addresses:after {
148
+ content: ".";
149
+ display: block;
150
+ height: 0;
151
+ clear: both;
152
+ visibility: hidden;
153
+ }
154
+
155
+ .billing-address {
156
+ width: 50%;
157
+ float: left;
158
+ }
159
+
160
+ .shipping-address {
161
+ width: 50%;
162
+ float: left;
163
+ }
164
+
165
+ /* Switch the addresses for invoices */
166
+ .invoice .billing-address {
167
+ float: right;
168
+ }
169
+
170
+ /* Order Info */
171
+ .order-info ul {
172
+ border-top: 0.24em solid black;
173
+ }
174
+
175
+ .order-info li {
176
+ border-bottom: 0.12em solid #bbb;
177
+ }
178
+
179
+ .order-info li strong {
180
+ font-weight: normal;
181
+ width: 25%;
182
+ display: inline-block;
183
+ white-space: nowrap;
184
+ text-overflow: ellipsis;
185
+ overflow: hidden;
186
+ margin-bottom: 0;
187
+ }
188
+
189
+ /* Order Items */
190
+ .order-items {
191
+ margin-bottom: 1em;
192
+ }
193
+
194
+ .order-items th,
195
+ .order-items td {
196
+ width: 50%;
197
+ }
198
+
199
+ .order-items tbody .quantity,
200
+ .order-items tbody .name {
201
+ font-weight: bold;
202
+ }
203
+
204
+ .order-items .product-price {
205
+ vertical-align: top;
206
+ }
207
+
208
+ .order-items p {
209
+ display: inline;
210
+ }
211
+
212
+ .order-items small,
213
+ .order-items dt,
214
+ .order-items dd {
215
+ font-size: 0.785em;
216
+ font-weight: normal;
217
+ line-height: 150%;
218
+ display: inline;
219
+ padding: 0;
220
+ margin: 0;
221
+ }
222
+
223
+ .order-items dt,
224
+ .order-items dd {
225
+ display: block;
226
+ float: left;
227
+ }
228
+
229
+ .order-items dt {
230
+ clear: left;
231
+ padding-right: 0.2em;
232
+ }
233
+
234
+ .order-items tfoot tr:last-child {
235
+ font-weight: bold;
236
+ }
237
+
238
+ .order-items tfoot tr:last-child .total-price {
239
+ font-size: 0.785em;
240
+ font-weight: normal;
241
+ }
242
+
243
+ .order-items tfoot tr:last-child .total-price .amount:first-child {
244
+ font-size: 1.273em;
245
+ font-weight: bold;
246
+ }
247
+
248
+ .order-items tfoot tr:last-child {
249
+ border-bottom: 0.24em solid black;
250
+ }
251
+
252
+ /* Order Notes */
253
+ .order-notes {
254
+ font-size: 0.785em;
255
+ line-height: 150%;
256
+ margin-bottom: 6em;
257
+ }
258
+
259
+ .order-notes h4 {
260
+ margin-bottom: 0;
261
+ }
262
+
263
+ /* Order Thanks */
264
+ .order-thanks {
265
+ margin-left: 50%;
266
+ }
267
+
268
+ /* Order Colophon */
269
+ .order-colophon {
270
+ font-size: 0.785em;
271
+ line-height: 150%;
272
+ margin-bottom: 0;
273
+ }
274
+
275
+ .colophon-policies {
276
+ margin-bottom: 1.25em;
277
+ }
278
+
279
+
280
+ /* CSS Media Queries for Print
281
+ ------------------------------------------*/
282
+
283
+
284
+ @media print {
285
+ body {
286
+ font-size: 8pt;
287
+ }
288
+ }
templates/print/print-delivery-note.php DELETED
@@ -1,119 +0,0 @@
1
- <!DOCTYPE html>
2
- <html class="<?php echo wcdn_get_template_type(); ?>">
3
- <head>
4
- <meta charset="utf-8">
5
- <title><?php wcdn_template_title(); ?></title>
6
- <?php wcdn_head(); ?>
7
- <link rel="stylesheet" href="<?php wcdn_stylesheet_url( 'style.css' ); ?>" type="text/css" media="screen,print" />
8
- </head>
9
- <body>
10
- <div id="container">
11
- <?php wcdn_navigation(); ?>
12
- <div id="content">
13
- <div id="page">
14
- <div id="letter-header">
15
- <div class="heading"><?php if( wcdn_get_company_logo_id() ) : ?><?php wcdn_company_logo(); ?><?php else : ?><?php wcdn_template_title(); ?><?php endif; ?></div>
16
- <div class="company-info">
17
- <div class="company-name"><?php wcdn_company_name(); ?></div>
18
- <div class="company-address"><?php wcdn_company_info(); ?></div>
19
- </div>
20
- </div><!-- #letter-header -->
21
-
22
- <div id="order-listing">
23
- <h3><?php _e( 'Recipient', 'woocommerce-delivery-notes' ); ?></h3>
24
- <div class="shipping-info">
25
- <?php if( wcdn_get_template_type() == 'invoice' ) : ?>
26
- <?php wcdn_billing_address(); ?>
27
- <?php else : ?>
28
- <?php wcdn_shipping_address(); ?>
29
- <?php endif ?>
30
- </div><!-- .shipping-info -->
31
- </div><!-- #order-listing -->
32
-
33
- <ul id="order-info">
34
- <?php if( wcdn_get_company_logo_id() ) : ?>
35
- <li>
36
- <h3 class="order-number-label"><?php wcdn_template_title(); ?></h3>
37
- </li>
38
- <?php endif; ?>
39
- <li>
40
- <h3 class="order-date-label"><?php _e( 'Order Date', 'woocommerce-delivery-notes' ); ?></h3>
41
- <span class="order-date"><?php wcdn_order_date(); ?></span>
42
- </li>
43
- <li>
44
- <h3 class="order-number-label"><?php _e( 'Order Number', 'woocommerce-delivery-notes' ); ?></h3>
45
- <span class="order-number"><?php wcdn_order_number(); ?></span>
46
- </li>
47
- <li>
48
- <h3 class="order-payment-label"><?php _e( 'Payment Method', 'woocommerce-delivery-notes' ); ?></h3>
49
- <span class="order-payment"><?php wcdn_payment_method(); ?></span>
50
- </li>
51
- <li>
52
- <h3 class="order-telephone-label"><?php _e( 'Email', 'woocommerce-delivery-notes' ); ?></h3>
53
- <span class="order-payment"><?php wcdn_billing_email(); ?></span>
54
- </li>
55
- <li>
56
- <h3 class="order-email-label"><?php _e( 'Phone', 'woocommerce-delivery-notes' ); ?></h3>
57
- <span class="order-payment"><?php wcdn_billing_phone(); ?></span>
58
- </li>
59
- </ul><!-- #order-info -->
60
-
61
- <div id="order-items">
62
- <table>
63
- <thead>
64
- <tr>
65
- <th class="product-label"><?php _e('Product', 'woocommerce-delivery-notes'); ?></th>
66
- <th class="quantity-label"><?php _e('Quantity', 'woocommerce-delivery-notes'); ?></th>
67
- <th class="totals-label"><?php _e('Totals', 'woocommerce-delivery-notes'); ?></th>
68
- </tr>
69
- </thead>
70
- <tbody>
71
- <?php $items = wcdn_get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?><tr>
72
- <td class="description"><?php echo $item['name']; ?>
73
- <?php echo $item['meta']; ?>
74
- <dl class="meta">
75
- <?php if( !empty( $item['sku'] ) ) : ?><dt><?php _e( 'SKU:', 'woocommerce-delivery-notes' ); ?></dt><dd><?php echo $item['sku']; ?></dd><?php endif; ?>
76
- <?php if( !empty( $item['weight'] ) ) : ?><dt><?php _e( 'Weight:', 'woocommerce-delivery-notes' ); ?></dt><dd><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?>
77
- </dl>
78
- </td>
79
- <td class="quantity"><?php echo $item['quantity']; ?></td>
80
- <td class="price"><?php echo $item['price']; ?></td>
81
- </tr><?php endforeach; endif; ?>
82
- </tbody>
83
- </table>
84
- </div><!-- #order-items -->
85
-
86
- <div id="order-summary">
87
- <table>
88
- <tfoot>
89
- <?php foreach( wcdn_get_order_totals() as $total ) : ?>
90
- <tr>
91
- <th class="description"><?php echo $total['label']; ?></th>
92
- <td class="price"><?php echo $total['value']; ?></td>
93
- </tr>
94
- <?php endforeach; ?>
95
- </tfoot>
96
- </table>
97
- </div><!-- #order-summery -->
98
-
99
- <div id="order-notes">
100
- <div class="notes-shipping">
101
- <?php if ( wcdn_get_shipping_notes() ) : ?>
102
- <h3><?php _e( 'Customer Notes', 'woocommerce-delivery-notes' ); ?></h3>
103
- <?php wcdn_shipping_notes(); ?>
104
- <?php endif; ?>
105
- </div>
106
- <div class="notes-personal"><?php wcdn_personal_notes(); ?></div>
107
- </div><!-- #order-notes -->
108
-
109
- <?php if ( wcdn_get_policies_conditions() || wcdn_get_footer_imprint() ) : ?>
110
- <div id="letter-footer">
111
- <div class="policies"><?php wcdn_policies_conditions(); ?></div>
112
- <div class="imprint"><?php wcdn_footer_imprint(); ?></div>
113
- </div><!-- #letter-footer -->
114
- <?php endif; ?>
115
- </div><!-- #page -->
116
- </div><!-- #content -->
117
- </div><!-- #container -->
118
- </body>
119
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/print/print-invoice.php DELETED
@@ -1 +0,0 @@
1
- <?php wcdn_get_template( 'print-delivery-note.php' ); ?>
 
templates/print/style.css DELETED
@@ -1,257 +0,0 @@
1
- /* Simple CSS Reset and Print options
2
- ------------------------------------------*/
3
-
4
-
5
- html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, table, ol, ul, dl, li, dt, dd {
6
- border: 0 none;
7
- font: inherit;
8
- margin: 0;
9
- padding: 0;
10
- vertical-align: baseline;
11
- }
12
-
13
- body {
14
- line-height: 1;
15
- }
16
-
17
- ol,
18
- ul {
19
- list-style: none;
20
- }
21
-
22
- table {
23
- border-collapse: collapse;
24
- border-spacing: 0;
25
- }
26
-
27
-
28
- /* Template Page Layout
29
- ------------------------------------------*/
30
-
31
-
32
- /* Main Body */
33
- body {
34
- background: #fff;
35
- color: #000;
36
- font-family: "HelveticaNeue", Helvetica, Arial, sans-serif;
37
- font-size: 0.875em;
38
- line-height: 125%;
39
- }
40
-
41
- h1,
42
- h2,
43
- h3,
44
- h4 {
45
- font-weight: bold;
46
- }
47
-
48
- li,
49
- ul {
50
- margin-bottom: 1.25em;
51
- }
52
-
53
- p + p {
54
- margin-top: 1.25em;
55
- }
56
-
57
- /* Basic Table Styling */
58
- table {
59
- page-break-inside: auto;
60
- }
61
-
62
- tr {
63
- border-top: 1px #ccc solid;
64
- border-bottom: 1px #ccc solid;
65
- page-break-inside: avoid;
66
- page-break-after: auto;
67
- }
68
-
69
- td,
70
- th {
71
- border-left: 1px #ccc solid;
72
- border-right: 1px #ccc solid;
73
- padding: 0.375em;
74
- vertical-align: middle;
75
- }
76
-
77
- th {
78
- color: #000;
79
- font-weight: bold;
80
- text-align: left;
81
- }
82
-
83
- /* Special Margin & Overflow Stylings */
84
- #page {
85
- margin-left: auto;
86
- margin-right: auto;
87
- padding-top: 5%;
88
- padding-bottom: 5%;
89
- padding-left: 10%;
90
- padding-right: 10%;
91
- text-align: left;
92
- /* page-break-after: always; */
93
- }
94
-
95
- #letter-header,
96
- #order-items,
97
- #order-summary,
98
- #order-notes {
99
- margin-bottom: 3em;
100
- }
101
-
102
- #order-info,
103
- #order-summary {
104
- margin-bottom: 6em;
105
- }
106
-
107
- #page,
108
- #letter-header,
109
- #order-listing,
110
- #order-summary,
111
- #order-notes,
112
- #letter-footer {
113
- overflow: hidden;
114
- }
115
-
116
- #order-items,
117
- #order-summary,
118
- #order-notes {
119
- page-break-before: auto;
120
- page-break-after: auto;
121
- }
122
-
123
- /* Delivery Notes Head */
124
- #letter-header .heading {
125
- float: left;
126
- width: 50%;
127
- font-weight: bold;
128
- font-size: 2em;
129
- line-height: 125%;
130
- }
131
-
132
- #letter-header .company-name {
133
- font-weight: bold;
134
- }
135
-
136
- #letter-header .company-info {
137
- float: right;
138
- width: 50%;
139
- margin-top: 0.45em;
140
- }
141
-
142
- /* Order Listing - #order-listing */
143
- #order-listing {
144
- float: right;
145
- width: 50%;
146
- }
147
-
148
- /* Order Info - #order-info */
149
- #order-info {
150
- float: left;
151
- width: 50%;
152
- }
153
-
154
- /* Order Items - #order-items */
155
- #order-items {
156
- clear: both;
157
- }
158
-
159
- #order-items table {
160
- width: 100%;
161
- }
162
-
163
- #order-items .description {
164
- width: 50%;
165
- }
166
-
167
- #order-items .price {
168
- width: 25%;
169
- }
170
-
171
- #order-items dl {
172
- display: inline;
173
- margin-bottom: 0;
174
- color: #666;
175
- }
176
-
177
- #order-items dt,
178
- #order-items dd {
179
- display: inline;
180
- margin-bottom: 0;
181
- font-size: 0.75em;
182
- }
183
- #order-items dt {
184
- margin-left: 0.75em;
185
- }
186
-
187
- #order-items dd {
188
- margin-left: 0.2em;
189
- }
190
-
191
- /* Order Summary - #order-summary */
192
- #order-summary {
193
- float: right;
194
- width: 50%;
195
- }
196
-
197
- #order-summary table {
198
- width: 100%;
199
- page-break-inside: avoid;
200
- }
201
-
202
- #order-summary .price {
203
- width: 50%;
204
- }
205
-
206
- #order-summary tr:last-child {
207
- border-top: 2px solid #000;
208
- border-bottom: 2px solid #000;
209
- font-weight: bold;
210
- }
211
-
212
- #order-summary small,
213
- #order-summary .includes_tax {
214
- font-size: 0.75em;
215
- color: #666;
216
- }
217
-
218
- /* Order Notes - #order-notes */
219
- #order-notes {
220
- clear: both;
221
- }
222
- #order-notes .notes-shipping {
223
- float: left;
224
- width: 50%;
225
- }
226
- #order-notes .notes-personal {
227
- float: right;
228
- width: 50%;
229
- font-weight: bold;
230
- }
231
-
232
- /* Footer Imprint */
233
- #letter-footer {
234
- border-top: 1px solid #ccc;
235
- padding-top: 1em;
236
- color: #666;
237
- font-size: 0.75em;
238
- }
239
-
240
- #letter-footer p + p {
241
- margin-top: 1em;
242
- }
243
-
244
- #letter-footer .policies,
245
- #letter-footer .imprint {
246
- margin-bottom: 1em;
247
- }
248
-
249
-
250
- /* CSS Media Queries for Print
251
- ------------------------------------------*/
252
-
253
- @media print {
254
- body {
255
- font-size: 8pt;
256
- }
257
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
woocommerce-delivery-notes.php CHANGED
@@ -1,31 +1,30 @@
1
  <?php
2
  /**
3
- * Print order invoices & delivery notes for WooCommerce shop plugin.
4
- * You can add company/shop info as well as personal notes & policies to print pages.
5
  *
6
- * Plugin Name: WooCommerce Print Invoices & Delivery Notes
7
  * Plugin URI: https://github.com/piffpaffpuff/woocommerce-delivery-notes
8
- * Description: Print order invoices & delivery notes for WooCommerce shop plugin. You can add company/shop info as well as personal notes & policies to print pages.
9
- * Version: 2.0.2
10
- * Author: Steve Clark, Triggvy Gunderson, David Decker
11
  * Author URI: https://github.com/piffpaffpuff/woocommerce-delivery-notes
12
  * License: GPLv3 or later
13
  * License URI: http://www.opensource.org/licenses/gpl-license.php
14
  * Text Domain: woocommerce-delivery-notes
15
  * Domain Path: /languages/
16
  *
17
- * Copyright 2011-2012 Steve Clark, Trigvvy Gunderson, David Decker - DECKERWEB
18
  *
19
  * This file is part of WooCommerce Print Invoices & Delivery Notes,
20
  * a plugin for WordPress.
21
  *
22
- * WooCommerce Print Invoices & Delivery Notes is free software:
23
  * You can redistribute it and/or modify it under the terms of the
24
  * GNU General Public License as published by the Free Software
25
  * Foundation, either version 2 of the License, or (at your option)
26
  * any later version.
27
  *
28
- * WooCommerce Print Invoices & Delivery Notes is distributed in the hope that
29
  * it will be useful, but WITHOUT ANY WARRANTY; without even the
30
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31
  * PURPOSE. See the GNU General Public License for more details.
@@ -39,92 +38,103 @@
39
  */
40
  if ( !class_exists( 'WooCommerce_Delivery_Notes' ) ) {
41
 
42
- class WooCommerce_Delivery_Notes {
43
 
44
  public static $plugin_prefix;
45
  public static $plugin_url;
46
  public static $plugin_path;
47
  public static $plugin_basefile;
 
48
 
49
  public $writepanel;
50
  public $settings;
51
  public $print;
 
52
 
53
  /**
54
  * Constructor
55
  */
56
  public function __construct() {
 
57
  self::$plugin_prefix = 'wcdn_';
58
- self::$plugin_basefile = plugin_basename(__FILE__);
59
- self::$plugin_url = plugin_dir_url(self::$plugin_basefile);
60
- self::$plugin_path = trailingslashit(dirname(__FILE__));
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
64
- * Load the hooks
65
  */
66
- public function load() {
67
- // load the hooks
68
- add_action( 'plugins_loaded', array($this, 'load_localisation') );
69
- add_action( 'init', array( $this, 'load_hooks' ) );
70
- add_action( 'admin_init', array( $this, 'load_admin_hooks' ) );
71
  }
72
-
73
  /**
74
- * Load the main plugin classes and functions
 
75
  */
76
- public function includes() {
77
- include_once( 'classes/class-wcdn-writepanel.php' );
78
- include_once( 'classes/class-wcdn-settings.php' );
79
- include_once( 'classes/class-wcdn-print.php' );
80
  }
81
-
82
  /**
83
- * Load the localisation
84
  */
85
- public function load_localisation() {
86
- load_plugin_textdomain( 'woocommerce-delivery-notes', false, dirname( self::$plugin_basefile ) . '/../../languages/woocommerce-delivery-notes/' );
87
- load_plugin_textdomain( 'woocommerce-delivery-notes', false, dirname( self::$plugin_basefile ) . '/languages' );
 
 
 
 
 
 
88
  }
89
-
90
  /**
91
- * Load the init hooks
92
  */
93
- public function load_hooks() {
94
- if ( $this->is_woocommerce_activated() ) {
95
- $this->includes();
96
- $this->writepanel = new WooCommerce_Delivery_Notes_Writepanel();
97
- $this->writepanel->load();
98
- $this->settings = new WooCommerce_Delivery_Notes_Settings();
99
- $this->settings->load();
100
- $this->print = new WooCommerce_Delivery_Notes_Print();
101
- $this->print->load();
102
- }
103
  }
104
 
105
  /**
106
- * Load the admin hooks
107
  */
108
- public function load_admin_hooks() {
109
- if ( $this->is_woocommerce_activated() ) {
110
- add_filter( 'plugin_row_meta', array( $this, 'add_support_links' ), 10, 2 );
111
- add_filter( 'plugin_action_links_' . self::$plugin_basefile, array( $this, 'add_settings_link') );
 
 
 
 
 
 
 
 
 
112
  }
113
  }
114
 
115
  /**
116
- * Add various support links to plugin page
117
  */
118
- public function add_support_links( $links, $file ) {
119
- if ( !current_user_can( 'install_plugins' ) ) {
120
- return $links;
121
- }
122
-
123
- if ( $file == WooCommerce_Delivery_Notes::$plugin_basefile ) {
124
- $links[] = '<a href="http://wordpress.org/extend/plugins/woocommerce-delivery-notes/faq/" target="_blank" title="' . __( 'FAQ', 'woocommerce-delivery-notes' ) . '">' . __( 'FAQ', 'woocommerce-delivery-notes' ) . '</a>';
125
- $links[] = '<a href="http://wordpress.org/support/plugin/woocommerce-delivery-notes" target="_blank" title="' . __( 'Support', 'woocommerce-delivery-notes' ) . '">' . __( 'Support', 'woocommerce-delivery-notes' ) . '</a>';
126
- }
127
- return $links;
128
  }
129
 
130
  /**
@@ -135,455 +145,28 @@ if ( !class_exists( 'WooCommerce_Delivery_Notes' ) ) {
135
  array_unshift( $links, $settings );
136
  return $links;
137
  }
138
-
139
  /**
140
  * Check if woocommerce is activated
141
  */
142
  public function is_woocommerce_activated() {
143
  $blog_plugins = get_option( 'active_plugins', array() );
144
  $site_plugins = get_site_option( 'active_sitewide_plugins', array() );
145
-
146
- if ( in_array( 'woocommerce/woocommerce.php', $blog_plugins ) || isset( $site_plugins['woocommerce/woocommerce.php'] ) ) {
 
147
  return true;
148
  } else {
149
  return false;
150
  }
151
  }
152
- }
153
- }
154
-
155
- /**
156
- * Instance of plugin
157
- */
158
- $wcdn = new WooCommerce_Delivery_Notes();
159
- $wcdn->load();
160
-
161
- /**
162
- * Public functions
163
- */
164
-
165
- /**
166
- * Return Type of the print template
167
- */
168
- if ( !function_exists( 'wcdn_get_template_type' ) ) {
169
- function wcdn_get_template_type() {
170
- global $wcdn;
171
- return $wcdn->print->template_type;
172
- }
173
- }
174
-
175
- /**
176
- * Show the template part
177
- */
178
- if ( !function_exists( 'wcdn_get_template' ) ) {
179
- function wcdn_get_template( $name ) {
180
- global $wcdn;
181
- $wcdn->print->get_template( $name );
182
- }
183
- }
184
-
185
- /**
186
- * Show template url
187
- */
188
- if ( !function_exists( 'wcdn_stylesheet_url' ) ) {
189
- function wcdn_stylesheet_url( $name ) {
190
- global $wcdn;
191
- echo apply_filters( 'wcdn_stylesheet_url', $wcdn->print->get_template_url( $name ) );
192
- }
193
- }
194
-
195
- /**
196
- * Show the template title depending on type
197
- */
198
- if ( !function_exists( 'wcdn_template_title' ) ) {
199
- function wcdn_template_title() {
200
- if( wcdn_get_template_type() == 'invoice' ) {
201
- echo apply_filters( 'wcdn_template_title', __( 'Invoice', 'woocommerce-delivery-notes' ) );
202
- } else {
203
- echo apply_filters( 'wcdn_template_title', __( 'Delivery Note', 'woocommerce-delivery-notes' ) );
204
- }
205
- }
206
- }
207
-
208
- /**
209
- * Create header
210
- */
211
- if ( !function_exists( 'wcdn_head' ) ) {
212
- function wcdn_head() {
213
- ?>
214
- <style>
215
- #navigation {
216
- font-family: sans-serif;
217
- background-color: #f7f7f7;
218
- z-index: 200;
219
- border-bottom: 1px solid #dfdfdf;
220
- left: 0;
221
- right: 0;
222
- top: 0;
223
- position: fixed;
224
- padding: 6px;
225
- }
226
-
227
- #navigation .button {
228
- display: inline-block;
229
- text-decoration: none;
230
- font-size: 12px;
231
- line-height: 23px;
232
- height: 24px;
233
- margin: 0;
234
- padding: 0 10px 1px;
235
- cursor: pointer;
236
- border-width: 1px;
237
- border-style: solid;
238
- -webkit-border-radius: 3px;
239
- -webkit-appearance: none;
240
- border-radius: 3px;
241
- white-space: nowrap;
242
- -webkit-box-sizing: border-box;
243
- -moz-box-sizing: border-box;
244
- box-sizing: border-box;
245
-
246
- background: #f3f3f3;
247
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4));
248
- background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4);
249
- background-image: -moz-linear-gradient(top, #fefefe, #f4f4f4);
250
- background-image: -o-linear-gradient(top, #fefefe, #f4f4f4);
251
- background-image: linear-gradient(to bottom, #fefefe, #f4f4f4);
252
- border-color: #bbb;
253
- color: #333;
254
- text-shadow: 0 1px 0 #fff;
255
- }
256
-
257
- #navigation .button:hover,
258
- #navigation .button:focus {
259
- background: #f3f3f3;
260
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
261
- background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
262
- background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
263
- background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
264
- background-image: -o-linear-gradient(top, #fff, #f3f3f3);
265
- background-image: linear-gradient(to bottom, #fff, #f3f3f3);
266
- border-color: #999;
267
- color: #222;
268
- }
269
-
270
- #navigation .button:active {
271
- background: #eee;
272
- background-image: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#fefefe));
273
- background-image: -webkit-linear-gradient(top, #f4f4f4, #fefefe);
274
- background-image: -moz-linear-gradient(top, #f4f4f4, #fefefe);
275
- background-image: -ms-linear-gradient(top, #f4f4f4, #fefefe);
276
- background-image: -o-linear-gradient(top, #f4f4f4, #fefefe);
277
- background-image: linear-gradient(to bottom, #f4f4f4, #fefefe);
278
- border-color: #999;
279
- color: #333;
280
- text-shadow: 0 -1px 0 #fff;
281
- -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
282
- box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
283
- }
284
-
285
- @media print {
286
- #navigation {
287
- display: none;
288
- }
289
- }
290
- </style>
291
- <?php
292
- }
293
- }
294
-
295
- /**
296
- * Create meta navigation
297
- */
298
- if ( !function_exists( 'wcdn_navigation' ) ) {
299
- function wcdn_navigation() {
300
- ?>
301
- <div id="navigation">
302
- <a href="#" class="button" onclick="window.print();return false;"><?php _e( 'Print', 'woocommerce-delivery-notes' ); ?></a>
303
- </div>
304
- <?php
305
- }
306
- }
307
-
308
- /**
309
- * Return logo id
310
- */
311
- if ( !function_exists( 'wcdn_get_company_logo_id' ) ) {
312
- function wcdn_get_company_logo_id() {
313
- global $wcdn;
314
- return apply_filters( 'wcdn_company_logo_id', $wcdn->settings->get_setting( 'company_logo_image_id' ) );
315
- }
316
- }
317
-
318
- /**
319
- * Show logo html
320
- */
321
- if ( !function_exists( 'wcdn_company_logo' ) ) {
322
- function wcdn_company_logo() {
323
- global $wcdn;
324
- $attachment_id = wcdn_get_company_logo_id();
325
- $company = $wcdn->settings->get_setting( 'custom_company_name' );
326
- if( $attachment_id ) {
327
- $attachment_src = wp_get_attachment_image_src( $attachment_id, 'full', false );
328
-
329
- // resize the image to a 1/4 of the original size
330
- // to have a printing point density of about 288ppi.
331
- ?>
332
- <img src="<?php echo $attachment_src[0]; ?>" width="<?php echo $attachment_src[1] / 4; ?>" height="<?php echo $attachment_src[2] / 4; ?>" alt="<?php echo esc_attr( $company ); ?>" />
333
- <?php
334
- }
335
- }
336
- }
337
-
338
- /**
339
- * Return default title name of Delivery Note
340
- */
341
- if ( !function_exists( 'wcdn_company_name' ) ) {
342
- function wcdn_company_name() {
343
- global $wcdn;
344
- $name = trim( $wcdn->settings->get_setting( 'custom_company_name' ) );
345
- if( !empty( $name ) ) {
346
- echo apply_filters( 'wcdn_company_name', wpautop( wptexturize( $name ) ) );
347
- } else {
348
- echo apply_filters( 'wcdn_company_name', get_bloginfo( 'name' ) );
349
- }
350
- }
351
- }
352
-
353
- /**
354
- * Return shop/company info if provided
355
- */
356
- if ( !function_exists( 'wcdn_company_info' ) ) {
357
- function wcdn_company_info() {
358
- global $wcdn;
359
- echo wpautop( wptexturize( $wcdn->settings->get_setting( 'company_address' ) ) );
360
- }
361
- }
362
-
363
- /**
364
- * Show billing phone
365
- */
366
- if ( !function_exists( 'wcdn_billing_phone' ) ) {
367
- function wcdn_billing_phone() {
368
- global $wcdn;
369
- echo $wcdn->print->get_order()->billing_phone;
370
- }
371
- }
372
-
373
- /**
374
- * Show billing email
375
- */
376
- if ( !function_exists( 'wcdn_billing_email' ) ) {
377
- function wcdn_billing_email() {
378
- global $wcdn;
379
- echo $wcdn->print->get_order()->billing_email;
380
- }
381
- }
382
-
383
- /**
384
- * Show billing address
385
- */
386
- if ( !function_exists( 'wcdn_billing_address' ) ) {
387
- function wcdn_billing_address() {
388
- global $wcdn;
389
- $address = $wcdn->print->get_order()->get_formatted_billing_address();
390
- if( !$address ) {
391
- $address = __('N/A', 'woocommerce-delivery-notes');
392
- }
393
- echo apply_filters( 'wcdn_billing_address', $address );
394
- }
395
- }
396
-
397
- /**
398
- * Show shipping address
399
- */
400
- if ( !function_exists( 'wcdn_shipping_address' ) ) {
401
- function wcdn_shipping_address() {
402
- global $wcdn;
403
- $address = $wcdn->print->get_order()->get_formatted_shipping_address();
404
- if( !$address ) {
405
- $address = __('N/A', 'woocommerce-delivery-notes');
406
- }
407
- echo apply_filters( 'wcdn_shipping_address', $address );
408
- }
409
- }
410
-
411
- /**
412
- * Show the current date
413
- */
414
- if ( !function_exists( 'wcdn_date' ) ) {
415
- function wcdn_date() {
416
- echo apply_filters( 'wcdn_date', date_i18n( get_option( 'date_format' ) ) );
417
- }
418
- }
419
-
420
- /**
421
- * Show payment method
422
- */
423
- if ( !function_exists( 'wcdn_payment_method' ) ) {
424
- function wcdn_payment_method() {
425
- global $wcdn;
426
- echo apply_filters( 'wcdn_payment_method', __( $wcdn->print->get_order()->payment_method_title, 'woocommerce' ) );
427
- }
428
- }
429
-
430
- /**
431
- * Get order
432
- */
433
- if ( !function_exists( 'wcdn_get_order' ) ) {
434
- function wcdn_get_order( $order_id = null ) {
435
- global $wcdn;
436
- return $wcdn->print->get_order( $order_id );
437
- }
438
- }
439
-
440
- /**
441
- * Get order custom field
442
- */
443
- if ( !function_exists( 'wcdn_get_order_custom_field' ) ) {
444
- function wcdn_get_order_custom_field( $field ) {
445
- global $wcdn;
446
- return $wcdn->print->get_order_field( $field );
447
- }
448
- }
449
-
450
- /**
451
- * Show order number
452
- */
453
- if ( !function_exists( 'wcdn_order_number' ) ) {
454
- function wcdn_order_number() {
455
- global $wcdn;
456
-
457
- // Trim the hash to have a clean number but still
458
- // support any filters that were applied before.
459
- $order_number = ltrim($wcdn->print->get_order()->get_order_number(), '#');
460
- echo $order_number;
461
- }
462
- }
463
-
464
- /**
465
- * Show the order date
466
- */
467
- if ( !function_exists( 'wcdn_order_date' ) ) {
468
- function wcdn_order_date() {
469
- global $wcdn;
470
- $order = $wcdn->print->get_order();
471
- echo apply_filters( 'wcdn_order_date', date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ) );
472
- }
473
- }
474
-
475
- /**
476
- * Return the order items
477
- */
478
- if ( !function_exists( 'wcdn_get_order_items' ) ) {
479
- function wcdn_get_order_items() {
480
- global $wcdn;
481
- return apply_filters( 'wcdn_order_items', $wcdn->print->get_order_items() );
482
- }
483
- }
484
-
485
- /**
486
- * Return the order totals listing
487
- */
488
- if ( !function_exists( 'wcdn_get_order_totals' ) ) {
489
- function wcdn_get_order_totals() {
490
- global $wcdn;
491
 
492
- // get totals and remove the semicolon
493
- $totals = apply_filters( 'wcdn_raw_order_totals', $wcdn->print->get_order()->get_order_item_totals() );
494
-
495
- // remove the colon for every label
496
- foreach ( $totals as $key => $total ) {
497
- $label = $total['label'];
498
- $colon = strrpos( $label, ':' );
499
- if( $colon !== false ) {
500
- $label = substr_replace( $label, '', $colon, 1 );
501
- }
502
- $totals[$key]['label'] = $label;
503
- }
504
-
505
- return apply_filters( 'wcdn_order_totals', $totals );
506
  }
507
  }
508
 
509
  /**
510
- * Return has shipping notes
511
  */
512
- if ( !function_exists( 'wcdn_get_shipping_notes' ) ) {
513
- function wcdn_get_shipping_notes() {
514
- global $wcdn;
515
- return wpautop( wptexturize( $wcdn->print->get_order()->customer_note ) );
516
- }
517
- }
518
-
519
- /**
520
- * Show shipping notes
521
- */
522
- if ( !function_exists( 'wcdn_shipping_notes' ) ) {
523
- function wcdn_shipping_notes() {
524
- global $wcdn;
525
- echo wcdn_get_shipping_notes();
526
- }
527
- }
528
-
529
- /**
530
- * Return personal notes, season greetings etc.
531
- */
532
- if ( !function_exists( 'wcdn_get_personal_notes' ) ) {
533
- function wcdn_get_personal_notes() {
534
- global $wcdn;
535
- return wpautop( wptexturize( $wcdn->settings->get_setting( 'personal_notes' ) ) );
536
- }
537
- }
538
-
539
- /**
540
- * Show personal notes, season greetings etc.
541
- */
542
- if ( !function_exists( 'wcdn_personal_notes' ) ) {
543
- function wcdn_personal_notes() {
544
- global $wcdn;
545
- echo wcdn_get_personal_notes();
546
- }
547
- }
548
-
549
- /**
550
- * Return policy for returns
551
- */
552
- if ( !function_exists( 'wcdn_get_policies_conditions' ) ) {
553
- function wcdn_get_policies_conditions() {
554
- global $wcdn;
555
- return wpautop( wptexturize( $wcdn->settings->get_setting( 'policies_conditions' ) ) );
556
- }
557
- }
558
-
559
- /**
560
- * Show policy for returns
561
- */
562
- if ( !function_exists( 'wcdn_policies_conditions' ) ) {
563
- function wcdn_policies_conditions() {
564
- global $wcdn;
565
- echo wcdn_get_policies_conditions();
566
- }
567
- }
568
-
569
- /**
570
- * Return shop/company footer imprint, copyright etc.
571
- */
572
- if ( !function_exists( 'wcdn_get_footer_imprint' ) ) {
573
- function wcdn_get_footer_imprint() {
574
- global $wcdn;
575
- return wpautop( wptexturize( $wcdn->settings->get_setting( 'footer_imprint' ) ) );
576
- }
577
- }
578
-
579
- /**
580
- * Show shop/company footer imprint, copyright etc.
581
- */
582
- if ( !function_exists( 'wcdn_footer_imprint' ) ) {
583
- function wcdn_footer_imprint() {
584
- global $wcdn;
585
- echo wcdn_get_footer_imprint();
586
- }
587
- }
588
 
589
  ?>
1
  <?php
2
  /**
3
+ * Print invoices & delivery notes for WooCommerce orders.
 
4
  *
5
+ * Plugin Name: WooCommerce Print Invoice & Delivery Note
6
  * Plugin URI: https://github.com/piffpaffpuff/woocommerce-delivery-notes
7
+ * Description: Print Invoices & Delivery Notes for WooCommerce Orders.
8
+ * Version: 3.0.6
9
+ * Author: Triggvy Gunderson
10
  * Author URI: https://github.com/piffpaffpuff/woocommerce-delivery-notes
11
  * License: GPLv3 or later
12
  * License URI: http://www.opensource.org/licenses/gpl-license.php
13
  * Text Domain: woocommerce-delivery-notes
14
  * Domain Path: /languages/
15
  *
16
+ * Copyright 2014 Triggvy Gunderson, David Decker
17
  *
18
  * This file is part of WooCommerce Print Invoices & Delivery Notes,
19
  * a plugin for WordPress.
20
  *
21
+ * WooCommerce Print Invoice & Delivery Note is free software:
22
  * You can redistribute it and/or modify it under the terms of the
23
  * GNU General Public License as published by the Free Software
24
  * Foundation, either version 2 of the License, or (at your option)
25
  * any later version.
26
  *
27
+ * WooCommerce Print Invoice & Delivery Note is distributed in the hope that
28
  * it will be useful, but WITHOUT ANY WARRANTY; without even the
29
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30
  * PURPOSE. See the GNU General Public License for more details.
38
  */
39
  if ( !class_exists( 'WooCommerce_Delivery_Notes' ) ) {
40
 
41
+ final class WooCommerce_Delivery_Notes {
42
 
43
  public static $plugin_prefix;
44
  public static $plugin_url;
45
  public static $plugin_path;
46
  public static $plugin_basefile;
47
+ public static $plugin_basefile_path;
48
 
49
  public $writepanel;
50
  public $settings;
51
  public $print;
52
+ public $theme;
53
 
54
  /**
55
  * Constructor
56
  */
57
  public function __construct() {
58
+ // Define the constants
59
  self::$plugin_prefix = 'wcdn_';
60
+ self::$plugin_basefile_path = __FILE__;
61
+ self::$plugin_basefile = plugin_basename( self::$plugin_basefile_path );
62
+ self::$plugin_url = plugin_dir_url( self::$plugin_basefile );
63
+ self::$plugin_path = trailingslashit( dirname( self::$plugin_basefile_path ) );
64
+
65
+ // Include the classes
66
+ $this->include_classes();
67
+
68
+ // Set hooks and wait for WooCommerce to load
69
+ register_activation_hook( self::$plugin_basefile_path, array( $this, 'install' ) );
70
+ add_action( 'plugins_loaded', array( $this, 'localise' ) );
71
+ add_action( 'woocommerce_loaded', array( $this, 'load' ) );
72
  }
73
 
74
  /**
75
+ * Include the main plugin classes and functions
76
  */
77
+ public function include_classes() {
78
+ include_once( 'includes/class-wcdn-print.php' );
79
+ include_once( 'includes/class-wcdn-settings.php' );
80
+ include_once( 'includes/class-wcdn-writepanel.php' );
81
+ include_once( 'includes/class-wcdn-theme.php' );
82
  }
83
+
84
  /**
85
+ * Function used to init Template Functions.
86
+ * This makes them pluggable by plugins and themes.
87
  */
88
+ public function include_template_functions() {
89
+ include_once( 'includes/wcdn-template-functions.php' );
90
+ include_once( 'includes/wcdn-template-hooks.php' );
 
91
  }
92
+
93
  /**
94
+ * Install the defaults on activation
95
  */
96
+ public function install() {
97
+ // Define default settings
98
+ $option = get_option( self::$plugin_prefix . 'print_order_page_endpoint' );
99
+ if( !$option ) {
100
+ update_option( self::$plugin_prefix . 'print_order_page_endpoint', 'print-order' );
101
+
102
+ // Flush the rewrite rules when a fresh install
103
+ set_transient( self::$plugin_prefix . 'flush_rewrite_rules', true );
104
+ }
105
  }
106
+
107
  /**
108
+ * Load the localisation
109
  */
110
+ public function localise() {
111
+ load_plugin_textdomain( 'woocommerce-delivery-notes', false, dirname( self::$plugin_basefile ) . '/languages/' );
 
 
 
 
 
 
 
 
112
  }
113
 
114
  /**
115
+ * Include the main plugin classes and functions
116
  */
117
+ public function load() {
118
+ // WooCommerce activation required
119
+ if ( $this->is_woocommerce_activated() ) {
120
+ // Create the instances
121
+ $this->print = new WooCommerce_Delivery_Notes_Print();
122
+ $this->settings = new WooCommerce_Delivery_Notes_Settings();
123
+ $this->writepanel = new WooCommerce_Delivery_Notes_Writepanel();
124
+ $this->theme = new WooCommerce_Delivery_Notes_Theme();
125
+
126
+ // Load the hooks for the template after the objetcs.
127
+ // Like this the template has full access to all objects.
128
+ add_action( 'admin_init', array( $this, 'load_admin_hooks' ) );
129
+ add_action( 'init', array( $this, 'include_template_functions' ) );
130
  }
131
  }
132
 
133
  /**
134
+ * Load the admin hooks
135
  */
136
+ public function load_admin_hooks() {
137
+ add_filter( 'plugin_action_links_' . self::$plugin_basefile, array( $this, 'add_settings_link') );
 
 
 
 
 
 
 
 
138
  }
139
 
140
  /**
145
  array_unshift( $links, $settings );
146
  return $links;
147
  }
148
+
149
  /**
150
  * Check if woocommerce is activated
151
  */
152
  public function is_woocommerce_activated() {
153
  $blog_plugins = get_option( 'active_plugins', array() );
154
  $site_plugins = get_site_option( 'active_sitewide_plugins', array() );
155
+ $woocommerce_basename = plugin_basename( WC_PLUGIN_FILE );
156
+
157
+ if( ( in_array( $woocommerce_basename, $blog_plugins ) || isset( $site_plugins[$woocommerce_basename] ) ) && version_compare( WC_VERSION, '2.1', '>=' )) {
158
  return true;
159
  } else {
160
  return false;
161
  }
162
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  }
165
  }
166
 
167
  /**
168
+ * Instance of the plugin
169
  */
170
+ $wcdn = new WooCommerce_Delivery_Notes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  ?>