diff --git a/admin/config.php b/admin/config.php index f365e05..c19297a 100644 --- a/admin/config.php +++ b/admin/config.php @@ -1,8 +1,8 @@ - product + + product
- ${response.items[0].product.name} + ${response.items[0].product.name} Unit Price: ${response.items[0].price} @@ -675,13 +677,15 @@ function popupAddToCart(product, productVendor, token, email, password, customer if (cartItem) { var updatedQuantity = response.items[0].quantity; // Use the correct quantity from the updated order var totalAmount = response.items[0].price * updatedQuantity; + var imageUrl = response.items[0].product.product_image ? response.items[0].product.product_image.split(',')[0].trim() : "https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png"; + // If the cart item already exists, update its content using innerHTML cartItem.innerHTML = ` - -product + +product
-${response.items[0].product.name} +${response.items[0].product.name} Unit Price: ${response.items[0].price} diff --git a/catalog-single-vendor.php b/catalog-single-vendor.php index 1d8b0ce..c9b3e87 100644 --- a/catalog-single-vendor.php +++ b/catalog-single-vendor.php @@ -1114,7 +1114,7 @@ if ($_SESSION["userId"] <> "") { '; + echo ''; } else { echo ''; } diff --git a/category-slider.php b/category-slider.php index 01afe66..6905164 100644 --- a/category-slider.php +++ b/category-slider.php @@ -381,34 +381,7 @@
- - - - - - - - - - - - - - - - - - - - - - '; - } else { - echo ''; - } - ?> + \ No newline at end of file diff --git a/checkouttest.php b/checkouttest.php index f0ad9e4..6584c87 100644 --- a/checkouttest.php +++ b/checkouttest.php @@ -577,18 +577,29 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
-
-
- - Product - +
-
+
@@ -599,11 +610,25 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"] x + + - Shipping Fee: + Shipping Fee: - Subtotal: + Subtotal:
diff --git a/header.php b/header.php index 3477429..1b285b4 100644 --- a/header.php +++ b/header.php @@ -228,7 +228,7 @@ ?> -
  • My Account
  • +
  • My Account
  • @@ -378,7 +378,23 @@ $product_data = json_decode($product, true); ?>
  • - product + + + product + + edit + +
    diff --git a/index.php b/index.php index 1d282a0..585ec0e 100644 --- a/index.php +++ b/index.php @@ -1819,7 +1819,7 @@ if ($_SESSION["userId"] <> "") { '; + echo ''; } else { echo ''; } diff --git a/product-left-sidebar.php b/product-left-sidebar.php index 0c7ec8f..b4ffbf2 100644 --- a/product-left-sidebar.php +++ b/product-left-sidebar.php @@ -1945,7 +1945,7 @@ if (isset($_GET['id'])) { '; + echo ''; } else { echo ''; } diff --git a/same_day_delivery.php b/same_day_delivery.php index 293e25b..95416dc 100644 --- a/same_day_delivery.php +++ b/same_day_delivery.php @@ -900,7 +900,7 @@ if ($_SESSION["userId"] <> "") { '; + echo ''; } else { echo ''; } diff --git a/shop-list-left-sidebar-action.php b/shop-list-left-sidebar-action.php index 88b8ccb..8b2c92d 100644 --- a/shop-list-left-sidebar-action.php +++ b/shop-list-left-sidebar-action.php @@ -4,13 +4,16 @@ $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
    "; + + + echo $categoryFinal; // You can add your logic here } $minPrice = isset($_POST['minPrice']) ? $_POST['minPrice'] : null; diff --git a/shop-list-left-sidebar.php b/shop-list-left-sidebar.php index f8dad2f..64e7732 100644 --- a/shop-list-left-sidebar.php +++ b/shop-list-left-sidebar.php @@ -15,90 +15,55 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"]; // 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") . "
    "; - echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "
    "; - 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 ($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") . "
    "; - echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "
    "; + // echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "
    "; + // echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "
    "; $selectedCategories = isset($_GET['category']) ? $_GET['category'] : []; - - if (!empty($selectedCategories)) { + + if (!empty($selectedCategories) && (($minPrice == null) && ($maxPrice == null))) { 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) + $productCategory == $category ) { $filteredProducts[] = $result; - } + } } } - } else { + } elseif (!empty($selectedCategories) && (!empty($minPrice) || !empty($maxPrice))) { + if ($minPrice === null) { + $minPrice = 0; + } + if ($maxPrice === null) { + $maxPrice = PHP_FLOAT_MAX; + } + foreach ($selectedCategories as $selectedCategory) { + $category = strtolower(trim($selectedCategory)); + foreach ($productSearchResult['results'] as $result) { + $product = $result['product']; + $productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price']; + $productCategory = strtolower(trim($product['product_category'])); + if ( + $productCategory = $category && (($productPrice >= $minPrice) && + ($productPrice <= $maxPrice)) + ) { + $filteredProducts[] = $result; + } + } + } + } + else { foreach ($productSearchResult['results'] as $result) { $product = $result['product']; $productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price']; @@ -108,7 +73,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate if ($maxPrice === null) { $maxPrice = PHP_FLOAT_MAX; - } + } if (($minPrice === null || $productPrice >= $minPrice) && ($maxPrice === null || $productPrice <= $maxPrice) ) { @@ -342,18 +307,35 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate for ($x = $startIndex; $x <= $endIndex; $x++) { $product = $filteredProducts[$x]['product']; $vendorOfProduct = getVendorbyId($product['vendor_api_id']); - $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"; + // $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; ?>
    -
    +
    - + "> + + edit + + edit + + +
    @@ -1016,7 +998,13 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate - + '; + } else { + echo ''; + } + ?> diff --git a/shop-list-left-sidebar2.php b/shop-list-left-sidebar2.php index c4a9748..3737ac5 100644 --- a/shop-list-left-sidebar2.php +++ b/shop-list-left-sidebar2.php @@ -872,7 +872,7 @@ if ($_SESSION["userId"] <> "") { '; + echo ''; } else { echo ''; } diff --git a/wishlist.php b/wishlist.php index a1e189d..353d5f6 100644 --- a/wishlist.php +++ b/wishlist.php @@ -770,10 +770,10 @@ if ($_SESSION["userId"] <> "") { - + '; + echo ''; } else { echo ''; }