Compare commits

...

2 Commits

Author SHA1 Message Date
3wc
3ea3cf7e6f Positioning fixes for non-coffee items
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-27 11:29:47 -04:00
3wc
2046a23a4b Initial work on showing labels for non-coffee items 2024-06-27 11:29:47 -04:00
2 changed files with 16 additions and 8 deletions

View File

@ -197,7 +197,7 @@ function mont58_coffee_label_add_sidepanel()
{
add_meta_box(
"mont58_coffee_label_sidepanel",
"Coffee Label",
"Label",
"mont58_coffee_label_render_sidepanel",
"shop_order",
"side",
@ -255,4 +255,4 @@ function mont58coffee_enqueue_fonts()
get_theme_file_uri("/fonts/acumin-variable-concept.css")
);
}
add_action("wp_enqueue_scripts", "mont58coffee_enqueue_fonts");
add_action("wp_enqueue_scripts", "mont58coffee_enqueue_fonts");

View File

@ -31,6 +31,7 @@ if(!is_user_logged_in()){
display: flex;
align-items: center;
justify-content: center;
position: relative;
background: linear-gradient(
0deg,
rgba(255, 255, 255, 1) 28%,
@ -75,7 +76,10 @@ if(!is_user_logged_in()){
}
.label .order-details {
padding-bottom: 1em;
position: absolute;
text-align: center;
width: 88%;
top: 120px;
font-size: calc(0.35 * 17px);
}
@ -123,13 +127,13 @@ if(!is_user_logged_in()){
}
}
if (!$is_coffee && !$is_subscription) {
continue;
if ($is_coffee || $is_subscription) {
$brew_method = $item->get_meta("pa_brew-method");
$weight = $item->get_meta("weight");
} else {
$product_name = $item->get_name();
}
$brew_method = $item->get_meta("pa_brew-method");
$weight = $item->get_meta("weight");
if ($is_coffee) {
// Non-subscription order
$product_name = $item->get_name();
@ -160,11 +164,15 @@ if(!is_user_logged_in()){
<div class="label">
<div>
<div class="product-details">
<?php if ($is_coffee || $is_subscription) { ?>
<p class="weight"><?php echo $weight; ?></p>
<?php } ?>
<p class="origin"><?php echo $product_name; ?></p>
<?php if ($is_coffee || $is_subscription) { ?>
<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 $roast_date; ?></span></p>
<?php } ?>
<p class="code"><?php
echo $is_new ? "N" : "";
echo $gift_message ? "G" : "";