Skip to content

Commit

Permalink
Update class.memberorder.php
Browse files Browse the repository at this point in the history
In saveOrder when we check if the tax has be set, we check if isset() and if the tax is defaulted to 0, that's going to return true, which would lead to us calculating taxes every time the order is saved, which could be costly if we're hitting an API to calculate taxes. So I set the tax property to default to null.
  • Loading branch information
ideadude authored Jul 14, 2022
1 parent 1a7d9ff commit 6a4b25d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/class.memberorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class MemberOrder
*
* @var float
*/
private $tax = 0.00;
private $tax = null;

This comment has been minimized.

Copy link
@eighty20results

eighty20results Jul 14, 2022

Contributor

Nit: Need to also update the @var doc for this property.


/**
* Discount Code Amount
Expand Down

1 comment on commit 6a4b25d

@mircobabini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ideadude @eighty20results this is causing issues though. Recorded and fix proposed into #2656

Please sign in to comment.