Product Items not being found
-
I have some php code which i am trying to use to get a list of product items for an order so that i can automatically print custom packaging slips. Everything works fine, i can get the order number, the order status etc, but it keeps coming up and saying no product items found.
// Loop through order items and add them to the PDF (Picking List) $items = $order->get_items(); error_log('Order Items: ' . print_r($items, true)); // Debugging the items if (empty($items)) { error_log("No items found in order ID: " . $order_id); } foreach ($items as $item_id => $item) { $product_name = $item->get_name(); // Get the item name (product name) $item_quantity = $item->get_quantity(); // Get the item quantity // Add item name and quantity to the PDF (Picking List) $pdf->Cell(0, 10, "Product name: {$product_name} | Quantity: {$item_quantity}", 0, 1); }
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Product Items not being found’ is closed to new replies.