Compare commits
15 Commits
4a6b027f9c
...
daae43768c
Author | SHA1 | Date |
---|---|---|
RryAn05 | daae43768c | |
RryAn05 | a02f0667ff | |
RryAn05 | 4bc084358c | |
RryAn05 | 2f7eb29f43 | |
MarkHipe | 351acf87dd | |
raymart | 13fed959b1 | |
raymart | 3fd03351c3 | |
MarkHipe | 09d777cb80 | |
Jun Barroga | 105c93079c | |
MarkHipe | 5cc36505fe | |
Erwin Galang | 815f0937f2 | |
erwin | 0f015cce5f | |
Erwin Galang | cbb11d60c6 | |
Erwin Galang | 51ff64d054 | |
MarkHipe | 1c1150334b |
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="egalang@premiummegastructures.com";
|
||||
$_SESSION["test_email_rcpt"]="stacyjoycemapano@gmail.com";
|
||||
$_SESSION["sales_email"]="stacyjoycemapano@gmail.com";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
?>
|
|
@ -7,6 +7,11 @@ $vendorId = $_SESSION['vendorId'];
|
|||
$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");
|
||||
|
|
|
@ -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://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
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://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`,
|
||||
};
|
||||
img.src = e.target.result;
|
||||
};
|
||||
|
||||
console.log('Payload:', payload);
|
||||
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(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 -->
|
||||
|
|
|
@ -6,7 +6,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
|
||||
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']);
|
||||
|
|
|
@ -135,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>
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
}
|
||||
|
|
@ -611,12 +611,14 @@ function popupAddToCart(product, productVendor, token, email, password, customer
|
|||
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>
|
||||
<!-- 02-16-2024 Stacy added style -->
|
||||
<div class="qty-plus-minuses" style="display:flex; overflow:visible; align-items:center; padding-top:10px;">
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
|
||||
<input style="width:100px; height:40px" id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:30px; padding-left:5px; cursor: pointer;" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')"><i class="ecicon eci-trash" style="padding:20px; opacity:70%"></i></a>
|
||||
</div>
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
<!-- 02-16-2024 Stacy added style -->
|
||||
</div>
|
||||
`;
|
||||
getLatestOrders()
|
|
@ -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/tester5.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<!-- 02-19-2024 Stacy created contact-seller-action.php -->
|
||||
<?php
|
||||
include "functions.php";
|
||||
|
||||
$cstm_email = $_SESSION['email'];
|
||||
$prd_name = $_POST['product_name'];
|
||||
$prd_qnty = $_POST['product_quantityf'];
|
||||
$message = $_POST['message'];
|
||||
$id = $_POST['product_id'];
|
||||
|
||||
|
||||
$response = contact_Seller(
|
||||
$cstm_email,
|
||||
$prd_name,
|
||||
$prd_qnty,
|
||||
$message,
|
||||
);
|
||||
|
||||
$array = json_decode($response,true);
|
||||
var_dump($array);
|
||||
// header("location: product-left-sidebar.php?id=$id");
|
||||
|
||||
# 02-20-2024 Stacy added message sent
|
||||
// $result = customerExists($_SESSION["email"]);
|
||||
if ($response) {
|
||||
$_SESSION["SuccessfullySent"] = "Message Sent Successfully";
|
||||
header("location: product-left-sidebar.php?id=$id");
|
||||
}
|
||||
|
||||
|
||||
#02-19-2024 Stacy added email to be sent to customer
|
||||
$response2 = contact_Inquirer(
|
||||
$cstm_email,
|
||||
);
|
||||
$array = json_decode($response2,true);
|
||||
var_dump($array);
|
||||
header("location: product-left-sidebar.php?id=$id");
|
||||
|
||||
// if ($response2) {
|
||||
// // $_SESSION["SuccessfullySent"] = "Message Sent Successfully";
|
||||
// header("location: contact-us.php");
|
||||
// }
|
|
@ -7,7 +7,7 @@ include "functions.php";
|
|||
$phone = $_POST['phonenumber'];
|
||||
$message = $_POST['message'];
|
||||
|
||||
$response = sendEmail(
|
||||
$response = sendEmail_obanana(
|
||||
$fName,
|
||||
$lName,
|
||||
$email,
|
||||
|
@ -20,10 +20,23 @@ include "functions.php";
|
|||
|
||||
|
||||
# 02-15-2024 Stacy added message sent
|
||||
$result = customerExists($_SESSION["email"]);
|
||||
|
||||
if ($result > 0) {
|
||||
$_SESSION["SuccessfullySent"] = "Message Sent Successfully";
|
||||
// $result = customerExists($_SESSION["email"]);
|
||||
if ($response) {
|
||||
$_SESSION["SuccessfullySent"] = "Message Sent Successfully";
|
||||
header("location: contact-us.php");
|
||||
}
|
||||
# 02-15-2024 Stacy added message sent
|
||||
|
||||
#02-19-2024 Stacy added email to be sent to customer
|
||||
$response2 = sendEmail_customer(
|
||||
$fName,
|
||||
$lName,
|
||||
$email,
|
||||
);
|
||||
$array = json_decode($response2,true);
|
||||
var_dump($array);
|
||||
header("location: contact-us.php");
|
||||
|
||||
if ($response2) {
|
||||
// $_SESSION["SuccessfullySent"] = "Message Sent Successfully";
|
||||
header("location: contact-us.php");
|
||||
}
|
|
@ -170,7 +170,7 @@
|
|||
echo " <script>
|
||||
setTimeout(function() {
|
||||
document.getElementById('alertSuccess').style.display = 'none';
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
</script>";
|
||||
}
|
||||
?>
|
||||
|
|
227
functions.php
227
functions.php
|
@ -28,6 +28,38 @@ 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);
|
||||
|
@ -450,13 +482,12 @@ function vendorExists($email)
|
|||
return $count;
|
||||
}
|
||||
|
||||
|
||||
function sendEmail($fName, $lName, $email, $phone, $message)
|
||||
function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
$testEmail = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$message2 = "
|
||||
$msgto_obanana = "
|
||||
<h4>Greetings from Obanana!</h4>
|
||||
<ul>
|
||||
<li style='list-style:none; font-size:13px'><b>Name: </b>$fName $lName</li>
|
||||
|
@ -465,6 +496,65 @@ function sendEmail($fName, $lName, $email, $phone, $message)
|
|||
<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" => [
|
||||
[
|
||||
|
@ -480,7 +570,126 @@ function sendEmail($fName, $lName, $email, $phone, $message)
|
|||
],
|
||||
"Subject" => "Obanana Contact Us Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $message2
|
||||
"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 Seller 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 Seller Form",
|
||||
"TextPart" => "Greetings from Obanana!",
|
||||
"HTMLPart" => $msgto_inquirer
|
||||
]
|
||||
]
|
||||
];
|
||||
|
@ -1279,6 +1488,9 @@ function editProduct(
|
|||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$ndd,
|
||||
$sdd,
|
||||
$freeSf,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
|
@ -1315,6 +1527,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(
|
||||
|
|
15
header.php
15
header.php
|
@ -386,13 +386,16 @@
|
|||
<div class="cart-price">
|
||||
<span class="subtotal-<?php echo $order['_id']; ?>">Subtotal: <?php echo $order['total_amount'] ?></span>
|
||||
</div>
|
||||
<div class="qty-plus-minuses">
|
||||
<div class="qty-btn" onclick="qtyDecrement('<?php echo $order['_id']; ?>' , '<?php echo $order['items'][0]['_id']; ?>')">-</div>
|
||||
<input id="qty-input-<?php echo $order['items'][0]['_id']; ?>" class="qty-input" type="number" name="ec_qtybtn" value="<?php echo $order['items'][0]['quantity']; ?>" oninput="handleQtyInput(this, '<?php echo $order['_id']; ?>', '<?php echo $order['items'][0]['_id']; ?>')" />
|
||||
<div class="qty-btn" onclick="qtyIncrement('<?php echo $order['_id']; ?>' , '<?php echo $order['items'][0]['_id']; ?>', false)">+</div>
|
||||
<!-- 02-16-2024 Stacy added style -->
|
||||
<div class="qty-plus-minuses" style="display:flex; overflow:visible; align-items:center; padding-top:10px;">
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="qtyDecrement('<?php echo $order['_id']; ?>' , '<?php echo $order['items'][0]['_id']; ?>')">-</div>
|
||||
<input style="width:100px; height:40px" id="qty-input-<?php echo $order['items'][0]['_id']; ?>" class="qty-input" type="number" name="ec_qtybtn" value="<?php echo $order['items'][0]['quantity']; ?>" oninput="handleQtyInput(this, '<?php echo $order['_id']; ?>', '<?php echo $order['items'][0]['_id']; ?>')" />
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:30px; padding-left:5px; cursor: pointer;" onclick="qtyIncrement('<?php echo $order['_id']; ?>' , '<?php echo $order['items'][0]['_id']; ?>', false)">+</div>
|
||||
<!-- <a class="remove">x</a> -->
|
||||
<!-- <a href="#" class="removeCart" onclick="deleteOrder('<?php #echo $order['_id']; ?>')">x</a> -->
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('<?php echo $order['_id']; ?>')"><i class="ecicon eci-trash" style="padding:20px; opacity:70%"></i></a>
|
||||
</div>
|
||||
<!-- <a class="remove">x</a> -->
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('<?php echo $order['_id']; ?>')">x</a>
|
||||
<!-- 02-16-2024 Stacy added style -->
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
|
|
10
index.php
10
index.php
|
@ -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/tester5.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -249,6 +249,21 @@ if (isset($_GET['id'])) {
|
|||
<!-- Single product content Start -->
|
||||
<div class="single-pro-block">
|
||||
<div class="single-pro-inner">
|
||||
<!-- 02-20-2024 Stacy message sent pop-up -->
|
||||
<?php
|
||||
if (isset($_SESSION["SuccessfullySent"])) {
|
||||
echo '<div class="alert alert-success" id="alertSuccess" role="alert"; content-align:center;>';
|
||||
echo $_SESSION["SuccessfullySent"];
|
||||
echo '</div>';
|
||||
unset($_SESSION["SuccessfullySent"]);
|
||||
echo " <script>
|
||||
setTimeout(function() {
|
||||
document.getElementById('alertSuccess').style.display = 'none';
|
||||
}, 10000);
|
||||
</script>";
|
||||
}
|
||||
?>
|
||||
<!-- 02-20-2024 Stacy message sent pop-up -->
|
||||
<div class="row">
|
||||
<div class="single-pro-img">
|
||||
<div class="single-product-scroll">
|
||||
|
@ -494,7 +509,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
<b class="mb-0">To:</b>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<span><?php echo $vendor_details['user_email'] ?></span>
|
||||
<span><?php echo $_SESSION["sales_email"] ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -516,7 +531,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
</div>
|
||||
<div class="col-md-2 col-2">
|
||||
<div class="qty-plus text-center">
|
||||
<input class="qty-inputs" type="number" name="ec_qtybtn" value="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" min="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" />
|
||||
<input class="qty-inputs" type="number" name="product_quantity" value="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" min="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -525,21 +540,30 @@ foreach ($variation_details as $index => $variation) {
|
|||
<div class="text-information">
|
||||
<b class="text">DETAILED REQUIREMENTS</b>
|
||||
</div>
|
||||
<form action="">
|
||||
<label for="">Enter product details such as color,sizr,materials,etc. and other specification requirements to receive an accurate quote</label>
|
||||
<textarea name="" id="" cols="30" rows="5"></textarea>
|
||||
<!-- 02-19-2024 Stacy modified this block of code -->
|
||||
<form action="contact-seller-action.php" method="post">
|
||||
<label for="">Enter product details such as color,size,materials,etc. and other specification requirements to receive an accurate quote</label>
|
||||
<textarea name="message" id="" cols="30" rows="5"></textarea>
|
||||
<input name="product_name" type="hidden" value='<?php echo $product_details['product_name']; ?>'/>
|
||||
<input class="qty-inputs" type="hidden" name="product_quantityf" value="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" id="qty-input" min="<?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>" />
|
||||
|
||||
<input name="product_id" type="hidden" value='<?php echo $product_details['_id']; ?>'/>
|
||||
|
||||
<!-- <input name="product_quantity" type="number"/> -->
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-secondary" data-bs-dismiss="modal">Send</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 02-19-2024 Stacy modified this block of code -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!-- <div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Send</button>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ec-single-wishlist">
|
||||
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart"></i></a>
|
||||
</div>
|
||||
|
@ -794,12 +818,14 @@ foreach ($variation_details as $index => $variation) {
|
|||
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>
|
||||
<!-- 02-16-2024 Stacy added style -->
|
||||
<div class="qty-plus-minuses" style="display:flex; overflow:visible; align-items:center; padding-top:10px;">
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:35px; padding-right:5px; cursor: pointer;" onclick="qtyDecrement('${response._id}', '${response.items[0]._id}', true)">-</div>
|
||||
<input style="width:100px; height:40px" id="qty-input-${response.items[0]._id}" class="qty-input" type="number" name="ec_qtybtn" value="${productData.quantity}" oninput="handleQtyInput(this, '${response._id}', '${response.items[0]._id}', true)"/>
|
||||
<div class="qty-btn" style="color:#ffaa00; font-size:30px; padding-left:5px; cursor: pointer;" onclick="qtyIncrement('${response._id}', '${response.items[0]._id}', true)">+</div>
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')"><i class="ecicon eci-trash" style="padding:20px; opacity:70%"></i></a>
|
||||
</div>
|
||||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
<!-- 02-16-2024 Stacy added style -->
|
||||
</div>
|
||||
`;
|
||||
getLatestOrders()
|
||||
|
@ -1471,6 +1497,7 @@ foreach ($variation_details as $index => $variation) {
|
|||
</section>
|
||||
<!-- Related Product end -->
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
|
|
|
@ -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/tester5.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>
|
|
@ -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/tester5.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -7,6 +7,11 @@ $vendorId = $_SESSION['vendorId'];
|
|||
$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,
|
||||
|
|
|
@ -352,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'] ?>">
|
||||
|
|
154
wishlist.php
154
wishlist.php
|
@ -1,9 +1,13 @@
|
|||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
include "functions.php";
|
||||
|
||||
include "functions.php";
|
||||
session_start();
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
@ -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,9 +321,10 @@ 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://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
|
||||
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) {
|
||||
|
@ -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/tester5.js"></script> -->
|
||||
<?php
|
||||
if ($_SESSION["is_test"]==true) {
|
||||
echo '<script src="assets/js/tester5.js"></script>';
|
||||
} else {
|
||||
echo '<script src="assets/js/produc3.js"></script>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue