]> _ Git - pmi.git/commitdiff
wait #6378 @0:10
authorsoufiane <soufiane@cubedesigners.com>
Tue, 10 Oct 2023 09:17:28 +0000 (11:17 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 10 Oct 2023 09:17:28 +0000 (11:17 +0200)
resources/views/pages/product-detail.blade.php

index 5723e42d6b9a1f9e32b39c5bd391ffd49d00340e..54b658c92c93d4e072ae106cd8fc90deaaf909f1 100644 (file)
@@ -2,13 +2,14 @@
     $technical_sheet = $product->getMediaUrl('technical_sheet', false);
     $specs = $product->json;
     $categoryProduct = $product->category;
-    $template = $view_name;
     $options = false;
     if($product->basic_selling_price && $product->json) {
         $options = true;
     }
 
     $discount = \App\Models\Client::getDiscount($categoryProduct);
+    $auth = Auth::guard('web-clients')->check();
+    $template = $auth && $options ? $view_name : '';
 @endphp
 
 @extends('layouts/app')
                             </div>
                         @endif
                     </div>
-                    @if(config('features.quote'))
-                        <div id="features-quotes" class="{{ $options ? 'hidden' : '' }}">
-                            <cart-add :id="$product->id" price="" reference="" :hasprice="$product->basic_selling_price" template="product-detail"></cart-add>
-                            <span
-                                data-tooltip="{{__('Ajoutez un ou plusieurs produits à votre sélection, ajustez les quantités et obtenez un devis.')}}"
-                                class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
-                        </div>
-                    @endif
                 @endauth
 
-                @guest('web-clients')
-                    <div id="features-quotes">
-                        <cart-add :id="$product->id" price="" reference="" :hasprice="$product->basic_selling_price" template=""></cart-add>
+                @if(config('features.quote'))
+                    <div id="features-quotes" class="{{ $options && $auth ? 'hidden' : '' }}">
+                        <cart-add :id="$product->id" price="" reference="" :hasprice="$product->basic_selling_price" :template="$template"></cart-add>
                         <span
                             data-tooltip="{{__('Ajoutez un ou plusieurs produits à votre sélection, ajustez les quantités et obtenez un devis.')}}"
                             class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
                     </div>
-                @endguest
+                @endif
 
                 @isset($product->time_limit)
                     <div class="mt-3 text-navy text-lg">