diff --git a/app/Http/Controllers/ProductsController.php b/app/Http/Controllers/ProductsController.php
index db9a27c4..ef4505dd 100644
--- a/app/Http/Controllers/ProductsController.php
+++ b/app/Http/Controllers/ProductsController.php
@@ -100,8 +100,7 @@ class ProductsController extends Controller
} else {
$ranges = Range::all();
$tags = Tag::where('status', true)->get();
- $hasPromotion = Promotion::where('date_start', '<=', now())->where('date_end', '>=', now())->get();
- return view('ranges', compact('products', 'ranges', 'tags', 'sessionFilter', 'filtersMenuIsOpen', 'brands', 'hasPromotion'));
+ return view('ranges', compact('products', 'ranges', 'tags', 'sessionFilter', 'filtersMenuIsOpen', 'brands'));
}
}
diff --git a/resources/views/front/sable/js/components/FilterComponent.vue b/resources/views/front/sable/js/components/FilterComponent.vue
index d20ee3dd..a578c4ea 100644
--- a/resources/views/front/sable/js/components/FilterComponent.vue
+++ b/resources/views/front/sable/js/components/FilterComponent.vue
@@ -86,7 +86,7 @@
-
+
@@ -184,7 +184,7 @@ import BasketButtons from './BasketButtons.vue';
return {
loading: false,
countFilter: 0,
- hasPromotion: false,
+ filterPromotion: false,
ranges: [],
brands: [],
tags: [],
@@ -204,7 +204,7 @@ import BasketButtons from './BasketButtons.vue';
},
mounted() {
const jsonData = JSON.parse(this.jsonData);
- this.hasPromotion = jsonData.hasPromotion ? true : false;
+ this.filterPromotion = jsonData.filterPromotion ?? false;
this.ranges = jsonData.ranges ?? [];
this.brands = jsonData.brands ?? [];
this.tags = jsonData.tags ?? [];
@@ -312,7 +312,7 @@ import BasketButtons from './BasketButtons.vue';
*/
getFilters() {
return {
- promotion: this.hasPromotion,
+ promotion: this.filterPromotion,
ranges: this.ranges.filter((range) => range.selected)
.map((range) => range.id),
brands: this.brands.filter((brand) => {
@@ -375,7 +375,7 @@ import BasketButtons from './BasketButtons.vue';
.map((brand) => brand.selected = false);
this.tags.filter((tag) => tag.selected)
.map((tag) => tag.selected = false);
- this.hasPromotion = false;
+ this.filterPromotion = false;
this.search = "";
this.updatedFilter();
},
diff --git a/resources/views/front/sable/ranges.blade.php b/resources/views/front/sable/ranges.blade.php
index 058df585..d315b69e 100644
--- a/resources/views/front/sable/ranges.blade.php
+++ b/resources/views/front/sable/ranges.blade.php
@@ -9,7 +9,6 @@
@php
$dataComponent = [
- 'hasPromotion' => $hasPromotion ? true : false,
'ranges' => $ranges,
'brands' => $brands,
'tags' => $tags,