Selaa lähdekoodia

[Boutique] Commander : suppression étape "Confirmation" #1380

feature/souke
Guillaume Bourgeois 1 vuosi sitten
vanhempi
commit
b138db70ae
3 muutettua tiedostoa jossa 119 lisäystä ja 124 poistoa
  1. +117
    -122
      producer/views/order/order.php
  2. +1
    -1
      producer/web/css/screen.css
  3. +1
    -1
      producer/web/sass/order/_order.scss

+ 117
- 122
producer/views/order/order.php Näytä tiedosto

@@ -112,7 +112,7 @@ $this->setTitle('Commander');
></step-date>
<?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')"
:class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')"
:disabled="step == 'date' || step == 'point-sale'">
@@ -123,14 +123,14 @@ $this->setTitle('Commander');
{{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }}
</div>
</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')"
:class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-default')"
:disabled="step == 'date' || step == 'point-sale' || step == 'products'">
<span class="button-content"><span
class="glyphicon glyphicon-ok"></span> Confirmation</span>
</button>
</li>
</li>-->
</ul>
<div class="clr"></div>
</div>
@@ -425,137 +425,132 @@ $this->setTitle('Commander');
</tr>
</tbody>
</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/>
Restera {{ formatPrice(priceTotal() - user.credit) }} à régler.
</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/>
Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler.
</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 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>
</transition>
<transition name="slide">

</transition>
</div>
</div>

@@ -647,7 +642,7 @@ $this->setTitle('Commander');
</div>

<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')"
:disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive">
<span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span>
@@ -659,7 +654,7 @@ $this->setTitle('Commander');
</script>

<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')"
:class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')"
:disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')">

+ 1
- 1
producer/web/css/screen.css Näytä tiedosto

@@ -1347,7 +1347,7 @@ termes.
padding-right: 0px;
}
/* line 72, ../sass/order/_order.scss */
.order-order #main #app-order-order #steps ul li#step-payment .btn::after, .order-order #main #app-order-order #steps ul li.first .btn::before {
.order-order #main #app-order-order #steps ul li#step-products .btn::after, .order-order #main #app-order-order #steps ul li.first .btn::before {
display: none;
}
/* line 77, ../sass/order/_order.scss */

+ 1
- 1
producer/web/sass/order/_order.scss Näytä tiedosto

@@ -69,7 +69,7 @@
padding-right: 0px ;
}
&#step-payment .btn::after,
&#step-products .btn::after,
&.first .btn::before {
display: none ;
}

Loading…
Peruuta
Tallenna