| @@ 143-152 (lines=10) @@ | ||
| 140 | * |
|
| 141 | * @return float The total, as a float |
|
| 142 | */ |
|
| 143 | public function total($includeTax = true) |
|
| 144 | { |
|
| 145 | $price = $this->totalPrice(); |
|
| 146 | ||
| 147 | if ($includeTax) { |
|
| 148 | $price = $this->tax->add($price); |
|
| 149 | } |
|
| 150 | ||
| 151 | return $price * $this->quantity; |
|
| 152 | } |
|
| 153 | ||
| 154 | /** |
|
| 155 | * Return the total weight of the item. |
|
| @@ 181-190 (lines=10) @@ | ||
| 178 | * |
|
| 179 | * @return float The total, as a float |
|
| 180 | */ |
|
| 181 | public function single($includeTax = true) |
|
| 182 | { |
|
| 183 | $price = $this->totalPrice(); |
|
| 184 | ||
| 185 | if ($includeTax) { |
|
| 186 | $price = $this->tax->add($price); |
|
| 187 | } |
|
| 188 | ||
| 189 | return $price; |
|
| 190 | } |
|
| 191 | ||
| 192 | /** |
|
| 193 | * Update a single key for this item, or multiple. |
|