'tab' => 'Produits associés',
]);
+ $this->addField(['name' => 'time_limit',
+ 'label' => 'Délai',
+ 'type' => 'Text',
+ 'tab' => 'Informations fournisseur'
+ ]);
+
foreach ($this->_hidden_options as $name => $label) {
$this->addField(['name' => $name,
'label' => $label,
if (count($cart_items) > 0) {
self::$_cart_data = $cart_items;
- //$products = self::with('media')->whereIn('id', array_keys($cart_items))->get();
-
- /*foreach ($cart_items as $product) {
- self::$_cart_data[] = [
- 'id' => $product['id'],
- 'name' => $product['name'],
- 'reference' => $product['reference'],
- 'category' => $product['category'],
- 'quantity' => $product['quantity'],
- 'image' => $product['image'],
- 'URL' => $product['URL'],
- 'price' => $product['price'],
- 'ref' => $product['ref']
- ];
- }*/
}
}
});
this.ref = this.$refs.refProduct?.dataset.ref
- this.price = this.$refs.optprice ?.dataset.default
+ this.price = parseFloat(this.$refs.optprice ?.dataset.default).toFixed(2)
this.statusText = this.$refs.statusConfig ?.dataset.incomplete
},
},
cartItemHasPriceCount() {
- return this.items.length ? this.items.filter(n => n.price !== "").length : 0
+ return this.items.length ? this.items.filter(n => n.price !== "" && !isNaN(n.price)).length : 0
},
total() {
- let prices = this.items.map(item => item.price * item.quantity)
- return this.items.length ? prices.reduce((init, current) => init + current) : false
+ let prices = this.items.length ? this.items.map(item => item.price * item.quantity) : false
+
+ prices = prices ? Number.parseFloat(prices.reduce((init, current) => init + current)) : 0
+ prices += (prices > 1000) ? 20 : 0
+
+ return prices.toFixed(2)
+ },
+
+ tva() {
+ let tva = this.total ? this.total * 0.2 : 0
+ return tva.toFixed(2)
+ },
+
+ totalTTC() {
+ let total = this.total ? parseFloat(this.total) + parseFloat(this.tva) : 0
+ return total.toFixed(2)
}
},
axios.post('/ajax/check_email_exist', data)
.then(function (response) {
root.validateEmail = true
+ root.removeErrorsForm()
if (response.data.length > 0) {
root.emailExist = true
}
this.ref = this.$refs.refProduct.dataset.ref+'/'+placeholder
this.price = total + parseFloat(this.$refs.optprice.dataset.default)
+ this.price = parseFloat(this.price).toFixed(2)
}
},
/**
<span class="mr-2">Quantité</span>
<number-input v-model="item.quantity" :min="1" inline center controls></number-input>
</div>
- <div v-if="item.price">
- <span>{{ price }}€ HT</span>
+ <div v-if="!isNaN(item.price)">
+ <span class="text-navy">{{ Number.parseFloat(price).toFixed(2) }}€ HT</span>
</div>
<a href="#" class="cart-delete-item text-red" @click.prevent="deleteItem">
Supprimer
'2': 5vw,
'3': 7.5vw,
'4': 10vw,
- '5': 12.5vw,
+ '5': 12.5vw
}
$sides = {
.cart-quantity
@apply bg-white
max-width: 220px
+ .cart-addresses
+ form
+ label
+ padding-left: 20px !important
+
+ [type="radio"]
+ width: 16px !important
+ height: 24px
+ margin: 0
+ border: 0
+ display: grid
+ place-content: center
+ padding: 0
+ position: relative
+ appearance: none
+
+ &:before
+ content: ""
+ width: 16px
+ height: 16px
+ background-image: url(/images/icon-radio.svg)
+ background-repeat: no-repeat
+ background-position: center
+ &:checked:before
+ content: ""
+ background-image: url(/images/icon-radio-checked.svg)
+ background-repeat: no-repeat
+ background-position: center
+ border-radius: 50px
+
+.cart-shipping-fees
+ padding: 10px 0
+ margin-bottom: 36px
+ border: 1px solid #D5D7DF
+ border-left: 0
+ border-right: 0
+
+.cart-total
+ p
+ margin-bottom: 0 !important
+
+.cart-valid-command
+ margin: 32px 0 28px
+
+.cart-links
+ margin-bottom: 32px
+ a
+ display: inline-block
+ &:not(:last-child)
+ margin-bottom: 10px
// Cart item
.cart-item
-<button data-product-id="{{ $id }}" class="btn cart-add" :class="{ 'pointer-events-none bg-grey-disabled' : price && !statusConfig }">
+<button data-product-id="{{ $id }}" class="btn cart-add" :class="{ 'pointer-events-none bg-grey-disabled' : !isNaN(price) && !statusConfig }">
<span class="btn-text relative">
<span class="add">
@if(isset($price))
@section('content')
- <content class="pb-3v">
- <text-block :title="$page->page_heading" title-tag="h1" />
+ <content class="pb-3v cart-page">
+ <text-block :title="__('Mon panier')" title-tag="h1" />
<div v-if="cartItemCount > 0">
{{-- Nested divs to allow grey backgrounds of columns to match the height of their content instead of total height --}}
<div>
- <cart :items='items' :sendevents="false" class="cart-page bg-grey-100 p-1v pb-0 overflow-hidden"></cart>
+ <cart :items='items' :sendevents="false" class="bg-grey-100 p-1v pb-0 overflow-hidden"></cart>
+ <div class="bg-grey-100 p-1v pt-0">
+ <div class="cart-shipping-fees text-navy">
+ {{ __('Frais de ports') }} : <span v-cloak>@{{ total > 1000 ? '20€' : '0€' }}</span>
+ </div>
+ <div class="cart-total">
+ <p class="text-2xl text-navy">{{ __('Total HT') }} : <span v-cloak>@{{ total }}</span></p>
+ <p class="text-2xl text-navy">{{ __('Montant TVA') }} : <span v-cloak>@{{ tva }}</span></p>
+ <p class="text-2xl text-navy">{{ __('Total TTC') }} : <span v-cloak>@{{ totalTTC }}</span></p>
+ </div>
+ </div>
+ <button class="cart-valid-command btn btn-custom xs:w-full">
+ {{ __('Valider la commande') }}
+ </button>
+
+ <div class="cart-links">
+ <a href="">{{ __('Obtenir un devis officiel') }}</a><br>
+ <a href="">{{ __('Enregistrer ce panier') }}</a>
+ </div>
+
+ <div class="text-sm">
+ En nous transmettant votre demande, vous acceptez que PM Instrumentation traite vos données
+ personnelles dans le but de vous offrir un service de qualité. Pour plus d’information sur la
+ protection de vos données à caractère personnel, vous pouvez consulter la page
+ <a href="/vie-privee">Vie privée</a>.
+ </div>
</div>
<div>
- <div class="bg-grey-100 p-1v">
+ <div class="bg-grey-100 p-1v" v-cloak v-if="cartItemCount !== cartItemHasPriceCount">
@form([
'action' => '/ajax/request_quote',
'ga'=>false,
'extra_fields' => '<input type="hidden" name="cart_data" :value="cartData">' // Populated by VueJS
])
</div>
+
+ <div class="bg-grey-100 p-1v cart-addresses" v-cloak v-else>
+ <h2 class="font-normal">{{ __('Choisir une adresse de facturation') }} :</h2>
+ <form class="mb-12">
+ <div class="grid grid-cols-2 grid-gap-lg grid-rows-0 mb-3">
+ <div class="bg-white p-3" v-for="address in addresses" :key="address.id">
+ <div class="form-group flex items-start" :data="address.address_billing">
+ <input name="billing_address" type="radio" :checked="address.billing_address === '1' ? true : false"/>
+ <label for="billing_address">
+ @verbatim
+ <span class="text-navy">{{ address.name }}</span>
+ <div class="text-sm leading-5">
+ {{ address.company }}<br>
+ {{ address.firstname }} {{ address.lastname }}<br>
+ {{ address.address }}<br>
+ {{ address.zipcode }}<br>
+ {{ address.city }}
+ </div>
+ @endverbatim
+ </label>
+ </div>
+ </div>
+ </div>
+ <a href="/mon-compte#address">{{ __('Ajouter une adresse') }}</a>
+ </form>
+ <h2 class="font-normal">{{ __('Choisir une adresse de livraison') }} :</h2>
+ <form>
+ <div class="grid grid-cols-2 grid-gap-lg grid-rows-0 mb-3">
+ <div class="bg-white p-3" v-for="address in addresses" :key="address.id">
+ <div class="form-group flex items-start" :data="address.address_billing">
+ <input :id="'input-'+key" name="delivery_address" type="radio" :checked="address.delivery_address === '1' ? true : false"/>
+ <label :for="'input-'+key">
+ @verbatim
+ <span class="text-navy">{{ address.name }}</span>
+ <div class="text-sm leading-5">
+ {{ address.company }}<br>
+ {{ address.firstname }} {{ address.lastname }}<br>
+ {{ address.address }}<br>
+ {{ address.zipcode }}<br>
+ {{ address.city }}
+ </div>
+ @endverbatim
+ </label>
+ </div>
+ </div>
+ </div>
+ <a href="/mon-compte#address">{{ __('Ajouter une adresse') }}</a>
+ </form>
+ </div>
</div>
</grid>
</div>
- <div v-if="cartItemCount == 0" class="p-1v text-center bg-grey-100 text-lg">
+ <div v-cloak v-if="cartItemCount == 0" class="p-1v text-center bg-grey-100 text-lg">
{{ __("Vous n'avez encore rien sélectionné") }}
</div>
</div>
</div>
<div class="opt-infos mb-8">
- <div class="opt-ref" v-cloak>{{ __('Référence') }} : <span ref="refProduct" data-ref="{{ $product->reference }}">@{{ ref }}</span></div>
- <div class="opt-price">
+ <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">
{{ __('Prix unitaire') }} :
<span ref="optprice" v-cloak data-default="{{ $product->basic_selling_price }}">@{{ price }}</span>{{ "€ ".__('HT') }}
</div>
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>
@endif
+ @isset($product->time_limit)
+ <div class="mt-3 text-navy text-lg">
+ {{ $product->time_limit }}
+ </div>
+ @endisset
</text-block>
</div>
<span class="account-header-title">
@auth('web-clients')
<span v-if="!user.firstname">{{ Auth::guard('web-clients')->user()->firstname }}</span>
- <span v-cloak>@{{ user.firstname }}</span> 
+ <span v-cloak>@{{ user.firstname }}</span>
+ <span class="mr-1"></span>
<span v-if="!user.lastname">{{ Auth::guard('web-clients')->user()->lastname }}</span>
- <span v-cloak>@{{ user.lastname }}</span> 
+ <span v-cloak>@{{ user.lastname }}</span>
@else
{{ __('Se connecter') }}
@endauth