fix: hide prices in products.index <hen the user isn't logged in - #96
This commit is contained in:
parent
06785a3cb8
commit
ab9fce56f5
2 changed files with 8 additions and 2 deletions
|
|
@ -210,7 +210,8 @@
|
|||
btnFilterCross: undefined,
|
||||
btnSearch: undefined,
|
||||
filters: [],
|
||||
filtersMenuIsOpen: 0
|
||||
filtersMenuIsOpen: 0,
|
||||
shouldDisplayPrices: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -231,6 +232,7 @@
|
|||
this.productsResults = jsonData.productsResults ?? 0;
|
||||
this.filters = jsonData.filters ?? [];
|
||||
this.filtersMenuIsOpen = jsonData.filtersMenuIsOpen ?? [];
|
||||
this.shouldDisplayPrices = jsonData.shouldDisplayPrices ?? false;
|
||||
this.selectFilters();
|
||||
this.responsiveFilters();
|
||||
this.countResults();
|
||||
|
|
@ -410,6 +412,9 @@
|
|||
if (isNaN(num)) {
|
||||
return num;
|
||||
}
|
||||
if (!this.shouldDisplayPrices) {
|
||||
return '-.--';
|
||||
}
|
||||
return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(num);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
'productsCount' => $products->total(),
|
||||
'search' => $sessionFilter->search ?? '',
|
||||
'filters' => $sessionFilter,
|
||||
'filtersMenuIsOpen' => $filtersMenuIsOpen
|
||||
'filtersMenuIsOpen' => $filtersMenuIsOpen,
|
||||
'shouldDisplayPrice' => \App\Helpers\BladeDirectivesHelper::shouldShowPrices(),
|
||||
];
|
||||
@endphp
|
||||
<filter-component json-data='@json($dataComponent)'/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue