public function testWithSuppliersAgain()
 {
     $result = ShippingCalculator::orderShippingCharge($this->makeCart2(true));
     $this->assertEquals(600, $result);
 }
示例#2
0
 /**
  * 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);
     }
 }