From 6567276f11765cd0bf5a5b653f734f4a1b673b78 Mon Sep 17 00:00:00 2001 From: Staycie Date: Mon, 12 Feb 2024 21:41:31 +0800 Subject: [PATCH 1/6] first commit for highlighting active tab --- vendor-dashboard.php | 17 ++++++++++------- vendor-profile-tabs.php | 20 ++++++++++++++++++++ vendor-profile.php | 21 ++++++++++++--------- vendor-settings.php | 29 ++++++++++++++++------------- vendor-uploads.php | 17 ++++++++++------- 5 files changed, 68 insertions(+), 36 deletions(-) create mode 100644 vendor-profile-tabs.php diff --git a/vendor-dashboard.php b/vendor-dashboard.php index ebbc1a5..edc7626 100644 --- a/vendor-dashboard.php +++ b/vendor-dashboard.php @@ -127,13 +127,16 @@ if (is_array($vendorOrderss)) { alt="vendor image">
-
- -
+ + + + diff --git a/vendor-profile-tabs.php b/vendor-profile-tabs.php new file mode 100644 index 0000000..a926e09 --- /dev/null +++ b/vendor-profile-tabs.php @@ -0,0 +1,20 @@ + +
+ +
+ + + + \ No newline at end of file diff --git a/vendor-profile.php b/vendor-profile.php index e9b4e7e..c229be9 100644 --- a/vendor-profile.php +++ b/vendor-profile.php @@ -165,15 +165,18 @@
diff --git a/vendor-settings.php b/vendor-settings.php index 5e7c8b7..b9b9b93 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -115,19 +115,22 @@ if ($_SESSION["userId"] <> "") {
- + + + + +
diff --git a/vendor-uploads.php b/vendor-uploads.php index b3e708d..2e1b84a 100644 --- a/vendor-uploads.php +++ b/vendor-uploads.php @@ -111,13 +111,16 @@ $array = json_decode($result, true);
- + + + +
From 959f2e62587c4632c6868bf133f4ea2a5af8e21f Mon Sep 17 00:00:00 2001 From: Jun Barroga Date: Tue, 13 Feb 2024 17:54:24 +0800 Subject: [PATCH 2/6] First Commit --- functions.php | 2 +- product-left-sidebar.php | 226 +++++++++++++++++++-------------------- selected_variation.php | 13 +++ user-profile-tabs.php | 24 ++++- 4 files changed, 148 insertions(+), 117 deletions(-) create mode 100644 selected_variation.php diff --git a/functions.php b/functions.php index 42a2e32..dde830a 100644 --- a/functions.php +++ b/functions.php @@ -1363,7 +1363,7 @@ function addVendor( $country, $email, $phone, - $dateRegistered, + $dateRegistered ) { $curl = curl_init(); diff --git a/product-left-sidebar.php b/product-left-sidebar.php index fdd1c8f..9202a4f 100644 --- a/product-left-sidebar.php +++ b/product-left-sidebar.php @@ -334,54 +334,17 @@ if (isset($_GET['id'])) {
As low as 0) { - echo '' . $product_details['regular_price'] . ''; - echo '' . $product_details['sale_price'] . ''; - } else { - echo '' . $product_details['regular_price'] . ''; - } - } elseif ($product_details['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; - - // 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 ($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; - } - } - } - - // 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 . ''; - } - } + // 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products + if (isset($product_details['sale_price']) && $product_details['sale_price'] > 0) { + echo '' . $product_details['regular_price'] . ''; + echo '' . $product_details['sale_price'] . ''; + } elseif (!isset($product_details['regular_price']) || $product_details['regular_price'] <= 0) { + echo 'Contact Seller for Price'; + } else { + echo '' . $product_details['regular_price'] . ''; + } + // 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products ?> - - -
Stocks Available @@ -389,68 +352,83 @@ if (isset($_GET['id'])) {
- + +
+
+ VARIATION +
+
    + -
    -
    - VARIATION -
    -
      - $variation) { - $variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg'; - ?> - -
    • - product -
    • -
      - -
    -
    -
    -
    - + +
  • + product + +

    + +
  • +
    + $variation) { + $variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg'; +?> + +
  • + product + +

    + +
  • +
    +
+
+
+
+ + + + +
@@ -460,25 +438,43 @@ if (isset($variation_details) && is_array($variation_details)) {
- Add To Cart'; - echo ''; - } elseif ($product_details['regular_price'] && $product_details['regular_price'] !== "") { - // For non-variable products with a regular price, show "Add to Cart" button + + Add To Cart'; + echo ''; + } else { + if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) { echo '
'; echo ''; } else { - // For non-variable products without a regular price, show "Contact seller" button echo ''; } - } else { - // If user is not logged in, prompt to log in - echo '

Please log in to add to cart.

'; } - ?> -
+ } else { + echo '

Please log in to add to cart.

'; + } +?> + + + + +
diff --git a/selected_variation.php b/selected_variation.php new file mode 100644 index 0000000..69b0b96 --- /dev/null +++ b/selected_variation.php @@ -0,0 +1,13 @@ + true]); diff --git a/user-profile-tabs.php b/user-profile-tabs.php index 337f506..ab38f3a 100644 --- a/user-profile-tabs.php +++ b/user-profile-tabs.php @@ -1,4 +1,4 @@ -
+ + + + + + + - \ No newline at end of file diff --git a/vendor-profile.php b/vendor-profile.php index c229be9..e9b4e7e 100644 --- a/vendor-profile.php +++ b/vendor-profile.php @@ -165,18 +165,15 @@
diff --git a/vendor-settings.php b/vendor-settings.php index b9b9b93..5e7c8b7 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -115,22 +115,19 @@ if ($_SESSION["userId"] <> "") {
- - - - - +
diff --git a/vendor-uploads.php b/vendor-uploads.php index 0892103..709251a 100644 --- a/vendor-uploads.php +++ b/vendor-uploads.php @@ -111,16 +111,13 @@ $array = json_decode($result, true);
- - - - +
From a004d1e7d580099fb35d5df86da1196bcbd88e56 Mon Sep 17 00:00:00 2001 From: Jun Barroga Date: Wed, 14 Feb 2024 17:47:28 +0800 Subject: [PATCH 6/6] Vendor User Tabs --- vendor-all-product-list.php | 5 +++-- vendor-dashboard.php | 6 ++++-- vendor-settings.php | 9 +++++---- vendor-uploads-add-product-action.php | 1 - vendor-user-tabs.php | 22 ++++++++++++++++++++++ 5 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 vendor-user-tabs.php diff --git a/vendor-all-product-list.php b/vendor-all-product-list.php index 88d53ab..ed74cc0 100644 --- a/vendor-all-product-list.php +++ b/vendor-all-product-list.php @@ -119,13 +119,14 @@ $products = productList(); alt="vendor image">
-
+ +
diff --git a/vendor-dashboard.php b/vendor-dashboard.php index ebbc1a5..56dfdd1 100644 --- a/vendor-dashboard.php +++ b/vendor-dashboard.php @@ -127,13 +127,15 @@ if (is_array($vendorOrderss)) { alt="vendor image">
-
+ +
diff --git a/vendor-settings.php b/vendor-settings.php index 5e7c8b7..69c50ce 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -115,19 +115,20 @@ if ($_SESSION["userId"] <> "") { diff --git a/vendor-uploads-add-product-action.php b/vendor-uploads-add-product-action.php index 9a130b4..30f45a1 100644 --- a/vendor-uploads-add-product-action.php +++ b/vendor-uploads-add-product-action.php @@ -47,4 +47,3 @@ $response = addProduct( $array = json_decode($response,true); $_SESSION['newProductId'] = $array['_id']; header("location: vendor-uploads.php"); -?> \ No newline at end of file diff --git a/vendor-user-tabs.php b/vendor-user-tabs.php new file mode 100644 index 0000000..c876095 --- /dev/null +++ b/vendor-user-tabs.php @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file