More Product Model optimisation

This commit is contained in:
2023-05-05 15:48:24 +10:00
parent 96f799f535
commit 820ff2be00
37 changed files with 161 additions and 592 deletions

View File

@@ -19,16 +19,14 @@ class Tax extends Model
/* METHODS */
/**
* Calculate Tax on a value
* Calculate Tax on a value, and return that value with tax applied
*
* @param float $value
* @param Collection $taxes
* @return void
* @return float
*/
public static function tax_calc(?float $value,Collection $taxes): float
public static function calc(float $value,Collection $taxes): float
{
if (! $value)
$value = 0;
$tax = 0;
foreach ($taxes as $o) {