From 6efdc5f4dd02b0d01c9db1ffaa09748686763f23 Mon Sep 17 00:00:00 2001 From: gelonspr Date: Wed, 8 May 2024 18:00:36 +0800 Subject: [PATCH] added message if wishlist is empty --- wishlist.php | 402 ++++++++++++++++++++++++++------------------------- 1 file changed, 203 insertions(+), 199 deletions(-) diff --git a/wishlist.php b/wishlist.php index 6b84754..bbe9cdf 100644 --- a/wishlist.php +++ b/wishlist.php @@ -174,240 +174,244 @@ if ($_SESSION["isVendor"] == true) {
- -
-
- - "> -
-
- " class="image"> - - - " alt="Product" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;"/> - - - - " id="removeItem">× - - -
- - - 0) : ?> +

No wishlist

'; // Display "No wishlist" message if wishlist is empty + } else { + foreach ($customer['favorites']['products'] as $product) { + // raymart added vendorproduct feb 14 2024 + $vendorOfProduct = getVendorbyId($product['vendor_api_id']); + ?> +
+
+ + "> + -
-
-
">
- - - - - 0) { - echo ''; - echo '' . $product['regular_price'] . ''; - echo '' . $product['sale_price'] . ''; - echo ''; - } else { - echo '' . $product['regular_price'] . ''; - } - } elseif ($product['product_type'] === "variable") { - $lowest_regular_price = null; - $highest_regular_price = null; - $lowest_sale_price = null; - $highest_sale_price = null; +
+
">
+ + + + + 0) { + echo ''; + echo '' . $product['regular_price'] . ''; + echo '' . $product['sale_price'] . ''; + echo ''; + } else { + echo '' . $product['regular_price'] . ''; + } + } elseif ($product['product_type'] === "variable") { + $lowest_regular_price = null; + $highest_regular_price = null; + $lowest_sale_price = null; + $highest_sale_price = null; - if (isset($variation_details) && is_array($variation_details)) { - foreach ($variation_details as $index => $variation) { - $regular_price = isset($variation['regular_price']) ? $variation['regular_price'] : 0; - $sale_price = isset($variation['sale_price']) ? $variation['sale_price'] : 0; + if (isset($variation_details) && is_array($variation_details)) { + foreach ($variation_details as $index => $variation) { + $regular_price = isset($variation['regular_price']) ? $variation['regular_price'] : 0; + $sale_price = isset($variation['sale_price']) ? $variation['sale_price'] : 0; - // Update the minimum and maximum prices only if they are not null - if ($lowest_regular_price === null || $regular_price < $lowest_regular_price) { - $lowest_regular_price = $regular_price; - } + // Update the minimum and maximum prices only if they are not null + if ($lowest_regular_price === null || $regular_price < $lowest_regular_price) { + $lowest_regular_price = $regular_price; + } - if ($highest_regular_price === null || $regular_price > $highest_regular_price) { - $highest_regular_price = $regular_price; - } + if ($highest_regular_price === null || $regular_price > $highest_regular_price) { + $highest_regular_price = $regular_price; + } - if ($lowest_sale_price === null || $sale_price < $lowest_sale_price) { - $lowest_sale_price = $sale_price; - } + if ($lowest_sale_price === null || $sale_price < $lowest_sale_price) { + $lowest_sale_price = $sale_price; + } - if ($highest_sale_price === null || $sale_price > $highest_sale_price) { - $highest_sale_price = $sale_price; + if ($highest_sale_price === null || $sale_price > $highest_sale_price) { + $highest_sale_price = $sale_price; + } } } - } - // Display the range of prices based on the presence of sale prices - if ($lowest_sale_price !== null && $highest_sale_price !== null && $lowest_sale_price > 0 && $highest_sale_price > 0) { - echo '' . '₱' . $lowest_sale_price . ' - ₱' . $highest_sale_price . ''; - } elseif ($lowest_regular_price !== null && $highest_regular_price !== null) { - echo '' . '₱' . $lowest_regular_price . ' - ₱' . $highest_regular_price . ''; + // Display the range of prices based on the presence of sale prices + if ($lowest_sale_price !== null && $highest_sale_price !== null && $lowest_sale_price > 0 && $highest_sale_price > 0) { + echo '' . '₱' . $lowest_sale_price . ' - ₱' . $highest_sale_price . ''; + } elseif ($lowest_regular_price !== null && $highest_regular_price !== null) { + echo '' . '₱' . $lowest_regular_price . ' - ₱' . $highest_regular_price . ''; + } } - } - ?> + ?> +
-
- - +