diff --git a/functions.php b/functions.php index 28a9656..cffbd8a 100644 --- a/functions.php +++ b/functions.php @@ -136,7 +136,43 @@ function searchProducts($query) $query = 'asus'; $result = searchProducts($query); +// +function searchVendor($query) +{ + $query = str_replace(" ", "+", $query); + $url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/search?q=$query"; + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt_array($curl, array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'X-Api-Key: {{apiKey}}' + ), + )); + $response = curl_exec($curl); + curl_close($curl); + $data = json_decode($response, true); + // Check if there are no results + if (empty($data['results'])) { + // $data['message'] = 'No products available for the given query.'; + $data['results'] = []; + } + + return json_encode($data); +} +// + + +// Example usage: +$query = 'asus'; +$result = searchProducts($query); // function searchProducts($query) // { diff --git a/more-vendors.php b/more-vendors.php new file mode 100644 index 0000000..4048719 --- /dev/null +++ b/more-vendors.php @@ -0,0 +1,465 @@ + + "") { + $_SESSION["isLoggedIn"] = true; + $customer_data = getCustomerbyLoginId($_SESSION["userId"]); +} else { + $_SESSION["isLoggedIn"] = false; +} +$productSearchResult = $_SESSION["productSearchResult"]; +$vendorSearchResult = $_SESSION["vendorSearchResult"]; + +?> + + + + + + + + + oBanana B2B - Elevate Your Business + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+

Shop

+
+
+ + + +
+
+
+
+
+
+ + + +
+
+
+ +
+
+ + + + + + + + +
+
+
+
+ +
+
+ 3 +
+
+ +
+
+ 4 +
+
+ +
+ +
+
+
+ + + +
+ payment image +
+

Someone in new just bought

+
stylish baby shoes
+

10 Minutes ago

+
+ × +
+ + + +
+ +
+
+ 3 +
+
+ + + +
+ +
+ +
+ Need Help? +

Chat with us on WhatsApp

+
+ + +
+ + +
+
+
+ whatsapp icon +
+
+
+ +
+ + + +
+
+
+

Features

+
+ + icon + +
+
+

Color Scheme

+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+

Backgrounds

+ +
+
+

Full Screen mode

+
+
+
Mode
+
On
+
Off
+
+
+
+
+

Dark mode

+
+
+
Mode
+
On
+
Off
+
+
+
+
+

RTL mode

+
+
+
Rtl
+
On
+
Off
+
+
+
+
+

Clear local storage

+ Clear Cache & Default +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/search_product_action.php b/search_product_action.php index a6b0ba8..bc5c0a1 100644 --- a/search_product_action.php +++ b/search_product_action.php @@ -16,10 +16,15 @@ $result = searchProducts( $category); } else { $result = searchProducts($_GET["searchText"]); + $result2 = searchVendor($_GET["searchText"]); } $array = json_decode($result,true); + $array2 = json_decode($result2,true); + $_SESSION["productSearchResult"] = $array; + $_SESSION["vendorSearchResult"] = $array2; + header("location: shop-list-left-sidebar.php"); diff --git a/shop-list-left-sidebar.php b/shop-list-left-sidebar.php index a5b085f..f8dad2f 100644 --- a/shop-list-left-sidebar.php +++ b/shop-list-left-sidebar.php @@ -9,6 +9,10 @@ if ($_SESSION["userId"] <> "") { $_SESSION["isLoggedIn"] = false; } $productSearchResult = $_SESSION["productSearchResult"]; +$vendorSearchResult = $_SESSION["vendorSearchResult"]; + + + // 02-19-2024 Jun Jihad Search Filter $filteredProducts = []; if ($_SERVER["REQUEST_METHOD"] == "POST") { @@ -257,7 +261,74 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate + + +
+
+
Vendor Search Results
+ +
+ More Vendors> +
+
+ +
+
+
+
+
+ + <?php echo $vendor['user_login']; ?> + + + +
+ +
+
+
Seller Products
+ +

+
+
+
+
+
Seller since
+

+
+
+
+
+
+
+ +
+
+
+ + +