public function testWithSuppliersAgain() { $result = ShippingCalculator::orderShippingCharge($this->makeCart2(true)); $this->assertEquals(600, $result); }
/** * */ private function updateShippingAndTaxes() { $this->taxRate = TaxCalculator::calculateProductTaxRate($this->getProduct()->getTax(), $this->countryId); $this->shippingPrice = ShippingCalculator::shippingForItem($this->getProduct()->getShipping(), $this->getQuantity(), $this->countryId, $this->shippingType); }
/** * Update shipping prices */ private function setShippingPrice() { if (!$this->countryId) { $this->countryId = CustomerHelper::getDefaultCountry(); } $this->availableShippingTypes = ShippingCalculator::availableShippingTypes($this); if (!$this->shippingType && count($this->availableShippingTypes) > 0) { $this->shippingType = $this->availableShippingTypes[0]; } $this->orderShippingPrice = ShippingCalculator::orderShippingCharge($this); foreach ($this->items as $item) { $item->setCountryId($this->countryId); $item->setShippingType($this->shippingType); } }