Overtrue\LaravelShoppingCart\Cart::totalPrice PHP Method

totalPrice() public method

Return total price of cart.
public totalPrice ( )
    public function totalPrice()
    {
        $total = 0;
        $cart = $this->getCart();
        if ($cart->isEmpty()) {
            return $total;
        }
        foreach ($cart as $row) {
            $total += $row->qty * $row->price;
        }
        return $total;
    }