"") { $_SESSION["isLoggedIn"] = true; $customer_data = getCustomerbyLoginId($_SESSION["userId"]); $customerId = $customer_data[0]['_id']; // $cart_items = isset($_SESSION['cart_items']) ? $_SESSION['cart_items'] : []; $cart_items = getOrderbyCustomerId($customerId); $cart_decode = json_decode($cart_items, true); $cartItems = array_filter($cart_decode, function ($order) { return isset($order['status']) && $order['status'] === 'CART' && isset($order['items'][0]['product']); }); $order_ids = []; if ($cartItems) { foreach ($cartItems as $item) { array_push($order_ids, $item['_id']); } } // $filteredIds = array_map(function ($order) { // return isset($order['_id']) ? $order['_id'] : null; // }, $cartItems); $filteredIdsJSON = json_encode($order_ids); // $cartItemsArray = json_decode($cartItemsJSON, true); // // $cartItemsJSON = $cartItems // var_dump($cartItemsArray[12]); } else { $_SESSION["isLoggedIn"] = false; } if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"])) { // Iterate through addresses foreach ($customer_data[0]["address"] as $address) { // Check if billing is true if ($address["billing"] === true) { $billing = $address; break; // Stop iterating once a match is found } } } // var_dump($customer_data[0]["address"]) ?> oBanana B2B - Elevate Your Business

Checkout

Billing Details

Delivery Address:

Name:
Contact #:
Address:
Place Order

Summary

Total Amount
$95.00 x Subtotal:
Color
Size

Payment Method

Please select the preferred payment method to use on this order.
3
4
payment image

Someone in new just bought

stylish baby shoes

10 Minutes ago

×
3
Need Help?

Chat with us on WhatsApp

whatsapp icon

Features

icon

Color Scheme

Full Screen mode

Mode
On
Off

Dark mode

Mode
On
Off

RTL mode

Rtl
On
Off

Clear local storage

Clear Cache & Default