Version Description
(08.02.2022) = * Enhancement :- Added an option to print the invoice text in Right to Left direction. * Enhancement :- Added a filter called 'wcdn_product_meta_data' to remove the meta fields of the product in the invoice. * Fix :- Quantity column was showing wrong total in the print invoice on the frontend when the invoice contains WooCommerce Composite products. * Fix :- Extra tabs were added in the bulk action print link. * Fix :- When using the file field in the WooCommerce Product Addons plugin whole path was getting printed instead of the filename. * Fix :- The invoice number was not appearing when we open the invoice from the Order email sent to the customer. * Fix :- Debug log errors are been fixed.
Download this release
Release Info
Developer | tychesoftwares |
Plugin | WooCommerce Print Invoice & Delivery Note |
Version | 4.6.5 |
Comparing to | |
See all releases |
Code changes from version 4.6.4 to 4.6.5
- includes/class-wcdn-settings.php +18 -10
- includes/class-wcdn-writepanel.php +1 -5
- includes/class-woocommerce-delivery-notes.php +1 -1
- includes/wcdn-all-component.php +7 -7
- includes/wcdn-template-functions.php +25 -1
- readme.txt +18 -9
- templates/print-order/print-content.php +28 -3
- templates/print-order/print-header.php +19 -0
- woocommerce-delivery-notes.php +3 -3
includes/class-wcdn-settings.php
CHANGED
@@ -222,20 +222,20 @@ if ( ! class_exists( 'WCDN_Settings' ) ) {
|
|
222 |
),
|
223 |
|
224 |
array(
|
225 |
-
'title'
|
226 |
-
'desc'
|
227 |
-
'id'
|
228 |
-
'default'
|
229 |
-
'type'
|
230 |
'checkboxgroup' => 'start',
|
231 |
),
|
232 |
|
233 |
array(
|
234 |
-
'desc'
|
235 |
-
'id'
|
236 |
-
'default'
|
237 |
-
'type'
|
238 |
-
'desc_tip'
|
239 |
'checkboxgroup' => 'end',
|
240 |
),
|
241 |
|
@@ -256,6 +256,14 @@ if ( ! class_exists( 'WCDN_Settings' ) ) {
|
|
256 |
'checkboxgroup' => 'end',
|
257 |
),
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
array(
|
260 |
'type' => 'sectionend',
|
261 |
'id' => 'display_options',
|
222 |
),
|
223 |
|
224 |
array(
|
225 |
+
'title' => __( 'Email', 'woocommerce-delivery-notes' ),
|
226 |
+
'desc' => __( 'Show print link in customer emails', 'woocommerce-delivery-notes' ),
|
227 |
+
'id' => 'wcdn_email_print_link',
|
228 |
+
'default' => 'no',
|
229 |
+
'type' => 'checkbox',
|
230 |
'checkboxgroup' => 'start',
|
231 |
),
|
232 |
|
233 |
array(
|
234 |
+
'desc' => __( 'Show print link in Admin emails', 'woocommerce-delivery-notes' ),
|
235 |
+
'id' => 'wcdn_admin_email_print_link',
|
236 |
+
'default' => 'no',
|
237 |
+
'type' => 'checkbox',
|
238 |
+
'desc_tip' => __( 'This includes the emails for a new, processing and completed order. On top of that the customer and admin invoice emails will also include the link.', 'woocommerce-delivery-notes' ),
|
239 |
'checkboxgroup' => 'end',
|
240 |
),
|
241 |
|
256 |
'checkboxgroup' => 'end',
|
257 |
),
|
258 |
|
259 |
+
array(
|
260 |
+
'title' => __( 'Text Direction', 'woocommerce-delivery-notes' ),
|
261 |
+
'desc' => __( 'Print Text from Right to left', 'woocommerce-delivery-notes' ),
|
262 |
+
'id' => 'wcdn_rtl_invoice',
|
263 |
+
'default' => 'no',
|
264 |
+
'type' => 'checkbox',
|
265 |
+
'desc_tip' => __( 'Show text in right to left direction in Invoice, Print Receipt & Delivery note if you are using languages such as Hebrew, Arabic, etc.', 'woocommerce-delivery-notes' ),
|
266 |
+
),
|
267 |
array(
|
268 |
'type' => 'sectionend',
|
269 |
'id' => 'display_options',
|
includes/class-wcdn-writepanel.php
CHANGED
@@ -218,11 +218,7 @@ if ( ! class_exists( 'WCDN_Writepanel' ) ) {
|
|
218 |
|
219 |
<div id="woocommerce-delivery-notes-bulk-print-message" class="updated">
|
220 |
<p><?php wp_kses_post( $message, 'woocommerce-delivery-notes' ); ?>
|
221 |
-
<a href="<?php if ( isset( $_REQUEST['print_url'] ) ) : ?>
|
222 |
-
<?php
|
223 |
-
// phpcs:ignore
|
224 |
-
echo urldecode( esc_url_raw( $_REQUEST['print_url'] ) ); ?>
|
225 |
-
<?php endif; ?>" target="_blank" class="print-preview-button" id="woocommerce-delivery-notes-bulk-print-button"><?php esc_attr_e( 'Print now', 'woocommerce-delivery-notes' ); ?></a> <span class="print-preview-loading spinner"></span></p>
|
226 |
</div>
|
227 |
|
228 |
<?php
|
218 |
|
219 |
<div id="woocommerce-delivery-notes-bulk-print-message" class="updated">
|
220 |
<p><?php wp_kses_post( $message, 'woocommerce-delivery-notes' ); ?>
|
221 |
+
<a href="<?php if ( isset( $_REQUEST['print_url'] ) ) : echo urldecode( esc_url_raw( $_REQUEST['print_url'] ) ); endif; // phpcs:ignore ?>" target="_blank" class="print-preview-button" id="woocommerce-delivery-notes-bulk-print-button"><?php esc_attr_e( 'Print now', 'woocommerce-delivery-notes' ); ?></a> <span class="print-preview-loading spinner"></span></p>
|
|
|
|
|
|
|
|
|
222 |
</div>
|
223 |
|
224 |
<?php
|
includes/class-woocommerce-delivery-notes.php
CHANGED
@@ -36,7 +36,7 @@ if ( ! class_exists( 'WooCommerce_Delivery_Notes' ) ) {
|
|
36 |
*
|
37 |
* @var string $plugin_version Current plugin version number
|
38 |
*/
|
39 |
-
public static $plugin_version = '4.6.
|
40 |
|
41 |
/**
|
42 |
* Plugin URL on current installation
|
36 |
*
|
37 |
* @var string $plugin_version Current plugin version number
|
38 |
*/
|
39 |
+
public static $plugin_version = '4.6.5';
|
40 |
|
41 |
/**
|
42 |
* Plugin URL on current installation
|
includes/wcdn-all-component.php
CHANGED
@@ -209,24 +209,24 @@ add_filter( \'wcdn_order_info_fields\', \'example_removed_payment_method\' );<pr
|
|
209 |
),
|
210 |
6 => array (
|
211 |
'question' => 'How can I add some more fields to the order info section? ',
|
212 |
-
'answer' => '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->
|
213 |
<br/><br/>
|
214 |
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:
|
215 |
<pre>
|
216 |
function example_custom_order_fields( $fields, $order ) {
|
217 |
$new_fields = array();
|
218 |
|
219 |
-
if( get_post_meta( $order->
|
220 |
$new_fields[\'your_meta_field_name\'] = array(
|
221 |
\'label\' => \'VAT\',
|
222 |
-
\'value\' => get_post_meta( $order->
|
223 |
);
|
224 |
}
|
225 |
|
226 |
-
if( get_post_meta( $order->
|
227 |
$new_fields[\'your_meta_field_name\'] = array(
|
228 |
\'label\' => \'Customer Number\',
|
229 |
-
\'value\' => get_post_meta( $order->
|
230 |
);
|
231 |
}
|
232 |
|
@@ -242,9 +242,9 @@ add_filter( \'wcdn_order_info_fields\', \'example_custom_order_fields\', 10, 2 )
|
|
242 |
|
243 |
<pre>
|
244 |
function example_product_image( $product ) {
|
245 |
-
if( isset( $product->
|
246 |
echo get_the_post_thumbnail(
|
247 |
-
$product->
|
248 |
array( 40, 40 ),
|
249 |
array( \'loading\' => false )
|
250 |
);
|
209 |
),
|
210 |
6 => array (
|
211 |
'question' => 'How can I add some more fields to the order info section? ',
|
212 |
+
'answer' => '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->get_id(), \'your_meta_field_name\', true);` function and of course the `your_meta_field_name`.
|
213 |
<br/><br/>
|
214 |
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:
|
215 |
<pre>
|
216 |
function example_custom_order_fields( $fields, $order ) {
|
217 |
$new_fields = array();
|
218 |
|
219 |
+
if( get_post_meta( $order->get_id(), \'your_meta_field_name\', true ) ) {
|
220 |
$new_fields[\'your_meta_field_name\'] = array(
|
221 |
\'label\' => \'VAT\',
|
222 |
+
\'value\' => get_post_meta( $order->get_id(), \'your_meta_field_name\', true )
|
223 |
);
|
224 |
}
|
225 |
|
226 |
+
if( get_post_meta( $order->get_id(), \'your_meta_field_name\', true ) ) {
|
227 |
$new_fields[\'your_meta_field_name\'] = array(
|
228 |
\'label\' => \'Customer Number\',
|
229 |
+
\'value\' => get_post_meta( $order->get_id(), \'your_meta_field_name\', true )
|
230 |
);
|
231 |
}
|
232 |
|
242 |
|
243 |
<pre>
|
244 |
function example_product_image( $product ) {
|
245 |
+
if( isset( $product->get_id() ) && ( \'\' !== $product->get_id() ) && has_post_thumbnail( $product->get_id ) ) {
|
246 |
echo get_the_post_thumbnail(
|
247 |
+
$product->get_id(),
|
248 |
array( 40, 40 ),
|
249 |
array( \'loading\' => false )
|
250 |
);
|
includes/wcdn-template-functions.php
CHANGED
@@ -265,7 +265,7 @@ function wcdn_get_order_info( $order ) {
|
|
265 |
$wdn_order_billing_id = ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) ? $order->get_billing_email() : $order->billing_email;
|
266 |
$wdn_order_billing_phone = ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) ? $order->get_billing_phone() : $order->billing_phone;
|
267 |
|
268 |
-
if ( 'invoice' === wcdn_get_template_type() && ! empty( $create_invoice_number ) && 'yes' === $create_invoice_number ) {
|
269 |
|
270 |
$fields['invoice_number'] = array(
|
271 |
'label' => __( 'Invoice Number', 'woocommerce-delivery-notes' ),
|
@@ -640,4 +640,28 @@ function wcdn_print_extra_fields( $item ) {
|
|
640 |
}
|
641 |
|
642 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
?>
|
265 |
$wdn_order_billing_id = ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) ? $order->get_billing_email() : $order->billing_email;
|
266 |
$wdn_order_billing_phone = ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) ? $order->get_billing_phone() : $order->billing_phone;
|
267 |
|
268 |
+
if ( ( 'invoice' === wcdn_get_template_type() || 'order' === wcdn_get_template_type() ) && ! empty( $create_invoice_number ) && 'yes' === $create_invoice_number ) {
|
269 |
|
270 |
$fields['invoice_number'] = array(
|
271 |
'label' => __( 'Invoice Number', 'woocommerce-delivery-notes' ),
|
640 |
}
|
641 |
|
642 |
}
|
643 |
+
|
644 |
+
/**
|
645 |
+
* Function to show the correct quantity on the frontend when Composite/Bundle products are there.
|
646 |
+
*
|
647 |
+
* @param int $count Total Quantity.
|
648 |
+
* @param string $type Item Type.
|
649 |
+
* @param WC_Order $order Order object.
|
650 |
+
*/
|
651 |
+
function wcdn_order_item_count( $count, $type, $order ) {
|
652 |
+
global $wp;
|
653 |
+
// Check that print button is been clicked or not.
|
654 |
+
if ( ! empty( $wp->query_vars['print-order'] ) ) {
|
655 |
+
if ( in_array( 'woocommerce-composite-products/woocommerce-composite-products.php', apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ), true ) || in_array( 'woocommerce-product-bundles/woocommerce-product-bundles.php', apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ), true ) ) {
|
656 |
+
if ( function_exists( 'is_account_page' ) && is_account_page() ) {
|
657 |
+
$count = 0;
|
658 |
+
foreach ( $order->get_items() as $item ) {
|
659 |
+
$count += $item->get_quantity();
|
660 |
+
}
|
661 |
+
}
|
662 |
+
}
|
663 |
+
}
|
664 |
+
return $count;
|
665 |
+
}
|
666 |
+
add_filter( 'woocommerce_get_item_count', 'wcdn_order_item_count', 20, 3 );
|
667 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: ashokrane, tychesoftwares, rashmim, shasvat
|
|
4 |
Donate link: https://www.paypal.me/TycheSoftwares
|
5 |
Tags: packing slips, invoice, pdf invoice, delivery notes, woocommerce print invoice, print, pdf, invoices
|
6 |
Requires at least: 4.0
|
7 |
-
Tested up to: 5.
|
8 |
Author URI: https://www.tychesoftwares.com/
|
9 |
Stable tag: trunk
|
10 |
License: GPLv3 or later
|
@@ -237,7 +237,7 @@ add_filter( 'wcdn_order_info_fields', 'example_removed_payment_method' );
|
|
237 |
|
238 |
= How can I add some more fields to the order info section? =
|
239 |
|
240 |
-
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->
|
241 |
|
242 |
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:
|
243 |
|
@@ -245,17 +245,17 @@ An example that adds a 'VAT' and 'Customer Number' field to the end of the list.
|
|
245 |
function example_custom_order_fields( $fields, $order ) {
|
246 |
$new_fields = array();
|
247 |
|
248 |
-
if( get_post_meta( $order->
|
249 |
$new_fields['your_meta_field_name'] = array(
|
250 |
'label' => 'VAT',
|
251 |
-
'value' => get_post_meta( $order->
|
252 |
);
|
253 |
}
|
254 |
|
255 |
-
if( get_post_meta( $order->
|
256 |
$new_fields['your_meta_field_name'] = array(
|
257 |
'label' => 'Customer Number',
|
258 |
-
'value' => get_post_meta( $order->
|
259 |
);
|
260 |
}
|
261 |
|
@@ -272,8 +272,8 @@ An example that adds a 40px large product image. Paste the code in the `function
|
|
272 |
|
273 |
`
|
274 |
function example_product_image( $product ) {
|
275 |
-
if(
|
276 |
-
echo get_the_post_thumbnail( $product->
|
277 |
}
|
278 |
}
|
279 |
add_action( 'wcdn_order_item_before', 'example_product_image' );
|
@@ -338,6 +338,15 @@ Please [contribute your translation](https://github.com/TycheSoftwares/woocommer
|
|
338 |
|
339 |
== Changelog ==
|
340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
= 4.6.4 (21.07.2021) =
|
342 |
* Fix :- After updating to v4.6.3 , fatal error was coming in some sites where the invoice template has been customized by copying print-content.php file in the theme folder. This is fixed now.
|
343 |
|
@@ -347,7 +356,7 @@ Please [contribute your translation](https://github.com/TycheSoftwares/woocommer
|
|
347 |
* Fix :- When printing receipts, the number of downloaded files is displayed as "%s files". This is fixed now. Props to @inc2734 for the PR.
|
348 |
* Dev :- Translated the plugin in Korean language. Props to @shga89 for the PR.
|
349 |
|
350 |
-
= 4.6.2 (
|
351 |
|
352 |
Enhancement :- Added an option to insert the print link in the admin emails.
|
353 |
Fix :- Strings of Bulk Printing options were not getting translated. This is fixed now. Props to @pomegranate
|
4 |
Donate link: https://www.paypal.me/TycheSoftwares
|
5 |
Tags: packing slips, invoice, pdf invoice, delivery notes, woocommerce print invoice, print, pdf, invoices
|
6 |
Requires at least: 4.0
|
7 |
+
Tested up to: 5.9
|
8 |
Author URI: https://www.tychesoftwares.com/
|
9 |
Stable tag: trunk
|
10 |
License: GPLv3 or later
|
237 |
|
238 |
= How can I add some more fields to the order info section? =
|
239 |
|
240 |
+
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->get_id(), 'your_meta_field_name', true);` function and of course the `your_meta_field_name`.
|
241 |
|
242 |
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:
|
243 |
|
245 |
function example_custom_order_fields( $fields, $order ) {
|
246 |
$new_fields = array();
|
247 |
|
248 |
+
if( get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ) {
|
249 |
$new_fields['your_meta_field_name'] = array(
|
250 |
'label' => 'VAT',
|
251 |
+
'value' => get_post_meta( $order->get_id(), 'your_meta_field_name', true )
|
252 |
);
|
253 |
}
|
254 |
|
255 |
+
if( get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ) {
|
256 |
$new_fields['your_meta_field_name'] = array(
|
257 |
'label' => 'Customer Number',
|
258 |
+
'value' => get_post_meta( $order->get_id(), 'your_meta_field_name', true )
|
259 |
);
|
260 |
}
|
261 |
|
272 |
|
273 |
`
|
274 |
function example_product_image( $product ) {
|
275 |
+
if( ( '' !== $product->get_id() ) && has_post_thumbnail( $product->get_id() ) ) {
|
276 |
+
echo get_the_post_thumbnail( $product->get_id(), array( 40, 40 ), array( 'loading' => false ) );
|
277 |
}
|
278 |
}
|
279 |
add_action( 'wcdn_order_item_before', 'example_product_image' );
|
338 |
|
339 |
== Changelog ==
|
340 |
|
341 |
+
= 4.6.5 (08.02.2022) =
|
342 |
+
* Enhancement :- Added an option to print the invoice text in Right to Left direction.
|
343 |
+
* Enhancement :- Added a filter called 'wcdn_product_meta_data' to remove the meta fields of the product in the invoice.
|
344 |
+
* Fix :- Quantity column was showing wrong total in the print invoice on the frontend when the invoice contains WooCommerce Composite products.
|
345 |
+
* Fix :- Extra tabs were added in the bulk action print link.
|
346 |
+
* Fix :- When using the file field in the WooCommerce Product Addons plugin whole path was getting printed instead of the filename.
|
347 |
+
* Fix :- The invoice number was not appearing when we open the invoice from the Order email sent to the customer.
|
348 |
+
* Fix :- Debug log errors are been fixed.
|
349 |
+
|
350 |
= 4.6.4 (21.07.2021) =
|
351 |
* Fix :- After updating to v4.6.3 , fatal error was coming in some sites where the invoice template has been customized by copying print-content.php file in the theme folder. This is fixed now.
|
352 |
|
356 |
* Fix :- When printing receipts, the number of downloaded files is displayed as "%s files". This is fixed now. Props to @inc2734 for the PR.
|
357 |
* Dev :- Translated the plugin in Korean language. Props to @shga89 for the PR.
|
358 |
|
359 |
+
= 4.6.2 (11.12.2020) =
|
360 |
|
361 |
Enhancement :- Added an option to insert the print link in the admin emails.
|
362 |
Fix :- Strings of Bulk Printing options were not getting translated. This is fixed now. Props to @pomegranate
|
templates/print-order/print-content.php
CHANGED
@@ -139,17 +139,33 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
139 |
</span>
|
140 |
|
141 |
<?php
|
|
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
|
144 |
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
|
145 |
$variation = wc_get_product( $item['product_id'] );
|
146 |
-
foreach ( $
|
147 |
if ( ! ( 0 === strpos( $key, '_' ) ) ) {
|
148 |
if ( is_array( $value ) ) {
|
149 |
continue;
|
150 |
}
|
151 |
$term_wp = get_term_by( 'slug', $value, $key );
|
152 |
$attribute_name = wc_attribute_label( $key, $variation );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
if ( isset( $term_wp->name ) ) {
|
154 |
echo '<br>' . wp_kses_post( $attribute_name . ':' . $term_wp->name );
|
155 |
} else {
|
@@ -158,17 +174,26 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
158 |
}
|
159 |
}
|
160 |
} else {
|
161 |
-
foreach ( $
|
162 |
if ( ! ( 0 === strpos( $key, '_' ) ) ) {
|
163 |
if ( is_array( $value ) ) {
|
164 |
continue;
|
165 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
echo '<br>' . wp_kses_post( $key . ':' . $value );
|
167 |
}
|
168 |
}
|
169 |
}
|
170 |
} else {
|
171 |
-
$item_meta_new = new WC_Order_Item_Meta( $
|
172 |
$item_meta_new->display();
|
173 |
|
174 |
}
|
139 |
</span>
|
140 |
|
141 |
<?php
|
142 |
+
$item_meta_fields = apply_filters( 'wcdn_product_meta_data', $item['item_meta'], $item );
|
143 |
|
144 |
+
$product_addons = array();
|
145 |
+
$woocommerce_product_addon = 'woocommerce-product-addons/woocommerce-product-addons.php';
|
146 |
+
if ( in_array( $woocommerce_product_addon, apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ), true ) ) {
|
147 |
+
$product_id = $item['product_id'];
|
148 |
+
$product_addons = WC_Product_Addons_Helper::get_product_addons( $product_id );
|
149 |
+
}
|
150 |
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
|
151 |
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
|
152 |
$variation = wc_get_product( $item['product_id'] );
|
153 |
+
foreach ( $item_meta_fields as $key => $value ) {
|
154 |
if ( ! ( 0 === strpos( $key, '_' ) ) ) {
|
155 |
if ( is_array( $value ) ) {
|
156 |
continue;
|
157 |
}
|
158 |
$term_wp = get_term_by( 'slug', $value, $key );
|
159 |
$attribute_name = wc_attribute_label( $key, $variation );
|
160 |
+
if ( ! empty( $product_addons ) ) {
|
161 |
+
foreach ( $product_addons as $addon ) {
|
162 |
+
if ( 'file_upload' === $addon['type'] ) {
|
163 |
+
if ( $key === $addon['name'] ) {
|
164 |
+
$value = wp_basename( $value );
|
165 |
+
}
|
166 |
+
}
|
167 |
+
}
|
168 |
+
}
|
169 |
if ( isset( $term_wp->name ) ) {
|
170 |
echo '<br>' . wp_kses_post( $attribute_name . ':' . $term_wp->name );
|
171 |
} else {
|
174 |
}
|
175 |
}
|
176 |
} else {
|
177 |
+
foreach ( $item_meta_fields as $key => $value ) {
|
178 |
if ( ! ( 0 === strpos( $key, '_' ) ) ) {
|
179 |
if ( is_array( $value ) ) {
|
180 |
continue;
|
181 |
}
|
182 |
+
if ( ! empty( $product_addons ) ) {
|
183 |
+
foreach ( $product_addons as $addon ) {
|
184 |
+
if ( 'file_upload' === $addon['type'] ) {
|
185 |
+
if ( $key === $addon['name'] ) {
|
186 |
+
$value = wp_basename( $value );
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
echo '<br>' . wp_kses_post( $key . ':' . $value );
|
192 |
}
|
193 |
}
|
194 |
}
|
195 |
} else {
|
196 |
+
$item_meta_new = new WC_Order_Item_Meta( $item_meta_fields, $product );
|
197 |
$item_meta_new->display();
|
198 |
|
199 |
}
|
templates/print-order/print-header.php
CHANGED
@@ -20,6 +20,25 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
20 |
<?php
|
21 |
// wcdn_head hook.
|
22 |
do_action( 'wcdn_head' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
?>
|
24 |
</head>
|
25 |
|
20 |
<?php
|
21 |
// wcdn_head hook.
|
22 |
do_action( 'wcdn_head' );
|
23 |
+
if ( 'yes' === get_option( 'wcdn_rtl_invoice', 'no' ) ) {
|
24 |
+
?>
|
25 |
+
<style>
|
26 |
+
body {
|
27 |
+
direction: rtl;
|
28 |
+
}
|
29 |
+
.order-items dt,
|
30 |
+
.order-items dd {
|
31 |
+
float: right;
|
32 |
+
}
|
33 |
+
.content{
|
34 |
+
text-align:right;
|
35 |
+
}
|
36 |
+
th {
|
37 |
+
text-align:right;
|
38 |
+
}
|
39 |
+
</style>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
?>
|
43 |
</head>
|
44 |
|
woocommerce-delivery-notes.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin Name: Print Invoice & Delivery Notes for WooCommerce
|
6 |
* Plugin URI: https://www.tychesoftwares.com/
|
7 |
* Description: Print Invoices & Delivery Notes for WooCommerce Orders.
|
8 |
-
* Version: 4.6.
|
9 |
* Author: Tyche Softwares
|
10 |
* Author URI: https://www.tychesoftwares.com/
|
11 |
* License: GPLv3 or later
|
@@ -14,8 +14,8 @@
|
|
14 |
* Domain Path: /languages
|
15 |
* Requires PHP: 5.6
|
16 |
* WC requires at least: 3.0.0
|
17 |
-
* WC tested up to:
|
18 |
-
* Tested up to: 5.
|
19 |
*
|
20 |
* Copyright 2019 Tyche Softwares
|
21 |
*
|
5 |
* Plugin Name: Print Invoice & Delivery Notes for WooCommerce
|
6 |
* Plugin URI: https://www.tychesoftwares.com/
|
7 |
* Description: Print Invoices & Delivery Notes for WooCommerce Orders.
|
8 |
+
* Version: 4.6.5
|
9 |
* Author: Tyche Softwares
|
10 |
* Author URI: https://www.tychesoftwares.com/
|
11 |
* License: GPLv3 or later
|
14 |
* Domain Path: /languages
|
15 |
* Requires PHP: 5.6
|
16 |
* WC requires at least: 3.0.0
|
17 |
+
* WC tested up to: 6.1
|
18 |
+
* Tested up to: 5.9
|
19 |
*
|
20 |
* Copyright 2019 Tyche Softwares
|
21 |
*
|