/** * standard SS method * adds the ability to update order after writing it. **/ function onAfterWrite() { parent::onAfterWrite(); if ($this->IsSubmitted()) { //do nothing } else { if ($this->StatusID) { $this->calculateOrderAttributes(); if (EcommerceRole::current_member_is_shop_admin()) { if (isset($_REQUEST["SubmitOrderViaCMS"])) { $this->tryToFinaliseOrder(); //just in case it writes again... unset($_REQUEST["SubmitOrderViaCMS"]); } } } } }
/** * Only shop admin can delete this *@return Boolean **/ public function canDelete($member = null) { return EcommerceRole::current_member_is_shop_admin($member); }