Version Description
- New: Allow filtering action button classes
- Fix: Error when no order data passed to filename function
- Fix: During first install, only set defaults if not already (pre-) configured
- Fix: Use
WC()->template_path()
instead ofWC_TEMPLATE_PATH
for theme template overrides - Fix: Checks existence of document data number and date for order metabox fields
- Fix: Prevent WooCommerce deprecation notices for non-product item types
- Fix: jQuery deprecation notices
- Tweak: Show instructions for emails metabox
- Marked tested up to WooCommerce 5.2 and WordPress 5.7
Download this release
Release Info
Developer | pomegranate |
Plugin | WooCommerce PDF Invoices & Packing Slips |
Version | 2.8.3 |
Comparing to | |
See all releases |
Code changes from version 2.8.2 to 2.8.3
- assets/js/admin-script.js +4 -4
- assets/js/order-script.js +4 -4
- assets/js/setup-wizard.js +2 -3
- includes/class-wcpdf-admin.php +21 -9
- includes/class-wcpdf-install.php +2 -2
- includes/class-wcpdf-settings-callbacks.php +1 -1
- includes/class-wcpdf-settings-general.php +1 -1
- includes/documents/abstract-wcpdf-order-document-methods.php +3 -1
- includes/documents/class-wcpdf-invoice.php +2 -2
- includes/views/wcpdf-extensions.php +1 -1
- readme.txt +13 -2
- woocommerce-pdf-invoices-packingslips.php +3 -3
assets/js/admin-script.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
jQuery( function( $ ) {
|
2 |
-
$('.edit-next-number').click
|
3 |
// enable input & show save button
|
4 |
$( this ).hide();
|
5 |
$( this ).siblings( 'input' ).prop('disabled', false);
|
6 |
$( this ).siblings( '.save-next-number.button').show();
|
7 |
});
|
8 |
|
9 |
-
$('.save-next-number').click
|
10 |
$input = $( this ).siblings( 'input' );
|
11 |
$input.addClass('ajax-waiting');
|
12 |
var data = {
|
@@ -29,11 +29,11 @@ jQuery( function( $ ) {
|
|
29 |
});
|
30 |
});
|
31 |
|
32 |
-
$("[name='wpo_wcpdf_documents_settings_invoice[display_number]']").change
|
33 |
if ($(this).val() == 'order_number') {
|
34 |
$(this).closest('td').find('.description').slideDown();
|
35 |
} else {
|
36 |
$(this).closest('td').find('.description').hide();
|
37 |
}
|
38 |
-
}).change
|
39 |
});
|
1 |
jQuery( function( $ ) {
|
2 |
+
$('.edit-next-number').on('click', function( event ) {
|
3 |
// enable input & show save button
|
4 |
$( this ).hide();
|
5 |
$( this ).siblings( 'input' ).prop('disabled', false);
|
6 |
$( this ).siblings( '.save-next-number.button').show();
|
7 |
});
|
8 |
|
9 |
+
$('.save-next-number').on('click', function( event ) {
|
10 |
$input = $( this ).siblings( 'input' );
|
11 |
$input.addClass('ajax-waiting');
|
12 |
var data = {
|
29 |
});
|
30 |
});
|
31 |
|
32 |
+
$("[name='wpo_wcpdf_documents_settings_invoice[display_number]']").on('change', function (event) {
|
33 |
if ($(this).val() == 'order_number') {
|
34 |
$(this).closest('td').find('.description').slideDown();
|
35 |
} else {
|
36 |
$(this).closest('td').find('.description').hide();
|
37 |
}
|
38 |
+
}).trigger('change');
|
39 |
});
|
assets/js/order-script.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
jQuery(document).ready(function($) {
|
2 |
-
$("#doaction, #doaction2").click
|
3 |
var actionselected = $(this).attr("id").substr(2);
|
4 |
var action = $('select[name="' + actionselected + '"]').val();
|
5 |
if ( $.inArray(action, wpo_wcpdf_ajax.bulk_actions) !== -1 ) {
|
@@ -32,7 +32,7 @@ jQuery(document).ready(function($) {
|
|
32 |
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
|
33 |
|
34 |
// enable invoice number edit if user initiated
|
35 |
-
$( ".wpo-wcpdf-set-date-number, .wpo-wcpdf-edit-date-number, .wpo-wcpdf-edit-document-notes" ).click
|
36 |
$form = $(this).closest('.wcpdf-data-fields-section');
|
37 |
if ($form.length == 0) { // no section, take overall wrapper
|
38 |
$form = $(this).closest('.wcpdf-data-fields');
|
@@ -50,7 +50,7 @@ jQuery(document).ready(function($) {
|
|
50 |
}
|
51 |
});
|
52 |
|
53 |
-
$( ".wcpdf-data-fields .wpo-wcpdf-delete-document" ).click
|
54 |
if ( window.confirm( wpo_wcpdf_ajax.confirm_delete ) === false ) {
|
55 |
return; // having second thoughts
|
56 |
}
|
@@ -80,7 +80,7 @@ jQuery(document).ready(function($) {
|
|
80 |
});
|
81 |
});
|
82 |
|
83 |
-
$( ".wcpdf-data-fields .wpo-wcpdf-regenerate-document" ).click
|
84 |
|
85 |
if ( window.confirm( wpo_wcpdf_ajax.confirm_regenerate ) === false ) {
|
86 |
return; // having second thoughts
|
1 |
jQuery(document).ready(function($) {
|
2 |
+
$("#doaction, #doaction2").on("click", function (event) {
|
3 |
var actionselected = $(this).attr("id").substr(2);
|
4 |
var action = $('select[name="' + actionselected + '"]').val();
|
5 |
if ( $.inArray(action, wpo_wcpdf_ajax.bulk_actions) !== -1 ) {
|
32 |
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
|
33 |
|
34 |
// enable invoice number edit if user initiated
|
35 |
+
$( ".wpo-wcpdf-set-date-number, .wpo-wcpdf-edit-date-number, .wpo-wcpdf-edit-document-notes" ).on("click", function() {
|
36 |
$form = $(this).closest('.wcpdf-data-fields-section');
|
37 |
if ($form.length == 0) { // no section, take overall wrapper
|
38 |
$form = $(this).closest('.wcpdf-data-fields');
|
50 |
}
|
51 |
});
|
52 |
|
53 |
+
$( ".wcpdf-data-fields .wpo-wcpdf-delete-document" ).on("click", function() {
|
54 |
if ( window.confirm( wpo_wcpdf_ajax.confirm_delete ) === false ) {
|
55 |
return; // having second thoughts
|
56 |
}
|
80 |
});
|
81 |
});
|
82 |
|
83 |
+
$( ".wcpdf-data-fields .wpo-wcpdf-regenerate-document" ).on("click", function() {
|
84 |
|
85 |
if ( window.confirm( wpo_wcpdf_ajax.confirm_regenerate ) === false ) {
|
86 |
return; // having second thoughts
|
assets/js/setup-wizard.js
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
jQuery( function( $ ) {
|
2 |
|
3 |
-
$( '.tab' ).click
|
4 |
$( this ).closest('.extra-field').find('.tab').removeClass( 'active' );
|
5 |
$( this ).addClass( 'active' );
|
6 |
var $language = $( this ).attr('id');
|
7 |
-
console.log($language);
|
8 |
$( this ).siblings('.extra-field-input').hide();
|
9 |
$('.' + $language ).show();
|
10 |
});
|
11 |
|
12 |
// Show Preview of logo
|
13 |
-
$('#file-upload').
|
14 |
if ( event.target.files[0] ) {
|
15 |
var tmppath = URL.createObjectURL(event.target.files[0]);
|
16 |
$( '#logo-preview' ).find( "img" ).attr( 'src',tmppath );
|
1 |
jQuery( function( $ ) {
|
2 |
|
3 |
+
$( '.tab' ).on( 'click', function() {
|
4 |
$( this ).closest('.extra-field').find('.tab').removeClass( 'active' );
|
5 |
$( this ).addClass( 'active' );
|
6 |
var $language = $( this ).attr('id');
|
|
|
7 |
$( this ).siblings('.extra-field-input').hide();
|
8 |
$('.' + $language ).show();
|
9 |
});
|
10 |
|
11 |
// Show Preview of logo
|
12 |
+
$('#file-upload').on( 'change', function(event) {
|
13 |
if ( event.target.files[0] ) {
|
14 |
var tmppath = URL.createObjectURL(event.target.files[0]);
|
15 |
$( '#logo-preview' ).find( "img" ).attr( 'src',tmppath );
|
includes/class-wcpdf-admin.php
CHANGED
@@ -182,19 +182,24 @@ class Admin {
|
|
182 |
$icon = !empty($document->icon) ? $document->icon : WPO_WCPDF()->plugin_url() . "/assets/images/generic_document.png";
|
183 |
if ( $document = wcpdf_get_document( $document->get_type(), $order ) ) {
|
184 |
$document_title = is_callable( array( $document, 'get_title' ) ) ? $document->get_title() : $document_title;
|
|
|
185 |
$listing_actions[$document->get_type()] = array(
|
186 |
-
'url'
|
187 |
-
'img'
|
188 |
-
'alt'
|
189 |
-
'exists'
|
|
|
190 |
);
|
191 |
}
|
192 |
}
|
193 |
|
194 |
-
$listing_actions = apply_filters( 'wpo_wcpdf_listing_actions', $listing_actions, $order );
|
195 |
|
196 |
foreach ($listing_actions as $action => $data) {
|
197 |
-
|
|
|
|
|
|
|
198 |
<img src="<?php echo $data['img']; ?>" alt="<?php echo $data['alt']; ?>" width="16">
|
199 |
</a><?php
|
200 |
}
|
@@ -294,7 +299,7 @@ class Admin {
|
|
294 |
<ul class="wpo_wcpdf_send_emails submitbox">
|
295 |
<li class="wide" id="actions">
|
296 |
<select name="wpo_wcpdf_send_emails">
|
297 |
-
<option value=""
|
298 |
<?php
|
299 |
$mailer = WC()->mailer();
|
300 |
$available_emails = apply_filters( 'woocommerce_resend_order_emails_available', array( 'new_order', 'cancelled_order', 'customer_processing_order', 'customer_completed_order', 'customer_invoice' ) );
|
@@ -314,7 +319,6 @@ class Admin {
|
|
314 |
<?php
|
315 |
$title = __( 'Send email', 'woocommerce-pdf-invoices-packing-slips' );
|
316 |
$url = wp_nonce_url( add_query_arg('wpo_wcpdf_action','resend_email'), 'generate_wpo_wcpdf' );
|
317 |
-
// printf('<a href="%s" class="button wpo_wcpdf_send_email"><span>%s</span></a>')
|
318 |
?>
|
319 |
</li>
|
320 |
</ul>
|
@@ -427,7 +431,7 @@ class Admin {
|
|
427 |
<!-- Title -->
|
428 |
<h4>
|
429 |
<?= $document->get_title(); ?>
|
430 |
-
<?php if( $document->exists() ) : ?>
|
431 |
<span class="wpo-wcpdf-edit-date-number dashicons dashicons-edit"></span>
|
432 |
<span class="wpo-wcpdf-delete-document dashicons dashicons-trash" data-nonce="<?php echo wp_create_nonce( "wpo_wcpdf_delete_document" ); ?>"></span>
|
433 |
<?php do_action( 'wpo_wcpdf_document_actions', $document ); ?>
|
@@ -437,6 +441,7 @@ class Admin {
|
|
437 |
<!-- Read only -->
|
438 |
<div class="read-only">
|
439 |
<?php if( $document->exists() ) : ?>
|
|
|
440 |
<div class="<?= $document->get_type(); ?>-number">
|
441 |
<p class="form-field <?= $data['number']['name']; ?>_field">
|
442 |
<p>
|
@@ -445,6 +450,8 @@ class Admin {
|
|
445 |
</p>
|
446 |
</p>
|
447 |
</div>
|
|
|
|
|
448 |
<div class="<?= $document->get_type(); ?>-date">
|
449 |
<p class="form-field form-field-wide">
|
450 |
<p>
|
@@ -453,6 +460,7 @@ class Admin {
|
|
453 |
</p>
|
454 |
</p>
|
455 |
</div>
|
|
|
456 |
<?php do_action( 'wpo_wcpdf_meta_box_after_document_data', $document, $document->order ); ?>
|
457 |
<?php else : ?>
|
458 |
<span class="wpo-wcpdf-set-date-number button"><?php printf( __( 'Set %s number & date', 'woocommerce-pdf-invoices-packing-slips' ), $document->get_title() ); ?></span>
|
@@ -461,14 +469,18 @@ class Admin {
|
|
461 |
|
462 |
<!-- Editable -->
|
463 |
<div class="editable">
|
|
|
464 |
<p class="form-field <?= $data['number']['name']; ?>_field ">
|
465 |
<label for="<?= $data['number']['name']; ?>"><?= $data['number']['label']; ?></label>
|
466 |
<input type="text" class="short" style="" name="<?= $data['number']['name']; ?>" id="<?= $data['number']['name']; ?>" value="<?= $data['number']['plain']; ?>" disabled="disabled" > (<?= __( 'unformatted!', 'woocommerce-pdf-invoices-packing-slips' ) ?>)
|
467 |
</p>
|
|
|
|
|
468 |
<p class="form-field form-field-wide">
|
469 |
<label for="<?= $data['date']['name'] ?>[date]"><?= $data['date']['label']; ?></label>
|
470 |
<input type="text" class="date-picker-field" name="<?= $data['date']['name'] ?>[date]" id="<?= $data['date']['name'] ?>[date]" maxlength="10" value="<?= $data['date']['date']; ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" disabled="disabled"/>@<input type="number" class="hour" disabled="disabled" placeholder="<?php _e( 'h', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[hour]" id="<?= $data['date']['name']; ?>[hour]" min="0" max="23" size="2" value="<?= $data['date']['hour']; ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[minute]" id="<?= $data['date']['name']; ?>[minute]" min="0" max="59" size="2" value="<?= $data['date']['minute']; ?>" pattern="[0-5]{1}[0-9]{1}" disabled="disabled" />
|
471 |
</p>
|
|
|
472 |
</div>
|
473 |
</section>
|
474 |
|
182 |
$icon = !empty($document->icon) ? $document->icon : WPO_WCPDF()->plugin_url() . "/assets/images/generic_document.png";
|
183 |
if ( $document = wcpdf_get_document( $document->get_type(), $order ) ) {
|
184 |
$document_title = is_callable( array( $document, 'get_title' ) ) ? $document->get_title() : $document_title;
|
185 |
+
$document_exists = is_callable( array( $document, 'exists' ) ) ? $document->exists() : false;
|
186 |
$listing_actions[$document->get_type()] = array(
|
187 |
+
'url' => wp_nonce_url( admin_url( "admin-ajax.php?action=generate_wpo_wcpdf&document_type={$document->get_type()}&order_ids=" . WCX_Order::get_id( $order ) ), 'generate_wpo_wcpdf' ),
|
188 |
+
'img' => $icon,
|
189 |
+
'alt' => "PDF " . $document_title,
|
190 |
+
'exists' => $document_exists,
|
191 |
+
'class' => apply_filters( 'wpo_wcpdf_action_button_class', $document_exists ? "exists " . $document->get_type() : $document->get_type(), $document ),
|
192 |
);
|
193 |
}
|
194 |
}
|
195 |
|
196 |
+
$listing_actions = apply_filters( 'wpo_wcpdf_listing_actions', $listing_actions, $order );
|
197 |
|
198 |
foreach ($listing_actions as $action => $data) {
|
199 |
+
if ( !isset( $data['class'] ) ) {
|
200 |
+
$data['class'] = $data['exists'] ? "exists " . $action : $action;
|
201 |
+
}
|
202 |
+
?><a href="<?php echo $data['url']; ?>" class="button tips wpo_wcpdf <?php echo $data['class']; ?>" target="_blank" alt="<?php echo $data['alt']; ?>" data-tip="<?php echo $data['alt']; ?>">
|
203 |
<img src="<?php echo $data['img']; ?>" alt="<?php echo $data['alt']; ?>" width="16">
|
204 |
</a><?php
|
205 |
}
|
299 |
<ul class="wpo_wcpdf_send_emails submitbox">
|
300 |
<li class="wide" id="actions">
|
301 |
<select name="wpo_wcpdf_send_emails">
|
302 |
+
<option value=""><?php esc_html_e( 'Choose an email to send…', 'woocommerce' ); ?></option>
|
303 |
<?php
|
304 |
$mailer = WC()->mailer();
|
305 |
$available_emails = apply_filters( 'woocommerce_resend_order_emails_available', array( 'new_order', 'cancelled_order', 'customer_processing_order', 'customer_completed_order', 'customer_invoice' ) );
|
319 |
<?php
|
320 |
$title = __( 'Send email', 'woocommerce-pdf-invoices-packing-slips' );
|
321 |
$url = wp_nonce_url( add_query_arg('wpo_wcpdf_action','resend_email'), 'generate_wpo_wcpdf' );
|
|
|
322 |
?>
|
323 |
</li>
|
324 |
</ul>
|
431 |
<!-- Title -->
|
432 |
<h4>
|
433 |
<?= $document->get_title(); ?>
|
434 |
+
<?php if( $document->exists() && ( isset( $data['number'] ) || isset( $data['date'] ) ) ) : ?>
|
435 |
<span class="wpo-wcpdf-edit-date-number dashicons dashicons-edit"></span>
|
436 |
<span class="wpo-wcpdf-delete-document dashicons dashicons-trash" data-nonce="<?php echo wp_create_nonce( "wpo_wcpdf_delete_document" ); ?>"></span>
|
437 |
<?php do_action( 'wpo_wcpdf_document_actions', $document ); ?>
|
441 |
<!-- Read only -->
|
442 |
<div class="read-only">
|
443 |
<?php if( $document->exists() ) : ?>
|
444 |
+
<?php if( isset( $data['number'] ) ) : ?>
|
445 |
<div class="<?= $document->get_type(); ?>-number">
|
446 |
<p class="form-field <?= $data['number']['name']; ?>_field">
|
447 |
<p>
|
450 |
</p>
|
451 |
</p>
|
452 |
</div>
|
453 |
+
<?php endif; ?>
|
454 |
+
<?php if( isset( $data['date'] ) ) : ?>
|
455 |
<div class="<?= $document->get_type(); ?>-date">
|
456 |
<p class="form-field form-field-wide">
|
457 |
<p>
|
460 |
</p>
|
461 |
</p>
|
462 |
</div>
|
463 |
+
<?php endif; ?>
|
464 |
<?php do_action( 'wpo_wcpdf_meta_box_after_document_data', $document, $document->order ); ?>
|
465 |
<?php else : ?>
|
466 |
<span class="wpo-wcpdf-set-date-number button"><?php printf( __( 'Set %s number & date', 'woocommerce-pdf-invoices-packing-slips' ), $document->get_title() ); ?></span>
|
469 |
|
470 |
<!-- Editable -->
|
471 |
<div class="editable">
|
472 |
+
<?php if( isset( $data['number'] ) ) : ?>
|
473 |
<p class="form-field <?= $data['number']['name']; ?>_field ">
|
474 |
<label for="<?= $data['number']['name']; ?>"><?= $data['number']['label']; ?></label>
|
475 |
<input type="text" class="short" style="" name="<?= $data['number']['name']; ?>" id="<?= $data['number']['name']; ?>" value="<?= $data['number']['plain']; ?>" disabled="disabled" > (<?= __( 'unformatted!', 'woocommerce-pdf-invoices-packing-slips' ) ?>)
|
476 |
</p>
|
477 |
+
<?php endif; ?>
|
478 |
+
<?php if( isset( $data['date'] ) ) : ?>
|
479 |
<p class="form-field form-field-wide">
|
480 |
<label for="<?= $data['date']['name'] ?>[date]"><?= $data['date']['label']; ?></label>
|
481 |
<input type="text" class="date-picker-field" name="<?= $data['date']['name'] ?>[date]" id="<?= $data['date']['name'] ?>[date]" maxlength="10" value="<?= $data['date']['date']; ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" disabled="disabled"/>@<input type="number" class="hour" disabled="disabled" placeholder="<?php _e( 'h', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[hour]" id="<?= $data['date']['name']; ?>[hour]" min="0" max="23" size="2" value="<?= $data['date']['hour']; ?>" pattern="([01]?[0-9]{1}|2[0-3]{1})" />:<input type="number" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ); ?>" name="<?= $data['date']['name']; ?>[minute]" id="<?= $data['date']['name']; ?>[minute]" min="0" max="59" size="2" value="<?= $data['date']['minute']; ?>" pattern="[0-5]{1}[0-9]{1}" disabled="disabled" />
|
482 |
</p>
|
483 |
+
<?php endif; ?>
|
484 |
</div>
|
485 |
</section>
|
486 |
|
includes/class-wcpdf-install.php
CHANGED
@@ -172,7 +172,7 @@ class Install {
|
|
172 |
),
|
173 |
);
|
174 |
foreach ($settings_defaults as $option => $defaults) {
|
175 |
-
|
176 |
}
|
177 |
|
178 |
// set transient for wizard notification
|
@@ -379,4 +379,4 @@ class Install {
|
|
379 |
|
380 |
endif; // class_exists
|
381 |
|
382 |
-
return new Install();
|
172 |
),
|
173 |
);
|
174 |
foreach ($settings_defaults as $option => $defaults) {
|
175 |
+
add_option( $option, $defaults );
|
176 |
}
|
177 |
|
178 |
// set transient for wizard notification
|
379 |
|
380 |
endif; // class_exists
|
381 |
|
382 |
+
return new Install();
|
includes/class-wcpdf-settings-callbacks.php
CHANGED
@@ -249,7 +249,7 @@ class Settings_Callbacks {
|
|
249 |
|
250 |
check_<?php echo $id; ?>_custom();
|
251 |
|
252 |
-
$( '#<?php echo $id; ?>' ).change
|
253 |
check_<?php echo $id; ?>_custom();
|
254 |
});
|
255 |
|
249 |
|
250 |
check_<?php echo $id; ?>_custom();
|
251 |
|
252 |
+
$( '#<?php echo $id; ?>' ).on( 'change', function() {
|
253 |
check_<?php echo $id; ?>_custom();
|
254 |
});
|
255 |
|
includes/class-wcpdf-settings-general.php
CHANGED
@@ -281,7 +281,7 @@ class Settings_General {
|
|
281 |
$installed_templates = array();
|
282 |
|
283 |
// get base paths
|
284 |
-
$template_base_path = (
|
285 |
$template_base_path = untrailingslashit( $template_base_path );
|
286 |
$template_paths = array (
|
287 |
// note the order: child-theme before theme, so that array_unique filters out parent doubles
|
281 |
$installed_templates = array();
|
282 |
|
283 |
// get base paths
|
284 |
+
$template_base_path = ( function_exists( 'WC' ) && is_callable( 'WC', 'template_path' ) ) ? WC()->template_path() : 'woocommerce/';
|
285 |
$template_base_path = untrailingslashit( $template_base_path );
|
286 |
$template_paths = array (
|
287 |
// note the order: child-theme before theme, so that array_unique filters out parent doubles
|
includes/documents/abstract-wcpdf-order-document-methods.php
CHANGED
@@ -548,8 +548,10 @@ abstract class Order_Document_Methods extends Order_Document {
|
|
548 |
// Get the product to add more info
|
549 |
if ( is_callable( array( $item, 'get_product' ) ) ) { // WC4.4+
|
550 |
$product = $item->get_product();
|
551 |
-
}
|
552 |
$product = $this->order->get_product_from_item( $item );
|
|
|
|
|
553 |
}
|
554 |
|
555 |
// Checking fo existance, thanks to MDesigner0
|
548 |
// Get the product to add more info
|
549 |
if ( is_callable( array( $item, 'get_product' ) ) ) { // WC4.4+
|
550 |
$product = $item->get_product();
|
551 |
+
} elseif ( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '4.4', '<' ) ) {
|
552 |
$product = $this->order->get_product_from_item( $item );
|
553 |
+
} else {
|
554 |
+
$product = null;
|
555 |
}
|
556 |
|
557 |
// Checking fo existance, thanks to MDesigner0
|
includes/documents/class-wcpdf-invoice.php
CHANGED
@@ -133,8 +133,8 @@ class Invoice extends Order_Document_Methods {
|
|
133 |
if ( isset( $this->settings['display_number'] ) && $this->settings['display_number'] == 'invoice_number' ) {
|
134 |
$suffix = (string) $this->get_number();
|
135 |
} else {
|
136 |
-
if ( empty( $this->order ) ) {
|
137 |
-
$order = WCX::get_order ( $order_ids[0] );
|
138 |
$suffix = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
139 |
} else {
|
140 |
$suffix = is_callable( array( $this->order, 'get_order_number' ) ) ? $this->order->get_order_number() : '';
|
133 |
if ( isset( $this->settings['display_number'] ) && $this->settings['display_number'] == 'invoice_number' ) {
|
134 |
$suffix = (string) $this->get_number();
|
135 |
} else {
|
136 |
+
if ( empty( $this->order ) && isset( $args['order_ids'][0] ) ) {
|
137 |
+
$order = WCX::get_order ( $args['order_ids'][0] );
|
138 |
$suffix = is_callable( array( $order, 'get_order_number' ) ) ? $order->get_order_number() : '';
|
139 |
} else {
|
140 |
$suffix = is_callable( array( $this->order, 'get_order_number' ) ) ? $this->order->get_order_number() : '';
|
includes/views/wcpdf-extensions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
jQuery(document).ready(function() {
|
4 |
jQuery('.extensions .more').hide();
|
5 |
|
6 |
-
jQuery('.extensions > li').click
|
7 |
jQuery(this).toggleClass('expanded');
|
8 |
jQuery(this).find('.more').slideToggle();
|
9 |
});
|
3 |
jQuery(document).ready(function() {
|
4 |
jQuery('.extensions .more').hide();
|
5 |
|
6 |
+
jQuery('.extensions > li').on('click',function() {
|
7 |
jQuery(this).toggleClass('expanded');
|
8 |
jQuery(this).find('.more').slideToggle();
|
9 |
});
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: pomegranate
|
|
3 |
Donate link: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
|
4 |
Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 7.1
|
8 |
-
Stable tag: 2.8.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -102,6 +102,17 @@ There's a setting on the Status tab of the settings page that allows you to togg
|
|
102 |
|
103 |
== Changelog ==
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
= 2.8.2 =
|
106 |
* Fix: Layout issues with totals for documents with more than 1 page
|
107 |
* Fix: Allow setting an Invoice number and date manually
|
3 |
Donate link: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
|
4 |
Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 5.7
|
7 |
Requires PHP: 7.1
|
8 |
+
Stable tag: 2.8.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
102 |
|
103 |
== Changelog ==
|
104 |
|
105 |
+
= 2.8.3 =
|
106 |
+
* New: Allow filtering action button classes
|
107 |
+
* Fix: Error when no order data passed to filename function
|
108 |
+
* Fix: During first install, only set defaults if not already (pre-) configured
|
109 |
+
* Fix: Use `WC()->template_path()` instead of `WC_TEMPLATE_PATH` for theme template overrides
|
110 |
+
* Fix: Checks existence of document data number and date for order metabox fields
|
111 |
+
* Fix: Prevent WooCommerce deprecation notices for non-product item types
|
112 |
+
* Fix: jQuery deprecation notices
|
113 |
+
* Tweak: Show instructions for emails metabox
|
114 |
+
* Marked tested up to WooCommerce 5.2 and WordPress 5.7
|
115 |
+
|
116 |
= 2.8.2 =
|
117 |
* Fix: Layout issues with totals for documents with more than 1 page
|
118 |
* Fix: Allow setting an Invoice number and date manually
|
woocommerce-pdf-invoices-packingslips.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
* Plugin Name: WooCommerce PDF Invoices & Packing Slips
|
4 |
* Plugin URI: http://www.wpovernight.com
|
5 |
* Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
|
6 |
-
* Version: 2.8.
|
7 |
* Author: Ewout Fernhout
|
8 |
* Author URI: http://www.wpovernight.com
|
9 |
* License: GPLv2 or later
|
10 |
* License URI: http://www.opensource.org/licenses/gpl-license.php
|
11 |
* Text Domain: woocommerce-pdf-invoices-packing-slips
|
12 |
* WC requires at least: 2.2.0
|
13 |
-
* WC tested up to: 5.
|
14 |
*/
|
15 |
|
16 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -21,7 +21,7 @@ if ( !class_exists( 'WPO_WCPDF' ) ) :
|
|
21 |
|
22 |
class WPO_WCPDF {
|
23 |
|
24 |
-
public $version = '2.8.
|
25 |
public $plugin_basename;
|
26 |
public $legacy_mode;
|
27 |
public $legacy_textdomain;
|
3 |
* Plugin Name: WooCommerce PDF Invoices & Packing Slips
|
4 |
* Plugin URI: http://www.wpovernight.com
|
5 |
* Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
|
6 |
+
* Version: 2.8.3
|
7 |
* Author: Ewout Fernhout
|
8 |
* Author URI: http://www.wpovernight.com
|
9 |
* License: GPLv2 or later
|
10 |
* License URI: http://www.opensource.org/licenses/gpl-license.php
|
11 |
* Text Domain: woocommerce-pdf-invoices-packing-slips
|
12 |
* WC requires at least: 2.2.0
|
13 |
+
* WC tested up to: 5.2.0
|
14 |
*/
|
15 |
|
16 |
if ( ! defined( 'ABSPATH' ) ) {
|
21 |
|
22 |
class WPO_WCPDF {
|
23 |
|
24 |
+
public $version = '2.8.3';
|
25 |
public $plugin_basename;
|
26 |
public $legacy_mode;
|
27 |
public $legacy_textdomain;
|