Compare commits
17 Commits
2e505256f6
...
a1a6ab2efb
Author | SHA1 | Date |
---|---|---|
Jun Barroga | a1a6ab2efb | |
Jun Barroga | 14609b9693 | |
JunBarroga | 2289cce143 | |
JunBarroga | e9a0505450 | |
Erwin Galang | 70b3011c6a | |
JunBarroga | da67badbec | |
MarkHipe | 61781cbff3 | |
raymart | efb1d4a960 | |
MarkHipe | 15977f1b02 | |
Stacy | 38ff115b1f | |
MarkHipe | 42f89fa7ef | |
Stacy | 639bccf3e5 | |
Stacy | b400d75494 | |
MarkHipe | 64c06a749f | |
raymart | cd922a186f | |
raymart | 157edf72a8 | |
MarkHipe | 00b4ca7a61 |
|
@ -0,0 +1,2 @@
|
|||
# ignore config.php
|
||||
config.php
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["sales_email"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["test_email_rcpt"]="";
|
||||
$_SESSION["sales_email"]="sales@obanana.com";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
if ($_SESSION["is_test"]){
|
||||
$_SESSION["obpay"]="web.obpay.online/test";
|
||||
$_SESSION["obpay_gate"]="gate.obpay.online/api";
|
||||
$_SESSION["obpay"]="web.obanana.io/test";
|
||||
$_SESSION["obpay_gate"]="gate.obanana.io/api";
|
||||
} else {
|
||||
$_SESSION["obpay"]="web.obpay.online";
|
||||
$_SESSION["obpay_gate"]="gate.obpay.online/api/v1";
|
||||
$_SESSION["obpay"]="web.obanana.io";
|
||||
$_SESSION["obpay_gate"]="gate.obanana.io/api/v1";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -40,7 +40,9 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<link id="ekka-css" href="assets/css/ekka.css" rel="stylesheet" />
|
||||
|
||||
<!-- FAVICON -->
|
||||
<link href="assets/img/favicon.png" rel="shortcut icon" />
|
||||
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
|
||||
<!-- 03-13-2024 Stacy changed the icon -->
|
||||
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -1130,10 +1130,10 @@ $vendorId = $_SESSION["vendorId"];
|
|||
|
||||
promises.push(promise);
|
||||
}
|
||||
|
||||
// 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename
|
||||
Promise.all(promises)
|
||||
.then(filenames => {
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`));
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${encodeURIComponent(filename)}`));
|
||||
|
||||
if (!Array.isArray(updatedImages)) {
|
||||
console.error('Updated images is not an array:', updatedImages);
|
||||
|
@ -1154,6 +1154,7 @@ $vendorId = $_SESSION["vendorId"];
|
|||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
// 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Images uploaded successfully');
|
||||
|
|
|
@ -138,8 +138,8 @@
|
|||
<?php
|
||||
if($_SESSION["is_test"]==true){
|
||||
?>
|
||||
<a class="btn btn-default" href="https://b2b.obpay.online/product-left-sidebar.php?id=<?php echo $product['product']['_id']; ?>" target="_blank">View</a>
|
||||
<a class="btn btn-default" href="https://b2b.obpay.online/admin/product-edit.php?id=<?php echo $product['product']['_id']; ?>" target="_blank">Edit</a>
|
||||
<a class="btn btn-default" href="https://b2b.obanana.com/product-left-sidebar.php?id=<?php echo $product['product']['_id']; ?>" target="_blank">View</a>
|
||||
<a class="btn btn-default" href="https://b2b.obanana.com/admin/product-edit.php?id=<?php echo $product['product']['_id']; ?>" target="_blank">Edit</a>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
|
|
@ -48,7 +48,8 @@ $users = getUsers();
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="Ekka - Admin Dashboard HTML Template.">
|
||||
|
||||
<title>Ekka - Admin Dashboard HTML Template.</title>
|
||||
<!-- <title>Ekka - Admin Dashboard HTML Template.</title> -->
|
||||
<title>oBanana B2B - Admin Dashboard</title>
|
||||
|
||||
<!-- GOOGLE FONTS -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
|
@ -66,7 +67,9 @@ $users = getUsers();
|
|||
<link id="ekka-css" rel="stylesheet" href="assets/css/ekka.css" />
|
||||
|
||||
<!-- FAVICON -->
|
||||
<link href="assets/img/favicon.png" rel="shortcut icon" />
|
||||
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
|
||||
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
|
||||
|
||||
</head>
|
||||
|
||||
<body class="ec-header-fixed ec-sidebar-fixed ec-sidebar-dark ec-header-light" id="body">
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
// 03-07-2024 Stacy created Search Vendor Filter Action
|
||||
|
||||
$search = isset($_POST['search']) ? $_POST['search'] : null;
|
||||
header("location: vendor-card.php?&search=$search");
|
||||
|
||||
|
||||
// 03-07-2024 Stacy created Search Vendor Filter Action
|
|
@ -759,7 +759,7 @@ $products = productList();
|
|||
<div class="vendor-image" style="padding-top:20px; ">
|
||||
<?php
|
||||
if (isset($vendor['vendor_image']) && !empty($vendor['vendor_image'])) {
|
||||
echo '<img src="' . $vendor['vendor_image'] . '" alt="edit" id="imgPrev" class="img-fluid rounded-circle" alt="Avatar Image" style="align-items:left; width:100px; height:100px; object-fit:cover; border-radius:80%;"> ';
|
||||
echo '<img src="' . $vendor['vendor_image'] . '" alt="edit" id="imgPrev' . $vendor['_id'] . '" class="img-fluid rounded-circle" alt="Avatar Image" style="align-items:left; width:100px; height:100px; object-fit:cover; border-radius:80%;"> ';
|
||||
} else {
|
||||
echo '<img src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" id="imgPrev" alt="edit" class="img-fluid rounded-circle" alt="Placeholder Image" style="align-items:left; width:80px; height:80px; object-fit:cover; border-radius:50%;">';
|
||||
}
|
||||
|
@ -775,21 +775,22 @@ $products = productList();
|
|||
label.innerHTML = '<i class="fa-solid fa-file-arrow-up"></i> Upload file';
|
||||
}
|
||||
}
|
||||
// 03-14-2024 Jun Jihad modified this block of code to show preview of the image to be uploaded
|
||||
function previewImage(vendorId) {
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
console.log('clicked hereee');
|
||||
const reader = new FileReader();
|
||||
|
||||
// 02-29-2024 Stacy for image preview
|
||||
function previewImage(vendorId){
|
||||
var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
var file = fileInput.files[0];
|
||||
console.log('clicked hereee')
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = function (e) {
|
||||
reader.onload = function (e) {
|
||||
const dataUri = e.target.result;
|
||||
document.getElementById('imgPrev').src=dataUri
|
||||
};
|
||||
document.getElementById('imgPrev' + vendorId).src = dataUri; // Fixed concatenation here
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
// 03-14-2024 Jun Jihad modified this block of code to show preview of the image to be uploaded
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<form>
|
||||
|
|
|
@ -789,7 +789,17 @@ $array = json_decode($vendor,true);
|
|||
<div class="profile-content-right profile-right-spacing py-5">
|
||||
<ul class="nav nav-tabs px-3 px-xl-5 nav-style-border" id="myProfileTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="profile-tab" data-bs-toggle="tab"
|
||||
<button class="nav-link active" id="payments-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#payments" type="button" role="tab"
|
||||
aria-controls="payments" aria-selected="true">Payments</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="payouts-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#payouts" type="button" role="tab"
|
||||
aria-controls="payouts" aria-selected="true">Payouts</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="profile-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#profile" type="button" role="tab"
|
||||
aria-controls="profile" aria-selected="true">Profile</button>
|
||||
</li>
|
||||
|
@ -801,7 +811,310 @@ $array = json_decode($vendor,true);
|
|||
</ul>
|
||||
<div class="tab-content px-3 px-xl-5" id="myTabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="profile" role="tabpanel"
|
||||
<div class="tab-pane fade show active" id="payments" role="tabpanel"
|
||||
aria-labelledby="payments-tab">
|
||||
<div class="tab-widget mt-5">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Recent Order Table -->
|
||||
<div class="card card-default card-table-border-none ec-tbl"
|
||||
id="recent-orders">
|
||||
<div class="card-header justify-content-between">
|
||||
<h2>Payments</h2>
|
||||
|
||||
<div class="date-range-report">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body pt-0 pb-0 table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox"></th>
|
||||
<th>Method</th>
|
||||
<th>Amount</th>
|
||||
<th>Status</th>
|
||||
<th>Payout</th>
|
||||
<th>Description</th>
|
||||
<th>Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱230</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Coach Swagger</a>
|
||||
</td>
|
||||
<td>Oct 20, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱550</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Toddler Shoes, Gucci Watch</a>
|
||||
</td>
|
||||
<td>Nov 15, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱325</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Hat Black Suits</a>
|
||||
</td>
|
||||
<td>Nov 18, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>PayMongo</td>
|
||||
<td>₱200</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> T100 Power Bank</a>
|
||||
</td>
|
||||
<td>Nov 20, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" disabled></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱150</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-success">Yes</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Vodka Milk Tea</a>
|
||||
</td>
|
||||
<td>Dec 11, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end mt-5">
|
||||
<button type="submit" class="btn btn-primary mb-2 btn-pill">Create Payout from Selected</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="payouts" role="tabpanel"
|
||||
aria-labelledby="payouts-tab">
|
||||
<div class="tab-widget mt-5">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Recent Order Table -->
|
||||
<div class="card card-default card-table-border-none ec-tbl"
|
||||
id="recent-orders">
|
||||
<div class="card-header justify-content-between">
|
||||
<h2>Payouts</h2>
|
||||
|
||||
<div class="date-range-report">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body pt-0 pb-0 table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Amount</th>
|
||||
<th>Bank</th>
|
||||
<th>Account</th>
|
||||
<th>Name</th>
|
||||
<th>Date</th>
|
||||
<th>Status</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>₱1,230</td>
|
||||
<td>EastWest</td>
|
||||
<td>**** **** 1234</td>
|
||||
<td>Jon-Jon Manaay</td>
|
||||
<td>Oct 20, 2018</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Deposited</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>₱2,340</td>
|
||||
<td>EastWest</td>
|
||||
<td>**** **** 1234</td>
|
||||
<td>Jon-Jon Manaay</td>
|
||||
<td>Oct 27, 2018</td>
|
||||
<td>
|
||||
<span class="badge badge-warning">Processing</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="profile" role="tabpanel"
|
||||
aria-labelledby="profile-tab">
|
||||
<div class="tab-widget mt-5">
|
||||
<div class="row">
|
||||
|
|
|
@ -356,7 +356,7 @@
|
|||
<li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="compare.html">Compare</a></li>
|
||||
<li><a href="faq.html">FAQ</a></li>
|
||||
<li><a href="faq.php">FAQ</a></li>
|
||||
<li><a href="login.php">Login</a></li>
|
||||
<li><a href="register.php">Register</a></li>
|
||||
<li><a href="track-order.html">Track Order</a></li>
|
||||
|
@ -645,7 +645,7 @@
|
|||
<li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="compare.html">Compare</a></li>
|
||||
<li><a href="faq.html">FAQ</a></li>
|
||||
<li><a href="faq.php">FAQ</a></li>
|
||||
<li><a href="login.php">Login</a></li>
|
||||
<li><a href="register.php">Register</a></li>
|
||||
<li><a href="track-order.html">Track Order</a></li>
|
||||
|
@ -1365,7 +1365,7 @@
|
|||
<div class="ec-footer-links">
|
||||
<ul class="align-items-center">
|
||||
<li class="ec-footer-link"><a href="about-us.html">About us</a></li>
|
||||
<li class="ec-footer-link"><a href="faq.html">FAQ</a></li>
|
||||
<li class="ec-footer-link"><a href="faq.php">FAQ</a></li>
|
||||
<li class="ec-footer-link"><a href="#">Delivery Information</a></li>
|
||||
<li class="ec-footer-link"><a href="contact-us.html">Contact us</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -48,6 +48,29 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<style>
|
||||
.pagination {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pagination a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ccc;
|
||||
margin: 0 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pagination a.active {
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
|
@ -196,7 +219,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- Ec breadcrumb end -->
|
||||
|
||||
<!-- Page detail section -->
|
||||
<section class="ec-bnr-detail ec-catalog-vendor-sec section-space-pt">
|
||||
<section class="ec-bnr-detail ec-catalog-vendor-sec section-space-pt">
|
||||
<div class="ec-page-detail">
|
||||
<div class="container">
|
||||
<div class="ec-main-heading d-none">
|
||||
|
@ -209,14 +232,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendor = json_decode($json, true);
|
||||
?>
|
||||
<div class="col-lg-12 col-md-12 profile-banner space-info margin-bottom-30">
|
||||
<ul class="social-bar mb-0">
|
||||
<li class="list-inline-item"><a class="hdr-facebook" href="#"><i class="ecicon eci-facebook"></i></a></li>
|
||||
<li class="list-inline-item"><a class="hdr-twitter" href="#"><i class="ecicon eci-twitter"></i></a></li>
|
||||
<li class="list-inline-item"><a class="hdr-instagram" href="#"><i class="ecicon eci-instagram"></i></a></li>
|
||||
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
|
||||
</ul>
|
||||
<div class="ec-page-description ec-page-description-info">
|
||||
<div class="ec-page-block">
|
||||
<!-- <ul class="social-bar mb-0">
|
||||
<li class="list-inline-item"><a class="hdr-facebook" href="#"><i class="ecicon eci-facebook"></i></a></li>
|
||||
<li class="list-inline-item"><a class="hdr-twitter" href="#"><i class="ecicon eci-twitter"></i></a></li>
|
||||
<li class="list-inline-item"><a class="hdr-instagram" href="#"><i class="ecicon eci-instagram"></i></a></li>
|
||||
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
|
||||
</ul> -->
|
||||
<div class="ec-page-description ec-page-description-info"style="background: orange;">
|
||||
<div class="ec-page-block" style="background: #393e46;">
|
||||
<div class="ec-catalog-vendor">
|
||||
<a href="vendor-profile.html">
|
||||
<?php
|
||||
|
@ -263,11 +286,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="col-lg-12 col-md-12 margin-bottom-30">
|
||||
<div class="ec-page-description p-30">
|
||||
<h5 class="ec-desc-title">About Our Firm</h5>
|
||||
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry. Lorem Ipsum has been the industry's standard dummy text ever
|
||||
since the 1500s, when an unknown printer took a galley of type and
|
||||
scrambled it to make a type specimen book.
|
||||
</p>
|
||||
<!-- raymart replace the vendor descript march 8 2024 -->
|
||||
<?php if (!empty($vendorData['vendor_description'])): ?>
|
||||
<p><?php echo $vendorData['vendor_description']; ?></p>
|
||||
<?php else: ?>
|
||||
<p>No description available.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -308,36 +332,53 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="shop-pro-content">
|
||||
<div class="shop-pro-inner">
|
||||
<div class="row">
|
||||
<?php
|
||||
<?php
|
||||
//var_dump($products);
|
||||
foreach ($products as $product) {
|
||||
// raymart added vendorproduct feb 14 2024
|
||||
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
foreach ($products as $product){
|
||||
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
// $pid = $i;
|
||||
$vendorOfProduct = getVendorbyId($simpleProducts[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
|
||||
<div class="ec-pro-image">
|
||||
<!-- raymart added for link for product feb 22 2024 -->
|
||||
<a class="image" href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>"<?php echo $product["product_image"] ?>>
|
||||
<?php
|
||||
if (isset($product["product_image"]) && $product["product_image"] <> "") {
|
||||
?>
|
||||
<img class="main-image" src="<?php echo $product["product_image"] ?>" alt="Product" />
|
||||
<!-- <img class="hover-image" src="<?php echo $product["product_image"] ?>" alt="Product" /> -->
|
||||
<!-- raymart replace new function for images of the product march 8 2024 -->
|
||||
<?php
|
||||
} else {
|
||||
if (isset($product['images'])) {
|
||||
$image_urls = explode(',', $product['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="main-image" src="assets/images/product-image/6_1.jpg" alt="Product" />
|
||||
<!-- <img class="hover-image" src="assets/images/product-image/6_2.jpg" alt="Product" /> -->
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="main-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
<!-- raymart edit action feb 14 2024 -->
|
||||
<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>
|
||||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<!-- raymart replace updated prize for the product march 8 2024 -->
|
||||
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
|
||||
<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>
|
||||
|
||||
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
|
||||
<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>
|
||||
|
||||
<?php else : ($product["regular_price"] == "" || $product["regular_price"] == null) ?>
|
||||
<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>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<!-- <span class="percentage">20%</span>
|
||||
<a href="#" class="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>
|
||||
|
@ -349,7 +390,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</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>
|
||||
<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>
|
||||
<!-- raymart remove ratings feb 22 2024 -->
|
||||
<!-- <div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
|
@ -358,7 +399,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star"></i>
|
||||
</div> -->
|
||||
<div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dutmmy text ever since the 1500s, when an unknown printer took a galley.</div>
|
||||
<!-- <div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dutmmy text ever since the 1500s, when an unknown printer took a galley.</div> -->
|
||||
<span class="ec-price">
|
||||
<!-- raymart added $ to pesos function feb 22 2024 -->
|
||||
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
|
||||
|
@ -421,10 +462,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec Pagination Start -->
|
||||
<div class="ec-pro-pagination">
|
||||
|
||||
<!-- <div class="ec-pro-pagination">
|
||||
<span>Showing 1-12 of 21 item(s)</span>
|
||||
<ul class="ec-pro-pagination-inner">
|
||||
<li><a class="active" href="#">1</a></li>
|
||||
|
@ -434,7 +477,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<li><a href="#">5</a></li>
|
||||
<li><a class="next" href="#">Next <i class="ecicon eci-angle-right"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Ec Pagination End -->
|
||||
</div>
|
||||
<!--Shop content End -->
|
||||
|
@ -501,12 +544,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
Categories</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Sidebar Size Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Size</h3>
|
||||
</div>
|
||||
|
@ -539,9 +581,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Sidebar Color item -->
|
||||
<div class="ec-sidebar-block ec-sidebar-block-clr">
|
||||
<!-- <div class="ec-sidebar-block ec-sidebar-block-clr">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Color</h3>
|
||||
</div>
|
||||
|
@ -579,9 +621,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Sidebar Price Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Price</h3>
|
||||
</div>
|
||||
|
@ -595,9 +637,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Sidebar Price Block -->
|
||||
<div class="ec-sidebar-block ec-contact-form">
|
||||
<!-- <div class="ec-sidebar-block ec-contact-form">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Contact With Seller</h3>
|
||||
</div>
|
||||
|
@ -615,7 +657,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<button type="submit" class="btn btn-lg btn-primary" tabindex="0">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -625,7 +667,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- End catalog page -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
<footer class="ec-footer section-space-mt">
|
||||
<?php include "footer.php" ?>
|
||||
|
||||
<!-- <footer class="ec-footer section-space-mt">
|
||||
<div class="footer-container">
|
||||
<div class="footer-offer">
|
||||
<div class="container">
|
||||
|
@ -660,7 +704,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-footer-links">
|
||||
<ul class="align-items-center">
|
||||
<li class="ec-footer-link"><a href="about-us.html">About us</a></li>
|
||||
<li class="ec-footer-link"><a href="faq.html">FAQ</a></li>
|
||||
<li class="ec-footer-link"><a href="faq.php">FAQ</a></li>
|
||||
<li class="ec-footer-link"><a href="#">Delivery Information</a></li>
|
||||
<li class="ec-footer-link"><a href="contact-us.html">Contact us</a></li>
|
||||
</ul>
|
||||
|
@ -718,9 +762,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<div class="footer-bottom">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="row align-items-center"> -->
|
||||
<!-- Footer social Start -->
|
||||
<div class="col text-left footer-bottom-left">
|
||||
<!-- <div class="col text-left footer-bottom-left">
|
||||
<div class="footer-bottom-social">
|
||||
<span class="social-text text-upper">Follow us on:</span>
|
||||
<ul class="mb-0">
|
||||
|
@ -730,30 +774,30 @@ if ($_SESSION["userId"] <> "") {
|
|||
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer social End -->
|
||||
<!-- Footer Copyright Start -->
|
||||
<div class="col text-center footer-copy">
|
||||
<!-- <div class="col text-center footer-copy">
|
||||
<div class="footer-bottom-copy ">
|
||||
<div class="ec-copy">Copyright © 2023 <a class="site-name text-upper" href="#">ekka<span>.</span></a>. All Rights Reserved</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer Copyright End -->
|
||||
<!-- Footer payment -->
|
||||
<div class="col footer-bottom-right">
|
||||
<!-- <div class="col footer-bottom-right">
|
||||
<div class="footer-bottom-payment d-flex justify-content-end">
|
||||
<div class="payment-link">
|
||||
<img src="assets/images/icons/payment.png" alt="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Footer payment -->
|
||||
</div>
|
||||
<!-- </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer> -->
|
||||
<!-- Footer Area End -->
|
||||
|
||||
<!-- Modal -->
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
|
||||
<meta name="author" content="ashishmaraviya">
|
||||
|
||||
<!-- CATEGORY-SLIDER -->
|
||||
<!-- site Favicon -->
|
||||
<link rel="icon" href="assets/images/favicon/favicon.png" sizes="32x32" />
|
||||
<link rel="apple-touch-icon" href="assets/images/favicon/favicon.png" />
|
||||
|
@ -42,9 +43,17 @@
|
|||
border-radius: 10px;
|
||||
color: #ffffff;
|
||||
}
|
||||
#sidebar-category:hover .ec-sidebar-block-item{
|
||||
#sidebar-category:hover .ec-sidebar-block-items{
|
||||
color: #ffffff;
|
||||
}
|
||||
.ec-sidebar-block-items {
|
||||
height: 40px;
|
||||
padding-top:10px;
|
||||
font-size:15px;
|
||||
}
|
||||
#best-sellers-title.bs-title:hover{
|
||||
color: #ffaa00;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
@ -64,8 +73,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Electronics">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rs-headset" style="padding-right:10px; padding-top:2px;"></i>Electronics</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rs-headset" style="padding-right:15px; padding-top:2px;"></i>Electronics</div></a>
|
||||
<!-- <ul style="display: block;">
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Shirt <span title="Available Stock">- 25</span></a>
|
||||
|
@ -91,8 +100,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Solar">
|
||||
<div class="ec-sidebar-block-item" id="sidebar-category-content">
|
||||
<i class="fi fi-rr-square" style="padding-right:10px; padding-top:2px;"></i>Solar</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rr-square" style="padding-right:15px; padding-top:3px;"></i>Solar</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sports <span title="Available Stock">- 25</span></a>
|
||||
|
@ -118,8 +127,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=E-bike">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rs-bike" style="padding-right:10px; padding-top:2px;"></i>E-Bike</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rs-bike" style="padding-right:15px; padding-top:2px;"></i>E-Bike</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Earrings <span title="Available Stock">- 50</span></a>
|
||||
|
@ -141,8 +150,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=E-vehicle">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rs-car-side" style="padding-right:10px; padding-top:2px;"></i>E-Vehicle</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rs-car-side" style="padding-right:15px; padding-top:2px;"></i>E-Vehicle</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Clothes perfume<span title="Available Stock">- 4 pcs</span></a>
|
||||
|
@ -169,8 +178,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Appliance">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rr-calculator" style="padding-right:10px; padding-top:2px;"></i>Appliance</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rr-calculator" style="padding-right:15px; padding-top:2px;"></i>Appliance</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shampoo<span title="Available Stock"></span></a>
|
||||
|
@ -197,8 +206,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Smart Home">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rs-screen" style="padding-right:10px; padding-top:2px;"></i>Smart Home</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rs-screen" style="padding-right:15px; padding-top:2px;"></i>Smart Home</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sunglasses <span title="Available Stock">- 20</span></a>
|
||||
|
@ -216,8 +225,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Home">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rr-home" style="padding-right:10px; padding-top:2px;"></i>Home</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rr-home" style="padding-right:15px; padding-top:2px;"></i>Home</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
|
||||
|
@ -243,9 +252,9 @@
|
|||
<div class="ec-sb-block-content" id="sidebar-category">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Apparell">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rr-user" style="padding-right:10px; padding-top:2px;"></i>Apparel</div></a>
|
||||
<a href="search_product_action.php?category=Apparel">
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rr-user" style="padding-right:15px; padding-top:2px;"></i>Apparel</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
|
||||
|
@ -272,8 +281,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<a href="search_product_action.php?category=Heavy Equipment">
|
||||
<div class="ec-sidebar-block-item">
|
||||
<i class="fi fi-rr-tool-box" style="padding-right:10px; padding-top:2px;"></i>Heavy Equipment</div></a>
|
||||
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
|
||||
<i class="fi fi-rr-tool-box" style="padding-right:15px; padding-top:2px;"></i>Heavy Equipment</div></a>
|
||||
<!-- <ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
|
||||
|
@ -307,21 +316,15 @@
|
|||
<div class="ec-sb-pro-sl">
|
||||
<div>
|
||||
<?php
|
||||
$productBestSellers = simpleProducts("");
|
||||
$array = array_filter($productBestSellers, function ($var) {
|
||||
return (fnmatch("Solar*", $var['product_category']) || fnmatch("E-bike*", $var['product_category'])
|
||||
|| fnmatch("Appliance*", $var['product_category']) || fnmatch("E-Vehicle*", $var['product_category'])
|
||||
|| fnmatch("Electronics*", $var['product_category']) || fnmatch("Smart Home*", $var['product_category'])
|
||||
|| fnmatch("Heavy Equipment*", $var['product_category']) || fnmatch("Home*", $var['product_category']));
|
||||
});
|
||||
$bestSellers = array_values($array);
|
||||
$bestSellers = simpleProducts("");
|
||||
|
||||
for ($x = 0; $x <= 3; $x++) {
|
||||
$pid = rand(0, count($bestSellers) - 1);
|
||||
?>
|
||||
<div class="ec-sb-pro-sl-item">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>" class="sidekka_pro_img"><img src="<?php echo $bestSellers[$pid]["product_image"] ?>" alt="product" /></a>
|
||||
<div class="ec-pro-content">
|
||||
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>"><?php echo $bestSellers[$pid]["product_name"] ?></a></h5>
|
||||
<h5 class="ec-pro-title"><a id="best-sellers-title" class="bs-title" href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>"><?php echo $bestSellers[$pid]["product_name"] ?></a></h5>
|
||||
<!-- <div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
|
|
402
checkouttest.php
402
checkouttest.php
|
@ -83,6 +83,8 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<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>
|
||||
|
@ -105,6 +107,13 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
#sidebar-category:hover{
|
||||
color: #ffaa00;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="updateCartItemCount(); updateWishItemCount()" class="checkout_page">
|
||||
|
@ -252,19 +261,29 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#secondModal">Add New Address</button>
|
||||
|
||||
<!-- Display a list of addresses and let the user choose -->
|
||||
<form id="addressForm">
|
||||
<form id="addressForm" style="min-width: 500px;">
|
||||
<label>Select Address:</label>
|
||||
<?php foreach ($customer_data as $customer_index => $customer) { ?>
|
||||
<?php foreach ($customer['address'] as $address_index => $address) { ?>
|
||||
<div class="form-check">
|
||||
<!-- added new id for filter delete -->
|
||||
<div class="form-check" id="form-check-<?php echo $address_index ?>">
|
||||
<input type="radio" class="form-check-input" name="selectedAddress" id="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
<label class="form-check-label" for="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
<label class="form-check-label" style="max-width: 80%; word-wrap: break-word;" for="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
<?php echo $address['first_name']; ?> <?php echo $address['last_name']; ?><br>
|
||||
<?php echo $address['address_1']; ?> <?php echo $address['address_2']; ?>
|
||||
<?php echo $address['barangay']; ?>, <?php echo $address['city']; ?>,
|
||||
<?php echo $address['province']; ?> <?php echo $address['country']; ?><br>
|
||||
Phone: <?php echo $address['phone']; ?>
|
||||
</label>
|
||||
<!-- raymart added icon march 4 2024 -->
|
||||
<?php
|
||||
$address['id'] =$address_index;
|
||||
$jsonAddress = json_encode($address)?>
|
||||
<a onclick="deleteAddress('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)"
|
||||
class="fa-regular fa-trash-can" id="sidebar-category" style="float: right; font-size: 20px;"></a>
|
||||
<a data-bs-toggle="modal" data-bs-target="#thirdModal" data-value=' <?php echo $jsonAddress; ?>'
|
||||
class="fa-regular fa-pen-to-square" id="sidebar-category" style="float: right; font-size: 20px; padding-right: 50px;"></a>
|
||||
<!-- raymart added icon march 4 2024 -->
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
@ -278,6 +297,50 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
<script>
|
||||
var customerData = <?php echo json_encode($customer_data); ?>;
|
||||
|
||||
// raymart/sir jun added delete function for customer id march 4 2024
|
||||
function deleteAddress(customerId, addressIndex) {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
let existingAddresses = data.address || [];
|
||||
if (addressIndex >= 0 && addressIndex < existingAddresses.length) {
|
||||
existingAddresses.splice(addressIndex, 1);
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
address: existingAddresses
|
||||
}),
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
// filter the delete action
|
||||
document.getElementById('form-check-' + addressIndex).remove();
|
||||
|
||||
// location.reload();
|
||||
} else {
|
||||
console.error('Failed to submit data');
|
||||
alert('Failed to submit data');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Error submitting data');
|
||||
});
|
||||
} else {
|
||||
console.log("Invalid address index.");
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Error fetching customer data');
|
||||
});
|
||||
}
|
||||
// raymart/sir jun added delete function for customer id march 4 2024
|
||||
|
||||
|
||||
function useSelectedAddress() {
|
||||
// Get the selected address radio button
|
||||
var selectedAddress = document.querySelector('input[name="selectedAddress"]:checked');
|
||||
|
@ -355,7 +418,89 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
<input type="text" class="form-control" id="addressCountry">
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" id="submitBtn">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- raymart added 3rd modal march to show the customer address 04 2024 -->
|
||||
<div class="modal fade" id="thirdModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>
|
||||
<input type="text" class="form-control" id="addressFirstName2" value="<?php echo $address['first_name']; ?>">
|
||||
|
||||
<!-- <label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>-->
|
||||
<input type="hidden" class="form-control" id="addressId" >
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
|
||||
<input type="text" class="form-control" id="addressLastName2" value="<?php echo $address['last_name']; ?>">
|
||||
<!-- <label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
|
||||
<input type="text" class="form-control" id="addressLastName"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
|
||||
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>">
|
||||
|
||||
|
||||
<!-- <label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
|
||||
<input type="number" class="form-control" id="addressContact"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2">Building,Number</label>
|
||||
<input type="text" class="form-control" id="addressBuilding2" value="<?php echo $address['address_1']; ?>">
|
||||
|
||||
<!-- <label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
|
||||
<input type="text" class="form-control" id="addressBuilding"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2">Street </label>
|
||||
<input type="text" class="form-control" id="addressStreet2" value="<?php echo $address['address_2']; ?>">
|
||||
|
||||
<!-- <label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2"> Street </label>
|
||||
<input type="text" class="form-control" id="addressStreet"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="provinceSelect2">Province</label>
|
||||
<select class="form-select" id="provinceSelect2">
|
||||
<option id="provinceSelect2Opt" value="<?php echo $address['province']; ?>" >Select Province</option>
|
||||
</select>
|
||||
|
||||
<!-- <label for="provinceSelect">Province</label>
|
||||
<select class="form-select" id="provinceSelect">
|
||||
<option value="" disabled selected hidden>Select Province</option>
|
||||
</select> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="citySelect2">Municipality/City</label>
|
||||
<select class="form-select" id="citySelect2" required>
|
||||
<option value="" id="citySelect2Opt" selected hidden>Select Municipality/City</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="barangaySelect2">Barangay</label>
|
||||
<select class="form-select" id="barangaySelect2" required>
|
||||
<option value="" id="barangaySelect2Opt" selected hidden>Select Barangay</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addressCountry2" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
|
||||
<input type="text" class="form-control" id="addressCountry2">
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" id="submitBtn2">Submit</button>
|
||||
<!-- raymart added 3rd modal march to show the customer address 04 2024 -->
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -363,8 +508,163 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const customerId = '<?php echo $customerId ?>';
|
||||
<script>
|
||||
// raymart/sir mark added function to show the addresses of the customer in the third modal march 04 2024
|
||||
$('#thirdModal').on('shown.bs.modal', function (event) {
|
||||
|
||||
var jsonString = $(event.relatedTarget).data('value');
|
||||
|
||||
var jsonObject = JSON.parse(jsonString);
|
||||
console.log(jsonObject)
|
||||
|
||||
// document.getElementById("addressFirstName2").value('mmmm');
|
||||
// $('#addressFirstName2').setAttribute('value','My default value');
|
||||
document.querySelector('input[id="addressFirstName2"]').value = jsonObject.first_name;
|
||||
document.querySelector('input[id="addressLastName2"]').value = jsonObject.last_name;
|
||||
document.querySelector('input[id="addressContact2"]').value = jsonObject.phone;
|
||||
document.querySelector('input[id="addressBuilding2"]').value = jsonObject.address_1;
|
||||
document.querySelector('input[id="addressStreet2"]').value = jsonObject.address_2;
|
||||
document.querySelector('option[id="provinceSelect2Opt"]').text = jsonObject.province;
|
||||
document.querySelector('option[id="provinceSelect2Opt"]').value = jsonObject.province;
|
||||
|
||||
document.querySelector('option[id="citySelect2Opt"]').text = jsonObject.city;
|
||||
document.querySelector('option[id="citySelect2Opt"]').value = jsonObject.city;
|
||||
|
||||
document.querySelector('option[id="barangaySelect2Opt"]').text = jsonObject.barangay;
|
||||
document.querySelector('option[id="barangaySelect2Opt"]').value = jsonObject.barangay;
|
||||
|
||||
document.querySelector('input[id="addressCountry2"]').value = jsonObject.country;
|
||||
document.querySelector('input[id="addressId"]').value = jsonObject.id;
|
||||
|
||||
|
||||
|
||||
console.log('id ' + jsonObject.id)
|
||||
const provinceSelect = $('#provinceSelect2'); // Use jQuery to select the element
|
||||
const citySelect = $('#citySelect2'); // Use jQuery to select the element
|
||||
const barangaySelect = $('#barangaySelect2'); // Use jQuery to select the element
|
||||
|
||||
// const provinceSelect = $('#provinceSelect2'); // Use jQuery to select the element
|
||||
// const citySelect = $('#citySelect2'); // Use jQuery to select the element
|
||||
// const barangaySelect = $('#barangaySelect2'); // Use jQuery to select the element
|
||||
|
||||
// Initialize Select2 on the provinceSelect, citySelect, and barangaySelect elements
|
||||
provinceSelect.select2({
|
||||
dropdownParent: $('#thirdModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
|
||||
citySelect.select2({
|
||||
dropdownParent: $('#thirdModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
barangaySelect.select2({
|
||||
dropdownParent: $('#thirdModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
|
||||
// Fetch provinces data
|
||||
fetch('https://psgc.gitlab.io/api/provinces')
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('Failed to fetch provinces');
|
||||
throw new Error('Failed to fetch provinces');
|
||||
}
|
||||
})
|
||||
.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();
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
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
|
||||
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/`;
|
||||
}
|
||||
|
||||
fetch(citiesEndpoint)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('Failed to fetch cities/municipalities');
|
||||
throw new Error('Failed to fetch cities/municipalities');
|
||||
}
|
||||
})
|
||||
.then(citiesData => {
|
||||
// Iterate through the cities data and add options
|
||||
citiesData.forEach(city => {
|
||||
const option = new Option(city.name, city.code);
|
||||
citySelect.append(option);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 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/`)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('Failed to fetch barangays');
|
||||
throw new Error('Failed to fetch barangays');
|
||||
}
|
||||
})
|
||||
.then(barangaysData => {
|
||||
// Iterate through the barangays data and add options
|
||||
barangaysData.forEach(barangay => {
|
||||
const option = new Option(barangay.name, barangay.code);
|
||||
barangaySelect.append(option);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// document.querySelector('input[id="addressFirstName2"]').value = jsonObject.last_name;
|
||||
});
|
||||
// raymart/sir mark added function to show the addresses of the customer in the third modal march 04 2024
|
||||
const customerId = '<?php echo $customerId ?>';
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Get the select elements
|
||||
const provinceSelect = $('#provinceSelect'); // Use jQuery to select the element
|
||||
|
@ -552,18 +852,102 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
// raymart/sir mark added submitbtn2 for edited customerId march 04 2024
|
||||
$('#submitBtn2').on('click', function() {
|
||||
// function updateAddress(){
|
||||
// Retrieve existing addresses from the API
|
||||
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
const existingAddresses = data.address || [];
|
||||
|
||||
// Get the new address details
|
||||
const firstName = $('#addressFirstName2').val();
|
||||
const lastName = $('#addressLastName2').val();
|
||||
const contact = $('#addressContact2').val();
|
||||
const buildingNumber = $('#addressBuilding2').val();
|
||||
const street = $('#addressStreet2').val();
|
||||
const province = $('#provinceSelect2 :selected').text();
|
||||
const city = $('#citySelect2 :selected').text();
|
||||
const barangay = $('#barangaySelect2 :selected').text();
|
||||
const country = $('#addressCountry2').val();
|
||||
const id = $('#addressId').val();
|
||||
console.log('clickkkkkkkk'+ id)
|
||||
|
||||
|
||||
// Create a new address object
|
||||
const newAddress = {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
phone: contact,
|
||||
address_1: buildingNumber,
|
||||
address_2: street,
|
||||
city: city,
|
||||
province: province,
|
||||
barangay: barangay,
|
||||
country: country,
|
||||
};
|
||||
|
||||
// Add the new address to the existing addresses
|
||||
// existingAddresses.push(newAddress);
|
||||
|
||||
// var newAddresses= existingAddresses.filter((e,i)=>i!==id)
|
||||
let existingAddress = existingAddresses
|
||||
|
||||
existingAddress[id]={
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
phone: contact,
|
||||
address_1: buildingNumber,
|
||||
address_2: street,
|
||||
city: city,
|
||||
province: province,
|
||||
barangay: barangay,
|
||||
country: country,
|
||||
};
|
||||
console.log( existingAddress[id])
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
address: existingAddress
|
||||
}),
|
||||
});
|
||||
})
|
||||
.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');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<span class="ec-check-order-btn">
|
||||
<?php
|
||||
<?php
|
||||
if (empty($cartItems)) {
|
||||
echo '<!-- $cartItems is empty, "Place Order" button will not be displayed -->';
|
||||
} else {
|
||||
echo '
|
||||
<span class="ec-check-order-btn">
|
||||
<a class="btn btn-primary" id="submitButton">Place Order</a>
|
||||
</span>';
|
||||
<a class="btn btn-primary" id="submitButton">Place Order</a>
|
||||
</span>';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
|
@ -1103,7 +1487,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
'Authorization': "Bearer " + token,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if (!patchResponse.ok) {
|
||||
throw new Error(`Error updating payment status: ${patchResponse.status} ${patchResponse.statusText}`);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,688 @@
|
|||
<!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/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="aboutus_page">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
<div class="ec-side-cart-overlay"></div>
|
||||
<div id="ec-side-cart" class="ec-side-cart">
|
||||
<div class="ec-cart-inner">
|
||||
<div class="ec-cart-top">
|
||||
<div class="ec-cart-title">
|
||||
<span class="cart_title">My Cart</span>
|
||||
<button class="ec-close">×</button>
|
||||
</div>
|
||||
<ul class="eccart-pro-items">
|
||||
<li>
|
||||
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img
|
||||
src="assets/images/product-image/6_1.jpg" alt="product"></a>
|
||||
<div class="ec-pro-content">
|
||||
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">T-shirt For Women</a>
|
||||
<span class="cart-price"><span>$76.00</span> x 1</span>
|
||||
<div class="qty-plus-minus">
|
||||
<input class="qty-input" type="text" name="ec_qtybtn" value="1" />
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="remove">×</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img
|
||||
src="assets/images/product-image/12_1.jpg" alt="product"></a>
|
||||
<div class="ec-pro-content">
|
||||
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">Women Leather Shoes</a>
|
||||
<span class="cart-price"><span>$64.00</span> x 1</span>
|
||||
<div class="qty-plus-minus">
|
||||
<input class="qty-input" type="text" name="ec_qtybtn" value="1" />
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="remove">×</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img"><img
|
||||
src="assets/images/product-image/3_1.jpg" alt="product"></a>
|
||||
<div class="ec-pro-content">
|
||||
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">Girls Nylon Purse</a>
|
||||
<span class="cart-price"><span>$59.00</span> x 1</span>
|
||||
<div class="qty-plus-minus">
|
||||
<input class="qty-input" type="text" name="ec_qtybtn" value="1" />
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="remove">×</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-cart-bottom">
|
||||
<div class="cart-sub-total">
|
||||
<table class="table cart-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-left">Sub-Total :</td>
|
||||
<td class="text-right">$300.00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">VAT (20%) :</td>
|
||||
<td class="text-right">$60.00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">Total :</td>
|
||||
<td class="text-right primary-color">$360.00</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="cart_btn">
|
||||
<a href="cart.html" class="btn btn-primary">View Cart</a>
|
||||
<a href="checkout.html" class="btn btn-secondary">Checkout</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row ec_breadcrumb_inner">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<h2 class="ec-breadcrumb-title">About Us</h2>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<!-- ec-breadcrumb-list start -->
|
||||
<ul class="ec-breadcrumb-list">
|
||||
<li class="ec-breadcrumb-item"><a href="index.php">Home</a></li>
|
||||
<li class="ec-breadcrumb-item active">About Us</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec breadcrumb end -->
|
||||
|
||||
<!-- Ec About Us page -->
|
||||
<section class="ec-page-content section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<div class="section-title">
|
||||
<h2 class="ec-bg-title">FAQ</h2>
|
||||
<h2 class="ec-title">FAQ</h2>
|
||||
<p class="sub-title mb-3">Frequently Asked Questions</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-common-wrapper">
|
||||
<div class="row">
|
||||
<!-- <div class="col-md-6 ec-cms-block ec-abcms-block text-center">
|
||||
<div class="ec-cms-block-inner">
|
||||
<img class="a-img" src="assets/images/offer-image/1.jpg" alt="about">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-md-12 ec-cms-block ec-abcms-block text-center">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">What is Obanana Corporation's B2B eCommerce platform?</h3>
|
||||
<p>Obanana Corporation's B2B eCommerce platform is an online marketplace designed to connect businesses worldwide, facilitating trade between buyers and sellers.</p>
|
||||
<h3 class="ec-cms-block-title">What kind of products can be found on the Obanana Corporation platform?</h3>
|
||||
<p>Our platform offers a diverse range of products across various industries, including but not limited to electronics, clothing, machinery, raw materials, and more, catering to the needs of businesses across different sectors.</p>
|
||||
<h3 class="ec-cms-block-title">How does the platform ensure the quality of products listed?</h3>
|
||||
<p>To ensure quality standards, we implement rigorous verification processes for both sellers and products. We encourage buyers to provide feedback and ratings based on their experience, fostering transparency and trust within our marketplace.</p>
|
||||
<h3 class="ec-cms-block-title">What are the payment options available on the Obanana Corporation platform?</h3>
|
||||
<p>We offer a variety of secure payment options to accommodate the needs of our users, including bank transfers, credit/debit cards, and third-party payment gateways, ensuring smooth and secure transactions.</p>
|
||||
<h3 class="ec-cms-block-title">Can buyers and sellers communicate directly on the platform?</h3>
|
||||
<p>Yes, our platform facilitates direct communication between buyers and sellers through messaging features and inquiry forms, allowing for seamless negotiation and collaboration.</p>
|
||||
<h3 class="ec-cms-block-title">How does shipping and logistics work on the Obanana Corporation platform?</h3>
|
||||
<p>We provide comprehensive shipping and logistics solutions, including freight forwarding services and shipping partners, to ensure efficient and timely delivery of goods to buyers worldwide.</p>
|
||||
<h3 class="ec-cms-block-title">Are there any minimum order requirements for purchasing on the platform?</h3>
|
||||
<p>Minimum order requirements may vary depending on the seller and product category. Buyers can find detailed information regarding minimum order quantities on product listings.</p>
|
||||
<h3 class="ec-cms-block-title">Does Obanana Corporation offer any trade assurance or buyer protection services?</h3>
|
||||
<p>Yes, we provide trade assurance services to protect buyers' interests, offering refunds or replacements for orders that do not meet agreed-upon quality standards or fail to arrive within specified delivery times.</p>
|
||||
<h3 class="ec-cms-block-title">How does Obanana Corporation handle disputes between buyers and sellers?</h3>
|
||||
<p>In the event of disputes, our dedicated support team mediates and facilitates resolution through our dispute resolution process, ensuring fair outcomes for all parties involved.</p>
|
||||
<h3 class="ec-cms-block-title">How can businesses join the Obanana Corporation platform as sellers?</h3>
|
||||
<p>Businesses interested in becoming sellers on our platform can apply for membership through our website, where they will undergo a verification process to ensure compliance with our standards and policies.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ec testmonial Start -->
|
||||
<section class="section ec-test-section section-space-ptb-100 section-space-m" id="reviews">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<div class="section-title mb-0">
|
||||
<h2 class="ec-bg-title">Testimonial</h2>
|
||||
<h2 class="ec-title">Client Review</h2>
|
||||
<p class="sub-title mb-3">What say client about us</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="ec-test-outer">
|
||||
<ul id="ec-testimonial-slider">
|
||||
<li class="ec-test-item">
|
||||
<i class="fi-rr-quote-right top"></i>
|
||||
<div class="ec-test-inner">
|
||||
<div class="ec-test-img"><img alt="testimonial" title="testimonial"
|
||||
src="assets/images/testimonial/1.jpg" /></div>
|
||||
<div class="ec-test-content">
|
||||
<div class="ec-test-desc">Lorem Ipsum is simply dummy text of the printing and
|
||||
typesetting industry. Lorem Ipsum has been the industry's standard dummy text
|
||||
ever since the 1500s, when an unknown printer took a galley of type and
|
||||
scrambled it to make a type specimen</div>
|
||||
<div class="ec-test-name">John Doe</div>
|
||||
<div class="ec-test-designation">General Manager</div>
|
||||
<div class="ec-test-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>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fi-rr-quote-right bottom"></i>
|
||||
</li>
|
||||
<li class="ec-test-item ">
|
||||
<i class="fi-rr-quote-right top"></i>
|
||||
<div class="ec-test-inner">
|
||||
<div class="ec-test-img"><img alt="testimonial" title="testimonial"
|
||||
src="assets/images/testimonial/2.jpg" /></div>
|
||||
<div class="ec-test-content">
|
||||
<div class="ec-test-desc">Lorem Ipsum is simply dummy text of the printing and
|
||||
typesetting industry. Lorem Ipsum has been the industry's standard dummy text
|
||||
ever since the 1500s, when an unknown printer took a galley of type and
|
||||
scrambled it to make a type specimen</div>
|
||||
<div class="ec-test-name">John Doe</div>
|
||||
<div class="ec-test-designation">General Manager</div>
|
||||
<div class="ec-test-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>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fi-rr-quote-right bottom"></i>
|
||||
</li>
|
||||
<li class="ec-test-item">
|
||||
<i class="fi-rr-quote-right top"></i>
|
||||
<div class="ec-test-inner">
|
||||
<div class="ec-test-img"><img alt="testimonial" title="testimonial"
|
||||
src="assets/images/testimonial/3.jpg" /></div>
|
||||
<div class="ec-test-content">
|
||||
<div class="ec-test-desc">Lorem Ipsum is simply dummy text of the printing and
|
||||
typesetting industry. Lorem Ipsum has been the industry's standard dummy text
|
||||
ever since the 1500s, when an unknown printer took a galley of type and
|
||||
scrambled it to make a type specimen</div>
|
||||
<div class="ec-test-name">John Doe</div>
|
||||
<div class="ec-test-designation">General Manager</div>
|
||||
<div class="ec-test-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>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fi-rr-quote-right bottom"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- ec testmonial end -->
|
||||
|
||||
<!-- services Section Start -->
|
||||
<section class="section ec-services-section section-space-p" id="services">
|
||||
<h2 class="d-none">Services</h2>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="ec_ser_content ec_ser_content_1 col-sm-12 col-md-6 col-lg-3" data-animation="zoomIn">
|
||||
<div class="ec_ser_inner">
|
||||
<div class="ec-service-image">
|
||||
<i class="fi fi-ts-truck-moving"></i>
|
||||
</div>
|
||||
<div class="ec-service-desc">
|
||||
<h2>Free Shipping</h2>
|
||||
<p>Free shipping on all US order or order above $200</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec_ser_content ec_ser_content_2 col-sm-12 col-md-6 col-lg-3" data-animation="zoomIn">
|
||||
<div class="ec_ser_inner">
|
||||
<div class="ec-service-image">
|
||||
<i class="fi fi-ts-hand-holding-seeding"></i>
|
||||
</div>
|
||||
<div class="ec-service-desc">
|
||||
<h2>24X7 Support</h2>
|
||||
<p>Contact us 24 hours a day, 7 days a week</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec_ser_content ec_ser_content_3 col-sm-12 col-md-6 col-lg-3" data-animation="zoomIn">
|
||||
<div class="ec_ser_inner">
|
||||
<div class="ec-service-image">
|
||||
<i class="fi fi-ts-badge-percent"></i>
|
||||
</div>
|
||||
<div class="ec-service-desc">
|
||||
<h2>30 Days Return</h2>
|
||||
<p>Simply return it within 30 days for an exchange</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec_ser_content ec_ser_content_4 col-sm-12 col-md-6 col-lg-3" data-animation="zoomIn">
|
||||
<div class="ec_ser_inner">
|
||||
<div class="ec-service-image">
|
||||
<i class="fi fi-ts-donate"></i>
|
||||
</div>
|
||||
<div class="ec-service-desc">
|
||||
<h2>Payment Secure</h2>
|
||||
<p>Contact us 24 hours a day, 7 days a week</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!--services Section End -->
|
||||
|
||||
<!-- Ec Instagram Start -->
|
||||
<!-- <section class="section ec-instagram-section module section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<div class="section-title">
|
||||
<h2 class="ec-bg-title">Instagram Feed</h2>
|
||||
<h2 class="ec-title">Instagram Feed</h2>
|
||||
<p class="sub-title">Share your store with us</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-insta-wrapper">
|
||||
<div class="ec-insta-outer">
|
||||
<div class="container">
|
||||
<div class="insta-auto"> -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/1.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/2.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/3.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/4.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/5.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/6.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
<!-- instagram item -->
|
||||
<!-- <div class="ec-insta-item">
|
||||
<div class="ec-insta-inner">
|
||||
<a href="#" target="_blank"><img src="assets/images/instragram-image/7.jpg"
|
||||
alt="insta"></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- instagram item -->
|
||||
|
||||
<!-- </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
<!-- Ec Instagram End -->
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
<div class="ec-nav-panel">
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i
|
||||
class="fi-rr-menu-burger"></i></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i
|
||||
class="fi-rr-shopping-bag"></i><span
|
||||
class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span
|
||||
class="ec-cart-noti">4</span></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- Recent Purchase Popup -->
|
||||
<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>
|
||||
<h6>stylish baby shoes</h6>
|
||||
<p>10 Minutes ago</p>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
|
||||
</div>
|
||||
<!-- Recent Purchase Popup end -->
|
||||
|
||||
<!-- Cart Floating Button -->
|
||||
<div class="ec-cart-float">
|
||||
<a href="#ec-side-cart" class="ec-header-btn ec-side-toggle">
|
||||
<div class="header-icon"><i class="fi-rr-shopping-basket"></i>
|
||||
</div>
|
||||
<span class="ec-cart-count cart-count-lable">3</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Cart Floating Button end -->
|
||||
|
||||
<!-- Whatsapp -->
|
||||
<div class="ec-style ec-right-bottom">
|
||||
<!-- Start Floating Panel Container -->
|
||||
<div class="ec-panel">
|
||||
<!-- Panel Header -->
|
||||
<div class="ec-header">
|
||||
<strong>Need Help?</strong>
|
||||
<p>Chat with us on WhatsApp</p>
|
||||
</div>
|
||||
<!-- Panel Content -->
|
||||
<div class="ec-body">
|
||||
<ul>
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266"
|
||||
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
|
||||
alt="Profile image">
|
||||
<span class="ec-status-icon"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Sahar Darya</span>
|
||||
<p>Sahar left 7 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266"
|
||||
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
|
||||
alt="Profile image">
|
||||
<span class="ec-status-icon ec-online"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Yolduz Rafi</span>
|
||||
<p>Yolduz is online</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266"
|
||||
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
|
||||
alt="Profile image">
|
||||
<span class="ec-status-icon ec-offline"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Nargis Hawa</span>
|
||||
<p>Nargis left 30 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266"
|
||||
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
|
||||
alt="Profile image">
|
||||
<span class="ec-status-icon ec-offline"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Khadija Mehr</span>
|
||||
<p>Khadija left 50 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ End Floating Panel Container -->
|
||||
<!-- Start Right Floating Button-->
|
||||
<div class="ec-right-bottom">
|
||||
<div class="ec-box">
|
||||
<div class="ec-button rotateBackward">
|
||||
<img class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ End Right Floating Button-->
|
||||
</div>
|
||||
<!-- Whatsapp end -->
|
||||
|
||||
<!-- Feature tools -->
|
||||
<div class="ec-tools-sidebar-overlay"></div>
|
||||
<div class="ec-tools-sidebar">
|
||||
<div class="tool-title">
|
||||
<h3>Features</h3>
|
||||
</div>
|
||||
<a href="#" class="ec-tools-sidebar-toggle in-out">
|
||||
<img alt="icon" src="assets/images/common/settings.png">
|
||||
</a>
|
||||
<div class="ec-tools-detail">
|
||||
<div class="ec-tools-sidebar-content ec-change-color ec-color-desc">
|
||||
<h3>Color Scheme</h3>
|
||||
<ul class="bg-panel">
|
||||
<li class="active" data-color="01"><a href="#" class="colorcode1"></a></li>
|
||||
<li data-color="02"><a href="#" class="colorcode2"></a></li>
|
||||
<li data-color="03"><a href="#" class="colorcode3"></a></li>
|
||||
<li data-color="04"><a href="#" class="colorcode4"></a></li>
|
||||
<li data-color="05"><a href="#" class="colorcode5"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Backgrounds</h3>
|
||||
<ul class="bg-panel">
|
||||
<li class="bg"><a class="back-bg-1" id="bg-1">Background-1</a></li>
|
||||
<li class="bg"><a class="back-bg-2" id="bg-2">Background-2</a></li>
|
||||
<li class="bg"><a class="back-bg-3" id="bg-3">Background-3</a></li>
|
||||
<li class="bg"><a class="back-bg-4" id="bg-4">Default</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Full Screen mode</h3>
|
||||
<div class="ec-fullscreen-mode">
|
||||
<div class="ec-fullscreen-switch">
|
||||
<div class="ec-fullscreen-btn">Mode</div>
|
||||
<div class="ec-fullscreen-on">On</div>
|
||||
<div class="ec-fullscreen-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Dark mode</h3>
|
||||
<div class="ec-change-mode">
|
||||
<div class="ec-mode-switch">
|
||||
<div class="ec-mode-btn">Mode</div>
|
||||
<div class="ec-mode-on">On</div>
|
||||
<div class="ec-mode-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>RTL mode</h3>
|
||||
<div class="ec-change-rtl">
|
||||
<div class="ec-rtl-switch">
|
||||
<div class="ec-rtl-btn">Rtl</div>
|
||||
<div class="ec-rtl-on">On</div>
|
||||
<div class="ec-rtl-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Clear local storage</h3>
|
||||
<a class="clear-cach" href="javascript:void(0)">Clear Cache & Default</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Feature tools end -->
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<script src="assets/js/vendor/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/vendor/popper.min.js"></script>
|
||||
<script src="assets/js/vendor/bootstrap.min.js"></script>
|
||||
<script src="assets/js/vendor/jquery-migrate-3.3.0.min.js"></script>
|
||||
<script src="assets/js/vendor/modernizr-3.11.2.min.js"></script>
|
||||
|
||||
<!--Plugins JS-->
|
||||
<script src="assets/js/plugins/swiper-bundle.min.js"></script>
|
||||
<script src="assets/js/plugins/countdownTimer.min.js"></script>
|
||||
<script src="assets/js/plugins/scrollup.js"></script>
|
||||
<script src="assets/js/plugins/jquery.zoom.min.js"></script>
|
||||
<script src="assets/js/plugins/slick.min.js"></script>
|
||||
<script src="assets/js/plugins/infiniteslidev2.js"></script>
|
||||
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
|
||||
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -33,7 +33,7 @@
|
|||
<div class="ec-footer-links">
|
||||
<ul class="align-items-center">
|
||||
<li class="ec-footer-link"><a href="about-us.php">About us</a></li>
|
||||
<li class="ec-footer-link"><a href="faq.html">FAQ</a></li>
|
||||
<li class="ec-footer-link"><a href="faq.php">FAQ</a></li>
|
||||
<!-- <li class="ec-footer-link"><a href="track-order.html">Delivery Information</a></li> -->
|
||||
<!-- <li class="ec-footer-link"><a href="contact-us.html">Contact us</a></li> -->
|
||||
<!-- 02-16-2024 Stacy changed contact us link-->
|
||||
|
|
|
@ -1552,6 +1552,7 @@ function editProduct(
|
|||
$color,
|
||||
$material,
|
||||
$size,
|
||||
$priceMatrix,
|
||||
$token
|
||||
) {
|
||||
$curl = curl_init();
|
||||
|
@ -1576,6 +1577,9 @@ function editProduct(
|
|||
'same-day-delivery' => $sdd ,
|
||||
'free-shipping' => $freeSf
|
||||
),
|
||||
'price_matrix' => array(
|
||||
$priceMatrix
|
||||
),
|
||||
'parent_id' => $parentId,
|
||||
'minimum_order' => $minimumOrder,
|
||||
// 'variants' => array(
|
||||
|
|
|
@ -870,7 +870,7 @@
|
|||
<li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="compare.html">Compare</a></li>
|
||||
<li><a href="faq.html">FAQ</a></li>
|
||||
<li><a href="faq.php">FAQ</a></li>
|
||||
<li><a href="login.php">Login</a></li>
|
||||
<li><a href="register.php">Register</a></li>
|
||||
<li><a href="track-order.html">Track Order</a></li>
|
||||
|
@ -1174,7 +1174,7 @@
|
|||
<li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="compare.html">Compare</a></li>
|
||||
<li><a href="faq.html">FAQ</a></li>
|
||||
<li><a href="faq.php">FAQ</a></li>
|
||||
<li><a href="login.php">Login</a></li>
|
||||
<li><a href="register.php">Register</a></li>
|
||||
<li><a href="track-order.html">Track Order</a></li>
|
||||
|
|
29
index.php
29
index.php
|
@ -256,7 +256,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($forAll[$pid]["sale_price"]) && $forAll[$pid]["sale_price"] > 0) : ?>
|
||||
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php elseif (isset($forAll[$pid]["regular_price"]) && $forAll[$pid]["regular_price"] != "") : ?>
|
||||
|
@ -377,11 +377,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($electronics[$pid]["sale_price"]) && $electronics[$pid]["sale_price"] > 0) : ?>
|
||||
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<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 Carttt</button>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php elseif (isset($electronics[$pid]["regular_price"]) && $electronics[$pid]["regular_price"] != "") : ?>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<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 Carttt</button>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php else : ($electronics[$pid]["regular_price"] == "" || $electronics[$pid]["regular_price"] == null) ?>
|
||||
|
@ -498,7 +498,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-pro-actions"style="bottom: -36px;">
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($smartHome[$pid]["sale_price"]) && $smartHome[$pid]["sale_price"] > 0) : ?>
|
||||
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php elseif (isset($smartHome[$pid]["regular_price"]) && $smartHome[$pid]["regular_price"] != "") : ?>
|
||||
|
@ -618,7 +618,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-pro-actions"style="bottom: -36px;">
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($forVehicle[$pid]["sale_price"]) && $forVehicle[$pid]["sale_price"] > 0) : ?>
|
||||
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php elseif (isset($forVehicle[$pid]["regular_price"]) && $forVehicle[$pid]["regular_price"] != "") : ?>
|
||||
|
@ -1240,8 +1240,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
</a> -->
|
||||
<!-- raymart edit action feb 14 2024 -->
|
||||
<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>
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($newArrival[$pid]["sale_price"]) && $newArrival[$pid]["sale_price"] > 0) : ?>
|
||||
<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>
|
||||
|
||||
<?php elseif (isset($newArrival[$pid]["regular_price"]) && $newArrival[$pid]["regular_price"] != "") : ?>
|
||||
<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>
|
||||
|
||||
<?php else : ($newArrival[$pid]["regular_price"] == "" || $newArrival[$pid]["regular_price"] == null) ?>
|
||||
<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>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
|
||||
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($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>
|
||||
<!-- <div class="ec-pro-actions">
|
||||
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
|
||||
|
|
|
@ -74,6 +74,7 @@ if (isset($_GET['id'])) {
|
|||
<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" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/nouislider.css" />
|
||||
|
||||
<!-- Main Style -->
|
||||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
|
@ -503,8 +504,8 @@ if (isset($_GET['id'])) {
|
|||
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 id="addToCartMessage" style="border:1px solid red;"></div>';
|
||||
echo '<div> <div id="addToCartMessage" style="padding-left:45px;"></div> <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></div>';
|
||||
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>';
|
||||
|
@ -1511,9 +1512,24 @@ if (isset($_GET['id'])) {
|
|||
</div> -->
|
||||
<!-- 02-21-2024 Stacy commented out -->
|
||||
<!-- 02-21-2024 Stacy added -->
|
||||
<div class="ec-pro-actions">
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$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($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($similar_products[$pid]["sale_price"]) && $similar_products[$pid]["sale_price"] > 0) : ?>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$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($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php elseif (isset($similar_products[$pid]["regular_price"]) && $similar_products[$pid]["regular_price"] != "") : ?>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$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($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php else : ($similar_products[$pid]["regular_price"] == "" || $similar_products[$pid]["regular_price"] == null) ?>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
|
||||
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$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($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
|
||||
</div>
|
||||
<!-- 02-21-2024 Stacy added -->
|
||||
</div>
|
||||
|
|
|
@ -169,12 +169,17 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header -->
|
||||
<?php include "header.php" ?>
|
||||
<?php include "category-slider.php" ?>
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Category Slider -->
|
||||
<?php include "category-slider.php" ?>
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
<div class="container">
|
||||
|
@ -253,7 +258,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<img src="https://api.obanana.com/images/storage/web_images/1708588564876-viber_image_2024-02-22_15-54-42-498.png" class="vendor-image-placeholder" style="max-width: 100px; max-height: 100px;">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="vendor-details" style="display: inline-block;">
|
||||
<div class="vendor-details" style="display:inline-block;">
|
||||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
|
||||
<h6 class="ec-pro-title" style="padding:0 30px;font-family: Poppins, sans-serif; text-decoration: none; color: #777;white-space: nowrap;text-overflow: ellipsis;display: block;font-size: 16px;font-weight: 400;">
|
||||
<?php echo $vendor['user_login']; ?>
|
||||
|
@ -339,9 +344,24 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<img class="main-image" src="<?php echo $product_image ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $product_image ?>" alt="Product" />
|
||||
</a> -->
|
||||
<div class="ec-pro-actions">
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($productWithoutSpecs), 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($productWithoutSpecs), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
|
||||
<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>
|
||||
|
||||
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
|
||||
<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>
|
||||
|
||||
<?php else : ($product["regular_price"] == "" || $product["regular_price"] == null) ?>
|
||||
<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>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
|
||||
|
||||
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($productWithoutSpecs), 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($productWithoutSpecs), 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>
|
||||
|
@ -476,25 +496,35 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Apparel" <?php echo (isset($_POST['category']) && in_array('Apparel', $_POST['category'])) || (isset($_GET['category']) && in_array('Apparel', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Apparel</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<label for="minPrice">Min Price:</label>
|
||||
<input type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
|
||||
<div style="padding-top:10px;">
|
||||
<label for="minPrice" style="margin-bottom:-5px;">Min Price:</label>
|
||||
<input style="height:40px" type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<label for="maxPrice">Max Price:</label>
|
||||
<input type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
|
||||
<label for="maxPrice" style="margin-bottom:-5px;">Max Price:</label>
|
||||
<input style="height:40px" type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div style="padding-top:10px;">
|
||||
<button style="font-size:12px; height:30px; width:60px;" class="btn-primary" type="submit">Apply</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<button type="submit">Apply</button>
|
||||
<!-- <button type="submit">Apply</button> -->
|
||||
</form>
|
||||
<!-- <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] . '?' . http_build_query(array_merge($_GET, $_POST)); ?>">
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<?php include "header.php" ?>
|
||||
<!-- ekka Cart Start -->
|
||||
<?php include "category-slider.php" ?>
|
||||
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
|
@ -178,16 +179,47 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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">
|
||||
<?php $simpleProducts ?>
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
|
||||
<div class="ec-pro-image">
|
||||
<a href="shop-left-sidebar-col-4.php" class="image">
|
||||
<img class="main-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" />
|
||||
<img class="hover-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" />
|
||||
<a href="product-left-sidebar.php?id=<?php echo $simpleProducts[$pid]["_id"]; ?>"class="image">
|
||||
<!-- raymart changes product images to images march 8 2024 -->
|
||||
<?php
|
||||
if (isset($simpleProducts[$pid]['images'])) {
|
||||
$image_urls = explode(',', $simpleProducts[$pid]['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="hover-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- <img class="main-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" /> -->
|
||||
<!-- <img class="hover-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" /> -->
|
||||
</a>
|
||||
|
||||
<div class="ec-pro-actions">
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$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($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
<div class="ec-pro-actions" style="bottom: -36px;">
|
||||
<!-- raymart added update prize for the product -->
|
||||
|
||||
<?php if (isset($simpleProducts[$pid]["sale_price"]) && $simpleProducts[$pid]["sale_price"] > 0) : ?>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$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($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php elseif (isset($simpleProducts[$pid]["regular_price"]) && $simpleProducts[$pid]["regular_price"] != "") : ?>
|
||||
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$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($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php else : ($simpleProducts[$pid]["regular_price"] == "" || $simpleProducts[$pid]["regular_price"] == null) ?>
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$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($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
|
||||
</div>
|
||||
<!-- <span class="percentage">20%</span>
|
||||
<a href="#" class="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>
|
||||
|
@ -394,7 +426,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
<!-- Sidebar Price Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Price</h3>
|
||||
</div>
|
||||
|
@ -408,7 +440,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Sidebar Size Block -->
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
|
@ -643,7 +675,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- Recent Purchase Popup -->
|
||||
<div class="recent-purchase">
|
||||
<!-- <div class="recent-purchase">
|
||||
<img src="assets/images/product-image/1.jpg" alt="payment image">
|
||||
<div class="detail">
|
||||
<p>Someone in new just bought</p>
|
||||
|
@ -651,7 +683,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<p>10 Minutes ago</p>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Recent Purchase Popup end -->
|
||||
|
||||
<!-- Cart Floating Button -->
|
||||
|
@ -868,11 +900,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
<script src="assets/js/newjs.js"></script>
|
||||
<!-- <script src="assets/js/newjs.js"></script> -->
|
||||
<!-- raymart added js link feb 14 2024 -->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester10.js"></script>';
|
||||
echo '<script src="assets/js/tester11.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<td>
|
||||
<span class="tbl-btn">
|
||||
<a class="btn btn-lg btn-primary" onclick="updateCompletedStatus('<?php echo $order['_id']; ?>')">Received</a>
|
||||
<a class="btn btn-lg btn-primary" onclick="updateCompletedStatus('<?php echo $order['_id']; ?>', '<?php echo htmlspecialchars($order['payment']['reference_number']); ?>')">Received</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -360,13 +360,22 @@ if ($_SESSION["userId"] <> "") {
|
|||
<td><span><?php echo $order['courier_name']; ?></span></td>
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<td>
|
||||
<?php
|
||||
<?php
|
||||
$currentDate = time(); // Current Unix timestamp
|
||||
|
||||
if ($order['return_order']['status'] === 'To Approve') {
|
||||
echo '<span class="tbl-btn">Refund Requested</span>';
|
||||
} elseif ($order['return_order']['status'] === 'To Ship') {
|
||||
echo '<span class="tbl-btn">For Refund</span>';
|
||||
}else {
|
||||
echo '<a class="btn btn-lg btn-primary" data-bs-toggle="modal" data-bs-target="#modal-refund-' . $order['_id'] . '">Return/Refund</a>';
|
||||
} else {
|
||||
$orderDate = strtotime($order['updatedAt']);
|
||||
$sevenDaysAfterOrder = strtotime('+7 days', $orderDate); // Seven days after the order date
|
||||
|
||||
if ($currentDate >= $sevenDaysAfterOrder) {
|
||||
echo '<span class="tbl-btn" disabled></span>';
|
||||
} else {
|
||||
echo '<a class="btn btn-lg btn-primary" data-bs-toggle="modal" data-bs-target="#modal-refund-' . $order['_id'] . '">Return/Refund</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
@ -580,7 +589,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
|
@ -656,7 +665,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
localStorage.setItem('activeTab', tabName);
|
||||
}
|
||||
|
||||
function updateCompletedStatus(orderId) {
|
||||
function updateCompletedStatus(orderId, referenceNumber) {
|
||||
login(email, password, function(token) {
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
|
@ -667,6 +676,10 @@ if ($_SESSION["userId"] <> "") {
|
|||
},
|
||||
body: JSON.stringify({
|
||||
status: 'COMPLETED',
|
||||
payment: {
|
||||
status: 'PAID',
|
||||
reference_number: referenceNumber
|
||||
}
|
||||
}),
|
||||
})
|
||||
.then(response => response.json())
|
||||
|
@ -675,7 +688,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (data && data !== "") {
|
||||
// Update the status in the table without reloading the page
|
||||
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
|
||||
// location.reload();
|
||||
location.reload();
|
||||
|
||||
} else {
|
||||
alert('Failed to update order status');
|
||||
|
|
412
user-profile.php
412
user-profile.php
|
@ -45,6 +45,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
|
||||
<!-- FONTAWESOME -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
|
||||
|
@ -84,6 +87,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
background-color: rgba(0, 0, 0, 0.6);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#editDelete:hover i{
|
||||
color: #ffaa00;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -106,7 +114,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Category Sidebar start -->
|
||||
<?php include "category-slider.php" ?>
|
||||
<?php #include "category-slider.php" ?>
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
|
@ -241,7 +249,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
<form id="addressForm">
|
||||
<?php foreach ($customer_data as $customer_index => $customer) { ?>
|
||||
<?php foreach ($customer['address'] as $address_index => $address) { ?>
|
||||
<div class="card mb-3">
|
||||
<!-- added id -->
|
||||
<div class="card mb-3" id="form-check-<?php echo $address_index ?>">
|
||||
<div class="card-body">
|
||||
<div class="selectCon">
|
||||
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
|
||||
|
@ -251,7 +260,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
|
||||
<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' : ''; ?>>
|
||||
<label class="form-check-label" style="margin: 0px 10px !important;" for="shipping_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
Shipping Address
|
||||
|
@ -259,10 +268,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 03-01-2024 Stacy modified this block of code -->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mx-auto"> <!-- Adjust the column size as needed -->
|
||||
<div class="col-md-12 mx-auto" > <!-- Adjust the column size as needed -->
|
||||
<div id="editDelete" style="display:flex; float:right; width:20px; margin-right:-10px;" >
|
||||
<?php
|
||||
$address['id'] =$address_index;
|
||||
$jsonAddress = json_encode($address)?>
|
||||
<a href="javascript:0" data-bs-toggle="modal" data-value=' <?php echo $jsonAddress; ?>' data-bs-target="#thirdModal">
|
||||
<i class="fa-regular fa-pen-to-square" style="font-size:15px; float:right;"></i></a>
|
||||
<!-- <i class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i> -->
|
||||
</div>
|
||||
<div id="editDelete" style="display:flex; float:right; width:20px; margin-top:20px; margin-right:-20px; margin-top:30px;">
|
||||
<!-- <i class="fa-solid fa-pen" style="font-size:15px; float:right;"></i></a> -->
|
||||
<i onclick="deleteAddress('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)"
|
||||
class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i>
|
||||
</div>
|
||||
<label class="form-check-label" for="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
<?php echo $address['first_name']; ?> <?php echo $address['last_name']; ?><br>
|
||||
<?php echo $address['address_1']; ?> <?php echo $address['address_2']; ?>
|
||||
|
@ -270,6 +292,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php echo $address['province']; ?> <?php echo $address['country']; ?><br>
|
||||
Phone: <?php echo $address['phone']; ?>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -284,6 +307,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- secondModal -->
|
||||
<div class="modal fade" id="secondModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
|
||||
<div class="modal-content">
|
||||
|
@ -329,7 +353,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addressCountry" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
|
||||
<input type="text" class="form-control" id="addressCountry">
|
||||
<input type="text" class="form-control" id="addressCountry" >
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" id="submitBtn">Submit</button>
|
||||
|
||||
|
@ -339,6 +363,91 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 03-01-2024 Stacy added thirdModal -->
|
||||
<div class="modal fade" id="thirdModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>
|
||||
<input type="text" class="form-control"
|
||||
id="addressFirstName2"
|
||||
value="<?php echo $address['first_name']; ?>">
|
||||
|
||||
<!-- <label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>-->
|
||||
<input type="hidden" class="form-control" id="addressId" >
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
|
||||
<input type="text" class="form-control" id="addressLastName2" value="<?php echo $address['last_name']; ?>">
|
||||
<!-- <label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
|
||||
<input type="text" class="form-control" id="addressLastName"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
|
||||
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>">
|
||||
|
||||
|
||||
<!-- <label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
|
||||
<input type="number" class="form-control" id="addressContact"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2">Building,Number</label>
|
||||
<input type="text" class="form-control" id="addressBuilding2" value="<?php echo $address['address_1']; ?>">
|
||||
|
||||
<!-- <label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
|
||||
<input type="text" class="form-control" id="addressBuilding"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2">Street </label>
|
||||
<input type="text" class="form-control" id="addressStreet2" value="<?php echo $address['address_2']; ?>">
|
||||
|
||||
<!-- <label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2"> Street </label>
|
||||
<input type="text" class="form-control" id="addressStreet"> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
<label for="provinceSelect2">Province</label>
|
||||
<select class="form-select" id="provinceSelect2">
|
||||
<option id="provinceSelect2Opt" value="<?php echo $address['province']; ?>" >Select Province</option>
|
||||
</select>
|
||||
|
||||
<!-- <label for="provinceSelect">Province</label>
|
||||
<select class="form-select" id="provinceSelect">
|
||||
<option value="" disabled selected hidden>Select Province</option>
|
||||
</select> -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="citySelect2">Municipality/City</label>
|
||||
<select class="form-select" id="citySelect2" required>
|
||||
<option value="" id="citySelect2Opt" selected hidden>Select Municipality/City</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="barangaySelect2">Barangay</label>
|
||||
<select class="form-select" id="barangaySelect2" required>
|
||||
<option value="" id="barangaySelect2Opt" selected hidden>Select Barangay</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addressCountry2" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
|
||||
<input type="text" class="form-control" id="addressCountry2">
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" id="submitBtn2">Submit</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// var myElement = document.getElementById('myElement');
|
||||
// myElement.style.backgroundImage = 'red';
|
||||
|
@ -385,6 +494,205 @@ if ($_SESSION["userId"] <> "") {
|
|||
</script>
|
||||
|
||||
<script>
|
||||
// function for delete
|
||||
function deleteAddress(customerId, addressIndex) {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
let existingAddresses = data.address || [];
|
||||
if (addressIndex >= 0 && addressIndex < existingAddresses.length) {
|
||||
existingAddresses.splice(addressIndex, 1);
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
address: existingAddresses
|
||||
}),
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
location.reload();
|
||||
// filter the delete action
|
||||
document.getElementById('form-check-' + addressIndex).remove();
|
||||
} else {
|
||||
console.error('Failed to submit data');
|
||||
alert('Failed to submit data');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Error submitting data');
|
||||
});
|
||||
} else {
|
||||
console.log("Invalid address index.");
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Error fetching customer data');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 03-04-2024 added
|
||||
|
||||
$('#thirdModal').on('shown.bs.modal', function (event) {
|
||||
|
||||
var jsonString = $(event.relatedTarget).data('value');
|
||||
|
||||
var jsonObject = JSON.parse(jsonString);
|
||||
console.log(jsonObject)
|
||||
|
||||
// document.getElementById("addressFirstName2").value('mmmm');
|
||||
// $('#addressFirstName2').setAttribute('value','My default value');
|
||||
|
||||
// shows inputed data by the customer
|
||||
document.querySelector('input[id="addressFirstName2"]').value = jsonObject.first_name;
|
||||
document.querySelector('input[id="addressLastName2"]').value = jsonObject.last_name;
|
||||
document.querySelector('input[id="addressContact2"]').value = jsonObject.phone;
|
||||
document.querySelector('input[id="addressBuilding2"]').value = jsonObject.address_1;
|
||||
document.querySelector('input[id="addressStreet2"]').value = jsonObject.address_2;
|
||||
document.querySelector('option[id="provinceSelect2Opt"]').text = jsonObject.province;
|
||||
document.querySelector('option[id="provinceSelect2Opt"]').value = jsonObject.province;
|
||||
|
||||
document.querySelector('option[id="citySelect2Opt"]').text = jsonObject.city;
|
||||
document.querySelector('option[id="citySelect2Opt"]').value = jsonObject.city;
|
||||
|
||||
document.querySelector('option[id="barangaySelect2Opt"]').text = jsonObject.barangay;
|
||||
document.querySelector('option[id="barangaySelect2Opt"]').value = jsonObject.barangay;
|
||||
|
||||
document.querySelector('input[id="addressCountry2"]').value = jsonObject.country;
|
||||
document.querySelector('input[id="addressId"]').value = jsonObject.id;
|
||||
|
||||
|
||||
|
||||
console.log('id ' + jsonObject.id)
|
||||
const provinceSelect = $('#provinceSelect2'); // Use jQuery to select the element
|
||||
const citySelect = $('#citySelect2'); // Use jQuery to select the element
|
||||
const barangaySelect = $('#barangaySelect2'); // Use jQuery to select the element
|
||||
|
||||
// Initialize Select2 on the provinceSelect, citySelect, and barangaySelect elements
|
||||
provinceSelect.select2({
|
||||
dropdownParent: $('#thirdModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
|
||||
citySelect.select2({
|
||||
dropdownParent: $('#thirdModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
barangaySelect.select2({
|
||||
dropdownParent: $('#thirdModal'),
|
||||
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
|
||||
});
|
||||
|
||||
// Fetch provinces data
|
||||
fetch('https://psgc.gitlab.io/api/provinces')
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('Failed to fetch provinces');
|
||||
throw new Error('Failed to fetch provinces');
|
||||
}
|
||||
})
|
||||
.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();
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
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
|
||||
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/`;
|
||||
}
|
||||
|
||||
fetch(citiesEndpoint)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('Failed to fetch cities/municipalities');
|
||||
throw new Error('Failed to fetch cities/municipalities');
|
||||
}
|
||||
})
|
||||
.then(citiesData => {
|
||||
// Iterate through the cities data and add options
|
||||
citiesData.forEach(city => {
|
||||
const option = new Option(city.name, city.code);
|
||||
citySelect.append(option);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 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/`)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('Failed to fetch barangays');
|
||||
throw new Error('Failed to fetch barangays');
|
||||
}
|
||||
})
|
||||
.then(barangaysData => {
|
||||
// Iterate through the barangays data and add options
|
||||
barangaysData.forEach(barangay => {
|
||||
const option = new Option(barangay.name, barangay.code);
|
||||
barangaySelect.append(option);
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// document.querySelector('input[id="addressFirstName2"]').value = jsonObject.last_name;
|
||||
});
|
||||
|
||||
|
||||
|
||||
const customerId = '<?php echo $customer_data[0]['_id']; ?>';
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Get the select elements
|
||||
|
@ -511,6 +819,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
$('#submitBtn').on('click', function() {
|
||||
// Retrieve existing addresses from the API
|
||||
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
|
||||
console.log('clickkkkkkkk')
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
|
@ -575,6 +884,93 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Added function for edit
|
||||
$('#submitBtn2').on('click', function() {
|
||||
// function updateAddress(){
|
||||
// Retrieve existing addresses from the API
|
||||
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
const existingAddresses = data.address || [];
|
||||
|
||||
// Get the new address details
|
||||
const firstName = $('#addressFirstName2').val();
|
||||
const lastName = $('#addressLastName2').val();
|
||||
const contact = $('#addressContact2').val();
|
||||
const buildingNumber = $('#addressBuilding2').val();
|
||||
const street = $('#addressStreet2').val();
|
||||
const province = $('#provinceSelect2 :selected').text();
|
||||
const city = $('#citySelect2 :selected').text();
|
||||
const barangay = $('#barangaySelect2 :selected').text();
|
||||
const country = $('#addressCountry2').val();
|
||||
const id = $('#addressId').val();
|
||||
console.log('clickkkkkkkk'+ id)
|
||||
|
||||
|
||||
// Create a new address object
|
||||
const newAddress = {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
phone: contact,
|
||||
address_1: buildingNumber,
|
||||
address_2: street,
|
||||
city: city,
|
||||
province: province,
|
||||
barangay: barangay,
|
||||
country: country,
|
||||
};
|
||||
|
||||
// Add the new address to the existing addresses
|
||||
// existingAddresses.push(newAddress);
|
||||
|
||||
// var newAddresses= existingAddresses.filter((e,i)=>i!==id)
|
||||
let existingAddress = existingAddresses
|
||||
|
||||
existingAddress[id]={
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
phone: contact,
|
||||
address_1: buildingNumber,
|
||||
address_2: street,
|
||||
city: city,
|
||||
province: province,
|
||||
barangay: barangay,
|
||||
country: country,
|
||||
};
|
||||
console.log( existingAddress[id])
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
address: existingAddress
|
||||
}),
|
||||
});
|
||||
})
|
||||
.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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
@ -636,6 +1032,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
async function updateAddressShipping(customerId, addressIndex, isShipping) {
|
||||
try {
|
||||
// const customerId = `<?php #echo $customer_data[0]['_id']; ?>`;
|
||||
|
||||
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/${customerId}`;
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
|
@ -703,6 +1101,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
sCountryElement.textContent = customerData.address[addressIndex].country;
|
||||
}
|
||||
console.log(`Address updated successfully for customer ${customerId}`);
|
||||
// location.reload();
|
||||
// header("location: user-profile.php");
|
||||
} catch (error) {
|
||||
console.error('Error updating address:', error.message);
|
||||
}
|
||||
|
|
|
@ -64,6 +64,30 @@ $products = productList();
|
|||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<style>
|
||||
.pagination {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pagination a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pagination a.active {
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="shop_page">
|
||||
|
@ -114,9 +138,23 @@ $products = productList();
|
|||
<!-- 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>
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_banner'])) { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } else { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } ?>
|
||||
<!-- <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">
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_image'])) { ?>
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<?php } else { ?>
|
||||
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
|
||||
<?php } ?>
|
||||
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
|
@ -138,9 +176,12 @@ $products = productList();
|
|||
<div class="ec-vendor-dashboard-card space-bottom-30">
|
||||
<div class="ec-vendor-card-header">
|
||||
<h5>Product List</h5>
|
||||
<div class="ec-header-btn">
|
||||
<div class="ec-header-btn" >
|
||||
<!-- <a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php">Add</a> -->
|
||||
<a class="btn btn-lg btn-primary" onclick="addProduct();" href="">Add</a>
|
||||
|
||||
<a class="btn btn-lg btn-primary" onclick="deleteSelectedProduct('<?php echo $product['_id'] ?>');">Delete Selected</a>
|
||||
|
||||
<a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php" onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-card-body">
|
||||
|
@ -163,11 +204,21 @@ $products = productList();
|
|||
<?php
|
||||
$products = productListVendor($vendorId);
|
||||
$totalProducts = count($products);
|
||||
for ($i = 0; $i <= $totalProducts - 1; $i++) {
|
||||
// 03-11-2024 Stacy added for products pagination
|
||||
$productsPerPage = 10;
|
||||
$totalPages = ceil($totalProducts / $productsPerPage);
|
||||
|
||||
$currentpage = isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$start = ($currentpage - 1) * $productsPerPage;
|
||||
$end = $start + $productsPerPage - 1;
|
||||
|
||||
for ($i = $start; $i <= $end && $i < $totalProducts; $i++) {
|
||||
$product = $products[$i];
|
||||
?>
|
||||
<tr>
|
||||
<tr id="<?php echo $product['_id']; ?>">
|
||||
|
||||
<td>
|
||||
|
||||
<!-- raymart added function feb 21 2024 -->
|
||||
<?php
|
||||
if (isset($product['images'])) {
|
||||
|
@ -175,12 +226,12 @@ $products = productList();
|
|||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<img style="margin-top:8px;" class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<img style="margin-top:8px;" class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -191,18 +242,21 @@ $products = productList();
|
|||
echo '<img src="admin/assets/img/vendor/u1.jpg" class="prod-img rounded-circle" alt="Placeholder Image" >';
|
||||
}
|
||||
?> -->
|
||||
</td>
|
||||
<td><span><?php echo $product['product_name']; ?></span></td>
|
||||
<td><span><?php echo $product['regular_price']; ?></span></td>
|
||||
<td><span><?php echo $product['sale_price']; ?></span></td>
|
||||
<td><span><?php echo $product['minimum_order']; ?></span></td>
|
||||
<td><span><?php echo $product['stock']; ?></span></td>
|
||||
<td style="display: flex; justify-content: space-between;">
|
||||
<span onclick="editProduct('<?php echo $product['_id'] ?>');">
|
||||
<i class="mdi mdi-circle-edit-outline"></i>
|
||||
</td>
|
||||
<td><span style="margin-top:8px;"><?php echo $product['product_name']; ?></span></td>
|
||||
<td><span style="margin-top:8px;"><?php echo $product['regular_price']; ?></span></td>
|
||||
<td><span style="margin-top:8px;"><?php echo $product['sale_price']; ?></span></td>
|
||||
<td><span style="margin-top:8px;"><?php echo $product['minimum_order']; ?></span></td>
|
||||
<td><span style="margin-top:8px;"><?php echo $product['stock']; ?></span></td>
|
||||
<td style="display:flex; justify-content:space-around;">
|
||||
<span style="margin-top:4px;">
|
||||
<input type="checkbox" name="product_checkbox[]" style="width:20px; height:33px; " value="<?php echo $product['_id']; ?>">
|
||||
</span>
|
||||
<span onclick="deleteProduct('<?php echo $product['_id'] ?>');">
|
||||
<i class="mdi mdi mdi-delete-outline"></i>
|
||||
<span style="margin-top:4px;" onclick="editProduct('<?php echo $product['_id'] ?>');">
|
||||
<a class="mdi mdi-circle-edit-outline" style="font-size:20px;"></a>
|
||||
</span>
|
||||
<span style="margin-top:4px;" onclick="deleteProduct('<?php echo $product['_id'] ?>');">
|
||||
<a class="mdi mdi mdi-delete-outline" style="font-size:20px;"></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -213,6 +267,14 @@ $products = productList();
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 03-11-2024 Stacy added pagination -->
|
||||
<div class="pagination mt-3">
|
||||
<?php
|
||||
for ($p = 1; $p <= $totalPages; $p++) {
|
||||
echo "<a href='?page=$p' class='" . ($currentpage == $p ? 'active' : '') . "'>$p</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -223,6 +285,7 @@ $products = productList();
|
|||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
|
||||
function deleteProduct(productId) {
|
||||
let text = "Please confirm delete action!\nClick OK or Cancel button.";
|
||||
if (confirm(text) == true) {
|
||||
|
@ -295,13 +358,54 @@ $products = productList();
|
|||
// function editProduct(productId) {
|
||||
// window.open("vendor-uploads.php?id=" + productId, "_self");
|
||||
// }
|
||||
function addProduct() {
|
||||
function addProduct(productId) {
|
||||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("vendor-uploads-add-product-action.php", "_self");
|
||||
window.open("vendor-uploads-add-product-action.php" + productId, "_self");
|
||||
});
|
||||
}
|
||||
|
||||
// multiple delete when checking the checkbox
|
||||
function deleteSelectedProduct() {
|
||||
var checkboxes = document.querySelectorAll('input[name="product_checkbox[]"]:checked');
|
||||
if (checkboxes.length === 0) {
|
||||
alert('Please select at least one product to delete.');
|
||||
return;
|
||||
}
|
||||
var selectedProductIds = [];
|
||||
checkboxes.forEach(function (checkbox) {
|
||||
selectedProductIds.push(checkbox.value);
|
||||
});
|
||||
var text = "Please confirm delete action!\nClick OK or Cancel button.";
|
||||
if (confirm(text) == true) {
|
||||
selectedProductIds.forEach(function(productId) {
|
||||
fetch("https://<?php echo $_SESSION['data_endpoint']; ?>/api/v1/products/" + productId, {
|
||||
method: "DELETE"
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log("Product with ID " + productId + " deleted successfully.");
|
||||
// Remove the deleted product row from the table
|
||||
var productRow = document.getElementById(productId);
|
||||
if (productRow) {
|
||||
productRow.remove();
|
||||
} else {
|
||||
console.error("Product row with ID " + productId + " not found in the DOM.");
|
||||
}
|
||||
} else {
|
||||
throw new Error("Error deleting product with ID " + productId + ": " + response.statusText);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error.message);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</section>
|
||||
<!-- End Vendor dashboard section -->
|
||||
|
|
|
@ -72,6 +72,24 @@ if (is_array($vendorOrderss)) {
|
|||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
|
||||
<style>
|
||||
#pagination {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#pagination a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="shop_page">
|
||||
|
@ -125,9 +143,23 @@ if (is_array($vendorOrderss)) {
|
|||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<div class="ec-vendor-block-bg" style="background-color:orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_banner'])) { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } else { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } ?>
|
||||
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php #echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
|
||||
<div class="ec-vendor-block-detail">
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_image'])) { ?>
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<?php } else { ?>
|
||||
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
|
||||
<?php } ?>
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
|
@ -213,16 +245,13 @@ if (is_array($vendorOrderss)) {
|
|||
<td>
|
||||
<!-- raymart added function feb 21 2024 -->
|
||||
<?php
|
||||
if (isset($product['images'])) {
|
||||
$image_urls = explode(',', $product['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
# 03-11-2024 Stacy modified
|
||||
if (isset($orderItems['items'][0]['product']['product_image'])) {
|
||||
?>
|
||||
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
<img class="prod-img" src="<?php echo $orderItems['items'][0]['product']['product_image']; ?>" alt="edit" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
?>
|
||||
<img class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
|
@ -240,9 +269,9 @@ if (is_array($vendorOrderss)) {
|
|||
<td><span><?php echo $orderItems['status']; ?></span></td>
|
||||
<td><span><?php echo $orderItems['shipping_address']['shipping_first_name']; ?></span></td>
|
||||
<td><span><?php echo $item['price']; ?></span></td>
|
||||
<td style="display: flex; justify-content: center;">
|
||||
<td style="display:flex; justify-content:center; margin-top:-4px;">
|
||||
<span onclick="editVendorOrder('<?php echo $orderItems['_id'] ?>');">
|
||||
<i class="mdi mdi-circle-edit-outline"></i>
|
||||
<a class="mdi mdi-circle-edit-outline" style="font-size: 20px;"></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -329,11 +358,25 @@ if (is_array($vendorOrderss)) {
|
|||
const totalItems = <?php echo $totalOrders; ?>;
|
||||
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
||||
|
||||
//03-11-2024 Stacy modified for the pagination UI
|
||||
function showPage(page) {
|
||||
const startIndex = (page - 1) * itemsPerPage;
|
||||
const endIndex = startIndex + itemsPerPage;
|
||||
const tableRows = document.querySelectorAll('#orderItemsBody tr');
|
||||
|
||||
// for pagination button
|
||||
const pager = document.querySelectorAll('.page-btn')
|
||||
pager.forEach((row, index) => {
|
||||
if (index!==page-1) {
|
||||
row.style.backgroundColor="white";
|
||||
row.style.color="black";
|
||||
} else {
|
||||
row.style.backgroundColor="#007bff";
|
||||
row.style.color="white";
|
||||
}
|
||||
});
|
||||
|
||||
// document.querySelector('.page-' + page).style.backgroundColor="red";
|
||||
tableRows.forEach((row, index) => {
|
||||
if (index >= startIndex && index < endIndex) {
|
||||
row.style.display = 'table-row';
|
||||
|
@ -347,7 +390,10 @@ if (is_array($vendorOrderss)) {
|
|||
const paginationContainer = document.getElementById('pagination');
|
||||
|
||||
for (let i = 1; i <= totalPages; i++) {
|
||||
const pageButton = document.createElement('button');
|
||||
// created a tag
|
||||
const pageButton = document.createElement('a');
|
||||
// created class for a tag
|
||||
pageButton.className = "page-btn page-" + i
|
||||
pageButton.textContent = i;
|
||||
pageButton.addEventListener('click', () => showPage(i));
|
||||
paginationContainer.appendChild(pageButton);
|
||||
|
@ -365,7 +411,7 @@ if (is_array($vendorOrderss)) {
|
|||
<div class="ec-header-btn">
|
||||
<a class="btn btn-lg btn-primary" href="vendor-all-product-list.php">View All</a>
|
||||
<!-- <a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php">Add</a> -->
|
||||
<a class="btn btn-lg btn-primary" onclick="addProduct();" href="">Add</a>
|
||||
<a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php" onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-card-body">
|
||||
|
@ -399,7 +445,7 @@ if (is_array($vendorOrderss)) {
|
|||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -407,7 +453,8 @@ if (is_array($vendorOrderss)) {
|
|||
<img class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<!-- <?php
|
||||
if (isset($product['product_image']) && !empty($product['product_image'])) {
|
||||
echo '<img src="' . $product['product_image'] . '" alt="Product Image" class="prod-img" >';
|
||||
|
@ -428,6 +475,7 @@ if (is_array($vendorOrderss)) {
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="pagination"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 02-26-2024 Stacy commented out -->
|
||||
|
|
|
@ -59,6 +59,30 @@ $products = productList();
|
|||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.pagination {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pagination a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ccc;
|
||||
/* margin: 0 5px; */
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pagination a.active {
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="updateCartItemCount()">
|
||||
|
@ -171,7 +195,18 @@ $products = productList();
|
|||
|
||||
<div class="section-space-p">
|
||||
<?php
|
||||
foreach ($vendors as $vendor) {
|
||||
$vendors = vendorList();
|
||||
$totalVendors = count($vendors);
|
||||
$vendorsPerPage = 10;
|
||||
$totalPages = ceil($totalVendors / $vendorsPerPage);
|
||||
|
||||
$currentpage = isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$start = ($currentpage - 1) * $vendorsPerPage;
|
||||
$end = $start + $vendorsPerPage - 1;
|
||||
?>
|
||||
<?php
|
||||
for ($x = $start; $x <= $end && $x < $totalVendors; $x++) {
|
||||
$vendor = $vendors[$x];
|
||||
?>
|
||||
<!-- Vendor list Section Start -->
|
||||
<section class="section ec-catalog-multi-vendor margin-bottom-30">
|
||||
|
@ -183,7 +218,7 @@ $products = productList();
|
|||
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>"></a>
|
||||
<?php
|
||||
if(!isset($vendor['vendor_image'])){
|
||||
?><img src="assets/images/vendor/1.jpg" alt="vendor img"><?php
|
||||
?><img src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="vendor img"><?php
|
||||
}else{
|
||||
?><img src="<?php echo $vendor['vendor_image'] ?>" alt="vendor img"><?php
|
||||
}
|
||||
|
@ -233,14 +268,25 @@ $products = productList();
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Vendor list Section End -->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- 03-11-2024 Stacy added pagination for vendor -->
|
||||
<!-- Ec Pagination Start -->
|
||||
<div class="pagination mt-3">
|
||||
<?php
|
||||
for ($i = 1; $i <= $totalPages; $i++) {
|
||||
echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<!-- Ec Pagination End -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Vendor list Section End -->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Footer Start -->
|
||||
|
|
|
@ -66,7 +66,7 @@ if (is_array($vendorOrderss)) {
|
|||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<style>
|
||||
.tab.active {
|
||||
background-color: #3498db;
|
||||
background-color: #ffaa00;
|
||||
/* Set your desired background color for the active tab */
|
||||
color: #ffffff;
|
||||
/* Set your desired text color for the active tab */
|
||||
|
@ -137,18 +137,37 @@ if (is_array($vendorOrderss)) {
|
|||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<div class="ec-vendor-block-items">
|
||||
<ul>
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_banner'])) { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } else { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } ?>
|
||||
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
|
||||
<div class="ec-vendor-block-detail">
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_image'])) { ?>
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<?php } else { ?>
|
||||
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
|
||||
<?php } ?>
|
||||
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
<!-- <ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a onclick="addProduct();" href="">Upload Product</a></li>
|
||||
<li><a href="vendor-uploads.php">Upload Product</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
<li><a href="user-refund-history.php">User Refund History</a></li>
|
||||
<li><a href="user-refund-history.php">User Refund History</a></li> -->
|
||||
<!-- <li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="track-order.html">Track Order</a></li>
|
||||
<li><a href="user-invoice.html">Invoice</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
<!-- </ul>
|
||||
</div> -->
|
||||
<?php include "vendor-user-tabs.php" ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -158,7 +177,7 @@ if (is_array($vendorOrderss)) {
|
|||
<div class="ec-vendor-card-header">
|
||||
<h5>Refund History</h5>
|
||||
<div class="ec-header-btn">
|
||||
<a class="btn btn-lg btn-primary" href="#">Shop Now</a>
|
||||
<a class="btn btn-lg btn-primary" href="shop-list-left-sidebar2.php">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-card-body">
|
||||
|
@ -566,6 +585,7 @@ if (is_array($vendorOrderss)) {
|
|||
|
||||
|
||||
<script>
|
||||
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
@ -718,6 +738,16 @@ if (is_array($vendorOrderss)) {
|
|||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
//S 03-06-2024 Stacy added upload function
|
||||
function addProduct() {
|
||||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("vendor-uploads-add-product-action.php", "_self");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -152,7 +152,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
} 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>
|
||||
|
@ -160,9 +160,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="ec-vendor-block-detail">
|
||||
<!-- 02-26-2024 Stacy added placeholder-->
|
||||
<?php
|
||||
$vendor_image = isset($vendorData[0]['vendor_image']) ? $vendorData[0]['vendor_image'] : 'https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg';
|
||||
?>
|
||||
<img class="v-img" src=<?php echo $vendor_image ?> alt="vendor image">
|
||||
if (!empty($vendorData['vendor_image'])) { ?>
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<?php } else { ?>
|
||||
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
|
||||
<?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 $vendorData['vendor_image'] ?> alt="vendor image"> -->
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -228,6 +233,34 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 03-19-24 Jun Jihad Bank Information -->
|
||||
<div class="col-md-12 col-sm-12" style="display:flex; justify-content: space-between">
|
||||
<h5>Bank Information </h5>
|
||||
<button type="button" class="btn btn-primary" id="vendorBankModalBtn" data-bs-toggle="modal" data-bs-target="#vendorBankModal">My Banks</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<?php foreach ($vendorData['bank_acount_details'] as $bank_acount_details) : ?>
|
||||
<?php if ($bank_acount_details['bank_payout']) : ?>
|
||||
<table style="width:100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px; font-weight: 700;">Bank Name</td>
|
||||
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $bank_acount_details["bank_name"] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px;font-weight: 700;">Account Number</td>
|
||||
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $bank_acount_details["bank_account_number"] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px;font-weight: 700;">Account Name</td>
|
||||
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $bank_acount_details["bank_account_name"] ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 03-19-24 Jun Jihad Bank Information -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -345,6 +378,71 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="vendorBankModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#secondBankModal">Add New Bank</button>
|
||||
|
||||
<!-- Display a list of addresses and let the user choose -->
|
||||
<form id="BankForm">
|
||||
<!-- <?php var_dump($vendorData) ?> -->
|
||||
<?php foreach ($vendorLoginIdjson['results'] as $vendor_index => $vendor) { ?>
|
||||
<?php foreach ($vendor['bank_acount_details'] as $bank_index => $bank) { ?>
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mx-auto">
|
||||
<label class="form-check-label" for="address_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">
|
||||
<strong style="font-weight: bold;">Bank Name: </strong><?php echo $bank['bank_name']; ?> <br>
|
||||
<strong style="font-weight: bold;">Bank Account Number: </strong><?php echo $bank['bank_account_number']; ?> <br>
|
||||
<strong style="font-weight: bold;">Bank Account Name: </strong><?php echo $bank['bank_account_name']; ?>
|
||||
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
|
||||
<input type="radio" name="payout_bank" id="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" onchange="setPayoutBank('<?php echo $vendor['_id']; ?>', <?php echo $bank_index; ?>, true)" <?php echo $bank['bank_payout'] ? 'checked' : ''; ?>>
|
||||
<label for="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">Set as Payout Bank</label>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="secondBankModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="bankName" class="text-dark font-weight-medium pt-3 mb-2">Bank Name</label>
|
||||
<input type="text" class="form-control" id="bankName">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bankAccountNumber" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Number</label>
|
||||
<input type="text" class="form-control" id="bankAccountNumber">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bankAccountName" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Name</label>
|
||||
<input type="text" class="form-control" id="bankAccountName">
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-primary" id="submitBankBtn">Add Bank</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function editUser() {
|
||||
// var fileInput = document.getElementById('fileInput' + vendorId);
|
||||
|
@ -387,6 +485,15 @@ if ($_SESSION["userId"] <> "") {
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
//S 03-06-2024 Stacy added upload function
|
||||
function addProduct() {
|
||||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("vendor-uploads-add-product-action.php", "_self");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
|
||||
|
@ -555,6 +662,49 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
|
||||
});
|
||||
|
||||
$('#submitBankBtn').on('click', function() {
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const existingBanks = data.bank_acount_details || [];
|
||||
|
||||
const bankName = $('#bankName').val();
|
||||
const bankAccountNumber = $('#bankAccountNumber').val();
|
||||
const bankAccountName = $('#bankAccountName').val();
|
||||
|
||||
const newBank = {
|
||||
bank_name: bankName,
|
||||
bank_account_number: bankAccountNumber,
|
||||
bank_account_name: bankAccountName,
|
||||
};
|
||||
|
||||
existingBanks.push(newBank);
|
||||
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
bank_acount_details: existingBanks
|
||||
}),
|
||||
});
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Failed to submit data');
|
||||
alert('Failed to submit data');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Error submitting data');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
async function updateAddressBilling(vendorid, addressIndex, isBilling) {
|
||||
|
@ -683,6 +833,56 @@ if ($_SESSION["userId"] <> "") {
|
|||
console.error('Error updating address:', error.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function setPayoutBank(vendorid, bankIndex, isBankPayout) {
|
||||
try {
|
||||
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch vendor data: ${response.status}`);
|
||||
}
|
||||
const vendorsData = await response.json();
|
||||
vendorsData.bank_acount_details.forEach((bank_acount_details, index) => {
|
||||
if (index === bankIndex) {
|
||||
if (isBankPayout !== undefined) {
|
||||
bank_acount_details.bank_payout = isBankPayout;
|
||||
|
||||
const radioButtonId = `#payout_bank__${vendorid}_${bankIndex}`;
|
||||
$(radioButtonId).prop('checked', isBankPayout);
|
||||
}
|
||||
|
||||
} else {
|
||||
bank_acount_details.bank_payout = false;
|
||||
}
|
||||
});
|
||||
|
||||
const updateResponse = await fetch(apiUrl, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
bank_acount_details: vendorsData.bank_acount_details
|
||||
}),
|
||||
});
|
||||
|
||||
if (!updateResponse.ok) {
|
||||
|
||||
throw new Error(`Failed to update address: ${updateResponse.status}`);
|
||||
}
|
||||
location.reload()
|
||||
// console.log(`Address updated successfully for customer ${vendorid}`);
|
||||
} catch (error) {
|
||||
console.error('Error updating address:', error.message);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</section>
|
||||
<!-- End Vendor setting section -->
|
||||
|
|
|
@ -40,6 +40,18 @@ $material = $_POST['material'];
|
|||
//echo '$material: '.$material.'<br>';
|
||||
$token = $_SESSION["token"];
|
||||
|
||||
$quantities = $_POST['quantity'];
|
||||
$prices = $_POST['price'];
|
||||
|
||||
// Constructing the price matrix
|
||||
$priceMatrix = array();
|
||||
for ($i = 0; $i < count($quantities); $i++) {
|
||||
$priceMatrix[] = array(
|
||||
'quantity' => $quantities[$i],
|
||||
'price' => $prices[$i]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$response = editProduct(
|
||||
$productId,
|
||||
|
@ -66,6 +78,7 @@ $response = editProduct(
|
|||
$color,
|
||||
$material,
|
||||
$size,
|
||||
$priceMatrix,
|
||||
$token);
|
||||
$array = json_decode($response,true);
|
||||
$_SESSION['newProdictId'] = $array['_id'];
|
||||
|
|
|
@ -116,15 +116,36 @@ $array = json_decode($result, true);
|
|||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_banner'])) { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } else { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } ?>
|
||||
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php #echo $vendorData['vendor_banner']
|
||||
?>) !important;"></div> -->
|
||||
<div class="ec-vendor-block-detail">
|
||||
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image']
|
||||
?> alt="vendor image"> -->
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_image'])) { ?>
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<?php } else { ?>
|
||||
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
|
||||
<?php } ?>
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- 2024-02-12 Stacy deleted div with class "ec-vendor-block-items", and inserted vendor-profile-tabs.php -->
|
||||
<div class="ec-vendor-block-items">
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
<ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a href="vendor-uploads-add-product-action.php">Upload Product</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<?php include "vendor-user-tabs.php" ?>
|
||||
<!-- 2024-02-12 Stacy deleted div with class "ec-vendor-block-items", and inserted vendor-profile-tabs.php -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -141,7 +162,7 @@ $array = json_decode($result, true);
|
|||
<div class="avatar-upload">
|
||||
<div class="avatar-edit">
|
||||
<input type='file' id="imageUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" multiple onchange="uploadProductImage()" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
<label for="imageUpload"><i class="fi-rr-edit" style="margin-top:5px;"></i></label>
|
||||
</div>
|
||||
<div class="avatar-preview ec-preview">
|
||||
<div class="imagePreview ec-div-preview">
|
||||
|
@ -363,26 +384,51 @@ $array = json_decode($result, true);
|
|||
)</span></label>
|
||||
<input type="number" class="form-control" id="price2" name="sale_price" value="<?php echo $array['sale_price'] ?>">
|
||||
</div>
|
||||
<!-- 03-15-2024 Jun Jihad price_matrix field Product Upload Vendor Page -->
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Price Matrix</label>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Quantity</th>
|
||||
<th scope="col">Price (PHP)</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="price-matrix-body">
|
||||
<?php foreach ($array['price_matrix'][0] as $index => $pair) : ?>
|
||||
<tr data-row-index="<?php echo $index; ?>">
|
||||
<td><input type="number" class="form-control" name="quantity[]" value="<?php echo $pair['quantity']; ?>"></td>
|
||||
<td><input type="number" class="form-control" name="price[]" value="<?php echo $pair['price']; ?>"></td>
|
||||
<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-secondary" id="add-row">Add Row</button>
|
||||
</div>
|
||||
<!-- 03-15-2024 Jun Jihad price_matrix field Product Upload Vendor Page -->
|
||||
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
|
||||
<div class="col-md-12" style="margin: 0 0 20px 0;">
|
||||
<label class="form-label">Promo</label>
|
||||
<div class="row" justify-content-between>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="nextDayDeliveryCheckbox" name="promo[next-day-delivery]" value="Yes" <?php if ($array['promo'][0]['next-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="nextDayDeliveryCheckbox">Next Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="sameDayDeliveryCheckbox" name="promo[same-day-delivery]" value="Yes" <?php if ($array['promo'][0]['same-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="sameDayDeliveryCheckbox">Same Day Delivery</label>
|
||||
<input type="checkbox" id="nextDayDeliveryCheckbox" name="promo[next-day-delivery]" value="Yes" <?php if ($array['promo'][0]['next-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="nextDayDeliveryCheckbox">Next Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="freeShippingCheckbox" name="promo[free-shipping]" value="Yes" <?php if ($array['promo'][0]['free-shipping'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="freeShippingCheckbox">Free Shipping</label>
|
||||
<input type="checkbox" id="sameDayDeliveryCheckbox" name="promo[same-day-delivery]" value="Yes" <?php if ($array['promo'][0]['same-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="sameDayDeliveryCheckbox">Same Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="freeShippingCheckbox" name="promo[free-shipping]" value="Yes" <?php if ($array['promo'][0]['free-shipping'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="freeShippingCheckbox">Free Shipping</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -416,6 +462,7 @@ $array = json_decode($result, true);
|
|||
<option value="Appliance" <?php echo ($array['product_category'] === 'Appliance') ? 'selected' : ''; ?>>Appliance</option>
|
||||
<option value="Smart Home" <?php echo ($array['product_category'] === 'Smart Home') ? 'selected' : ''; ?>>Smart Home</option>
|
||||
<option value="Home" <?php echo ($array['product_category'] === 'Home') ? 'selected' : ''; ?>>Home</option>
|
||||
<option value="Apparel" <?php echo ($array['product_category'] === 'Apparel') ? 'selected' : ''; ?>>Apparel</option>
|
||||
<option value="Heavy Equipment" <?php echo ($array['product_category'] === 'Heavy Equipment') ? 'selected' : ''; ?>>Heavy Equipment</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -453,7 +500,7 @@ $array = json_decode($result, true);
|
|||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
||||
<script>
|
||||
var quill = new Quill('#editor-container', {
|
||||
theme: 'snow'
|
||||
theme: 'snow'
|
||||
});
|
||||
quill.clipboard.dangerouslyPasteHTML(document.getElementById('hidden-editor').value);
|
||||
quill.on('text-change', function() {
|
||||
|
@ -461,12 +508,107 @@ $array = json_decode($result, true);
|
|||
});
|
||||
|
||||
var newquill = new Quill('#short-editor-container', {
|
||||
theme: 'snow'
|
||||
theme: 'snow'
|
||||
});
|
||||
newquill.clipboard.dangerouslyPasteHTML(document.getElementById('short-hidden-editor').value);
|
||||
newquill.on('text-change', function() {
|
||||
document.getElementById('short-hidden-editor').value = newquill.root.innerHTML;
|
||||
});
|
||||
|
||||
// 03-15-2024 Jun Jihad price_matrix field delete/add row function
|
||||
document.getElementById("add-row").addEventListener("click", function() {
|
||||
var newRow = '<tr>' +
|
||||
'<td><input type="number" class="form-control quantity-input" name="quantity[]"></td>' +
|
||||
'<td><input type="number" class="form-control" name="price[]"></td>' +
|
||||
'<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>' +
|
||||
'</tr>';
|
||||
document.getElementById("price-matrix-body").insertAdjacentHTML('beforeend', newRow);
|
||||
|
||||
var quantityInputs = document.querySelectorAll('.quantity-input');
|
||||
var lastIndex = quantityInputs.length - 1;
|
||||
quantityInputs[lastIndex].addEventListener('blur', function(event) {
|
||||
checkQuantity(event, lastIndex);
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("price-matrix-body").addEventListener("click", function(event) {
|
||||
if (event.target.classList.contains("delete-row")) {
|
||||
event.preventDefault();
|
||||
var rows = document.querySelectorAll("#price-matrix-body tr");
|
||||
if (rows.length > 1) {
|
||||
event.target.closest("tr").remove();
|
||||
} else {
|
||||
alert("At least one row is required.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function checkQuantity(event, index) {
|
||||
var currentInput = event.target;
|
||||
var previousRow = currentInput.parentNode.parentNode.previousElementSibling;
|
||||
var nextRow = currentInput.parentNode.parentNode.nextElementSibling;
|
||||
|
||||
if (previousRow !== null) {
|
||||
var previousQuantityInput = previousRow.querySelector('input[name="quantity[]"]');
|
||||
var currentQuantity = parseInt(currentInput.value);
|
||||
var previousQuantity = parseInt(previousQuantityInput.value);
|
||||
|
||||
if (currentQuantity <= previousQuantity) {
|
||||
alert("Quantity must be greater than the previous row's quantity.");
|
||||
currentInput.value = previousQuantity + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextRow !== null) {
|
||||
var nextQuantityInput = nextRow.querySelector('input[name="quantity[]"]');
|
||||
var nextQuantity = parseInt(nextQuantityInput.value);
|
||||
|
||||
if (currentQuantity >= nextQuantity) {
|
||||
alert("Quantity must be less than the next row's quantity.");
|
||||
currentInput.value = nextQuantity - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkExistingQuantity(row) {
|
||||
var currentInput = row.querySelector('input[name="quantity[]"]');
|
||||
var allRows = document.querySelectorAll("#price-matrix-body tr");
|
||||
var currentIndex = Array.from(allRows).indexOf(row);
|
||||
|
||||
for (var i = currentIndex - 1; i >= 0; i--) {
|
||||
var previousRow = allRows[i];
|
||||
var previousQuantityInput = previousRow.querySelector('input[name="quantity[]"]');
|
||||
var currentQuantity = parseInt(currentInput.value);
|
||||
var previousQuantity = parseInt(previousQuantityInput.value);
|
||||
|
||||
if (currentQuantity <= previousQuantity) {
|
||||
alert("Quantity must be greater than the previous row's quantity.");
|
||||
currentInput.value = previousQuantity + 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var nextRow = allRows[currentIndex + 1];
|
||||
if (nextRow !== undefined) {
|
||||
var nextQuantityInput = nextRow.querySelector('input[name="quantity[]"]');
|
||||
var nextQuantity = parseInt(nextQuantityInput.value);
|
||||
|
||||
if (currentQuantity >= nextQuantity) {
|
||||
alert("Quantity must be less than the next row's quantity.");
|
||||
currentInput.value = nextQuantity - 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("price-matrix-body").addEventListener("blur", function(event) {
|
||||
if (event.target.tagName === "INPUT" && event.target.name === "quantity[]") {
|
||||
checkExistingQuantity(event.target.closest("tr"));
|
||||
}
|
||||
}, true);
|
||||
|
||||
|
||||
// 03-15-2024 Jun Jihad price_matrix field delete/add row function
|
||||
</script>
|
||||
<script>
|
||||
function onload() {
|
||||
|
|
|
@ -8,6 +8,7 @@ $current_page = basename($_SERVER['PHP_SELF']);
|
|||
<li <?php if ($current_page == 'vendor-dashboard.php') echo 'class="active"'; ?>><a href="vendor-dashboard.php" id="vendor-dashboard-link">Dashboards</a></li>
|
||||
<li <?php if ($current_page == 'vendor-uploads.php') echo 'class="active"'; ?>><a onclick="addProduct();" id="vendor-uploads-link">Uploads</a></li>
|
||||
<li <?php if ($current_page == 'vendor-settings.php') echo 'class="active"'; ?>><a href="vendor-settings.php" id="vendor-settings-link">Settings (edit)</a></li>
|
||||
<li <?php if ($current_page == 'vendor-refund-history.php') echo 'class="active"'; ?>><a href="vendor-refund-history.php" id="vendor-refund-history-link">Vendor Refund History</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue