|
|
|
@ -7,6 +7,7 @@ $last_name = $order->get_billing_last_name();
|
|
|
|
|
$postcode = $order->get_billing_postcode();
|
|
|
|
|
$items = $order->get_items();
|
|
|
|
|
$order_date = $order->get_date_created()->date('d/m/Y');
|
|
|
|
|
$gift_message = $order->get_meta('_shipping_gift_message');
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
@ -22,6 +23,7 @@ $order_date = $order->get_date_created()->date('d/m/Y');
|
|
|
|
|
<style>
|
|
|
|
|
.container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.label {
|
|
|
|
@ -29,7 +31,7 @@ $order_date = $order->get_date_created()->date('d/m/Y');
|
|
|
|
|
height: 400px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
padding: 2rem;
|
|
|
|
|
margin-inline: 2rem;
|
|
|
|
|
margin: 2rem;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border: 1px solid gray;
|
|
|
|
|
display: flex;
|
|
|
|
@ -89,32 +91,48 @@ $order_date = $order->get_date_created()->date('d/m/Y');
|
|
|
|
|
<body>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<?php foreach ($items as $item) {
|
|
|
|
|
$quantity = $item->get_quantity();
|
|
|
|
|
$product_name = $item->get_name();
|
|
|
|
|
$brew_method = $item->get_meta('pa_brew-method');
|
|
|
|
|
$weight = $item->get_meta('weight');
|
|
|
|
|
// checking if product is a coffee
|
|
|
|
|
$product_id = $item->get_product_id();
|
|
|
|
|
$roast = get_field('roast_level', $product_id);
|
|
|
|
|
$product_categories = get_the_terms($product_id, 'product_cat');
|
|
|
|
|
$is_coffee = false;
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i < $quantity; $i++) { ?>
|
|
|
|
|
<div class="label">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="product-details">
|
|
|
|
|
<p class="weight"><?php echo $weight; ?></p>
|
|
|
|
|
<p class="origin"><?php echo $product_name; ?></p>
|
|
|
|
|
<p class="bean-type"><?php echo $brew_method; ?></p>
|
|
|
|
|
<p class="roast"><?php echo $roast; ?> Roast</p>
|
|
|
|
|
<p class="date">Roasted on: <span><?php echo $order_date; ?></span></p>
|
|
|
|
|
<p class="code">NGO</p>
|
|
|
|
|
</div>
|
|
|
|
|
<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>
|
|
|
|
|
if (!empty($product_categories) && !is_wp_error($product_categories)) {
|
|
|
|
|
foreach ($product_categories as $product_category) {
|
|
|
|
|
if ($product_category->slug == 'coffee') {
|
|
|
|
|
$is_coffee = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($is_coffee) {
|
|
|
|
|
$quantity = $item->get_quantity();
|
|
|
|
|
$product_name = $item->get_name();
|
|
|
|
|
$brew_method = $item->get_meta('pa_brew-method');
|
|
|
|
|
$weight = $item->get_meta('weight');
|
|
|
|
|
$roast = get_field('roast_level', $product_id);
|
|
|
|
|
$is_organic = get_field('is_organic', $product_id);
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i < $quantity; $i++) { ?>
|
|
|
|
|
<div class="label">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="product-details">
|
|
|
|
|
<p class="weight"><?php echo $weight; ?></p>
|
|
|
|
|
<p class="origin"><?php echo $product_name; ?></p>
|
|
|
|
|
<p class="bean-type"><?php echo $brew_method; ?></p>
|
|
|
|
|
<p class="roast"><?php echo $roast; ?> Roast</p>
|
|
|
|
|
<p class="date">Roasted on: <span><?php echo $order_date; ?></span></p>
|
|
|
|
|
<p class="code">N<?php echo $gift_message ? 'G' : '' ?><?php echo $is_organic ? 'O' : '' ?></p>
|
|
|
|
|
</div>
|
|
|
|
|
<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>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<?php }
|
|
|
|
|
<?php }
|
|
|
|
|
}
|
|
|
|
|
} ?>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|