|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677 |
- <?php
-
- /**
- * Copyright distrib (2018)
- *
- * contact@opendistrib.net
- *
- * Ce logiciel est un programme informatique servant à aider les producteurs
- * à distribuer leur production en circuits courts.
- *
- * Ce logiciel est régi par la licence CeCILL soumise au droit français et
- * respectant les principes de diffusion des logiciels libres. Vous pouvez
- * utiliser, modifier et/ou redistribuer ce programme sous les conditions
- * de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
- * sur le site "http://www.cecill.info".
- *
- * En contrepartie de l'accessibilité au code source et des droits de copie,
- * de modification et de redistribution accordés par cette licence, il n'est
- * offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
- * seule une responsabilité restreinte pèse sur l'auteur du programme, le
- * titulaire des droits patrimoniaux et les concédants successifs.
- *
- * A cet égard l'attention de l'utilisateur est attirée sur les risques
- * associés au chargement, à l'utilisation, à la modification et/ou au
- * développement et à la reproduction du logiciel par l'utilisateur étant
- * donné sa spécificité de logiciel libre, qui peut le rendre complexe à
- * manipuler et qui le réserve donc à des développeurs et des professionnels
- * avertis possédant des connaissances informatiques approfondies. Les
- * utilisateurs sont donc invités à charger et tester l'adéquation du
- * logiciel à leurs besoins dans des conditions permettant d'assurer la
- * sécurité de leurs systèmes et ou de leurs données et, plus généralement,
- * à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
- *
- * Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
- * pris connaissance de la licence CeCILL, et que vous en avez accepté les
- * termes.
- */
-
- use common\helpers\GlobalParam;
- use common\logic\Distribution\Distribution\Module\DistributionModule;
- use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution;
- use common\logic\Producer\Producer\Model\Producer;
- use common\logic\Producer\Producer\Module\ProducerModule;
-
- \producer\assets\VuejsOrderOrderAsset::register($this);
-
- $distributionModule =DistributionModule::getInstance();
- $producerModule = ProducerModule::getInstance();
-
- $producer = $this->context->getProducerCurrent();
-
- $this->setTitle('Commander');
-
- ?>
-
- <script>
- var appInitValues = {
- urlLogin: '<?= \Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducerCurrent()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducerCurrent()->slug])]) ?>',
- producerOptionOrderEntryPoint: '<?= $producer->option_order_entry_point ?>',
- <?php if (isset($order)): ?>pointSaleActiveId: <?= $order->id_point_sale ?><?php endif; ?>
- };
- </script>
-
- <div id="app-order-order" :class="{'loaded': !loadingInit}">
-
- <?php if (isset($order)): ?>
- <span id="order-distribution-date"><?= $order->distribution->date; ?></span>
- <?php endif; ?>
- <?php if (isset($date)): ?>
- <span id="distribution-date"><?= $date; ?></span>
- <?php endif; ?>
-
- <div v-if="loadingInit">
- Chargement ...
- </div>
- <div class="wrapper">
- <div v-if="!loadingInit && distributions.length == 0" class="alert alert-warning">
- Aucune distribution à venir chez ce producteur.
- </div>
- <div v-else>
- <div id="steps">
- <ul>
- <?php if ($producer->option_order_entry_point == Producer::ORDER_ENTRY_POINT_DATE): ?>
- <step-date
- first="true"
- :step="step"
- :point-sale-active="pointSaleActive"
- :date-format="dateFormat"
- :change-step="changeStep"
- :producer="producer"
- ></step-date>
- <step-point-sale
- :step="step"
- :point-sale-active="pointSaleActive"
- :change-step="changeStep"
- :producer="producer"
- ></step-point-sale>
- <?php else: ?>
- <step-point-sale
- first="true"
- :step="step"
- :point-sale-active="pointSaleActive"
- :change-step="changeStep"
- :producer="producer"
- ></step-point-sale>
- <step-date
- :step="step"
- :point-sale-active="pointSaleActive"
- :date-format="dateFormat"
- :change-step="changeStep"
- :producer="producer"
- ></step-date>
- <?php endif; ?>
-
- <li id="step-products" :class="'col-md-3 '+((step == 'products') ? 'active ' : '')">
- <button @click="changeStep('products')"
- :class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')"
- :disabled="step == 'date' || step == 'point-sale'">
- <span class="button-content"><span
- class="glyphicon glyphicon-th-list"></span> Produits</span>
- </button>
- <div class="info-step" v-if="oneProductOrdered()">
- {{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }}
- </div>
- </li>
- <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>
- </ul>
- <div class="clr"></div>
- </div>
- <div class="content">
- <div v-if="errors && errors.length" class="alert alert-danger">
- <ul>
- <li v-for="error in errors">
- <div v-html="error"></div>
- </li>
- </ul>
- </div>
- <div v-else-if="loading && step != 'payment'">
- Chargement ...
- </div>
- <transition name="slide">
- <div id="content-step-date" v-if="step == 'date'">
- <div v-if="!loading">
- <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
- <div style="display:none ;">
- <?php endif; ?>
- <div id="legend">
- <div><span id="distribution-date-color"></span> Prochains jours de distribution
- </div>
- <div><span id="order-date-color"></span> Vos commandes déjà enregistrées</div>
- </div>
- <div id="calendar">
- <v-calendar
- is-inline
- is-expanded
- v-model="date"
- mode="single"
- color="green"
- :columns="calendar.columns"
- :formats="calendar.formats"
- :theme-styles="calendar.themeStyles"
- :attributes="calendar.attrs"
- :available-dates="calendar.availableDates"
- @dayclick='dayClick'
- ></v-calendar>
- </div>
- <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
- </div>
- <?php endif; ?>
-
- <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
- <div id="distributions-list">
- <?php $incomingDistributions = $distributionModule->findDistributionsIncoming(); ?>
- <?php foreach ($incomingDistributions as $distribution): ?>
-
- <?php
- $pointSaleDistributions = PointSaleDistribution::searchAll([
- 'id_distribution' => $distribution->id,
- 'delivery' => 1
- ], []);
- ?>
-
- <div class="panel panel-default">
- <div class="panel-body">
- <button class="btn btn-primary" @click="dayClickList"
- data-distribution-date="<?= $distribution->date . ' 00:00:00' ?>">
- Sélectionner cette distribution
- </button>
- <span class="date"><?= ucfirst(strftime('%A %d %B', strtotime($distribution->date))); ?></span>
- <?php
- if ($pointSaleDistributions && count($pointSaleDistributions) > 0) {
- echo '<div class="point-sales">';
- foreach ($pointSaleDistributions as $pointSaleDistribution) {
- if ($pointSaleDistribution->pointSale->status == 1) {
- echo $pointSaleDistribution->pointSale->name . '';
- if (strlen($pointSaleDistribution->pointSale->locality)) {
- echo ' (' . $pointSaleDistribution->pointSale->locality . ')';
- }
- echo '<br />';
- }
- }
- echo '</div>';
- }
- ?>
- </div>
- </div>
- <?php endforeach; ?>
- </div>
- <?php endif; ?>
- </div>
- </div>
- </transition>
- <transition name="slide">
- <div id="content-step-point-sale" v-if="step == 'point-sale'">
- <div v-if="!loading">
- <h3>Où souhaitez-vous récupérer votre commande ?</h3>
- <table id="points-sale" class="table table-bordered" v-if="pointsSale.length">
- <thead>
- <tr>
- <th>Nom</th>
- <th>Localité</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr v-for="pointSale in orderedPointsSale"
- v-if="pointSale && (producer.option_order_entry_point == 'point-sale' || (producer.option_order_entry_point == 'date' && pointSale.pointSaleDistribution.delivery))"
- :class="(pointSaleActive && pointSale.id == pointSaleActive.id) ? 'selected' : ''">
- <td class="name">
- <span class="the-name">{{ pointSale.name }}</span>
- <div class="comment" v-if="pointSale.userPointSale">
- {{ pointSale.userPointSale.comment }}
- </div>
- <div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0"
- v-html="pointSale.infos"></div>
- </td>
- <td class="locality">{{ pointSale.locality }}</td>
- <td class="actions">
- <template
- v-if="(order == null || order.id_point_sale != pointSale.id) && pointSale.maximum_number_orders && pointSale.count_orders && pointSale.count_orders >= pointSale.maximum_number_orders">
- <span class="label label-default">
- <template v-if="pointSale.is_bread_box">
- Déjà réservée
- </template>
- <template v-else>
- Maximum de commande atteint
- </template>
- </span>
- </template>
- <template v-else>
- <div :class="'form-group' + (pointSale.invalid_code ? ' has-error' : '')">
- <div class="input-group"
- v-if="pointSale.code && pointSale.code.length > 0">
- <span class="input-group-addon"><span
- class="glyphicon glyphicon-lock"></span></span>
- <input v-model="pointsSaleCodes[pointSale.id]" type="password"
- placeholder="Code" class="form-control input-code"/>
- </div>
- </div>
-
- <div v-if="!user && producer.credit == 1 && pointSale.credit == 1">
- <a :href="urlLogin" class="btn btn-default">
- <span class="glyphicon glyphicon-log-in"></span>
- Connexion obligatoire
- </a>
- </div>
- <div v-else>
- <button class="btn btn-primary" @click="pointSaleClick"
- :data-code="pointSale.code && pointSale.code.length > 0"
- :data-id-point-sale="pointSale.id">
- <span class="glyphicon glyphicon-map-marker"></span>
- Choisir
- </button>
- </div>
- </template>
- </td>
- </tr>
- </tbody>
- </table>
- <div class="alert alert-warning" v-else>
- Aucun point de vente disponible pour ce jour de distribution.
- </div>
- </div>
- </div>
- </transition>
- <transition name="slide">
- <div id="content-step-products" v-if="step == 'products'">
- <div v-if="!loading">
- <div v-if="products.length">
- <table id="products" class="table table-bordered">
- <thead>
- <tr>
- <th class="photo">Photo</th>
- <th class="name">Nom</th>
- <th class="price">Prix unitaire</th>
- <th class="quantity">Quantité</th>
- <th class="total">Total</th>
- </tr>
- </thead>
- <tbody>
- <template v-for="category in categories">
- <tr v-if="category.id && countProductsByCategory(category)">
- <td class="category-name" colspan="5" @click="setCategoryCurrent(category)">
- <span v-if="categoryCurrent && categoryCurrent.id == category.id"
- class="glyphicon glyphicon-triangle-bottom"></span>
- <span v-else class="glyphicon glyphicon-triangle-right"></span>
- {{ category.name }}
- <span class="label label-default">{{ countProductsByCategory(category) }} produit<template
- v-if="countProductsByCategory(category) > 1">s</template></span>
- <span v-if="countSelectedProductsByCategory(category) > 0"
- class="label label-success">{{ countSelectedProductsByCategory(category) }} produit<template
- v-if="countSelectedProductsByCategory(category) > 1">s</template> sélectionné<template
- v-if="countSelectedProductsByCategory(category) > 1">s</template></span>
- </td>
- </tr>
- <template
- v-if="(categoryCurrent && categoryCurrent.id == category.id) || category.id == null">
- <tr v-for="product in products"
- v-if="product.id_product_category == category.id && product.productDistribution && product.productDistribution[0] && product.productDistribution[0].active == 1">
- <td class="photo">
- <img v-if="product.photo.length" class="photo-product"
- :src="product.photo"/>
- </td>
- <td class="name product-name-description-block">
- <span class="name">{{ product.name }}</span>
- <span class="other">
- <span v-if="product.weight">({{ product.weight }} g)</span>
- </span>
- <div>
- <span v-if="product.quantity_max > 0 && ((product.quantity_form / product.coefficient_unit == product.quantity_remaining) || ((product.quantity_remaining * product.coefficient_unit) - product.quantity_form) < product.step)"
- class="label label-danger">Épuisé</span>
- </div>
- <div class="description" v-if="product.description.length">
- {{ product.description }}
- </div>
- <div class="description-long" v-if="product.recipe.length">
- <a href="javascript:void(0);" class="show-more-link">En savoir
- plus</a>
- <div class="content">
- {{ product.recipe }}
- </div>
- </div>
- </td>
- <td class="price-unit">
- <template v-if="productHasPrice(product)">
- <div>
- {{ formatPrice(getBestProductPrice(product.id,
- product.quantity_form)) }}<br/>
- <span class="unit">{{ product.wording_unit }}</span>
- </div>
- <div v-if="productHasPriceWithFromQuantity(product)"
- class="alert alert-info decreasing-prices">
- <ul>
- <li v-for="price in product.prices"
- v-if="price.from_quantity > 0">
- <strong>{{ formatPrice(price.price_with_tax)
- }}</strong><br/>à partir de {{
- price.from_quantity }} {{ product.wording_unit_ref
- }}
- </li>
- </ul>
- </div>
- </template>
- </td>
- <td class="td-quantity">
- <template v-if="productHasPrice(product)">
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn btn-default btn-moins"
- type="button"
- @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))"
- :disabled="product.quantity_form == 0"><span
- class="glyphicon glyphicon-minus"></span></button>
- </span>
- <input type="text" v-model="product.quantity_form"
- class="form-control quantity" readonly="readonly"/>
- <span class="input-group-addon">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
- <span class="input-group-btn">
- <button class="btn btn-default btn-plus"
- type="button"
- @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))"
- :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0"><span
- class="glyphicon glyphicon-plus"></span></button>
- </span>
- </div>
- </template>
- </td>
- <td class="price-total">
- <template
- v-if="productHasPrice(product) && product.quantity_form > 0">
- {{ formatPrice(getBestProductPrice(product.id,
- product.quantity_form) * (product.quantity_form /
- product.coefficient_unit )) }}
- </template>
- </td>
- </tr>
- </template>
- </template>
- <tr class="total">
- <td class="summary" colspan="4">
- <template v-if="priceTotal() > 0">
- <h3>> Résumé</h3>
- <ul>
- <li v-for="product in products" v-if="product.quantity_form > 0">
- <span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }} x</span>
- <span class="name">{{ product.name }}</span>
- <!--<span class="other">
- <span v-if="product.description.length">/</span>
- <span class="description">{{ product.description }}</span>-->
- <span class="other">
- <span v-if="product.weight">({{ product.weight }} g)</span>
- </span>
- </li>
- </ul>
- </template>
- </td>
- <td class="price-total">{{ priceTotal(true) }}</td>
- </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="producer.option_delivery">
- <input type="checkbox" name="delivery" id="delivery" v-model="delivery"/>
- <label for="delivery">Je souhaite être livré à domicile</label>
- </div>
- <div class="delivery-address" v-if="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>
-
- <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>
- {{ 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>
- {{ 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; ?>
- </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>
- </transition>
- </div>
- </div>
-
- <div id="infos" v-if="producer != null && producer.order_infos != null && producer.order_infos.length">
- <div class="panel panel-default">
- <div class="panel-heading">
- <i class="glyphicon glyphicon-info-sign"></i> Informations
- </div>
- <div class="panel-body">
- {{ producer.order_infos }}
- </div>
- </div>
- </div>
-
- <div v-if="producer != null && producer.online_payment && producer.option_online_payment_type == 'credit'"
- id="credit-online-payment">
- <div class="panel panel-default">
- <div class="panel-heading">
- <i class="glyphicon glyphicon-euro"></i> Paiement en ligne
- <a href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>" class="btn btn-sm btn-default"><i
- class="glyphicon glyphicon-credit-card"></i> Créditer mon compte</a>
- </div>
- <div class="panel-body">
- Vous utilisez le crédit pour régler vos commandes ? Simplifiez les paiements avec votre producteur
- en créditant votre compte par carte bancaire.
- </div>
- </div>
- </div>
-
- <?php
- $producer = GlobalParam::getCurrentProducer();
- if ($producerModule->hasSpecificDelays($producer)): ?>
- <div id="specific-delays" class="panel panel-default">
- <div class="panel-heading">
- Délais de commande spécifiques
- </div>
- <div class="panel-body">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th>Jour</th>
- <th>Délai</th>
- </tr>
- </thead>
- <?php foreach ($producerModule->getSpecificDelays($producer) as $day => $delay): ?>
- <?php if ($delay['order_delay'] && $delay['order_deadline']): ?>
- <tr>
- <td>
- <?php
- switch ($day) {
- case 'monday':
- echo 'Lundi';
- break;
- case 'tuesday':
- echo 'Mardi';
- break;
- case 'wednesday':
- echo 'Mercredi';
- break;
- case 'thursday':
- echo 'Jeudi';
- break;
- case 'friday':
- echo 'Vendredi';
- break;
- case 'saturday':
- echo 'Samedi';
- break;
- case 'sunday':
- echo 'Dimanche';
- break;
- }
- ?>
- </td>
- <td>
- <span><?= $delay['order_delay'] ?> jour<?= ($delay['order_delay'] > 1) ? 's' : '' ?></span>
- à l'avance,
- avant
- <span><?= ($delay['order_deadline'] == 24) ? 'minuit' : $delay['order_deadline'] . 'h'; ?></span>
- </td>
- </tr>
- <?php endif; ?>
- <?php endforeach; ?>
- </table>
- </div>
- </div>
- <?php endif; ?>
- </div>
- </div>
-
- <script type="text/x-template" id="template-step-date">
- <li id="step-date" :class="'col-md-3'+((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>
- </button>
- <div class="info-step" v-if="dateFormat">
- {{ dateFormat }}
- </div>
- </li>
- </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' : '')">
- <button @click="changeStep('point-sale')"
- :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')"
- :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')">
- <span class="button-content"><span
- class="glyphicon glyphicon-map-marker"></span> <?= $producerModule->getPointSaleWording($producer); ?></span>
- </button>
- <div class="info-step" v-if="pointSaleActive">
- {{ pointSaleActive.name }}
- </div>
- </li>
- </script>
|