diff --git a/resources/js/components/Listing/Filters/SelectedFiltersValues.vue b/resources/js/components/Listing/Filters/SelectedFiltersValues.vue new file mode 100644 index 000000000..5c683151e --- /dev/null +++ b/resources/js/components/Listing/Filters/SelectedFiltersValues.vue @@ -0,0 +1,56 @@ + diff --git a/resources/js/filters.js b/resources/js/filters.js index 68603bb29..077e90e2b 100644 --- a/resources/js/filters.js +++ b/resources/js/filters.js @@ -1,17 +1,21 @@ -Vue.filter('truncate', function (value, limit) { +window.truncate = function (value, limit) { if (value.length > limit) { value = value.substring(0, limit - 3) + '...' } return value -}) +} + +Vue.filter('truncate', window.truncate) -Vue.filter('price', function (value) { +window.price = function (value) { return new Intl.NumberFormat(config.locale.replace('_', '-'), { style: 'currency', currency: config.currency, }).format(value) -}) +} + +Vue.filter('price', window.price) window.url = function (path = '') { // Transform urls starting with / into url with domain diff --git a/resources/js/vue-components.js b/resources/js/vue-components.js index d9c0098bb..7b4b2796c 100644 --- a/resources/js/vue-components.js +++ b/resources/js/vue-components.js @@ -28,3 +28,4 @@ Vue.component('login', () => import('./components/User/Login.vue')) Vue.component('listing', () => import('./components/Listing/Listing.vue')) Vue.component('checkout-success', () => import('./components/Checkout/CheckoutSuccess.vue')) Vue.component('popup', () => import('./components/Popup.vue')) +Vue.component('selected-filters-values', () => import('./components/Listing/Filters/SelectedFiltersValues.vue')) diff --git a/resources/lang/en/frontend.php b/resources/lang/en/frontend.php index 52a6cc370..9c57ff6fb 100644 --- a/resources/lang/en/frontend.php +++ b/resources/lang/en/frontend.php @@ -23,6 +23,11 @@ 'email' => 'An email address is required.', ], + 'filters' => [ + 'no' => 'No', + 'yes' => 'Yes', + ], + 'asc' => 'asc', 'desc' => 'desc', 'relevance' => 'Relevance', diff --git a/resources/views/listing/partials/filter/price.blade.php b/resources/views/listing/partials/filter/price.blade.php index 7e06f394a..6b3196ba3 100644 --- a/resources/views/listing/partials/filter/price.blade.php +++ b/resources/views/listing/partials/filter/price.blade.php @@ -4,7 +4,6 @@ :component-id="filter.code" :data-field="filter.code" :react="{and: ['query-filter']}" - :show-filter="false" :slider-options="{ dragOnClick: true, useKeyboard: false }" :inner-class="{ slider: '!pt-4 !mt-0 mx-2', diff --git a/resources/views/listing/partials/filter/selected.blade.php b/resources/views/listing/partials/filter/selected.blade.php index fb7514468..d32329c4a 100644 --- a/resources/views/listing/partials/filter/selected.blade.php +++ b/resources/views/listing/partials/filter/selected.blade.php @@ -1,20 +1,32 @@ - - +
- @lang('Reset filters') - + +
+
+
+ @lang('You have filtered on'): +
+ +
+
+
+
+ + @{{ filter.value }} + + +
+
+
+
+
+
diff --git a/src/Http/Controllers/CategoryController.php b/src/Http/Controllers/CategoryController.php index 1f410f42e..586862a84 100644 --- a/src/Http/Controllers/CategoryController.php +++ b/src/Http/Controllers/CategoryController.php @@ -10,6 +10,7 @@ public function show(int $categoryId) $category = $categoryModel::findOrFail($categoryId); config(['frontend.category' => $category->only('entity_id')]); + config(['frontend.subcategories' => $category->subcategories->pluck('name', 'entity_id')]); session(['latest_category_path' => $category->path]); return view('rapidez::category.overview', compact('category'));