diff --git a/user-profile.php b/user-profile.php
index c525917..2564fc0 100644
--- a/user-profile.php
+++ b/user-profile.php
@@ -205,7 +205,7 @@ if ($_SESSION["isVendor"] == true) {
+
+ Shipping Address:
+
Name:
@@ -236,8 +239,60 @@ if ($_SESSION["isVendor"] == true) {
+
+
+ Billing Address:
+
+
+ Name:
+
+
+
+
+
+ Contact #:
+
+
+ Address:
+
+
+
+
+
+
+
+
+
+
@@ -264,16 +319,16 @@ if ($_SESSION["isVendor"] == true) {
@@ -1085,6 +1140,27 @@ if ($_SESSION["isVendor"] == true) {
if (!updateResponse.ok) {
throw new Error(`Failed to update address: ${updateResponse.status}`);
}
+
+ const selectedBillingElement = document.getElementById('selectedBillingFName');
+ const selectedBillingLNameElement = document.getElementById('selectedBillingLName');
+ const selectedBillingContactElement = document.getElementById('selectedBillingContact');
+ const sBillingBuildingElement = document.getElementById('sBillingBuilding');
+ const sBillingStreetElement = document.getElementById('sBillingStreet');
+ const sBillingBarangayElement = document.getElementById('sBillingBarangay');
+ const sBillingCityElement = document.getElementById('sBillingCity');
+ const sBillingProvinceElement = document.getElementById('sBillingProvince');
+ const sBillingCountryElement = document.getElementById('sBillingCountry');
+ if (selectedBillingElement) {
+ selectedBillingElement.textContent = customerData.address[addressIndex].first_name;
+ selectedBillingLNameElement.textContent = customerData.address[addressIndex].last_name;
+ selectedBillingContactElement.textContent = 'Contact #: ' + customerData.address[addressIndex].phone;
+ sBillingBuildingElement.textContent = customerData.address[addressIndex].address_1;
+ sBillingStreetElement.textContent = customerData.address[addressIndex].address_2;
+ sBillingBarangayElement.textContent = customerData.address[addressIndex].barangay;
+ sBillingCityElement.textContent = customerData.address[addressIndex].city;
+ sBillingProvinceElement.textContent = customerData.address[addressIndex].province;
+ sBillingCountryElement.textContent = customerData.address[addressIndex].country;
+ }
console.log(`Address updated successfully for customer ${customerId}`);
} catch (error) {
console.error('Error updating address:', error.message);
@@ -1162,8 +1238,8 @@ if ($_SESSION["isVendor"] == true) {
sCountryElement.textContent = customerData.address[addressIndex].country;
}
console.log(`Address updated successfully for customer ${customerId}`);
- location.reload();
- header("location: user-profile.php");
+ // location.reload();
+ // header("location: user-profile.php");
} catch (error) {
console.error('Error updating address:', error.message);
}
diff --git a/vendor-settings.php b/vendor-settings.php
index 912331c..308b6d0 100644
--- a/vendor-settings.php
+++ b/vendor-settings.php
@@ -265,10 +265,6 @@ if ($_SESSION["isCustomer"] == true) {
-
-
-