From 2046a23a4b45f24e224a891de9857659d26e0472 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 10 Jun 2024 20:56:15 -0500 Subject: [PATCH 1/2] Initial work on showing labels for non-coffee items --- .../themes/mont58-coffee/template-order-label.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/mont58-coffee/template-order-label.php b/wp-content/themes/mont58-coffee/template-order-label.php index 86d9535..150b9ab 100644 --- a/wp-content/themes/mont58-coffee/template-order-label.php +++ b/wp-content/themes/mont58-coffee/template-order-label.php @@ -123,13 +123,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 +160,15 @@ if(!is_user_logged_in()){
+

+

+

Roast

Roasted on:

+

Date: Thu, 27 Jun 2024 11:28:27 -0400 Subject: [PATCH 2/2] Positioning fixes for non-coffee items --- wp-content/themes/mont58-coffee/functions.php | 4 ++-- wp-content/themes/mont58-coffee/template-order-label.php | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/mont58-coffee/functions.php b/wp-content/themes/mont58-coffee/functions.php index a76f2a0..7b14da4 100644 --- a/wp-content/themes/mont58-coffee/functions.php +++ b/wp-content/themes/mont58-coffee/functions.php @@ -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"); \ No newline at end of file +add_action("wp_enqueue_scripts", "mont58coffee_enqueue_fonts"); diff --git a/wp-content/themes/mont58-coffee/template-order-label.php b/wp-content/themes/mont58-coffee/template-order-label.php index 150b9ab..6c5bec5 100644 --- a/wp-content/themes/mont58-coffee/template-order-label.php +++ b/wp-content/themes/mont58-coffee/template-order-label.php @@ -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); }