function output()
 {
     if (modApiFunc('Checkout', 'getCurrentStepID') == 4) {
         return getCheckout();
     }
     if (modApiFunc('Session', 'is_Set', '_lastPlacedOrderID')) {
         return getOrderInfo(modApiFunc('Session', 'get', '_lastPlacedOrderID'));
     }
     global $application;
     $request = new Request();
     $request->setView('Checkout');
     $application->redirect($request);
 }
 /**
  * Outputs the OneStepCheckout view.
  */
 function output($current_step = '', $errors_only = false)
 {
     global $application;
     if ($current_step < 1 || $current_step > 3) {
         $current_step = '';
     }
     $step_id = $this->pCheckout->getCurrentStepID();
     if ($step_id == 3) {
         $payment_module_id = modApiFunc("Checkout", "getChosenPaymentModuleIdCZ");
         $prerequisite_name = Checkout::getAdditionalPrerequisiteName("creditCardInfo", $payment_module_id);
         $PrerequisitesValidationResults = modApiFunc("Checkout", "getPrerequisitesValidationResults");
         if (isset($PrerequisitesValidationResults[$prerequisite_name]) && $PrerequisitesValidationResults[$prerequisite_name]["isMet"] != true) {
             if ($prerequisite_name == "creditCardInfoAC593800_68BA_A4D3_6A14_49BA5022FED7" && isset($PrerequisitesValidationResults['billingInfo']['variant_tag']) && $PrerequisitesValidationResults['billingInfo']['variant_tag'] == "PayPalProExpressCheckout") {
             } else {
                 $request = new Request();
                 $request->setView('CheckoutView');
                 $request->setAction("SetCurrStep");
                 $request->setKey('step_id', 2);
                 $request = modApiFunc("Checkout", "appendCheckoutCZGETParameters", $request);
                 modApiFunc("Checkout", "saveState");
                 $application->redirect($request);
                 return '';
             }
         }
     }
     // setting up the template engine
     $template_block = $application->getBlockTemplate('OneStepCheckout');
     $this->mTmplFiller->setTemplate($template_block);
     if (!modApiFunc('Cart', 'getCartProductsQuantity') || modApiFunc('Checkout', 'getLastPlacedOrderID') || modApiFunc('Configuration', 'getValue', SYSCONFIG_MIN_SUBTOTAL_TO_BEGIN_CHECKOUT) > ZERO_PRICE && modApiFunc('Checkout', 'getOrderPrice', 'Subtotal', modApiFunc('Localization', 'getMainStoreCurrency')) < modApiFunc('Configuration', 'getValue', SYSCONFIG_MIN_SUBTOTAL_TO_BEGIN_CHECKOUT)) {
         return getCheckout();
     }
     $_tags = array('Local_StepID' => $step_id, 'Local_FormAction' => $this->getLinkToCheckoutStep(), 'Local_BlowFishKey' => modApiFunc('Checkout', 'getPerRequestVariable', 'CHECKOUT_CZ_BLOWFISH_KEY'), 'Local_PaymentMethods' => $this->getPaymentModulesList(), 'Local_PaymentMethodOutput' => $this->getPaymentModuleOutput(), 'Local_CreditCardInfoJSAttrRules' => $this->getJSAttrRules(), 'Local_Errors_1' => $this->getErrors(1), 'Local_Errors_2' => $this->getErrors(2), 'Local_Errors_3' => $this->getErrors(3), 'Local_Errors' => $this->getErrors($step_id));
     $this->_Template_Contents = $_tags;
     $application->registerAttributes($this->_Template_Contents, 'OneStepCheckout');
     if ($current_step) {
         if ($errors_only && $this->getErrors($step_id)) {
             return $this->mTmplFiller->fill('error');
         }
         return $this->mTmplFiller->fill('step' . $current_step);
     }
     return $this->mTmplFiller->fill('container');
 }