public function PostageForm()
    {
        // If no estimate found, generate error
        if (!$this->hasEstimate()) {
            return $this->redirect($this->Link("noestimate"));
        }

        $estimate = $this->getEstimate();

        $form = PostageForm::create(
            $this,
            "PostageForm",
            $estimate,
            $estimate->SubTotal,
            $estimate->TotalWeight,
            $estimate->TotalItems,
            $estimate->DeliveryCountry,
            $estimate->DeliveryCounty
        );

        $form->setLegend(_t('SilverCommerce\Checkout.Postage', "Postage"));

        $proceed_action = $form->Actions()->fieldByName("action_doSetPostage");

        if (isset($proceed_action)) {
            $fields = $form->Fields();
            $fields->push(HiddenField::create(
                "CompleteURL",
                null,
                $this->Link("payment")
            ));

            $proceed_action
                ->setTitle(_t(
                    'SilverCommerce\Checkout.PayNow',
                    "Pay Now"
                ))->removeExtraClass("btn-secondary")
                ->addExtraClass("btn-success");
        }

        // Extension call
        $this->extend("updatePostageForm", $form);

        return $form;
    }
public function PostageForm()
    {
        // If no estimate found, generate error
        if (!$this->hasEstimate()) {
            return $this->redirect($this->Link("noestimate"));
        }

        $estimate = $this->getEstimate();

        $form = PostageForm::create(
            $this,
            "PostageForm",
            $estimate,
            $estimate->SubTotal,
            $estimate->TotalWeight,
            $estimate->TotalItems,
            $estimate->DeliveryCountry,
            $estimate->DeliveryCounty
        );

        $form->setLegend(_t('SilverCommerce\Checkout.Postage', "Postage"));

        $proceed_action = $form->Actions()->fieldByName("action_doSetPostage");

        if (isset($proceed_action)) {
            $fields = $form->Fields();
            $fields->push(HiddenField::create(
                "CompleteURL",
                null,
                $this->Link("payment")
            ));

            $proceed_action
                ->setTitle(_t(
                    'SilverCommerce\Checkout.PayNow',
                    "Pay Now"
                ))->removeExtraClass("btn-secondary")
                ->addExtraClass("btn-success");
        }

        // Extension call
        $this->extend("updatePostageForm", $form);

        return $form;
    }
public function PostageForm ( ) { // If no estimate found, generate error if ( ! $ this -> hasEstimate ( ) ) { return $ this -> redirect ( $ this -> Link ( "noestimate" ) ) ; } $ estimate = $ this -> getEstimate ( ) ; $ form = PostageForm :: create ( $ this , "PostageForm" , $ estimate , $ estimate -> SubTotal , $ estimate -> TotalWeight , $ estimate -> TotalItems , $ estimate -> DeliveryCountry , $ estimate -> DeliveryCounty ) ; $ form -> setLegend ( _t ( 'SilverCommerce\Checkout.Postage' , "Postage" ) ) ; $ proceed_action = $ form -> Actions ( ) -> fieldByName ( "action_doSetPostage" ) ; if ( isset ( $ proceed_action ) ) { $ fields = $ form -> Fields ( ) ; $ fields -> push ( HiddenField :: create ( "CompleteURL" , null , $ this -> Link ( "payment" ) ) ) ; $ proceed_action -> setTitle ( _t ( 'SilverCommerce\Checkout.PayNow' , "Pay Now" ) ) -> removeExtraClass ( "btn-secondary" ) -> addExtraClass ( "btn-success" ) ; } // Extension call $ this -> extend ( "updatePostageForm" , $ form ) ; return $ form ; }
Form to find postage options and allow user to select payment

@return Form
Form to find postage options and allow user to select payment