function calculate($shippingMethod) { try { $this->Price = parent::calculate($shippingMethod); } catch (Exception $e) { ShopOrder::displayExtensionNoticeFor("ShopShipping::calculate"); } }
function calculate() { $round = self::$round; $amount = $this->amount(); $this->calcShippingCosts(); $this->calcPaymentCosts(); $this->calcDiscount(); $this->SubTotal = $amount - $this->Discount + $this->Shipping()->Price(); $this->Total = $this->SubTotal + $this->Payment()->Price(); $this->calcTax(); $tax = 1 + $this->Tax / 100; if ($this->VAT == "INCL") { $this->VATAmount = round($amount - $this->Total / $tax, $round); } if ($this->VAT == "EXCL") { $this->VATAmount = round($amount / 100 * $this->Tax, $round); $this->Total = $this->Total + $this->VATAmount; } try { parent::calculate(); } catch (Exception $e) { //don't display a message, because it's not necessary/bestpractice to override the calculate method } }