From 7a6c154e5f4d5824fce866773771b59ebcf74296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 28 Oct 2026 11:26:23 +0100 Subject: [PATCH] feat(products): add price info section to product details This update introduces a new price information section in the product details view, enhancing user experience by providing clear pricing details. --- .../fo/pages/products/show-details.blade.php | 178 +++++++++--------- .../fo/pages/products/show-info.blade.php | 47 ----- .../pages/products/show-price-info.blade.php | 47 +++++ .../views/fo/pages/products/show.blade.php | 17 +- 4 files changed, 147 insertions(+), 142 deletions(-) create mode 100644 resources/views/fo/pages/products/show-price-info.blade.php diff --git a/resources/views/fo/pages/products/show-details.blade.php b/resources/views/fo/pages/products/show-details.blade.php index c48bd991..cacbda88 100644 --- a/resources/views/fo/pages/products/show-details.blade.php +++ b/resources/views/fo/pages/products/show-details.blade.php @@ -1,100 +1,98 @@ -@if (!empty($productWithPricing->product->inco->nv_kj)) -
+
- @if (!empty($productWithPricing->product->inco->ingredients)) -
-

- -

-
-
- {!! clean($productWithPricing->product->inco->ingredients ?? '') !!} - @if (!empty($productWithPricing->product->inco->allergens)) -
- {{ __('Allergens') }} : - {{ $productWithPricing->product->inco->allergens }} -
- @endif -
-
-
- @endif -
+ @if (!empty($productWithPricing->product->inco->ingredients)) +

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ __('Average nutritional values') }}
{{ __('Nutrient') }}{{ __('Per') }} {{ $productWithPricing->product->inco->nv_ref_weight_g }}g -
{{ __('Energy') }} - {{ $productWithPricing->product->inco->nv_kj }} {{ __('Kj') }}
- {{ $productWithPricing->product->inco->nv_kcal }} {{ __('Kcal') }} -
- {{ __('Fat') }}
- • {{ __('Of which saturated fatty acids') }} -
- {{ $productWithPricing->product->inco->nv_fat_g }} g
- {{ $productWithPricing->product->inco->nv_sat_fat_g }} g -
- {{ __('Carbohydrates') }}
- • {{ __('of which sugars') }} -
- {{ $productWithPricing->product->inco->nv_carb_g }} g
- {{ $productWithPricing->product->inco->nv_sugar_g }} g -
{{ __('Dietary fiber') }}{{ $productWithPricing->product->inco->nv_fiber_g }} g
{{ __('Proteins') }}{{ $productWithPricing->product->inco->nv_protein_g }} g
{{ __('Salt') }}{{ $productWithPricing->product->inco->nv_salt_g }} g
-
-

- *{{ __('Reference Daily Intakes for an adult (8400kj/2000kcal).') }} -

-
+
+
+ {!! clean($productWithPricing->product->inco->ingredients ?? '') !!} + @if (!empty($productWithPricing->product->inco->allergens)) +
+ {{ __('Allergens') }} : + {{ $productWithPricing->product->inco->allergens }} +
+ @endif +
+
+
+ @endif +
+

+ +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ __('Average nutritional values') }}
{{ __('Nutrient') }}{{ __('Per') }} {{ $productWithPricing->product->inco->nv_ref_weight_g }}g +
{{ __('Energy') }} + {{ $productWithPricing->product->inco->nv_kj }} {{ __('Kj') }}
+ {{ $productWithPricing->product->inco->nv_kcal }} {{ __('Kcal') }} +
+ {{ __('Fat') }}
+ • {{ __('Of which saturated fatty acids') }} +
+ {{ $productWithPricing->product->inco->nv_fat_g }} g
+ {{ $productWithPricing->product->inco->nv_sat_fat_g }} g +
+ {{ __('Carbohydrates') }}
+ • {{ __('of which sugars') }} +
+ {{ $productWithPricing->product->inco->nv_carb_g }} g
+ {{ $productWithPricing->product->inco->nv_sugar_g }} g +
{{ __('Dietary fiber') }}{{ $productWithPricing->product->inco->nv_fiber_g }} g
{{ __('Proteins') }}{{ $productWithPricing->product->inco->nv_protein_g }} g
{{ __('Salt') }}{{ $productWithPricing->product->inco->nv_salt_g }} g
+
+

+ *{{ __('Reference Daily Intakes for an adult (8400kj/2000kcal).') }} +

-@endif +
diff --git a/resources/views/fo/pages/products/show-info.blade.php b/resources/views/fo/pages/products/show-info.blade.php index 24acf87c..0e806de6 100644 --- a/resources/views/fo/pages/products/show-info.blade.php +++ b/resources/views/fo/pages/products/show-info.blade.php @@ -33,51 +33,4 @@ alt="{{ __('Nutriscore') }} {{ Str::upper($productWithPricing->product->inco->nutriscore->label()) }}">
@endif - -
-
-

- @if ($productWithPricing->product->weight_variable) - {{ __('About') }}* - @endif -

-

- - {{ __('Current price') }} :  - @include('fo.modules.guarded-currency', [ - 'money' => $productWithPricing->pricing->hasDiscount ? - $productWithPricing->pricing->discountedPriceTtc() : $productWithPricing->pricing->basePriceTtc(), - 'product' => $productWithPricing->product, - ]) - - - @if ($productWithPricing->product->validDiscount?->is_old_price_displayed) - - {{ __('Original price') }} :  - @include('fo.modules.guarded-currency', [ - 'money' => $productWithPricing->pricing->basePriceTtc(), - 'product' => $productWithPricing->product, - ]) - - @endif - /{{ $productWithPricing->product->sell_unit->label() }} -

- -

- {{ $productWithPricing->product->weight_variable ? __('Product sold by the kilo') : __('Price per kilo') }} : - @include('fo.modules.guarded-currency', [ - 'money' => $productWithPricing->pricing->priceKgTtc(), - 'product' => $productWithPricing->product - ]) - /kg -

-
- -
- @can('addToBasket', $productWithPricing->product) -
$productWithPricing->product->id])'>
- @endcan -
-
diff --git a/resources/views/fo/pages/products/show-price-info.blade.php b/resources/views/fo/pages/products/show-price-info.blade.php new file mode 100644 index 00000000..36e5512c --- /dev/null +++ b/resources/views/fo/pages/products/show-price-info.blade.php @@ -0,0 +1,47 @@ +
+
+

+ @if ($productWithPricing->product->weight_variable) + {{ __('About') }}* + @endif +

+

+ + {{ __('Current price') }} :  + @include('fo.modules.guarded-currency', [ + 'money' => $productWithPricing->pricing->hasDiscount + ? $productWithPricing->pricing->discountedPriceTtc() + : $productWithPricing->pricing->basePriceTtc(), + 'product' => $productWithPricing->product, + ]) + + + @if ($productWithPricing->product->validDiscount?->is_old_price_displayed) + + {{ __('Original price') }} :  + @include('fo.modules.guarded-currency', [ + 'money' => $productWithPricing->pricing->basePriceTtc(), + 'product' => $productWithPricing->product, + ]) + + @endif + /{{ $productWithPricing->product->sell_unit->label() }} +

+ +

+ {{ $productWithPricing->product->weight_variable ? __('Product sold by the kilo') : __('Price per kilo') }} : + @include('fo.modules.guarded-currency', [ + 'money' => $productWithPricing->pricing->priceKgTtc(), + 'product' => $productWithPricing->product, + ]) + /kg +

+
+ + @can('addToBasket', $productWithPricing->product) +
+
$productWithPricing->product->id])'>
+
+ @endcan +
diff --git a/resources/views/fo/pages/products/show.blade.php b/resources/views/fo/pages/products/show.blade.php index e2a4b284..39eabb47 100644 --- a/resources/views/fo/pages/products/show.blade.php +++ b/resources/views/fo/pages/products/show.blade.php @@ -17,14 +17,21 @@ @include('fo.pages.products.show-info', compact('productWithPricing')) - +
+ @include('fo.pages.products.show-price-info', compact('productWithPricing')) + + @if (!empty($productWithPricing->product->inco->nv_kj)) + + @endif +
@if (!empty($associatedProducts))
-
@endif - +
+ @endif + @endsection