Skip to content

Commit f79a758

Browse files
authored
InstantSearch migration (#706)
1 parent f42206f commit f79a758

File tree

132 files changed

+3433
-2008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+3433
-2008
lines changed

composer.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@
1717
"prefer-stable": true,
1818
"require": {
1919
"php": "^8.2",
20-
"rapidez/laravel-multi-cache": "^2.0",
2120
"blade-ui-kit/blade-heroicons": "^2.6",
21+
"blade-ui-kit/blade-icons": "^1.8",
22+
"http-interop/http-factory-guzzle": "^1.2",
2223
"illuminate/database": "^11.0|^12.0",
2324
"illuminate/events": "^11.0|^12.0",
2425
"illuminate/queue": "^11.0|^12.0",
2526
"illuminate/support": "^11.0|^12.0",
2627
"justbetter/laravel-http3earlyhints": "^1.4",
28+
"laravel/scout": "^10.14",
2729
"lcobucci/clock": "^2.0|^3.2",
2830
"lcobucci/jwt": "^4.0|^5.3",
29-
"mailerlite/laravel-elasticsearch": "^11.2",
31+
"matchish/laravel-scout-elasticsearch": "^7.11",
3032
"rapidez/blade-components": "^1.8",
3133
"rapidez/blade-directives": "^1.1",
34+
"rapidez/laravel-multi-cache": "^2.0",
3235
"tormjens/eventy": "^0.8"
3336
},
3437
"require-dev": {
@@ -52,12 +55,16 @@
5255
}
5356
},
5457
"config": {
55-
"sort-packages": true
58+
"sort-packages": true,
59+
"allow-plugins": {
60+
"php-http/discovery": true
61+
}
5662
},
5763
"extra": {
5864
"laravel": {
5965
"providers": [
60-
"Rapidez\\Core\\RapidezServiceProvider"
66+
"Rapidez\\Core\\RapidezServiceProvider",
67+
"Matchish\\ScoutElasticSearch\\ElasticSearchServiceProvider"
6168
],
6269
"aliases": {
6370
"Rapidez": "Rapidez\\Core\\Facades\\Rapidez"

config/rapidez/frontend.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
'exposed' => [
66
'store',
77
'es_url',
8-
'es_prefix',
98
'media_url',
109
'magento_url',
1110
'notifications',
@@ -21,38 +20,32 @@
2120
],
2221

2322
// The checkout steps which are used to name the steps
24-
// in the url and in the progressbar on steps. You can
25-
// add different steps for different stores. Keep
23+
// in the url and in the progressbar on steps. Keep
2624
// them lowercase and do not include any spaces.
2725
'checkout_steps' => [
28-
// 'default' => ['onestep'],
29-
'default' => ['login', 'credentials', 'payment'],
26+
'login', 'credentials', 'payment',
27+
// 'onestep',
3028
],
3129

3230
'autocomplete' => [
3331
// Attach additional indexes to the autocomplete
3432
// Uses the views in rapidez::layouts.partials.header.autocomplete
3533
'additionals' => [
36-
'categories' => ['name^3', 'description'],
34+
'history' => [],
35+
'search-suggestions' => [],
36+
'categories' => [],
3737

3838
// For example:
3939
// 'blogs' => [
40-
// 'fields' => ['title^3', 'description'], // Required
4140
// 'size' => 3, // Optional; Overrides the default `size` as defined below
42-
// 'stores' => ['my_second_store'], // Optional; Define this only if you want to specify which stores use this index
43-
// 'sort' => ['date' => 'desc'], // Optional; See: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/sort-search-results.html)
4441
// ],
4542
],
4643

47-
'debounce' => 500,
48-
'size' => 3,
44+
'size' => 3,
4945
],
5046

51-
// Link store codes to theme folders
5247
// The structure is `'store_code' => 'folder_path'`
53-
'themes' => [
54-
'default' => resource_path('themes/default'),
55-
],
48+
'theme' => resource_path('themes/default'),
5649

5750
// The fully qualified class names of the widgets.
5851
'widgets' => [

config/rapidez/indexer.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

config/rapidez/searchkit.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
// See: https://www.searchkit.co/docs/api-documentation/searchkit#search_settings-configuration
4+
return [
5+
// Attributes that are used to highlight the search results.
6+
'highlight_attributes' => [
7+
'name',
8+
'query_text',
9+
],
10+
11+
// Additional attributes that are used to search the results.
12+
// This will be merged with the searchable
13+
// attributes configured in Magento.
14+
'search_attributes' => [
15+
// ['field' => 'attribute_code', 'weight' => 4.0],
16+
],
17+
18+
// Attributes that are returned in the search result response.
19+
// Don't want to keep track of this? An empty array will
20+
// return all attributes, but that's not recommended!
21+
'result_attributes' => [
22+
'entity_id',
23+
'name',
24+
'sku',
25+
'price',
26+
'special_price',
27+
'image',
28+
'images',
29+
'url',
30+
'thumbnail',
31+
'in_stock',
32+
'children',
33+
'super_*',
34+
'reviews_count',
35+
'reviews_score',
36+
'parents',
37+
],
38+
39+
// Extra attributes that should be a range slider. Only supports numeric values.
40+
'range_attributes' => [
41+
// 'attribute_code'
42+
],
43+
44+
// Additional attributes that are used to create facets.
45+
// From Magento only "Yes/No, Dropdown, Multiple Select and Price" attribute types
46+
// can be configured as filter. If you'd like to have a filter for an attribute
47+
// with, for example, the type of "Text", you can specify the attribute_code here.
48+
'facet_attributes' => [
49+
// ['attribute' => 'brand', 'field' => 'brand.keyword', 'type' => 'string'],
50+
],
51+
52+
// Attributes that are used to create filters.
53+
// Required so that SearchKit can keep track of the type and field of each attribute.
54+
'filter_attributes' => [
55+
['attribute' => 'entity_id', 'field' => 'entity_id', 'type' => 'numeric'],
56+
['attribute' => 'sku', 'field' => 'sku.keyword', 'type' => 'string'],
57+
['attribute' => 'category_ids', 'field' => 'category_ids', 'type' => 'numeric'],
58+
['attribute' => 'visibility', 'field' => 'visibility', 'type' => 'numeric'],
59+
],
60+
61+
// Additional sorting options to be added to the product listings
62+
// Given directions can only be an array of 'asc' and/or 'desc'
63+
// Order shown here will be the order shown in the dropdown (including the order of the given directions!)
64+
'sorting' => [
65+
'created_at' => ['desc'],
66+
],
67+
];

config/rapidez/system.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
// Elasticsearch url.
88
'es_url' => env('ELASTICSEARCH_URL', 'http://localhost:9200'),
99

10-
// Elasticsearch prefix.
11-
'es_prefix' => env('ELASTICSEARCH_PREFIX', 'rapidez'),
12-
1310
// Get Magento url from Database
1411
'magento_url_from_db' => env('GET_MAGENTO_URL_FROM_DATABASE', false),
1512

lang/en/frontend.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,23 @@
2828
'yes' => 'Yes',
2929
],
3030

31-
'asc' => 'asc',
32-
'desc' => 'desc',
31+
'asc' => 'ascending',
32+
'desc' => 'descending',
3333
'relevance' => 'Relevance',
34-
'newest' => 'Newest',
3534
'all' => 'All',
3635

36+
'sorting' => [
37+
'created_at' => [
38+
'asc' => 'Oldest',
39+
'desc' => 'Newest',
40+
],
41+
'name' => [
42+
'asc' => 'Name A-Z',
43+
'desc' => 'Name Z-A',
44+
],
45+
],
46+
3747
'search' => [
3848
'title' => 'Search for',
3949
],
40-
41-
// 'sorting' => [
42-
// 'attribute' => [
43-
// 'asc' => 'Attribute asc',
44-
// 'desc' => 'Attrribute desc',
45-
// ],
46-
// ],
4750
];

lang/nl.json

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"Adding": "Aan het toevoegen",
88
"Addition": "Toevoeging",
99
"All rights reserved.": "Alle rechten voorbehouden.",
10-
"Apply coupon code": "Kortingscode toepassen",
1110
"Apply": "Toepassen",
11+
"Apply coupon code": "Kortingscode toepassen",
1212
"Billing address": "Factuuradres",
1313
"Cart": "Winkelwagen",
1414
"Categories": "Categorieën",
1515
"Category": "Categorie",
16-
"Checkout": "Afrekenen",
1716
"Check the spelling of your search term": "De spelling van je zoekterm te controleren",
17+
"Checkout": "Afrekenen",
1818
"City": "Stad",
1919
"Close": "Sluiten",
2020
"Company": "Bedrijf",
@@ -23,17 +23,21 @@
2323
"Country": "Land",
2424
"Create an account": "Account aanmaken",
2525
"Credentials": "Gegevens",
26+
"Decrease": "Verlagen",
2627
"Description": "Beschrijving",
2728
"Email": "Email",
2829
"Fax": "Fax",
2930
"Filters": "Filters",
31+
"First": "Eerste",
3032
"Firstname": "Voornaam",
3133
"Forgot your password?": "Wachtwoord vergeten?",
3234
"Go to home": "Naar de homepagina",
3335
"Have you tried:": "Heb je gedacht aan:",
3436
"Home": "Homepagina",
3537
"Housenumber": "Huisnummer",
38+
"Increase": "Verhogen",
3639
"Items per page": "Producten per pagina",
40+
"Last": "Laatste",
3741
"Lastname": "Achternaam",
3842
"Less options": "Minder opties",
3943
"Loading": "Aan het laden",
@@ -45,18 +49,19 @@
4549
"Middlename": "Tussenvoegsel",
4650
"More options": "Meer opties",
4751
"My billing and shipping address are the same": "Mijn factuur- en verzendadres zijn hetzelfde",
48-
"Please enter a shipping address first": "Voer eerst een verzendadres in",
4952
"New address": "Nieuw adres",
5053
"Next": "Volgende",
5154
"No": "Nee",
5255
"No results found for :searchterm": "Geen resultaten voor :searchterm",
5356
"Order placed succesfully": "Bestelling succesvol geplaatst",
5457
"Orders": "Bestellingen",
58+
"Out of stock": "Niet op voorraad",
5559
"page": "pagina",
5660
"Password": "Wachtwoord",
57-
"Payment method": "Betaalmethode",
5861
"Payment": "Betalen",
62+
"Payment method": "Betaalmethode",
5963
"Place order": "Bestelling plaatsen",
64+
"Please enter a shipping address first": "Voer eerst een verzendadres in",
6065
"Please log in": "Log hier in",
6166
"Postcode": "Postcode",
6267
"Prefix": "Aanhef",
@@ -65,28 +70,28 @@
6570
"products": "producten",
6671
"Products": "Producten",
6772
"Quantity": "Hoeveelheid",
68-
"Increase": "Verhogen",
69-
"Decrease": "Verlagen",
7073
"Region": "Regio",
7174
"Related products": "Gerelateerde producten",
75+
"Relevance": "Relevantie",
7276
"Remove": "Verwijderen",
7377
"Repeat password": "Wachtwoord herhalen",
7478
"Reset filters": "Filters resetten",
75-
"Search for": "Zoeken naar",
7679
"Search": "Zoeken",
80+
"Search for": "Zoeken naar",
7781
"Select": "Selecteer",
82+
"Shipping": "Verzending",
7883
"Shipping & billing address": "Verzend- en factuuradres",
7984
"Shipping address": "Verzendadres",
8085
"Shipping method": "Verzendmethode",
81-
"Shipping": "Verzending",
8286
"Show cart": "Bekijk winkelwagen",
83-
"This product is out of stock, remove it to continue your order.": "Dit product is niet op voorraad, verwijder het om verder te gaan met je bestelling.",
84-
"Out of stock": "Niet op voorraad",
8587
"Show results": "Bekijk resultaten",
8688
"Sign up for our newsletter to stay up to date.": "Meld je aan voor onze nieuwsbrief om op de hoogte te blijven.",
8789
"Sorry! No image": "Sorry! Geen afbeelding",
8890
"Sorry! This product is currently out of stock.": "Sorry! Dit product is momenteel niet op voorraad.",
89-
"Sorry! We did not find any products.": "Sorry! We hebben geen producten gevonden.",
91+
"No products found.": "Geen producten gevonden.",
92+
"There are currently no products in this category.": "Er zijn momenteel geen producten in deze categorie.",
93+
"Here are some suggestions:": "Hier zijn enkele suggesties:",
94+
"Suggestions": "Suggesties",
9095
"Specifications": "Specificaties",
9196
"Street": "Straat",
9297
"Subscribe": "Inschrijven",
@@ -97,21 +102,33 @@
97102
"Tax ID": "Btw-id",
98103
"Telephone": "Telefoonnummer",
99104
"Thank you for subscribing!": "Bedankt voor het inschrijven!",
105+
"This product is out of stock, remove it to continue your order.": "Dit product is niet op voorraad, verwijder het om verder te gaan met je bestelling.",
100106
"This product will be backordered": "Dit product zal worden nageleverd",
101107
"This website uses cookies": "Deze website maakt gebruik van cookies",
102108
"Total": "Totaal",
103109
"Update": "Update",
104110
"Use other search terms": "Andere zoektermen te gebruiken",
111+
"Previous Searches": "Vorige zoekopdrachten",
105112
"View all products": "Bekijk alle producten",
106-
"What are you looking for?": "Waar ben je naar op zoek?",
107113
"Want product news and updates?": "Wil je productnieuws en updates?",
108114
"We care about the protection of your data. Read our": "Wij geven om de bescherming van uw gegevens. Lees onze",
109115
"We found other products you might like!": "We hebben andere producten gevonden die je misschien leuk vindt!",
110116
"We will get to work for you right away": "Wij gaan meteen aan de slag",
111117
"We will send a confirmation of your order to": "Wij zullen een confirmatie sturen naar",
118+
"What are you looking for?": "Waar ben je naar op zoek?",
112119
"Wishlist": "Wensenlijst",
113120
"Yes": "Ja",
114121
"You don't have anything in your cart.": "Je hebt geen producten in je winkelwagen.",
115122
"You have filtered for:": "Je hebt gefilterd op:",
116-
"Your order is currently:": "Je bestelling is op dit moment:"
123+
"Your order is currently:": "Je bestelling is op dit moment:",
124+
"Search within the results": "Zoeken binnen resultaten",
125+
"Selected filters": "Geselecteerde filters",
126+
"First Page": "Eerste pagina",
127+
"Previous Page": "Vorige pagina",
128+
"Page": "Pagina",
129+
"Next Page": "Volgende pagina",
130+
"Last Page": "Laatste pagina",
131+
"Clear the search query": "De zoekopdracht wissen",
132+
"Sort options": "Sorteer opties",
133+
"Searching...": "Zoeken..."
117134
}

lang/nl/frontend.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@
2626
'asc' => 'oplopend',
2727
'desc' => 'aflopend',
2828
'relevance' => 'Relevantie',
29-
'newest' => 'Nieuwste',
3029
'all' => 'Alles',
30+
'price' => 'Prijs',
3131

3232
'search' => [
3333
'title' => 'Zoeken naar',
3434
],
3535

3636
'sorting' => [
37-
'price' => [
38-
'asc' => 'Prijs oplopend',
39-
'desc' => 'Prijs aflopend',
37+
'created_at' => [
38+
'asc' => 'Oudste',
39+
'desc' => 'Nieuwste',
4040
],
4141
'name' => [
4242
'asc' => 'Naam A-Z',
4343
'desc' => 'Naam Z-A',
4444
],
4545
],
46+
47+
'search' => [
48+
'title' => 'Zoeken naar',
49+
],
4650
];

0 commit comments

Comments
 (0)