dont print error
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
trav 2024-07-09 14:20:39 -04:00
parent 6f3069bee9
commit 83be51bf32

View File

@ -185,21 +185,14 @@ if(!is_user_logged_in()){
$quantity = $item->get_quantity(); $quantity = $item->get_quantity();
for ($i = 0; $i < $quantity; $i++) { for ($i = 0; $i < $quantity; $i++) {
if ($is_subscription) { if ($is_subscription) {
$coffee = $order_subscription_coffees[$i + $j]["coffee"]; if (is_object($order_subscription_coffees[$i + $j]["coffee"])){
$product_name = $coffee->post_title; $coffee = $order_subscription_coffees[$i + $j]["coffee"];
$roast = get_field("roast_level", $coffee->ID); $product_name = $coffee->post_title;
$is_organic = get_field("is_organic", $coffee->ID); $roast = get_field("roast_level", $coffee->ID);
$is_organic = get_field("is_organic", $coffee->ID);
}
} ?>
if (is_object($coffee)) {
$product_name = $coffee->post_title;
$roast = get_field("roast_level", $coffee->ID);
$is_organic = get_field("is_organic", $coffee->ID);
} else {
// Handle the case where $coffee is not an object
error_log("Error: \$coffee is not an object in template-order-label.php");
// Set default values or skip this iteration
}
} ?>
<div class="label"> <div class="label">
<div> <div>
<div class="product-details"> <div class="product-details">