From 3e8e62a13143d8852cdfc63eae22d10e211ac9a5 Mon Sep 17 00:00:00 2001 From: Jun Barroga Date: Tue, 27 Feb 2024 08:56:59 +0800 Subject: [PATCH 1/2] Vendor Page Modifications --- admin/config.php | 2 +- admin/login.php | 2 +- admin/vendor-card.php | 340 ++++++++++++---------- assets/css/style.css | 2 +- checkouttest.php | 4 +- functions.php | 10 +- vendor-dashboard-orders-edit-action.php | 6 + vendor-dashboard-orders-edit.php | 4 + vendor-settings.php | 367 +++++++++++++++--------- 9 files changed, 444 insertions(+), 293 deletions(-) diff --git a/admin/config.php b/admin/config.php index 57d9763..7f523ab 100644 --- a/admin/config.php +++ b/admin/config.php @@ -1,6 +1,6 @@ -
+
diff --git a/admin/vendor-card.php b/admin/vendor-card.php index 111c49c..a08d6b5 100644 --- a/admin/vendor-card.php +++ b/admin/vendor-card.php @@ -852,168 +852,212 @@ $products = productList();
diff --git a/functions.php b/functions.php index cffbd8a..ae5ff93 100644 --- a/functions.php +++ b/functions.php @@ -1382,17 +1382,23 @@ function getOrderbyVendorId($id) return $response; } -function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $token) +function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $paymentStatus, $paymentReference, $token) { $curl = curl_init(); $data = array( 'status' => $status ); - if ($currentStatus == "TO SHIP" || $currentStatus == "T Ship") { + if ($currentStatus == "TO SHIP" || $currentStatus == "To Ship") { // $data['tracking_number'] = $trackingNumber; $data['tracking_number'] = $trackingNumber; $data['courier_name'] = $courierName; } + if ($currentStatus == "TO RECEIVE" || $currentStatus == "To Receive") { + // $data['tracking_number'] = $trackingNumber; + $data['payment']['status'] = $paymentStatus; + $data['payment']['reference_number'] = $paymentReference; + + } $params3 = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders/" . $orderId, diff --git a/vendor-dashboard-orders-edit-action.php b/vendor-dashboard-orders-edit-action.php index f86541a..b47079e 100644 --- a/vendor-dashboard-orders-edit-action.php +++ b/vendor-dashboard-orders-edit-action.php @@ -5,15 +5,19 @@ $orderId = $_SESSION['vendorOrderId']; $currentStatus = $_POST['order_status']; $trackingNumber = $_POST['tracking_number']; $courirerName = $_POST['courier_name']; +$paymentReference = $_POST['payment_reference']; $token = $_SESSION['token']; // $status = "TO SHIP"; if ($currentStatus === 'TO PAY' || $currentStatus === 'To Pay') { $status = 'TO SHIP'; + $paymentStatus = 'UNPAID'; } elseif ($currentStatus === 'TO SHIP' || $currentStatus === 'To Ship') { $status = 'TO RECEIVE'; + $paymentStatus = 'UNPAID'; } elseif ($currentStatus === 'TO RECEIVE' || $currentStatus === 'To Receive') { $status = 'COMPLETED'; + $paymentStatus = 'PAID'; } $response = editOrderStatus( @@ -22,6 +26,8 @@ $response = editOrderStatus( $currentStatus, $trackingNumber, $courirerName, + $paymentStatus, + $paymentReference, $token ); $array = json_decode($response,true); diff --git a/vendor-dashboard-orders-edit.php b/vendor-dashboard-orders-edit.php index 9d3a41a..06b7ac9 100644 --- a/vendor-dashboard-orders-edit.php +++ b/vendor-dashboard-orders-edit.php @@ -199,6 +199,10 @@ $array = json_decode($result, true); +
diff --git a/vendor-settings.php b/vendor-settings.php index 3758f5f..8e1f553 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -137,26 +137,42 @@ if ($_SESSION["userId"] <> "") {
+
-
+ +
- alt="vendor image"> + + alt="vendor image">
+ +
About Us
-

+ +

+ +

No description available.

+
+
Account Information
@@ -164,7 +180,7 @@ if ($_SESSION["userId"] <> "") {
E-mail address
    -
  • +
@@ -172,7 +188,7 @@ if ($_SESSION["userId"] <> "") {
Contact nubmer
    -
  • +
@@ -335,6 +351,7 @@ if ($_SESSION["userId"] <> "") { const firstName = document.getElementById('cfirstname-').value; const lastName = document.getElementById('clastname-').value; const phone = document.getElementById('cphone-').value; + const description = document.getElementById('cdescription-').value; // If no file selected, only update the email fetch(`https:///api/v1/vendors/${vendorid}`, { @@ -347,6 +364,7 @@ if ($_SESSION["userId"] <> "") { first_name: firstName, last_name: lastName, phone: phone, + vendor_description:description }) }) .then(response => { @@ -369,24 +387,22 @@ if ($_SESSION["userId"] <> "") {
@@ -854,6 +939,12 @@ if ($_SESSION["userId"] <> "") {
+ +
+ + +
+ +
@@ -311,17 +317,18 @@ if ($_SESSION["userId"] <> "") {
">
-
+ +
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dutmmy text ever since the 1500s, when an unknown printer took a galley.
+ 0) : ?> @@ -362,9 +371,22 @@ if ($_SESSION["userId"] <> "") { Inquire + +
-
+ + +
@@ -864,7 +886,7 @@ if ($_SESSION["userId"] <> "") { -
+ diff --git a/checkouttest.php b/checkouttest.php index 46c0ad0..f0ad9e4 100644 --- a/checkouttest.php +++ b/checkouttest.php @@ -605,6 +605,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"] Subtotal: + +
diff --git a/functions.php b/functions.php index ae5ff93..23f6d72 100644 --- a/functions.php +++ b/functions.php @@ -521,8 +521,9 @@ function vendorExists($email) function sendEmail_obanana($fName, $lName, $email, $phone, $message) { if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){ - $testEmail = $_SESSION["test_email_rcpt"]; + $email = $_SESSION["test_email_rcpt"]; } + $salesEmail = $_SESSION["sales_email"]; $msgto_obanana = "

Greetings from Obanana!

    @@ -541,7 +542,7 @@ function sendEmail_obanana($fName, $lName, $email, $phone, $message) ], "To" => [ [ - "Email" => $testEmail, + "Email" => $salesEmail, "Name" => "Subscriber" ] ], @@ -639,8 +640,9 @@ function sendEmail_customer($fName, $lName, $email) function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message) { if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){ - $testEmail = $_SESSION["test_email_rcpt"]; + $cstm_email = $_SESSION["test_email_rcpt"]; } + $salesEmail = $_SESSION["sales_email"]; $msgto_seller = "

    Greetings from Obanana!

      @@ -659,7 +661,7 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message) ], "To" => [ [ - "Email" => $testEmail, + "Email" => $salesEmail, "Name" => "Subscriber" ] ], @@ -697,9 +699,9 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message) function contact_Inquirer($cstm_email) { - // if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){ - // $testEmail = $_SESSION["test_email_rcpt"]; - // } + if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){ + $cstm_email = $_SESSION["test_email_rcpt"]; + } $msgto_inquirer = "

      Greetings from Obanana!

        @@ -717,8 +719,8 @@ function contact_Inquirer($cstm_email) ], "To" => [ [ - // "Email" => $cstm_email, - "Email" => "stacyjoycemapano@gmail.com", + "Email" => $cstm_email, + //"Email" => "stacyjoycemapano@gmail.com", "Name" => "Subscriber" ] diff --git a/header.php b/header.php index 71d2a17..3477429 100644 --- a/header.php +++ b/header.php @@ -977,15 +977,15 @@
      • Top Collection
      • Categories
      • -
      • Offers
      • +
      • Top Vendors
      • Services
      • New Arrivals
      • -
      • Client - Review
      • -
      • Instagram Feed
      • + +
    diff --git a/index.php b/index.php index 3a27575..4b4dd0e 100644 --- a/index.php +++ b/index.php @@ -568,6 +568,7 @@ if ($_SESSION["userId"] <> "") {
    + "> "") { + - - edit + + edit + + edit - edit - + "") { + "") { + + +
    @@ -1476,6 +1485,7 @@ if ($_SESSION["userId"] <> "") {
    -
    + +
    -
    + + +
    As low as @@ -397,32 +402,32 @@ if (isset($_GET['id'])) {
      - -
    • - product - -

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

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

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

      + +
    • +
      +
    @@ -462,35 +467,57 @@ foreach ($variation_details as $index => $variation) { - + +
    -
    -
    -
    - " id="qty-input" /> -
    +
    -
    - -
    +
    + + +
    Add To Cart'; - echo ''; - } else { - if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) { - echo '
    '; - echo ''; - } else { - echo ''; - } - } - } else { - echo '

    Please log in to add to cart.

    '; - } -?> + if ($_SESSION["isLoggedIn"]) { + if ($product_details['product_type'] === "variable") { + echo '
    -
    '; + echo ''; + echo '
    +
    '; + echo '
    '; + echo '
    + +
    '; + + } else { + if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) { + echo '
    -
    '; + echo ''; + echo '
    +
    '; + echo '
    '; + echo ''; + echo '
    + +
    '; + } else { + echo ''; + } + } + } else { + echo ''; + } + ?> + + + @@ -509,10 +536,9 @@ foreach ($variation_details as $index => $variation) { // echo '

    Please log in to add to cart.

    '; // } ?> --> +
    - - diff --git a/vendor-list.php b/vendor-list.php index fb6a8bc..3897c62 100644 --- a/vendor-list.php +++ b/vendor-list.php @@ -179,6 +179,7 @@ $products = productList();
    + vendor img( Retail Business )

    -
    +
    -
    Seller Products
    + +
    Seller Products
    +
    -
    Seller since
    + +
    Seller since
    +

    diff --git a/vendor-settings.php b/vendor-settings.php index 8e1f553..cc4246c 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -155,10 +155,11 @@ if ($_SESSION["userId"] <> "") {
    - + - alt="vendor image"> + alt="vendor image">
    diff --git a/wishlist.php b/wishlist.php index b3005f0..a1e189d 100644 --- a/wishlist.php +++ b/wishlist.php @@ -182,7 +182,8 @@ if ($_SESSION["userId"] <> "") { ">
    - + " class="image"> + " alt="Product" /> @@ -403,7 +404,8 @@ if ($_SESSION["userId"] <> "") {
    -
    + + -
    + -- 2.40.1