Compare commits

..

No commits in common. "f91e552a89ddcecdf8829c93cb8222d3c9b1f4c1" and "84f86370eb4559668ba7dd2fcc237021201a948a" have entirely different histories.

29 changed files with 835 additions and 1404 deletions

View File

@ -1,8 +1,8 @@
<?php
$_SESSION["is_test"]=true;
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
$_SESSION["sales_email"]="junjihadbarroga@gmail.com";
$_SESSION["data_endpoint"]="api.obanana.shop";
$_SESSION["is_test"]=false;
$_SESSION["test_email_rcpt"]="";
$_SESSION["sales_email"]="sales@obanana.com";
$_SESSION["data_endpoint"]="api.obanana.com";
if ($_SESSION["is_test"]){
$_SESSION["obpay"]="web.obpay.online/test";
$_SESSION["obpay_gate"]="gate.obpay.online/api";

View File

@ -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">

View File

@ -66,9 +66,6 @@ $products = productList();
<!-- FAVICON -->
<link href="assets/img/favicon.png" rel="shortcut icon" />
<!-- FONTAWESOME -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
@ -747,50 +744,9 @@ $products = productList();
</button>
</div>
<!-- 02-28-2024 Stacy modified this block of code -->
<div class="modal-body pt-0">
<div style="text-align: center; display: column; justify-content: center; align-items: center;" class="col-md-6">
<!-- <input type="file" id="fileInput<?php #echo $vendor['_id']; ?>" accept=".png, .jpg, .jpeg" /> -->
<div class="thumb-edit" style="padding-left:120px; margin-bottom:-40px;">
<input style="display:none;" type='file' id="fileInput<?php echo $vendor['_id']; ?>" class="ec-image-upload" accept=".png, .jpg, .jpeg" onchange="previewImage('<?php echo $vendor['_id']; ?>')"/>
<label><i class="fa-solid fa-file-import" style="cursor:pointer;" onclick="document.getElementById('fileInput<?php echo $vendor['_id']; ?>').click()"></i></label>
</div>
<div class="vendor-image" style="padding-top:20px; ">
<?php
if (isset($vendor['vendor_image']) && !empty($vendor['vendor_image'])) {
echo '<img src="' . $vendor['vendor_image'] . '" alt="edit" id="imgPrev" class="img-fluid rounded-circle" alt="Avatar Image" style="align-items:left; width:100px; height:100px; object-fit:cover; border-radius:80%;"> ';
} else {
echo '<img src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" id="imgPrev" alt="edit" class="img-fluid rounded-circle" alt="Placeholder Image" style="align-items:left; width:80px; height:80px; object-fit:cover; border-radius:50%;">';
}
?>
</div>
<script>
function updateButtonText(input){
var label = document.getElementById('fileInputLabel');
if (input.files.length > 0) {
label.innerHTML = '<i class="fa-solid fa-file-arrow-up"></i> ' + input.files[0].name;
}else{
label.innerHTML = '<i class="fa-solid fa-file-arrow-up"></i> Upload file';
}
}
// 02-29-2024 Stacy for image preview
function previewImage(vendorId){
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
console.log('clicked hereee')
const reader = new FileReader();
reader.onload = function (e) {
const dataUri = e.target.result;
document.getElementById('imgPrev').src=dataUri
};
reader.readAsDataURL(file);
}
</script>
<div style="text-align: center; display: flex; justify-content: center; align-items: center;" class="col-md-6">
<input type="file" id="fileInput<?php echo $vendor['_id']; ?>" />
</div>
<form>
<div class="row no-gutters">
@ -799,7 +755,7 @@ $products = productList();
<div class="text-center widget-profile px-0 border-0">
<div class="card-body">
<div class="form-group">
<label for="user_login-<?php echo $vendor['_id']; ?>" class="text-dark font-weight-medium pt-3 mb-2"><i class="fi-rr-edit"></i>Name</label>
<label for="user_login-<?php echo $vendor['_id']; ?>" class="text-dark font-weight-medium pt-3 mb-2">Name</label>
<input type="text" class="form-control" id="user_login-<?php echo $vendor['_id']; ?>" value="<?php echo $vendor['user_login']; ?>">
</div>
<div class="row">
@ -845,7 +801,7 @@ $products = productList();
</div>
</div>
<div class="col-md-6" style="margin-top:-100px;">
<div class="col-md-6">
<div class="contact-info px-4">
<h4 class="text-dark mb-1">Address</h4>
@ -896,296 +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;
// 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);
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;
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;
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
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,
}]
};
if(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,
}]
};
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{
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,
}]
};
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (response.ok) {
location.reload();
return response.json();
} else {
console.error('vendor Update failed');
throw new Error('vendor Update failed');
}
})
;
}
}
});
}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);
if (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);
});
}else{
const payload = {
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,
}]
};
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (response.ok) {
location.reload();
return response.json();
} else {
console.error('vendor Update failed');
throw new Error('vendor Update failed');
}
})
;
}
}
}
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>

View File

@ -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;

View File

@ -491,7 +491,7 @@ function popupAddToCart(product, productVendor, token, email, password, customer
var vendorObj = JSON.parse(productVendor);
var sessionToken = token;
var productImage = productObj.images;
var productImage = productObj.product_image;
var productId = productObj._id;
var productName = productObj.product_name;
var productPrice = productObj.sale_price ? productObj.sale_price : productObj.regular_price;
@ -600,15 +600,13 @@ function popupAddToCart(product, productVendor, token, email, password, customer
var newOrder = document.createElement("li");
newOrder.id = `order_${response._id}`;
var imageUrl = response.items[0].product.product_image ? response.items[0].product.product_image.split(',')[0].trim() : "https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png";
console.log(response)
newOrder.innerHTML = `
<a href="product-left-sidebar.php?id=${response.items[0]._id}" class="sidekka_pro_img">
<img src="${imageUrl}" alt="product" />
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
<img src="${response.items[0].product.product_image}" alt="product">
</a>
<div class="ec-pro-content">
<a href="product-left-sidebar.php?id=${response.items[0]._id}" class="cart_pro_title">${response.items[0].product.name}</a>
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
<span class="cart-price" id="cart-price">
Unit Price: <span>${response.items[0].price}</span>
</span>
@ -677,27 +675,25 @@ function popupAddToCart(product, productVendor, token, email, password, customer
if (cartItem) {
var updatedQuantity = response.items[0].quantity; // Use the correct quantity from the updated order
var totalAmount = response.items[0].price * updatedQuantity;
var imageUrl = response.items[0].product.product_image ? response.items[0].product.product_image.split(',')[0].trim() : "https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png";
// If the cart item already exists, update its content using innerHTML
cartItem.innerHTML = `
<a href="product-left-sidebar.php?id=${response.items[0]._id}"" class="sidekka_pro_img">
<img src="${imageUrl}" alt="product">
</a>
<div class="ec-pro-content">
<a href="product-left-sidebar.php?id=${response.items[0]._id}"" class="cart_pro_title">${response.items[0].product.name}</a>
<span class="cart-price" id="cart-price">
Unit Price: <span>${response.items[0].price}</span>
</span>
<span id="subtotal-${response._id}" class="subtotal-${response._id}">Subtotal: ${totalAmount}</span>
// raymart feb 26 2024
<div class="qty-plus-minuses" style="display:flex; overflow:visible; align-items:center; padding-top:10px;">
<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
<input style="width:100px; height:40px" id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
<div class="qty-btn" style="color:#ffaa00; font-size:30px; padding-left:5px; cursor: pointer;" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')"><i class="ecicon eci-trash" style="padding:20px; opacity:70%"></i></a>
</div>
`;
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
<img src="${response.items[0].product.product_image}" alt="product">
</a>
<div class="ec-pro-content">
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
<span class="cart-price" id="cart-price">
Unit Price: <span>${response.items[0].price}</span>
</span>
<span id="subtotal-${response._id}" class="subtotal-${response._id}">Subtotal: ${totalAmount}</span>
<div class="qty-plus-minuses">
<div class="qty-btn" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
<input id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
<div class="qty-btn" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
</div>
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
</div>
`;
document.getElementById(`qty-input-${response.items[0]._id}`).value = updatedQuantity;
} else {
// If the cart item doesn't exist, create a new one

View File

@ -82,9 +82,6 @@ if ($_SESSION["userId"] <> "") {
<?php include "header.php" ?>
<!-- Header End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- ekka Cart Start -->
<div class="ec-side-cart-overlay"></div>
<div id="ec-side-cart" class="ec-side-cart">

View File

@ -97,7 +97,6 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
<?php include 'header.php' ?>
<?php include "category-slider.php" ?>
<!-- ekka Cart Start -->
<div class="ec-side-cart-overlay"></div>
<div id="ec-side-cart" class="ec-side-cart">
@ -229,7 +228,7 @@ if ($_SESSION["userId"] <> "") {
</a>
</div>
<div class="ec-catalog-vendor-info row" style="justify-content: center;">
<div class="ec-catalog-vendor-info row">
<div class="col-lg-3 col-md-6 ec-catalog-name pad-15">
<a href="vendor-profile.html">
<h6 class="name"><?php echo $vendor["user_login"] ?></h6>
@ -1115,7 +1114,7 @@ if ($_SESSION["userId"] <> "") {
<!-- raymart added js link feb 14 2024 -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester11.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -1,517 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>oBanana B2B - Elevate Your Business</title>
<meta name="keywords" content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
<meta name="author" content="ashishmaraviya">
<!-- site Favicon -->
<link rel="icon" href="assets/images/favicon/favicon.png" sizes="32x32" />
<link rel="apple-touch-icon" href="assets/images/favicon/favicon.png" />
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
<link rel="stylesheet" href="assets/css/plugins/swiper-bundle.min.css" />
<link rel="stylesheet" href="assets/css/plugins/jquery-ui.min.css" />
<link rel="stylesheet" href="assets/css/plugins/countdownTimer.css" />
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
<!-- Main Style -->
<link rel="stylesheet" href="assets/css/demo1.css" />
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/responsive.css" />
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<!-- 02-27-2024 Stacy added style for Sidebar Category -->
<style>
#sidebar-category:hover {
background-color: #ffaa00;
border-radius: 10px;
color: #ffffff;
}
#sidebar-category:hover .ec-sidebar-block-item{
color: #ffffff;
}
</style>
</head>
<body class="shop_page">
<div class="ec-side-cat-overlay"></div>
<div class="col-lg-3 category-sidebar" data-animation="fadeIn">
<div class="cat-sidebar">
<div class="cat-sidebar-box">
<div class="ec-sidebar-wrap">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Category<button class="ec-close">×</button></h3>
</div>
<!-- 02-27-2024 Stacy modified Sidebar Category Block -->
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Electronics">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-headset" style="padding-right:10px; padding-top:2px;"></i>Electronics</div></a>
<!-- <ul style="display: block;">
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Shirt <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shorts & jeans <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">jacket<span title="Available Stock">- 500</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">dress & frock <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Solar">
<div class="ec-sidebar-block-item" id="sidebar-category-content">
<i class="fi fi-rr-square" style="padding-right:10px; padding-top:2px;"></i>Solar</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sports <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Formal <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Casual <span title="Available Stock">- 40</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">safety shoes <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=E-bike">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-bike" style="padding-right:10px; padding-top:2px;"></i>E-Bike</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Earrings <span title="Available Stock">- 50</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Couple Rings <span title="Available Stock">- 35</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Necklace <span title="Available Stock">- 40</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=E-vehicle">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-car-side" style="padding-right:10px; padding-top:2px;"></i>E-Vehicle</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Clothes perfume<span title="Available Stock">- 4 pcs</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">deodorant <span title="Available Stock">- 52 pcs</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Flower fragrance <span title="Available Stock">- 10 pack</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Air
Freshener<span title="Available Stock">- 35 pack</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Appliance">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-calculator" style="padding-right:10px; padding-top:2px;"></i>Appliance</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shampoo<span title="Available Stock"></span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sunscreen<span title="Available Stock"></span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">body
wash<span title="Available Stock"></span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">makeup kit<span title="Available Stock"></span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Smart Home">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-screen" style="padding-right:10px; padding-top:2px;"></i>Smart Home</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sunglasses <span title="Available Stock">- 20</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Lenses <span title="Available Stock">- 52</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Home">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-home" style="padding-right:10px; padding-top:2px;"></i>Home</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Gym
backpack <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">purse <span title="Available Stock">- 40</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">wallet <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Apparell">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-user" style="padding-right:10px; padding-top:2px;"></i>Apparel</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Gym
backpack <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">purse <span title="Available Stock">- 40</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">wallet <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Heavy Equipment">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-tool-box" style="padding-right:10px; padding-top:2px;"></i>Heavy Equipment</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Gym
backpack <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">purse <span title="Available Stock">- 40</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">wallet <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul> -->
</li>
</ul>
</div>
<!-- 02-27-2024 Stacy modified Sidebar Category Block -->
</div>
<!-- Sidebar Category Block -->
</div>
</div>
<div class="ec-sidebar-slider">
<div class="ec-sb-slider-title">Best Sellers</div>
<div class="ec-sb-pro-sl">
<div>
<?php
$productBestSellers = simpleProducts("");
$array = array_filter($productBestSellers, function ($var) {
return (fnmatch("Solar*", $var['product_category']) || fnmatch("E-bike*", $var['product_category'])
|| fnmatch("Appliance*", $var['product_category']) || fnmatch("E-Vehicle*", $var['product_category'])
|| fnmatch("Electronics*", $var['product_category']) || fnmatch("Smart Home*", $var['product_category'])
|| fnmatch("Heavy Equipment*", $var['product_category']) || fnmatch("Home*", $var['product_category']));
});
$bestSellers = array_values($array);
for ($x = 0; $x <= 3; $x++) {
$pid = rand(0, count($bestSellers) - 1);
?>
<div class="ec-sb-pro-sl-item">
<a href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>" class="sidekka_pro_img"><img src="<?php echo $bestSellers[$pid]["product_image"] ?>" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>"><?php echo $bestSellers[$pid]["product_name"] ?></a></h5>
<!-- <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> -->
<span class="ec-price">
<?php if (isset($bestSellers[$pid]["sale_price"]) && $bestSellers[$pid]["sale_price"] > 0) : ?>
<span class="old-price">&#8369;<?php echo number_format($bestSellers[$pid]["regular_price"], 2, ".", ",") ?></span>
<span class="new-price">&#8369;<?php echo number_format($bestSellers[$pid]["sale_price"], 2, ".", ",") ?></span>
<?php elseif (isset($bestSellers[$pid]["regular_price"]) && $bestSellers[$pid]["regular_price"] != "") : ?>
<span class="new-price">&#8369;<?php echo number_format($bestSellers[$pid]["regular_price"], 2, ".", ",") ?></span>
<?php elseif ($bestSellers[$pid]["regular_price"] == "" || $bestSellers[$pid]["regular_price"] == null) : ?>
<span class="inquire-text">Inquire</span>
<?php else : ?>
<span class="inquire-text">Inquire</span>
<?php endif; ?>
</span>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<!-- <div class="ec-sidebar-slider-cat">
<div class="ec-sb-slider-title">Best Sellers</div>
<div class="ec-sb-pro-sl">
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/1.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">baby fabric shoes</a></h5>
<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 fill"></i>
</div>
<span class="ec-price">
<span class="old-price">$5.00</span>
<span class="new-price">$4.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/2.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Men's hoodies t-shirt</a>
</h5>
<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>
<span class="ec-price">
<span class="old-price">$10.00</span>
<span class="new-price">$7.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/3.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Girls t-shirt</a></h5>
<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"></i>
<i class="ecicon eci-star"></i>
</div>
<span class="ec-price">
<span class="old-price">$5.00</span>
<span class="new-price">$3.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/4.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">woolen hat for men</a></h5>
<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 fill"></i>
</div>
<span class="ec-price">
<span class="old-price">$15.00</span>
<span class="new-price">$12.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/5.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Womens purse</a></h5>
<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>
<span class="ec-price">
<span class="old-price">$15.00</span>
<span class="new-price">$12.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/6.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Baby toy doctor kit</a>
</h5>
<div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star"></i>
<i class="ecicon eci-star"></i>
<i class="ecicon eci-star"></i>
</div>
<span class="ec-price">
<span class="old-price">$50.00</span>
<span class="new-price">$45.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/7.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">teddy bear baby toy</a>
</h5>
<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 fill"></i>
</div>
<span class="ec-price">
<span class="old-price">$35.00</span>
<span class="new-price">$25.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/2.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Mens hoodies blue</a></h5>
<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"></i>
<i class="ecicon eci-star"></i>
</div>
<span class="ec-price">
<span class="old-price">$15.00</span>
<span class="new-price">$13.00</span>
</span>
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
</body>
</html>

View File

@ -577,29 +577,18 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<div class="col-sm-12 mb-6">
<?php foreach ($checkout['items'] as $item) { ?>
<div class="ec-product-inner">
<div class="ec-pro-image-outer" >
<div class="ec-pro-image" style="width: 128px; height: 150px; display: flex; justify-content: center; align-items: center;">
<a href="product-left-sidebar.php?id=<?php echo $item['product']['product_id']; ?>">
<?php
if (isset($item['product']['product_image'])) {
$image_urls = explode(',', $item['product']['product_image']);
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="main-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
<?php
}
?>
<div class="ec-pro-image-outer">
<div class="ec-pro-image">
<a href="shop-left-sidebar-col-4.php" class="image">
<img class="main-image" src="<?php echo $item['product']['product_image']; ?>" alt="Product" />
<!-- <img class="hover-image"
src="assets/images/product-image/1_2.jpg"
alt="Product" /> -->
</a>
</div>
</div>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $item['product']['product_id']; ?>"><?php echo $item['product']['name']; ?></a></h5>
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php"><?php echo $item['product']['name']; ?></a></h5>
<div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
@ -610,25 +599,11 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<span class="ec-price">
<span class="new-price"><?php echo $item['price']; ?> x <?php echo $item['quantity']; ?></span>
</span>
<?php $checkProduct = getProduct($item['product']['product_id']);
$decodedProduct = json_decode($checkProduct, true);
$freeShipping = false;
if (!empty($decodedProduct['promo']) && $decodedProduct['promo'][0]['free-shipping'] === 'Yes') {
$freeShipping = true;
}
// Set the shipping fee based on the condition
$shippingFee = $freeShipping ? 0 : $checkout['shipping_fee'];
// Set the shipping fee based on the condition
?>
<span class="ec-price">
<span class="new-price">Shipping Fee: <?php echo $shippingFee; ?></span>
<span class="new-price">Shipping Fee: <?php echo $checkout['shipping_fee']; ?></span>
</span>
<span class="ec-price">
<span class="new-price">Subtotal: <?php echo $shippingFee + $checkout['total_amount']; ?></span>
<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">
@ -749,21 +724,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<?php
$totalAmount = 0;
foreach ($cartItems as $checkout) {
foreach ($checkout['items'] as $item) {
$checkProduct = getProduct($item['product']['product_id']);
$decodedProduct = json_decode($checkProduct, true);
$freeShipping = false;
if (!empty($decodedProduct['promo']) && $decodedProduct['promo'][0]['free-shipping'] === 'Yes') {
$freeShipping = true;
}
// Set the shipping fee based on the condition
$shippingFee = $freeShipping ? 0 : $checkout['shipping_fee'];
// Calculate total amount for each item
$totalAmount += ($item['price'] + $shippingFee) * $item['quantity'];
}
$totalAmount += $checkout['total_amount'] + $checkout['shipping_fee'];
}
?>
@ -895,18 +856,13 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
}
} else if (pay2RadioButton.checked) {
try {
<?php foreach ($cartItems as $checkout) { ?>
<?php foreach ($checkout['items'] as $item) { ?>
itemNames.push("<?php echo str_replace('"', "\\'", $item['product']['name']) . ' (' . $item['quantity'] . ')'; ?>");
<?php } ?>
<?php } ?>
const base64Credentialss = btoa(`${username}:${password}`);
const response = await fetch('https://<?php echo $_SESSION["obpay_gate"]; ?>/payment/links', {
method: "POST",
body: JSON.stringify({
amount: totalAmount * 100,
description: itemNames.join(', '),
description: `ordered from obanana ecommerce website`,
}),
headers: {
'Content-Type': 'application/json',
@ -923,6 +879,51 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
if (result) {
// Update payment status using PATCH request
// const ordersToUpdate = <?php
// // $arr=$cartItemsJSON[12];
// // $ref=$arr['attributes'];
// // $id=$ref['_id'];
// echo $filteredIdsJSON;
// // print_r($cartItemsArray);
// // if (isset($cartItemsJSON['12'])) {
// // $id = $cartItemsJSON['12'];
// // echo $id;
// // } else {
// // echo "No _id found in the specified structure.";
// // }
//
?>;
// const ordersToUpdate = <?php echo $cartItems; ?>;
// // console.log(ordersToUpdate);
// ordersToUpdate.forEach(async (order) => {
// // console.log(orderId)
// const shippingFee = order.shipping_fee ?? 50
// const patchResponse = await fetch(`https://api.obanana.shop/api/v1/orders/${order._id}`, {
// method: "PATCH",
// body: JSON.stringify({
// // shipping_address:{
// // shipping_first_name: document.getElementById('selectedFName').innerText,
// // },
// payment: {
// status: "UNPAID",
// reference_number: result.attributes.reference_number,
// },
// }),
// headers: {
// 'Content-Type': 'application/json',
// // Add any additional headers as needed
// },
// });
// if (!patchResponse.ok) {
// throw new Error(`Error updating payment status: ${patchResponse.status} ${patchResponse.statusText}`);
// }
// })
const currentDate = new Date();
const iso8601String = currentDate.toISOString();
const ordersToUpdate = <?php echo $cartencode; ?>;

View File

@ -5,8 +5,8 @@
<div class="container">
<div class="row">
<div class="text-center footer-off-msg">
<!-- <span>Win a contest! Get this limited-editon</span><a href="#" target="_blank">View
Detail</a> -->
<span>Win a contest! Get this limited-editon</span><a href="#" target="_blank">View
Detail</a>
</div>
</div>
</div>

View File

@ -1384,23 +1384,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,

View File

@ -228,7 +228,7 @@
?><?php
if ($_SESSION["isVendor"]) {
?>
<li><a class="dropdown-item" href="vendor-dashboard.php">My Account</a></li>
<li><a class="dropdown-item" href="vendor-settings.php">My Account</a></li>
<?php
} else {
?>
@ -378,23 +378,7 @@
$product_data = json_decode($product, true);
?>
<li id="order_<?php echo $order['_id'] ?>">
<a href="product-left-sidebar.php?id=<?php echo $order['items'][0]['product']['product_id']; ?>" class="sidekka_pro_img">
<?php
if (isset($order['items'][0]['product']['product_image'])) {
$image_urls = explode(',', $order['items'][0]['product']['product_image']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img src="<?php echo $first_image_url; ?>" alt="product" />
<?php
}
} else {
?>
<img class="hover-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
<?php
}
?>
</a>
<a href="product-left-sidebar.php?id=<?php echo $order['items'][0]['product']['product_id']; ?>" class="sidekka_pro_img"><img src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></a>
<div class="ec-pro-content">
<a href="product-left-sidebar.php?id=<?php echo $order['items'][0]['product']['product_id']; ?>" class="cart_pro_title"><?php echo $order['items'][0]['product']['name']; ?></a>

467
index.php
View File

@ -110,7 +110,348 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<div class="ec-side-cat-overlay"></div>
<div class="col-lg-3 category-sidebar" data-animation="fadeIn">
<div class="cat-sidebar">
<div class="cat-sidebar-box">
<div class="ec-sidebar-wrap">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Category<button class="ec-close">×</button></h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/dress-8.png" class="svg_img" alt="drink" />Cothes</div>
<ul style="display: block;">
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Shirt <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shorts & jeans <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">jacket<span title="Available Stock">- 500</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">dress & frock <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/shoes-8.png" class="svg_img" alt="drink" />Footwear</div>
<ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sports <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Formal <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Casual <span title="Available Stock">- 40</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">safety shoes <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/jewelry-8.png" class="svg_img" alt="drink" />jewelry</div>
<ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Earrings <span title="Available Stock">- 50</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Couple Rings <span title="Available Stock">- 35</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Necklace <span title="Available Stock">- 40</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/perfume-8.png" class="svg_img" alt="drink" />perfume</div>
<ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Clothes perfume<span title="Available Stock">- 4 pcs</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">deodorant <span title="Available Stock">- 52 pcs</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Flower fragrance <span title="Available Stock">- 10 pack</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Air
Freshener<span title="Available Stock">- 35 pack</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/cosmetics-8.png" class="svg_img" alt="drink" />cosmetics</div>
<ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shampoo<span title="Available Stock"></span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sunscreen<span title="Available Stock"></span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">body
wash<span title="Available Stock"></span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">makeup kit<span title="Available Stock"></span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/glasses-8.png" class="svg_img" alt="drink" />glasses</div>
<ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sunglasses <span title="Available Stock">- 20</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Lenses <span title="Available Stock">- 52</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><img src="assets/images/icons/bag-8.png" class="svg_img" alt="drink" />bags</div>
<ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Gym
backpack <span title="Available Stock">- 52</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">purse <span title="Available Stock">- 40</span></a>
</div>
</li>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">wallet <span title="Available Stock">- 35</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- Sidebar Category Block -->
</div>
</div>
<div class="ec-sidebar-slider-cat">
<div class="ec-sb-slider-title">Best Sellers</div>
<div class="ec-sb-pro-sl">
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/1.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">baby fabric shoes</a></h5>
<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 fill"></i>
</div>
<span class="ec-price">
<span class="old-price">$5.00</span>
<span class="new-price">$4.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/2.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Men's hoodies t-shirt</a>
</h5>
<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>
<span class="ec-price">
<span class="old-price">$10.00</span>
<span class="new-price">$7.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/3.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Girls t-shirt</a></h5>
<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"></i>
<i class="ecicon eci-star"></i>
</div>
<span class="ec-price">
<span class="old-price">$5.00</span>
<span class="new-price">$3.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/4.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">woolen hat for men</a></h5>
<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 fill"></i>
</div>
<span class="ec-price">
<span class="old-price">$15.00</span>
<span class="new-price">$12.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/5.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Womens purse</a></h5>
<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>
<span class="ec-price">
<span class="old-price">$15.00</span>
<span class="new-price">$12.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/6.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Baby toy doctor kit</a>
</h5>
<div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star"></i>
<i class="ecicon eci-star"></i>
<i class="ecicon eci-star"></i>
</div>
<span class="ec-price">
<span class="old-price">$50.00</span>
<span class="new-price">$45.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/7.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">teddy bear baby toy</a>
</h5>
<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 fill"></i>
</div>
<span class="ec-price">
<span class="old-price">$35.00</span>
<span class="new-price">$25.00</span>
</span>
</div>
</div>
</div>
<div>
<div class="ec-sb-pro-sl-item">
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img src="assets/images/product-image/2.jpg" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php">Mens hoodies blue</a></h5>
<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"></i>
<i class="ecicon eci-star"></i>
</div>
<span class="ec-price">
<span class="old-price">$15.00</span>
<span class="new-price">$13.00</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Main Slider Start -->
<div class="sticky-header-next-sec ec-main-slider section section-space-pb">
@ -225,9 +566,7 @@ if ($_SESSION["userId"] <> "") {
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<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-->
@ -237,7 +576,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;" />
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
@ -253,24 +592,9 @@ if ($_SESSION["userId"] <> "") {
</a> -->
<!-- <span class="percentage">20%</span> -->
<!-- raymart edit action -->
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($forAll[$pid]["sale_price"]) && $forAll[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($forAll[$pid]["regular_price"]) && $forAll[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($forAll[$pid]["regular_price"] == "" || $forAll[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>','<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>', '<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>' , '<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>' , '<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>' ,'<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
@ -345,9 +669,7 @@ if ($_SESSION["userId"] <> "") {
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<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-->
@ -357,7 +679,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;"/>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
@ -374,24 +696,9 @@ if ($_SESSION["userId"] <> "") {
<!-- <span class="percentage">20%</span> -->
<!-- raymart edit action feb 14 2024-->
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($electronics[$pid]["sale_price"]) && $electronics[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($electronics[$pid]["regular_price"]) && $electronics[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($electronics[$pid]["regular_price"] == "" || $electronics[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
@ -467,9 +774,7 @@ if ($_SESSION["userId"] <> "") {
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<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-->
@ -479,7 +784,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;"/>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
@ -495,24 +800,9 @@ if ($_SESSION["userId"] <> "") {
</a> -->
<!-- <span class="percentage">20%</span> -->
<!-- raymart edit action feb 14 2024-->
<div class="ec-pro-actions"style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($smartHome[$pid]["sale_price"]) && $smartHome[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($smartHome[$pid]["regular_price"]) && $smartHome[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($smartHome[$pid]["regular_price"] == "" || $smartHome[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
@ -587,9 +877,7 @@ if ($_SESSION["userId"] <> "") {
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024-->
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<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-->
@ -599,7 +887,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;"/>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
@ -615,24 +903,9 @@ if ($_SESSION["userId"] <> "") {
</a> -->
<!-- <span class="percentage">20%</span> -->
<!-- raymart added action feb 14 2024-->
<div class="ec-pro-actions"style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($forVehicle[$pid]["sale_price"]) && $forVehicle[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($forVehicle[$pid]["regular_price"]) && $forVehicle[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($forVehicle[$pid]["regular_price"] == "" || $forVehicle[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
@ -1053,7 +1326,7 @@ if ($_SESSION["userId"] <> "") {
<div class="col-sm-12 col-md-6 col-lg-3 ec_ven_content" data-animation="zoomIn">
<div class="ec-vendor-card">
<div class="ec-vendor-detail">
<div class="ec-vendor-avtar" style="width: 75px; height: 75px; overflow: hidden;">
<div class="ec-vendor-avtar" style="width: 200; height: 200; overflow: hidden;">
<img src="<?php echo $vendor['vendor_image']; ?>" alt="vendor img" style="width: 100%; height: 100%; object-fit: cover;">
</div>
<div class="ec-vendor-info">
@ -1081,9 +1354,7 @@ if ($_SESSION["userId"] <> "") {
$randomProducts = array_slice($vendorProducts, 0, 4);
foreach ($randomProducts as $product) { ?>
<!-- raymart added style feb 26 2024 -->
<div class="ec-prod-img" style="max-width: 140px; height: 150px;">
<!-- <div class="ec-prod-img"> -->
<div class="ec-prod-img">
<a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>"><img src="<?php echo $product['product_image']; ?>" alt="product img"></a>
</div>
<?php } ?>
@ -1212,9 +1483,7 @@ if ($_SESSION["userId"] <> "") {
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="flipInY">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<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-->
@ -1224,7 +1493,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;" />
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
@ -1239,7 +1508,7 @@ if ($_SESSION["userId"] <> "") {
<img class="hover-image" src="<?php echo $newArrival[$pid]["product_image"] ?>" alt="Product" />
</a> -->
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions"style="bottom: -36px;">
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
@ -1891,7 +2160,7 @@ if ($_SESSION["userId"] <> "") {
<!-- raymart added js feb 14, 2024-->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester11.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -86,9 +86,6 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">

View File

@ -236,10 +236,6 @@ if (isset($_GET['id'])) {
<!-- ekka Cart Start -->
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">
@ -1949,7 +1945,7 @@ if (isset($_GET['id'])) {
<!-- 02-21-2024 Stacy added js link -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester11.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -102,8 +102,6 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Page detail section -->
<!-- Main Slider Start -->
@ -902,7 +900,7 @@ if ($_SESSION["userId"] <> "") {
<script src="assets/js/main.js"></script>
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester11.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -4,16 +4,13 @@
$categories = isset($_POST['category']) ? $_POST['category'] : array();
$categoryFinal = null;
$count=0;
foreach ($categories as $category) {
// Perform checks or actions for each category
// For example:
$categoriesCopy = $categoryFinal;
$categoryFinal =$categoryFinal!== null? $categoriesCopy . '&category['.$count.']='.$category:$categoriesCopy . 'category['.$count.']='.$category;
$count+=1;
echo $categoryFinal;
echo "Processing category: $category <br>";
// You can add your logic here
}
$minPrice = isset($_POST['minPrice']) ? $_POST['minPrice'] : null;

View File

@ -15,55 +15,90 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
// 02-19-2024 Jun Jihad Search Filter
$filteredProducts = [];
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$minPrice = ($_POST['minPrice'] !== '' && is_numeric($_POST['minPrice'])) ? floatval($_POST['minPrice']) : null;
$maxPrice = ($_POST['maxPrice'] !== '' && is_numeric($_POST['maxPrice'])) ? floatval($_POST['maxPrice']) : null;
echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "<br>";
echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "<br>";
if (isset($_POST['category'])) {
$selectedCategories = $_POST['category'];
foreach ($selectedCategories as $selectedCategory) {
$category = strtolower(trim($selectedCategory));
foreach ($productSearchResult['results'] as $result) {
$productCategory = strtolower(trim($result['product']['product_category']));
$productPrice = isset($result['product']['sale_price']) ? $result['product']['sale_price'] : $result['product']['regular_price'];
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (
$productCategory == $category &&
($productPrice >= $minPrice) &&
($productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
} else {
// If no category is selected, filter only by price range
foreach ($productSearchResult['results'] as $result) {
$productPrice = isset($result['product']['sale_price']) ? $result['product']['sale_price'] : $result['product']['regular_price'];
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (($productPrice >= $minPrice) &&
($productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
}
if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['category'])) {
$filteredProducts = [];
$minPrice = isset($_GET['minPrice']) && $_GET['minPrice'] !== '' ? floatval($_GET['minPrice']) : null;
$maxPrice = isset($_GET['maxPrice']) && $_GET['maxPrice'] !== '' ? floatval($_GET['maxPrice']) : null;
// echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "<br>";
// echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "<br>";
echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "<br>";
echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "<br>";
$selectedCategories = isset($_GET['category']) ? $_GET['category'] : [];
if (!empty($selectedCategories) && (($minPrice == null) && ($maxPrice == null))) {
if (!empty($selectedCategories)) {
foreach ($selectedCategories as $selectedCategory) {
$category = strtolower(trim($selectedCategory));
foreach ($productSearchResult['results'] as $result) {
$product = $result['product'];
$productCategory = strtolower(trim($product['product_category']));
if (
$productCategory == $category
) {
$filteredProducts[] = $result;
}
}
}
} elseif (!empty($selectedCategories) && (!empty($minPrice) || !empty($maxPrice))) {
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
foreach ($selectedCategories as $selectedCategory) {
$category = strtolower(trim($selectedCategory));
foreach ($productSearchResult['results'] as $result) {
$product = $result['product'];
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
$productCategory = strtolower(trim($product['product_category']));
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (
$productCategory = $category && (($productPrice >= $minPrice) &&
($productPrice <= $maxPrice))
$productCategory == $category &&
($minPrice === null || $productPrice >= $minPrice) &&
($maxPrice === null || $productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
}
}
else {
} else {
foreach ($productSearchResult['results'] as $result) {
$product = $result['product'];
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
@ -73,7 +108,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
}
if (($minPrice === null || $productPrice >= $minPrice) &&
($maxPrice === null || $productPrice <= $maxPrice)
) {
@ -170,7 +205,6 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
</div>
</div>
<?php include "header.php" ?>
<?php include "category-slider.php" ?>
<!-- ekka Cart Start -->
<!-- ekka Cart End -->
@ -308,44 +342,26 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
for ($x = $startIndex; $x <= $endIndex; $x++) {
$product = $filteredProducts[$x]['product'];
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
// $product_image = !empty($product["product_image"]) ? $product["product_image"] : "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/330px-No-Image-Placeholder.svg.png";
$product_image = !empty($product["product_image"]) ? $product["product_image"] : "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/330px-No-Image-Placeholder.svg.png";
$sale_price = isset($product['sale_price']) ? $product['sale_price'] : null;
$regular_price = isset($product['regular_price']) ? $product['regular_price'] : null;
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content width-100">
<div class="ec-product-inner">
<div class="ec-pro-image-outer" style="width: 290px; height: 200px;">
<div class="ec-pro-image-outer">
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>">
<?php
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img style="width: 290px; height: 200px; object-fit: cover;" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
?>
<img class="hover-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
<?php
}
?>
</a>
<!-- <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_image ?>" alt="Product" />
<img class="hover-image" src="<?php echo $product_image ?>" alt="Product" />
</a> -->
</a>
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
</div>
</div>
<div class="ec-pro-content">
<!-- raymart added style for text wrap feb 29, 2024 -->
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>" style="width: 90%; text-wrap: wrap;"><?php echo $product["product_name"] ?></a></h5>
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>"><?php echo $product["product_name"] ?></a></h5>
<div class="ec-pro-list-desc"><?php echo $product["product_description"] ?></div>
<span class="ec-price">
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
@ -775,7 +791,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<!-- 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>
@ -783,7 +799,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<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 -->
@ -1000,13 +1016,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<!-- Main Js -->
<script src="assets/js/vendor/index.js"></script>
<script src="assets/js/main.js"></script>
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester11.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}
?>
<script src="assets/js/tester3.js"></script>
</body>

View File

@ -872,7 +872,7 @@ if ($_SESSION["userId"] <> "") {
<!-- raymart added js link feb 14 2024 -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester10.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -92,9 +92,6 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">

View File

@ -105,9 +105,6 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">

View File

@ -94,9 +94,6 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">

View File

@ -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);

View File

@ -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>

View File

@ -88,9 +88,6 @@ if (is_array($vendorOrderss)) {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">

View File

@ -71,7 +71,6 @@ $products = productList();
</div>
</div>
<?php include 'header.php'; ?>
<?php include "category-slider.php" ?>
<!-- ekka Cart Start -->
<div class="ec-side-cart-overlay"></div>
<div id="ec-side-cart" class="ec-side-cart">
@ -190,9 +189,8 @@ $products = productList();
?>
</div>
<div class="ec-catalog-vendor-info">
<!-- raymart added to justify the content feb 26 2026 -->
<div class="row vendor-card-height" style="justify-content: space-evenly;">
<div class="col-lg-3 col-md-6 detail-card-space" >
<div class="row vendor-card-height">
<div class="col-lg-3 col-md-6 detail-card-space">
<div class="seller-name-level catalog-detail-card">
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">

View File

@ -81,9 +81,6 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">
@ -140,20 +137,14 @@ 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-color:orange; 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>
@ -166,17 +157,10 @@ if ($_SESSION["userId"] <> "") {
<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">
@ -184,7 +168,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>
@ -192,7 +176,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>
@ -355,7 +339,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}`, {
@ -368,7 +351,6 @@ if ($_SESSION["userId"] <> "") {
first_name: firstName,
last_name: lastName,
phone: phone,
vendor_description:description
})
})
.then(response => {
@ -391,22 +373,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
@ -420,19 +404,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();
});
})
@ -440,11 +428,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/`;
@ -460,6 +450,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);
@ -470,9 +461,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/`)
@ -485,6 +480,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);
@ -499,11 +495,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();
@ -515,6 +514,7 @@ if ($_SESSION["userId"] <> "") {
const country = $('#addressCountry').val();
// Create a new address object
const newAddress = {
first_name: firstName,
last_name: lastName,
@ -527,8 +527,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: {
@ -541,13 +543,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');
});
@ -705,18 +710,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">
@ -725,201 +723,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">
@ -943,12 +858,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>

View File

@ -79,9 +79,6 @@ $array = json_decode($result, true);
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">

View File

@ -116,12 +116,12 @@ if ($_SESSION["userId"] <> "") {
<?php include "header.php" ?>
<!-- Header End -->
<!-- ekka Cart Start -->
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
@ -770,10 +770,10 @@ if ($_SESSION["userId"] <> "") {
<script src="assets/js/vendor/index.js"></script>
<script src="assets/js/main.js"></script>
<!-- raymart added link from js feb 14 2024 -->
<!-- <script src="assets/js/tester10.js"></script> -->
<!-- <script src="assets/js/tester5.js"></script> -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester10.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}