Skip to content

Conversation

@isaeedam-ir
Copy link

  • Fixes fatal DivisionByZeroError when $realprice is 0 (email invoice PDF generation).
  • Adds guard for $wasPrice <= 0, clamps result to 0..100.
  • Corrects wcorder call to calc_precentage(new=total, was=subtotal).
  • Repro: mark multiple orders “processing” with subtotal=0 (or total=0), plugin attaches PDF → fatal.
  • Env: WP 6.8.3, WooCommerce (version), PHP 8.4.x.

…rder args

Fixes fatal DivisionByZeroError when $realprice is 0 (email invoice PDF generation).
Adds guard for $wasPrice <= 0, clamps result to 0..100.
Corrects wcorder call to calc_precentage(new=total, was=subtotal).
Repro: mark multiple orders “processing” with subtotal=0 (or total=0), plugin attaches PDF → fatal.
Env: WP 6.8.3, WooCommerce (version), PHP 8.4.x.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant