From 354ac8a242b0525dd055ae257774b7e8d4247b55 Mon Sep 17 00:00:00 2001 From: Jaroslav Drzik Date: Sun, 4 Feb 2024 19:35:22 +0100 Subject: [PATCH] Basic online search with bugs... --- .DS_Store | Bin 0 -> 6148 bytes Taskfile.yml | 4 + app/Console/Commands/IkeaPrices.php | 10 +- app/Console/Commands/OnlineTestCommand.php | 36 ++ app/Console/Commands/TestOnline.php | 37 ++ .../Controllers/CountryCompareController.php | 109 +++--- .../Controllers/IkeaProductsController.php | 2 +- .../Controllers/OnlineCompareController.php | 326 ++++++++++++++++++ .../Controllers/ProductsCompareController.php | 86 +++-- resources/js/Pages/IkeaRoot.vue | 32 +- routes/web.php | 3 +- 11 files changed, 549 insertions(+), 96 deletions(-) create mode 100644 .DS_Store create mode 100644 app/Console/Commands/OnlineTestCommand.php create mode 100644 app/Console/Commands/TestOnline.php create mode 100644 app/Http/Controllers/OnlineCompareController.php diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b168a04787fe9c2edec5e2e98abc8f3642a36ad6 GIT binary patch literal 6148 zcmeHKOKQVF43%0F4B2Gasj*T%fdWR;7lNcI{Qq)uZLJ(U&CHxCn7D}P<|}T&Cbnd_K+C`!g0qa=hN`{`ZA91v+Cu9aX0cUZ}K6- z4gBR>nWX|$fC^9nDnJF+6tLb4Yqx=nRDcRlfj`b@ z02WICYvL4$3`~Ox465dcp+QH!WL-_10)sA^!-wXRH76AHr{n(O<)Sr^kqS_OYXu%- zyR-g(fUnH|*Cg(!02R0^1+?jpeTP@d-a30Z>$L^`47ZwJxEaargument('article'); $responses = $countryCompareController->makeRequests($article); - $prices = $countryCompareController->processResponse($responses,$article); - //dd($prices); - return 0; + $products = $countryCompareController->processResponse($responses,$article); + + dd($products); } } diff --git a/app/Console/Commands/OnlineTestCommand.php b/app/Console/Commands/OnlineTestCommand.php new file mode 100644 index 0000000..8801802 --- /dev/null +++ b/app/Console/Commands/OnlineTestCommand.php @@ -0,0 +1,36 @@ +argument('article'); + $prices = $onlineCompareController->compare(); + dd($prices); + return 0; + } +} diff --git a/app/Console/Commands/TestOnline.php b/app/Console/Commands/TestOnline.php new file mode 100644 index 0000000..20ebd87 --- /dev/null +++ b/app/Console/Commands/TestOnline.php @@ -0,0 +1,37 @@ +argument('article'); + $prices = $onlineCompareController->compare(); + dd($prices); + return 0; + } +} + diff --git a/app/Http/Controllers/CountryCompareController.php b/app/Http/Controllers/CountryCompareController.php index b84b47b..7790cf1 100644 --- a/app/Http/Controllers/CountryCompareController.php +++ b/app/Http/Controllers/CountryCompareController.php @@ -12,15 +12,19 @@ use PHPHtmlParser\Dom; class CountryCompareController extends Controller { private $countries = []; + private $cHash = []; public function __construct() { $countries = []; - CountryCode::all()->each(function ($country) use (&$countries) { - $countries[] = $country->country_name; + $cHash = []; + CountryCode::active('Y')->each(function ($country) use (&$countries, &$cHash) { + $countries[] = $country; + $cHash[$country->country_name] = $country->country_code; }); $this->countries = collect($countries); + $this->cHash = collect($cHash); } public function search(Request $request) { @@ -31,13 +35,16 @@ class CountryCompareController extends Controller return $this->processResponse($requests,$ta_codes[0]); } + public function compare($countries, $cHash, $aCodes){ + $requests = $this->makeRequests($aCodes); + return $this->processResponse($requests, $aCodes); + } public function makeRequests($ta_code) { $requests = Http::pool(fn (Pool $pool) => [ - CountryCode::all()->each(function ($countryCode) use ($pool, $ta_code) { - $this->countries[] = $countryCode->country_name; - Log::info('Getting page {url}', [ 'url' => $countryCode->search_url . $ta_code ] ); - return $pool->as($countryCode->country_name)->get($countryCode->search_url . $ta_code); + $this->countries->each(function ($country) use ($pool, $ta_code) { + Log::info('Getting page {url}', [ 'url' => $country->search_url . $ta_code ] ); + return $pool->as($country->country_code)->get($country->search_url . $ta_code); }) ]); return $requests; @@ -45,9 +52,9 @@ class CountryCompareController extends Controller public function makeRequest($ta_code, $country) { - $countryCode = CountryCode::where('country_name', $country)->first(); + $country = CountryCode::where('country_name', $country)->first(); return Http::pool(fn (Pool $pool) => [ - $pool->as($countryCode->country_name)->get($countryCode->search_url . $ta_code) + $pool->as($country->country_name)->get($country->search_url . $ta_code) ]); } @@ -55,38 +62,49 @@ class CountryCompareController extends Controller { $prices = []; - foreach ($this->countries as $country) { + foreach ($this->countries as $c) { - if (isset($responses[$country]) && $responses[$country]->ok()) { + $country = $c->country_code; + + if ($responses[$country] instanceof \Illuminate\Http\Client\Response && $responses[$country]->ok()) { $response = $responses[$country]->body(); switch ($country) { - case "Bulgaria": - case "Cyprus": - case "Greece": - $prices[$country] = $this->parseJson_CY_GR_BG($code, (string) $response); + case "BG": + case "BY": + case "GR": + $prices[$country] = $this->parseJson_CY_GR_BG($code, (string) $response, $country); break; - case "Iceland": - $prices[$country] = $this->parseJson_IS($country, $code, (string) $response); + case "IS": + $prices[$country] = $this->parseJson_IS($code, (string) $response, $country); break; - case "Türkiye": - $prices[$country] = $this->parseJson_TR((string) $response); + case "TR": + $prices[$country] = $this->parseJson_TR((string) $response, $country); break; - case "Lithuania": - case "Estonia": - case "Latvia": - $prices[$country] = $this->parseJson_EE_LT_LV($country, $code, (string) $response); + case "EE": + case "LT": + case "LV": + $prices[$country] = $this->parseJson_EE_LT_LV($code, (string) $response, $country); break; default: - $prices[$country] = $this->parseJson((string) $response); + $prices[$country] = $this->parseJson((string) $response, $country); } } } - return $prices; + $products = []; + collect($prices)->each(function ($price) use (&$products) { + if (count($price)) + $products[] = $price; + }); + return collect($products); } - public function parseJson($json_raw) + + // { "country": "AT", "code": "50161321", "url": "https://www.ikea.com/at/de/p/hol-aufbewahrungstisch-akazie-50161321/", "name": "HOL", "typeName": "Aufbewahrungstisch", "mainImageUrl": "https://www.ikea.com/at/de/images/products/hol-aufbewahrungstisch-akazie__0104310_pe251255_s5.jpg", "itemNoGlobal": "50161321", "salesPrice": "80.99", "tag": "FAMILY_PRICE", "last_mod": "2023-12-03 16:44:24" }, + + public function parseJson($json_raw, $country) { + try { $json_values = array(); $json_decoded = json_decode($json_raw, true); @@ -103,18 +121,21 @@ class CountryCompareController extends Controller $numeral = $salesPrice["numeral"]; $json_values = array( - 'url_product' => $product['pipUrl'], + 'url' => $product['pipUrl'], 'tag' => $product['tag'], - 'price' => $numeral, - 'price_eur' => 0 + 'country' => $country, + 'salesPrice' => $numeral, ); break; } +} catch (\Exception $e) { + return []; +} return $json_values; } - public function parseJson_TR($body) + public function parseJson_TR($body,$country) { //echo "country: " . $country . ", code: " . $code . "
"; @@ -132,16 +153,16 @@ class CountryCompareController extends Controller $price = floatval(trim(str_replace('.', '', $price))); $json_values = array( - 'url_product' => $url_product, + 'url' => $url_product, 'tag' => null, 'price' => floatval($price), - 'price_eur' => 0 + 'country' => $country, ); return $json_values; } - public function parseJson_CY_GR_BG($code, $body) + public function parseJson_CY_GR_BG($code, $body , $country) { //echo "country: " . $country . ", code: " . $code . "
"; @@ -163,16 +184,16 @@ class CountryCompareController extends Controller $json_values = array( - 'url_product' => $url_product, + 'url' => $url_product, 'tag' => null, 'price' => floatval($price), - 'price_eur' => 0 + 'country' => $country, ); return $json_values; } - public function parseJson_EE_LT_LV($country, $code, $body) + public function parseJson_EE_LT_LV($code, $body, $country) { //echo "country: " . $country . ", code: " . $code . "
"; @@ -192,13 +213,13 @@ class CountryCompareController extends Controller } switch ($country) { - case "Estonia": + case "EE": $url_product = "https://www.ikea.ee" . $xpath->query('//*/div[(@class="card-header")]/a/@href')[0]->nodeValue; break; - case "Lithuania": + case "LT": $url_product = "https://www.ikea.lt" . $xpath->query('//*/div[(@class="card-header")]/a/@href')[0]->nodeValue; break; - case "Latvia": + case "LV": $url_product = "https://www.ikea.lv" . $xpath->query('//*/div[(@class="card-header")]/a/@href')[0]->nodeValue; break; default: @@ -215,17 +236,16 @@ class CountryCompareController extends Controller $price = floatval(trim(str_replace(' ', '', str_replace(',', '.', str_replace(array('€'), '', $price))))); $json_values = array( - 'url_product' => $url_product, - //$url_product, + 'url' => $url_product, 'tag' => null, 'price' => $price, - 'price_eur' => 0 + 'country' => $country, ); return $json_values; } - public function parseJson_IS($country, $code, $body) + public function parseJson_IS($code, $body, $country) { //echo "country: " . $country . ", code: " . $code . "
"; @@ -258,11 +278,10 @@ class CountryCompareController extends Controller $price = floatval(trim(str_replace(' ', '', str_replace(',', '.', str_replace('.', '', str_replace(array('€'), '', $price)))))); $json_values = array( - 'url_product' => $url_product, - //$url_product, + 'url' => $url_product, 'tag' => null, 'price' => $price, - 'price_eur' => 0 + 'country' => $country, ); return $json_values; diff --git a/app/Http/Controllers/IkeaProductsController.php b/app/Http/Controllers/IkeaProductsController.php index 7345954..78e46b2 100644 --- a/app/Http/Controllers/IkeaProductsController.php +++ b/app/Http/Controllers/IkeaProductsController.php @@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Log; class IkeaProductsController extends Controller { - public function search(Request $request, string $field, string $text, ?string $country = '') + public function search(Request $request, string $field, string $text, ?string $country = '', $online = false) { return IkeaProducts::search($field, $text, $country); } diff --git a/app/Http/Controllers/OnlineCompareController.php b/app/Http/Controllers/OnlineCompareController.php new file mode 100644 index 0000000..62e3553 --- /dev/null +++ b/app/Http/Controllers/OnlineCompareController.php @@ -0,0 +1,326 @@ + $product['pipUrl'], + 'tag' => $product['tag'], + 'price' => $numeral, + 'price_eur' => 0 + ); + + break; + } + + return $json_values; +} + +function parseJson_TR($body) +{ + //echo "country: " . $country . ", code: " . $code . "
"; + + $dochtml = new \DOMDocument(); + $dochtml->loadHTML($body); + + $xpath = new \DOMXpath($dochtml); + $price = null; + //$c = ltrim($code, "0"); + $json_values = array(); + + $url_product = $xpath->query('/html/head/meta[(@property="og:url")]/@content')[0]->nodeValue; + $price = $xpath->query('/html/head/meta[(@property="og:price:amount")]/@content')[0]->nodeValue; + + $price = floatval(trim(str_replace('.', '', $price))); + + $json_values = array( + 'url_product' => $url_product, + 'tag' => null, + 'price' => floatval($price), + 'price_eur' => 0 + ); + + return $json_values; +} + +function parseJson_CY_GR_BG($code, $body) +{ + //echo "country: " . $country . ", code: " . $code . "
"; + + $dochtml = new \DOMDocument(); + $dochtml->loadHTML($body); + + $xpath = new \DOMXpath($dochtml); + $price = null; + $c = ltrim($code, "0"); + $json_values = array(); + + $price = $xpath->query('//*/div[(@class="yotpo yotpo-main-widget" and @data-product-id="' . $code . '")]/@data-price')[0]->nodeValue; + $url_product = $xpath->query('//*/div[(@class="yotpo yotpo-main-widget" and @data-product-id="' . $code . '")]/@data-url')[0]->nodeValue; + + $price = floatval($price); + + + $json_values = array( + 'url_product' => $url_product, + 'tag' => null, + 'price' => floatval($price), + 'price_eur' => 0 + ); + + return $json_values; +} + +function parseJson_EE_LT_LV($country, $code, $body) +{ + //echo "country: " . $country . ", code: " . $code . "
"; + + $dochtml = new \DOMDocument(); + $dochtml->loadHTML($body); + + $xpath = new \DOMXpath($dochtml); + $price = null; + $c = ltrim($code, "0"); + $json_values = array(); + + $price = $xpath->query('//*/div[(@class="itemPriceBox" and @data-item="' . $c . '")]//p[@class="itemNormalPrice display-6"]/span')[0]->nodeValue; + + if (is_null($price) || empty($price)) { + $price = $xpath->query('//*/div[(@class="itemPriceBox" and @data-item="' . $c . '")]//div[@class="itemBTI display-6"]/span')[0]->nodeValue; + } + + switch ($country) { + case "Estonia": + $url_product = "https://www.ikea.ee" . $xpath->query('//*/div[(@class="card-header")]/a/@href')[0]->nodeValue; + break; + case "Lithuania": + $url_product = "https://www.ikea.lt" . $xpath->query('//*/div[(@class="card-header")]/a/@href')[0]->nodeValue; + break; + case "Latvia": + $url_product = "https://www.ikea.lv" . $xpath->query('//*/div[(@class="card-header")]/a/@href')[0]->nodeValue; + break; + default: + $url_product = null; + } + + if (is_null($price) || empty($price)) { + $url_product = null; + } + + $price = floatval(trim(str_replace(' ', '', str_replace(',', '.', str_replace(array('€'), '', $price))))); + + $json_values = array( + 'url_product' => $url_product, + //$url_product, + 'tag' => null, + 'price' => $price, + 'price_eur' => 0 + ); + + return $json_values; +} + +function parseJson_IS($country, $code, $body) +{ + //echo "country: " . $country . ", code: " . $code . "
"; + + $dochtml = new \DOMDocument(); + $dochtml->loadHTML($body); + + $xpath = new \DOMXpath($dochtml); + $price = null; + $c = ltrim($code, "0"); + $json_values = array(); + + $price = $xpath->query('//*/div[(@class="itemPriceBox")]//p[@class="itemNormalPrice revamp_price price"]/span/span')[0]->nodeValue; + + if (is_null($price) || empty($price)) { + $price = $xpath->query('//*/div[(@class="itemPriceBox")]//p[@class="itemBTI display-6 revamp_price price"]/span/span')[0]->nodeValue; + } + + $url_product = "https://www.ikea.is" . $xpath->query('/html/head/meta[(@property="og:url")]/@content')[0]->nodeValue; + + //echo "url_product: " . $url_product . "
"; + + if (is_null($price) || empty($price)) { + $url_product = null; + } + + $price = floatval(trim(str_replace(' ', '', str_replace(',', '.', str_replace('.', '', str_replace(array('€'), '', $price)))))); + + $json_values = array( + 'url_product' => $url_product, + //$url_product, + 'tag' => null, + 'price' => $price, + 'price_eur' => 0 + ); + + return $json_values; +} + +class OnlineCompareController extends Controller +{ + private $countries = []; + public function __construct() + { + $countries = []; + CountryCode::all()->each(function ($country) use (&$countries) { + $countries[] = $country->country_name; + }); + + $this->countries = collect($countries); + } + public function compare() + { + // $codes = $request->input("codes"); + // $countries = $request->input("countries"); + // $currency = $request->input("currency"); + $codes = ['00102452',]; + $countries = ['Austria', 'Belgium']; + $ta_codes = $codes; + $exch_rates = "EUR"; + + $item = array(); + $codes = array(); + + // krajiny ktore som pridal do zoznamu z DB + $added_countries[] = null; + + // loop cez jednotlive code z textarea a pridanie url + /* ******************************************************************** */ + foreach ($ta_codes as $code) { + unset($item); + + if (!is_numeric($code) || strlen($code) < 6) { + continue; + } + + foreach ($countries as $country) { + + if (!in_array($country['country_name'], $added_countries)) { + + $item[] = array( + 'country_name' => $country['country_name'], + 'url_call' => $country['search_url'] . $code, + 'price' => 0, + 'url_product' => null, + 'tag' => null + ); + } + } + + $codes[] = array( + 'code' => $code, + 'item' => $item + ); + } + //echo var_dump($codes); + + /* ******************************************************************** */ + + + + // paralelene prevolanie URL + /* ******************************************************************** */ + $client = new GuzzleClient(['timeout' => 12.0]); + + $promises[] = null; + $prices[] = null; + + foreach ($codes as $x => $code) { + //echo "CODE: " . $code_value['code'] . "
"; + + unset($promises); + unset($responses); + unset($prices); + + // naplnenie pola promises URL + foreach ($code['item'] as $i => $i_value) { + if (!is_null($i_value['url_call'])) { + $promises[$i_value['country_name']] = $client->getAsync($i_value['url_call']); + } + } + + $responses = GuzzlePromise\settle($promises)->wait(); + + foreach ($responses as $country => $response) { + + if ($response['state'] === 'fulfilled') { + $response_value = $response['value']; + + if ($response_value->getStatusCode() == 200) { + + switch ($country) { + case "Bulgaria": + case "Cyprus": + case "Greece": + $prices[$country] = parseJson_CY_GR_BG($code['code'], (string) $response_value->body()); + break; + case "Iceland": + $prices[$country] = parseJson_IS($country, $code['code'], (string) $response_value->body()); + break; + case "Turkey": + $prices[$country] = parseJson_TR((string) $response_value->body()); + break; + case "Lithuania": + case "Estonia": + case "Latvia": + $prices[$country] = parseJson_EE_LT_LV($country, $code['code'], (string) $response_value->body()); + break; + default: + $prices[$country] = parseJson((string) $response_value->body()); + } + } + } + } + /* {"products":{"Illuminate\\Database\\Eloquent\\Collection":[{"country":"AT","code":"00222671","url":"https://www.ikea.com/at +/de/p/vardoe-bettkasten-weiss-00222671/","name":"VARDÖ","typeName":"Bettkasten","mainImageUrl":"https://www.ikea.com/at/de/images/products/vardoe-bettkasten-weiss__0636 +223_pe697736_s5.jpg","itemNoGlobal":"00222671","salesPrice":"34.99","tag":"NONE","last_mod":"2024-01-04 15:41:48","mainImageAlt":"VARDÖ Bettkasten, weiß, 65x70 cm","pri +ceUnit":null,"countryName":"Austria"} */ + + // zistenu cenu doplnim do kolekcie + foreach ($code['item'] as $i => $i_value) { + asort($codes[$x]['item']); // zotriedenie + $codes[$x]['item'][$i]['salesPrice'] = $prices[$i_value['country_name']]['price'] ?? 0; + + + if ($prices[$i_value['country_name']]['tag'] == 'NONE') { + $codes[$x]['item'][$i]['tag'] = ""; + } else { + $codes[$x]['item'][$i]['tag'] = $prices[$i_value['country_name']]['tag']; + } + + $codes[$x]['item'][$i]['url'] = $prices[$i_value['country_name']]['url_product']; + } + } + /* ******************************************************************** */ + + + // vypis do tabulky + /* ******************************************************************** */ + return $codes; + } +} diff --git a/app/Http/Controllers/ProductsCompareController.php b/app/Http/Controllers/ProductsCompareController.php index b937591..7783456 100644 --- a/app/Http/Controllers/ProductsCompareController.php +++ b/app/Http/Controllers/ProductsCompareController.php @@ -10,50 +10,60 @@ use Illuminate\Support\Facades\Log; use App\Models\CountryCode; use App\Models\CurrencyRates; use Inertia\Inertia; +use App\Http\Controllers\CountryCompareController; class ProductsCompareController extends Controller { - public function compare(Request $request) - { - $codes = $request->input("codes"); - $countries = $request->input("countries"); - $currency = $request->input("currency"); - - Log::info("{codes} {countries}", ["codes" => $codes, "countries" => $countries]); - - $codes = collect($codes); - $countries = collect($countries); - - if ($countries != null && count($countries)) { - $hCountry = CountryCode::countryHash(); - $countries = $countries->map(function ($country) use ($hCountry) { - return $hCountry[$country]; - }); - } else { - $countries = []; + private $countryCompareController; + public function __construct(CountryCompareController $countryCompareController) + { + $this->countryCompareController = $countryCompareController; } + public function compare(Request $request) + { + $codes = $request->input("codes"); + $countries = $request->input("countries"); + $online = $request->input("online"); - $cHash = CountryCode::code_countryHash(); - if (is_array($codes) == false) - $aCodes = $codes; - else - $aCodes = $codes->map(function ($code) { - return $code; - }); + Log::info("{codes} {countries}", ["codes" => $codes, "countries" => $countries, "online" => $online]); - $products = IkeaProducts::whereIn("code", $aCodes); - if (count($countries)) $products->whereIn("country",$countries); - $products = $products->get(); + $codes = collect($codes); + $countries = collect($countries); + if ($countries != null && count($countries)) { + $hCountry = CountryCode::countryHash(); + $countries = $countries->map(function ($country) use ($hCountry) { + return $hCountry[$country]; + }); + } else { + $countries = []; + } - $products = $products->map(function ($product) use ( $cHash) { - $product["countryName"] = $cHash[$product["country"]]; - return $product; - }); - Log::info("{products}", ["products" => $products]); - return [ - 'products' => $products, - 'countryHash' => $cHash, - ]; - } + $cHash = CountryCode::code_countryHash(); + if (is_array($codes) == false) + $aCodes = $codes; + else + $aCodes = $codes->map(function ($code) { + return $code; + }); + + if ($online == true) { + Log::info("ONLINE {codes} {countries}", ["codes" => $codes, "countries" => $countries, "online" => $online]); + $products = $this->countryCompareController->compare($countries, $cHash, $aCodes); + } else { + $products = IkeaProducts::whereIn("code", $aCodes); + if (count($countries)) $products->whereIn("country", $countries); + $products = $products->get(); + } + + $products = $products->map(function ($product) use ($cHash) { + $product["countryName"] = $cHash[$product["country"]]; + return $product; + }); + Log::info("{products}", ["products" => $products]); + return [ + 'products' => $products, + 'countryHash' => $cHash, + ]; + } } diff --git a/resources/js/Pages/IkeaRoot.vue b/resources/js/Pages/IkeaRoot.vue index b139aee..563f880 100644 --- a/resources/js/Pages/IkeaRoot.vue +++ b/resources/js/Pages/IkeaRoot.vue @@ -168,6 +168,7 @@ const form = useForm({ field: sdropdown.value[0], text: "", currency: "EUR", + online: false, }); const ccodes = ref([]); @@ -208,6 +209,11 @@ const sleep = (ms) => { return new Promise((resolve) => setTimeout(resolve, ms)); }; +const onSelectCode = () => { + if (form.field.value == 'code') { + + } +} const fetch = async () => { try { const response = await axios.get(route("ccountry.active")); @@ -302,12 +308,8 @@ const async_search = async () => { let country = null; if (form.country.code !== undefined) country = form.country.code; - console.log( - "SEARCH", - route("products.search", [form.field.value, form.text, country]) - ); const response = await axios.get( - route("products.search", [form.field.value, form.text, country]) + route("products.search", [form.field.value, form.text, country, form.online]) ); options_items.value = response.data.map((i) => { @@ -323,6 +325,9 @@ const async_search = async () => { }; }); console.log("VALUES=", options_items.value); + if (form.field.value == 'code') { + showRow({'code': form.text}); + } productsCriteria.value = null; } catch (e) { const response = await Swal.fire({ @@ -367,6 +372,7 @@ const showRow = async (item) => { codes: item.code, countries: form.countries, currency: form.currency, + online: form.online, }); products.value = response.data.products; @@ -473,7 +479,7 @@ watch(ccodes, (codes) => {
-
+
Dynamic search: @@ -486,6 +492,19 @@ watch(ccodes, (codes) => { />
+
+
+ Online: +
+
+ +
+
Search in: @@ -499,6 +518,7 @@ watch(ccodes, (codes) => { :options="sdropdown" track-by="value" label="text" + @select="onSelectCode" >
diff --git a/routes/web.php b/routes/web.php index 21eebb1..b38b450 100644 --- a/routes/web.php +++ b/routes/web.php @@ -10,6 +10,7 @@ use App\Http\Controllers\IkeaProductsController; use App\Http\Controllers\ProductsCompareController; use App\Http\Controllers\FeedbackController; use App\Http\Controllers\SettingsController; +use App\Http\Controllers\OnlineCompareController; /* |-------------------------------------------------------------------------- | Web Routes @@ -31,7 +32,7 @@ Route::get('/exchange/', function () { return Inertia::render('IkeaExchange'); })->name('exchange'); Route::post('users-send-email', [FeedbackController::class, 'sendEmail'])->name('ajax.send.email'); - +Route::get('/products/online', [OnlineCompareController::class,'compare'])->name('products.online.compare'); Route::get('/menu/get', [App\Http\Controllers\Superuser\UserMenuController::class, 'get'])->name('menu.user'); Route::get('/ip/get/{ip?}', [GeoIPController::class, 'index'])->name('geo.ip.get'); Route::get('/ccountry/', [CountryCodeController::class, 'index'])->name('ccountry.index');