public function display()
 {
     if (!$this->form) {
         $this->form = shopHelper::getCustomerForm();
     }
     $contact = $this->getContact();
     if ($contact) {
         $this->form->setValue($contact);
         // Make sure there are no more than one address of each type in the form
         foreach (array('address', 'address.shipping', 'address.billing') as $fld) {
             if (isset($this->form->values[$fld]) && count($this->form->values[$fld]) > 1) {
                 $this->form->values[$fld] = array(reset($this->form->values[$fld]));
             }
         }
     }
     $view = wa()->getView();
     $view->assign('checkout_contact_form', $this->form);
     $view->assign('customer', $contact ? $contact : new waContact());
     if (!$view->getVars('error')) {
         $view->assign('error', array());
     }
     $checkout_flow = new shopCheckoutFlowModel();
     $step_number = shopOnestepCheckout::getStepNumber('contactinfo');
     // IF no errors
     $checkout_flow->add(array('step' => $step_number));
     // ELSE
     //        $checkout_flow->add(array(
     //            'step' => $step_number,
     //            'description' => ERROR MESSAGE HERE
     //        ));
 }
 public function execute()
 {
     $this->form = $this->getForm();
     $this->contact = $this->getContact();
     $this->form->setValue($this->contact);
     $saved = waRequest::post() && $this->saveFromPost($this->form, $this->contact);
     $this->view->assign('saved', $saved);
     $this->view->assign('contact', $this->contact);
     $this->view->assign('form', $this->form);
     $this->view->assign('user_info', $this->getFormFieldsHtml());
 }