Compare commits

..

No commits in common. "fd712f1ad972ca32653eda92a39955938da90288" and "dd254035c4eb87ca782074302e3d56eb099a166c" have entirely different histories.

14 changed files with 153 additions and 320 deletions

View File

@ -858,15 +858,21 @@ $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</label> -->
<!-- raymart edit weight -->
<label for="weight" class="form-label">Weight(grams)</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>
<!-- <label for="length" class="form-label">Length</label> -->
<!-- raymart edit length -->
<label for="length" class="form-label">Length(cm)</label>
<input type="number" class="form-control slug-title" id="width" 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</label> -->
<!-- raymart edit width -->
<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">

View File

@ -65,26 +65,6 @@ if ($_SESSION["userId"] <> "") {
});
}
</script>
<!-- raymart added css feb 14 2024 -->
<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;
}
.ec-product-inner .ec-pro-image .ec-pro-actions .wishlist {
position: absolute;
right: 15px;
bottom: 0;
border-radius: 0 0 10px 10px;
}
</style>
</head>
<body onload="updateCartItemCount(); updateWishItemCount()" class="shop_page">
@ -304,8 +284,6 @@ if ($_SESSION["userId"] <> "") {
<?php
//var_dump($products);
foreach ($products as $product) {
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content">
<div class="ec-product-inner">
@ -326,18 +304,13 @@ if ($_SESSION["userId"] <> "") {
}
?>
</a>
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <span class="percentage">20%</span>
<span class="percentage">20%</span>
<a href="#" class="quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
<div class="ec-pro-actions">
<a href="compare.html" class="ec-btn-group compare" title="Compare"><i class="fi fi-rr-arrows-repeat"></i></a>
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -1089,8 +1062,6 @@ if ($_SESSION["userId"] <> "") {
<!-- Main Js -->
<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>
</body>

View File

@ -1363,7 +1363,7 @@ function addVendor(
$country,
$email,
$phone,
$dateRegistered
$dateRegistered,
) {
$curl = curl_init();

View File

@ -573,15 +573,10 @@ if ($_SESSION["userId"] <> "") {
<img class="hover-image" src="<?php echo $forAll[$pid]["product_image"] ?>" alt="Product" />
</a>
<!-- <span class="percentage">20%</span> -->
<!-- raymart edit action -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>','<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>', '<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>' , '<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>' , '<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>' ,'<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -644,8 +639,6 @@ if ($_SESSION["userId"] <> "") {
} else {
for ($x = 0; $x <= 7; $x++) {
$pid = rand(0, count($electronics) - 1);
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($electronics[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
@ -656,16 +649,10 @@ if ($_SESSION["userId"] <> "") {
<img class="hover-image" src="<?php echo $electronics[$pid]["product_image"] ?>" alt="Product" />
</a>
<!-- <span class="percentage">20%</span> -->
<!-- raymart edit action feb 14 2024-->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -729,8 +716,6 @@ if ($_SESSION["userId"] <> "") {
} else {
for ($x = 0; $x <= 7; $x++) {
$pid = rand(0, count($smartHome) - 1);
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($smartHome[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
@ -741,15 +726,10 @@ if ($_SESSION["userId"] <> "") {
<img class="hover-image" src="<?php echo $smartHome[$pid]["product_image"] ?>" alt="Product" />
</a>
<!-- <span class="percentage">20%</span> -->
<!-- raymart edit action feb 14 2024-->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -812,8 +792,6 @@ if ($_SESSION["userId"] <> "") {
} else {
for ($x = 0; $x <= 7; $x++) {
$pid = rand(0, count($home) - 1);
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($forVehicle[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner">
@ -824,15 +802,11 @@ if ($_SESSION["userId"] <> "") {
<img class="hover-image" src="<?php echo $forVehicle[$pid]["product_image"] ?>" alt="Product" />
</a>
<!-- <span class="percentage">20%</span> -->
<!-- raymart added action feb 14 2024-->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -1397,8 +1371,6 @@ if ($_SESSION["userId"] <> "") {
} else {
for ($x = 0; $x <= 3; $x++) {
$pid = rand(0, count($newArrival) - 1);
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($newArrival[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="flipInY">
<div class="ec-product-inner">
@ -1408,15 +1380,10 @@ if ($_SESSION["userId"] <> "") {
<img class="main-image" src="<?php echo $newArrival[$pid]["product_image"] ?>" alt="Product" />
<img class="hover-image" src="<?php echo $newArrival[$pid]["product_image"] ?>" alt="Product" />
</a>
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -2056,9 +2023,7 @@ if ($_SESSION["userId"] <> "") {
<!-- Main Js -->
<script src="assets/js/vendor/index.js"></script>
<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>
<script src="assets/js/texts2.js"></script>
</body>
</html>

View File

@ -334,17 +334,54 @@ if (isset($_GET['id'])) {
<div class="ec-single-price">
<span class="ec-single-ps-title">As low as</span>
<?php
// 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products
if (isset($product_details['sale_price']) && $product_details['sale_price'] > 0) {
echo '<span id="productPrice" class="old-price">' . $product_details['regular_price'] . '</span>';
echo '<span id="productNewPrice" class="new-price">' . $product_details['sale_price'] . '</span>';
} elseif (!isset($product_details['regular_price']) || $product_details['regular_price'] <= 0) {
echo '<span id="productPrice" class="new-price">Contact Seller for Price</span>';
} else {
echo '<span id="productPrice" class="new-price">' . $product_details['regular_price'] . '</span>';
}
// 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products
if ($product_details['product_type'] === "simple") {
if (isset($product_details['sale_price']) && $product_details['sale_price'] > 0) {
echo '<span id="productPrice" class="old-price">' . $product_details['regular_price'] . '</span>';
echo '<span id="productNewPrice" class="new-price">' . $product_details['sale_price'] . '</span>';
} else {
echo '<span id="productPrice" class="new-price">' . $product_details['regular_price'] . '</span>';
}
} elseif ($product_details['product_type'] === "variable") {
$lowest_regular_price = null;
$highest_regular_price = null;
$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>';
} elseif ($lowest_regular_price !== null && $highest_regular_price !== null) {
echo '<span id="productPrice" class="new-price">' . '&#8369;' . $lowest_regular_price . ' - &#8369;' . $highest_regular_price . '</span>';
}
}
?>
</div>
<div class="ec-single-stoke">
<span class="ec-single-ps-title">Stocks Available</span>
@ -352,83 +389,68 @@ if (isset($_GET['id'])) {
</div>
</div>
<!-- 20240212 Jun Jihad Include Parent Product in the Variation Selection -->
<?php
if (isset($variation_details) && is_array($variation_details)) {
?>
<div class="ec-pro-variation">
<div class="ec-pro-variation-inner ec-pro-variation-size">
<span>VARIATION</span>
<div class="ec-pro-variation-content">
<ul class="eccart-pro-items">
<?php
$main_product_image = isset($product_details["product_image"]) ? $product_details["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
?>
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($product_details), ENT_QUOTES, 'UTF-8'); ?>)">
<li style="width: 100px; height: 100px">
<img src="<?php echo $main_product_image; ?>" alt="product">
<?php foreach ($product_details['variables'] as $variable) { ?>
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
<?php } ?>
</li>
</a>
<?php
foreach ($variation_details as $index => $variation) {
$variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
<?php
if (isset($variation_details) && is_array($variation_details)) {
?>
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($variation), ENT_QUOTES, 'UTF-8'); ?>)">
<li style="width: 100px; height: 100px">
<img src="<?php echo $variationImage; ?>" alt="product">
<?php foreach ($variation['variables'] as $variable) { ?>
<p><?php echo $variable['name'] . ': ' . $variable['value']; ?></p>
<?php } ?>
</li>
</a>
<div class="ec-pro-variation">
<div class="ec-pro-variation-inner ec-pro-variation-size">
<span>VARIATION</span>
<div class="ec-pro-variation-content">
<ul class="eccart-pro-items">
<?php
foreach ($variation_details as $index => $variation) {
$variationImage = isset($variation["product_image"]) ? $variation["product_image"] : 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
?>
<a href="javascript:void(0);" onclick="selectVariation(<?php echo htmlspecialchars(json_encode($variation), ENT_QUOTES, 'UTF-8'); ?>)">
<li style="width: 100px; height: 100px">
<img src="<?php echo $variationImage; ?>" alt="product">
</li>
</a>
<?php
}
?>
</ul>
</div>
</div>
</div>
<script>
function selectVariation(variation) {
console.log("Variation selected: ", variation);
document.getElementById("productDescription").innerHTML = variation.specifications;
document.getElementById("shortDescription").innerHTML = variation.product_description;
document.getElementById("productTitle").innerText = variation.product_name;
document.getElementById("product_Id").value = variation._id;
var productImage = variation.product_image || 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
document.getElementById('mainProductImage').src = productImage;
document.getElementById("productTitlemodal").innerText = variation.product_name;
document.getElementById('mainProductImagemodal').src = productImage;
if (variation.regular_price || variation.sale_price) {
// Variation has a price, show "Add to Cart" button
document.getElementById("productPrice").innerText = variation.sale_price ? variation.sale_price : variation.regular_price;
document.getElementById("productStock").innerText = variation.stock;
document.getElementById('addToCartButton').disabled = false;
document.getElementById("addToCartButton").style.display = "block";
document.getElementById("contactSellerButton").style.display = "none";
} else {
// Variation doesn't have a price, show "Contact seller" button
document.getElementById("productPrice").innerText = "Contact seller for price";
document.getElementById("productStock").innerText = "Available";
document.getElementById('addToCartButton').disabled = true;
document.getElementById("addToCartButton").style.display = "none";
document.getElementById("contactSellerButton").style.display = "block";
}
}
</script>
<?php
}
?>
</ul>
</div>
</div>
</div>
<script>
function selectVariation(variation) {
console.log("Variation selected: ", variation);
document.getElementById("productDescription").innerHTML = variation.specifications;
document.getElementById("shortDescription").innerHTML = variation.product_description;
document.getElementById("productTitle").innerText = variation.product_name;
document.getElementById("product_Id").value = variation._id;
var productImage = variation.product_image || 'https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg';
document.getElementById('mainProductImage').src = productImage;
document.getElementById("productTitlemodal").innerText = variation.product_name;
document.getElementById('mainProductImagemodal').src = productImage;
if (variation.regular_price || variation.sale_price) {
document.getElementById("productPrice").innerText = variation.sale_price ? variation.sale_price : variation.regular_price;
document.getElementById("productStock").innerText = variation.stock;
document.getElementById('addToCartButton').disabled = false;
document.getElementById("addToCartButton").style.display = "block";
document.getElementById("contactSellerButton").style.display = "none";
} else {
document.getElementById("productPrice").innerText = "Contact seller for price";
document.getElementById("productStock").innerText = "Available";
document.getElementById('addToCartButton').disabled = true;
document.getElementById("addToCartButton").style.display = "none";
document.getElementById("contactSellerButton").style.display = "block";
}
}
</script>
<?php
}
?>
<!-- 20240212 Jun Jihad Include Parent Product in the Variation Selection -->
<div class="ec-single-qty">
<div class="qty-plus-minuses">
@ -438,43 +460,25 @@ foreach ($variation_details as $index => $variation) {
</div>
<div class="ec-single-cart">
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
<?php
if ($_SESSION["isLoggedIn"]) {
if ($product_details['product_type'] === "variable") {
echo '<button class="btn btn-primary" id="addToCartButton" style="display:none">Add To Cart</button>';
echo '<button type="button" class="btn btn-primary" id="contactSellerButton" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
} else {
if (!empty($product_details['regular_price']) || !empty($product_details['sale_price'])) {
<?php
if ($_SESSION["isLoggedIn"]) {
if ($product_details['product_type'] === "variable") {
echo '<button class="btn btn-primary" id="addToCartButton" disabled>Add To Cart</button>';
echo '<button type="button" class="btn btn-primary" id="contactSellerButton" style="display:none" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
} elseif ($product_details['regular_price'] && $product_details['regular_price'] !== "") {
// For non-variable products with a regular price, show "Add to Cart" button
echo '<div id="addToCartMessage"></div>';
echo '<button class="btn btn-primary" id="addToCartButton">Add To Cart</button>';
} else {
// For non-variable products without a regular price, show "Contact seller" button
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
}
} else {
// If user is not logged in, prompt to log in
echo '<p>Please log in to add to cart.</p>';
}
} else {
echo '<p>Please log in to add to cart.</p>';
}
?>
<!-- 02-13-24 Jun Jihad Contact Seller will appear to Variable products with no price -->
<!-- <?php
// if ($_SESSION["isLoggedIn"]) {
// if ($product_details['product_type'] === "variable") {
// echo '<button class="btn btn-primary" id="addToCartButton" disabled>Add To Cart</button>';
// echo '<button type="button" class="btn btn-primary" id="contactSellerButton" style="display:none" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
// } elseif ($product_details['regular_price'] && $product_details['regular_price'] !== "") {
// echo '<div id="addToCartMessage"></div>';
// echo '<button class="btn btn-primary" id="addToCartButton">Add To Cart</button>';
// } else {
// echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
// }
// } else {
// echo '<p>Please log in to add to cart.</p>';
// }
?> -->
</div>
?>
</div>

View File

@ -1,13 +0,0 @@
<?php
// update_selected_variation.php
// Retrieve the JSON data sent via AJAX
$data = json_decode(file_get_contents('php://input'), true);
// You can process the $data as needed, for example, store it in session
session_start();
$_SESSION['selected_variation'] = $data;
var_dump($_SESSION['selected_variation']);
// You can also return a response if needed
// echo json_encode(['success' => true]);

View File

@ -68,26 +68,6 @@ if ($_SESSION["userId"] <> "") {
});
}
</script>
<!-- raymart added css feb 14 2024 -->
<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;
}
.ec-product-inner .ec-pro-image .ec-pro-actions .wishlist {
position: absolute;
right: 15px;
bottom: 0;
border-radius: 0 0 10px 10px;
}
</style>
</head>
<body class="shop_page" onload="updateCartItemCount(); updateWishItemCount()">
@ -170,10 +150,7 @@ if ($_SESSION["userId"] <> "") {
$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-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content width-100">
<div class="ec-product-inner">
@ -184,18 +161,13 @@ if ($_SESSION["userId"] <> "") {
<img class="main-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" />
<img class="hover-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" />
</a>
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
</div>
<!-- <span class="percentage">20%</span>
<span class="percentage">20%</span>
<a href="#" class="quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
<div class="ec-pro-actions">
<a href="compare.html" class="ec-btn-group compare" title="Compare"><i class="fi fi-rr-arrows-repeat"></i></a>
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
</div>
<div class="ec-pro-content">
@ -843,8 +815,6 @@ if ($_SESSION["userId"] <> "") {
<script src="assets/js/vendor/index.js"></script>
<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>
</body>

View File

@ -1,4 +1,4 @@
<!-- <div class="ec-vendor-block-items">
<div class="ec-vendor-block-items">
<ul>
<li <?php if ($_SERVER['REQUEST_URI'] == '/user-profile.php') echo 'class="active"'; ?>><a href="user-profile.php" id="user-profile-link">User Profile</a></li>
<li <?php if ($_SERVER['REQUEST_URI'] == '/user-history.php') echo 'class="active"'; ?>><a href="user-history.php" id="purchase-history-link">Purchase History</a></li>
@ -8,28 +8,6 @@
</div>
<style>.ec-vendor-block-items ul li.active a {
color: white !important; /* Change the text color */
background-color: #3474d4; /* Change the background color */
padding: 10px;
border-radius: 10px;
}
</style> -->
<?php
$current_page = basename($_SERVER['PHP_SELF']);
?>
<div class="ec-vendor-block-items">
<ul>
<li <?php if ($current_page == 'user-profile.php') echo 'class="active"'; ?>><a href="user-profile.php" id="user-profile-link">User Profile</a></li>
<li <?php if ($current_page == 'user-history.php') echo 'class="active"'; ?>><a href="user-history.php" id="purchase-history-link">Purchase History</a></li>
<li <?php if ($current_page == 'user-refund-history.php') echo 'class="active"'; ?>><a href="user-refund-history.php" id="refund-history-link">User Refund History</a></li>
<li <?php if ($current_page == 'wishlist.php') echo 'class="active"'; ?>><a href="wishlist.php" id="wishlist-link">Wishlist</a></li>
</ul>
</div>
<style>.ec-vendor-block-items ul li.active a {
color: white !important; /* Change the text color */
background-color: #3474d4; /* Change the background color */

View File

@ -119,14 +119,13 @@ $products = productList();
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
<div class="ec-vendor-block-items">
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-uploads-add-product-action.php">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
</ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
</div>
</div>
</div>

View File

@ -127,15 +127,13 @@ if (is_array($vendorOrderss)) {
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
<div class="ec-vendor-block-items">
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a onclick="addProduct();" href="">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
</ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
</div>
</div>
</div>

View File

@ -115,20 +115,19 @@ if ($_SESSION["userId"] <> "") {
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<!-- <div class="ec-vendor-block-items">
<div class="ec-vendor-block-items">
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<!-- <li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-profile.html">Public Profile</a></li>
<li><a href="vendor-uploads.html">Uploads</a></li>
<li><a href="vendor-uploads.php">Uploads</a></li>
<li><a href="#">Track Shipping</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li> -->
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-uploads-add-product-action.php">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
</ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
</div>
</div>
</div>

View File

@ -47,3 +47,4 @@ $response = addProduct(
$array = json_decode($response,true);
$_SESSION['newProductId'] = $array['_id'];
header("location: vendor-uploads.php");
?>

View File

@ -1,22 +0,0 @@
<!-- 2024-02-12 Stacy created this file -->
<?php
$current_page = basename($_SERVER['PHP_SELF']);
?>
<div class="ec-vendor-block-items">
<ul>
<li <?php if ($current_page == 'vendor-dashboard.php') echo 'class="active"'; ?>><a href="vendor-dashboard.php" id="vendor-dashboard-link">Dashboards</a></li>
<li <?php if ($current_page == 'vendor-uploads.php') echo 'class="active"'; ?>><a onclick="addProduct();" id="vendor-uploads-link">Uploads</a></li>
<li <?php if ($current_page == 'vendor-settings.php') echo 'class="active"'; ?>><a href="vendor-settings.php" id="vendor-settings-link">Settings (edit)</a></li>
</ul>
</div>
<style>.ec-vendor-block-items ul li.active a {
color: white !important; /* Change the text color */
background-color: #3474d4; /* Change the background color */
padding: 10px;
border-radius: 10px;
}
</style>
<!-- 2024-02-12 Stacy created this file -->

View File

@ -65,26 +65,6 @@ if ($_SESSION["userId"] <> "") {
});
}
</script>
<!-- raymart added css feb 14 2024 -->
<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;
}
.ec-product-inner .ec-pro-image .ec-pro-actions .wishlist {
position: absolute;
right: 15px;
bottom: 0;
border-radius: 0 0 10px 10px;
}
</style>
</head>
<body onload="updateCartItemCount(); updateWishItemCount()">
@ -145,10 +125,7 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-compare-content">
<div class="ec-compare-inner">
<div class="row margin-minus-b-30">
<?php foreach ($customer['favorites']['products'] as $product) {
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
?>
<?php foreach ($customer['favorites']['products'] as $product) { ?>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-6 mb-6 pro-gl-content">
<div class="ec-product-inner">
<div class="ec-pro-image-outer">
@ -160,10 +137,12 @@ if ($_SESSION["userId"] <> "") {
<span class="ec-com-remove ec-remove-wishlist">
<a href="javascript:void(0)" class="remove-product" data-product-id="<?php echo $product["_id"]; ?>" id="removeItem<?php echo $product["_id"]; ?>">×</a>
</span>
<!-- raymart edit action feb 14 2024 -->
<span class="percentage">20%</span>
<a href="#" class="quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<a href="compare.html" class="ec-btn-group compare" title="Compare"><i class="fi fi-rr-arrows-repeat"></i></a>
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div>
</div>
</div>
@ -678,8 +657,6 @@ if ($_SESSION["userId"] <> "") {
<!-- 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>
</body>