function calculate($shippingMethod) { try { $this->Price = parent::calculate($shippingMethod); } catch (Exception $e) { ShopOrder::displayExtensionNoticeFor("ShopShipping::calculate"); } }
function isComplete() { //define your own isComplete rules with MyShopAddress.php try { return parent::isComplete(); } catch (Exception $e) { //no extension found ShopOrder::displayExtensionNoticeFor("ShopAddress::isComplete"); foreach (self::$required_fields as $field) { if (!(strlen($this->{$field}) > 0)) { return false; } } return true; } }
function isIncompleteCause() { //define your own isIncompleteCause rules with MyShopOrder.php $this->isIncompleteReasons = null; try { $this->isIncompleteReasons = parent::isIncompleteCause(); return $this->isIncompleteReasons; } catch (Exception $e) { ShopOrder::displayExtensionNoticeFor("ShopOrder::isIncompleteCause"); return null; } }