/** * Set the total value of all items (sum of all items: $item->count * $item->price). * * @param $currency string ISO3 currency code * @param $total string total value of all goods in $currency * @return $this */ public function addTotal($currency, $total) { Preconditions::checkIso3Currency($currency, 'currency'); Preconditions::checkFloat($total, 'total'); $this->total[$currency] = $total; return $this; }
/** * @param $currency string ISO3 currency code * @param $price string price ofe item in specified currency * @return $this */ public function addPrice($currency, $price) { Preconditions::checkIso3Currency($currency, 'currency'); Preconditions::checkFloat($price, 'price'); $this->price[$currency] = $price; return $this; }