$total_weight; /* --- ORDER NUMBER --- */ $ord_name = strtoupper(substr(filter_var($_POST['checkout_user_fname'], FILTER_SANITIZE_STRING), 0, 3)); //$ord_name = strtoupper(substr($_global_user->user_first_name, 0, 3)); $ord_day = date("dmy"); $today = date('Y-m-d'); $generate_order_number = $_checkout_get->generate_order_number($today); if ($generate_order_number->rows > 0) { $_total_order = $generate_order_number->rows + 1; } else { $_total_order = 1; } $format_order_number = $ord_name . $ord_day; $order_number = $ord_name . $ord_day . substr('000' . $_total_order, -3); /* --- COURIER --- */ $courier_rate = $_checkout_get->get_courier($_POST['opt-shipping']); $courier_name = $_checkout_get->get_courier_name($courier_rate->courier_name); //$total_weights = ceil($total_weight / $courier_rate['courier_weight']); $order_ship_note = filter_var('No message', FILTER_SANITIZE_STRING); $order_ship_method = $_checkout_get->get_courier_name($courier_rate->courier_name); $order_ship_method = $order_ship_method->courier_name; /* --- BILLING INFORMATION --- */ $order_billing_fname = $_global_user->user_first_name; $order_billing_lname = $_global_user->user_last_name; $order_billing_fullname = $_global_user->user_fullname; $order_billing_email = $_global_user->user_email; if ($_global_user->user_phone != '') { $order_billing_phone = $_global_user->user_phone; } else { $order_billing_phone = filter_var($_POST['checkout_user_phone'], FILTER_SANITIZE_STRING); }
$order_counter = $generate_order_number->rows * 1 + 1; $add_order = ''; if(strlen(($order_counter + 1)) == 1 || ($order_counter + 1) == ''){ $add_order = "00"; }else if(strlen(($order_counter + 1)) == 2){ $add_order = "0"; }else if(strlen(($order_counter + 1)) == 3){ $add_order = ""; } $order_number = $format_order_number.$add_order.$order_counter; /* --- COURIER --- */ $courier_rate = $_checkout_get->get_courier($_POST['courier_service']); $courier_name = $_checkout_get->get_courier_name($courier_rate->courier_name); //$total_weights = ceil($total_weight / $courier_rate['courier_weight']); $order_ship_note = filter_var('No message', FILTER_SANITIZE_STRING); $order_ship_method = $_checkout_get->get_courier_name($courier_rate->courier_name); $order_ship_method = $order_ship_method->courier_name; /* --- BILLING INFORMATION --- */ $order_billing_fname = $_global_user->user_first_name; $order_billing_lname = $_global_user->user_last_name; $order_billing_fullname = $_global_user->user_fullname; $order_billing_email = $_global_user->user_email; if($_global_user->user_address == ''){ $order_billing_address = filter_var($_POST['checkout_user_address'], FILTER_SANITIZE_STRING);