Compare commits
30 Commits
fd712f1ad9
...
13fed959b1
Author | SHA1 | Date |
---|---|---|
raymart | 13fed959b1 | |
raymart | 3fd03351c3 | |
MarkHipe | 09d777cb80 | |
Jun Barroga | 105c93079c | |
MarkHipe | 5cc36505fe | |
Erwin Galang | 815f0937f2 | |
erwin | 0f015cce5f | |
Erwin Galang | cbb11d60c6 | |
Erwin Galang | 51ff64d054 | |
MarkHipe | 1c1150334b | |
Staycie | 4a6b027f9c | |
Staycie | 01c736b868 | |
erwin | 5ad26fa20b | |
Erwin Galang | 431336cf14 | |
Staycie | 3c343d6266 | |
Erwin Galang | 152d9832ff | |
Erwin Galang | 155cd3df6e | |
Staycie | a12dd88621 | |
erwin | c8529f58cf | |
Erwin Galang | 2bb8b8062b | |
erwin | 2a6882fd75 | |
Erwin Galang | 02387180ee | |
webdeveloper | 4f8a0c5471 | |
MarkHipe | 129a9e7734 | |
Jun Barroga | 8bd8211b3d | |
Staycie | c41774adc4 | |
Staycie | 2c8467bcca | |
MarkHipe | 89d0535af8 | |
Staycie | 593b99e8f6 | |
MarkHipe | b97836f1bc |
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
// $_SESSION["company"] = $_POST["company"];
|
||||
// $_SESSION["firstname"] = $_POST["company"];
|
||||
// $_SESSION["phone"] = $_POST["phonenumber"];
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="";
|
||||
$_SESSION["sales_email"]="";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
?>
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
if ($_SESSION["isLoggedIn"] == true and $_SESSION["user_type"] == "admin"){
|
||||
header("location: index.php");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
session_unset();
|
||||
session_destroy();
|
||||
header("location: login.php")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -959,7 +959,7 @@ $allorders = json_encode($orders, true);
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -1029,7 +1029,7 @@ $allorders = json_encode($orders, true);
|
|||
// Define your functions here
|
||||
function toReceiveFunction(orderId, reason, image, token) {
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -1057,7 +1057,7 @@ $allorders = json_encode($orders, true);
|
|||
}
|
||||
|
||||
function refundCompleteFunction(orderId, reason, image, token) {
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
|
||||
$vendorId = $_POST['vendor_api_id'];
|
||||
$productName = $_POST['product_name'];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$vendorId = $_SESSION['vendorId'];
|
||||
//echo '$vendorId: '.$vendorId.'<br>';
|
||||
$productName = $_POST['product_name'];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
$productId = $_GET['id'];
|
||||
$curl = curl_init();
|
||||
$url = 'https://api.obanana.shop/api/v1/products/'.$productId;
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/".$productId;
|
||||
curl_setopt($curl,CURLOPT_URL,$url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/656717579624f6181c49cdda',
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$productId = $_SESSION['productId'];
|
||||
$vendorId = $_SESSION['vendorId'];
|
||||
//echo '$vendorId: '.$vendorId.'<br>';
|
||||
$productName = $_POST['product_name'];
|
||||
//echo '$productName: '.$productName.'<br>';
|
||||
$stock = $_POST['stock'];
|
||||
// 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page Action
|
||||
$ndd = isset($_POST['promo']['next-day-delivery']) ? $_POST['promo']['next-day-delivery'] : 'No';
|
||||
$sdd = isset($_POST['promo']['same-day-delivery']) ? $_POST['promo']['same-day-delivery'] : 'No';
|
||||
$freeSf = isset($_POST['promo']['free-shipping']) ? $_POST['promo']['free-shipping'] : 'No';
|
||||
// 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page Action
|
||||
$minimumOrder = $_POST['minimum_order'];
|
||||
//echo '$stock: '.$stock.'<br>';
|
||||
$price = $_POST['regular_price'];
|
||||
|
@ -40,6 +45,9 @@ $response = editProduct(
|
|||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$ndd,
|
||||
$sdd,
|
||||
$freeSf,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
|
@ -57,8 +65,7 @@ $response = editProduct(
|
|||
$color,
|
||||
$material,
|
||||
$size,
|
||||
$token
|
||||
);
|
||||
$token);
|
||||
$array = json_decode($response, true);
|
||||
$_SESSION['prodictId'] = $array['_id'];
|
||||
header("location: vendor-product-grid.php");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
$vendorId = $_SESSION["vendorId"];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
|
@ -672,86 +672,103 @@ $vendorId = $_SESSION["vendorId"];
|
|||
<div class="ec-vendor-main-img">
|
||||
<div class="avatar-upload">
|
||||
<div class="avatar-edit">
|
||||
<input type='file' id="imageUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" onchange="uploadImage()" />
|
||||
<input type='file' id="imageUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" multiple onchange="uploadProductImage()" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="avatar-preview ec-preview">
|
||||
<div class="imagePreview ec-div-preview">
|
||||
<?php
|
||||
if (isset($array['product_image'])) {
|
||||
?><img class="ec-image-preview" src="<?php echo $array['product_image']; ?>" alt="edit" /><?php
|
||||
} else { ?><img class="ec-image-preview" src="assets/img/products/vender-upload-preview.jpg" alt="edit" /><?php } ?>
|
||||
</div>
|
||||
<div class="imagePreview ec-div-preview">
|
||||
<?php
|
||||
if (isset($array['images'])) {
|
||||
$image_urls = explode(',', $array['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="ec-image-preview" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="ec-image-preview" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload-set colo-md-12">
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload01" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/img/products/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload02" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/img/products/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload03" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/img/products/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload04" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/img/products/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload05" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/img/products/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload06" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/img/products/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($array['images'])) {
|
||||
$image_urls = explode(',', $array['images']);
|
||||
foreach ($image_urls as $index => $image_url) {
|
||||
$image_url = trim($image_url);
|
||||
?>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<button class="delete-image-button" onclick="deleteImage('<?php echo $array['_id']; ?>', <?php echo $index; ?>)">
|
||||
<i class="mdi mdi-delete" style="font-size:16px; color: black; background-color:white; border-radius:3px;"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="" src="<?php echo $image_url; ?>" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="thumbUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function deleteImage(productId, indexToDelete) {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId)
|
||||
.then(response => response.json())
|
||||
.then(product => {
|
||||
let imagesArray = product.images.split(',');
|
||||
if (indexToDelete >= 0 && indexToDelete < imagesArray.length) {
|
||||
imagesArray.splice(indexToDelete, 1);
|
||||
}
|
||||
const updatedImages = imagesArray.join(',');
|
||||
const payload = {
|
||||
images: updatedImages,
|
||||
};
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Image deleted successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Image deletion failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during image deletion:', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -858,15 +875,15 @@ $vendorId = $_SESSION["vendorId"];
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="weight" class="form-label">Weight</label>
|
||||
<label for="weight" class="form-label">Weight(g)</label>
|
||||
<input type="number" class="form-control slug-title" id="width" name="weight" value="<?php echo $array['weight']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="length" class="form-label">Length</label>
|
||||
<input type="number" class="form-control slug-title" id="width" name="length" value="<?php echo $array['length']; ?>">
|
||||
<label for="length" class="form-label">Length(cm)</label>
|
||||
<input type="number" class="form-control slug-title" id="length" name="length" value="<?php echo $array['length']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="width" class="form-label">Width</label>
|
||||
<label for="width" class="form-label">Width(cm)</label>
|
||||
<input type="number" class="form-control slug-title" id="width" name="width" value="<?php echo $array['width']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
@ -890,6 +907,31 @@ $vendorId = $_SESSION["vendorId"];
|
|||
)</span></label>
|
||||
<input type="number" class="form-control" id="price2" name="sale_price" value="<?php echo $array['sale_price'] ?>">
|
||||
</div>
|
||||
<!-- 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="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>
|
||||
</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>
|
||||
</div>
|
||||
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Stock</label>
|
||||
<input type="number" class="form-control" id="quantity1" name="stock" value="<?php echo $array['stock'] ?>">
|
||||
|
@ -997,105 +1039,134 @@ $vendorId = $_SESSION["vendorId"];
|
|||
}
|
||||
}
|
||||
|
||||
function uploadImage() {
|
||||
function uploadProductImage() {
|
||||
var productId = '<?php echo $_SESSION['productId'] ?>';
|
||||
var fileInput = document.getElementById('imageUpload');
|
||||
var file = fileInput.files[0];
|
||||
var files = fileInput.files;
|
||||
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (files.length > 0) {
|
||||
var promises = [];
|
||||
var existingImages = [];
|
||||
|
||||
// Resize the image
|
||||
const maxWidth = 1200; // Set your desired maximum width
|
||||
const maxHeight = 1000; // Set your desired maximum height
|
||||
const aspectRatio = img.width / img.height;
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId)
|
||||
.then(response => response.json())
|
||||
.then(product => {
|
||||
existingImages = product.images || [];
|
||||
existingImages = Array.isArray(existingImages) ? existingImages : [existingImages];
|
||||
existingImages = existingImages.filter(image => image);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching existing images:', error);
|
||||
});
|
||||
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const reader = new FileReader();
|
||||
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
reader.onload = function(e) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const maxWidth = 1200;
|
||||
const maxHeight = 1000;
|
||||
const aspectRatio = img.width / img.height;
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
|
||||
// Draw the image on the canvas
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
|
||||
// Convert the canvas content to a new image file
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
|
||||
// Continue with the rest of your upload logic using the resized file
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', productId);
|
||||
formData.append('category', 'product');
|
||||
formData.append('image', resizedFile);
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', productId);
|
||||
formData.append('category', 'product');
|
||||
formData.append('image', resizedFile);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
reject(new Error('File upload failed'));
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
resolve(filename);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
reject(error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
|
||||
const payload = {
|
||||
product_image: `https://api.obanana.shop/images/storage/product_uploads/${filename}`,
|
||||
};
|
||||
img.src = e.target.result;
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://api.obanana.shop/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
|
||||
img.src = e.target.result;
|
||||
};
|
||||
promises.push(promise);
|
||||
}
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
Promise.all(promises)
|
||||
.then(filenames => {
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`));
|
||||
|
||||
if (!Array.isArray(updatedImages)) {
|
||||
console.error('Updated images is not an array:', updatedImages);
|
||||
throw new Error('Updated images is not an array');
|
||||
}
|
||||
const imagesString = updatedImages.join(',');
|
||||
const payload = {
|
||||
images: imagesString,
|
||||
};
|
||||
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Images uploaded successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Image upload failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during image upload:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Common Javascript -->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -928,7 +928,7 @@ if($_SESSION["user_type"]!="admin"){
|
|||
formData.append('category', 'product');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -947,7 +947,7 @@ if($_SESSION["user_type"]!="admin"){
|
|||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
product_image: `https://api.obanana.shop/images/storage/product_uploads/${filename}`,
|
||||
product_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`,
|
||||
vendor_api_id: vendor,
|
||||
product_name: updatedName,
|
||||
stock: updatedStock,
|
||||
|
@ -963,7 +963,7 @@ if($_SESSION["user_type"]!="admin"){
|
|||
console.log('Payload:', payload);
|
||||
|
||||
// Make another API request using the extracted filename
|
||||
return fetch('https://api.obanana.shop/api/v1/products/' + productId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -988,7 +988,7 @@ if($_SESSION["user_type"]!="admin"){
|
|||
}
|
||||
else {
|
||||
// If no file selected, only update the email
|
||||
fetch('https://api.obanana.shop/api/v1/products/' + productId, {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$input = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
if (isset($input['token'])) {
|
||||
// Update the session token
|
||||
$_SESSION['token'] = $input['token'];
|
||||
$_SESSION["token"] = $input['token'];
|
||||
echo json_encode(['status' => 'success']);
|
||||
} else {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Token not provided']);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<?php include "../functions.php"; ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
|
@ -134,19 +135,18 @@
|
|||
echo $id[0]['username'];
|
||||
?></a></td>
|
||||
<td>
|
||||
<?php
|
||||
// if (isset($product['product']['specifications'])) {
|
||||
?>
|
||||
<!--<button onclick="window.location.href='https://b2b.obpay.online/product-left-sidebar.php?id=<?php //echo $product['product']['_id'];
|
||||
?>';">View</button>
|
||||
<button onclick="window.location.href='https://b2b.obpay.online/admin/product-edit.php?id=<?php //echo $product['product']['_id'];
|
||||
?>';">Edit</button>-->
|
||||
<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>
|
||||
<?php
|
||||
// } else {
|
||||
// echo "No Data";
|
||||
// }
|
||||
<?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>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a class="btn btn-default" href="https://obanana.com/product-left-sidebar.php?id=<?php echo $product['product']['_id']; ?>" target="_blank">View</a>
|
||||
<a class="btn btn-default" href="https://obanana.com/admin/product-edit.php?id=<?php echo $product['product']['_id']; ?>" target="_blank">Edit</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -169,7 +169,7 @@ function getAllProducts()
|
|||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -194,7 +194,7 @@ function getAllUsers()
|
|||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/users',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/users",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
$id = $_GET['id'];
|
||||
$users = getAllUsers($id);
|
||||
$users = array_values($users);
|
||||
|
@ -76,7 +77,7 @@ function getAllUsers($id)
|
|||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/users',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/users",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -108,7 +109,7 @@ function getAllProducts()
|
|||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$id = $_POST['_id'];
|
||||
$username = $_POST['username'];
|
||||
$userType = $_POST['user_type'];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -762,7 +762,7 @@ $users = getUsers();
|
|||
}
|
||||
|
||||
function login(username, password, sessionToken, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -892,7 +892,7 @@ function deleteVendor(vendorId){
|
|||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -908,7 +908,7 @@ function deleteVendor(vendorId){
|
|||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://api.obanana.shop/images/storage/vendor_uploads/${filename}`,
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
user_login: updatedUser,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
|
@ -927,7 +927,7 @@ function deleteVendor(vendorId){
|
|||
};
|
||||
|
||||
// Make another API request using the extracted filename
|
||||
return fetch('https://api.obanana.shop/api/v1/vendors/' + vendorId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -948,7 +948,7 @@ function deleteVendor(vendorId){
|
|||
});
|
||||
} else {
|
||||
// If no file selected, only update the email
|
||||
fetch('https://api.obanana.shop/api/v1/vendors/' + vendorId, {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -992,7 +992,7 @@ function deleteVendor(vendorId){
|
|||
var email = emailInput.value;
|
||||
|
||||
if (email.trim() !== '') {
|
||||
return fetch('https://api.obanana.shop/api/v1/vendors/search?q=' + email)
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
|
@ -1301,7 +1301,7 @@ function deleteVendor(vendorId){
|
|||
if (email.trim() !== '') {
|
||||
var response;
|
||||
$.ajax({
|
||||
url: 'https://api.obanana.shop/api/v1/vendors/search?q=' + email,
|
||||
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email,
|
||||
method: 'GET',
|
||||
success: function(data) {
|
||||
response = data;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
session_start();
|
||||
include "../functions.php";
|
||||
$urlCurrent = $_SESSION["url"];
|
||||
|
||||
$vendorId = $_GET['id'];
|
||||
$curl = curl_init();
|
||||
$url = 'https://api.obanana.shop/api/v1/vendors/'.$vendorId;
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/".$vendorId;
|
||||
curl_setopt($curl,CURLOPT_URL,$url);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
$vendorId = $_SESSION["vendorId"];
|
||||
?>
|
||||
|
@ -1102,7 +1102,7 @@ $vendorId = $_SESSION["vendorId"];
|
|||
formData.append('category', 'product');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -1121,7 +1121,7 @@ $vendorId = $_SESSION["vendorId"];
|
|||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
product_image: `https://api.obanana.shop/images/storage/product_uploads/${filename}`,
|
||||
product_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`,
|
||||
vendor_api_id: vendor,
|
||||
product_name: updatedName,
|
||||
stock: updatedStock,
|
||||
|
@ -1137,7 +1137,7 @@ $vendorId = $_SESSION["vendorId"];
|
|||
console.log('Payload:', payload);
|
||||
|
||||
// Make another API request using the extracted filename
|
||||
return fetch('https://api.obanana.shop/api/v1/products/' + productId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -1161,7 +1161,7 @@ $vendorId = $_SESSION["vendorId"];
|
|||
});
|
||||
} else {
|
||||
// If no file selected, only update the email
|
||||
fetch('https://api.obanana.shop/api/v1/products/' + productId, {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
$vendorId = $_SESSION["vendorId"];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
|
@ -777,7 +777,7 @@ if($_SESSION["user_type"]!="admin"){
|
|||
}
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
if(isset($_SESSION["vendorId"])){
|
||||
if(isset($_GET["id"])){
|
||||
$_SESSION["vendorId"]=$_GET["id"];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
session_start();
|
||||
|
||||
$email = $_POST['user_email'];
|
||||
$phone = $_POST['phone'];
|
||||
$company = $_POST['first_name'];
|
||||
|
|
|
@ -0,0 +1,802 @@
|
|||
// function increment() {
|
||||
// var qtyInput = document.getElementById('qty-input');
|
||||
// qtyInput.value = parseInt(qtyInput.value) + 1;
|
||||
// }
|
||||
|
||||
// function decrement() {
|
||||
// var qtyInput = document.getElementById('qty-input');
|
||||
// if (parseInt(qtyInput.value) > 1) {
|
||||
// qtyInput.value = parseInt(qtyInput.value) - 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// function deleteOrder(orderId) {
|
||||
// fetch('https://api.obanana.com/api/v1/orders/' + orderId, {
|
||||
// method: 'DELETE'
|
||||
// })
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// if (data && data !== "") {
|
||||
// // Order deleted successfully, update the UI
|
||||
// document.getElementById('order_' + data._id).remove(); // Assuming each order has a unique ID in the DOM
|
||||
// } else {
|
||||
// alert('Error deleting order: ' + data.status);
|
||||
// }
|
||||
// })
|
||||
// .catch(error => console.error('Error:', error));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// function login(username, password, callback) {
|
||||
// fetch("https://api.obanana.com/api/v1/login", {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// "X-Api-Key": "{{apiKey}}"
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// username: username,
|
||||
// password: password
|
||||
// })
|
||||
// })
|
||||
// .then(response => {
|
||||
// if (response.ok) {
|
||||
// return response.json();
|
||||
// } else {
|
||||
// throw new Error("Unable to login");
|
||||
// }
|
||||
// })
|
||||
// .then(data => {
|
||||
// fetch("update-token-session.php", {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json"
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// token: data.token
|
||||
// })
|
||||
// })
|
||||
// .then(response => response.json())
|
||||
// .then(result => {
|
||||
// if (result.status === 'success') {
|
||||
// sessionToken = data.token;
|
||||
// console.log("New Token:", sessionToken);
|
||||
// callback(sessionToken);
|
||||
// } else {
|
||||
// throw new Error("Unable to update session token");
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
// .catch(error => {
|
||||
// console.error("Error:", error.message);
|
||||
// });
|
||||
// }
|
||||
|
||||
// function popupAddToCart(product, productVendor, token, email, password, customer) {
|
||||
// // Parse the JSON string into a JavaScript object
|
||||
// var productObj = JSON.parse(product);
|
||||
// var vendorObj = JSON.parse(productVendor);
|
||||
// var customerObj = JSON.parse(customer);
|
||||
|
||||
// console.log("Product Vendor JSON: " + vendorObj);
|
||||
|
||||
|
||||
// var sessionToken = token;
|
||||
// var productImage = productObj.product_image;
|
||||
// var productId = productObj._id;
|
||||
// var productName = productObj.product_name;
|
||||
// var productPrice = productObj.sale_price ? productObj.sale_price : productObj.regular_price;
|
||||
// var shippingFee = productObj.shipping_fee && productObj.shipping_fee !=="" ? productObj.shipping_fee: '50' ;
|
||||
// var productVendorId = vendorObj._id;
|
||||
// var vendorName = vendorObj.user_login;
|
||||
// var productQuantity = 1;
|
||||
// var customerId = customerObj[0]._id;
|
||||
// var customerName = customerObj[0].first_name + ' ' + customerObj[0].last_name;
|
||||
|
||||
|
||||
// // Now you can use these variables as needed
|
||||
// console.log("Product email: " + email);
|
||||
// console.log("Product password: " + password);
|
||||
// console.log("Product Token: " + sessionToken);
|
||||
// console.log("Product Image: " + productImage);
|
||||
// console.log("Product ID: " + productId);
|
||||
// console.log("Product Name: " + productName);
|
||||
// console.log("Product Price: " + productPrice);
|
||||
// console.log("Product Vendor ID: " + productVendorId);
|
||||
// console.log("Product Vendor Name: " + vendorName);
|
||||
// console.log("Product Quantity: " + productQuantity);
|
||||
// console.log("Customer ID: " + customerId);
|
||||
// console.log("Customer Name: " + customerName);
|
||||
|
||||
// login(email, password, function(token){
|
||||
|
||||
// var productData = {
|
||||
// product: {
|
||||
// product_image: productImage,
|
||||
// product_id: productId,
|
||||
// name: productName,
|
||||
// },
|
||||
// price: productPrice,
|
||||
// quantity: productQuantity,
|
||||
// vendor_id: productVendorId,
|
||||
// vendor_name: vendorName,
|
||||
// };
|
||||
|
||||
// var totalAmount = productData.price * productData.quantity;
|
||||
|
||||
// var customerData = {
|
||||
// customer_id: customerId,
|
||||
// name: customerName,
|
||||
// };
|
||||
|
||||
// var existingOrder;
|
||||
// var orderCheckXhr = new XMLHttpRequest();
|
||||
// orderCheckXhr.open("GET", "https://api.obanana.com/api/v1/orders/customer/" + customerData.customer_id, true);
|
||||
// orderCheckXhr.onreadystatechange = function() {
|
||||
// if (orderCheckXhr.readyState === 4) {
|
||||
// if (orderCheckXhr.status === 200) {
|
||||
// var orders = JSON.parse(orderCheckXhr.responseText);
|
||||
// var existingItemId;
|
||||
// var ordersFiltered = orders.filter((e) => e.status === "CART" || e.status === "Cart")
|
||||
// existingOrder = ordersFiltered.find(order => order.items.some(item => item.product.product_id === productData.product.product_id));
|
||||
// console.log("exist? " + existingOrder)
|
||||
// if (existingOrder) {
|
||||
// var existingItemId = existingOrder.items[0]._id;
|
||||
|
||||
// // If the product is found in an existing CART order, update the order
|
||||
// updateOrder(existingOrder._id, existingItemId);
|
||||
// } else {
|
||||
// // If the product is not found or the order is not a CART, create a new order
|
||||
// console.log("No Order Yet!")
|
||||
// createNewOrder()
|
||||
// }
|
||||
// } else if (orderCheckXhr.status === 404) {
|
||||
// // If the customer has no orders, create a new order
|
||||
// console.log("No Order Yet!")
|
||||
// createNewOrder();
|
||||
// } else {
|
||||
// // Handle error response from the server when checking orders
|
||||
// console.log("Error checking orders:", orderCheckXhr.responseText);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
// orderCheckXhr.send();
|
||||
|
||||
// function createNewOrder() {
|
||||
// var xhr = new XMLHttpRequest();
|
||||
|
||||
// // Declare requestData before sending the request
|
||||
// var requestData = {
|
||||
// items: [productData],
|
||||
// customer: [customerData],
|
||||
// status: "CART",
|
||||
// total_amount: totalAmount,
|
||||
// shipping_fee: shippingFee,
|
||||
// };
|
||||
|
||||
// console.log("Request data:", requestData); // Debugging statement
|
||||
// // const token = '<?php echo $_SESSION["token"] ?>';
|
||||
// xhr.open("POST", "https://api.obanana.com/api/v1/orders", true);
|
||||
// xhr.setRequestHeader("Content-Type", "application/json", );
|
||||
// xhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
// xhr.onreadystatechange = function() {
|
||||
// if (xhr.readyState === 4) {
|
||||
// if (xhr.status === 201) {
|
||||
// var response = JSON.parse(xhr.responseText);
|
||||
|
||||
// console.log("Response:", response); // Debugging statement
|
||||
|
||||
// // Update the cart dynamically
|
||||
// var cartList = document.querySelector(".eccart-pro-items");
|
||||
|
||||
// var newOrder = document.createElement("li");
|
||||
// newOrder.id = `order_${response._id}`;
|
||||
// console.log(response)
|
||||
// newOrder.innerHTML = `
|
||||
// <a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
|
||||
// <img src="${response.items[0].product.product_image}" alt="product">
|
||||
// </a>
|
||||
// <div class="ec-pro-content">
|
||||
// <a href="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
|
||||
// <span class="cart-price" id="cart-price">
|
||||
// Unit Price: <span>${response.items[0].price}</span>
|
||||
// </span>
|
||||
// <span id="subtotal-${response._id}" class="subtotal-${response._id}">Subtotal: ${totalAmount}</span>
|
||||
// <div class="qty-plus-minuses">
|
||||
// <div class="qty-btn" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
|
||||
// <input id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
|
||||
// <div class="qty-btn" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
|
||||
// </div>
|
||||
// <a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
// </div>
|
||||
// `;
|
||||
// getLatestOrders()
|
||||
// updateCartItemCount()
|
||||
// cartList.appendChild(newOrder);
|
||||
// } else {
|
||||
// // Handle error response from the server
|
||||
// console.log("Error response from the server");
|
||||
// console.log(xhr.responseText); // Log the server's response
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// xhr.send(JSON.stringify(requestData));
|
||||
// }
|
||||
|
||||
// function getLatestOrders() {
|
||||
// // var customerId = '<?php echo $customer_data[0]['_id'] ?>'
|
||||
// // Fetch the order data
|
||||
// fetch(`https://api.obanana.com/api/v1/orders/customer/${customerId}`)
|
||||
// .then(response => response.json())
|
||||
// .then(orderData => {
|
||||
// if (orderData && orderData !== "") {
|
||||
// console.log(orderData)
|
||||
// const filteredOrders = orderData.filter(order => order.status.toUpperCase() === 'CART');
|
||||
// const totalAmountSum = filteredOrders.reduce((sum, order) => {
|
||||
// const totalAmount = parseFloat(order.total_amount);
|
||||
// return sum + totalAmount;
|
||||
// }, 0);
|
||||
|
||||
// console.log('Total Amount Sum:', totalAmountSum);
|
||||
// document.getElementById(`floatCartTotalAmount`).innerText = totalAmountSum;
|
||||
// } else {
|
||||
// alert('Error fetching order data');
|
||||
// }
|
||||
// })
|
||||
// .catch(error => console.error('Error:', error));
|
||||
// }
|
||||
|
||||
|
||||
// function updateOrder(orderId, existingItemId) {
|
||||
// var updateOrderXhr = new XMLHttpRequest();
|
||||
// // const token = '<?php echo $_SESSION["token"] ?>';
|
||||
// updateOrderXhr.open("PUT", `https://api.obanana.com/api/v1/orders/${orderId}/items/${existingItemId}`, true);
|
||||
// updateOrderXhr.setRequestHeader("Content-Type", "application/json");
|
||||
// updateOrderXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
// updateOrderXhr.onreadystatechange = function() {
|
||||
// if (updateOrderXhr.readyState === 4) {
|
||||
// if (updateOrderXhr.status === 200) {
|
||||
// var response = JSON.parse(updateOrderXhr.responseText);
|
||||
// console.log("Order updated:", response);
|
||||
|
||||
// var cartItem = document.getElementById(`order_${response._id}`);
|
||||
|
||||
// if (cartItem) {
|
||||
// var updatedQuantity = response.items[0].quantity; // Use the correct quantity from the updated order
|
||||
// var totalAmount = response.items[0].price * updatedQuantity;
|
||||
// // If the cart item already exists, update its content using innerHTML
|
||||
// cartItem.innerHTML = `
|
||||
// <a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
|
||||
// <img src="${response.items[0].product.product_image}" alt="product">
|
||||
// </a>
|
||||
// <div class="ec-pro-content">
|
||||
// <a href="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
|
||||
// <span class="cart-price" id="cart-price">
|
||||
// Unit Price: <span>${response.items[0].price}</span>
|
||||
// </span>
|
||||
// <span id="subtotal-${response._id}" class="subtotal-${response._id}">Subtotal: ${totalAmount}</span>
|
||||
// <div class="qty-plus-minuses">
|
||||
// <div class="qty-btn" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
|
||||
// <input id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
|
||||
// <div class="qty-btn" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
|
||||
// </div>
|
||||
// <a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
// </div>
|
||||
// `;
|
||||
// document.getElementById(`qty-input-${response.items[0]._id}`).value = updatedQuantity;
|
||||
// } else {
|
||||
// // If the cart item doesn't exist, create a new one
|
||||
// console.log("Error updating order:", updateOrderXhr.responseText);
|
||||
// }
|
||||
|
||||
// getLatestOrders();
|
||||
// updateCartItemCount();
|
||||
// } else {
|
||||
// // Handle error response from the server
|
||||
// console.log("Error response from the server");
|
||||
// console.log(xhr.responseText); // Log the server's response
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// var existingQuantity = parseInt(existingOrder.items[0].quantity, 10);
|
||||
// var newQuantity = parseInt(productQuantity, 10);
|
||||
// var updatedQuantity = existingQuantity + newQuantity;
|
||||
|
||||
// var updateData = {
|
||||
// quantity: updatedQuantity,
|
||||
// };
|
||||
|
||||
// updateOrderXhr.send(JSON.stringify(updateData));
|
||||
|
||||
// var patchTotalAmountXhr = new XMLHttpRequest();
|
||||
// patchTotalAmountXhr.open("PATCH", `https://api.obanana.com/api/v1/orders/${orderId}`, true);
|
||||
// patchTotalAmountXhr.setRequestHeader("Content-Type", "application/json");
|
||||
// patchTotalAmountXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
|
||||
// var originalPrice = productPrice;
|
||||
// var totalAmount = originalPrice * updatedQuantity;
|
||||
// console.log(originalPrice);
|
||||
// console.log(totalAmount);
|
||||
// var patchData = {
|
||||
// total_amount: totalAmount
|
||||
// };
|
||||
|
||||
// patchTotalAmountXhr.send(JSON.stringify(patchData));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// })
|
||||
// }
|
||||
|
||||
// function popupWishlist(wishproduct, wishCustomer) {
|
||||
// var productObject = JSON.parse(wishproduct);
|
||||
// var customerObject = JSON.parse(wishCustomer);
|
||||
|
||||
// var prodId = productObject._id;
|
||||
// var custId = customerObject[0]._id;
|
||||
// fetch('https://api.obanana.com/api/v1/customers/' + custId)
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// const existingWishlist = data.favorites ?? {
|
||||
// products: [],
|
||||
// vendors: []
|
||||
// };
|
||||
|
||||
// // Check if the product already exists in the wishlist
|
||||
// const isAlreadyAdded = existingWishlist.products.some(product => product._id === prodId);
|
||||
|
||||
// if (!isAlreadyAdded) {
|
||||
// const newFavorites = {
|
||||
// products: [{
|
||||
// ...productObject, // Use the spread operator to include all properties from product_details
|
||||
// }]
|
||||
// };
|
||||
|
||||
// existingWishlist.products.push(newFavorites.products[0]);
|
||||
|
||||
// return fetch('https://api.obanana.com/api/v1/customers/' + custId, {
|
||||
// method: 'PATCH',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// body: JSON.stringify({
|
||||
// favorites: existingWishlist
|
||||
// }),
|
||||
// });
|
||||
// } else {
|
||||
// console.log("Product already exists in favorites");
|
||||
// // Optionally, you can notify the user that the product is already in their favorites
|
||||
// // alert("Product already exists in favorites");
|
||||
// return Promise.resolve(); // Resolve the promise to continue the chain
|
||||
// }
|
||||
// })
|
||||
|
||||
// .then(response => {
|
||||
// if (response && response.ok) {
|
||||
// // Handle success (e.g., show a success message)
|
||||
// console.log("Added to favorites")
|
||||
// updateWishItemCount();
|
||||
// // location.reload();
|
||||
// } else if (response) {
|
||||
// // 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');
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// function deleteOrder(orderId) {
|
||||
// fetch('https://api.obanana.com/api/v1/orders/' + orderId, {
|
||||
// method: 'DELETE'
|
||||
// })
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// if (data && data !== "") {
|
||||
// // Order deleted successfully, update the UI
|
||||
// document.getElementById('order_' + data._id).remove(); // Assuming each order has a unique ID in the DOM
|
||||
// } else {
|
||||
// alert('Error deleting order: ' + data.status);
|
||||
// }
|
||||
// })
|
||||
// .catch(error => console.error('Error:', error));
|
||||
// }
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.com/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": "{{apiKey}}"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
password: password
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error("Unable to login");
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
fetch("update-token-session.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback(sessionToken);
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
function popupAddToCart(product, productVendor, token, email, password, customer) {
|
||||
// var productObj = JSON.parse(product);
|
||||
// console.log(product)
|
||||
var cleanedProduct = product.replace(/[\r\n]+/gm, '');
|
||||
var productObj;
|
||||
|
||||
try {
|
||||
// Attempt to parse 'cleanedProduct' as JSON
|
||||
productObj = JSON.parse(cleanedProduct);
|
||||
|
||||
// Log the parsed object for debugging
|
||||
console.log("Parsed Product Object:", productObj);
|
||||
} catch (error) {
|
||||
// Log the error and return, or handle it accordingly
|
||||
console.error("Error parsing product JSON: ", error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Now 'productObj' contains the parsed product or the original object/array
|
||||
|
||||
try {
|
||||
var trimmedCustomer = customer
|
||||
var customerObj = JSON.parse(trimmedCustomer);
|
||||
console.log("Customer Object: ", customerObj);
|
||||
} catch (error) {
|
||||
console.error("Error parsing customer JSON: ", error);
|
||||
}
|
||||
var vendorObj = JSON.parse(productVendor);
|
||||
|
||||
var sessionToken = token;
|
||||
var productImage = productObj.product_image;
|
||||
var productId = productObj._id;
|
||||
var productName = productObj.product_name;
|
||||
var productPrice = productObj.sale_price ? productObj.sale_price : productObj.regular_price;
|
||||
var shippingFee = productObj.shipping_fee && productObj.shipping_fee !=="" ? productObj.shipping_fee: '50' ;
|
||||
var productVendorId = vendorObj._id;
|
||||
var vendorName = vendorObj.user_login;
|
||||
var productQuantity = 1;
|
||||
var customerId = customerObj[0]._id;
|
||||
var customerName = customerObj[0].first_name + ' ' + customerObj[0].last_name;
|
||||
|
||||
console.log("Product email: " + email);
|
||||
console.log("Product password: " + password);
|
||||
console.log("Product Token: " + sessionToken);
|
||||
console.log("Product Image: " + productImage);
|
||||
console.log("Product ID: " + productId);
|
||||
console.log("Product Name: " + productName);
|
||||
console.log("Product Price: " + productPrice);
|
||||
console.log("Product Vendor ID: " + productVendorId);
|
||||
console.log("Product Vendor Name: " + vendorName);
|
||||
console.log("Product Quantity: " + productQuantity);
|
||||
console.log("Customer ID: " + customerId);
|
||||
console.log("Customer Name: " + customerName);
|
||||
|
||||
login(email, password, function(token){
|
||||
|
||||
var productData = {
|
||||
product: {
|
||||
product_image: productImage,
|
||||
product_id: productId,
|
||||
name: productName,
|
||||
},
|
||||
price: productPrice,
|
||||
quantity: productQuantity,
|
||||
vendor_id: productVendorId,
|
||||
vendor_name: vendorName,
|
||||
};
|
||||
|
||||
var totalAmount = productData.price * productData.quantity;
|
||||
|
||||
var customerData = {
|
||||
customer_id: customerId,
|
||||
name: customerName,
|
||||
};
|
||||
|
||||
var existingOrder;
|
||||
var orderCheckXhr = new XMLHttpRequest();
|
||||
orderCheckXhr.open("GET", "https://api.obanana.com/api/v1/orders/customer/" + customerData.customer_id, true);
|
||||
orderCheckXhr.onreadystatechange = function() {
|
||||
if (orderCheckXhr.readyState === 4) {
|
||||
if (orderCheckXhr.status === 200) {
|
||||
var orders = JSON.parse(orderCheckXhr.responseText);
|
||||
var existingItemId;
|
||||
var ordersFiltered = orders.filter((e) => e.status === "CART" || e.status === "Cart")
|
||||
console.log()
|
||||
existingOrder = ordersFiltered.find(order => order.items.some(item => item.product.product_id === productData.product.product_id));
|
||||
console.log("exist? " + existingOrder)
|
||||
if (existingOrder) {
|
||||
var existingItemId = existingOrder.items[0]._id;
|
||||
|
||||
// If the product is found in an existing CART order, update the order
|
||||
updateOrder(existingOrder._id, existingItemId);
|
||||
} else {
|
||||
// If the product is not found or the order is not a CART, create a new order
|
||||
console.log("No Order Yet!")
|
||||
createNewOrder()
|
||||
}
|
||||
} else if (orderCheckXhr.status === 404) {
|
||||
// If the customer has no orders, create a new order
|
||||
console.log("No Order Yet!")
|
||||
createNewOrder();
|
||||
} else {
|
||||
// Handle error response from the server when checking orders
|
||||
console.log("Error checking orders:", orderCheckXhr.responseText);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
orderCheckXhr.send();
|
||||
|
||||
function createNewOrder() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
// Declare requestData before sending the request
|
||||
var requestData = {
|
||||
items: [productData],
|
||||
customer: [customerData],
|
||||
status: "CART",
|
||||
total_amount: totalAmount,
|
||||
shipping_fee: shippingFee,
|
||||
};
|
||||
|
||||
console.log("Request data:", requestData); // Debugging statement
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
xhr.open("POST", "https://api.obanana.com/api/v1/orders", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json", );
|
||||
xhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 201) {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
|
||||
console.log("Response:", response); // Debugging statement
|
||||
|
||||
// Update the cart dynamically
|
||||
var cartList = document.querySelector(".eccart-pro-items");
|
||||
|
||||
var newOrder = document.createElement("li");
|
||||
newOrder.id = `order_${response._id}`;
|
||||
console.log(response)
|
||||
newOrder.innerHTML = `
|
||||
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
|
||||
<img src="${response.items[0].product.product_image}" alt="product">
|
||||
</a>
|
||||
<div class="ec-pro-content">
|
||||
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
|
||||
<span class="cart-price" id="cart-price">
|
||||
Unit Price: <span>${response.items[0].price}</span>
|
||||
</span>
|
||||
<span id="subtotal-${response._id}" class="subtotal-${response._id}">Subtotal: ${totalAmount}</span>
|
||||
<div class="qty-plus-minuses">
|
||||
<div class="qty-btn" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
|
||||
<input id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
|
||||
<div class="qty-btn" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
|
||||
</div>
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
</div>
|
||||
`;
|
||||
getLatestOrders()
|
||||
updateCartItemCount()
|
||||
cartList.appendChild(newOrder);
|
||||
} else {
|
||||
// Handle error response from the server
|
||||
console.log("Error response from the server");
|
||||
console.log(xhr.responseText); // Log the server's response
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(JSON.stringify(requestData));
|
||||
}
|
||||
|
||||
function getLatestOrders() {
|
||||
// var customerId = '<?php echo $customer_data[0]['_id'] ?>'
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.com/api/v1/orders/customer/${customerId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
if (orderData && orderData !== "") {
|
||||
console.log(orderData)
|
||||
const filteredOrders = orderData.filter(order => order.status.toUpperCase() === 'CART');
|
||||
const totalAmountSum = filteredOrders.reduce((sum, order) => {
|
||||
const totalAmount = parseFloat(order.total_amount);
|
||||
return sum + totalAmount;
|
||||
}, 0);
|
||||
|
||||
console.log('Total Amount Sum:', totalAmountSum);
|
||||
document.getElementById(`floatCartTotalAmount`).innerText = totalAmountSum;
|
||||
} else {
|
||||
alert('Error fetching order data');
|
||||
}
|
||||
})
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
|
||||
function updateOrder(orderId, existingItemId) {
|
||||
var updateOrderXhr = new XMLHttpRequest();
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
updateOrderXhr.open("PUT", `https://api.obanana.com/api/v1/orders/${orderId}/items/${existingItemId}`, true);
|
||||
updateOrderXhr.setRequestHeader("Content-Type", "application/json");
|
||||
updateOrderXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
updateOrderXhr.onreadystatechange = function() {
|
||||
if (updateOrderXhr.readyState === 4) {
|
||||
if (updateOrderXhr.status === 200) {
|
||||
var response = JSON.parse(updateOrderXhr.responseText);
|
||||
console.log("Order updated:", response);
|
||||
|
||||
var cartItem = document.getElementById(`order_${response._id}`);
|
||||
|
||||
if (cartItem) {
|
||||
var updatedQuantity = response.items[0].quantity; // Use the correct quantity from the updated order
|
||||
var totalAmount = response.items[0].price * updatedQuantity;
|
||||
// If the cart item already exists, update its content using innerHTML
|
||||
cartItem.innerHTML = `
|
||||
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
|
||||
<img src="${response.items[0].product.product_image}" alt="product">
|
||||
</a>
|
||||
<div class="ec-pro-content">
|
||||
<a href="shop-left-sidebar-col-4.php" class="cart_pro_title">${response.items[0].product.name}</a>
|
||||
<span class="cart-price" id="cart-price">
|
||||
Unit Price: <span>${response.items[0].price}</span>
|
||||
</span>
|
||||
<span id="subtotal-${response._id}" class="subtotal-${response._id}">Subtotal: ${totalAmount}</span>
|
||||
<div class="qty-plus-minuses">
|
||||
<div class="qty-btn" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
|
||||
<input id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
|
||||
<div class="qty-btn" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
|
||||
</div>
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
</div>
|
||||
`;
|
||||
document.getElementById(`qty-input-${response.items[0]._id}`).value = updatedQuantity;
|
||||
} else {
|
||||
// If the cart item doesn't exist, create a new one
|
||||
console.log("Error updating order:", updateOrderXhr.responseText);
|
||||
}
|
||||
|
||||
getLatestOrders();
|
||||
updateCartItemCount();
|
||||
} else {
|
||||
// Handle error response from the server
|
||||
console.log("Error response from the server");
|
||||
console.log(xhr.responseText); // Log the server's response
|
||||
}
|
||||
}
|
||||
};
|
||||
var existingQuantity = parseInt(existingOrder.items[0].quantity, 10);
|
||||
var newQuantity = parseInt(productQuantity, 10);
|
||||
var updatedQuantity = existingQuantity + newQuantity;
|
||||
|
||||
var updateData = {
|
||||
quantity: updatedQuantity,
|
||||
};
|
||||
|
||||
updateOrderXhr.send(JSON.stringify(updateData));
|
||||
|
||||
var patchTotalAmountXhr = new XMLHttpRequest();
|
||||
patchTotalAmountXhr.open("PATCH", `https://api.obanana.com/api/v1/orders/${orderId}`, true);
|
||||
patchTotalAmountXhr.setRequestHeader("Content-Type", "application/json");
|
||||
patchTotalAmountXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
|
||||
var originalPrice = productPrice;
|
||||
var totalAmount = originalPrice * updatedQuantity;
|
||||
console.log(originalPrice);
|
||||
console.log(totalAmount);
|
||||
var patchData = {
|
||||
total_amount: totalAmount
|
||||
};
|
||||
|
||||
patchTotalAmountXhr.send(JSON.stringify(patchData));
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function popupWishlist(wishproduct, wishCustomer) {
|
||||
var productObject = JSON.parse(wishproduct);
|
||||
var customerObject = JSON.parse(wishCustomer);
|
||||
|
||||
var prodId = productObject._id;
|
||||
var custId = customerObject[0]._id;
|
||||
fetch('https://api.obanana.com/api/v1/customers/' + custId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const existingWishlist = data.favorites ?? {
|
||||
products: [],
|
||||
vendors: []
|
||||
};
|
||||
|
||||
// Check if the product already exists in the wishlist
|
||||
const isAlreadyAdded = existingWishlist.products.some(product => product._id === prodId);
|
||||
|
||||
if (!isAlreadyAdded) {
|
||||
const newFavorites = {
|
||||
products: [{
|
||||
...productObject, // Use the spread operator to include all properties from product_details
|
||||
}]
|
||||
};
|
||||
|
||||
existingWishlist.products.push(newFavorites.products[0]);
|
||||
|
||||
return fetch('https://api.obanana.com/api/v1/customers/' + custId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
favorites: existingWishlist
|
||||
}),
|
||||
});
|
||||
} else {
|
||||
console.log("Product already exists in favorites");
|
||||
// Optionally, you can notify the user that the product is already in their favorites
|
||||
// alert("Product already exists in favorites");
|
||||
return Promise.resolve(); // Resolve the promise to continue the chain
|
||||
}
|
||||
})
|
||||
|
||||
.then(response => {
|
||||
if (response && response.ok) {
|
||||
// Handle success (e.g., show a success message)
|
||||
console.log("Added to favorites")
|
||||
updateWishItemCount();
|
||||
// location.reload();
|
||||
} else if (response) {
|
||||
// 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');
|
||||
});
|
||||
}
|
||||
|
22
cart.php
22
cart.php
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -255,7 +255,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
function handleQtyInputCart(input, orderId, itemId, prodId) {
|
||||
var newQuantity = parseInt(input.value);
|
||||
// updateQuantityCart(orderId, itemId, newQuantity);
|
||||
fetch(`https://api.obanana.shop/api/v1/products/${prodId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/${prodId}`, {
|
||||
method: 'GET'
|
||||
|
||||
})
|
||||
|
@ -301,7 +301,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
|
||||
function qtyIncrementCart(orderId, itemId, isFloat, prodId) {
|
||||
fetch(`https://api.obanana.shop/api/v1/products/${prodId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/${prodId}`, {
|
||||
method: 'GET'
|
||||
|
||||
})
|
||||
|
@ -352,7 +352,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
function qtyDecrementCart(orderId, itemId, isFloat, prodId) {
|
||||
console.log('decrementing')
|
||||
|
||||
fetch(`https://api.obanana.shop/api/v1/products/${prodId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/${prodId}`, {
|
||||
method: 'GET'
|
||||
|
||||
})
|
||||
|
@ -408,7 +408,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
function updateQuantityCart(orderId, itemId, newQuantity, isFloat) {
|
||||
console.log(isFloat)
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}/items/${itemId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}/items/${itemId}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -441,7 +441,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
function updateFloatTotalAmountCart(orderId) {
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
console.log("This is the OrderData: " + JSON.stringify(orderData, null, 2));
|
||||
|
@ -457,7 +457,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
// Perform the PATCH request to update the total amount in the API
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -487,7 +487,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
function updateTotalAmountCart(orderId) {
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
if (orderData && orderData !== "") {
|
||||
|
@ -504,7 +504,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
// Perform the PATCH request to update the total amount in the API
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -534,7 +534,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
function getLatestOrdersCart() {
|
||||
var customerId = '<?php echo $customer['_id'] ?>'
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/customer/${customerId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/customer/${customerId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
if (orderData && orderData !== "") {
|
||||
|
@ -563,7 +563,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
function deleteOrderCart(orderId) {
|
||||
console.log('delete')
|
||||
fetch('https://api.obanana.shop/api/v1/orders/' + orderId, {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/' + orderId, {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => response.json())
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -1090,7 +1090,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
<!-- raymart added js link feb 14 2024 -->
|
||||
<script src="assets/js/tester3.js"></script>
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester3.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -1,37 +1,9 @@
|
|||
<?php
|
||||
session_start();
|
||||
echo "user_type : ".$_SESSION['user_type']."<br>";
|
||||
echo "email : ".$_SESSION["email"]."<br>";
|
||||
echo "password : ".$_SESSION["password"]."<br>";
|
||||
echo "firstname : ".$_SESSION["firstname"]."<br>";
|
||||
echo "lastname : ".$_SESSION["lastname"]."<br>";
|
||||
echo "company : ".$_SESSION["company"]."<br>";
|
||||
echo "phone : ".$_SESSION["phone"]."<br>";
|
||||
if($_SESSION["isCustomer"]){
|
||||
echo "isCustomer : true<br>";
|
||||
} else {
|
||||
echo "isCustomer : false<br>";
|
||||
}
|
||||
echo "customerId : ".$_SESSION["customerId"]."<br>";
|
||||
if($_SESSION["isVendor"]){
|
||||
echo "isVendor : true<br>";
|
||||
} else {
|
||||
echo "isVendor : false<br>";
|
||||
}
|
||||
echo "vendorId : ".$_SESSION["vendorId"]."<br>";
|
||||
echo "otp : ".$_SESSION["otp"]."<br>";
|
||||
echo "token : ".$_SESSION["token"]."<br>";
|
||||
echo "userId : ".$_SESSION["userId"]."<br>";
|
||||
if($_SESSION["isLoggedIn"]){
|
||||
echo "isLoggedIn : true<br>";
|
||||
} else {
|
||||
echo "isLoggedIn : false<br>";
|
||||
}
|
||||
echo "url : ".$_SESSION["url"]."<br>";
|
||||
echo "cartitems : ".count($_SESSION["cart_items"])."<br>";
|
||||
echo "productId : ".$_SESSION["productId"]."<br>";
|
||||
if (isset($_SESSION["LoggedInVendorId"])) {
|
||||
echo "LoggedInVendorId: " . $_SESSION["LoggedInVendorId"] . "<br>";
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
include "functions.php";
|
||||
if($_SESSION["is_test"]==true){
|
||||
echo '<pre>';
|
||||
var_dump($_SESSION);
|
||||
echo '</pre>';
|
||||
}else{
|
||||
echo "<h1>Alert! This only works in test mode.</h1>";
|
||||
}
|
||||
|
|
10
checkout.php
10
checkout.php
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -489,7 +489,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
$('#submitBtn').on('click', function() {
|
||||
// Retrieve existing addresses from the API
|
||||
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
|
||||
fetch('https://api.obanana.shop/api/v1/customers/' + customerId)
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
|
@ -524,7 +524,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
existingAddresses.push(newAddress);
|
||||
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://api.obanana.shop/api/v1/customers/' + customerId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -892,7 +892,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
ordersToUpdate.forEach(async (orderId) => {
|
||||
// console.log(orderId)
|
||||
|
||||
const patchResponse = await fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
const patchResponse = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({
|
||||
// shipping_address:{
|
||||
|
@ -947,7 +947,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
ordersToUpdate.forEach(async (orderId) => {
|
||||
// console.log(orderId)
|
||||
|
||||
const patchResponse = await fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
const patchResponse = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({
|
||||
shipping_address: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -490,7 +490,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
$('#submitBtn').on('click', function() {
|
||||
// Retrieve existing addresses from the API
|
||||
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
|
||||
fetch('https://api.obanana.shop/api/v1/customers/' + customerId)
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
|
@ -525,7 +525,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
existingAddresses.push(newAddress);
|
||||
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://api.obanana.shop/api/v1/customers/' + customerId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -937,7 +937,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
console.log(orderId)
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
const shippingfee = parseFloat(orderId.shipping_fee)
|
||||
const patchResponse = await fetch(`https://api.obanana.shop/api/v1/orders/${orderId._id}`, {
|
||||
const patchResponse = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId._id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({
|
||||
shipping_address: {
|
||||
|
@ -1020,7 +1020,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
console.log(orderId)
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
const shippingfee = parseFloat(orderId.shipping_fee)
|
||||
const patchResponse = await fetch(`https://api.obanana.shop/api/v1/orders/${orderId._id}`, {
|
||||
const patchResponse = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId._id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({
|
||||
shipping_address: {
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
|
||||
$fName = $_POST['firstname'];
|
||||
$lName = $_POST['lastname'];
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phonenumber'];
|
||||
$message = $_POST['message'];
|
||||
|
||||
$response = sendEmail(
|
||||
$fName,
|
||||
$lName,
|
||||
$email,
|
||||
$phone,
|
||||
$message,
|
||||
);
|
||||
$array = json_decode($response,true);
|
||||
var_dump($array);
|
||||
header("location: contact-us.php");
|
||||
|
||||
|
||||
# 02-15-2024 Stacy added message sent
|
||||
$result = customerExists($_SESSION["email"]);
|
||||
|
||||
if ($result > 0) {
|
||||
$_SESSION["SuccessfullySent"] = "Message Sent Successfully";
|
||||
header("location: contact-us.php");
|
||||
}
|
||||
# 02-15-2024 Stacy added message sent
|
|
@ -0,0 +1,528 @@
|
|||
<!-- 02-14-2024 Stacy created this file and added contact-us-action.php -->
|
||||
<?php session_start()?>
|
||||
|
||||
<!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="contact_us_page">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php"?>
|
||||
<!-- Header End -->
|
||||
|
||||
<!-- 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">Contact 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">Contact Us</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec breadcrumb end -->
|
||||
|
||||
<!-- Ec Contact Us page -->
|
||||
<section class="ec-page-content section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="ec-common-wrapper">
|
||||
<div class="ec-contact-leftside">
|
||||
<div class="ec-contact-container">
|
||||
<div class="ec-contact-form">
|
||||
<!-- 02-15-2024 Stacy added SuccessfullySent -->
|
||||
<?php
|
||||
if (isset($_SESSION["SuccessfullySent"])) {
|
||||
echo '<div class="alert alert-success" id="alertSuccess" role="alert">';
|
||||
echo $_SESSION["SuccessfullySent"];
|
||||
echo '</div>';
|
||||
unset($_SESSION["SuccessfullySent"]);
|
||||
echo " <script>
|
||||
setTimeout(function() {
|
||||
document.getElementById('alertSuccess').style.display = 'none';
|
||||
}, 5000);
|
||||
</script>";
|
||||
}
|
||||
?>
|
||||
<!-- 02-15-2024 Stacy added SuccessfullySent -->
|
||||
|
||||
<form action="contact-us-action.php" method="post">
|
||||
<span class="ec-contact-wrap">
|
||||
<label>First Name*</label>
|
||||
<!-- <input type="text" name="firstname" placeholder="Enter your first name"
|
||||
required /> -->
|
||||
<!-- 02-15-2024 Stacy removed required -->
|
||||
<input type="text" name="firstname" placeholder="Enter your first name"/>
|
||||
<!-- 02-15-2024 Stacy removed required -->
|
||||
</span>
|
||||
<span class="ec-contact-wrap">
|
||||
<!-- -->
|
||||
<label>Last Name*</label>
|
||||
<!-- <input type="text" name="lastname" placeholder="Enter your last name"
|
||||
required /> -->
|
||||
<!-- 02-15-2024 Stacy removed required -->
|
||||
<input type="text" name="lastname" placeholder="Enter your last name"/>
|
||||
<!-- 02-15-2024 Stacy removed required -->
|
||||
</span>
|
||||
<span class="ec-contact-wrap">
|
||||
<label>Email*</label>
|
||||
<input type="email" name="email" placeholder="Enter your email address"
|
||||
required />
|
||||
</span>
|
||||
<span class="ec-contact-wrap">
|
||||
<label>Phone Number*</label>
|
||||
<!-- <input type="text" name="phonenumber" placeholder="Enter your phone number"
|
||||
required /> -->
|
||||
<!-- 02-15-2024 Stacy removed required -->
|
||||
<input type="text" name="phonenumber" placeholder="Enter your phone number"/>
|
||||
<!-- 02-15-2024 Stacy removed required -->
|
||||
</span>
|
||||
<span class="ec-contact-wrap">
|
||||
<label>Comments/Questions*</label>
|
||||
<textarea name="message"
|
||||
placeholder="Please leave your comments here.." required ></textarea>
|
||||
</span>
|
||||
<span class="ec-contact-wrap ec-recaptcha">
|
||||
<span class="g-recaptcha"
|
||||
data-sitekey="6LfKURIUAAAAAO50vlwWZkyK_G2ywqE52NU7YO0S"
|
||||
data-callback="verifyRecaptchaCallback"
|
||||
data-expired-callback="expiredRecaptchaCallback"></span>
|
||||
<!-- <input class="form-control d-none" data-recaptcha="true" required
|
||||
data-error="Please complete the Captcha"> -->
|
||||
<span class="help-block with-errors"></span>
|
||||
</span>
|
||||
<span class="ec-contact-wrap ec-contact-btn">
|
||||
<button class="btn btn-primary" type="submit">Submit</button>
|
||||
</span>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-contact-rightside">
|
||||
<div class="ec_contact_map">
|
||||
<div class="ec_map_canvas">
|
||||
<iframe id="ec_map_canvas"
|
||||
src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d15446.255178112197!2d121.0115448!3d14.5669195!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3397c9e950b65bb7%3A0x202999e3d77ee94d!2sObanana!5e0!3m2!1sen!2sph!4v1707965526114!5m2!1sen!2sph"></iframe>
|
||||
<a href="https://sites.google.com/view/maps-api-v2/mapv2"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec_contact_info">
|
||||
<h1 class="ec_contact_info_head">Contact us</h1>
|
||||
<ul class="align-items-center">
|
||||
<li class="ec-contact-item"><i class="ecicon eci-map-marker"
|
||||
aria-hidden="true"></i><span>Address :</span>16th flr PMI Tower Cabanillas Corner,
|
||||
273 Pablo Ocampo Sr. Ext, Makati, 1203 Metro Manila</li>
|
||||
<li class="ec-contact-item align-items-center"><i class="ecicon eci-phone"
|
||||
aria-hidden="true"></i><span>Call Us :</span><a href="tel:+63(2)8807-6379">+63 (2) 8807-6379</a></li>
|
||||
<li class="ec-contact-item align-items-center"><i class="ecicon eci-envelope"
|
||||
aria-hidden="true"></i><span>Email :</span><a
|
||||
href="mailto:example@ec-email.com">sales@obanana.com</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
|
||||
|
||||
<!-- 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>
|
|
@ -35,7 +35,10 @@
|
|||
<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="track-order.html">Delivery Information</a></li> -->
|
||||
<li class="ec-footer-link"><a href="contact-us.html">Contact us</a></li>
|
||||
<!-- <li class="ec-footer-link"><a href="contact-us.html">Contact us</a></li> -->
|
||||
<!-- 02-16-2024 Stacy changed contact us link-->
|
||||
<li class="ec-footer-link"><a href="contact-us.php">Contact us</a></li>
|
||||
<!-- 02-16-2024 Stacy changed contact us link-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
@ -181,7 +181,7 @@ var pass2I = document.getElementById(`passInput2`);
|
|||
var email = '<?php echo $_SESSION["email"] ?>'
|
||||
if (otp && pass && pass2) {
|
||||
if (pass === pass2) {
|
||||
fetch(`https://api.obanana.shop/api/v1/change-password`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/change-password`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$otp = md5($_POST["otp"]);
|
||||
if($otp==$_SESSION["otp"]){
|
||||
header("location: forget_password_reset.php");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
// include "functions.php";
|
||||
// session_start();
|
||||
//
|
||||
|
||||
// $_SESSION["email"] = $_POST["name"];
|
||||
// $result = sendOTP($_SESSION["email"]);
|
||||
|
@ -17,7 +17,7 @@
|
|||
// }
|
||||
// header("location: forget_otp.php");
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
|
||||
$_SESSION["email"] = $_POST["name"];
|
||||
|
||||
|
|
397
functions.php
397
functions.php
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
session_start();
|
||||
include "admin/config.php";
|
||||
|
||||
function simpleProducts($category)
|
||||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -27,10 +28,42 @@ function simpleProducts($category)
|
|||
return $products;
|
||||
}
|
||||
|
||||
// 02-19-2024 Jun Jihad Same Day Filter Function
|
||||
function sddProducts()
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products";
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/6527b593f79b5deac5ad6cb8',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'GET',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'X-Api-Key: {{apiKey}}'
|
||||
),
|
||||
));
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
$json = json_decode($response, true);
|
||||
$products = array_filter($json, function ($var) {
|
||||
return ($var['promo'][0]['next-day-delivery'] === "Yes" && $var['product_type'] == '' || $var['promo'][0]['next-day-delivery'] === "Yes" && $var['product_type'] == 'simple' || $var['promo'][0]['next-day-delivery'] === "Yes" && $var['product_type'] == 'variable' );
|
||||
});
|
||||
$products = array_values($products);
|
||||
return $products;
|
||||
return $json; // Add this line to return the decoded JSON data
|
||||
}
|
||||
// 02-19-2024 Jun Jihad Same Day Filter Function
|
||||
|
||||
|
||||
// function searchProducts($query)
|
||||
// {
|
||||
// $query = str_replace(" ", "+", $query);
|
||||
// $url = "https://api.obanana.shop/api/v1/products/search?q=$query";
|
||||
// $url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=$query";
|
||||
// $curl = curl_init();
|
||||
// curl_setopt($curl, CURLOPT_URL, $url);
|
||||
// curl_setopt_array($curl, array(
|
||||
|
@ -57,7 +90,7 @@ function simpleProducts($category)
|
|||
function searchProducts($query)
|
||||
{
|
||||
$query = str_replace(" ", "+", $query);
|
||||
$url = "https://api.obanana.shop/api/v1/products/search?q=$query";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=$query";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -108,11 +141,11 @@ $result = searchProducts($query);
|
|||
// function searchProducts($query)
|
||||
// {
|
||||
// $query = str_replace(" ", "+", $query);
|
||||
// $url = "https://api.obanana.shop/api/v1/products/search?q=$query";
|
||||
// $url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=$query";
|
||||
// $curl = curl_init();
|
||||
// curl_setopt($curl, CURLOPT_URL, $url);
|
||||
// curl_setopt_array($curl, array(
|
||||
// //CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=phone',
|
||||
// //CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=phone',
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -133,7 +166,7 @@ $result = searchProducts($query);
|
|||
|
||||
function getProduct($product)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/products/$product";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/$product";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -157,7 +190,7 @@ function productList()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -179,10 +212,10 @@ function productList()
|
|||
function productListVendor($vendorId)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = 'https://api.obanana.shop/api/v1/products/vendor/' . $vendorId;
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/" . $vendorId;
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/vendor/6527b593f79b5deac5ad6cb8',
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/6527b593f79b5deac5ad6cb8',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -209,7 +242,7 @@ function getProductVariations($parent_id)
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -245,7 +278,7 @@ function register($username, $password)
|
|||
$json = json_encode($array);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/register',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/register",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -273,7 +306,7 @@ function login($username, $password)
|
|||
$json = json_encode($array);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/login',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/login",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -293,6 +326,9 @@ function login($username, $password)
|
|||
}
|
||||
function forgot_password($email)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$curl = curl_init();
|
||||
$array = array(
|
||||
"username" => $email
|
||||
|
@ -300,7 +336,7 @@ function forgot_password($email)
|
|||
$json = json_encode($array);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/forgot-password',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/forgot-password",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -320,7 +356,7 @@ function forgot_password($email)
|
|||
function getCustomerbyLoginId($id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://api.obanana.shop/api/v1/customers/login_id/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/login_id/$id";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -344,7 +380,7 @@ function getCustomerbyLoginId($id)
|
|||
function getCustomer($id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://api.obanana.shop/api/v1/customers/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/$id";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -368,7 +404,7 @@ function getCustomer($id)
|
|||
function getVendorbyLoginId($id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://api.obanana.shop/api/v1/vendors/login_id/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/login_id/$id";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -392,7 +428,7 @@ function getVendorbyLoginId($id)
|
|||
function customerExists($email)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://api.obanana.shop/api/v1/customers/search?q=$email";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/search?q=$email";
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -420,7 +456,7 @@ function customerExists($email)
|
|||
function vendorExists($email)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://api.obanana.shop/api/v1/vendors/search?q=$email";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/search?q=$email";
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -446,9 +482,250 @@ function vendorExists($email)
|
|||
return $count;
|
||||
}
|
||||
|
||||
function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$msgto_obanana = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
<li style='list-style:none; font-size:13px'><b>Name: </b>$fName $lName</li>
|
||||
<li style='list-style:none; font-size:13px'><b>Email: </b>$email</li>
|
||||
<li style='list-style:none; font-size:13px'><b>Phone: </b>$phone</li>
|
||||
<br>
|
||||
<li style='list-style:none; font-size:13px'><b>Message: </b>$message</li>
|
||||
</ul>";
|
||||
$data = [
|
||||
"Messages" => [
|
||||
[
|
||||
"From" => [
|
||||
"Email" => "webdev@obanana.com",
|
||||
"Name" => "Obanana B2B"
|
||||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $testEmail,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
"Subject" => "Obanana Contact Us Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $msgto_obanana
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$json = json_encode($data);
|
||||
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://api.mailjet.com/v3.1/send",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Basic ODA4MDc4ZThjMDA4NjVhYzU4MTcyNDJjNTMxY2JlZGU6MGQ4ODg3ZTdiZjY1ZWNkMmQ0NzdiOWJhZGIyYTJhY2Q='
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sendEmail_customer($fName, $lName, $email)
|
||||
{
|
||||
// if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
// $testEmail = $_SESSION["test_email_rcpt"];
|
||||
// }
|
||||
$msgto_customer = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
<li style='list-style:none; font-size:13px'>Hi! <b>$fName $lName</b></li>
|
||||
<br>
|
||||
<li style='list-style:none; font-size:13px'>Thank you for contacting us.</li>
|
||||
<li style='list-style:none; font-size:13px'>We will get back to you soon.</li>
|
||||
</ul>";
|
||||
$data = [
|
||||
"Messages" => [
|
||||
[
|
||||
"From" => [
|
||||
"Email" => "webdev@obanana.com",
|
||||
"Name" => "Obanana B2B"
|
||||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $email,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
"Subject" => "Obanana Contact Us Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $msgto_customer
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$json = json_encode($data);
|
||||
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://api.mailjet.com/v3.1/send",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Basic ODA4MDc4ZThjMDA4NjVhYzU4MTcyNDJjNTMxY2JlZGU6MGQ4ODg3ZTdiZjY1ZWNkMmQ0NzdiOWJhZGIyYTJhY2Q='
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$msgto_seller = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
<li style='list-style:none; font-size:13px'><b>Email: </b>$cstm_email</li>
|
||||
<li style='list-style:none; font-size:13px'><b>Product Name: </b>$prd_name</li>
|
||||
<li style='list-style:none; font-size:13px'><b>Product Quantity: </b>$prd_qnty</li>
|
||||
<br>
|
||||
<li style='list-style:none; font-size:13px'><b>Message: </b>$message</li>
|
||||
</ul>";
|
||||
$data = [
|
||||
"Messages" => [
|
||||
[
|
||||
"From" => [
|
||||
"Email" => "webdev@obanana.com",
|
||||
"Name" => "Obanana B2B"
|
||||
],
|
||||
"To" => [
|
||||
[
|
||||
"Email" => $testEmail,
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
"Subject" => "Obanana Contact Us Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $msgto_seller
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$json = json_encode($data);
|
||||
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://api.mailjet.com/v3.1/send",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Basic ODA4MDc4ZThjMDA4NjVhYzU4MTcyNDJjNTMxY2JlZGU6MGQ4ODg3ZTdiZjY1ZWNkMmQ0NzdiOWJhZGIyYTJhY2Q='
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
function contact_Inquirer($cstm_email)
|
||||
{
|
||||
// if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
// $testEmail = $_SESSION["test_email_rcpt"];
|
||||
// }
|
||||
$msgto_inquirer = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
<li style='list-style:none; font-size:13px'>Hi!</b></li>
|
||||
<br>
|
||||
<li style='list-style:none; font-size:13px'>Thank you for contacting us.</li>
|
||||
<li style='list-style:none; font-size:13px'>We will get back to you soon.</li>
|
||||
</ul>";
|
||||
$data = [
|
||||
"Messages" => [
|
||||
[
|
||||
"From" => [
|
||||
"Email" => "webdev@obanana.com",
|
||||
"Name" => "Obanana B2B"
|
||||
],
|
||||
"To" => [
|
||||
[
|
||||
// "Email" => $cstm_email,
|
||||
"Email" => "stacyjoycemapano@gmail.com",
|
||||
|
||||
"Name" => "Subscriber"
|
||||
]
|
||||
],
|
||||
"Subject" => "Obanana Contact Us Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $msgto_inquirer
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$json = json_encode($data);
|
||||
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://api.mailjet.com/v3.1/send",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Basic ODA4MDc4ZThjMDA4NjVhYzU4MTcyNDJjNTMxY2JlZGU6MGQ4ODg3ZTdiZjY1ZWNkMmQ0NzdiOWJhZGIyYTJhY2Q='
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
function sendOTP($email)
|
||||
{
|
||||
$email2 = "junjihadbarroga@gmail.com";
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$curl = curl_init();
|
||||
$otp = generateOTP(6);
|
||||
$json = '{
|
||||
|
@ -460,7 +737,7 @@ function sendOTP($email)
|
|||
},
|
||||
"To": [
|
||||
{
|
||||
"Email": "' . $email2 . '",
|
||||
"Email": "' . $email . '",
|
||||
"Name": "Subscriber"
|
||||
}
|
||||
],
|
||||
|
@ -472,7 +749,7 @@ function sendOTP($email)
|
|||
}';
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.mailjet.com/v3.1/send',
|
||||
CURLOPT_URL => "https://api.mailjet.com/v3.1/send",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -522,7 +799,7 @@ function createCustomer($email, $phone, $firstname, $lastname, $loginId, $token)
|
|||
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/customers',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/customers",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -541,7 +818,7 @@ function createCustomer($email, $phone, $firstname, $lastname, $loginId, $token)
|
|||
|
||||
function updateCustomer($customerId, $phone, $firstname, $lastname, $loginId, $token)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/customers/$customerId";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/$customerId";
|
||||
$array = '{
|
||||
"last_name": "' . $lastname . '",
|
||||
"login_id": "' . $loginId . '",
|
||||
|
@ -578,7 +855,7 @@ function profile($token)
|
|||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/profile',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/profile",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -604,7 +881,7 @@ function profile($token)
|
|||
// );
|
||||
// curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
// curl_setopt_array($curl, array(
|
||||
// CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
// CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/vendors',
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -624,7 +901,7 @@ function profile($token)
|
|||
|
||||
// function updateVendor($vendorId, $phone, $company, $loginId, $token)
|
||||
// {
|
||||
// $url = "https://api.obanana.shop/api/v1/vendors/$vendorId";
|
||||
// $url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/$vendorId";
|
||||
// $array = '{
|
||||
// "login_id": "' . $loginId . '",
|
||||
// "first_name": "' . $company . '",
|
||||
|
@ -653,7 +930,7 @@ function profile($token)
|
|||
// }
|
||||
function updateVendor($vendorId, $phone, $userlogin, $firstname, $lastname, $loginId, $token)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/vendors/$vendorId";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/$vendorId";
|
||||
$array = '{
|
||||
"login_id": "' . $loginId . '",
|
||||
"user_login": "' . $userlogin . '",
|
||||
|
@ -696,7 +973,7 @@ function createVendor($email, $phone, $userlogin, $firstname, $lastname, $loginI
|
|||
);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -765,7 +1042,7 @@ function createVendor($email, $phone, $userlogin, $firstname, $lastname, $loginI
|
|||
|
||||
// curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
// curl_setopt_array($curl, array(
|
||||
// CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
// CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/vendors',
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -791,7 +1068,7 @@ function vendorList()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -814,7 +1091,7 @@ function simpleVendors()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -843,7 +1120,7 @@ function productListVendors($vendorIds)
|
|||
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products?vendor_ids=' . $vendorIdsString,
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products?vendor_ids=" . $vendorIdsString,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -866,7 +1143,7 @@ function simpleVendorsWithProducts()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -929,11 +1206,11 @@ function simpleVendorsWithProducts()
|
|||
|
||||
function getVendorbyId($id)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/vendors/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=phone',
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=phone',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -953,7 +1230,7 @@ function getVendorbyId($id)
|
|||
function searchVendorByLoginId($id)
|
||||
{
|
||||
$id = str_replace(" ", "+", $id);
|
||||
$url = "https://api.obanana.shop/api/v1/vendors/search?q=$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/search?q=$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -975,7 +1252,7 @@ function searchVendorByLoginId($id)
|
|||
|
||||
function getOrder($order)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/orders/$order";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/$order";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -999,7 +1276,7 @@ function getAllOrder()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/orders',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1027,11 +1304,11 @@ function getAllOrder()
|
|||
|
||||
function getOrderbyCustomerId($id)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/orders/customer/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/customer/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=phone',
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=phone',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1049,11 +1326,11 @@ function getOrderbyCustomerId($id)
|
|||
}
|
||||
function getOrderbyVendorId($id)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/orders/vendor/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/vendor/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=phone',
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=phone',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1083,7 +1360,7 @@ function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $co
|
|||
}
|
||||
$params3 = json_encode($data);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/orders/' . $orderId,
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders/" . $orderId,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1115,7 +1392,7 @@ function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $co
|
|||
// $curl = curl_init();
|
||||
// curl_setopt($curl,CURLOPT_POSTFIELDS,$array);
|
||||
// curl_setopt_array($curl, array(
|
||||
// CURLOPT_URL => 'https://api.obanana.shop/api/v1/orders',
|
||||
// CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/orders',
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1134,11 +1411,11 @@ function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $co
|
|||
|
||||
function deleteOrderbyId($id)
|
||||
{
|
||||
$url = "https://api.obanana.shop/api/v1/orders/$id";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/search?q=phone',
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=phone',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1188,7 +1465,7 @@ function addProduct(
|
|||
);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1212,6 +1489,9 @@ function editProduct(
|
|||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$ndd,
|
||||
$sdd,
|
||||
$freeSf,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
|
@ -1248,6 +1528,11 @@ function editProduct(
|
|||
'product_category' => $productCategory,
|
||||
'shipping_fee' => $productSf,
|
||||
'status' => $productStatus,
|
||||
'promo' => array(
|
||||
'next-day-delivery' => $ndd ,
|
||||
'same-day-delivery' => $sdd ,
|
||||
'free-shipping' => $freeSf
|
||||
),
|
||||
'parent_id' => $parentId,
|
||||
'minimum_order' => $minimumOrder,
|
||||
// 'variants' => array(
|
||||
|
@ -1266,11 +1551,11 @@ function editProduct(
|
|||
}
|
||||
|
||||
// $params3 = json_encode($data);
|
||||
// $url = 'https://api.obanana.shop/api/v1/products/'.$productId;
|
||||
// $url = 'https://".$_SESSION["data_endpoint"]."/api/v1/products/'.$productId;
|
||||
// curl_setopt($curl,CURLOPT_URL,$url);
|
||||
// curl_setopt($curl, CURLOPT_POSTFIELDS, $params3);
|
||||
// curl_setopt_array($curl, array(
|
||||
// //CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/656712969624f6181c49cdd0',
|
||||
// //CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/656712969624f6181c49cdd0',
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1286,7 +1571,7 @@ function editProduct(
|
|||
$params3 = json_encode($data);
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/' . $productId,
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products/" . $productId,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1331,7 +1616,7 @@ function editProduct(
|
|||
// );
|
||||
// curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
// curl_setopt_array($curl, array(
|
||||
// CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
// CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/vendors',
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1389,7 +1674,7 @@ function addVendor(
|
|||
$params2 = json_encode($data);
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/vendors',
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1414,7 +1699,7 @@ function addVendor(
|
|||
function getUsers()
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://api.obanana.shop/api/v1/users";
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/users";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -1449,7 +1734,7 @@ function getUsers()
|
|||
// );
|
||||
// curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
// curl_setopt_array($curl, array(
|
||||
// CURLOPT_URL => 'https://api.obanana.shop/api/v1/users/' . $id,
|
||||
// CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/users/' . $id,
|
||||
// CURLOPT_RETURNTRANSFER => true,
|
||||
// CURLOPT_ENCODING => '',
|
||||
// CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1481,7 +1766,7 @@ function editUsers($id, $username, $userType, $token)
|
|||
$jsonPayload = json_encode($data); // Convert the array to JSON format
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => 'https://api.obanana.shop/api/v1/users/' . $id,
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/users/" . $id,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1502,4 +1787,4 @@ function editUsers($id, $username, $userType, $token)
|
|||
echo $response;
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
18
header.php
18
header.php
|
@ -411,7 +411,7 @@
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -488,7 +488,7 @@
|
|||
function updateQuantity(orderId, itemId, newQuantity, isFloat, token) {
|
||||
console.log(isFloat)
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}/items/${itemId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}/items/${itemId}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -521,7 +521,7 @@
|
|||
|
||||
function updateFloatTotalAmount(orderId, token) {
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
console.log("This is the OrderData: " + JSON.stringify(orderData, null, 2));
|
||||
|
@ -537,7 +537,7 @@
|
|||
|
||||
// Perform the PATCH request to update the total amount in the API
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -568,7 +568,7 @@
|
|||
|
||||
function updateTotalAmount(orderId, token) {
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
if (orderData && orderData !== "") {
|
||||
|
@ -583,7 +583,7 @@
|
|||
|
||||
// Perform the PATCH request to update the total amount in the API
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -614,7 +614,7 @@
|
|||
function getLatestOrders() {
|
||||
var customerId = '<?php echo $customer['_id'] ?>'
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/customer/${customerId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/customer/${customerId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
if (orderData && orderData !== "") {
|
||||
|
@ -635,7 +635,7 @@
|
|||
}
|
||||
|
||||
function deleteOrder(orderId) {
|
||||
fetch('https://api.obanana.shop/api/v1/orders/' + orderId, {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/' + orderId, {
|
||||
method: 'DELETE'
|
||||
})
|
||||
.then(response => response.json())
|
||||
|
@ -1151,7 +1151,7 @@
|
|||
<li><a href="javascript:void(0)">Pages</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a href="about-us.html">About Us</a></li>
|
||||
<li><a href="contact-us.html">Contact Us</a></li>
|
||||
<li><a href="contact-us.php">Contact Us</a></li>
|
||||
<li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="compare.html">Compare</a></li>
|
||||
|
|
12
index.php
12
index.php
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -95,7 +95,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="updateCartItemCount(); updateWishItemCount()">
|
||||
<body class="shop_page" onload="updateCartItemCount(); updateWishItemCount()">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
|
@ -2058,7 +2058,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script src="assets/js/main.js"></script>
|
||||
<!-- <script src="assets/js/texts2.js"></script> -->
|
||||
<!-- raymart added js feb 14, 2024-->
|
||||
<script src="assets/js/tester3.js"></script>
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester3.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$url = $_SESSION["url"];
|
||||
$_SESSION["email"] = $_POST["name"];
|
||||
$_SESSION["password"] = $_POST["password"];
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
$productId = $_GET['id'];
|
||||
$curl = curl_init();
|
||||
$url = 'https://api.obanana.shop/api/v1/products/'.$productId;
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/".$productId;
|
||||
curl_setopt($curl,CURLOPT_URL,$url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/656717579624f6181c49cdda',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -579,7 +579,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
var wishCustomerId = '<?php echo $customer_data[0]['_id'] ?>';
|
||||
var wishProductId = '<?php echo $product_details['_id']; ?>';
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/customers/' + wishCustomerId)
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + wishCustomerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const existingWishlist = data.favorites ?? {
|
||||
|
@ -599,7 +599,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
|
||||
existingWishlist.products.push(newFavorites.products[0]);
|
||||
|
||||
return fetch('https://api.obanana.shop/api/v1/customers/' + wishCustomerId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + wishCustomerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -639,7 +639,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -722,7 +722,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
// Check if the product is already in the order API
|
||||
var existingOrder;
|
||||
var orderCheckXhr = new XMLHttpRequest();
|
||||
orderCheckXhr.open("GET", "https://api.obanana.shop/api/v1/orders/customer/" + customerData.customer_id, true);
|
||||
orderCheckXhr.open("GET", "https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/customer/" + customerData.customer_id, true);
|
||||
orderCheckXhr.onreadystatechange = function() {
|
||||
if (orderCheckXhr.readyState === 4) {
|
||||
if (orderCheckXhr.status === 200) {
|
||||
|
@ -768,7 +768,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
|
||||
console.log("Request data:", requestData); // Debugging statement
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
xhr.open("POST", "https://api.obanana.shop/api/v1/orders", true);
|
||||
xhr.open("POST", "https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json", );
|
||||
xhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
xhr.onreadystatechange = function() {
|
||||
|
@ -823,7 +823,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
function getLatestOrders() {
|
||||
var customerId = '<?php echo $customer_data[0]['_id'] ?>'
|
||||
// Fetch the order data
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/customer/${customerId}`)
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/customer/${customerId}`)
|
||||
.then(response => response.json())
|
||||
.then(orderData => {
|
||||
if (orderData && orderData !== "") {
|
||||
|
@ -846,7 +846,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
function updateOrder(orderId, existingItemId) {
|
||||
var updateOrderXhr = new XMLHttpRequest();
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
updateOrderXhr.open("PUT", `https://api.obanana.shop/api/v1/orders/${orderId}/items/${existingItemId}`, true);
|
||||
updateOrderXhr.open("PUT", `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}/items/${existingItemId}`, true);
|
||||
updateOrderXhr.setRequestHeader("Content-Type", "application/json");
|
||||
updateOrderXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
updateOrderXhr.onreadystatechange = function() {
|
||||
|
@ -909,7 +909,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
updateOrderXhr.send(JSON.stringify(updateData));
|
||||
|
||||
var patchTotalAmountXhr = new XMLHttpRequest();
|
||||
patchTotalAmountXhr.open("PATCH", `https://api.obanana.shop/api/v1/orders/${orderId}`, true);
|
||||
patchTotalAmountXhr.open("PATCH", `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, true);
|
||||
patchTotalAmountXhr.setRequestHeader("Content-Type", "application/json");
|
||||
patchTotalAmountXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
$_SESSION["isCustomer"] = false;
|
||||
$_SESSION["isVendor"] = false;
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["email"] = $_POST["name"];
|
||||
$_SESSION["password"] = $_POST["password"];
|
||||
$result = sendOTP($_SESSION["email"]);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["firstname"] = $_POST["firstname"];
|
||||
$_SESSION["lastname"] = $_POST["lastname"];
|
||||
$_SESSION["phone"] = $_POST["phonenumber"];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$otp = md5($_POST["otp"]);
|
||||
if($otp==$_SESSION["otp"]){
|
||||
$result = register($_SESSION["email"],$_SESSION["password"]);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$vendors = getVendorbyId($_SESSION["vendorId"]);
|
||||
$vendorData = json_decode($vendors, true);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
// include "functions.php";
|
||||
// session_start();
|
||||
//
|
||||
// $_SESSION["company"] = $_POST["company"];
|
||||
// $_SESSION["firstname"] = $_POST["company"];
|
||||
// $_SESSION["phone"] = $_POST["phonenumber"];
|
||||
|
@ -13,7 +13,7 @@
|
|||
// }
|
||||
// header("location: /");
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["user_login"] = $_POST["user_login"];
|
||||
$_SESSION["firstname"] = $_POST["first_name"];
|
||||
$_SESSION["contactlast_name"] = $_POST["last_name"];
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -11,43 +11,63 @@ if ($_SESSION["userId"] <> "") {
|
|||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<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" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/nouislider.css" />
|
||||
|
||||
<!-- Main Style -->
|
||||
<link rel="stylesheet" href="assets/css/demo1.css" />
|
||||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<style>
|
||||
.ec-product-inner .ec-pro-image .ec-pro-actions .add-to-cart {
|
||||
width: 35px;
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
bottom: 36px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 0;
|
||||
border-radius: 10px 10px 0 0;
|
||||
}
|
||||
|
||||
<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">
|
||||
.ec-product-inner .ec-pro-image .ec-pro-actions .wishlist {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
bottom: 0;
|
||||
border-radius: 0 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
|
@ -66,9 +86,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body onload="updateCartItemCount(); updateWishItemCount()">
|
||||
<body class="shop_page" onload="updateCartItemCount(); updateWishItemCount()">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
|
@ -77,164 +97,564 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
|
||||
<?php include "header.php" ?>
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
|
||||
<!-- 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">Same Day Delivery</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">Same Day Delivery</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
|
||||
<!-- Page detail section -->
|
||||
<!-- Main Slider Start -->
|
||||
<div class="sticky-header-next-sec ec-main-slider section section-space-pb">
|
||||
<div class="ec-slider swiper-container main-slider-nav main-slider-dot">
|
||||
<!-- Main slider -->
|
||||
<div class="swiper-wrapper">
|
||||
<div class="ec-slide-item swiper-slide d-flex ec-slide-1">
|
||||
<img src="https://api.obanana.com/images/storage/web_images/1708068709103-0-02-06-f2fd3afbfa98cf9fcb81bce9df0691a06bb004b883d08ef2e80c4a3bdaf17f8f_1c6db9236e4582.jpg" alt="" width="1920">
|
||||
<div class="container align-self-center">
|
||||
<div class="row">
|
||||
<div class="col-xl-6 col-lg-7 col-md-7 col-sm-7 align-self-center">
|
||||
<div class="ec-slide-content slider-animation">
|
||||
<h1 class="ec-slide-title">Obanana Series 2 PowerBank Collection</h1>
|
||||
<h2 class="ec-slide-stitle">More that just a backup - a lifeline for your devices</h2>
|
||||
<p>A perfect blend of style and substance - stay in control of your day!</p>
|
||||
<a href="https://obanana.com/product-left-sidebar.php?id=6576c58dd1dba10ba2392765" class="btn btn-lg btn-secondary">Order Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-pagination swiper-pagination-white"></div>
|
||||
<div class="swiper-buttons">
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec breadcrumb end -->
|
||||
<section class="labels section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<img src="./assets/images/comingsoon.png" alt="">
|
||||
<!-- Main Slider End -->
|
||||
<section class="ec-bnr-detail margin-bottom-30 section-space-pt">
|
||||
<div class="ec-page-detail">
|
||||
<div class="container">
|
||||
<div class="ec-main-heading d-none">
|
||||
<h2>Shop <span>Detail</span></h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<div class="ec-cat-bnr">
|
||||
<a href="shop-left-sidebar-col-4.php"><span></span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<div class="ec-page-description">
|
||||
<h6>The Best deal on top brands</h6>
|
||||
<p class="m-0">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. It has survived not only five centuries, but also the
|
||||
leap into electronic typesetting, remaining essentially unchanged.
|
||||
<p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Start Offer section -->
|
||||
<!-- <section class="labels section-space-p">
|
||||
<!-- End detail section -->
|
||||
|
||||
<!-- Sart Shop -->
|
||||
<section class="ec-page-content-bnr section-space-pb">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<div class="section-title">
|
||||
<h2 class="ec-bg-title">Style 1</h2>
|
||||
<h2 class="ec-title">Style 1</h2>
|
||||
<p class="sub-title">Browse The Collection of Top Categories</p>
|
||||
<div class="ec-shop-rightside col-lg-12 col-md-12">
|
||||
<!-- Shop Top Start -->
|
||||
<div class="ec-pro-list-top d-flex">
|
||||
<div class="col-md-6 ec-grid-list">
|
||||
<div class="ec-gl-btn">
|
||||
<button class="btn sidebar-toggle-icon"><i class="fi-rr-filter"></i></button>
|
||||
<button class="btn btn-grid-50 active"><i class="fi-rr-apps"></i></button>
|
||||
<button class="btn btn-list-50"><i class="fi-rr-list"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 ec-sort-select">
|
||||
<span class="sort-by">Sort by</span>
|
||||
<div class="ec-select-inner">
|
||||
<select name="ec-select" id="ec-select">
|
||||
<option selected disabled>Position</option>
|
||||
<option value="1">Relevance</option>
|
||||
<option value="2">Name, A to Z</option>
|
||||
<option value="3">Name, Z to A</option>
|
||||
<option value="4">Price, low to high</option>
|
||||
<option value="5">Price, high to low</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Shop Top End -->
|
||||
|
||||
<!-- Shop content Start -->
|
||||
<!-- 02-19-2024 Jun Jihad Same Day Delivery page -->
|
||||
<div class="shop-pro-content">
|
||||
<div class="shop-pro-inner">
|
||||
<div class="row">
|
||||
<?php
|
||||
$simpleProducts = sddProducts();
|
||||
$productsPerPage = 8;
|
||||
$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$startIndex = ($currentPage - 1) * $productsPerPage;
|
||||
$endIndex = $startIndex + $productsPerPage - 1;
|
||||
$endIndex = min($endIndex, count($simpleProducts) - 1);
|
||||
for ($i = $startIndex; $i <= $endIndex; $i++) {
|
||||
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
$pid = $i;
|
||||
$vendorOfProduct = getVendorbyId($simpleProducts[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 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">
|
||||
<a href="shop-left-sidebar-col-4.php" class="image">
|
||||
<?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="ec-image-preview" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="ec-image-preview" src="assets/images/product-image/vender-upload-preview.jpg" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<!-- <img class="main-image" src="<?php echo $simpleProducts[$pid]["images"] ?>" alt="Product" /> -->
|
||||
<!-- <img class="hover-image" src="<?php echo $simpleProducts[$pid]["images"] ?>" 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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-pro-content">
|
||||
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $simpleProducts[$pid]["_id"]; ?>">
|
||||
<?php echo $simpleProducts[$pid]["product_name"] ?></a></h5>
|
||||
<!-- <div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star"></i>
|
||||
</div> -->
|
||||
<div class="ec-pro-list-desc"> <?php echo $simpleProducts[$pid]["specifications"] ?></div>
|
||||
<span class="ec-price">
|
||||
<?php if (isset($simpleProducts[$pid]["sale_price"]) && $simpleProducts[$pid]["sale_price"] > 0) : ?>
|
||||
<span class="old-price">₱<?php echo number_format($simpleProducts[$pid]["regular_price"], 2, ".", ",") ?></span>
|
||||
<span class="new-price">₱<?php echo number_format($simpleProducts[$pid]["sale_price"], 2, ".", ",") ?></span>
|
||||
<?php elseif (isset($simpleProducts[$pid]["regular_price"]) && $simpleProducts[$pid]["regular_price"] != "") : ?>
|
||||
<span class="new-price">₱<?php echo number_format($simpleProducts[$pid]["regular_price"], 2, ".", ",") ?></span>
|
||||
|
||||
<?php elseif ($simpleProducts[$pid]["regular_price"] == "" || $simpleProducts[$pid]["regular_price"] == null) : ?>
|
||||
<span class="inquire-text">Inquire</span>
|
||||
<?php else : ?>
|
||||
<span class="inquire-text">Inquire</span>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<!-- <div class="ec-pro-option">
|
||||
<div class="ec-pro-color">
|
||||
<span class="ec-pro-opt-label">Color</span>
|
||||
<ul class="ec-opt-swatch ec-change-img">
|
||||
<li class="active"><a href="#" class="ec-opt-clr-img"
|
||||
data-src="assets/images/product-image/8_2.jpg"
|
||||
data-src-hover="assets/images/product-image/8_2.jpg"
|
||||
data-tooltip="Gray"><span
|
||||
style="background-color:#e9dddd;"></span></a></li>
|
||||
<li><a href="#" class="ec-opt-clr-img"
|
||||
data-src="assets/images/product-image/8_3.jpg"
|
||||
data-src-hover="assets/images/product-image/8_3.jpg"
|
||||
data-tooltip="Orange"><span
|
||||
style="background-color:#ffd5cb;"></span></a></li>
|
||||
<li><a href="#" class="ec-opt-clr-img"
|
||||
data-src="assets/images/product-image/8_4.jpg"
|
||||
data-src-hover="assets/images/product-image/8_4.jpg"
|
||||
data-tooltip="Green"><span
|
||||
style="background-color:#92e4fd;"></span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
// }
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec Pagination Start -->
|
||||
<div class="ec-pro-pagination">
|
||||
<span>Showing <?php echo $startIndex + 1; ?>-<?php echo $endIndex + 1; ?> of <?php echo count($simpleProducts); ?> item(s)</span>
|
||||
<ul class="ec-pro-pagination-inner">
|
||||
|
||||
<?php
|
||||
$totalPages = ceil(count($simpleProducts) / $productsPerPage);
|
||||
$maxPaginationLinks = 5;
|
||||
$startPage = max(1, $currentPage - floor($maxPaginationLinks / 2));
|
||||
$endPage = min($startPage + $maxPaginationLinks - 1, $totalPages);
|
||||
if ($startPage > 1) {
|
||||
?>
|
||||
<li><a href="?page=1">1</a></li>
|
||||
<?php
|
||||
if ($startPage > 2) {
|
||||
?>
|
||||
<li><span>...</span></li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
for ($page = $startPage; $page <= $endPage; $page++) {
|
||||
$activeClass = ($page == $currentPage) ? 'active' : '';
|
||||
?>
|
||||
<li><a class="<?php echo $activeClass; ?>" href="?page=<?php echo $page; ?>"><?php echo $page; ?></a></li>
|
||||
<?php
|
||||
}
|
||||
if ($endPage < $totalPages) {
|
||||
if ($endPage < $totalPages - 1) {
|
||||
?>
|
||||
<li><span>...</span></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<li><a href="?page=<?php echo $totalPages; ?>"><?php echo $totalPages; ?></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 02-19-2024 Jun Jihad Same Day Delivery page -->
|
||||
<!-- Ec Pagination End -->
|
||||
</div>
|
||||
<!--Shop content End -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-12 margin-b-30">
|
||||
<div class="ec-offer-coupon">
|
||||
<div class="ec-cpn-brand">
|
||||
<img class="ec-brand-img" src="assets/images/offer-image/2.jpg" alt="" />
|
||||
<!-- Sidebar Area Start -->
|
||||
<div class="filter-sidebar-overlay"></div>
|
||||
<div class="ec-shop-leftside filter-sidebar">
|
||||
<div class="ec-sidebar-heading">
|
||||
<h1>Filter Products By</h1>
|
||||
<a class="filter-cls-btn" href="javascript:void(0)">×</a>
|
||||
</div>
|
||||
<div class="ec-sidebar-wrap">
|
||||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Category</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" checked /> <a href="#">clothes</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Bags</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Shoes</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">cosmetics</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">electrics</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">phone</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li id="ec-more-toggle-content" style="padding: 0; display: none;">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Watch</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Cap</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item ec-more-toggle">
|
||||
<span class="checked"></span><span id="ec-more-toggle">More
|
||||
Categories</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-cpn-title">
|
||||
<h2 class="coupon-title">Get 15% off on branded Shoes</h2>
|
||||
<!-- Sidebar Size Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Size</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" value="" checked /><a href="#">S</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" value="" /><a href="#">M</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" value="" /> <a href="#">L</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" value="" /><a href="#">XL</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" value="" /><a href="#">XXL</a><span
|
||||
class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-cpn-desc">
|
||||
<p class="coupon-text">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry has been.</p>
|
||||
<!-- Sidebar Color item -->
|
||||
<div class="ec-sidebar-block ec-sidebar-block-clr">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Color</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#c4d6f9;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#ff748b;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#000000;"></span></div>
|
||||
</li>
|
||||
<li class="active">
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#2bff4a;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#ff7c5e;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#f155ff;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#ffef00;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#c89fff;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#7bfffa;"></span></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item"><span
|
||||
style="background-color:#56ffc1;"></span></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-cpn-code">
|
||||
<a href="#" class="btn btn-secondary">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-12 margin-b-30">
|
||||
<div class="ec-offer-coupon">
|
||||
<div class="ec-cpn-brand">
|
||||
<img class="ec-brand-img" src="assets/images/offer-image/3.jpg" alt="" />
|
||||
</div>
|
||||
<div class="ec-cpn-title">
|
||||
<h2 class="coupon-title">Get 30% off on branded chair</h2>
|
||||
</div>
|
||||
<div class="ec-cpn-desc">
|
||||
<p class="coupon-text">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry has been.</p>
|
||||
</div>
|
||||
<div class="ec-cpn-code">
|
||||
<a href="#" class="btn btn-secondary">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-12 m-auto">
|
||||
<div class="ec-offer-coupon">
|
||||
<div class="ec-cpn-brand">
|
||||
<img class="ec-brand-img" src="assets/images/offer-image/4.jpg" alt="" />
|
||||
</div>
|
||||
<div class="ec-cpn-title">
|
||||
<h2 class="coupon-title">Get 50% off on branded Hand Bags</h2>
|
||||
</div>
|
||||
<div class="ec-cpn-desc">
|
||||
<p class="coupon-text">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry has been.</p>
|
||||
</div>
|
||||
<div class="ec-cpn-code">
|
||||
<a href="#" class="btn btn-secondary">Shop Now</a>
|
||||
<!-- Sidebar Price Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Price</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content es-price-slider">
|
||||
<div class="ec-price-filter">
|
||||
<div id="ec-sliderPrice" class="filter__slider-price" data-min="0" data-max="250"
|
||||
data-step="10"></div>
|
||||
<div class="ec-price-input">
|
||||
<label class="filter__label"><input type="text" class="filter__input"></label>
|
||||
<span class="ec-price-divider"></span>
|
||||
<label class="filter__label"><input type="text" class="filter__input"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
<!-- End Offer section -->
|
||||
</section>
|
||||
<!-- End Shop -->
|
||||
|
||||
<!-- Start Offer section -->
|
||||
<!-- <section class="labels 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">Style 2</h2>
|
||||
<h2 class="ec-title">Style 2</h2>
|
||||
<p class="sub-title">Browse The Collection of Top Categories</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-line-offer" style="background-image: url('assets/images/offer-image/offer-banner-06.jpg');">
|
||||
<div class="ec-line-offer-info">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h6>On Furniture</h6>
|
||||
<h2 class="offer-upto">Upto <span>45%</span> OFF</h2>
|
||||
<p class="offer-desc">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry. Lorem Ipsum has been the industry's.</p>
|
||||
<div class="offer-btn"><a class="btn-shop-now">SHOP NOW!</a></div>
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="ec_quickview_modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<button type="button" class="btn-close qty_close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-5 col-sm-12 col-xs-12">
|
||||
<!-- Swiper -->
|
||||
<div class="qty-product-cover">
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_1.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_2.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_3.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_4.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_5.jpg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="qty-nav-thumb">
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_1.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_2.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_3.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_4.jpg" alt="">
|
||||
</div>
|
||||
<div class="qty-slide">
|
||||
<img class="img-responsive" src="assets/images/product-image/3_5.jpg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7 col-sm-12 col-xs-12">
|
||||
<div class="quickview-pro-content">
|
||||
<h5 class="ec-quick-title"><a href="shop-left-sidebar-col-4.php">Handbag leather purse for
|
||||
women</a>
|
||||
</h5>
|
||||
<div class="ec-quickview-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star"></i>
|
||||
</div>
|
||||
|
||||
<div class="ec-quickview-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,</div>
|
||||
<div class="ec-quickview-price">
|
||||
<span class="old-price">$100.00</span>
|
||||
<span class="new-price">$80.00</span>
|
||||
</div>
|
||||
|
||||
<div class="ec-pro-variation">
|
||||
<div class="ec-pro-variation-inner ec-pro-variation-color">
|
||||
<span>Color</span>
|
||||
<div class="ec-pro-color">
|
||||
<ul class="ec-opt-swatch">
|
||||
<li><span style="background-color:#696d62;"></span></li>
|
||||
<li><span style="background-color:#d73808;"></span></li>
|
||||
<li><span style="background-color:#577023;"></span></li>
|
||||
<li><span style="background-color:#2ea1cd;"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-pro-variation-inner ec-pro-variation-size ec-pro-size">
|
||||
<span>Size</span>
|
||||
<div class="ec-pro-variation-content">
|
||||
<ul class="ec-opt-size">
|
||||
<li class="active"><a href="#" class="ec-opt-sz"
|
||||
data-tooltip="Small">S</a></li>
|
||||
<li><a href="#" class="ec-opt-sz" data-tooltip="Medium">M</a></li>
|
||||
<li><a href="#" class="ec-opt-sz" data-tooltip="Large">X</a></li>
|
||||
<li><a href="#" class="ec-opt-sz" data-tooltip="Extra Large">XL</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-quickview-qty">
|
||||
<div class="qty-plus-minus">
|
||||
<input class="qty-input" type="text" name="ec_qtybtn" value="1" />
|
||||
</div>
|
||||
<div class="ec-quickview-cart ">
|
||||
<button class="btn btn-primary"><i class="fi-rr-shopping-basket"></i>> Add To Cart</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
<!-- End Offer section -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
</div>
|
||||
<!-- Modal end -->
|
||||
|
||||
<!-- 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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
@ -246,7 +666,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>
|
||||
|
@ -254,7 +674,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 -->
|
||||
|
@ -281,11 +701,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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">
|
||||
<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">
|
||||
<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 -->
|
||||
|
@ -303,11 +725,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!--/ 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">
|
||||
<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">
|
||||
<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 -->
|
||||
|
@ -325,11 +749,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!--/ 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">
|
||||
<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">
|
||||
<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 -->
|
||||
|
@ -347,11 +773,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!--/ 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">
|
||||
<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">
|
||||
<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 -->
|
||||
|
@ -466,11 +894,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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>
|
||||
<script src="assets/js/plugins/nouislider.js"></script>
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester3.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,476 @@
|
|||
<?php
|
||||
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
}
|
||||
|
||||
?>
|
||||
<!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">
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
if (data != "") {
|
||||
console.log("Data: " + data + "\nStatus: " + status);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateWishItemCount() {
|
||||
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
|
||||
if (data != "") {
|
||||
document.getElementById("wishItemCount").innerHTML = data;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="updateCartItemCount(); updateWishItemCount()">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
<!-- 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">Same Day Delivery</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">Same Day Delivery</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec breadcrumb end -->
|
||||
<section class="labels section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<img src="./assets/images/comingsoon.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Start Offer section -->
|
||||
<!-- <section class="labels 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">Style 1</h2>
|
||||
<h2 class="ec-title">Style 1</h2>
|
||||
<p class="sub-title">Browse The Collection of Top Categories</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-12 margin-b-30">
|
||||
<div class="ec-offer-coupon">
|
||||
<div class="ec-cpn-brand">
|
||||
<img class="ec-brand-img" src="assets/images/offer-image/2.jpg" alt="" />
|
||||
</div>
|
||||
<div class="ec-cpn-title">
|
||||
<h2 class="coupon-title">Get 15% off on branded Shoes</h2>
|
||||
</div>
|
||||
<div class="ec-cpn-desc">
|
||||
<p class="coupon-text">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry has been.</p>
|
||||
</div>
|
||||
<div class="ec-cpn-code">
|
||||
<a href="#" class="btn btn-secondary">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-12 margin-b-30">
|
||||
<div class="ec-offer-coupon">
|
||||
<div class="ec-cpn-brand">
|
||||
<img class="ec-brand-img" src="assets/images/offer-image/3.jpg" alt="" />
|
||||
</div>
|
||||
<div class="ec-cpn-title">
|
||||
<h2 class="coupon-title">Get 30% off on branded chair</h2>
|
||||
</div>
|
||||
<div class="ec-cpn-desc">
|
||||
<p class="coupon-text">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry has been.</p>
|
||||
</div>
|
||||
<div class="ec-cpn-code">
|
||||
<a href="#" class="btn btn-secondary">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-6 col-sm-12 col-12 m-auto">
|
||||
<div class="ec-offer-coupon">
|
||||
<div class="ec-cpn-brand">
|
||||
<img class="ec-brand-img" src="assets/images/offer-image/4.jpg" alt="" />
|
||||
</div>
|
||||
<div class="ec-cpn-title">
|
||||
<h2 class="coupon-title">Get 50% off on branded Hand Bags</h2>
|
||||
</div>
|
||||
<div class="ec-cpn-desc">
|
||||
<p class="coupon-text">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry has been.</p>
|
||||
</div>
|
||||
<div class="ec-cpn-code">
|
||||
<a href="#" class="btn btn-secondary">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
<!-- End Offer section -->
|
||||
|
||||
<!-- Start Offer section -->
|
||||
<!-- <section class="labels 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">Style 2</h2>
|
||||
<h2 class="ec-title">Style 2</h2>
|
||||
<p class="sub-title">Browse The Collection of Top Categories</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-line-offer" style="background-image: url('assets/images/offer-image/offer-banner-06.jpg');">
|
||||
<div class="ec-line-offer-info">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h6>On Furniture</h6>
|
||||
<h2 class="offer-upto">Upto <span>45%</span> OFF</h2>
|
||||
<p class="offer-desc">Lorem Ipsum is simply dummy text of the printing and typesetting
|
||||
industry. Lorem Ipsum has been the industry's.</p>
|
||||
<div class="offer-btn"><a class="btn-shop-now">SHOP NOW!</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section> -->
|
||||
<!-- End Offer section -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
|
||||
<!-- 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>
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
// $result=searchProducts($_GET["searchText"]);
|
||||
// //echo $result;
|
||||
// $array = json_decode($result,true);
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
|
||||
// include "functions.php";
|
||||
// session_start();
|
||||
//
|
||||
// $searchText = $_GET["searchText"];
|
||||
// $result = searchProducts($searchText);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
// You can process the $data as needed, for example, store it in session
|
||||
session_start();
|
||||
|
||||
$_SESSION['selected_variation'] = $data;
|
||||
|
||||
var_dump($_SESSION['selected_variation']);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ( $_SESSION["userId"] <> "" ) {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -844,7 +844,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script src="assets/js/main.js"></script>
|
||||
<script src="assets/js/newjs.js"></script>
|
||||
<!-- raymart added js link feb 14 2024 -->
|
||||
<script src="assets/js/tester3.js"></script>
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester3.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$input = json_decode(file_get_contents('php://input'), true);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -408,7 +408,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -498,7 +498,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
console.log('FormData:', formData);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -528,12 +528,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
const payload = {
|
||||
return_order: {
|
||||
reason: reason,
|
||||
image: `https://api.obanana.shop/images/storage/order_uploads/${filename}`,
|
||||
image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/order_uploads/${filename}`,
|
||||
status: 'To Approve',
|
||||
}
|
||||
}
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch('https://api.obanana.shop/api/v1/orders/' + orderId, {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/' + orderId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -583,7 +583,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -660,7 +660,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
function updateCompletedStatus(orderId) {
|
||||
login(email, password, function(token) {
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -351,7 +351,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
const phone = document.getElementById('phone-').value;
|
||||
|
||||
// If no file selected, only update the email
|
||||
fetch(`https://api.obanana.shop/api/v1/customers/${customerId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/${customerId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -508,7 +508,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
$('#submitBtn').on('click', function() {
|
||||
// Retrieve existing addresses from the API
|
||||
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
|
||||
fetch('https://api.obanana.shop/api/v1/customers/' + customerId)
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
|
@ -543,7 +543,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
existingAddresses.push(newAddress);
|
||||
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://api.obanana.shop/api/v1/customers/' + customerId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -577,7 +577,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script>
|
||||
async function updateAddressBilling(customerId, addressIndex, isBilling) {
|
||||
try {
|
||||
const apiUrl = `https://api.obanana.shop/api/v1/customers/${customerId}`;
|
||||
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/${customerId}`;
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
@ -633,7 +633,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
async function updateAddressShipping(customerId, addressIndex, isShipping) {
|
||||
try {
|
||||
const apiUrl = `https://api.obanana.shop/api/v1/customers/${customerId}`;
|
||||
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/${customerId}`;
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
@ -763,7 +763,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
formData.append('category', 'customer');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -779,13 +779,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
customer_image: `https://api.obanana.shop/images/storage/customer_uploads/${filename}`,
|
||||
customer_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/customer_uploads/${filename}`,
|
||||
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
|
||||
return fetch('https://api.obanana.shop/api/v1/customers/' + customerId, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -171,7 +171,7 @@ $products = productList();
|
|||
if (isset($product['product_image']) && !empty($product['product_image'])) {
|
||||
echo '<img src="' . $product['product_image'] . '" alt="Product Image" class="prod-img" >';
|
||||
} else {
|
||||
echo '<img src="assets/img/vendor/u1.jpg" class="prod-img rounded-circle" alt="Placeholder Image" >';
|
||||
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>
|
||||
|
@ -221,7 +221,7 @@ $products = productList();
|
|||
}
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$orderId = $_SESSION['vendorOrderId'];
|
||||
$currentStatus = $_POST['order_status'];
|
||||
$trackingNumber = $_POST['tracking_number'];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -238,7 +238,7 @@ if (is_array($vendorOrderss)) {
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ( $_SESSION["userId"] <> "" ) {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -571,7 +571,7 @@ if (is_array($vendorOrderss)) {
|
|||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://api.obanana.shop/api/v1/login", {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -650,7 +650,7 @@ if (is_array($vendorOrderss)) {
|
|||
|
||||
function updateRefundShipStatus(orderId, image, reason) {
|
||||
login(email, password, function() {
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -685,7 +685,7 @@ if (is_array($vendorOrderss)) {
|
|||
|
||||
function updateRefundReceiveStatus(orderId, image, reason) {
|
||||
login(email, password, function() {
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
// $customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
|
@ -337,7 +337,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
const phone = document.getElementById('cphone-').value;
|
||||
|
||||
// If no file selected, only update the email
|
||||
fetch(`https://api.obanana.shop/api/v1/vendors/${vendorid}`, {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -492,7 +492,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
$('#submitBtn').on('click', function() {
|
||||
// Retrieve existing addresses from the API
|
||||
fetch('https://api.obanana.shop/api/v1/vendors/' + vendorid)
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Get the existing addresses array
|
||||
|
@ -527,7 +527,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
existingAddresses.push(newAddress);
|
||||
|
||||
// Make a PATCH request to update the addresses array
|
||||
return fetch('https://api.obanana.shop/api/v1/vendors/' + vendorid, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -560,7 +560,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script>
|
||||
async function updateAddressBilling(vendorid, addressIndex, isBilling) {
|
||||
try {
|
||||
const apiUrl = `https://api.obanana.shop/api/v1/vendors/${vendorid}`;
|
||||
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
@ -613,7 +613,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
async function updateAddressShipping(vendorid, addressIndex, isShipping) {
|
||||
try {
|
||||
const apiUrl = `https://api.obanana.shop/api/v1/vendors/${vendorid}`;
|
||||
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
@ -735,7 +735,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -751,13 +751,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_image: `https://api.obanana.shop/images/storage/vendor_uploads/${filename}`,
|
||||
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
|
||||
return fetch('https://api.obanana.shop/api/v1/vendors/' + vendorid, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -788,7 +788,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
formData.append('category', 'vendor');
|
||||
formData.append('image', file);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
|
@ -804,13 +804,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
vendor_banner: `https://api.obanana.shop/images/storage/vendor_uploads/${filename}`,
|
||||
vendor_banner: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
|
||||
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
|
||||
return fetch('https://api.obanana.shop/api/v1/vendors/' + vendorid, {
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$vendorId = $_SESSION['vendorId'];
|
||||
//echo '$vendorId: '.$vendorId.'<br>';
|
||||
$productName = $_POST['product_name'];
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$productId = $_SESSION['newProductId'];
|
||||
$vendorId = $_SESSION['vendorId'];
|
||||
//echo '$vendorId: '.$vendorId.'<br>';
|
||||
$productName = $_POST['product_name'];
|
||||
//echo '$productName: '.$productName.'<br>';
|
||||
$stock = $_POST['stock'];
|
||||
// 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page Action
|
||||
$ndd = isset($_POST['promo']['next-day-delivery']) ? $_POST['promo']['next-day-delivery'] : 'No';
|
||||
$sdd = isset($_POST['promo']['same-day-delivery']) ? $_POST['promo']['same-day-delivery'] : 'No';
|
||||
$freeSf = isset($_POST['promo']['free-shipping']) ? $_POST['promo']['free-shipping'] : 'No';
|
||||
// 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page Action
|
||||
$minimumOrder = $_POST['minimum_order'];
|
||||
//echo '$stock: '.$stock.'<br>';
|
||||
$price = $_POST['regular_price'];
|
||||
|
@ -41,6 +46,9 @@ $response = editProduct(
|
|||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$ndd,
|
||||
$sdd,
|
||||
$freeSf,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
session_start();
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -111,6 +111,7 @@ $array = json_decode($result, true);
|
|||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<!-- 2024-02-12 Stacy deleted div with class "ec-vendor-block-items", and inserted vendor-profile-tabs.php -->
|
||||
<div class="ec-vendor-block-items">
|
||||
<ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
|
@ -118,10 +119,13 @@ $array = json_decode($result, true);
|
|||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 2024-02-12 Stacy deleted div with class "ec-vendor-block-items", and inserted vendor-profile-tabs.php -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 02-15-2024 Jun Jihad Vendor Product Add and Edit page Multiple Image -->
|
||||
<div class="ec-shop-rightside col-lg-9 col-md-12">
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-card-body">
|
||||
|
@ -131,93 +135,109 @@ $array = json_decode($result, true);
|
|||
<div class="ec-vendor-main-img">
|
||||
<div class="avatar-upload">
|
||||
<div class="avatar-edit">
|
||||
<input type='file' id="imageUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" onchange="uploadProductImage()" />
|
||||
<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>
|
||||
</div>
|
||||
<div class="avatar-preview ec-preview">
|
||||
<div class="imagePreview ec-div-preview">
|
||||
<?php
|
||||
if (isset($array['product_image'])) {
|
||||
if (isset($array['images'])) {
|
||||
$image_urls = explode(',', $array['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="ec-image-preview" src="<?php echo $array['product_image']; ?>" alt="edit" />
|
||||
<?php
|
||||
<img class="ec-image-preview" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
?>
|
||||
<img class="ec-image-preview" src="assets/images/product-image/vender-upload-preview.jpg" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="thumb-upload-set colo-md-12">
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload01" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
<?php
|
||||
if (isset($array['images'])) {
|
||||
$image_urls = explode(',', $array['images']);
|
||||
foreach ($image_urls as $index => $image_url) {
|
||||
$image_url = trim($image_url);
|
||||
?>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload<?php echo $index + 1; ?>" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="thumbUpload<?php echo $index + 1; ?>"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="<?php echo $image_url; ?>" alt="edit" />
|
||||
<button class="delete-image-button" onclick="deleteImage('<?php echo $array['_id']; ?>', <?php echo $index; ?>)">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="thumbUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload02" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload03" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload04" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload05" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload06" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
function deleteImage(productId, indexToDelete) {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId)
|
||||
.then(response => response.json())
|
||||
.then(product => {
|
||||
let imagesArray = product.images.split(',');
|
||||
if (indexToDelete >= 0 && indexToDelete < imagesArray.length) {
|
||||
imagesArray.splice(indexToDelete, 1);
|
||||
}
|
||||
const updatedImages = imagesArray.join(',');
|
||||
const payload = {
|
||||
images: updatedImages,
|
||||
};
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Image deleted successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Image deletion failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during image deletion:', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -248,7 +268,6 @@ $array = json_decode($result, true);
|
|||
<div class="col-md-6">
|
||||
<label class="form-label">Parent Id</label>
|
||||
<select class="form-select" name="parent_id" id="variation-type-select">
|
||||
<!-- Your variation options go here -->
|
||||
<option value="" disabled selected>Select Product</option>
|
||||
<?php
|
||||
$products = productListVendor($vendorId);
|
||||
|
@ -333,6 +352,31 @@ $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>
|
||||
<!-- 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="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>
|
||||
</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>
|
||||
</div>
|
||||
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Stock</label>
|
||||
<input type="number" class="form-control" id="quantity1" name="stock" value="<?php echo $array['stock'] ?>">
|
||||
|
@ -346,31 +390,31 @@ $array = json_decode($result, true);
|
|||
<textarea class="form-control" rows="4" name="specifications"><?php echo $array['specifications'] ?></textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Category</label>
|
||||
<select class="form-select" name="product_category" id="product_category">
|
||||
<option value="">Select Category</option>
|
||||
<option value="Electronics" <?php echo ($array['product_category'] === 'Electronics') ? 'selected' : ''; ?>>Electronics</option>
|
||||
<option value="Solar" <?php echo ($array['product_category'] === 'Solar') ? 'selected' : ''; ?>>Solar</option>
|
||||
<option value="E-bike" <?php echo ($array['product_category'] === 'E-bike') ? 'selected' : ''; ?>>E-bike</option>
|
||||
<option value="E-vehicle" <?php echo ($array['product_category'] === 'E-vehicle') ? 'selected' : ''; ?>>E-Vehicle</option>
|
||||
<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="Heavy Equipment" <?php echo ($array['product_category'] === 'Heavy Equipment') ? 'selected' : ''; ?>>Heavy Equipment</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Shipping Fee</label>
|
||||
<input type="number" class="form-control" id="sfee" name="shipping_fee" value="<?php echo $array['shipping_fee'] ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Status</label>
|
||||
<select class="form-select" name="status" id="status">
|
||||
<option value="">Select Product Status</option>
|
||||
<option value="Active" <?php echo ($array['status'] === 'Active') ? 'selected' : ''; ?>>Active</option>
|
||||
<option value="Inactive" <?php echo ($array['status'] === 'Inactive') ? 'selected' : ''; ?>>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="form-label">Product Category</label>
|
||||
<select class="form-select" name="product_category" id="product_category">
|
||||
<option value="">Select Category</option>
|
||||
<option value="Electronics" <?php echo ($array['product_category'] === 'Electronics') ? 'selected' : ''; ?>>Electronics</option>
|
||||
<option value="Solar" <?php echo ($array['product_category'] === 'Solar') ? 'selected' : ''; ?>>Solar</option>
|
||||
<option value="E-bike" <?php echo ($array['product_category'] === 'E-bike') ? 'selected' : ''; ?>>E-bike</option>
|
||||
<option value="E-vehicle" <?php echo ($array['product_category'] === 'E-vehicle') ? 'selected' : ''; ?>>E-Vehicle</option>
|
||||
<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="Heavy Equipment" <?php echo ($array['product_category'] === 'Heavy Equipment') ? 'selected' : ''; ?>>Heavy Equipment</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Shipping Fee</label>
|
||||
<input type="number" class="form-control" id="sfee" name="shipping_fee" value="<?php echo $array['shipping_fee'] ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Status</label>
|
||||
<select class="form-select" name="status" id="status">
|
||||
<option value="">Select Product Status</option>
|
||||
<option value="Active" <?php echo ($array['status'] === 'Active') ? 'selected' : ''; ?>>Active</option>
|
||||
<option value="Inactive" <?php echo ($array['status'] === 'Inactive') ? 'selected' : ''; ?>>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Tags <span>( Type and
|
||||
make comma to separate tags )</span></label>
|
||||
|
@ -409,104 +453,135 @@ $array = json_decode($result, true);
|
|||
function uploadProductImage() {
|
||||
var productId = '<?php echo $_SESSION['newProductId'] ?>';
|
||||
var fileInput = document.getElementById('imageUpload');
|
||||
var file = fileInput.files[0];
|
||||
var files = fileInput.files;
|
||||
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (files.length > 0) {
|
||||
var promises = [];
|
||||
var existingImages = [];
|
||||
|
||||
// Resize the image
|
||||
const maxWidth = 1200; // Set your desired maximum width
|
||||
const maxHeight = 1000; // Set your desired maximum height
|
||||
const aspectRatio = img.width / img.height;
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId)
|
||||
.then(response => response.json())
|
||||
.then(product => {
|
||||
existingImages = product.images || [];
|
||||
existingImages = Array.isArray(existingImages) ? existingImages : [existingImages];
|
||||
existingImages = existingImages.filter(image => image);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching existing images:', error);
|
||||
});
|
||||
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const reader = new FileReader();
|
||||
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
reader.onload = function(e) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const maxWidth = 1200;
|
||||
const maxHeight = 1000;
|
||||
const aspectRatio = img.width / img.height;
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
|
||||
// Draw the image on the canvas
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
|
||||
// Convert the canvas content to a new image file
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
|
||||
// Continue with the rest of your upload logic using the resized file
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', productId);
|
||||
formData.append('category', 'product');
|
||||
formData.append('image', resizedFile);
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
product_image: `https://api.obanana.shop/images/storage/product_uploads/${filename}`,
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://api.obanana.shop/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
})
|
||||
.then(secondResponse => {
|
||||
if (secondResponse.ok) {
|
||||
console.log('Second request successful');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Second request failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
|
||||
img.src = e.target.result;
|
||||
};
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', productId);
|
||||
formData.append('category', 'product');
|
||||
formData.append('image', resizedFile);
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
reject(new Error('File upload failed'));
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
resolve(filename);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
reject(error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
|
||||
img.src = e.target.result;
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
|
||||
promises.push(promise);
|
||||
}
|
||||
|
||||
Promise.all(promises)
|
||||
.then(filenames => {
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`));
|
||||
|
||||
if (!Array.isArray(updatedImages)) {
|
||||
console.error('Updated images is not an array:', updatedImages);
|
||||
throw new Error('Updated images is not an array');
|
||||
}
|
||||
const imagesString = updatedImages.join(',');
|
||||
const payload = {
|
||||
images: imagesString,
|
||||
};
|
||||
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Images uploaded successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Image upload failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during image upload:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- 02-15-2024 Jun Jihad Vendor Product Add and Edit page Multiple Image -->
|
||||
</section>
|
||||
|
||||
<!-- End Vendor upload section -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
|
|
150
wishlist.php
150
wishlist.php
|
@ -1,7 +1,11 @@
|
|||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
|
@ -15,24 +19,29 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!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" />
|
||||
|
@ -41,10 +50,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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">
|
||||
<script>
|
||||
|
@ -57,6 +68,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
function updateWishItemCount() {
|
||||
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
|
||||
if (data != "") {
|
||||
|
@ -78,6 +90,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
border-radius: 10px 10px 0 0;
|
||||
}
|
||||
|
||||
|
||||
.ec-product-inner .ec-pro-image .ec-pro-actions .wishlist {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
|
@ -87,6 +100,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body onload="updateCartItemCount(); updateWishItemCount()">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
|
@ -97,14 +111,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
<div class="container">
|
||||
|
@ -138,12 +156,21 @@ if ($_SESSION["userId"] <> "") {
|
|||
<!-- Ec Wishlist page -->
|
||||
<section class="ec-page-content section-space-p">
|
||||
<div class="container">
|
||||
<div class="row ec_breadcrumb_inner">
|
||||
<div class="row">
|
||||
<!-- Compare Content Start -->
|
||||
<div class="ec-wish-rightside col-lg-12 col-md-12">
|
||||
<!-- Compare content Start -->
|
||||
<div class="ec-compare-content">
|
||||
<div class="ec-compare-inner">
|
||||
<!-- raymart added button for delete and checkbox for select all feb 19 2024 -->
|
||||
<div class="ec-breadcrumb-list" style="padding: 30px;">
|
||||
<a Id="delete-button"><i class="ecicon eci-trash" style="font-size: 40px;"></i></a>
|
||||
<input type="checkbox" Id="select-button" style="width: 30px; height: 30px; float: left; "><title>has</title>
|
||||
<!-- <button class="btn btn-primary" id="delete-button">Delete Selected</button> -->
|
||||
<!-- <button class="btn btn-primary" style="float: left;" id="select-button">Select all</button> -->
|
||||
</div>
|
||||
|
||||
<div class="row margin-minus-b-30">
|
||||
<?php foreach ($customer['favorites']['products'] as $product) {
|
||||
// raymart added vendorproduct feb 14 2024
|
||||
|
@ -151,6 +178,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
?>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-6 mb-6 pro-gl-content">
|
||||
<div class="ec-product-inner">
|
||||
<!-- raymart added style for checkboxes feb 19 2024 -->
|
||||
<input type="checkbox" class="product-checkbox" style="width: 20px; height: 20px; "value="<?php echo $product["_id"]; ?>">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="shop-left-sidebar-col-4.php" class="image">
|
||||
|
@ -205,30 +234,36 @@ if ($_SESSION["userId"] <> "") {
|
|||
$lowest_sale_price = null;
|
||||
$highest_sale_price = null;
|
||||
|
||||
|
||||
if (isset($variation_details) && is_array($variation_details)) {
|
||||
foreach ($variation_details as $index => $variation) {
|
||||
$regular_price = isset($variation['regular_price']) ? $variation['regular_price'] : 0;
|
||||
$sale_price = isset($variation['sale_price']) ? $variation['sale_price'] : 0;
|
||||
|
||||
|
||||
// Update the minimum and maximum prices only if they are not null
|
||||
if ($lowest_regular_price === null || $regular_price < $lowest_regular_price) {
|
||||
$lowest_regular_price = $regular_price;
|
||||
}
|
||||
|
||||
|
||||
if ($highest_regular_price === null || $regular_price > $highest_regular_price) {
|
||||
$highest_regular_price = $regular_price;
|
||||
}
|
||||
|
||||
|
||||
if ($lowest_sale_price === null || $sale_price < $lowest_sale_price) {
|
||||
$lowest_sale_price = $sale_price;
|
||||
}
|
||||
|
||||
|
||||
if ($highest_sale_price === null || $sale_price > $highest_sale_price) {
|
||||
$highest_sale_price = $sale_price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Display the range of prices based on the presence of sale prices
|
||||
if ($lowest_sale_price !== null && $highest_sale_price !== null && $lowest_sale_price > 0 && $highest_sale_price > 0) {
|
||||
echo '<span id="productPrice" class="new-price">' . '₱' . $lowest_sale_price . ' - ₱' . $highest_sale_price . '</span>';
|
||||
|
@ -237,24 +272,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- <div class="ec-pro-option">
|
||||
<div class="ec-pro-color">
|
||||
<span class="ec-pro-opt-label">Color</span>
|
||||
<ul class="ec-opt-swatch ec-change-img">
|
||||
<li class="active"><a href="#" class="ec-opt-clr-img" data-src="assets/images/product-image/8_1.jpg" data-src-hover="assets/images/product-image/8_1.jpg" data-tooltip="Gray"><span style="background-color:#e2e2e2;"></span></a></li>
|
||||
<li><a href="#" class="ec-opt-clr-img" data-src="assets/images/product-image/8_3.jpg" data-src-hover="assets/images/product-image/8_3.jpg" data-tooltip="Orange"><span style="background-color:#ffcef7;"></span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-pro-size">
|
||||
<span class="ec-pro-opt-label">Size</span>
|
||||
<ul class="ec-opt-size">
|
||||
<li class="active"><a href="#" class="ec-opt-sz" data-old="$12.00" data-new="$10.00" data-tooltip="Small">S</a></li>
|
||||
<li><a href="#" class="ec-opt-sz" data-old="$15.00" data-new="$12.00" data-tooltip="Medium">M</a></li>
|
||||
<li><a href="#" class="ec-opt-sz" data-old="$20.00" data-new="$17.00" data-tooltip="Extra Large">XL</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -269,8 +286,32 @@ if ($_SESSION["userId"] <> "") {
|
|||
removeProduct(productId);
|
||||
});
|
||||
});
|
||||
var deleteButton = document.getElementById('delete-button');
|
||||
deleteButton.addEventListener('click', function() {
|
||||
var selectedProducts = [];
|
||||
var checkboxes = document.querySelectorAll('.product-checkbox');
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
if (checkbox.checked) {
|
||||
selectedProducts.push(checkbox.value);
|
||||
}
|
||||
});
|
||||
deleteProducts(selectedProducts);
|
||||
});
|
||||
});
|
||||
|
||||
var selectAllButton = document.querySelector('#select-button');
|
||||
selectAllButton.addEventListener('click', function() {
|
||||
var selectedProducts = [];
|
||||
var checkboxes = document.querySelectorAll('.product-checkbox');
|
||||
// checkboxes.forEach(function(checkbox) {
|
||||
// }
|
||||
console.log('clicked')
|
||||
for (let i = 0; i < checkboxes.length; i++ ) {
|
||||
checkboxes[i].checked = selectAllButton.checked
|
||||
// checkboxes[i].checked = true
|
||||
}})
|
||||
|
||||
|
||||
|
||||
// Function to remove product
|
||||
function removeProduct(productId) {
|
||||
// Get all product IDs except the one to remove
|
||||
|
@ -280,6 +321,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
return id !== productId;
|
||||
});
|
||||
|
||||
|
||||
// Make an AJAX request to update the favorites with the remaining products
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
|
||||
|
@ -305,6 +347,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
return product['_id'] === id;
|
||||
});
|
||||
|
||||
|
||||
// Return the entire product object
|
||||
return remainingProduct;
|
||||
})
|
||||
|
@ -313,19 +356,54 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
xhr.send(data);
|
||||
}
|
||||
// Function to delete multiple products
|
||||
function deleteProducts(productIds) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
if (xhr.status === 200) {
|
||||
console.log('Products removed successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Error removing products:', xhr.responseText);
|
||||
}
|
||||
}
|
||||
};
|
||||
var remainingProductIds = Array.from(document.querySelectorAll('.remove-product')).map(function(button) {
|
||||
return button.getAttribute('data-product-id');
|
||||
}).filter(function(id) {
|
||||
return !productIds.includes(id);
|
||||
});
|
||||
var data = JSON.stringify({
|
||||
favorites: {
|
||||
products: remainingProductIds.map(function(id) {
|
||||
var remainingProduct = <?php echo json_encode($customer['favorites']['products']); ?>.find(function(product) {
|
||||
return product['_id'] === id;
|
||||
});
|
||||
return remainingProduct;
|
||||
})
|
||||
}
|
||||
});
|
||||
xhr.send(data);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--compare content End -->
|
||||
<!-- // compare content End -->
|
||||
</div>
|
||||
<!-- Compare Content end -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<!-- Start Offer section -->
|
||||
<!-- <section class="labels section-space-p">
|
||||
<section class="labels section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
|
@ -393,6 +471,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</section> -->
|
||||
<!-- End Offer section -->
|
||||
|
||||
|
||||
<!-- Start Offer section -->
|
||||
<!-- <section class="labels section-space-p">
|
||||
<div class="container">
|
||||
|
@ -424,10 +503,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
</section> -->
|
||||
<!-- End Offer section -->
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
|
@ -448,11 +529,13 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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">
|
||||
|
@ -465,6 +548,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</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">
|
||||
|
@ -475,6 +559,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<!-- Cart Floating Button end -->
|
||||
|
||||
|
||||
<!-- Whatsapp -->
|
||||
<div class="ec-style ec-right-bottom">
|
||||
<!-- Start Floating Panel Container -->
|
||||
|
@ -591,6 +676,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
<!-- Whatsapp end -->
|
||||
|
||||
|
||||
<!-- Feature tools -->
|
||||
<div class="ec-tools-sidebar-overlay"></div>
|
||||
<div class="ec-tools-sidebar">
|
||||
|
@ -658,6 +744,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</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>
|
||||
|
@ -665,6 +752,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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>
|
||||
|
@ -675,12 +763,24 @@ if ($_SESSION["userId"] <> "") {
|
|||
<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>
|
||||
<!-- raymart added link from js feb 14 2024 -->
|
||||
<script src="assets/js/tester3.js"></script>
|
||||
<!-- <script src="assets/js/tester3.js"></script> -->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester3.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue