Compare commits

...

12 Commits

17 changed files with 513 additions and 210 deletions

View File

@ -1,6 +1,6 @@
<?php
$_SESSION["is_test"]=true;
$_SESSION["test_email_rcpt"]="";
$_SESSION["sales_email"]="";
$_SESSION["test_email_rcpt"]="stacyjoycemapano@gmail.com";
$_SESSION["sales_email"]="stacyjoycemapano@gmail.com";
$_SESSION["data_endpoint"]="api.obanana.shop";
?>

View File

@ -1,5 +1,5 @@
<?php
include "../functions.php";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$input = json_decode(file_get_contents('php://input'), true);

View File

@ -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()

View File

@ -1092,7 +1092,7 @@ if ($_SESSION["userId"] <> "") {
<!-- raymart added js link feb 14 2024 -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester3.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

42
contact-seller-action.php Normal file
View File

@ -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");
// }

View File

@ -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");
}

View File

@ -170,7 +170,7 @@
echo " <script>
setTimeout(function() {
document.getElementById('alertSuccess').style.display = 'none';
}, 5000);
}, 10000);
</script>";
}
?>

View File

@ -51,7 +51,7 @@ function sddProducts()
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' );
return ($var['promo'][0]['same-day-delivery'] === "Yes" && $var['product_type'] == '' || $var['promo'][0]['same-day-delivery'] === "Yes" && $var['product_type'] == 'simple' || $var['promo'][0]['same-day-delivery'] === "Yes" && $var['product_type'] == 'variable' );
});
$products = array_values($products);
return $products;
@ -542,7 +542,6 @@ function sendEmail_obanana($fName, $lName, $email, $phone, $message)
}
function sendEmail_customer($fName, $lName, $email)
{
// if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
@ -628,7 +627,7 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
"Name" => "Subscriber"
]
],
"Subject" => "Obanana Contact Us Form",
"Subject" => "Obanana Contact Seller Form",
"TextPart" => "Greetings from Obanana!",
"HTMLPart" => $msgto_seller
]
@ -688,7 +687,7 @@ function contact_Inquirer($cstm_email)
"Name" => "Subscriber"
]
],
"Subject" => "Obanana Contact Us Form",
"Subject" => "Obanana Contact Seller Form",
"TextPart" => "Greetings from Obanana!",
"HTMLPart" => $msgto_inquirer
]

View File

@ -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

View File

@ -2060,7 +2060,7 @@ if ($_SESSION["userId"] <> "") {
<!-- raymart added js feb 14, 2024-->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester3.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -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 -->

View File

@ -901,7 +901,7 @@ if ($_SESSION["userId"] <> "") {
<script src="assets/js/main.js"></script>
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester3.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -0,0 +1,26 @@
<?php
// 02-21-2024 Jun Jihad Search Filter Action
$categories = isset($_POST['category']) ? $_POST['category'] : array();
$categoryFinal = null;
$count=0;
foreach ($categories as $category) {
// Perform checks or actions for each category
// For example:
$categoriesCopy = $categoryFinal;
$categoryFinal =$categoryFinal!== null? $categoriesCopy . '&category['.$count.']='.$category:$categoriesCopy . 'category['.$count.']='.$category;
$count+=1;
echo "Processing category: $category <br>";
// You can add your logic here
}
$minPrice = isset($_POST['minPrice']) ? $_POST['minPrice'] : null;
$maxPrice = isset($_POST['maxPrice']) ? $_POST['maxPrice'] : null;
if(isset($categoryFinal)){
header("location: shop-list-left-sidebar.php?$categoryFinal&minPrice=$minPrice&maxPrice=$maxPrice");
}else{
header("location: shop-list-left-sidebar.php?&minPrice=$minPrice&maxPrice=$maxPrice");
}
// 02-21-2024 Jun Jihad Search Filter Action

View File

@ -9,12 +9,112 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
}
$productSearchResult = $_SESSION["productSearchResult"];
// var_dump($product);
// 02-19-2024 Jun Jihad Search Filter
$filteredProducts = [];
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$minPrice = ($_POST['minPrice'] !== '' && is_numeric($_POST['minPrice'])) ? floatval($_POST['minPrice']) : null;
$maxPrice = ($_POST['maxPrice'] !== '' && is_numeric($_POST['maxPrice'])) ? floatval($_POST['maxPrice']) : null;
echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "<br>";
echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "<br>";
if (isset($_POST['category'])) {
$selectedCategories = $_POST['category'];
foreach ($selectedCategories as $selectedCategory) {
$category = strtolower(trim($selectedCategory));
foreach ($productSearchResult['results'] as $result) {
$productCategory = strtolower(trim($result['product']['product_category']));
$productPrice = isset($result['product']['sale_price']) ? $result['product']['sale_price'] : $result['product']['regular_price'];
// if (isset($_SESSION["productSearchResult"])) {
// $productSearchResult = $_SESSION["productSearchResult"];
// var_dump($productSearchResult)
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (
$productCategory == $category &&
($productPrice >= $minPrice) &&
($productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
} else {
// If no category is selected, filter only by price range
foreach ($productSearchResult['results'] as $result) {
$productPrice = isset($result['product']['sale_price']) ? $result['product']['sale_price'] : $result['product']['regular_price'];
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (($productPrice >= $minPrice) &&
($productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
}
if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['category'])) {
$filteredProducts = [];
$minPrice = isset($_GET['minPrice']) && $_GET['minPrice'] !== '' ? floatval($_GET['minPrice']) : null;
$maxPrice = isset($_GET['maxPrice']) && $_GET['maxPrice'] !== '' ? floatval($_GET['maxPrice']) : null;
echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "<br>";
echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "<br>";
$selectedCategories = isset($_GET['category']) ? $_GET['category'] : [];
if (!empty($selectedCategories)) {
foreach ($selectedCategories as $selectedCategory) {
$category = strtolower(trim($selectedCategory));
foreach ($productSearchResult['results'] as $result) {
$product = $result['product'];
$productCategory = strtolower(trim($product['product_category']));
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (
$productCategory == $category &&
($minPrice === null || $productPrice >= $minPrice) &&
($maxPrice === null || $productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
} else {
foreach ($productSearchResult['results'] as $result) {
$product = $result['product'];
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
if ($minPrice === null) {
$minPrice = 0;
}
if ($maxPrice === null) {
$maxPrice = PHP_FLOAT_MAX;
}
if (($minPrice === null || $productPrice >= $minPrice) &&
($maxPrice === null || $productPrice <= $maxPrice)
) {
$filteredProducts[] = $result;
}
}
}
} else {
$filteredProducts = $productSearchResult['results'];
}
?>
<!DOCTYPE html>
<html lang="en">
@ -158,40 +258,22 @@ $productSearchResult = $_SESSION["productSearchResult"];
</div>
<!-- Shop Top End -->
<!-- Shop content Start -->
<div class="shop-pro-content">
<div class="shop-pro-inner list-view">
<div class="row">
<?php
// echo count($productSearchResult["results"]);
// var_dump($productSearchResult["results"][10]["product"]);
// var_dump($_SESSION["productSearchResult"]);
// for($x=0;$x<=11;$x++){
// $pid = rand(0,count($simpleProducts)-1);
$productsPerPage = 10; // Set the number of products to display per page
$currentPage = isset($_GET['page']) ? max(1, intval($_GET['page'])) : 1;
$startIndex = ($currentPage - 1) * $productsPerPage;
$endIndex = min($startIndex + $productsPerPage - 1, count($productSearchResult['results']) - 1);
$endIndex = min($startIndex + $productsPerPage - 1, count($filteredProducts) - 1);
for ($x = $startIndex; $x <= $endIndex; $x++) {
$product = $productSearchResult['results'][$x]['product'];
$product = $filteredProducts[$x]['product'];
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
// $pid = rand(0, count($productSearchResult["results"]) - 1);
// $product = $productSearchResult["results"][$pid]["product"];
$product_image = !empty($product["product_image"]) ? $product["product_image"] : "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/330px-No-Image-Placeholder.svg.png";
$sale_price = isset($product['sale_price']) ? $product['sale_price'] : null;
$regular_price = isset($product['regular_price']) ? $product['regular_price'] : null;
//var_dump( $productSearchResult["results"][0]["product"]["product_name"]);
// var_dump($productSearchResult);
// if (isset($_SESSION["noProductsFound"]) && $_SESSION["noProductsFound"]) {
// echo '<div class="no-products-found">No products found</div>';
// } else {
// foreach ($productSearchResult["results"] as $productItem) {
// $product = $productItem["product"];
// $product_image = !empty($product["product_image"]) ? $product["product_image"] : "https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/330px-No-Image-Placeholder.svg.png";
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content width-100">
<div class="ec-product-inner">
@ -208,80 +290,43 @@ $productSearchResult = $_SESSION["productSearchResult"];
</div>
</div>
<div class="ec-pro-content">
<!-- <h5 class="ec-pro-title"><a href="shop-left-sidebar-col-4.php?id=<?php echo $product["_id"]; ?>"> -->
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>">
<?php echo $product["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> -->
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>"><?php echo $product["product_name"] ?></a></h5>
<div class="ec-pro-list-desc"><?php echo $product["product_description"] ?></div>
<span class="ec-price">
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<span class="old-price">&#8369;<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
<span class="new-price">&#8369;<?php echo number_format($product["sale_price"], 2, ".", ",") ?></span>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<span class="new-price">&#8369;<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
<?php elseif ($product["regular_price"] == "" || $product["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="<?php echo $product["product_image"] ?>" data-src-hover="<?php echo $product["product_image"] ?>" data-tooltip="Gray"><span style="background-color:#e8c2ff;"></span></a></li>
<li><a href="#" class="ec-opt-clr-img" data-src="<?php echo $product["product_image"] ?>" data-src-hover="<?php echo $product["product_image"] ?>" data-tooltip="Orange"><span style="background-color:#9cfdd5;"></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="$25.00" data-new="$20.00" data-tooltip="Small">S</a></li>
<li><a href="#" class="ec-opt-sz" data-old="$27.00" data-new="$22.00" data-tooltip="Medium">M</a></li>
<li><a href="#" class="ec-opt-sz" data-old="$30.00" data-new="$25.00" data-tooltip="Large">X</a></li>
<li><a href="#" class="ec-opt-sz" data-old="$35.00" data-new="$30.00" data-tooltip="Extra Large">XL</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($productSearchResult['results']); ?> item(s)</span>
<span>Showing <?php echo $startIndex + 1; ?>-<?php echo $endIndex + 1; ?> of <?php echo count($filteredProducts); ?> item(s)</span>
<ul class="ec-pro-pagination-inner">
<?php
// Calculate the total number of pages
$totalPages = ceil(count($productSearchResult['results']) / $productsPerPage);
// Define the maximum number of pagination links to display
$totalPages = ceil(count($filteredProducts) / $productsPerPage);
$maxPaginationLinks = 5;
// Calculate the range of pagination links to display
$startPage = max(1, $currentPage - floor($maxPaginationLinks / 2));
$endPage = min($startPage + $maxPaginationLinks - 1, $totalPages);
// Display the first page link
if ($startPage > 1) {
?>
<li><a href="?page=1">1</a></li>
<?php
// Add an ellipsis if there are more pages before the first displayed page
if ($startPage > 2) {
?>
<li><span>...</span></li>
@ -289,17 +334,21 @@ $productSearchResult = $_SESSION["productSearchResult"];
}
}
// Display pagination links within the defined range
for ($page = $startPage; $page <= $endPage; $page++) {
$activeClass = ($page == $currentPage) ? 'active' : '';
$filterParams = array('minPrice' => $minPrice, 'maxPrice' => $maxPrice);
if (isset($_POST['category'])) {
$filterParams['category'] = $_POST['category'];
}
$paginationUrl = '?' . http_build_query(array_merge($_GET, $_POST, array('page' => $page)));
?>
<li><a class="<?php echo $activeClass; ?>" href="?page=<?php echo $page; ?>"><?php echo $page; ?></a></li>
<li><a class="<?php echo $activeClass; ?>" href="<?php echo $paginationUrl; ?>"><?php echo $page; ?></a></li>
<?php
}
// Display the last page link
if ($endPage < $totalPages) {
// Add an ellipsis if there are more pages after the last displayed page
if ($endPage < $totalPages - 1) {
?>
<li><span>...</span></li>
@ -330,77 +379,128 @@ $productSearchResult = $_SESSION["productSearchResult"];
<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>
<form method="POST" action="shop-list-left-sidebar-action.php">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) || (isset($_GET['category']) && in_array('Electronics', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) || (isset($_GET['category']) && in_array('Solar', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) || (isset($_GET['category']) && in_array('E-bike', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) || (isset($_GET['category']) && in_array('E-vehicle', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) || (isset($_GET['category']) && in_array('Appliance', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Smart Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div>
<label for="minPrice">Min Price:</label>
<input type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice">Max Price:</label>
<input type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
</ul>
<button type="submit">Apply</button>
</form>
<!-- <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] . '?' . http_build_query(array_merge($_GET, $_POST)); ?>">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div>
<label for="minPrice">Min Price:</label>
<input type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice">Max Price:</label>
<input type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
</ul>
<button type="submit">Apply</button>
</form> -->
</ul>
</div>
</div>
<!-- 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>
<!-- 02-19-2024 Jun Jihad Search Filter -->
<!-- Sidebar Size Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">

View File

@ -846,7 +846,7 @@ if ($_SESSION["userId"] <> "") {
<!-- raymart added js link feb 14 2024 -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester3.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -1,5 +1,5 @@
<?php
include "functions.php";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$input = json_decode(file_get_contents('php://input'), true);

View File

@ -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,22 +156,30 @@ 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">
<div class="col-12">
<button id="select-all-button">Select All</button>
</div>
<?php foreach ($customer['favorites']['products'] as $product) {
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
?>
<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">
@ -208,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">' . '&#8369;' . $lowest_sale_price . ' - &#8369;' . $highest_sale_price . '</span>';
@ -240,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>
@ -272,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
@ -283,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) {
@ -308,6 +347,7 @@ if ($_SESSION["userId"] <> "") {
return product['_id'] === id;
});
// Return the entire product object
return remainingProduct;
})
@ -316,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">
@ -396,6 +471,7 @@ if ($_SESSION["userId"] <> "") {
</section> -->
<!-- End Offer section -->
<!-- Start Offer section -->
<!-- <section class="labels section-space-p">
<div class="container">
@ -427,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">
@ -451,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">
@ -468,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">
@ -478,6 +559,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
@ -594,6 +676,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>
<div class="ec-tools-sidebar">
@ -661,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>
@ -668,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>
@ -678,13 +763,15 @@ 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/tester5.js"></script> -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester3.js"></script>';
echo '<script src="assets/js/tester5.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}
@ -692,4 +779,8 @@ if ($_SESSION["userId"] <> "") {
</body>
</html>
</html>