Merge branch 'develop' into trunk
This commit is contained in:
commit
e5f3ea4d04
3 changed files with 6 additions and 8 deletions
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
</label>
|
||||
</div>
|
||||
<div class="form-check d-flex flex-row flex-lg-row-reverse justify-content-between align-items-center rounded-2 px-3 py-2 p-lg-0 mt-2 mb-0">
|
||||
<input v-on:click="updatedFilter()" v-model="hasPromotion" :disabled="loading" class="form-check-input m-0" type="checkbox" role="button" id="filterPromotions">
|
||||
<input v-on:click="updatedFilter()" v-model="filterPromotion" :disabled="loading" class="form-check-input m-0" type="checkbox" role="button" id="filterPromotions">
|
||||
<label class="form-check-label w-100 ps-3 pe-0 ps-lg-0 pe-lg-3" role="button" for="filterPromotions">
|
||||
Promotions
|
||||
</label>
|
||||
|
|
@ -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();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
<section id="ranges" class="vue-apps">
|
||||
@php
|
||||
$dataComponent = [
|
||||
'hasPromotion' => $hasPromotion ? true : false,
|
||||
'ranges' => $ranges,
|
||||
'brands' => $brands,
|
||||
'tags' => $tags,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue