function get_order_details_in_session() { $cart = get_cart_in_session(); $order_details = $cart['order_details']; return $order_details; }
<?php get_header(); $produdct_Arr = array(); $product_id = !empty($_GET['product_id']) ? $_GET['product_id'] : ""; $product_price = get_field('product_price', $product_id); //$amount_select = !empty($_GET['amount_select']) ? $_GET['amount_select']:""; $price = number_format($product_price, 0, ',', '.'); $cart = get_cart_in_session(); if (wp_verify_nonce($_POST['action_contact'], 'contact')) { global $wpdb; $errors = array(); $cart_tt = get_cart_in_session(); $ten = $_POST['fullname']; $dienthoai = $_POST['phone']; $diachi = $_POST['address']; $email = $_POST['khachemail']; $chitiet = $_POST['message']; $order = $wpdb->prefix . 'order'; $userID = $current_user->ID; if ($cart_tt) { if (insert_cart_to_db()) { $orderid = get_order_id_with_session(); gui_noi_dung_don_hang_admin($ten, $dienthoai, $diachi, $email, $chitiet, $orderid); gui_noi_dung_don_hang_khach($ten, $dienthoai, $diachi, $email, $chitiet, $orderid); $wpdb->get_results("UPDATE {$order} SET email='{$email}' WHERE ID='{$orderid}'"); //session_regenerate_id(); session_unset(); //echo '<script>alert("Đặt hàng thành công. Vui lòng kiểm tra email !");</script>'; ?> <script type="text/javascript">