/** * Get the tax rate for an item to an address. If address is null, * a default address should be used. * * @param Product $product The product to calulate tax for * @param Address $address The address delvered to * @return Collection The tax rates to be applied * @throws AddressNotSetException If no address given or default address set */ public function getProductTaxRates(Product $product, Address $address = null) { if ($address === null) { $address = $this->_defaultAddress; } if (!$address) { throw new \LogicException('No address given and no default address set. Either provide an address or ensure a default address is set on the loader.'); } return $this->_taxResolver->getTaxRates($product->getType()->getName(), $address); }