public function goToNextStep(array $data, ReservationForm $form)
    {
        $reservation = $form->getReservation();
        foreach ($data['Attendee'] as $attendeeID => $attendeeData) {
            /** @var Attendee $attendee */
            $attendee = Attendee::get()->byID($attendeeID);

            // populate the attendees
            foreach ($attendeeData as $field => $value) {
                if (is_int($field)) {
                    $attendee->Fields()->add($field, array('Value' => $value));
                } else {
                    $attendee->setField($field, $value);
                }
            }

            $attendee->write();

            // Set the main contact
            if (isset($attendeeData['Main']) && (bool)$attendeeData['Main']) {
                $reservation->setMainContact($attendeeID);
            }
        }
        
        // add the tax modifier
        $reservation->PriceModifiers()->add(TaxModifier::findOrMake($reservation));
        $reservation->calculateTotal();
        $reservation->write();
        
        $this->extend('beforeNextStep', $data, $form);
        return $this->nextStep();
    }
public function goToNextStep(array $data, ReservationForm $form)
    {
        $reservation = $form->getReservation();
        foreach ($data['Attendee'] as $attendeeID => $attendeeData) {
            /** @var Attendee $attendee */
            $attendee = Attendee::get()->byID($attendeeID);

            // populate the attendees
            foreach ($attendeeData as $field => $value) {
                if (is_int($field)) {
                    $attendee->Fields()->add($field, array('Value' => $value));
                } else {
                    $attendee->setField($field, $value);
                }
            }

            $attendee->write();

            // Set the main contact
            if (isset($attendeeData['Main']) && (bool)$attendeeData['Main']) {
                $reservation->setMainContact($attendeeID);
            }
        }
        
        // add the tax modifier
        $reservation->PriceModifiers()->add(TaxModifier::findOrMake($reservation));
        $reservation->calculateTotal();
        $reservation->write();
        
        $this->extend('beforeNextStep', $data, $form);
        return $this->nextStep();
    }
public function goToNextStep ( array $ data , ReservationForm $ form ) { $ reservation = $ form -> getReservation ( ) ; foreach ( $ data [ 'Attendee' ] as $ attendeeID => $ attendeeData ) { /** @var Attendee $attendee */ $ attendee = Attendee :: get ( ) -> byID ( $ attendeeID ) ; // populate the attendees foreach ( $ attendeeData as $ field => $ value ) { if ( is_int ( $ field ) ) { $ attendee -> Fields ( ) -> add ( $ field , array ( 'Value' => $ value ) ) ; } else { $ attendee -> setField ( $ field , $ value ) ; } } $ attendee -> write ( ) ; // Set the main contact if ( isset ( $ attendeeData [ 'Main' ] ) && ( bool ) $ attendeeData [ 'Main' ] ) { $ reservation -> setMainContact ( $ attendeeID ) ; } } // add the tax modifier $ reservation -> PriceModifiers ( ) -> add ( TaxModifier :: findOrMake ( $ reservation ) ) ; $ reservation -> calculateTotal ( ) ; $ reservation -> write ( ) ; $ this -> extend ( 'beforeNextStep' , $ data , $ form ) ; return $ this -> nextStep ( ) ; }
Finish the registration and continue to checkout

@param array           $data
@param ReservationForm $form

@return \SS_HTTPResponse
Finish the registration and continue to checkout