|
|
|
|
|
|
|
|
></step-date> |
|
|
></step-date> |
|
|
<?php endif; ?> |
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
<li id="step-products" :class="'col-md-3 '+((step == 'products') ? 'active ' : '')"> |
|
|
|
|
|
|
|
|
<li id="step-products" :class="'col-md-4 '+((step == 'products') ? 'active ' : '')"> |
|
|
<button @click="changeStep('products')" |
|
|
<button @click="changeStep('products')" |
|
|
:class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')" |
|
|
:class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')" |
|
|
:disabled="step == 'date' || step == 'point-sale'"> |
|
|
:disabled="step == 'date' || step == 'point-sale'"> |
|
|
|
|
|
|
|
|
{{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }} |
|
|
{{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }} |
|
|
</div> |
|
|
</div> |
|
|
</li> |
|
|
</li> |
|
|
<li id="step-payment" :class="'col-md-3 '+((step == 'payment') ? 'active' : '')"> |
|
|
|
|
|
|
|
|
<!--<li id="step-payment" :class="'col-md-3 '+((step == 'payment') ? 'active' : '')"> |
|
|
<button @click="changeStep('payment')" |
|
|
<button @click="changeStep('payment')" |
|
|
:class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-default')" |
|
|
:class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-default')" |
|
|
:disabled="step == 'date' || step == 'point-sale' || step == 'products'"> |
|
|
:disabled="step == 'date' || step == 'point-sale' || step == 'products'"> |
|
|
<span class="button-content"><span |
|
|
<span class="button-content"><span |
|
|
class="glyphicon glyphicon-ok"></span> Confirmation</span> |
|
|
class="glyphicon glyphicon-ok"></span> Confirmation</span> |
|
|
</button> |
|
|
</button> |
|
|
</li> |
|
|
|
|
|
|
|
|
</li>--> |
|
|
</ul> |
|
|
</ul> |
|
|
<div class="clr"></div> |
|
|
<div class="clr"></div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
</tbody> |
|
|
</tbody> |
|
|
</table> |
|
|
</table> |
|
|
<div class="block-actions"> |
|
|
|
|
|
<button class="btn btn-primary" @click="changeStep('payment')">Valider</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="alert alert-warning" v-else> |
|
|
|
|
|
Aucun produit disponible |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</transition> |
|
|
|
|
|
<transition name="slide"> |
|
|
|
|
|
<div id="content-step-payment" v-if="step == 'payment'"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div class="delivery"> |
|
|
|
|
|
<div class="delivery-home" v-if="pointSaleActive.is_home_delivery"> |
|
|
|
|
|
<label for="deliver-address">Adresse de livraison</label> |
|
|
|
|
|
<textarea id="deliver-address" v-model="deliveryAddress" class="form-control" |
|
|
|
|
|
required="required"></textarea> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="comment"> |
|
|
|
|
|
<label for="order-comment">Commentaire</label> |
|
|
|
|
|
<textarea id="order-comment" v-model="comment" class="form-control"></textarea> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="content-step-payment"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<div class="delivery"> |
|
|
|
|
|
<div class="delivery-home" v-if="pointSaleActive.is_home_delivery"> |
|
|
|
|
|
<label for="deliver-address">Adresse de livraison</label> |
|
|
|
|
|
<textarea id="deliver-address" v-model="deliveryAddress" class="form-control" |
|
|
|
|
|
required="required"></textarea> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<template |
|
|
|
|
|
v-if="producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)) && !checkCreditLimit(order) "> |
|
|
|
|
|
<div class="alert alert-danger"> |
|
|
|
|
|
Vous devez |
|
|
|
|
|
<template v-if="producer.online_payment == 1"><a |
|
|
|
|
|
href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>">recharger |
|
|
|
|
|
votre crédit</a></template> |
|
|
|
|
|
<template v-else>recharger votre crédit</template> |
|
|
|
|
|
auprès de votre producteur ou supprimer des produits.</span> |
|
|
|
|
|
Votre producteur n'autorise pas un crédit inférieur |
|
|
|
|
|
à <strong>{{ formatPrice(producer.credit_limit) }}</strong>. |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="block-actions"> |
|
|
|
|
|
<a class="btn btn-primary" |
|
|
|
|
|
href="<?= \Yii::$app->urlManager->createUrl(['site/index']) ?>">Retour à |
|
|
|
|
|
l'accueil</a> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<div class="credit"> |
|
|
|
|
|
<div v-if="user && producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))"> |
|
|
|
|
|
<input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled" |
|
|
|
|
|
v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)"/> |
|
|
|
|
|
<input type="checkbox" id="use-credit" v-model="useCredit" v-else/> <label |
|
|
|
|
|
for="use-credit">Utiliser mon Crédit ({{ formatPrice(user.credit) |
|
|
|
|
|
}})</label> |
|
|
|
|
|
|
|
|
<div class="comment"> |
|
|
|
|
|
<label for="order-comment">Commentaire</label> |
|
|
|
|
|
<textarea id="order-comment" v-model="comment" class="form-control"></textarea> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<template |
|
|
|
|
|
v-if="producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)) && !checkCreditLimit(order) "> |
|
|
|
|
|
<div class="alert alert-danger"> |
|
|
|
|
|
Vous devez |
|
|
|
|
|
<template v-if="producer.online_payment == 1"><a |
|
|
|
|
|
href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>">recharger |
|
|
|
|
|
votre crédit</a></template> |
|
|
|
|
|
<template v-else>recharger votre crédit</template> |
|
|
|
|
|
auprès de votre producteur ou supprimer des produits.</span> |
|
|
|
|
|
Votre producteur n'autorise pas un crédit inférieur |
|
|
|
|
|
à <strong>{{ formatPrice(producer.credit_limit) }}</strong>. |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="block-actions"> |
|
|
|
|
|
<a class="btn btn-primary" |
|
|
|
|
|
href="<?= \Yii::$app->urlManager->createUrl(['site/index']) ?>">Retour à |
|
|
|
|
|
l'accueil</a> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<div class="credit"> |
|
|
|
|
|
<div v-if="user && producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))"> |
|
|
|
|
|
<input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled" |
|
|
|
|
|
v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)"/> |
|
|
|
|
|
<input type="checkbox" id="use-credit" v-model="useCredit" v-else/> <label |
|
|
|
|
|
for="use-credit">Utiliser mon Crédit ({{ formatPrice(user.credit) |
|
|
|
|
|
}})</label> |
|
|
|
|
|
|
|
|
<div class="info" v-if="useCredit"> |
|
|
|
|
|
<template v-if="order == null || order.amount_paid == 0"> |
|
|
|
|
|
<span v-if="checkCreditLimit(order)">{{ priceTotal(true) }} seront débités</span> |
|
|
|
|
|
<span v-else> |
|
|
|
|
|
|
|
|
<div class="info" v-if="useCredit"> |
|
|
|
|
|
<template v-if="order == null || order.amount_paid == 0"> |
|
|
|
|
|
<span v-if="checkCreditLimit(order)">{{ priceTotal(true) }} seront débités</span> |
|
|
|
|
|
<span v-else> |
|
|
{{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/> |
|
|
{{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/> |
|
|
Restera {{ formatPrice(priceTotal() - user.credit) }} à régler. |
|
|
Restera {{ formatPrice(priceTotal() - user.credit) }} à régler. |
|
|
</span> |
|
|
</span> |
|
|
</template> |
|
|
|
|
|
<template |
|
|
|
|
|
v-else-if="order != null && order.amount_paid > 0 && order.amount_paid < priceTotal()"> |
|
|
|
|
|
<span v-if="checkCreditLimit(order)">{{ formatPrice(priceTotal() - order.amount_paid) }} seront débités</span> |
|
|
|
|
|
<span v-else> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
<template |
|
|
|
|
|
v-else-if="order != null && order.amount_paid > 0 && order.amount_paid < priceTotal()"> |
|
|
|
|
|
<span v-if="checkCreditLimit(order)">{{ formatPrice(priceTotal() - order.amount_paid) }} seront débités</span> |
|
|
|
|
|
<span v-else> |
|
|
{{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/> |
|
|
{{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/> |
|
|
Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler. |
|
|
Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler. |
|
|
</span> |
|
|
</span> |
|
|
</template> |
|
|
|
|
|
<template v-else-if="order != null && order.amount_paid > priceTotal()"> |
|
|
|
|
|
<span>{{ formatPrice(order.amount_paid - priceTotal()) }} seront remboursés</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else> |
|
|
|
|
|
<span class="glyphicon glyphicon-chevron-right"></span> |
|
|
|
|
|
<?php if ($producerModule->isOnlinePaymentActiveAndTypeOrder($producer)): ?> |
|
|
|
|
|
La commande est à payer en ligne lors de l'étape suivante. |
|
|
|
|
|
<?php elseif ($producer->option_payment_info && strlen($producer->option_payment_info) > 0): ?> |
|
|
|
|
|
Confirmez votre commande et retrouvez les informations liées au paiement sur la page suivante. |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
La commande sera à régler sur place. |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else-if="order != null && order.amount_paid > priceTotal()"> |
|
|
|
|
|
<span>{{ formatPrice(order.amount_paid - priceTotal()) }} seront remboursés</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else> |
|
|
|
|
|
<span class="glyphicon glyphicon-chevron-right"></span> |
|
|
|
|
|
<?php if ($producerModule->isOnlinePaymentActiveAndTypeOrder($producer)): ?> |
|
|
|
|
|
La commande est à payer en ligne lors de l'étape suivante. |
|
|
|
|
|
<?php elseif ($producer->option_payment_info && strlen($producer->option_payment_info) > 0): ?> |
|
|
|
|
|
Confirmez votre commande et retrouvez les informations liées au paiement sur la page suivante. |
|
|
|
|
|
<?php else: ?> |
|
|
|
|
|
La commande sera à régler sur place. |
|
|
|
|
|
<?php endif; ?> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div id="signup-guest" v-if="!user && producer.option_allow_order_guest"> |
|
|
|
|
|
<h3>Informations personnelles</h3> |
|
|
|
|
|
<form action="#"> |
|
|
|
|
|
<div class="form-group field-signupguest-email required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-email">Email</label> |
|
|
|
|
|
<input type="email" id="signupguest-email" class="form-control" |
|
|
|
|
|
name="SignupForm[email]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group field-signupguest-firstname required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-firstname">Prénom</label> |
|
|
|
|
|
<input type="text" id="signupguest-firstname" class="form-control" |
|
|
|
|
|
name="SignupForm[firstname]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group field-signupguest-lastname required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-lastname">Nom</label> |
|
|
|
|
|
<input type="text" id="signupguest-lastname" class="form-control" |
|
|
|
|
|
name="SignupForm[lastname]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group field-signupguest-phone required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-phone">Téléphone</label> |
|
|
|
|
|
<input type="text" id="signupguest-phone" class="form-control" |
|
|
|
|
|
name="SignupForm[phone]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
</form> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="block-actions"> |
|
|
|
|
|
<button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton || !oneProductOrdered()">Je |
|
|
|
|
|
confirme ma commande |
|
|
|
|
|
</button> |
|
|
|
|
|
<button class="btn btn-primary" v-else @click="confirmClick">Je confirme ma |
|
|
|
|
|
commande |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div id="signup-guest" v-if="!user && producer.option_allow_order_guest"> |
|
|
|
|
|
<h3>Informations personnelles</h3> |
|
|
|
|
|
<form action="#"> |
|
|
|
|
|
<div class="form-group field-signupguest-email required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-email">Email</label> |
|
|
|
|
|
<input type="email" id="signupguest-email" class="form-control" |
|
|
|
|
|
name="SignupForm[email]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<!--<div class="form-group field-signupguest-password required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-password">Mot de passe</label> |
|
|
|
|
|
<input type="password" id="signupguest-password" class="form-control" name="SignupForm[password]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div>--> |
|
|
|
|
|
<div class="form-group field-signupguest-firstname required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-firstname">Prénom</label> |
|
|
|
|
|
<input type="text" id="signupguest-firstname" class="form-control" |
|
|
|
|
|
name="SignupForm[firstname]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group field-signupguest-lastname required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-lastname">Nom</label> |
|
|
|
|
|
<input type="text" id="signupguest-lastname" class="form-control" |
|
|
|
|
|
name="SignupForm[lastname]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group field-signupguest-phone required"> |
|
|
|
|
|
<label class="control-label" for="signupguest-phone">Téléphone</label> |
|
|
|
|
|
<input type="text" id="signupguest-phone" class="form-control" |
|
|
|
|
|
name="SignupForm[phone]"> |
|
|
|
|
|
<p class="help-block help-block-error"></p> |
|
|
|
|
|
</div> |
|
|
|
|
|
</form> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="block-actions"> |
|
|
|
|
|
<button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton">Je |
|
|
|
|
|
confirme ma commande |
|
|
|
|
|
</button> |
|
|
|
|
|
<button class="btn btn-primary" v-else @click="confirmClick">Je confirme ma |
|
|
|
|
|
commande |
|
|
|
|
|
</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="alert alert-warning" v-else> |
|
|
|
|
|
Aucun produit disponible |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</transition> |
|
|
</transition> |
|
|
|
|
|
<transition name="slide"> |
|
|
|
|
|
|
|
|
|
|
|
</transition> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<script type="text/x-template" id="template-step-date"> |
|
|
<script type="text/x-template" id="template-step-date"> |
|
|
<li id="step-date" :class="'col-md-3'+((step == 'date') ? ' active' : '')+(first ? ' first' : '')"> |
|
|
|
|
|
|
|
|
<li id="step-date" :class="'col-md-4'+((step == 'date') ? ' active' : '')+(first ? ' first' : '')"> |
|
|
<button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-default')" |
|
|
<button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-default')" |
|
|
:disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive"> |
|
|
:disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive"> |
|
|
<span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span> |
|
|
<span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span> |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<script type="text/x-template" id="template-step-point-sale"> |
|
|
<script type="text/x-template" id="template-step-point-sale"> |
|
|
<li id="step-point-sale" :class="'col-md-3'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')"> |
|
|
|
|
|
|
|
|
<li id="step-point-sale" :class="'col-md-4'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')"> |
|
|
<button @click="changeStep('point-sale')" |
|
|
<button @click="changeStep('point-sale')" |
|
|
:class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')" |
|
|
:class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')" |
|
|
:disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')"> |
|
|
:disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')"> |