Compare commits
10 Commits
22a3a404aa
...
fd8016afd0
Author | SHA1 | Date |
---|---|---|
MarkHipe | fd8016afd0 | |
mark H | 7c5c0cab4f | |
mark H | 6160b494c9 | |
MarkHipe | 478b74c465 | |
Stacy | 62c2d9ae1b | |
Stacy | 7d44fae6bd | |
Stacy | 02b2f799db | |
Stacy | 1d6b14208d | |
Stacy | 8439191bbc | |
MarkHipe | 3d686c607f |
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["test_email_rcpt"]="kramblooda@gmail.com";
|
||||
$_SESSION["sales_email"]="sales@obanana.com";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
$_SESSION["transfer_fee"]=0.02;
|
||||
|
|
|
@ -506,9 +506,34 @@ function popupAddToCart(
|
|||
} catch (error) {
|
||||
console.error("Error parsing customer JSON: ", error);
|
||||
}
|
||||
let vendorData = decodeURIComponent(productVendor);
|
||||
|
||||
var vendorObj = JSON.parse(vendorData);
|
||||
let vendorData = null;
|
||||
console.log(productVendor);
|
||||
if (
|
||||
productVendor === undefined ||
|
||||
productVendor === null ||
|
||||
productVendor === "undefined"
|
||||
) {
|
||||
console.log("here i am");
|
||||
var vendorCheckXhr = new XMLHttpRequest();
|
||||
vendorCheckXhr.open(
|
||||
"GET",
|
||||
"https://api.obanana.shop/api/v1/vendors/" + productData.vendor_api_id,
|
||||
true
|
||||
);
|
||||
vendorCheckXhr.onreadystatechange = function () {
|
||||
if (vendorCheckXhr.readyState === 4) {
|
||||
if (vendorCheckXhr.status === 200) {
|
||||
var vendorObj = JSON.parse(vendorCheckXhr.responseText);
|
||||
console.log(vendorObj);
|
||||
}
|
||||
}
|
||||
};
|
||||
vendorCheckXhr.send();
|
||||
} else {
|
||||
vendorData = decodeURIComponent(productVendor);
|
||||
console.log("vendorData");
|
||||
var vendorObj = JSON.parse(vendorData);
|
||||
}
|
||||
|
||||
var sessionToken = token;
|
||||
var productImage = productObj.images;
|
||||
|
@ -541,52 +566,57 @@ function popupAddToCart(
|
|||
console.log("Customer Names: " + customerName);
|
||||
|
||||
login(email, password, function (token) {
|
||||
var priceMatrix = productObj.price_matrix !=="" ? productObj.price_matrix : "[]";
|
||||
// var quantityValue = productData.quantity;
|
||||
var minimumOrder = productObj.minimum_order;
|
||||
var priceMatrix =
|
||||
productObj.price_matrix !== "" ? productObj.price_matrix : "[]";
|
||||
// var quantityValue = productData.quantity;
|
||||
var minimumOrder = productObj.minimum_order;
|
||||
|
||||
var quantityValue = productObj.minimum_order =="" ? productQuantity : '1';
|
||||
var quantityValue = productObj.minimum_order == "" ? productQuantity : "1";
|
||||
|
||||
|
||||
// var minimumOrder = productObj.minimum_order !=="" ? productObj.minimum_order : '1';
|
||||
// var quantityValue = minimumOrder ;
|
||||
|
||||
// var minimumOrder = productObj.minimum_order !=="" ? productObj.minimum_order : '1';
|
||||
// var quantityValue = minimumOrder ;
|
||||
if (parseInt(quantityValue) < minimumOrder) {
|
||||
quantityValue = minimumOrder;
|
||||
alert("The minimum order quantity is " + minimumOrder);
|
||||
}
|
||||
|
||||
if (parseInt(quantityValue) < minimumOrder) {
|
||||
quantityValue = minimumOrder;
|
||||
alert("The minimum order quantity is " + minimumOrder);
|
||||
}
|
||||
//Apply Matrix
|
||||
var productPrice;
|
||||
var foundPrice = false;
|
||||
|
||||
|
||||
|
||||
//Apply Matrix
|
||||
var productPrice;
|
||||
var foundPrice = false;
|
||||
|
||||
if (priceMatrix.length > 0) {
|
||||
for (var i = 0; i < priceMatrix.length; i++) {
|
||||
for (var j = 0; j < priceMatrix[i].length; j++) {
|
||||
var currentQuantity = parseFloat(priceMatrix[i][j].quantity);
|
||||
var nextQuantity = (j < priceMatrix[i].length - 1) ? parseFloat(priceMatrix[i][j + 1].quantity) : Infinity;
|
||||
|
||||
if (quantityValue >= currentQuantity && quantityValue < nextQuantity) {
|
||||
productPrice = parseFloat(priceMatrix[i][j].price);
|
||||
foundPrice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundPrice) {
|
||||
break;
|
||||
}
|
||||
if (priceMatrix.length > 0) {
|
||||
for (var i = 0; i < priceMatrix.length; i++) {
|
||||
for (var j = 0; j < priceMatrix[i].length; j++) {
|
||||
var currentQuantity = parseFloat(priceMatrix[i][j].quantity);
|
||||
var nextQuantity =
|
||||
j < priceMatrix[i].length - 1
|
||||
? parseFloat(priceMatrix[i][j + 1].quantity)
|
||||
: Infinity;
|
||||
|
||||
if (
|
||||
quantityValue >= currentQuantity &&
|
||||
quantityValue < nextQuantity
|
||||
) {
|
||||
productPrice = parseFloat(priceMatrix[i][j].price);
|
||||
foundPrice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundPrice) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundPrice) {
|
||||
productPrice = productObj.sale_price ? productObj.sale_price : productObj.regular_price;
|
||||
// productPrice = parseFloat(document.getElementById("productNewPrice") ? document.getElementById("productNewPrice").innerText : document.getElementById("productPrice"));
|
||||
// productPrice = parseFloat(document.getElementById("productNewPrice") ? document.getElementById("productNewPrice").innerText : document.getElementById("productPrice"));
|
||||
// productPrice;
|
||||
}
|
||||
if (!foundPrice) {
|
||||
productPrice = productObj.sale_price
|
||||
? productObj.sale_price
|
||||
: productObj.regular_price;
|
||||
// productPrice = parseFloat(document.getElementById("productNewPrice") ? document.getElementById("productNewPrice").innerText : document.getElementById("productPrice"));
|
||||
// productPrice = parseFloat(document.getElementById("productNewPrice") ? document.getElementById("productNewPrice").innerText : document.getElementById("productPrice"));
|
||||
// productPrice;
|
||||
}
|
||||
|
||||
var productData = {
|
||||
product: {
|
||||
|
@ -696,7 +726,7 @@ function popupAddToCart(
|
|||
: "https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png";
|
||||
console.log(response);
|
||||
|
||||
newOrder.innerHTML = `
|
||||
newOrder.innerHTML = `
|
||||
<input type="checkbox" class="rowcartCheckbox" name="cart-item[]" value="${response._id}"/>
|
||||
<a href="product-left-sidebar.php?id=${response.items[0]._id}" class="sidekka_pro_img">
|
||||
<img src="${imageUrl}" alt="product" />
|
||||
|
@ -736,7 +766,7 @@ function popupAddToCart(
|
|||
}
|
||||
|
||||
function getLatestOrders() {
|
||||
var customerId = '<?php echo $customer_data[0][\'_id\'] ?>'
|
||||
var customerId = "<?php echo $customer_data[0]['_id'] ?>";
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/customer/${customerId}`)
|
||||
.then((response) => response.json())
|
||||
|
@ -831,32 +861,38 @@ function popupAddToCart(
|
|||
var updatedQuantity = existingQuantity + newQuantity;
|
||||
|
||||
// Check if the updated quantity exceeds the previous price matrix
|
||||
var newProductPrice = productPrice;
|
||||
var foundNewPrice = false;
|
||||
if (priceMatrix.length > 0) {
|
||||
for (var i = 0; i < priceMatrix.length; i++) {
|
||||
for (var j = 0; j < priceMatrix[i].length; j++) {
|
||||
var currentQuantity = parseFloat(priceMatrix[i][j].quantity);
|
||||
var nextQuantity = (j < priceMatrix[i].length - 1) ? parseFloat(priceMatrix[i][j + 1].quantity) : Infinity;
|
||||
if (updatedQuantity >= currentQuantity && updatedQuantity < nextQuantity) {
|
||||
newProductPrice = parseFloat(priceMatrix[i][j].price);
|
||||
foundNewPrice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundNewPrice) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
var newProductPrice = productPrice;
|
||||
var foundNewPrice = false;
|
||||
if (priceMatrix.length > 0) {
|
||||
for (var i = 0; i < priceMatrix.length; i++) {
|
||||
for (var j = 0; j < priceMatrix[i].length; j++) {
|
||||
var currentQuantity = parseFloat(priceMatrix[i][j].quantity);
|
||||
var nextQuantity =
|
||||
j < priceMatrix[i].length - 1
|
||||
? parseFloat(priceMatrix[i][j + 1].quantity)
|
||||
: Infinity;
|
||||
if (
|
||||
updatedQuantity >= currentQuantity &&
|
||||
updatedQuantity < nextQuantity
|
||||
) {
|
||||
newProductPrice = parseFloat(priceMatrix[i][j].price);
|
||||
foundNewPrice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundNewPrice) {
|
||||
productPrice = newProductPrice;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundNewPrice) {
|
||||
productPrice = newProductPrice;
|
||||
}
|
||||
|
||||
var updateData = {
|
||||
quantity: updatedQuantity,
|
||||
price: productPrice
|
||||
price: productPrice,
|
||||
};
|
||||
|
||||
updateOrderXhr.send(JSON.stringify(updateData));
|
||||
|
|
72
cart.php
72
cart.php
|
@ -191,11 +191,26 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-cart-content">
|
||||
<div class="ec-cart-inner">
|
||||
<div class="row">
|
||||
<style>
|
||||
.rowcart{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
align-self: center;
|
||||
flex-direction:row;
|
||||
}
|
||||
.rowcartCheckbox{
|
||||
height:15px;
|
||||
width:15px;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<form action="#">
|
||||
<div class="table-content cart-table-content">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Product</th>
|
||||
<th>Price</th>
|
||||
<th style="text-align: center;">Quantity</th>
|
||||
|
@ -229,6 +244,10 @@ if ($_SESSION["userId"] <> "") {
|
|||
?>
|
||||
|
||||
<tr id="cart_order_<?php echo $order['_id'] ?>">
|
||||
<td>
|
||||
<input type="checkbox" class="rowcartCheckbox" name="cart-item1[]" value="<?php echo $order['_id']?>"/>
|
||||
|
||||
</td>
|
||||
<td data-label="Product" class="ec-cart-pro-name"><a href="product-left-sidebar.php?id=<?php echo $order['items'][0]['product']['product_id']; ?>">
|
||||
<img loading="lazy" class="ec-cart-pro-img mr-4" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="" />
|
||||
<?php echo $order['items'][0]['product']['name']; ?></a>
|
||||
|
@ -270,6 +289,34 @@ if ($_SESSION["userId"] <> "") {
|
|||
?>
|
||||
<script>
|
||||
// let myLatestOrders = [];
|
||||
var checkboxes = document.querySelectorAll('input[name="cart-item1[]"]');
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
checkbox.addEventListener('change', function() {
|
||||
getCheckedCheckboxes();
|
||||
getLatestOrdersCart();
|
||||
// update_Total()
|
||||
});
|
||||
});
|
||||
function getCheckedCheckboxes() {
|
||||
var checkboxes = document.querySelectorAll('input[name="cart-item1[]"]');
|
||||
var checkedValues = [];
|
||||
var uncheckedValues = [];
|
||||
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
if (checkbox.checked) {
|
||||
checkedValues.push(checkbox.value.toLowerCase().trim());
|
||||
} else {
|
||||
uncheckedValues.push(checkbox.value.toLowerCase().trim());
|
||||
}
|
||||
});
|
||||
|
||||
if (checkedValues.length === 0) {
|
||||
return uncheckedValues;
|
||||
} else {
|
||||
console.log(checkedValues);
|
||||
return checkedValues;
|
||||
}
|
||||
}
|
||||
|
||||
function handleQtyInputCart(input, orderId, itemId, prodId) {
|
||||
var newQuantity = parseInt(input.value);
|
||||
|
@ -564,7 +611,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (orderData && orderData !== "") {
|
||||
console.log(orderData)
|
||||
const filteredOrders = orderData.filter(order => order.status.toUpperCase() === 'CART');
|
||||
const totalAmountSum = filteredOrders.reduce((sum, order) => {
|
||||
var checkedCategories = getCheckedCheckboxes();
|
||||
let orderInitial= null;
|
||||
if (filteredOrders && filteredOrders !== "") {
|
||||
// Calculate the new total amount based on the updated quantities
|
||||
if(checkedCategories?.length>0){
|
||||
orderInitial = filteredOrders?.filter(order => checkedCategories?.includes(order._id));
|
||||
|
||||
}else{
|
||||
orderInitial = filteredOrders
|
||||
}
|
||||
}
|
||||
const totalAmountSum = orderInitial.reduce((sum, order) => {
|
||||
const totalAmount = parseFloat(order.total_amount);
|
||||
return sum + totalAmount;
|
||||
}, 0);
|
||||
|
@ -602,6 +660,16 @@ if ($_SESSION["userId"] <> "") {
|
|||
})
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
function handleCheckoutButton(event) {
|
||||
event.preventDefault();
|
||||
var checkedCategories = getCheckedCheckboxes();
|
||||
|
||||
const selectedIdString = checkedCategories.join('-');
|
||||
login(email, password, function(token) {
|
||||
|
||||
window.location.href = `checkouttest.php?selected=${selectedIdString}`;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- <tr>
|
||||
<td data-label="Product" class="ec-cart-pro-name"><a
|
||||
|
@ -670,7 +738,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="col-lg-12">
|
||||
<div class="ec-cart-update-bottom">
|
||||
<a href="index.php">Continue Shopping</a>
|
||||
<a style="text-decoration:none; color:white" href="checkout.php" class="btn btn-primary">Check Out</a>
|
||||
<a style="text-decoration:none; color:white"onclick="handleCheckoutButton(event)" class="btn btn-primary">Check Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -134,33 +134,35 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
var data = xhr.responseText;
|
||||
if (data !== "") {
|
||||
console.log("Data: " + data);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
var data = xhr.responseText;
|
||||
if (data !== "") {
|
||||
console.log("Data: " + data);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
document.getElementById("cartNewItemCount").innerHTML = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function updateWishItemCount() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
var data = xhr.responseText;
|
||||
if (data !== "") {
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
function updateWishItemCount() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
var data = xhr.responseText;
|
||||
if (data !== "") {
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
document.getElementById("wishNewItemCount").innerHTML = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- raymart added css feb 14 2024 -->
|
||||
|
|
|
@ -28,7 +28,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
$cartencode = json_encode($filteredCartItems);
|
||||
|
||||
}else{
|
||||
$cartItems = $filteredCartItems;
|
||||
// $cartItems = $filteredCartItems;
|
||||
|
||||
$cartencode = json_encode($cartItems);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ $_SESSION["email"] = $_POST["name"];
|
|||
// Check if the customer exists in the database
|
||||
$result = customerExists($_SESSION["email"]);
|
||||
|
||||
if ($result > 0) {
|
||||
if ($result) {
|
||||
$forgot = forgot_password($_SESSION["email"]);
|
||||
if($forgot){
|
||||
header("location: forget_otp.php");
|
||||
|
|
33
header.php
33
header.php
|
@ -147,6 +147,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
.fi-rr-user:active,
|
||||
.fi-rr-shopping-bag:hover,
|
||||
.fi-rr-shopping-bag:active,
|
||||
.fi-rr-shopping-basket:hover,
|
||||
.fi-rr-shopping-basket:active,
|
||||
.fi-rr-home:hover,
|
||||
.fi-rr-home:active {
|
||||
cursor: pointer !important;
|
||||
|
@ -302,13 +304,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- Header Cart Start -->
|
||||
<a href="wishlist.php" class="ec-header-btn ec-header-wishlist">
|
||||
<div class="header-icon"><i class="fi-rr-heart"></i></div>
|
||||
<span id="wishItemCount" class="ec-header-count">0</span>
|
||||
<span id="wishNewItemCount" class="ec-header-count">0</span>
|
||||
</a>
|
||||
<!-- Header Cart End -->
|
||||
<!-- Header Cart Start -->
|
||||
<a href="cart.php" class="ec-header-btn ec-header-wishlist">
|
||||
<div class="header-icon"><i class="fi-rr-shopping-bag"></i></div>
|
||||
<span id="cartItemCount" class="ec-header-count">0</span>
|
||||
<span id="cartNewItemCount" class="ec-header-count">0</span>
|
||||
</a>
|
||||
<!-- Header Cart End -->
|
||||
<a href="javascript:void(0)" class="ec-header-btn ec-sidebar-toggle">
|
||||
|
@ -386,6 +388,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<!-- Header User End -->
|
||||
<!-- Header wishlist Start -->
|
||||
<?php
|
||||
if (($_SESSION["isCustomer"] == true) && ($_SESSION["isVendor"] == false) || ($_SESSION["isLoggedIn"] == false)) {
|
||||
?>
|
||||
<a href="wishlist.php" class="ec-header-btn ec-header-wishlist">
|
||||
<div class="header-icon"><i class="fi-rr-heart"></i></div>
|
||||
<span class="ec-header-count">
|
||||
|
@ -560,13 +565,24 @@ if ($_SESSION["userId"] <> "") {
|
|||
});
|
||||
});
|
||||
function getCheckedCheckboxes() {
|
||||
var checkboxes = document.querySelectorAll('input[name="cart-item[]"]:checked');
|
||||
var values = [];
|
||||
var checkboxes = document.querySelectorAll('input[name="cart-item[]"]');
|
||||
var checkedValues = [];
|
||||
var uncheckedValues = [];
|
||||
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
values.push(checkbox.value.toLowerCase().trim());
|
||||
if (checkbox.checked) {
|
||||
checkedValues.push(checkbox.value.toLowerCase().trim());
|
||||
} else {
|
||||
uncheckedValues.push(checkbox.value.toLowerCase().trim());
|
||||
}
|
||||
});
|
||||
console.log(values);
|
||||
return values;
|
||||
|
||||
if (checkedValues.length === 0) {
|
||||
return uncheckedValues;
|
||||
} else {
|
||||
console.log(checkedValues);
|
||||
return checkedValues;
|
||||
}
|
||||
}
|
||||
function update_Total(){
|
||||
|
||||
|
@ -864,6 +880,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- Header Cart End -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -76,11 +76,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
if (data != "") {
|
||||
console.log("Data: " + data + "\nStatus: " + status);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
document.getElementById("cartNewItemCount").innerHTML = data;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -89,6 +91,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
|
||||
if (data != "") {
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
document.getElementById("wishNewItemCount").innerHTML = data;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -90,6 +90,8 @@ if (isset($_GET['id'])) {
|
|||
if (data != "") {
|
||||
console.log("Data: " + data + "\nStatus: " + status);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
document.getElementById("cartNewItemCount").innerHTML = data;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -97,8 +99,9 @@ if (isset($_GET['id'])) {
|
|||
function updateWishItemCount() {
|
||||
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
|
||||
if (data != "") {
|
||||
console.log("Data: " + data + "\nStatus: " + status);
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
document.getElementById("wishNewItemCount").innerHTML = data;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -538,7 +541,7 @@ if (isset($_GET['id'])) {
|
|||
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
|
||||
<?php
|
||||
$product_price = (!empty($product_details['sale_price'])) ? $product_details['sale_price'] : $product_details['regular_price'] ;
|
||||
if ($_SESSION["isLoggedIn"]) {
|
||||
if ($_SESSION["isCustomer"]) {
|
||||
if ($product_details['product_type'] === "variable") {
|
||||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="decrement()"
|
||||
onmouseover="this.style.color=\'#a15d00\'" onmouseout="this.style.color=\'#ffaa00\'">-</div>';
|
||||
|
@ -548,6 +551,7 @@ if (isset($_GET['id'])) {
|
|||
echo '<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()"
|
||||
onmouseover="this.style.color=\'#a15d00\'" onmouseout="this.style.color=\'#ffaa00\'">+</div>';
|
||||
echo '<div style="display:flex; margin-left:45px;"><button type="button" class="btn btn-primary" id="contactSellerButton" style="background:#ffaa00; width:190px;"
|
||||
onmouseover="this.style.background=\'#df9000\'" onmouseout="this.style.background=\'#ffaa00\'"
|
||||
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 '<button class="btn btn-primary" id="addToCartButton" style="display:none">Add To Cart</button>';
|
||||
echo '<div class="ec-single-wishlist">
|
||||
|
@ -572,10 +576,11 @@ if (isset($_GET['id'])) {
|
|||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal" style="text-wrap:nowrap;" >Contact seller</button>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (($_SESSION["isCustomer"] == false) && ($_SESSION["isVendor"] == false)) {
|
||||
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>';
|
||||
border-radius:10px; letter-spacing:1px;" onmouseover="this.style.background=\'#df9000\'" onmouseout="this.style.background=\'#ffaa00\'"
|
||||
data-bs-toggle="modal">LOGIN</button></a></div>';
|
||||
}
|
||||
?>
|
||||
<!-- <div class="ec-single-wishlist" style="border: 1px solid yellow;">
|
||||
|
|
|
@ -150,6 +150,7 @@ $filteredProducts = [];
|
|||
if (data !== "") {
|
||||
console.log("Data: " + data);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
document.getElementById("cartNewItemCount").innerHTML = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -164,6 +165,7 @@ function updateWishItemCount() {
|
|||
var data = xhr.responseText;
|
||||
if (data !== "") {
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
document.getElementById("wishNewItemCount").innerHTML = data;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -302,7 +304,7 @@ function updateWishItemCount() {
|
|||
var filteredProducts = [];
|
||||
// Filter by category
|
||||
if (checkedCategories.length > 0) {
|
||||
let filteredProduct= products?.results?.filter((product) => {
|
||||
let filteredProduct= products?.filter((product) => {
|
||||
let categoryF = product?.product?.product_category?.toLowerCase();
|
||||
// console.log('Category (lowercase):', categoryF);
|
||||
let result =checkedCategories.includes(categoryF)
|
||||
|
@ -314,7 +316,7 @@ console.log(filteredProducts);
|
|||
|
||||
} else {
|
||||
// If no categories are selected, keep all products
|
||||
filteredProducts = products?.results;
|
||||
filteredProducts = products;
|
||||
}
|
||||
|
||||
// If minPrice or maxPrice is not provided, set them to default values
|
||||
|
@ -347,7 +349,7 @@ console.log({results:filteredProducts});
|
|||
|
||||
// Final filtered products
|
||||
// console.log({results:filteredProducts});
|
||||
let final = {results:filteredProducts}
|
||||
let final = filteredProducts
|
||||
return final;
|
||||
}
|
||||
function loadVendors(page,isFilter) {
|
||||
|
@ -477,8 +479,9 @@ function loadProducts(page,isFilter) {
|
|||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
// Parse JSON response
|
||||
let products = JSON.parse(xhr.responseText);
|
||||
|
||||
let products1 = JSON.parse(xhr.responseText);
|
||||
let products = products1.results.filter(product => product.product.product_type !== 'variation');
|
||||
console.log(products);
|
||||
// if(isFilter===true){
|
||||
var checkedCategories = getCheckedCheckboxes();
|
||||
var prices = getMinMaxPrices();
|
||||
|
@ -492,8 +495,8 @@ function loadProducts(page,isFilter) {
|
|||
let startIndex = (page - 1) * productsPerPage;
|
||||
let endIndex = startIndex + productsPerPage - 1;
|
||||
// Filter products for current page
|
||||
if(products.results.length>0){
|
||||
let productsForPage = products.results.slice(startIndex, endIndex + 1);
|
||||
if(products.length>0){
|
||||
let productsForPage = products.slice(startIndex, endIndex + 1);
|
||||
|
||||
|
||||
productsForPage.forEach(function(prod) {
|
||||
|
@ -572,7 +575,7 @@ function loadProducts(page,isFilter) {
|
|||
</div>
|
||||
</div>`;
|
||||
productContainer.appendChild(card);
|
||||
updatePaginationUI(page, products.results.length);
|
||||
updatePaginationUI(page, products.length);
|
||||
});
|
||||
gridList()
|
||||
}else{
|
||||
|
|
|
@ -50,12 +50,15 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
if (data != "") {
|
||||
console.log("Data: " + data + "\nStatus: " + status);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
document.getElementById("cartNewItemCount").innerHTML = data;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -64,10 +67,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
|
||||
if (data != "") {
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
document.getElementById("wishNewItemCount").innerHTML = data;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- raymart added css feb 14 2024 -->
|
||||
<style>
|
||||
.ec-product-inner .ec-pro-image .ec-pro-actions .add-to-cart {
|
||||
|
|
185
user-history.php
185
user-history.php
|
@ -42,7 +42,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<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" />
|
||||
|
||||
|
||||
<!-- FLATICON -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
|
||||
|
||||
|
@ -50,9 +50,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
<link href="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<style>
|
||||
.tab.active {
|
||||
|
@ -149,7 +153,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
|
@ -325,9 +329,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<div class="ec-vendor-card-table">
|
||||
|
||||
<!-- 03-15-2024 Stacy added tab for all orders -->
|
||||
<div id="allOrders" class=" tab-content active">
|
||||
<div id="allOrders" class=" tab-content mt-1 active">
|
||||
<!-- Content for "all Orders" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="allOrdersTbl" class="table ec-table">
|
||||
<thead id="allOrdersTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -360,7 +364,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($order['items'][0]['product']['product_image']))
|
||||
|
@ -377,10 +382,10 @@ if ($_SESSION["isVendor"] == true) {
|
|||
}
|
||||
?>
|
||||
</td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['status']; ?></span></td>
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
|
@ -415,9 +420,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toPay" class="tab-content">
|
||||
<div id="toPay" class="tab-content mt-1">
|
||||
<!-- Content for "To Pay" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toPayTbl" class="table ec-table">
|
||||
<thead id="toPayTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -450,7 +455,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($order['items'][0]['product']['product_image']))
|
||||
|
@ -467,10 +473,10 @@ if ($_SESSION["isVendor"] == true) {
|
|||
}
|
||||
?>
|
||||
</td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['status']; ?></span></td>
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
|
@ -499,9 +505,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toShip" class="tab-content">
|
||||
<div id="toShip" class="tab-content mt-1">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toShipTbl" class="table ec-table">
|
||||
<thead id="toShipTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -536,7 +542,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($order['items'][0]['product']['product_image']))
|
||||
|
@ -553,10 +560,10 @@ if ($_SESSION["isVendor"] == true) {
|
|||
}
|
||||
?>
|
||||
</td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['status']; ?></span></td>
|
||||
<!-- <td><span><?php echo $order['tracking_number']; ?></span></td>
|
||||
<td><span><?php echo $order['courier_name']; ?></span></td> -->
|
||||
|
@ -585,9 +592,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toReceive" class="tab-content">
|
||||
<div id="toReceive" class="tab-content mt-1">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toReceiveTbl" class="table ec-table">
|
||||
<thead id="toReceiveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -621,8 +628,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView">
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'" id="to-receive-<?php echo $order['_id']?>" data-value=' <?php echo $jsonorder; ?>'>
|
||||
<td data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<?php
|
||||
if(!empty($order['items'][0]['product']['product_image']))
|
||||
{
|
||||
|
@ -638,10 +645,10 @@ if ($_SESSION["isVendor"] == true) {
|
|||
}
|
||||
?>
|
||||
</td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['tracking_number']; ?></span></td>
|
||||
<td><span><?php # echo $order['courier_name']; ?></span></td> -->
|
||||
|
@ -676,9 +683,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="completed" class="tab-content">
|
||||
<div id="completed" class="tab-content mt-1">
|
||||
<!-- Content for "Completed" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="completedTbl" class="table ec-table">
|
||||
<thead id="completedTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -713,7 +720,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($order['items'][0]['product']['product_image']))
|
||||
|
@ -731,10 +739,10 @@ if ($_SESSION["isVendor"] == true) {
|
|||
?>
|
||||
|
||||
</td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?> </span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?> </span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['status']; ?></span></td>
|
||||
<!-- <td><span><?php echo $order['tracking_number']; ?></span></td>
|
||||
<td><span><?php echo $order['courier_name']; ?></span></td> -->
|
||||
|
@ -1061,20 +1069,20 @@ if ($_SESSION["isVendor"] == true) {
|
|||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
const orderResponse = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`);
|
||||
const orderData = await orderResponse.json();
|
||||
const updatedDetails = orderData.payment.details.map(detail => ({
|
||||
...detail,
|
||||
attributes: {
|
||||
...detail.attributes,
|
||||
data: {
|
||||
...detail.attributes.data,
|
||||
attributes: {
|
||||
...detail.attributes.data.attributes,
|
||||
status: 'paid'
|
||||
}
|
||||
}
|
||||
},
|
||||
status: 'paid'
|
||||
}));
|
||||
// const updatedDetails = orderData.payment.details.map(detail => ({
|
||||
// ...detail,
|
||||
// attributes: {
|
||||
// ...detail.attributes,
|
||||
// data: {
|
||||
// ...detail.attributes.data,
|
||||
// attributes: {
|
||||
// ...detail.attributes.data.attributes,
|
||||
// status: 'paid'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// status: 'paid'
|
||||
// }));
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
|
@ -1083,11 +1091,11 @@ if ($_SESSION["isVendor"] == true) {
|
|||
},
|
||||
body: JSON.stringify({
|
||||
status: 'COMPLETED',
|
||||
payment: {
|
||||
status: 'PAID',
|
||||
reference_number: orderData.payment.reference_number,
|
||||
details: updatedDetails,
|
||||
}
|
||||
// payment: {
|
||||
// status: 'PAID',
|
||||
// reference_number: orderData.payment.reference_number,
|
||||
// // details: updatedDetails,
|
||||
// }
|
||||
}),
|
||||
})
|
||||
.then(response => response.json())
|
||||
|
@ -1097,6 +1105,39 @@ if ($_SESSION["isVendor"] == true) {
|
|||
// Update the status in the table without reloading the page
|
||||
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
|
||||
// location.reload();
|
||||
var rowToMove = document.querySelector(`#to-receive-${orderId}`);
|
||||
if (rowToMove) {
|
||||
// Get the values of the order
|
||||
var image = rowToMove.querySelector('td:nth-child(1)').innerHTML;
|
||||
var name = rowToMove.querySelector('td:nth-child(2)').innerHTML;
|
||||
var quantity = rowToMove.querySelector('td:nth-child(3)').innerHTML;
|
||||
var unitPrice = rowToMove.querySelector('td:nth-child(4)').innerHTML;
|
||||
var price = rowToMove.querySelector('td:nth-child(5)').innerHTML;
|
||||
var status = rowToMove.querySelector('td:nth-child(6)').innerHTML;
|
||||
var date = rowToMove.querySelector('td:nth-child(7)').innerHTML;
|
||||
|
||||
// Construct the HTML for the new row in the "Completed" table
|
||||
var newRowHTML = '<tr>' +
|
||||
'<td>' + image + '</td>' +
|
||||
'<td>' + name + '</td>' +
|
||||
'<td>' + quantity + '</td>' +
|
||||
'<td>' + unitPrice + '</td>' +
|
||||
'<td>' + price + '</td>' +
|
||||
'<td><span> COMPLETED </span></td>' +
|
||||
'<td>' + date + '</td>' +
|
||||
'<td>' +
|
||||
|
||||
'</td>' +
|
||||
'</tr>';
|
||||
// var newRowHTML = 'HERE!!!!!!!!!!!!!!!!!'
|
||||
// Remove the row from the "To Receive" table
|
||||
rowToMove.parentNode.removeChild(rowToMove);
|
||||
|
||||
// Append the HTML for the new row to the "Completed" table
|
||||
document.querySelector('#completed tbody').innerHTML += newRowHTML;
|
||||
}
|
||||
|
||||
// rowToMove.parentNode.removeChild(rowToMove);
|
||||
|
||||
} else {
|
||||
alert('Failed to update order status');
|
||||
|
@ -1290,7 +1331,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<!-- <div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
<div class="ec-nav-panel">
|
||||
<div class="ec-nav-panel-icons">
|
||||
|
@ -1311,7 +1352,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- raymart remove popup feb 20 2024 -->
|
||||
|
@ -1520,6 +1561,29 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
<!-- Feature tools end -->
|
||||
|
||||
<!-- DataTables -->
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#allOrdersTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toPayTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toShipTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toReceiveTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#completedTbl').DataTable();
|
||||
} );
|
||||
</script>
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<script src="assets/js/vendor/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/vendor/popper.min.js"></script>
|
||||
|
@ -1537,7 +1601,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
|
||||
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
|
||||
<script src="assets/js/plugins/nouislider.js"></script>
|
||||
|
||||
<script src="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.js"></script>
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
|
|
@ -261,14 +261,16 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<div class="card-body">
|
||||
<div class="selectCon">
|
||||
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
|
||||
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php echo $customer_index; ?>]" id="billing_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressBilling('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)" <?php echo $address["billing"] ? 'checked' : ''; ?>>
|
||||
<!-- <input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php # echo $customer_index; ?>]" id="billing_address_<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" value="<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" class="form-check-input" onchange="updateAddressBilling('<?php # echo $customer['_id']; ?>', <?php # echo $address_index; ?>, true)" <?php # echo $address["billing"] ? 'checked' : ''; ?>> -->
|
||||
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php echo $customer_index; ?>]" id="billing_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" <?php echo $address["billing"] ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" style="margin: 0px 10px !important;" for="billing_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
Billing Address
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%; margin-left:-20px;">
|
||||
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedShippingAddress[<?php echo $customer_index; ?>]" id="shipping_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressShipping('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)" <?php echo $address["shipping"] ? 'checked' : ''; ?>>
|
||||
<!-- <input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedShippingAddress[<?php # echo $customer_index; ?>]" id="shipping_address_<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" value="<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" class="form-check-input" onchange="updateAddressShipping('<?php # echo $customer['_id']; ?>', <?php # echo $address_index; ?>, true)" <?php # echo $address["shipping"] ? 'checked' : ''; ?>> -->
|
||||
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedShippingAddress[<?php echo $customer_index; ?>]" id="shipping_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" <?php echo $address["billing"] ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" style="margin: 0px 10px !important;" for="shipping_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
Shipping Address
|
||||
</label>
|
||||
|
@ -308,6 +310,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<button type="button" onclick="updateAddressBilling('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)">Use Selected Address</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -891,7 +894,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
const city = $('#citySelect :selected').text();
|
||||
const barangay = $('#barangaySelect :selected').text();
|
||||
const country = $('#addressCountry').val();
|
||||
|
||||
|
||||
|
||||
// Create a new address object
|
||||
const newAddress = {
|
||||
|
@ -1156,8 +1159,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
sCountryElement.textContent = customerData.address[addressIndex].country;
|
||||
}
|
||||
console.log(`Address updated successfully for customer ${customerId}`);
|
||||
// location.reload();
|
||||
// header("location: user-profile.php");
|
||||
location.reload();
|
||||
header("location: user-profile.php");
|
||||
} catch (error) {
|
||||
console.error('Error updating address:', error.message);
|
||||
}
|
||||
|
@ -1305,7 +1308,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<!-- Modal end -->
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<!-- <div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
<div class="ec-nav-panel">
|
||||
<div class="ec-nav-panel-icons">
|
||||
|
@ -1326,7 +1329,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- raymart remove popup feb 20 2024 -->
|
||||
|
|
|
@ -54,9 +54,14 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
<link href="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<style>
|
||||
.tab.active {
|
||||
background-color: #ffffff;
|
||||
|
@ -342,9 +347,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div> -->
|
||||
|
||||
<!-- 03-15-2024 Stacy added tab for all orders -->
|
||||
<div id="allRefunds" class="tab-content active">
|
||||
<div id="allRefunds" class="tab-content mt-1 active">
|
||||
<!-- Content for "all Orders" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="allRefundsTbl" class="table ec-table">
|
||||
<thead id="allRefundsTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -381,12 +386,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -417,9 +423,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toApprove" class="tab-content">
|
||||
<div id="toApprove" class="tab-content mt-1">
|
||||
<!-- Content for "To Approve" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toApproveTbl" class="table ec-table">
|
||||
<thead id="toApproveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -454,12 +460,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -490,9 +497,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toShip" class="tab-content">
|
||||
<div id="toShip" class="tab-content mt-1">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toShipTbl" class="table ec-table">
|
||||
<thead id="toShipTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -527,12 +534,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -563,9 +571,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toReceive" class="tab-content">
|
||||
<div id="toReceive" class="tab-content mt-1">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toReceiveTbl" class="table ec-table">
|
||||
<thead id="toReceiveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -600,12 +608,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -639,9 +648,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="toRefund" class="tab-content">
|
||||
<div id="toRefund" class="tab-content mt-1">
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="toRefundTbl" class="table ec-table">
|
||||
<thead id="toRefundTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -676,12 +685,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -715,9 +725,9 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
|
||||
|
||||
<div id="returnComplete" class="tab-content">
|
||||
<div id="returnComplete" class="tab-content mt-1">
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<table class="table ec-table">
|
||||
<table id="returnCompleteTbl" class="table ec-table">
|
||||
<thead id="returnCompleteTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -751,12 +761,13 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -1203,7 +1214,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<!-- <div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
<div class="ec-nav-panel">
|
||||
<div class="ec-nav-panel-icons">
|
||||
|
@ -1224,7 +1235,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- raymart remove popup feb 20 2024 -->
|
||||
|
@ -1433,6 +1444,33 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
<!-- Feature tools end -->
|
||||
|
||||
<!-- DataTables -->
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#allRefundsTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toApproveTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toShipTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toReceiveTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toRefundTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#returnCompleteTbl').DataTable();
|
||||
} );
|
||||
</script>
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<script src="assets/js/vendor/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/vendor/popper.min.js"></script>
|
||||
|
@ -1450,6 +1488,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
|
||||
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
|
||||
<script src="assets/js/plugins/nouislider.js"></script>
|
||||
<script src="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.js"></script>
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
|
|
|
@ -111,6 +111,10 @@ $products = productList();
|
|||
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Category Sidebar start -->
|
||||
<?php include "category-slider.php" ?>
|
||||
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
<div class="container">
|
||||
|
|
|
@ -254,7 +254,7 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
$order = $vendorOrders[$i];
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
|
||||
if ($orderItems['status'] !== 'TO CHECKOUT' ) {
|
||||
foreach ($orderItems['items'] as $item) {
|
||||
?>
|
||||
<tr>
|
||||
|
@ -333,6 +333,7 @@ $style = "display: flex; height: 15px;font-weight:400; width:90px; margin-top:10
|
|||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -69,9 +69,14 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
<link href="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<style>
|
||||
.tab.active {
|
||||
background-color: #ffffff;
|
||||
|
@ -260,7 +265,7 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
<!-- <ul>
|
||||
<ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a href="vendor-uploads.php">Upload Product</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
|
@ -319,8 +324,8 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
<!-- 03-26-2024 Stacy added tab for all orders -->
|
||||
<!-- Content for "All Refunds" tab -->
|
||||
<div id="allRefunds" class="tab-content active">
|
||||
<table class="table ec-table">
|
||||
<div id="allRefunds" class="tab-content mt-1 active">
|
||||
<table id="allRefundsTbl" class="table ec-table">
|
||||
<thead id="allRefundTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -353,12 +358,13 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -388,8 +394,8 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
|
||||
<!-- Content for "To Approve" tab -->
|
||||
<div id="toApprove" class="tab-content">
|
||||
<table class="table ec-table">
|
||||
<div id="toApprove" class="tab-content mt-1">
|
||||
<table id="toApproveTbl" class="table ec-table">
|
||||
<thead id="toApproveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -420,12 +426,12 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'">
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -459,8 +465,8 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<div id="toShip" class="tab-content">
|
||||
<table class="table ec-table">
|
||||
<div id="toShip" class="tab-content mt-1">
|
||||
<table id="toShipTbl" class="table ec-table">
|
||||
<thead id="toShipTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -491,12 +497,13 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -526,8 +533,8 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<div id="toReceive" class="tab-content">
|
||||
<table class="table ec-table">
|
||||
<div id="toReceive" class="tab-content mt-1">
|
||||
<table id="toReceiveTbl" class="table ec-table">
|
||||
<thead id="toReceiveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -557,12 +564,12 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'">
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -595,8 +602,8 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<div id="toRefund" class="tab-content">
|
||||
<table class="table ec-table">
|
||||
<div id="toRefund" class="tab-content mt-1">
|
||||
<table id="toRefundTbl" class="table ec-table">
|
||||
<thead id="toRefundTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -626,12 +633,13 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -664,8 +672,8 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<div id="returnComplete" class="tab-content">
|
||||
<table class="table ec-table">
|
||||
<div id="returnComplete" class="tab-content mt-1">
|
||||
<table id="returnCompleteTbl" class="table ec-table">
|
||||
<thead id="returnCompleteTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
|
@ -695,12 +703,13 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
|
||||
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
|
@ -1076,7 +1085,7 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
if (jsonObject.return_order.status === 'To Approve') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<div class="modal-header" style="height:5px; padding:10px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
@ -1246,7 +1255,7 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<!-- <div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
<div class="ec-nav-panel">
|
||||
<div class="ec-nav-panel-icons">
|
||||
|
@ -1267,7 +1276,7 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- raymart remove popup feb 20 2024 -->
|
||||
|
@ -1476,6 +1485,33 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
</div>
|
||||
<!-- Feature tools end -->
|
||||
|
||||
<!-- DataTables -->
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#allRefundsTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toApproveTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toShipTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toReceiveTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#toRefundTbl').DataTable();
|
||||
} );
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#returnCompleteTbl').DataTable();
|
||||
} );
|
||||
</script>
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<script src="assets/js/vendor/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/vendor/popper.min.js"></script>
|
||||
|
@ -1493,6 +1529,7 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
|
||||
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
|
||||
<script src="assets/js/plugins/nouislider.js"></script>
|
||||
<script src="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.js"></script>
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
|
|
Loading…
Reference in New Issue