Generation

generate functionSat, 31 Dec 2022

in wordpress create code to extract woocommerce orders. include details like customer's name, email, phone, products and price.

$order = new WC_Order( $order_id ); $items = $order->get_items(); foreach ( $items as $item ) { $product_id = $item[‘product_id’]; $title = $item[‘name’]; // Get the product $product = new WC_Product($product_id); $price = $product->get_price(); }

Want to kickstart your project?Use the new AI Studio to create your code