Overtrue\LaravelShoppingCart\Cart::totalPrice PHP 메소드

totalPrice() 공개 메소드

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;
    }