This commit is contained in:
parent
6f3069bee9
commit
83be51bf32
@ -185,21 +185,14 @@ if(!is_user_logged_in()){
|
||||
$quantity = $item->get_quantity();
|
||||
for ($i = 0; $i < $quantity; $i++) {
|
||||
if ($is_subscription) {
|
||||
$coffee = $order_subscription_coffees[$i + $j]["coffee"];
|
||||
$product_name = $coffee->post_title;
|
||||
$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
|
||||
}
|
||||
} ?>
|
||||
if (is_object($order_subscription_coffees[$i + $j]["coffee"])){
|
||||
$coffee = $order_subscription_coffees[$i + $j]["coffee"];
|
||||
$product_name = $coffee->post_title;
|
||||
$roast = get_field("roast_level", $coffee->ID);
|
||||
$is_organic = get_field("is_organic", $coffee->ID);
|
||||
}
|
||||
} ?>
|
||||
|
||||
<div class="label">
|
||||
<div>
|
||||
<div class="product-details">
|
||||
|
Loading…
Reference in New Issue
Block a user