Compare commits
14 Commits
ac74d7c61a
...
8982f54971
Author | SHA1 | Date |
---|---|---|
raymart | 8982f54971 | |
MarkHipe | cd347af5f2 | |
Jun Barroga | d9aae2efda | |
MarkHipe | 8d98f924ee | |
Jun Barroga | 5ef99b16ff | |
MarkHipe | 1c40f338e1 | |
Jun Barroga | 2e43720a0f | |
Jun Barroga | 1572bac6de | |
Jun Barroga | 3e8e62a131 | |
MarkHipe | 1e876e09ac | |
Stacy | 84f86370eb | |
erwin | 82b5b94cbd | |
Erwin Galang | 54ab59abb2 | |
MarkHipe | 682848438d |
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="stacyjoycemapano@gmail.com";
|
||||
$_SESSION["sales_email"]="stacyjoycemapano@gmail.com";
|
||||
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["sales_email"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
if ($_SESSION["is_test"]){
|
||||
$_SESSION["obpay"]="web.obpay.online/test";
|
||||
|
|
|
@ -81,7 +81,7 @@ if ($_SESSION["isLoggedIn"] == true and $_SESSION["user_type"] == "admin"){
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<form action="/login_action.php" method="post">
|
||||
<form action="../login_action.php" method="post">
|
||||
<div class="mb-3 mt-3">
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" class="form-control" id="email" placeholder="Enter email" name="name">
|
||||
|
|
|
@ -852,168 +852,212 @@ $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) {
|
||||
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();
|
||||
const originalEmail = document.getElementById('email-' + vendorId).defaultValue;
|
||||
const updatedEmail = document.getElementById('email-' + vendorId).value;
|
||||
const isEmailModified = originalEmail !== updatedEmail;
|
||||
|
||||
// Rest of the code for file upload and API request
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
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();
|
||||
|
||||
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];
|
||||
|
||||
// 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,
|
||||
}]
|
||||
};
|
||||
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;
|
||||
|
||||
// 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
user_email: updatedEmail,
|
||||
phone: phone,
|
||||
vendor_description: description,
|
||||
status: status,
|
||||
address: [{
|
||||
address_1: updatedAddress1,
|
||||
address_2: updatedAddress2,
|
||||
barangay: barangay,
|
||||
city: city,
|
||||
province: province,
|
||||
country: country,
|
||||
}]
|
||||
};
|
||||
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
});
|
||||
}else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
|
||||
const updatedUser = document.getElementById('user_login-' + vendorId).value;
|
||||
const firstName = document.getElementById('firstName-' + vendorId).value;
|
||||
const lastName = document.getElementById('lastName-' + vendorId).value;
|
||||
const updatedEmail = document.getElementById('email-' + vendorId).value;
|
||||
const phone = document.getElementById('phone-' + vendorId).value;
|
||||
const description = document.getElementById('description-' + vendorId).value;
|
||||
const status = document.getElementById('status-' + vendorId).value;
|
||||
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
|
||||
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
|
||||
const barangay = document.getElementById('barangay-' + vendorId).value;
|
||||
const city = document.getElementById('city-' + vendorId).value;
|
||||
const province = document.getElementById('province-' + vendorId).value;
|
||||
const country = document.getElementById('country-' + vendorId).value;
|
||||
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorId);
|
||||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
user_email: updatedEmail,
|
||||
phone: phone,
|
||||
vendor_description: description,
|
||||
status: status,
|
||||
address: [{
|
||||
address_1: updatedAddress1,
|
||||
address_2: updatedAddress2,
|
||||
barangay: barangay,
|
||||
city: city,
|
||||
province: province,
|
||||
country: country,
|
||||
}]
|
||||
};
|
||||
|
||||
// Make API request using the extracted filename
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function validateEmail(vendorId) {
|
||||
var emailInput = document.getElementById('email-' + vendorId);
|
||||
var email = emailInput.value;
|
||||
|
||||
if (email.trim() !== '') {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Failed to check email availability');
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
const isEmailAvailable = parseInt(data.results.length) === 0;
|
||||
$('#email-error-message-' + vendorId).text(isEmailAvailable ? '' : 'Email is already in use').show();
|
||||
return isEmailAvailable;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during email validation:', error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
}
|
||||
|
||||
function validateEmail(vendorId) {
|
||||
var emailInput = document.getElementById('email-' + vendorId);
|
||||
var email = emailInput.value;
|
||||
|
||||
if (email.trim() !== '') {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Failed to check email availability');
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
const isEmailAvailable = parseInt(data.results.length) === 0;
|
||||
$('#email-error-message-' + vendorId).text(isEmailAvailable ? '' : 'Email is already in use').show();
|
||||
return isEmailAvailable;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during email validation:', error);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$('#email-error-message-' + vendorId).text('').hide();
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
|
|
|
@ -35085,7 +35085,7 @@ input[type=email]:focus::-webkit-input-placeholder {
|
|||
.ec-vendor-profile-card .ec-vendor-block-profile .ec-vendor-block-img .ec-vendor-block-bg {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background-image: url(../images/banner/7.jpg);
|
||||
background-image:none;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
|
|
@ -491,7 +491,7 @@ function popupAddToCart(product, productVendor, token, email, password, customer
|
|||
var vendorObj = JSON.parse(productVendor);
|
||||
|
||||
var sessionToken = token;
|
||||
var productImage = productObj.product_image;
|
||||
var productImage = productObj.images;
|
||||
var productId = productObj._id;
|
||||
var productName = productObj.product_name;
|
||||
var productPrice = productObj.sale_price ? productObj.sale_price : productObj.regular_price;
|
||||
|
@ -600,13 +600,15 @@ 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="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
|
||||
<img src="${response.items[0].product.product_image}" alt="product">
|
||||
<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="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
|
||||
<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>
|
||||
|
@ -675,25 +677,27 @@ 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="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>
|
||||
`;
|
||||
<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>
|
||||
`;
|
||||
document.getElementById(`qty-input-${response.items[0]._id}`).value = updatedQuantity;
|
||||
} else {
|
||||
// If the cart item doesn't exist, create a new one
|
|
@ -97,6 +97,7 @@ 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">
|
||||
|
@ -228,7 +229,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<div class="ec-catalog-vendor-info row">
|
||||
<div class="ec-catalog-vendor-info row" style="justify-content: center;">
|
||||
<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>
|
||||
|
@ -1114,7 +1115,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- raymart added js link feb 14 2024 -->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester5.js"></script>';
|
||||
echo '<script src="assets/js/tester11.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,387 @@
|
|||
<!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">
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
119
checkouttest.php
119
checkouttest.php
|
@ -577,18 +577,29 @@ 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">
|
||||
<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" /> -->
|
||||
<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
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-pro-content">
|
||||
<h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php"><?php echo $item['product']['name']; ?></a></h5>
|
||||
<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>
|
||||
<div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
|
@ -599,13 +610,28 @@ 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 $checkout['shipping_fee']; ?></span>
|
||||
<span class="new-price">Shipping Fee: <?php echo $shippingFee; ?></span>
|
||||
</span>
|
||||
<span class="ec-price">
|
||||
<span class="new-price">Subtotal: <?php echo $checkout['shipping_fee'] + $checkout['total_amount']; ?></span>
|
||||
<span class="new-price">Subtotal: <?php echo $shippingFee + $checkout['total_amount']; ?></span>
|
||||
</span>
|
||||
<div class="ec-pro-option">
|
||||
<!-- 02-22-2024 Stacy hide variation -->
|
||||
<!-- <div class="ec-pro-option">
|
||||
<div class="ec-pro-color">
|
||||
<span class="ec-pro-opt-label">Color</span>
|
||||
<ul class="ec-opt-swatch ec-change-img">
|
||||
|
@ -629,7 +655,8 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- 02-22-2024 Stacy hide variation -->
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
@ -722,7 +749,21 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
<?php
|
||||
$totalAmount = 0;
|
||||
foreach ($cartItems as $checkout) {
|
||||
$totalAmount += $checkout['total_amount'] + $checkout['shipping_fee'];
|
||||
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'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -854,13 +895,18 @@ 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: `ordered from obanana ecommerce website`,
|
||||
description: itemNames.join(', '),
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -877,51 +923,6 @@ 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; ?>;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -521,8 +521,9 @@ function vendorExists($email)
|
|||
function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$salesEmail = $_SESSION["sales_email"];
|
||||
$msgto_obanana = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
|
@ -541,7 +542,7 @@ function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
|||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $testEmail,
|
||||
"Email" => $salesEmail,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
|
@ -639,8 +640,9 @@ function sendEmail_customer($fName, $lName, $email)
|
|||
function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
$cstm_email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$salesEmail = $_SESSION["sales_email"];
|
||||
$msgto_seller = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
|
@ -659,7 +661,7 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
|||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $testEmail,
|
||||
"Email" => $salesEmail,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
|
@ -697,9 +699,9 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
|||
|
||||
function contact_Inquirer($cstm_email)
|
||||
{
|
||||
// if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
// $testEmail = $_SESSION["test_email_rcpt"];
|
||||
// }
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$cstm_email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$msgto_inquirer = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
|
@ -717,8 +719,8 @@ function contact_Inquirer($cstm_email)
|
|||
],
|
||||
"To" => [
|
||||
[
|
||||
// "Email" => $cstm_email,
|
||||
"Email" => "stacyjoycemapano@gmail.com",
|
||||
"Email" => $cstm_email,
|
||||
//"Email" => "stacyjoycemapano@gmail.com",
|
||||
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
|
@ -1382,17 +1384,23 @@ function getOrderbyVendorId($id)
|
|||
return $response;
|
||||
}
|
||||
|
||||
function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $token)
|
||||
function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $paymentStatus, $paymentReference, $token)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$data = array(
|
||||
'status' => $status
|
||||
);
|
||||
if ($currentStatus == "TO SHIP" || $currentStatus == "T Ship") {
|
||||
if ($currentStatus == "TO SHIP" || $currentStatus == "To Ship") {
|
||||
// $data['tracking_number'] = $trackingNumber;
|
||||
$data['tracking_number'] = $trackingNumber;
|
||||
$data['courier_name'] = $courierName;
|
||||
}
|
||||
if ($currentStatus == "TO RECEIVE" || $currentStatus == "To Receive") {
|
||||
// $data['tracking_number'] = $trackingNumber;
|
||||
$data['payment']['status'] = $paymentStatus;
|
||||
$data['payment']['reference_number'] = $paymentReference;
|
||||
|
||||
}
|
||||
$params3 = json_encode($data);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders/" . $orderId,
|
||||
|
|
28
header.php
28
header.php
|
@ -228,7 +228,7 @@
|
|||
?><?php
|
||||
if ($_SESSION["isVendor"]) {
|
||||
?>
|
||||
<li><a class="dropdown-item" href="vendor-settings.php">My Account</a></li>
|
||||
<li><a class="dropdown-item" href="vendor-dashboard.php">My Account</a></li>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
@ -378,7 +378,23 @@
|
|||
$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"><img src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></a>
|
||||
<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>
|
||||
<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>
|
||||
|
@ -977,15 +993,15 @@
|
|||
<li><a href="javascript:void(0)" data-scroll="collection" class="nav-scroll">Top
|
||||
Collection</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="categories" class="nav-scroll">Categories</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="offers" class="nav-scroll">Offers</a></li>
|
||||
<!-- <li><a href="javascript:void(0)" data-scroll="offers" class="nav-scroll">Offers</a></li> -->
|
||||
<li><a href="javascript:void(0)" data-scroll="vendors" class="nav-scroll">Top
|
||||
Vendors</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="services" class="nav-scroll">Services</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="arrivals" class="nav-scroll">New
|
||||
Arrivals</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="reviews" class="nav-scroll">Client
|
||||
Review</a></li>
|
||||
<li><a href="javascript:void(0)" data-scroll="insta" class="nav-scroll">Instagram Feed</a></li>
|
||||
<!-- <li><a href="javascript:void(0)" data-scroll="reviews" class="nav-scroll">Client
|
||||
Review</a></li> -->
|
||||
<!-- <li><a href="javascript:void(0)" data-scroll="insta" class="nav-scroll">Instagram Feed</a></li> -->
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
391
index.php
391
index.php
|
@ -110,348 +110,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Category Sidebar start -->
|
||||
<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>
|
||||
<?php include "category-slider.php" ?>
|
||||
|
||||
<!-- Main Slider Start -->
|
||||
<div class="sticky-header-next-sec ec-main-slider section section-space-pb">
|
||||
|
@ -566,7 +225,9 @@ 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">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- 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">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $forAll[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
|
@ -576,7 +237,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" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -592,7 +253,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</a> -->
|
||||
<!-- <span class="percentage">20%</span> -->
|
||||
<!-- raymart edit action -->
|
||||
<div class="ec-pro-actions">
|
||||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<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>
|
||||
|
@ -669,7 +330,9 @@ 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">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- 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">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $electronics[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
|
@ -679,7 +342,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" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -696,7 +359,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- <span class="percentage">20%</span> -->
|
||||
|
||||
<!-- raymart edit action feb 14 2024-->
|
||||
<div class="ec-pro-actions">
|
||||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<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>
|
||||
|
@ -774,7 +437,9 @@ 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">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- 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">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $smartHome[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
|
@ -784,7 +449,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" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -800,7 +465,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</a> -->
|
||||
<!-- <span class="percentage">20%</span> -->
|
||||
<!-- raymart edit action feb 14 2024-->
|
||||
<div class="ec-pro-actions">
|
||||
<div class="ec-pro-actions"style="bottom: -36px;">
|
||||
<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>
|
||||
|
@ -877,7 +542,9 @@ 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">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- 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">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $forVehicle[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
|
@ -887,7 +554,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" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -903,7 +570,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</a> -->
|
||||
<!-- <span class="percentage">20%</span> -->
|
||||
<!-- raymart added action feb 14 2024-->
|
||||
<div class="ec-pro-actions">
|
||||
<div class="ec-pro-actions"style="bottom: -36px;">
|
||||
<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>
|
||||
|
@ -1326,7 +993,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: 200; height: 200; overflow: hidden;">
|
||||
<div class="ec-vendor-avtar" style="width: 75px; height: 75px; 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">
|
||||
|
@ -1354,7 +1021,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$randomProducts = array_slice($vendorProducts, 0, 4);
|
||||
|
||||
foreach ($randomProducts as $product) { ?>
|
||||
<div class="ec-prod-img">
|
||||
<!-- raymart added style feb 26 2024 -->
|
||||
<div class="ec-prod-img" style="max-width: 140px; height: 150px;">
|
||||
<!-- <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 } ?>
|
||||
|
@ -1483,7 +1152,9 @@ 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">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- 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">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $newArrival[$pid]["_id"]; ?>">
|
||||
<!-- raymart added function for images feb 21 2024-->
|
||||
|
@ -1493,7 +1164,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" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -1508,7 +1179,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">
|
||||
<div class="ec-pro-actions"style="bottom: -36px;">
|
||||
<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>
|
||||
|
@ -2160,7 +1831,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- raymart added js feb 14, 2024-->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester5.js"></script>';
|
||||
echo '<script src="assets/js/tester11.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
|
@ -320,7 +320,9 @@ if (isset($_GET['id'])) {
|
|||
$productImage = $i;
|
||||
}
|
||||
?>
|
||||
<img class="img-responsive" src="<?php echo $productImage; ?>" alt="" style="width: 100%; height: 100%; object-fit: cover; object-position: center center;">
|
||||
<!-- <img class="img-responsive" src="<?php #echo $productImage; ?>" alt="" style="width: 100%; height: 100%; object-fit: cover; object-position: center center;"> -->
|
||||
<!-- 02-26-2024 Stacy updated img width & height -->
|
||||
<img class="img-responsive" src="<?php echo $productImage; ?>" alt="" style="max/width: 90px; height: 120px; object-fit: cover; object-position: center center;">
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
@ -336,7 +338,8 @@ if (isset($_GET['id'])) {
|
|||
<h5 class="ec-single-title" id="productTitle"><?php echo $product_details['product_name']; ?></h5>
|
||||
<!-- <h5 class="ec-single-title" id="productTitlemodal"><?php echo $product_details['product_name']; ?></h5> -->
|
||||
|
||||
<div class="ec-single-rating-wrap">
|
||||
<!-- 02-22-2024 Stacy hide -->
|
||||
<!-- <div class="ec-single-rating-wrap">
|
||||
<div class="ec-single-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
|
@ -346,10 +349,11 @@ if (isset($_GET['id'])) {
|
|||
</div>
|
||||
<span class="ec-read-review"><a href="#ec-spt-nav-review">Be the first to
|
||||
review this product</a></span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="ec-single-desc" id="shortDescription"><?php echo $product_details['product_description']; ?></div>
|
||||
|
||||
<div class="ec-single-sales">
|
||||
<!-- 02-22-2024 Stacy hide -->
|
||||
<!-- <div class="ec-single-sales">
|
||||
<div class="ec-single-sales-inner">
|
||||
<div class="ec-single-sales-title">sales accelerators</div>
|
||||
<div class="ec-single-sales-visitor">real time <span>24</span> visitor
|
||||
|
@ -364,7 +368,8 @@ if (isset($_GET['id'])) {
|
|||
<div class="ec-single-count-desc">Time is Running Out!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ec-single-price-stoke">
|
||||
<div class="ec-single-price">
|
||||
<span class="ec-single-ps-title">As low as</span>
|
||||
|
@ -397,32 +402,32 @@ if (isset($_GET['id'])) {
|
|||
<div class="ec-pro-variation-content">
|
||||
<ul class="eccart-pro-items">
|
||||
<?php
|
||||
$main_product_image = isset($product_details["product_image"]) ? $product_details["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($product_details), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $main_product_image; ?>" alt="product">
|
||||
<?php foreach ($product_details['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
$main_product_image = isset($product_details["product_image"]) ? $product_details["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($product_details), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $main_product_image; ?>" alt="product">
|
||||
<?php foreach ($product_details['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
foreach ($variation_details as $index => $variation) {
|
||||
$variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($variation), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $variationImage; ?>" alt="product">
|
||||
<?php foreach ($variation['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
foreach ($variation_details as $index => $variation) {
|
||||
$variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
|
||||
?>
|
||||
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($variation), ENT_QUOTES, 'UTF-8'); ?>)">
|
||||
<li style="width: 100px; height: 100px">
|
||||
<img src="<?php echo $variationImage; ?>" alt="product">
|
||||
<?php foreach ($variation['variables'] as $variable) { ?>
|
||||
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -462,35 +467,57 @@ foreach ($variation_details as $index => $variation) {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- 20240212 Jun Jihad Include Parent Product in the Variation Selection -->
|
||||
<!-- 20240212 Jun Jihad Include Parent Product in the Variation Selection -->
|
||||
|
||||
<!-- 02-22-2024 Stacy modified this block of code -->
|
||||
<div class="ec-single-qty">
|
||||
|
||||
<div class="qty-plus-minuses">
|
||||
<div class="qty-btn" onclick="decrement()">-</div>
|
||||
<input class="qty-inputs" type="number" name="ec_qtybtn" value="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" />
|
||||
<div class="qty-btn" onclick="increment()">+</div>
|
||||
</div>
|
||||
|
||||
<div class="ec-single-cart">
|
||||
<div class="qty-plus-minuses" style="display:flex; overflow:visible;">
|
||||
<!-- <div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()">-</div>
|
||||
<input class="qty-inputs" style="width:100px; height:40px" type="number" name="ec_qtybtn" value="<?php #echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" />
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div> -->
|
||||
|
||||
<div class="ec-single-cart" style="display:flex; flex-direction:row; width:80%; overflow:visible; text-align:center; align-items:center; ">
|
||||
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
|
||||
<?php
|
||||
if ($_SESSION["isLoggedIn"]) {
|
||||
if ($product_details['product_type'] === "variable") {
|
||||
echo '<button class="btn btn-primary" id="addToCartButton" style="display:none">Add To Cart</button>';
|
||||
echo '<button type="button" class="btn btn-primary" id="contactSellerButton" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
} else {
|
||||
if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) {
|
||||
echo '<div id="addToCartMessage"></div>';
|
||||
echo '<button class="btn btn-primary" id="addToCartButton">Add To Cart</button>';
|
||||
} else {
|
||||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<p>Please log in to add to cart.</p>';
|
||||
}
|
||||
?>
|
||||
if ($_SESSION["isLoggedIn"]) {
|
||||
if ($product_details['product_type'] === "variable") {
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()">-</div>';
|
||||
echo '<input class="qty-inputs" style="width:110px; height:40px" type="number" name="ec_qtybtn" value="';
|
||||
echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1";
|
||||
echo '" id="qty-input" />';
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div>';
|
||||
echo '<div style="display:flex; margin-left:45px;"><button type="button" class="btn btn-primary" id="contactSellerButton" style="background:#ffaa00; width:190px;" data-bs-toggle="modal" data-bs-target="#priceModal"><i class="fi-rr-envelope" style="font-size:20px; margin-bottom:-3px; margin-right:10px;"></i>Contact Seller</button>';
|
||||
echo '<div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart" style="color:#B80F0A; font-size:20px;"></i></a>
|
||||
</div></div>';
|
||||
|
||||
} else {
|
||||
if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) {
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()">-</div>';
|
||||
echo '<input class="qty-inputs" style="width:100px; height:40px" type="number" name="ec_qtybtn" value="';
|
||||
echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1";
|
||||
echo '" id="qty-input" />';
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div>';
|
||||
echo '<div id="addToCartMessage"></div>';
|
||||
echo '<button class="btn btn-primary" id="addToCartButton" style="background:#ffaa00; margin-left:55px;"><i class="fi-rr-shopping-bag" style="font-size:20px; margin-bottom:-3px; margin-right:10px;"></i>Add To Cart</button>';
|
||||
echo '<div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart" style="color:#B80F0A; font-size:20px;"></i></a>
|
||||
</div>';
|
||||
} else {
|
||||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<div class="login-button" style=""><p style="color:red; text-wrap:nowrap;">Please log in to your account.</p>';
|
||||
echo '<a href="login.php" style="margin-left:-2px;"><button type="button" class="btn btn-primary" style="margin-left:-2px; margin-top:-20px; background:#ffaa00; border-radius:10px; letter-spacing:1px;" data-bs-toggle="modal">LOGIN</button></a></div>';
|
||||
}
|
||||
?>
|
||||
<!-- <div class="ec-single-wishlist" style="border: 1px solid yellow;">
|
||||
<a class="ec-btn-group wishlist" style="padding-left:40px;" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart"></i></a>
|
||||
</div> -->
|
||||
<!-- 02-22-2024 Stacy modified this block of code -->
|
||||
|
||||
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
|
||||
|
||||
|
||||
|
@ -509,10 +536,9 @@ foreach ($variation_details as $index => $variation) {
|
|||
// echo '<p>Please log in to add to cart.</p>';
|
||||
// }
|
||||
?> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="priceModal" tabindex="-1" role="dialog" aria-labelledby="priceModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
|
@ -584,9 +610,10 @@ foreach ($variation_details as $index => $variation) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ec-single-wishlist">
|
||||
<!-- <div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart"></i></a>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="ec-single-quickview">
|
||||
<a href="#" class="ec-btn-group quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
|
||||
</div> -->
|
||||
|
@ -1918,7 +1945,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
<!-- 02-21-2024 Stacy added js link -->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester5.js"></script>';
|
||||
echo '<script src="assets/js/tester11.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
|
@ -900,7 +900,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script src="assets/js/main.js"></script>
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester5.js"></script>';
|
||||
echo '<script src="assets/js/tester11.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
|
@ -4,13 +4,16 @@
|
|||
$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 "Processing category: $category <br>";
|
||||
|
||||
|
||||
echo $categoryFinal;
|
||||
// You can add your logic here
|
||||
}
|
||||
$minPrice = isset($_POST['minPrice']) ? $_POST['minPrice'] : null;
|
||||
|
|
|
@ -15,90 +15,55 @@ $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)) {
|
||||
|
||||
if (!empty($selectedCategories) && (($minPrice == null) && ($maxPrice == null))) {
|
||||
foreach ($selectedCategories as $selectedCategory) {
|
||||
$category = strtolower(trim($selectedCategory));
|
||||
|
||||
foreach ($productSearchResult['results'] as $result) {
|
||||
$product = $result['product'];
|
||||
|
||||
$productCategory = strtolower(trim($product['product_category']));
|
||||
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
|
||||
if ($minPrice === null) {
|
||||
$minPrice = 0;
|
||||
}
|
||||
|
||||
if ($maxPrice === null) {
|
||||
$maxPrice = PHP_FLOAT_MAX;
|
||||
}
|
||||
|
||||
if (
|
||||
$productCategory == $category &&
|
||||
($minPrice === null || $productPrice >= $minPrice) &&
|
||||
($maxPrice === null || $productPrice <= $maxPrice)
|
||||
$productCategory == $category
|
||||
) {
|
||||
$filteredProducts[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} 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 (
|
||||
$productCategory = $category && (($productPrice >= $minPrice) &&
|
||||
($productPrice <= $maxPrice))
|
||||
) {
|
||||
$filteredProducts[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($productSearchResult['results'] as $result) {
|
||||
$product = $result['product'];
|
||||
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
|
||||
|
@ -108,7 +73,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)
|
||||
) {
|
||||
|
@ -205,6 +170,7 @@ 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 -->
|
||||
|
@ -342,26 +308,44 @@ 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">
|
||||
<div class="ec-pro-image-outer" style="width: 290px; height: 200px;">
|
||||
<div class="ec-pro-image">
|
||||
<a href="shop-left-sidebar-col-4.php" class="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">
|
||||
<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($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>
|
||||
<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>
|
||||
</div>
|
||||
<div class="ec-pro-content">
|
||||
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>"><?php echo $product["product_name"] ?></a></h5>
|
||||
<!-- raymart 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>
|
||||
<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) : ?>
|
||||
|
@ -791,7 +775,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>
|
||||
|
@ -799,7 +783,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 -->
|
||||
|
@ -1016,7 +1000,13 @@ 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>
|
||||
<script src="assets/js/tester3.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>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -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/tester5.js"></script>';
|
||||
echo '<script src="assets/js/tester10.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
|
@ -5,15 +5,19 @@ $orderId = $_SESSION['vendorOrderId'];
|
|||
$currentStatus = $_POST['order_status'];
|
||||
$trackingNumber = $_POST['tracking_number'];
|
||||
$courirerName = $_POST['courier_name'];
|
||||
$paymentReference = $_POST['payment_reference'];
|
||||
$token = $_SESSION['token'];
|
||||
// $status = "TO SHIP";
|
||||
|
||||
if ($currentStatus === 'TO PAY' || $currentStatus === 'To Pay') {
|
||||
$status = 'TO SHIP';
|
||||
$paymentStatus = 'UNPAID';
|
||||
} elseif ($currentStatus === 'TO SHIP' || $currentStatus === 'To Ship') {
|
||||
$status = 'TO RECEIVE';
|
||||
$paymentStatus = 'UNPAID';
|
||||
} elseif ($currentStatus === 'TO RECEIVE' || $currentStatus === 'To Receive') {
|
||||
$status = 'COMPLETED';
|
||||
$paymentStatus = 'PAID';
|
||||
}
|
||||
|
||||
$response = editOrderStatus(
|
||||
|
@ -22,6 +26,8 @@ $response = editOrderStatus(
|
|||
$currentStatus,
|
||||
$trackingNumber,
|
||||
$courirerName,
|
||||
$paymentStatus,
|
||||
$paymentReference,
|
||||
$token
|
||||
);
|
||||
$array = json_decode($response,true);
|
||||
|
|
|
@ -199,6 +199,10 @@ $array = json_decode($result, true);
|
|||
<label for="inputEmail4" class="form-label">Payment Status</label>
|
||||
<input type="text" class="form-control slug-title" value="<?php echo $array['payment']['status'] ?>" readonly>
|
||||
</div>
|
||||
<div class="col-md-6" style="display:none;">
|
||||
<label for="inputEmail4" class="form-label">Payment Reference</label>
|
||||
<input type="text" name="payment_reference" class="form-control slug-title" value="<?php echo htmlspecialchars($array['payment']['reference_number']); ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="inputEmail4" class="form-label">Status</label>
|
||||
<input type="text" class="form-control slug-title" name="order_status" value="<?php echo $array['status'] ?>" readonly>
|
||||
|
|
|
@ -122,7 +122,7 @@ if (is_array($vendorOrderss)) {
|
|||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<div class="ec-vendor-block-bg" style="background-color:orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<div class="ec-vendor-block-detail">
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
|
@ -160,7 +160,8 @@ if (is_array($vendorOrderss)) {
|
|||
<h3> <?php echo count($vendorOrders); ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<!-- 02-26-2024 Stacy commented out -->
|
||||
<!-- <div class="col-lg-3 col-md-6">
|
||||
<div class="ec-vendor-dashboard-sort-card color-green">
|
||||
<h5>Earnings</h5>
|
||||
<h3>$56<span>/ Day</span></h3>
|
||||
|
@ -171,7 +172,7 @@ if (is_array($vendorOrderss)) {
|
|||
<h5>Sales</h5>
|
||||
<h3>550<span>/ Mo</span></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="ec-vendor-dashboard-card space-bottom-30">
|
||||
<div class="ec-vendor-card-header">
|
||||
|
@ -426,7 +427,8 @@ if (is_array($vendorOrderss)) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<!-- 02-26-2024 Stacy commented out -->
|
||||
<!-- <div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-card-header">
|
||||
<h5>Growth statastics</h5>
|
||||
<div class="ec-header-btn">
|
||||
|
@ -436,7 +438,7 @@ if (is_array($vendorOrderss)) {
|
|||
<div class="ec-vendor-card-body">
|
||||
<canvas id="growthChart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -71,6 +71,7 @@ $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">
|
||||
|
@ -189,8 +190,9 @@ $products = productList();
|
|||
?>
|
||||
</div>
|
||||
<div class="ec-catalog-vendor-info">
|
||||
<div class="row vendor-card-height">
|
||||
<div class="col-lg-3 col-md-6 detail-card-space">
|
||||
<!-- 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="seller-name-level catalog-detail-card">
|
||||
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
|
||||
|
|
|
@ -137,26 +137,43 @@ 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 ">
|
||||
<div class="ec-vendor-block-bg profBg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;" id="myElement">
|
||||
<?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; ?>">
|
||||
<a href="#" class="btn btn-lg btn-primary" data-link-action="editmodal" title="Edit Detail" data-bs-toggle="modal" data-bs-target="#edit_modal">Edit Detail</a>
|
||||
</div>
|
||||
|
||||
<div class="ec-vendor-block-detail">
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<!-- 02-26-2024 Stacy added placeholder-->
|
||||
<?php
|
||||
$vendor_image = isset($vendorData[0]['vendor_image']) ? $vendorData[0]['vendor_image'] : 'https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg';
|
||||
?>
|
||||
<img class="v-img" src=<?php echo $vendor_image ?> alt="vendor image">
|
||||
<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>
|
||||
<p><?php echo $vendorData["vendor_description"] ?></p>
|
||||
<?php if (!empty($vendorData['vendor_description'])): ?>
|
||||
<p><?php echo $vendorData['vendor_description']; ?></p>
|
||||
<?php else: ?>
|
||||
<p>No description available.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<!-- 02-23-2023 Jun Jihad Vendor Description -->
|
||||
<h5>Account Information</h5>
|
||||
|
||||
<div class="row">
|
||||
|
@ -164,7 +181,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-detail-block ec-vendor-block-email space-bottom-30">
|
||||
<h6>E-mail address </h6>
|
||||
<ul>
|
||||
<li><strong><?php echo $vendorData["user_email"] ?></strong></li>
|
||||
<li style="padding:3%"><strong><?php echo $vendorData["user_email"] ?></strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -172,7 +189,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-detail-block ec-vendor-block-contact space-bottom-30">
|
||||
<h6>Contact nubmer</h6>
|
||||
<ul>
|
||||
<li><strong><?php echo $vendorData["phone"] ?></strong></li>
|
||||
<li style="padding:3%"><strong><?php echo $vendorData["phone"] ?></strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -335,6 +352,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
const firstName = document.getElementById('cfirstname-').value;
|
||||
const lastName = document.getElementById('clastname-').value;
|
||||
const phone = document.getElementById('cphone-').value;
|
||||
const description = document.getElementById('cdescription-').value;
|
||||
|
||||
// If no file selected, only update the email
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`, {
|
||||
|
@ -347,6 +365,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
phone: phone,
|
||||
vendor_description:description
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
|
@ -369,24 +388,22 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script>
|
||||
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 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
|
||||
const provinceSelect = $('#provinceSelect');
|
||||
const citySelect = $('#citySelect');
|
||||
const barangaySelect = $('#barangaySelect');
|
||||
|
||||
// Initialize Select2 on the provinceSelect, citySelect, and barangaySelect elements
|
||||
provinceSelect.select2({
|
||||
dropdownParent: $('#secondModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
containerCssClass: 'select2-zindex-high'
|
||||
});
|
||||
|
||||
citySelect.select2({
|
||||
dropdownParent: $('#secondModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
containerCssClass: 'select2-zindex-high'
|
||||
});
|
||||
barangaySelect.select2({
|
||||
dropdownParent: $('#secondModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
containerCssClass: 'select2-zindex-high'
|
||||
});
|
||||
|
||||
// Fetch provinces data
|
||||
|
@ -400,23 +417,19 @@ 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();
|
||||
});
|
||||
})
|
||||
|
@ -424,13 +437,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
console.error('Error:', error);
|
||||
});
|
||||
|
||||
// Function to update city/municipality options based on the selected province
|
||||
function updateCities() {
|
||||
const selectedProvinceCode = provinceSelect.val(); // Use val() to get the selected value with Select2
|
||||
const selectedProvinceCode = provinceSelect.val();
|
||||
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/`;
|
||||
|
@ -446,7 +457,6 @@ 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);
|
||||
|
@ -457,13 +467,9 @@ 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/`)
|
||||
|
@ -476,7 +482,6 @@ 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);
|
||||
|
@ -491,14 +496,11 @@ 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();
|
||||
|
@ -510,7 +512,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
const country = $('#addressCountry').val();
|
||||
|
||||
|
||||
// Create a new address object
|
||||
const newAddress = {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
|
@ -523,10 +524,8 @@ 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: {
|
||||
|
@ -539,16 +538,13 @@ 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');
|
||||
});
|
||||
|
@ -706,11 +702,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
<label><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<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 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-block-detail">
|
||||
<div class="thumb-upload">
|
||||
|
@ -719,118 +722,201 @@ if ($_SESSION["userId"] <> "") {
|
|||
<label><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<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 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>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
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);
|
||||
function uploadVendorProfileImage() {
|
||||
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
|
||||
var file = document.getElementById('imageUpload').files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
|
||||
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;
|
||||
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;
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
|
||||
};
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
|
||||
console.log('Payload:', payload);
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
|
||||
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);
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', vendorid);
|
||||
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 = 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 = encodeURI(result.filename);
|
||||
|
||||
const payload = {
|
||||
vendor_banner: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
const payload = {
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
};
|
||||
|
||||
};
|
||||
console.log('Payload:', payload);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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">
|
||||
|
@ -854,6 +940,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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>
|
||||
|
|
|
@ -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/tester5.js"></script> -->
|
||||
<!-- <script src="assets/js/tester10.js"></script> -->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester5.js"></script>';
|
||||
echo '<script src="assets/js/tester10.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue