/** * Fill the form with default values * * @return void * * @author Sebastian Diel <*****@*****.**>, * Roland Lehmann <*****@*****.**> * @since 15.11.2014 */ protected function fillInFieldValues() { $member = SilvercartCustomer::currentUser(); $id = $this->customParameters['addressID']; if ($member && $id) { $filter = array("MemberID" => $member->ID, "ID" => $id); $this->address = SilvercartAddress::get()->filter($filter)->first(); if ($this->address) { $this->formFields['Salutation']['selectedValue'] = $this->address->Salutation; $this->formFields['AcademicTitle']['value'] = $this->address->AcademicTitle; $this->formFields['FirstName']['value'] = $this->address->FirstName; $this->formFields['Surname']['value'] = $this->address->Surname; $this->formFields['Addition']['value'] = $this->address->Addition; $this->formFields['Street']['value'] = $this->address->Street; $this->formFields['StreetNumber']['value'] = $this->address->StreetNumber; $this->formFields['Postcode']['value'] = $this->address->Postcode; $this->formFields['City']['value'] = $this->address->City; $this->formFields['PhoneAreaCode']['value'] = $this->address->PhoneAreaCode; $this->formFields['Phone']['value'] = $this->address->Phone; $this->formFields['Fax']['value'] = $this->address->Fax; $this->formFields['Country']['selectedValue'] = $this->address->SilvercartCountry()->ID; if (SilvercartConfig::enablePackstation()) { $this->formFields['PostNumber']['value'] = $this->address->PostNumber; $this->formFields['Packstation']['value'] = $this->address->Packstation; $this->formFields['IsPackstation']['selectedValue'] = $this->address->IsPackstation; } if (SilvercartConfig::enableBusinessCustomers()) { $this->formFields['Company']['value'] = $this->address->Company; $this->formFields['TaxIdNumber']['value'] = $this->address->TaxIdNumber; } } } }
/** * Indicates wether business customers should be enabled. * * @return boolean * * @author Sebastian Diel <*****@*****.**> * @since 09.10.2012 */ public function EnablePackstation() { return SilvercartConfig::enablePackstation(); }
/** * Returns wether to enable packstations or not. * * @return boolean * * @author Sebastian Diel <*****@*****.**> * @since 09.10.2012 */ public static function enablePackstation() { if (is_null(self::$enablePackstation)) { self::$enablePackstation = self::getConfig()->enablePackstation; } return self::$enablePackstation; }