@endguest
@auth('web-clients')
- @if($product->basic_selling_price)
- @if($specs)
- <div class="opt-configurator bg-grey-200 p-12 mb-8">
- <div class="opt-group">
- @foreach($specs as $spec)
- @php
- $containEmptyOption = array_filter($spec['options'], function($n) {
- return empty($n['name_fr']);
- });
- @endphp
- @if(sizeof($containEmptyOption) < 1 )
- <div class="opt-group">
- <label class="opt-name mb-2 inline-block">
- {{ \Illuminate\Support\Str::ucfirst( $spec['name_fr']) }}
- </label>
- <div>
- <select class="opt-select" v-on:change="changePrice">
- <option selected disabled value="">Sélectionner</option>
- @foreach($spec['options'] as $option)
- @if($option['name_fr'] != "")
- <option data-price="{{ $option['sale_price'] }}" data-ref="{{ $option['ref'] }}">
- {{ $option['name_fr'] }}
- {{ floatval($option['sale_price']) > 0 ? '(+'.$option['sale_price'].' € HT)' : '' }}
- </option>
- @endif
- @endforeach
- </select>
+ @if($options)
+ <button id="open-configurator" class="btn">
+ Configurer le produit
+ </button>
+ @endif
+ <div id="product-price-container" class="{{ $options ? 'hidden' : '' }}">
+ @if($product->basic_selling_price)
+ @if($specs)
+ <div class="opt-configurator bg-grey-200 p-12 mb-8">
+ <div class="opt-group">
+ @foreach($specs as $spec)
+ @php
+ $containEmptyOption = array_filter($spec['options'], function($n) {
+ return empty($n['name_fr']);
+ });
+ @endphp
+ @if(sizeof($containEmptyOption) < 1 )
+ <div class="opt-group">
+ <label class="opt-name mb-2 inline-block">
+ {{ \Illuminate\Support\Str::ucfirst( $spec['name_fr']) }}
+ </label>
+ <div>
+ <select class="opt-select" v-on:change="changePrice">
+ <option selected disabled value="">Sélectionner</option>
+ @foreach($spec['options'] as $option)
+ @if($option['name_fr'] != "")
+ <option data-price="{{ $option['sale_price'] }}" data-ref="{{ $option['ref'] }}">
+ {{ $option['name_fr'] }}
+ {{ floatval($option['sale_price']) > 0 ? '(+'.$option['sale_price'].' € HT)' : '' }}
+ </option>
+ @endif
+ @endforeach
+ </select>
+ </div>
</div>
+ @endif
+ @endforeach
+ </div>
+ </div>
+ @endif
+ <div class="opt-infos mb-8">
+ <div class="opt-ref text-navy" v-cloak>{{ __('Référence') }} : <span ref="refProduct" data-ref="{{ $product->reference }}">@{{ ref }}</span></div>
+ <div class="opt-price text-navy">
+ @if($discount)
+ <div>
+ {{ __('Prix catalogue') }} :
+ <span class="line-through" ref="optprice" v-cloak data-default="{{ $product->basic_selling_price }}">@{{ price }}</span>{{ "€ ".__('HT') }}
</div>
- @endif
- @endforeach
+ <div>
+ {{ __('Votre prix') }} :
+ <span ref="discount" data-value="{{ $discount }}"></span>
+ <span v-cloak data-default="{{ $product->basic_selling_price }}">@{{ priceDiscount }}</span>{{ "€ ".__('HT') }}
+ </div>
+ @else
+ {{ __('Prix unitaire') }} :
+ <span ref="optprice" v-cloak data-default="{{ $product->basic_selling_price }}">@{{ price }}</span>{{ "€ ".__('HT') }}
+ @endif
+ </div>
+ @if($options)
+ <div class="opt-statut">{{ __('Statut') }} :
+ <span v-cloak :class="{ 'text-green' : statusConfig }" ref="statusConfig" data-incomplete="{{ __('La configuration est incomplète') }}" data-completed="{{ __('La configuration est complète') }}">
+ @{{ statusText }}
+ </span>
</div>
- </div>
- @endif
- <div class="opt-infos mb-8">
- <div class="opt-ref text-navy" v-cloak>{{ __('Référence') }} : <span ref="refProduct" data-ref="{{ $product->reference }}">@{{ ref }}</span></div>
- <div class="opt-price text-navy">
- @if($discount)
- <div>
- {{ __('Prix catalogue') }} :
- <span class="line-through" ref="optprice" v-cloak data-default="{{ $product->basic_selling_price }}">@{{ price }}</span>{{ "€ ".__('HT') }}
- </div>
- <div>
- {{ __('Votre prix') }} :
- <span ref="discount" data-value="{{ $discount }}"></span>
- <span v-cloak data-default="{{ $product->basic_selling_price }}">@{{ priceDiscount }}</span>{{ "€ ".__('HT') }}
- </div>
- @else
- {{ __('Prix unitaire') }} :
- <span ref="optprice" v-cloak data-default="{{ $product->basic_selling_price }}">@{{ price }}</span>{{ "€ ".__('HT') }}
@endif
+ <input type="hidden" ref="optionsExist" data-val="{{$options}}">
</div>
- @if($options)
- <div class="opt-statut">{{ __('Statut') }} :
- <span v-cloak :class="{ 'text-green' : statusConfig }" ref="statusConfig" data-incomplete="{{ __('La configuration est incomplète') }}" data-completed="{{ __('La configuration est complète') }}">
- @{{ statusText }}
- </span>
- </div>
- @endif
- <input type="hidden" ref="optionsExist" data-val="{{$options}}">
- </div>
- @endif
+ @endif
+ </div>
@endauth
@if(config('features.quote'))
- <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 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
@isset($product->time_limit)