Compare commits
No commits in common. "1572bac6dec435bf89a3ce338b9dcc9b3da91add" and "b0d8cb1bd1797b40e008b1ec60d8a76d801bc76a" have entirely different histories.
1572bac6de
...
b0d8cb1bd1
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["test_email_rcpt"]="stacyjoycemapano@gmail.com";
|
||||
$_SESSION["sales_email"]="stacyjoycemapano@gmail.com";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
if ($_SESSION["is_test"]){
|
||||
|
|
|
@ -81,7 +81,7 @@ if ($_SESSION["isLoggedIn"] == true and $_SESSION["user_type"] == "admin"){
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<form action="../login_action.php" method="post">
|
||||
<form action="/login_action.php" method="post">
|
||||
<div class="mb-3 mt-3">
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" class="form-control" id="email" placeholder="Enter email" name="name">
|
||||
|
|
|
@ -852,212 +852,168 @@ $products = productList();
|
|||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function deleteVendor(vendorId){
|
||||
function deleteVendor(vendorId){
|
||||
let text = "Please confirm delete action!\nClick OK or Cancel button.";
|
||||
if (confirm(text) == true) {
|
||||
window.open("vendor-delete-action.php?id=" + vendorId, "_self");
|
||||
}
|
||||
}
|
||||
function uploadFile(vendorId) {
|
||||
const originalEmail = document.getElementById('email-' + vendorId).defaultValue;
|
||||
const updatedEmail = document.getElementById('email-' + vendorId).value;
|
||||
const isEmailModified = originalEmail !== updatedEmail;
|
||||
validateEmail(vendorId).then(isEmailAvailable => {
|
||||
if (!isEmailAvailable) {
|
||||
// Display an error message and prevent form submission
|
||||
$('#email-error-message-' + vendorId).text('Email is already in use').show();
|
||||
} else {
|
||||
// Proceed with form submission
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
|
||||
if (isEmailModified) {
|
||||
validateEmail(vendorId).then(isEmailAvailable => {
|
||||
if (!isEmailAvailable) {
|
||||
$('#email-error-message-' + vendorId).text('Email is already in use').show();
|
||||
} else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
// Rest of the code for file upload and API request
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
const updatedUser = document.getElementById('user_login-' + vendorId).value;
|
||||
const firstName = document.getElementById('firstName-' + vendorId).value;
|
||||
const lastName = document.getElementById('lastName-' + vendorId).value;
|
||||
const updatedEmail = document.getElementById('email-' + vendorId).value;
|
||||
const phone = document.getElementById('phone-' + vendorId).value;
|
||||
const description = document.getElementById('description-' + vendorId).value;
|
||||
const status = document.getElementById('status-' + vendorId).value;
|
||||
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
|
||||
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
|
||||
const barangay = document.getElementById('barangay-' + vendorId).value;
|
||||
const city = document.getElementById('city-' + vendorId).value;
|
||||
const province = document.getElementById('province-' + vendorId).value;
|
||||
const country = document.getElementById('country-' + vendorId).value;
|
||||
|
||||
const updatedUser = document.getElementById('user_login-' + vendorId).value;
|
||||
const firstName = document.getElementById('firstName-' + vendorId).value;
|
||||
const lastName = document.getElementById('lastName-' + vendorId).value;
|
||||
const phone = document.getElementById('phone-' + vendorId).value;
|
||||
const description = document.getElementById('description-' + vendorId).value;
|
||||
const status = document.getElementById('status-' + vendorId).value;
|
||||
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
|
||||
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
|
||||
const barangay = document.getElementById('barangay-' + vendorId).value;
|
||||
const city = document.getElementById('city-' + vendorId).value;
|
||||
const province = document.getElementById('province-' + vendorId).value;
|
||||
const country = document.getElementById('country-' + vendorId).value;
|
||||
// Check if a file is selected for upload
|
||||
if (file) {
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorId);
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorId);
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', file); // Include the file data in the form data
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
user_email: updatedEmail,
|
||||
phone: phone,
|
||||
vendor_description: description,
|
||||
status: status,
|
||||
address: [{
|
||||
address_1: updatedAddress1,
|
||||
address_2: updatedAddress2,
|
||||
barangay: barangay,
|
||||
city: city,
|
||||
province: province,
|
||||
country: country,
|
||||
}]
|
||||
};
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
user_email: updatedEmail,
|
||||
phone: phone,
|
||||
vendor_description: description,
|
||||
status: status,
|
||||
address: [{
|
||||
address_1: updatedAddress1,
|
||||
address_2: updatedAddress2,
|
||||
barangay: barangay,
|
||||
city: city,
|
||||
province: province,
|
||||
country: country,
|
||||
}]
|
||||
};
|
||||
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
});
|
||||
}else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
|
||||
const updatedUser = document.getElementById('user_login-' + vendorId).value;
|
||||
const firstName = document.getElementById('firstName-' + vendorId).value;
|
||||
const lastName = document.getElementById('lastName-' + vendorId).value;
|
||||
const updatedEmail = document.getElementById('email-' + vendorId).value;
|
||||
const phone = document.getElementById('phone-' + vendorId).value;
|
||||
const description = document.getElementById('description-' + vendorId).value;
|
||||
const status = document.getElementById('status-' + vendorId).value;
|
||||
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
|
||||
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
|
||||
const barangay = document.getElementById('barangay-' + vendorId).value;
|
||||
const city = document.getElementById('city-' + vendorId).value;
|
||||
const province = document.getElementById('province-' + vendorId).value;
|
||||
const country = document.getElementById('country-' + vendorId).value;
|
||||
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorId);
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
user_email: updatedEmail,
|
||||
phone: phone,
|
||||
vendor_description: description,
|
||||
status: status,
|
||||
address: [{
|
||||
address_1: updatedAddress1,
|
||||
address_2: updatedAddress2,
|
||||
barangay: barangay,
|
||||
city: city,
|
||||
province: province,
|
||||
country: country,
|
||||
}]
|
||||
};
|
||||
|
||||
// Make API request using the extracted filename
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function validateEmail(vendorId) {
|
||||
var emailInput = document.getElementById('email-' + vendorId);
|
||||
var email = emailInput.value;
|
||||
|
||||
if (email.trim() !== '') {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Failed to check email availability');
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
const isEmailAvailable = parseInt(data.results.length) === 0;
|
||||
$('#email-error-message-' + vendorId).text(isEmailAvailable ? '' : 'Email is already in use').show();
|
||||
return isEmailAvailable;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during email validation:', error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
}
|
||||
// Make another API request using the extracted filename
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
} else {
|
||||
// If no file selected, only update the email
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
user_email: updatedEmail,
|
||||
vendor_description: description,
|
||||
status: status,
|
||||
phone: phone,
|
||||
address: [{
|
||||
address_1: updatedAddress1,
|
||||
address_2: updatedAddress2,
|
||||
barangay: barangay,
|
||||
city: city,
|
||||
province: province,
|
||||
country: country,
|
||||
}]
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Email update successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Email update failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function validateEmail(vendorId) {
|
||||
var emailInput = document.getElementById('email-' + vendorId);
|
||||
var email = emailInput.value;
|
||||
|
||||
if (email.trim() !== '') {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Failed to check email availability');
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
const isEmailAvailable = parseInt(data.results.length) === 0;
|
||||
$('#email-error-message-' + vendorId).text(isEmailAvailable ? '' : 'Email is already in use').show();
|
||||
return isEmailAvailable;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during email validation:', error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
|
|
|
@ -35085,7 +35085,7 @@ input[type=email]:focus::-webkit-input-placeholder {
|
|||
.ec-vendor-profile-card .ec-vendor-block-profile .ec-vendor-block-img .ec-vendor-block-bg {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background-image:none;
|
||||
background-image: url(../images/banner/7.jpg);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
|
|
@ -217,15 +217,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-page-description ec-page-description-info">
|
||||
<div class="ec-page-block">
|
||||
<div class="ec-catalog-vendor">
|
||||
<a href="vendor-profile.html">
|
||||
<?php
|
||||
<?php
|
||||
if (isset($vendor["vendor_image"])) {
|
||||
?><img src="<?php echo $vendor["vendor_image"] ?>" alt="vendor img"><?php
|
||||
} else {
|
||||
?><img src="assets/images/vendor/5.jpg" alt="vendor img"><?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
?><img src="<?php echo $vendor["vendor_image"] ?>" alt="vendor img"><?php
|
||||
} else {
|
||||
?><img src="assets/images/vendor/5.jpg" alt="vendor img"><?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ec-catalog-vendor-info row">
|
||||
|
@ -235,25 +234,20 @@ if ($_SESSION["userId"] <> "") {
|
|||
</a>
|
||||
<p>( Retail Business )</p>
|
||||
</div>
|
||||
<!-- raymart remove level feb 22 2024 -->
|
||||
<!-- <div class="col-lg-3 col-md-6 ec-catalog-ratings pad-15">
|
||||
<div class="col-lg-3 col-md-6 ec-catalog-ratings pad-15">
|
||||
<h6>Level</h6>
|
||||
<p>Level : 9 out of 10</p>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 ec-catalog-pro-count pad-15">
|
||||
<a href="vendor-profile.html">
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
$products = productListVendor($_GET["id"]);
|
||||
?>
|
||||
</a>
|
||||
<p><?php echo count($products) ?> Products</p>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 ec-catalog-since pad-15">
|
||||
<a href="vendor-profile.html">
|
||||
<h6>Seller since</h6>
|
||||
<p><?php echo $vendor["date_registered"] ?></p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -317,18 +311,17 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<!-- raymart added for link for product feb 22 2024 -->
|
||||
<a class="image" href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>"<?php echo $product["product_image"] ?>>
|
||||
<?php
|
||||
<a href="shop-left-sidebar-col-4.php" class="image">
|
||||
<?php
|
||||
if (isset($product["product_image"]) && $product["product_image"] <> "") {
|
||||
?>
|
||||
<img class="main-image" src="<?php echo $product["product_image"] ?>" alt="Product" />
|
||||
<!-- <img class="hover-image" src="<?php echo $product["product_image"] ?>" alt="Product" /> -->
|
||||
<img class="hover-image" src="<?php echo $product["product_image"] ?>" alt="Product" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<img class="main-image" src="assets/images/product-image/6_1.jpg" alt="Product" />
|
||||
<!-- <img class="hover-image" src="assets/images/product-image/6_2.jpg" alt="Product" /> -->
|
||||
<img class="hover-image" src="assets/images/product-image/6_2.jpg" alt="Product" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -349,17 +342,15 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<div class="ec-pro-content">
|
||||
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>"><?php echo $product["product_name"] ?></a></h5>
|
||||
<!-- raymart remove ratings feb 22 2024 -->
|
||||
<!-- <div class="ec-pro-rating">
|
||||
<div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star"></i>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="ec-pro-list-desc">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.</div>
|
||||
<span class="ec-price">
|
||||
<!-- raymart added $ to pesos function feb 22 2024 -->
|
||||
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
|
||||
<span class="old-price">₱<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
|
||||
<span class="new-price">₱<?php echo number_format($product["sale_price"], 2, ".", ",") ?></span>
|
||||
|
@ -371,22 +362,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php else : ?>
|
||||
<span class="inquire-text">Inquire</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- <?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
|
||||
<span class="old-price">₱<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
|
||||
<span class="new-price">₱<?php echo number_format($product["sale_price"], 2, ".", ",") ?></span>
|
||||
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
|
||||
<span class="new-price">₱<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
|
||||
|
||||
<?php elseif ($product["regular_price"] == "" || $product["regular_price"] == null) : ?>
|
||||
<span class="inquire-text">Inquire</span>
|
||||
<?php else : ?>
|
||||
<span class="inquire-text">Inquire</span>
|
||||
<?php endif; ?> -->
|
||||
</span>
|
||||
<div class="ec-pro-option">
|
||||
<!-- raymart remove color and size function feb 22 2024 -->
|
||||
<!-- <div class="ec-pro-color">
|
||||
<div class="ec-pro-color">
|
||||
<span class="ec-pro-opt-label">Color</span>
|
||||
<ul class="ec-opt-swatch ec-change-img">
|
||||
<?php
|
||||
|
@ -403,8 +381,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</ul>
|
||||
</div> -->
|
||||
<!-- <div class="ec-pro-size">
|
||||
</div>
|
||||
<div class="ec-pro-size">
|
||||
<span class="ec-pro-opt-label">Size</span>
|
||||
<ul class="ec-opt-size">
|
||||
<li class="active"><a href="#" class="ec-opt-sz" data-old="$25.00" data-new="$20.00" data-tooltip="Small">S</a></li>
|
||||
|
@ -412,7 +390,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<li><a href="#" class="ec-opt-sz" data-old="$30.00" data-new="$25.00" data-tooltip="Large">X</a></li>
|
||||
<li><a href="#" class="ec-opt-sz" data-old="$35.00" data-new="$30.00" data-tooltip="Extra Large">XL</a></li>
|
||||
</ul>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -886,7 +864,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- Recent Purchase Popup -->
|
||||
<!-- <div class="recent-purchase">
|
||||
<div class="recent-purchase">
|
||||
<img src="assets/images/product-image/1.jpg" alt="payment image">
|
||||
<div class="detail">
|
||||
<p>Someone in new just bought</p>
|
||||
|
@ -894,7 +872,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<p>10 Minutes ago</p>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- Recent Purchase Popup end -->
|
||||
|
||||
<!-- Cart Floating Button -->
|
||||
|
|
|
@ -605,8 +605,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
<span class="ec-price">
|
||||
<span class="new-price">Subtotal: <?php echo $checkout['shipping_fee'] + $checkout['total_amount']; ?></span>
|
||||
</span>
|
||||
<!-- 02-22-2024 Stacy hide variation -->
|
||||
<!-- <div class="ec-pro-option">
|
||||
<div class="ec-pro-option">
|
||||
<div class="ec-pro-color">
|
||||
<span class="ec-pro-opt-label">Color</span>
|
||||
<ul class="ec-opt-swatch ec-change-img">
|
||||
|
@ -630,8 +629,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- 02-22-2024 Stacy hide variation -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
|
@ -521,9 +521,8 @@ function vendorExists($email)
|
|||
function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$salesEmail = $_SESSION["sales_email"];
|
||||
$msgto_obanana = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
|
@ -542,7 +541,7 @@ function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
|||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $salesEmail,
|
||||
"Email" => $testEmail,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
|
@ -640,9 +639,8 @@ 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"]!=""){
|
||||
$cstm_email = $_SESSION["test_email_rcpt"];
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$salesEmail = $_SESSION["sales_email"];
|
||||
$msgto_seller = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
|
@ -661,7 +659,7 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
|||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $salesEmail,
|
||||
"Email" => $testEmail,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
|
@ -699,9 +697,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"]!=""){
|
||||
$cstm_email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
// if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
// $testEmail = $_SESSION["test_email_rcpt"];
|
||||
// }
|
||||
$msgto_inquirer = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
|
@ -719,8 +717,8 @@ function contact_Inquirer($cstm_email)
|
|||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $cstm_email,
|
||||
//"Email" => "stacyjoycemapano@gmail.com",
|
||||
// "Email" => $cstm_email,
|
||||
"Email" => "stacyjoycemapano@gmail.com",
|
||||
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
|
@ -1384,23 +1382,17 @@ function getOrderbyVendorId($id)
|
|||
return $response;
|
||||
}
|
||||
|
||||
function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $paymentStatus, $paymentReference, $token)
|
||||
function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $token)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$data = array(
|
||||
'status' => $status
|
||||
);
|
||||
if ($currentStatus == "TO SHIP" || $currentStatus == "To Ship") {
|
||||
if ($currentStatus == "TO SHIP" || $currentStatus == "T 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,
|
||||
|
|
|
@ -977,15 +977,15 @@
|
|||
<li><a href="javascript:void(0)" data-scroll="collection" class="nav-scroll">Top
|
||||
Collection</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="categories" class="nav-scroll">Categories</a></li>
|
||||
<!-- <li><a href="javascript:void(0)" data-scroll="offers" class="nav-scroll">Offers</a></li> -->
|
||||
<li><a href="javascript:void(0)" data-scroll="offers" class="nav-scroll">Offers</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="vendors" class="nav-scroll">Top
|
||||
Vendors</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="services" class="nav-scroll">Services</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="arrivals" class="nav-scroll">New
|
||||
Arrivals</a></li>
|
||||
<!-- <li><a href="javascript:void(0)" data-scroll="reviews" class="nav-scroll">Client
|
||||
Review</a></li> -->
|
||||
<!-- <li><a href="javascript:void(0)" data-scroll="insta" class="nav-scroll">Instagram Feed</a></li> -->
|
||||
<li><a href="javascript:void(0)" data-scroll="reviews" class="nav-scroll">Client
|
||||
Review</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="insta" class="nav-scroll">Instagram Feed</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
43
index.php
43
index.php
|
@ -568,7 +568,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $forAll[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
<?php
|
||||
if (isset($forAll[$pid]['images'])) {
|
||||
|
@ -585,7 +584,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<!-- <a href="product-left-sidebar.php?id=<?php echo $forAll[$pid]["_id"]; ?>" class="image">
|
||||
<img class="main-image" src="<?php echo $forAll[$pid]["product_image"] ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $forAll[$pid]["product_image"] ?>" alt="Product" />
|
||||
|
@ -671,24 +669,22 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $electronics[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
<?php
|
||||
if (isset($electronics[$pid]['images'])) {
|
||||
$image_urls = explode(',', $electronics[$pid]['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="hover-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
if (isset($electronics[$pid]['images'])) {
|
||||
$image_urls = explode(',', $electronics[$pid]['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
</a>
|
||||
<img class="hover-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- <a href="product-left-sidebar.php?id=<?php echo $electronics[$pid]["_id"]; ?>" class="image">
|
||||
<img class="main-image" src="<?php echo $electronics[$pid]["product_image"] ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $electronics[$pid]["product_image"] ?>" alt="Product" />
|
||||
|
@ -776,7 +772,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $smartHome[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
<?php
|
||||
if (isset($smartHome[$pid]['images'])) {
|
||||
|
@ -793,7 +788,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<!-- <a href="product-left-sidebar.php?id=<?php echo $smartHome[$pid]["_id"]; ?>" class="image">
|
||||
<img class="main-image" src="<?php echo $smartHome[$pid]["product_image"] ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $smartHome[$pid]["product_image"] ?>" alt="Product" />
|
||||
|
@ -879,7 +873,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $forVehicle[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
<?php
|
||||
if (isset($forVehicle[$pid]['images'])) {
|
||||
|
@ -896,7 +889,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<!-- <a href="product-left-sidebar.php?id=<?php echo $forVehicle[$pid]["_id"]; ?>" class="image">
|
||||
<img class="main-image" src="<?php echo $forVehicle[$pid]["product_image"] ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $forVehicle[$pid]["product_image"] ?>" alt="Product" />
|
||||
|
@ -1332,17 +1324,16 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-info">
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>" class="name"><?php echo $vendor['user_login'] ?></a>
|
||||
<p class="prod-count"><?php echo count($vendorProducts) ?> Products</p>
|
||||
<!-- raymart remove ratings and sales feb 22 2024 -->
|
||||
<!-- <div class="ec-pro-rating">
|
||||
<div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star"></i>
|
||||
</div> -->
|
||||
<!-- <div class="ec-sale">
|
||||
</div>
|
||||
<div class="ec-sale">
|
||||
<p title="Weekly sales">Sales 954</p>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-prod">
|
||||
|
@ -1485,7 +1476,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $newArrival[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
<?php
|
||||
if (isset($newArrival[$pid]['images'])) {
|
||||
|
@ -1502,7 +1492,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<!-- <a href="product-left-sidebar.php?id=<?php echo $newArrival[$pid]["_id"]; ?>" class="image">
|
||||
<img class="main-image" src="<?php echo $newArrival[$pid]["product_image"] ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $newArrival[$pid]["product_image"] ?>" alt="Product" />
|
||||
|
|
|
@ -320,9 +320,7 @@ if (isset($_GET['id'])) {
|
|||
$productImage = $i;
|
||||
}
|
||||
?>
|
||||
<!-- <img class="img-responsive" src="<?php #echo $productImage; ?>" alt="" style="width: 100%; height: 100%; object-fit: cover; object-position: center center;"> -->
|
||||
<!-- 02-26-2024 Stacy updated img width & height -->
|
||||
<img class="img-responsive" src="<?php echo $productImage; ?>" alt="" style="max/width: 90px; height: 120px; object-fit: cover; object-position: center center;">
|
||||
<img class="img-responsive" src="<?php echo $productImage; ?>" alt="" style="width: 100%; height: 100%; object-fit: cover; object-position: center center;">
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
@ -338,8 +336,7 @@ if (isset($_GET['id'])) {
|
|||
<h5 class="ec-single-title" id="productTitle"><?php echo $product_details['product_name']; ?></h5>
|
||||
<!-- <h5 class="ec-single-title" id="productTitlemodal"><?php echo $product_details['product_name']; ?></h5> -->
|
||||
|
||||
<!-- 02-22-2024 Stacy hide -->
|
||||
<!-- <div class="ec-single-rating-wrap">
|
||||
<div class="ec-single-rating-wrap">
|
||||
<div class="ec-single-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
|
@ -349,11 +346,10 @@ if (isset($_GET['id'])) {
|
|||
</div>
|
||||
<span class="ec-read-review"><a href="#ec-spt-nav-review">Be the first to
|
||||
review this product</a></span>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="ec-single-desc" id="shortDescription"><?php echo $product_details['product_description']; ?></div>
|
||||
|
||||
<!-- 02-22-2024 Stacy hide -->
|
||||
<!-- <div class="ec-single-sales">
|
||||
<div class="ec-single-sales">
|
||||
<div class="ec-single-sales-inner">
|
||||
<div class="ec-single-sales-title">sales accelerators</div>
|
||||
<div class="ec-single-sales-visitor">real time <span>24</span> visitor
|
||||
|
@ -368,8 +364,7 @@ if (isset($_GET['id'])) {
|
|||
<div class="ec-single-count-desc">Time is Running Out!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<div class="ec-single-price-stoke">
|
||||
<div class="ec-single-price">
|
||||
<span class="ec-single-ps-title">As low as</span>
|
||||
|
@ -402,32 +397,32 @@ if (isset($_GET['id'])) {
|
|||
<div class="ec-pro-variation-content">
|
||||
<ul class="eccart-pro-items">
|
||||
<?php
|
||||
$main_product_image = isset($product_details["product_image"]) ? $product_details["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($product_details), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $main_product_image; ?>" alt="product">
|
||||
<?php foreach ($product_details['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
$main_product_image = isset($product_details["product_image"]) ? $product_details["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($product_details), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $main_product_image; ?>" alt="product">
|
||||
<?php foreach ($product_details['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
foreach ($variation_details as $index => $variation) {
|
||||
$variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($variation), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $variationImage; ?>" alt="product">
|
||||
<?php foreach ($variation['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
foreach ($variation_details as $index => $variation) {
|
||||
$variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($variation), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $variationImage; ?>" alt="product">
|
||||
<?php foreach ($variation['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -467,57 +462,35 @@ if (isset($_GET['id'])) {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- 20240212 Jun Jihad Include Parent Product in the Variation Selection -->
|
||||
<!-- 20240212 Jun Jihad Include Parent Product in the Variation Selection -->
|
||||
|
||||
<!-- 02-22-2024 Stacy modified this block of code -->
|
||||
<div class="ec-single-qty">
|
||||
|
||||
<div class="qty-plus-minuses" style="display:flex; overflow:visible;">
|
||||
<!-- <div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()">-</div>
|
||||
<input class="qty-inputs" style="width:100px; height:40px" type="number" name="ec_qtybtn" value="<?php #echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" />
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div> -->
|
||||
|
||||
<div class="ec-single-cart" style="display:flex; flex-direction:row; width:80%; overflow:visible; text-align:center; align-items:center; ">
|
||||
<div class="qty-plus-minuses">
|
||||
<div class="qty-btn" onclick="decrement()">-</div>
|
||||
<input class="qty-inputs" type="number" name="ec_qtybtn" value="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" />
|
||||
<div class="qty-btn" onclick="increment()">+</div>
|
||||
</div>
|
||||
|
||||
<div class="ec-single-cart">
|
||||
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
|
||||
<?php
|
||||
if ($_SESSION["isLoggedIn"]) {
|
||||
if ($product_details['product_type'] === "variable") {
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()">-</div>';
|
||||
echo '<input class="qty-inputs" style="width:110px; height:40px" type="number" name="ec_qtybtn" value="';
|
||||
echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1";
|
||||
echo '" id="qty-input" />';
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div>';
|
||||
echo '<div style="display:flex; margin-left:45px;"><button type="button" class="btn btn-primary" id="contactSellerButton" style="background:#ffaa00; width:190px;" data-bs-toggle="modal" data-bs-target="#priceModal"><i class="fi-rr-envelope" style="font-size:20px; margin-bottom:-3px; margin-right:10px;"></i>Contact Seller</button>';
|
||||
echo '<div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart" style="color:#B80F0A; font-size:20px;"></i></a>
|
||||
</div></div>';
|
||||
|
||||
} else {
|
||||
if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) {
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()">-</div>';
|
||||
echo '<input class="qty-inputs" style="width:100px; height:40px" type="number" name="ec_qtybtn" value="';
|
||||
echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1";
|
||||
echo '" id="qty-input" />';
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div>';
|
||||
echo '<div id="addToCartMessage"></div>';
|
||||
echo '<button class="btn btn-primary" id="addToCartButton" style="background:#ffaa00; margin-left:55px;"><i class="fi-rr-shopping-bag" style="font-size:20px; margin-bottom:-3px; margin-right:10px;"></i>Add To Cart</button>';
|
||||
echo '<div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart" style="color:#B80F0A; font-size:20px;"></i></a>
|
||||
</div>';
|
||||
} else {
|
||||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<div class="login-button" style=""><p style="color:red; text-wrap:nowrap;">Please log in to your account.</p>';
|
||||
echo '<a href="login.php" style="margin-left:-2px;"><button type="button" class="btn btn-primary" style="margin-left:-2px; margin-top:-20px; background:#ffaa00; border-radius:10px; letter-spacing:1px;" data-bs-toggle="modal">LOGIN</button></a></div>';
|
||||
}
|
||||
?>
|
||||
<!-- <div class="ec-single-wishlist" style="border: 1px solid yellow;">
|
||||
<a class="ec-btn-group wishlist" style="padding-left:40px;" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart"></i></a>
|
||||
</div> -->
|
||||
<!-- 02-22-2024 Stacy modified this block of code -->
|
||||
|
||||
if ($_SESSION["isLoggedIn"]) {
|
||||
if ($product_details['product_type'] === "variable") {
|
||||
echo '<button class="btn btn-primary" id="addToCartButton" style="display:none">Add To Cart</button>';
|
||||
echo '<button type="button" class="btn btn-primary" id="contactSellerButton" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
} else {
|
||||
if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) {
|
||||
echo '<div id="addToCartMessage"></div>';
|
||||
echo '<button class="btn btn-primary" id="addToCartButton">Add To Cart</button>';
|
||||
} else {
|
||||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<p>Please log in to add to cart.</p>';
|
||||
}
|
||||
?>
|
||||
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
|
||||
|
||||
|
||||
|
@ -536,9 +509,10 @@ if (isset($_GET['id'])) {
|
|||
// echo '<p>Please log in to add to cart.</p>';
|
||||
// }
|
||||
?> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="priceModal" tabindex="-1" role="dialog" aria-labelledby="priceModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
|
@ -610,10 +584,9 @@ if (isset($_GET['id'])) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="ec-single-wishlist">
|
||||
<div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart"></i></a>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<!-- <div class="ec-single-quickview">
|
||||
<a href="#" class="ec-btn-group quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
|
||||
</div> -->
|
||||
|
|
|
@ -5,19 +5,15 @@ $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(
|
||||
|
@ -26,8 +22,6 @@ $response = editOrderStatus(
|
|||
$currentStatus,
|
||||
$trackingNumber,
|
||||
$courirerName,
|
||||
$paymentStatus,
|
||||
$paymentReference,
|
||||
$token
|
||||
);
|
||||
$array = json_decode($response,true);
|
||||
|
|
|
@ -199,10 +199,6 @@ $array = json_decode($result, true);
|
|||
<label for="inputEmail4" class="form-label">Payment Status</label>
|
||||
<input type="text" class="form-control slug-title" value="<?php echo $array['payment']['status'] ?>" readonly>
|
||||
</div>
|
||||
<div class="col-md-6" style="display:none;">
|
||||
<label for="inputEmail4" class="form-label">Payment Reference</label>
|
||||
<input type="text" name="payment_reference" class="form-control slug-title" value="<?php echo htmlspecialchars($array['payment']['reference_number']); ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="inputEmail4" class="form-label">Status</label>
|
||||
<input type="text" class="form-control slug-title" name="order_status" value="<?php echo $array['status'] ?>" readonly>
|
||||
|
|
|
@ -122,7 +122,7 @@ if (is_array($vendorOrderss)) {
|
|||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<div class="ec-vendor-block-bg" style="background-color:orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<div class="ec-vendor-block-detail">
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
|
@ -160,8 +160,7 @@ if (is_array($vendorOrderss)) {
|
|||
<h3> <?php echo count($vendorOrders); ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 02-26-2024 Stacy commented out -->
|
||||
<!-- <div class="col-lg-3 col-md-6">
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="ec-vendor-dashboard-sort-card color-green">
|
||||
<h5>Earnings</h5>
|
||||
<h3>$56<span>/ Day</span></h3>
|
||||
|
@ -172,7 +171,7 @@ if (is_array($vendorOrderss)) {
|
|||
<h5>Sales</h5>
|
||||
<h3>550<span>/ Mo</span></h3>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-dashboard-card space-bottom-30">
|
||||
<div class="ec-vendor-card-header">
|
||||
|
@ -427,8 +426,7 @@ if (is_array($vendorOrderss)) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 02-26-2024 Stacy commented out -->
|
||||
<!-- <div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-card-header">
|
||||
<h5>Growth statastics</h5>
|
||||
<div class="ec-header-btn">
|
||||
|
@ -438,7 +436,7 @@ if (is_array($vendorOrderss)) {
|
|||
<div class="ec-vendor-card-body">
|
||||
<canvas id="growthChart"></canvas>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -179,7 +179,6 @@ $products = productList();
|
|||
<div class="ec-multi-vendor-detail">
|
||||
<div class="ec-page-description ec-page-description-info description-info-list">
|
||||
<div class="ec-catalog-vendor">
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>"></a>
|
||||
<?php
|
||||
if(!isset($vendor['vendor_image'])){
|
||||
?><img src="assets/images/vendor/1.jpg" alt="vendor img"><?php
|
||||
|
@ -199,19 +198,15 @@ $products = productList();
|
|||
<p>( Retail Business )</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-lg-3 col-md-6 detail-card-space">
|
||||
<div class="col-lg-3 col-md-6 detail-card-space">
|
||||
<div class="ec-catalog-ratings catalog-detail-card">
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
|
||||
<h6>Level</h6>
|
||||
</a>
|
||||
<h6>Level</h6>
|
||||
<p>( Level : 9 out of 10 )</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 detail-card-space">
|
||||
<div class="ec-catalog-pro-count catalog-detail-card">
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
|
||||
<h6>Seller Products</h6>
|
||||
</a>
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
$vendorId = $vendor['_id'];
|
||||
$product = array_filter($products, function ($var) use ($vendorId) {
|
||||
|
@ -222,9 +217,7 @@ $products = productList();
|
|||
</div>
|
||||
<div class="col-lg-3 col-md-6 detail-card-space">
|
||||
<div class="ec-catalog-since catalog-detail-card">
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
|
||||
<h6>Seller since</h6>
|
||||
</a>
|
||||
<h6>Seller since</h6>
|
||||
<p><?php echo $vendor['date_registered']; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -137,43 +137,26 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-dashboard-card ec-vendor-setting-card">
|
||||
<div class="ec-vendor-card-body">
|
||||
<?php
|
||||
|
||||
// var_dump($vendor);
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="ec-vendor-block-profile">
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Header Paceholder -->
|
||||
<div class="ec-vendor-block-img space-bottom-30 ">
|
||||
<?php
|
||||
if (!isset($vendorData['vendor_banner']) || empty($vendorData['vendor_banner'])) {
|
||||
$banner_style = 'background-color: orange !important; background-image: none !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; border-radius: 5px !important;';
|
||||
} else {
|
||||
$banner_style = 'background-image: url(' . $vendorData['vendor_banner'] . ') !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; background-blend-mode: overlay !important; background-color: rgba(0, 0, 0, 0.6) !important; border-radius: 5px !important;';
|
||||
}
|
||||
?>
|
||||
<div class="ec-vendor-block-bg" style="<?php echo $banner_style; ?>">
|
||||
<div class="ec-vendor-block-bg profBg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;" id="myElement">
|
||||
<a href="#" class="btn btn-lg btn-primary" data-link-action="editmodal" title="Edit Detail" data-bs-toggle="modal" data-bs-target="#edit_modal">Edit Detail</a>
|
||||
</div>
|
||||
|
||||
<div class="ec-vendor-block-detail">
|
||||
<!-- 02-26-2024 Stacy added placeholder-->
|
||||
<?php
|
||||
$vendor_image = isset($vendorData[0]['vendor_image']) ? $vendorData[0]['vendor_image'] : 'https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg';
|
||||
?>
|
||||
<img class="v-img" src=<?php echo $vendor_image ?> alt="vendor image">
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Header Paceholder -->
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Description -->
|
||||
<div class="ec-vendor-block-about space-bottom-30">
|
||||
<h5>About Us</h5>
|
||||
<?php if (!empty($vendorData['vendor_description'])): ?>
|
||||
<p><?php echo $vendorData['vendor_description']; ?></p>
|
||||
<?php else: ?>
|
||||
<p>No description available.</p>
|
||||
<?php endif; ?>
|
||||
<p><?php echo $vendorData["vendor_description"] ?></p>
|
||||
</div>
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Description -->
|
||||
<h5>Account Information</h5>
|
||||
|
||||
<div class="row">
|
||||
|
@ -181,7 +164,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-detail-block ec-vendor-block-email space-bottom-30">
|
||||
<h6>E-mail address </h6>
|
||||
<ul>
|
||||
<li style="padding:3%"><strong><?php echo $vendorData["user_email"] ?></strong></li>
|
||||
<li><strong><?php echo $vendorData["user_email"] ?></strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -189,7 +172,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-detail-block ec-vendor-block-contact space-bottom-30">
|
||||
<h6>Contact nubmer</h6>
|
||||
<ul>
|
||||
<li style="padding:3%"><strong><?php echo $vendorData["phone"] ?></strong></li>
|
||||
<li><strong><?php echo $vendorData["phone"] ?></strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -352,7 +335,6 @@ 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://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`, {
|
||||
|
@ -365,7 +347,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
phone: phone,
|
||||
vendor_description:description
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
|
@ -388,22 +369,24 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script>
|
||||
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const provinceSelect = $('#provinceSelect');
|
||||
const citySelect = $('#citySelect');
|
||||
const barangaySelect = $('#barangaySelect');
|
||||
// Get the select elements
|
||||
const provinceSelect = $('#provinceSelect'); // Use jQuery to select the element
|
||||
const citySelect = $('#citySelect'); // Use jQuery to select the element
|
||||
const barangaySelect = $('#barangaySelect'); // Use jQuery to select the element
|
||||
|
||||
// Initialize Select2 on the provinceSelect, citySelect, and barangaySelect elements
|
||||
provinceSelect.select2({
|
||||
dropdownParent: $('#secondModal'),
|
||||
containerCssClass: 'select2-zindex-high'
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
|
||||
citySelect.select2({
|
||||
dropdownParent: $('#secondModal'),
|
||||
containerCssClass: 'select2-zindex-high'
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
barangaySelect.select2({
|
||||
dropdownParent: $('#secondModal'),
|
||||
containerCssClass: 'select2-zindex-high'
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
|
||||
// Fetch provinces data
|
||||
|
@ -417,19 +400,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
})
|
||||
.then(provincesData => {
|
||||
|
||||
// Iterate through the provinces data and add options
|
||||
provincesData.forEach(province => {
|
||||
const option = new Option(province.name, province.code);
|
||||
provinceSelect.append(option);
|
||||
});
|
||||
|
||||
// Add an extra option manually
|
||||
const extraOption = new Option('Metro Manila', '130000000');
|
||||
provinceSelect.append(extraOption);
|
||||
|
||||
// Add event listener to provinceSelect
|
||||
provinceSelect.on('change', function() {
|
||||
// Clear existing options in citySelect and barangaySelect
|
||||
citySelect.html('<option value="" disabled selected hidden>Select City</option>');
|
||||
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
|
||||
|
||||
// Fetch and update cities/municipalities based on the selected province
|
||||
updateCities();
|
||||
});
|
||||
})
|
||||
|
@ -437,11 +424,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
console.error('Error:', error);
|
||||
});
|
||||
|
||||
// Function to update city/municipality options based on the selected province
|
||||
function updateCities() {
|
||||
const selectedProvinceCode = provinceSelect.val();
|
||||
const selectedProvinceCode = provinceSelect.val(); // Use val() to get the selected value with Select2
|
||||
if (selectedProvinceCode) {
|
||||
let citiesEndpoint;
|
||||
if (selectedProvinceCode === '130000000') {
|
||||
// Check if Metro Manila is selected
|
||||
citiesEndpoint = 'https://psgc.gitlab.io/api/regions/130000000/cities-municipalities/';
|
||||
} else {
|
||||
citiesEndpoint = `https://psgc.gitlab.io/api/provinces/${selectedProvinceCode}/cities-municipalities/`;
|
||||
|
@ -457,6 +446,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
})
|
||||
.then(citiesData => {
|
||||
// Iterate through the cities data and add options
|
||||
citiesData.forEach(city => {
|
||||
const option = new Option(city.name, city.code);
|
||||
citySelect.append(option);
|
||||
|
@ -467,9 +457,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Add event listener to citySelect
|
||||
citySelect.on('change', function() {
|
||||
// Clear existing options in barangaySelect
|
||||
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
|
||||
|
||||
// Fetch and update barangays based on the selected city/municipality
|
||||
const selectedCityCode = citySelect.val();
|
||||
if (selectedCityCode) {
|
||||
fetch(`https://psgc.gitlab.io/api/cities-municipalities/${selectedCityCode}/barangays/`)
|
||||
|
@ -482,6 +476,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
})
|
||||
.then(barangaysData => {
|
||||
// Iterate through the barangays data and add options
|
||||
barangaysData.forEach(barangay => {
|
||||
const option = new Option(barangay.name, barangay.code);
|
||||
barangaySelect.append(option);
|
||||
|
@ -496,11 +491,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
|
||||
$('#submitBtn').on('click', function() {
|
||||
// Retrieve existing addresses from the API
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
const existingAddresses = data.address || [];
|
||||
|
||||
// Get the new address details
|
||||
const firstName = $('#addressFirstName').val();
|
||||
const lastName = $('#addressLastName').val();
|
||||
const contact = $('#addressContact').val();
|
||||
|
@ -512,6 +510,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
const country = $('#addressCountry').val();
|
||||
|
||||
|
||||
// Create a new address object
|
||||
const newAddress = {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
|
@ -524,8 +523,10 @@ if ($_SESSION["userId"] <> "") {
|
|||
country: country,
|
||||
};
|
||||
|
||||
// Add the new address to the existing addresses
|
||||
existingAddresses.push(newAddress);
|
||||
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
|
@ -538,13 +539,16 @@ if ($_SESSION["userId"] <> "") {
|
|||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
// Handle success (e.g., show a success message)
|
||||
location.reload();
|
||||
} else {
|
||||
// Handle error
|
||||
console.error('Failed to submit data');
|
||||
alert('Failed to submit data');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
// Handle network or other errors
|
||||
console.error('Error:', error);
|
||||
alert('Error submitting data');
|
||||
});
|
||||
|
@ -702,18 +706,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
<label><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<?php
|
||||
if (!isset($vendorData['vendor_banner']) || empty($vendorData['vendor_banner'])) {
|
||||
$banner_style2 = 'background-color: orange !important; background-image: none !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; border-radius: 5px !important;';
|
||||
echo '<div class="image-thumb-preview ec-image-preview v-img" style="' . $banner_style2 . '"></div>';
|
||||
} else {
|
||||
echo '<img class="image-thumb-preview ec-image-preview v-img" src="' . $vendorData['vendor_banner'] . '" alt="edit" />';
|
||||
}
|
||||
?>
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview v-img" src=<?php echo $vendorData['vendor_banner'] ?> alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-block-detail">
|
||||
<div class="thumb-upload">
|
||||
|
@ -722,201 +719,118 @@ if ($_SESSION["userId"] <> "") {
|
|||
<label><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<?php if (!empty($vendorData['vendor_image'])): ?>
|
||||
<img class="image-thumb-preview ec-image-preview v-img" src="<?php echo $vendorData['vendor_image']; ?>" alt="edit" />
|
||||
<?php else: ?>
|
||||
<img class="image-thumb-preview ec-image-preview v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="edit" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function uploadVendorProfileImage() {
|
||||
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
|
||||
var file = document.getElementById('imageUpload').files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
function uploadVendorProfileImage() {
|
||||
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
|
||||
var file = document.getElementById('imageUpload').files[0];
|
||||
if (file) {
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorid);
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
reader.onload = function(event) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const maxWidth = 1200;
|
||||
const maxHeight = 1000;
|
||||
const aspectRatio = img.width / img.height;
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
};
|
||||
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
console.log('Payload:', payload);
|
||||
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorid);
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', resizedFile);
|
||||
function uploadProfileBanner() {
|
||||
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
|
||||
var file = document.getElementById('thumbUpload01').files[0];
|
||||
if (file) {
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorid + '_banner');
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = encodeURI(result.filename);
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
};
|
||||
const payload = {
|
||||
vendor_banner: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
|
||||
console.log('Payload:', payload);
|
||||
};
|
||||
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
|
||||
img.src = event.target.result;
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
|
||||
function uploadProfileBanner() {
|
||||
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
|
||||
var file = document.getElementById('thumbUpload01').files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = function(event) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const maxWidth = 1200;
|
||||
const maxHeight = 1000;
|
||||
const aspectRatio = img.width / img.height;
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorid + '_banner');
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', resizedFile);
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = encodeURI(result.filename);
|
||||
// const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_banner: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
|
||||
img.src = event.target.result;
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
console.log('Payload:', payload);
|
||||
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="ec-vendor-upload-detail">
|
||||
<form class="row g-3">
|
||||
|
@ -940,12 +854,6 @@ function uploadProfileBanner() {
|
|||
<label for="cphone-" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
|
||||
<input type="text" class="form-control" id="cphone-" value="<?php echo $vendorData['phone'] ?>">
|
||||
</div>
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Description Field-->
|
||||
<div class="form-group">
|
||||
<label for="cdescription-" class="text-dark font-weight-medium pt-3 mb-2">Vendor Description</label>
|
||||
<textarea class="form-control" id="cdescription-"><?php echo $vendorData['vendor_description']; ?></textarea>
|
||||
</div>
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Description Field-->
|
||||
|
||||
<!-- <div class="col-md-12 space-t-15">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
|
|
10
wishlist.php
10
wishlist.php
|
@ -182,8 +182,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<input type="checkbox" class="product-checkbox" style="width: 20px; height: 20px; "value="<?php echo $product["_id"]; ?>">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>" class="image">
|
||||
<!-- <a href="shop-left-sidebar-col-4.php" class="image"> -->
|
||||
<a href="shop-left-sidebar-col-4.php" class="image">
|
||||
<img class="main-image" src="<?php echo $product["product_image"]; ?>" alt="Product" />
|
||||
<!-- <img class="hover-image" src="<?php echo $product["product_image"]; ?>" alt="Product" /> -->
|
||||
</a>
|
||||
|
@ -404,8 +403,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<section>
|
||||
<!-- Start Offer section -->
|
||||
<!-- raymart remove start offer section from style feb 22 2024-->
|
||||
<!-- <section class="labels section-space-p">
|
||||
<section class="labels section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
|
@ -539,7 +537,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
|
||||
<!-- Recent Purchase Popup -->
|
||||
<!-- <div class="recent-purchase">
|
||||
<div class="recent-purchase">
|
||||
<img src="assets/images/product-image/1.jpg" alt="payment image">
|
||||
<div class="detail">
|
||||
<p>Someone in new just bought</p>
|
||||
|
@ -547,7 +545,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<p>10 Minutes ago</p>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- Recent Purchase Popup end -->
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue