/** * Initialisierung * * @return void * * @author Sascha Koehler <*****@*****.**> * @since 02.12.2010 */ public function init() { if (SilvercartConfig::EnableSSL()) { Director::forceSSL(); } parent::init(); }
/** * statements to be called on object initialisation * * @author Roland Lehmann <*****@*****.**> * @since 18.11.2010 * @return void */ public function init() { if (SilvercartConfig::EnableSSL()) { Director::forceSSL(); } Session::clear("redirect"); //if customer has been to the checkout yet this is set to direct him back to the checkout after address editing parent::init(); $this->registerCustomHtmlForm('SilvercartLoginForm', new SilvercartLoginForm($this)); }
/** * Initializes the step form. Includes forms and requirements. * * @return void * * @author Sebastian Diel <*****@*****.**>, * Sascha Koehler <*****@*****.**> * @since 15.11.2014 */ public function init() { $this->preferences['templateDir'] = PIXELTRICKS_CHECKOUT_BASE_PATH_REL . 'templates/Layout/'; if (SilvercartConfig::EnableSSL()) { Director::forceSSL(); } parent::init(); // Inject payment and shippingmethods to shoppingcart, if available $member = SilvercartCustomer::currentUser(); if ($member) { $stepData = $this->getCombinedStepData(); $shoppingCart = $member->getCart(); // If minimum order value is set and shoppingcart value is below we // have to redirect the customer to the shoppingcart page and set // an appropriate error message. if ($this->getCurrentStep() < 5 && SilvercartConfig::UseMinimumOrderValue() && SilvercartConfig::MinimumOrderValue() && SilvercartConfig::MinimumOrderValue()->getAmount() > $shoppingCart->getAmountTotalWithoutFees()->getAmount()) { $silvercartSessionErrors = Session::get('Silvercart.errors'); $silvercartSessionErrors[] = sprintf(_t('SilvercartShoppingCart.ERROR_MINIMUMORDERVALUE_NOT_REACHED'), SilvercartConfig::MinimumOrderValue()->Nice()); Session::set('Silvercart.errors', $silvercartSessionErrors); Session::save(); $this->redirect(SilvercartPage_Controller::PageByIdentifierCode('SilvercartCartPage')->Link()); } if (isset($stepData['ShippingMethod'])) { $shoppingCart->setShippingMethodID($stepData['ShippingMethod']); } if (isset($stepData['PaymentMethod'])) { $shoppingCart->setPaymentMethodID($stepData['PaymentMethod']); } $requestParams = $this->getRequest()->allParams(); if ($requestParams['Action'] == 'editAddress') { $addressID = (int) $requestParams['ID']; $membersAddresses = SilvercartCustomer::currentUser()->SilvercartAddresses(); $membersAddress = $membersAddresses->find('ID', $addressID); if ($membersAddress instanceof SilvercartAddress && $membersAddress->exists()) { Session::set("redirect", $this->Link()); $preferences = array(); $preferences['submitAction'] = 'editAddress/' . $addressID . '/customHtmlFormSubmit'; $this->registerCustomHtmlForm('SilvercartEditAddressForm', new SilvercartEditAddressForm($this, array('addressID' => $addressID), $preferences)); } } elseif ($requestParams['Action'] == 'addNewAddress') { Session::set("redirect", $this->Link()); $preferences = array(); $preferences['submitAction'] = 'addNewAddress/customHtmlFormSubmit'; $this->registerCustomHtmlForm('SilvercartAddAddressForm', new SilvercartAddAddressForm($this, array(), $preferences)); } } }
/** * initialisation of the form object * logged in members get logged out * * @author Sascha Koehler <*****@*****.**> Roland Lehmann <*****@*****.**> * @since 20.10.2010 * @return void */ public function init() { if (SilvercartConfig::EnableSSL()) { Director::forceSSL(); } $this->registerCustomHtmlForm('SilvercartRegisterRegularCustomerForm', new SilvercartRegisterRegularCustomerForm($this)); parent::init(); }