Skip to content

Commit

Permalink
Fix: Error calling undefined method `WC_Order_Refund::get_customer_id…
Browse files Browse the repository at this point in the history
…()` (#1019)
  • Loading branch information
alexmigf authored Jan 21, 2025
1 parent 3b82aef commit ae49e29
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: woocommerce, pdf, ubl, invoices, packing slips
Requires at least: 4.4
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 3.9.5
Stable tag: 3.9.6-beta-1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
4 changes: 2 additions & 2 deletions woocommerce-pdf-invoices-packingslips.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Requires Plugins: woocommerce
* Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
* Description: Create, print & email PDF or UBL Invoices & PDF Packing Slips for WooCommerce orders.
* Version: 3.9.5
* Version: 3.9.6-beta-1
* Author: WP Overnight
* Author URI: https://www.wpovernight.com
* License: GPLv2 or later
Expand All @@ -22,7 +22,7 @@

class WPO_WCPDF {

public $version = '3.9.5';
public $version = '3.9.6-beta-1';
public $version_php = '7.4';
public $version_woo = '3.3';
public $version_wp = '4.4';
Expand Down
13 changes: 13 additions & 0 deletions wpo-ips-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ function wcpdf_get_document_file( object $document, string $output_format = 'pdf
$error_message = "Invalid output format: {$output_format}. Expected one of: " . implode( ', ', $document->output_formats );
return wcpdf_error_handling( $error_message, $error_handling, true, 'critical' );
}

if ( ! $document->is_enabled( $output_format ) ) {
$error_message = "The {$output_format} output format is not enabled for this document: {$document->get_title()}.";
return wcpdf_error_handling( $error_message, $error_handling, true, 'critical' );
}

$tmp_path = WPO_WCPDF()->main->get_tmp_path( 'attachments' );

Expand Down Expand Up @@ -1035,6 +1040,14 @@ function wpo_wcpdf_dynamic_translate( string $string, string $textdomain ): stri
* @return bool
*/
function wpo_wcpdf_order_is_vat_exempt( \WC_Abstract_Order $order ): bool {
if ( 'shop_order_refund' === $order->get_type() ) {
$order = wc_get_order( $order->get_parent_id() );

if ( ! $order ) {
return false;
}
}

// Check if order is VAT exempt based on order meta
$vat_exempt_meta_key = apply_filters( 'wpo_wcpdf_order_vat_exempt_meta_key', 'is_vat_exempt', $order );
$is_vat_exempt = apply_filters( 'woocommerce_order_is_vat_exempt', 'yes' === $order->get_meta( $vat_exempt_meta_key ), $order );
Expand Down

0 comments on commit ae49e29

Please # to comment.