/**
  * Display Classic Checkout
  */
 function show_classic_checkout()
 {
     if (!empty($_GET['action']) && $_GET['action'] == 'direct_payment_link') {
         wpshop_checkout::direct_payment_link($_GET['token'], $_GET['order_id'], $_GET['login']);
     }
     $checkout_step_indicator = do_shortcode('[wps_checkout_step_indicator]');
     $checkout_content = '';
     if (!empty($_GET['order_step'])) {
         switch ($_GET['order_step']) {
             case 1:
                 ob_start();
                 require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic-checkout", "step-one");
                 $checkout_content .= ob_get_contents();
                 ob_end_clean();
                 break;
             case 2:
                 if (get_current_user_id() != 0) {
                     $permalink_option = get_option('permalink_structure');
                     $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                     $url = get_permalink($checkout_page_id) . (!empty($permalink_option) ? '?' : '&') . 'order_step=3';
                     wpshop_tools::wpshop_safe_redirect($url);
                 } else {
                     ob_start();
                     require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic-checkout", "step-two");
                     $checkout_content .= ob_get_contents();
                     ob_end_clean();
                 }
                 break;
             case 3:
                 if (get_current_user_id() == 0) {
                     $permalink_option = get_option('permalink_structure');
                     $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                     $url = get_permalink($checkout_page_id) . (!empty($permalink_option) ? '?' : '&') . 'order_step=2';
                     wpshop_tools::wpshop_safe_redirect($url);
                 } else {
                     if (!empty($_SESSION) && !empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items'])) {
                         ob_start();
                         require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic-checkout", "step-three");
                         $checkout_content .= ob_get_contents();
                         ob_end_clean();
                         $url = apply_filters('wps_extra_signup_actions', isset($url) ? $url : '');
                         if (!empty($url)) {
                             wpshop_tools::wpshop_safe_redirect($url);
                         }
                     } else {
                         $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                         $url = get_permalink($checkout_page_id);
                         wpshop_tools::wpshop_safe_redirect($url);
                     }
                 }
                 break;
             case 4:
                 if (get_current_user_id() == 0) {
                     $permalink_option = get_option('permalink_structure');
                     $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                     $url = get_permalink($checkout_page_id) . (!empty($permalink_option) ? '?' : '&') . 'order_step=2';
                     wpshop_tools::wpshop_safe_redirect($url);
                 } else {
                     if (!empty($_SESSION) && !empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items'])) {
                         ob_start();
                         require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic-checkout", "step-four");
                         $checkout_content .= ob_get_contents();
                         ob_end_clean();
                     } else {
                         $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                         $url = get_permalink($checkout_page_id);
                         wpshop_tools::wpshop_safe_redirect($url);
                     }
                 }
                 break;
             case 5:
                 if (get_current_user_id() == 0) {
                     $permalink_option = get_option('permalink_structure');
                     $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                     $url = get_permalink($checkout_page_id) . (!empty($permalink_option) ? '?' : '&') . 'order_step=2';
                     wpshop_tools::wpshop_safe_redirect($url);
                 } else {
                     $wps_cart = new wps_cart();
                     $order = $wps_cart->calcul_cart_information(array());
                     $wps_cart->store_cart_in_session($order);
                     $shipping_option = get_option('wpshop_shipping_address_choice');
                     if (!empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items']) && (!empty($shipping_option) && !empty($shipping_option['activate']) && !empty($_SESSION['shipping_method']) || !empty($shipping_option) && empty($shipping_option['activate']))) {
                         $order_id = !empty($_SESSION['cart']['order_id']) ? wpshop_tools::varSanitizer($_SESSION['cart']['order_id']) : 0;
                         ob_start();
                         require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic-checkout", "step-five");
                         $checkout_content .= ob_get_contents();
                         ob_end_clean();
                     } else {
                         $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                         $url = get_permalink($checkout_page_id);
                         wpshop_tools::wpshop_safe_redirect($url);
                     }
                 }
                 break;
             case 6:
                 if (!empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items'])) {
                     $wps_marketing_tools_ctr = new wps_marketing_tools_ctr();
                     $checkout_content .= $wps_marketing_tools_ctr->display_ecommerce_ga_tracker($_SESSION['order_id']);
                     $checkout_content .= $this->wps_classic_confirmation_message();
                 } else {
                     $checkout_page_id = wpshop_tools::get_page_id(get_option('wpshop_checkout_page_id'));
                     $url = get_permalink($checkout_page_id);
                     wpshop_tools::wpshop_safe_redirect($url);
                 }
                 break;
             default:
                 ob_start();
                 require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic-checkout", "step-one");
                 $checkout_content .= ob_get_contents();
                 ob_end_clean();
                 break;
         }
     } else {
         $checkout_content = do_shortcode('[wps_cart]');
     }
     require_once wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "classic_checkout");
 }