This commit is contained in:
Kevin Adametz 2020-07-01 13:21:35 +02:00
parent 9ed251820e
commit da08e9ff37
13 changed files with 378 additions and 56 deletions

View file

@ -43,6 +43,7 @@ class Yard extends Cart
public static function getTaxRate()
{
return config('cart.tax');
}
@ -121,7 +122,6 @@ class Yard extends Cart
//sec by weight
if(!$price){
$price = $this->shippingPriceByWeight($shipping->prices, intval($this->weight()));
}
//default
if(!$price){
@ -182,18 +182,20 @@ class Yard extends Cart
public function subtotalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$taxRate =config('cart.tax');
$total = (float) ($this->total(2, '.', '')) + $this->shipping;
$totalTax = $total/ (100 + $taxRate) * $taxRate;
return $this->numberFormat(($total - $totalTax), $decimals, $decimalPoint, $thousandSeperator);
$subtotal = $this->subtotal(2, '.', '') + $this->shipping;
//$taxRate =config('cart.tax');
/*$total = (float) ($this->total(2, '.', '')) + $this->shipping;
$totalTax = $total/ (100 + $taxRate) * $taxRate;*/
return $this->numberFormat($subtotal, $decimals, $decimalPoint, $thousandSeperator);
}
public function taxWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$taxRate =config('cart.tax');
$totalTax = $this->tax(2, '.', '');
/* $taxRate =config('cart.tax');
$total = (float) ($this->total(2, '.', '')) + $this->shipping;
$totalTax = $total/ (100 + $taxRate) * $taxRate;
$totalTax = $total/ (100 + $taxRate) * $taxRate; */
return $this->numberFormat($totalTax, $decimals, $decimalPoint, $thousandSeperator);
}