Show total order items in label counter

This commit is contained in:
Aadil Ayub 2024-05-20 15:10:51 +00:00
parent edc124792d
commit 92d562ffc0

View File

@ -87,12 +87,12 @@
$last_name = $order->get_billing_last_name();
$postcode = $order->get_billing_postcode();
$items = $order->get_items();
$total_items = $order->get_item_count();
$roast_date = (new DateTime())->modify("-3 days")->format("d/m/Y");
$gift_message = $order->get_meta("_shipping_gift_message");
$order_subscription_coffees = get_field("coffees", $order_id);
$j = 0; // Count order items
foreach ($items as $item) {
// checking if product is a coffee
$product_id = $item->get_product_id();
@ -166,7 +166,7 @@
<div class="order-details">
<p class="customer-name"><?php echo "$first_name $last_name"; ?></p>
<p class="purchase-code"><?php echo $postcode; ?></p>
<p class="quantity"><?php echo $quantity; ?></p>
<p class="quantity"><?php echo $total_items; ?></p>
</div>
</div>
</div>