Skip to content

Commit

Permalink
fix: PDF not generating when changing shipping method
Browse files Browse the repository at this point in the history
  • Loading branch information
dkjensen committed Sep 17, 2024
1 parent 2e368d0 commit 36a3ce7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Adds ability for users and guests to download their WooCommerce cart as PDF. Use

== Changelog ==

3.0.1
* Fix PDF not generating when changing shipping method

3.0.0
* **BREAKING CHANGE**: Scoped dependencies to prevent collisions. References to namespace `\Mpdf` is now `\WCCartPDF\Mpdf`

Expand Down
4 changes: 2 additions & 2 deletions wc-cart-pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function wc_cart_pdf_process_download() {
return;
}

if ( ! is_cart() || WC()->cart->is_empty() ) {
if ( WC()->cart->is_empty() ) {
return;
}

Expand Down Expand Up @@ -232,7 +232,7 @@ function wc_cart_pdf_process_download() {

exit;
}
add_action( 'template_redirect', 'wc_cart_pdf_process_download' );
add_action( 'template_redirect', 'wc_cart_pdf_process_download', 0 );

/**
* Declare compatibility with HPOS and Cart / Checkout blocks.
Expand Down

0 comments on commit 36a3ce7

Please sign in to comment.