public function BillingForm()
    {
        $form = BillingDetailsForm::create($this, 'BillingForm');

        $data = Session::get("Checkout.BillingDetailsForm.data");
        if (is_array($data)) {
            $form->loadDataFrom($data);
        } elseif($member = Member::currentUser()) {
            // Fill email, phone, etc
            $form->loadDataFrom($member);
            
            // Then fill with Address info
            if($member->DefaultAddress()) {
                $form->loadDataFrom($member->DefaultAddress());
            }
        }

        $this->extend("updateBillingForm", $form);

        return $form;
    }
public function BillingForm()
    {
        $form = BillingDetailsForm::create($this, 'BillingForm');

        $data = Session::get("Checkout.BillingDetailsForm.data");
        if (is_array($data)) {
            $form->loadDataFrom($data);
        } elseif($member = Member::currentUser()) {
            // Fill email, phone, etc
            $form->loadDataFrom($member);
            
            // Then fill with Address info
            if($member->DefaultAddress()) {
                $form->loadDataFrom($member->DefaultAddress());
            }
        }

        $this->extend("updateBillingForm", $form);

        return $form;
    }
public function BillingForm ( ) { $ form = BillingDetailsForm :: create ( $ this , 'BillingForm' ) ; $ data = Session :: get ( "Checkout.BillingDetailsForm.data" ) ; if ( is_array ( $ data ) ) { $ form -> loadDataFrom ( $ data ) ; } elseif ( $ member = Member :: currentUser ( ) ) { // Fill email, phone, etc $ form -> loadDataFrom ( $ member ) ; // Then fill with Address info if ( $ member -> DefaultAddress ( ) ) { $ form -> loadDataFrom ( $ member -> DefaultAddress ( ) ) ; } } $ this -> extend ( "updateBillingForm" , $ form ) ; return $ form ; }
Form to capture the users billing details

@return BillingDetailsForm
Form to capture the users billing details