Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong calculation with total() #202

Closed
lostika86 opened this issue Aug 8, 2017 · 3 comments
Closed

Wrong calculation with total() #202

lostika86 opened this issue Aug 8, 2017 · 3 comments

Comments

@lostika86
Copy link

If you need, cart items total (with tax), and you dont need additional fees sum in total sum.

$withFees should be inserted in in taxTotal()
How to replicate:

  1. add one item to the cart - only 1
  2. show this item subtotal, and item total
  3. show cart total(false,false,true,false) and you will see, fees tax are included in tax (item total != cart total)
   public function total($format = true, $withDiscount = true, $withTax = true, $withFees = true)
    {
        $total = $this->subTotal(false);

        if ($withFees) {
            $total += $this->feeTotals(false);
        }

        if ($withDiscount) {
            $total -= $this->totalDiscount(false);
        }

        if ($withTax) {
            $total += $this->taxTotal(false,$withFees);
        }

        return $this->formatMoney($total, null, null, $format);
    }
@lukepolo
Copy link
Owner

lukepolo commented Aug 8, 2017

Mind submitting a PR? Fastest way to get this done, as I wont be able to get to it till tomorrow at the soonest

@lukepolo
Copy link
Owner

lukepolo commented Aug 11, 2017

fixed with tag 1.3.7

@lukepolo
Copy link
Owner

Use 1.3.7 instead~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants