You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

679 lines
49KB

  1. <?php
  2. /**
  3. * Copyright Souke (2018)
  4. *
  5. * contact@souke.fr
  6. *
  7. * Ce logiciel est un programme informatique servant à aider les producteurs
  8. * à distribuer leur production en circuits courts.
  9. *
  10. * Ce logiciel est régi par la licence CeCILL soumise au droit français et
  11. * respectant les principes de diffusion des logiciels libres. Vous pouvez
  12. * utiliser, modifier et/ou redistribuer ce programme sous les conditions
  13. * de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
  14. * sur le site "http://www.cecill.info".
  15. *
  16. * En contrepartie de l'accessibilité au code source et des droits de copie,
  17. * de modification et de redistribution accordés par cette licence, il n'est
  18. * offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
  19. * seule une responsabilité restreinte pèse sur l'auteur du programme, le
  20. * titulaire des droits patrimoniaux et les concédants successifs.
  21. *
  22. * A cet égard l'attention de l'utilisateur est attirée sur les risques
  23. * associés au chargement, à l'utilisation, à la modification et/ou au
  24. * développement et à la reproduction du logiciel par l'utilisateur étant
  25. * donné sa spécificité de logiciel libre, qui peut le rendre complexe à
  26. * manipuler et qui le réserve donc à des développeurs et des professionnels
  27. * avertis possédant des connaissances informatiques approfondies. Les
  28. * utilisateurs sont donc invités à charger et tester l'adéquation du
  29. * logiciel à leurs besoins dans des conditions permettant d'assurer la
  30. * sécurité de leurs systèmes et ou de leurs données et, plus généralement,
  31. * à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
  32. *
  33. * Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
  34. * pris connaissance de la licence CeCILL, et que vous en avez accepté les
  35. * termes.
  36. */
  37. use common\helpers\GlobalParam;
  38. use domain\Distribution\Distribution\DistributionModule;
  39. use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
  40. use domain\Producer\Producer\Producer;
  41. use domain\Producer\Producer\ProducerModule;
  42. use yii\helpers\Html;
  43. \producer\assets\VuejsOrderOrderAsset::register($this);
  44. $distributionModule =DistributionModule::getInstance();
  45. $producerModule = ProducerModule::getInstance();
  46. $producer = $this->context->getProducerCurrent();
  47. $this->setTitle('Commander');
  48. ?>
  49. <script>
  50. var appInitValues = {
  51. 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])]) ?>',
  52. producerOptionOrderEntryPoint: '<?= $producer->option_order_entry_point ?>',
  53. <?php if (isset($order)): ?>pointSaleActiveId: <?= $order->id_point_sale ?><?php endif; ?>
  54. };
  55. </script>
  56. <div id="app-order-order" :class="{'loaded': !loadingInit}">
  57. <?php if (isset($order)): ?>
  58. <span id="order-distribution-date"><?= $order->distribution->date; ?></span>
  59. <?php endif; ?>
  60. <?php if (isset($date)): ?>
  61. <span id="distribution-date"><?= $date; ?></span>
  62. <?php endif; ?>
  63. <div v-if="loadingInit">
  64. <div class="text-center">
  65. <div class="spinner-border" role="status">
  66. <span class="visually-hidden">Chargement ...</span>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="wrapper">
  71. <div v-if="!loadingInit && !pointSaleActive && distributions.length == 0" class="alert alert-warning">
  72. Aucune distribution à venir chez ce producteur.
  73. </div>
  74. <div v-else>
  75. <div id="steps">
  76. <ul class="row g-0">
  77. <?php if ($producer->option_order_entry_point == Producer::ORDER_ENTRY_POINT_DATE): ?>
  78. <step-date
  79. first="true"
  80. :step="step"
  81. :point-sale-active="pointSaleActive"
  82. :date-format="dateFormat"
  83. :change-step="changeStep"
  84. :producer="producer"
  85. ></step-date>
  86. <step-point-sale
  87. :step="step"
  88. :point-sale-active="pointSaleActive"
  89. :change-step="changeStep"
  90. :producer="producer"
  91. ></step-point-sale>
  92. <?php else: ?>
  93. <step-point-sale
  94. first="true"
  95. :step="step"
  96. :point-sale-active="pointSaleActive"
  97. :change-step="changeStep"
  98. :producer="producer"
  99. ></step-point-sale>
  100. <step-date
  101. :step="step"
  102. :point-sale-active="pointSaleActive"
  103. :date-format="dateFormat"
  104. :change-step="changeStep"
  105. :producer="producer"
  106. ></step-date>
  107. <?php endif; ?>
  108. <li id="step-products" :class="'col-md-4 '+((step == 'products') ? 'active ' : '')">
  109. <button @click="changeStep('products')"
  110. :class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-secondary')"
  111. :disabled="step == 'date' || step == 'point-sale'">
  112. <span class="button-content"><span
  113. class="glyphicon glyphicon-th-list"></span> Produits</span>
  114. </button>
  115. <div class="info-step" v-if="oneProductOrdered()">
  116. {{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }}
  117. </div>
  118. </li>
  119. </ul>
  120. <div class="clr"></div>
  121. </div>
  122. <div class="content">
  123. <div v-if="order && date" class="alert alert-warning alert-edit-order">
  124. <div class="glyphicon glyphicon-pencil"></div>
  125. Attention, vous êtes en train de modifier votre commande du <strong>{{ dateFormat }}</strong>.
  126. </div>
  127. <div v-if="errors && errors.length" class="alert alert-danger">
  128. <ul>
  129. <li v-for="error in errors">
  130. <div v-html="error"></div>
  131. </li>
  132. </ul>
  133. </div>
  134. <div v-else-if="loading && step != 'payment'">
  135. <div class="text-center">
  136. <div class="spinner-border" role="status">
  137. <span class="visually-hidden">Chargement ...</span>
  138. </div>
  139. </div>
  140. </div>
  141. <transition name="slide">
  142. <div id="content-step-date" v-if="step == 'date'">
  143. <div v-if="!loading && pointSaleActive && distributions.length == 0" class="alert alert-warning">
  144. Aucune distribution à venir sur ce point de vente.
  145. </div>
  146. <div v-else-if="!loading">
  147. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  148. <div style="display:none ;">
  149. <?php endif; ?>
  150. <div id="legend">
  151. <div><span id="distribution-date-color"></span> Prochains jours de distribution</div>
  152. <div><span id="order-date-color"></span> Vos commandes déjà enregistrées</div>
  153. <div><span id="leave-period-date-color"></span> Congés</div>
  154. </div>
  155. <div id="calendar">
  156. <v-calendar
  157. is-inline
  158. is-expanded
  159. v-model="date"
  160. mode="single"
  161. color="green"
  162. :columns="calendar.columns"
  163. :masks="calendar.masks"
  164. :theme-styles="calendar.themeStyles"
  165. :attributes="calendar.attrs"
  166. :available-dates="calendar.availableDates"
  167. @dayclick='dayClick'
  168. ></v-calendar>
  169. </div>
  170. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  171. </div>
  172. <?php endif; ?>
  173. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  174. <div id="distributions-list">
  175. <?php $incomingDistributions = $distributionModule->findDistributionsIncoming(); ?>
  176. <?php foreach ($incomingDistributions as $distribution): ?>
  177. <?php
  178. $pointSaleDistributions = PointSaleDistribution::searchAll([
  179. 'id_distribution' => $distribution->id,
  180. 'delivery' => 1
  181. ], []);
  182. ?>
  183. <div class="card card-default">
  184. <div class="card-body">
  185. <button class="btn btn-primary" @click="dayClickList"
  186. data-distribution-date="<?= $distribution->date . ' 00:00:00' ?>">
  187. Sélectionner cette distribution
  188. </button>
  189. <span class="date"><?= ucfirst(strftime('%A %d %B', strtotime($distribution->date))); ?></span>
  190. <?php
  191. if ($pointSaleDistributions && count($pointSaleDistributions) > 0) {
  192. echo '<div class="point-sales">';
  193. foreach ($pointSaleDistributions as $pointSaleDistribution) {
  194. if ($pointSaleDistribution->pointSale->status == 1) {
  195. echo $pointSaleDistribution->pointSale->name . '';
  196. if (strlen($pointSaleDistribution->pointSale->locality)) {
  197. echo ' (' . $pointSaleDistribution->pointSale->locality . ')';
  198. }
  199. echo '<br />';
  200. }
  201. }
  202. echo '</div>';
  203. }
  204. ?>
  205. </div>
  206. </div>
  207. <?php endforeach; ?>
  208. </div>
  209. <?php endif; ?>
  210. </div>
  211. </div>
  212. </transition>
  213. <transition name="slide">
  214. <div id="content-step-point-sale" v-if="step == 'point-sale'">
  215. <div v-if="!loading">
  216. <h3>Où souhaitez-vous récupérer votre commande ?</h3>
  217. <table id="points-sale" class="table table-striped" v-if="pointsSale.length">
  218. <thead>
  219. <tr>
  220. <th>Point de vente</th>
  221. <th class="column-locality">Localité</th>
  222. <th></th>
  223. </tr>
  224. </thead>
  225. <tbody>
  226. <tr v-for="pointSale in orderedPointsSale"
  227. v-if="pointSale && (producer.option_order_entry_point == 'point-sale' || (producer.option_order_entry_point == 'date' && pointSale.pointSaleDistribution.delivery))"
  228. :class="(pointSaleActive && pointSale.id == pointSaleActive.id) ? 'selected' : ''">
  229. <td class="name">
  230. <span class="the-name">{{ pointSale.name }}</span>
  231. <div class="comment" v-if="pointSale.userPointSale">
  232. {{ pointSale.userPointSale.comment }}
  233. </div>
  234. <div class="locality">{{ pointSale.locality }}</div>
  235. <div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0"
  236. v-html="pointSale.infos"></div>
  237. <div class="minimum-order-amount" v-if="pointSale.minimum_order_amount">
  238. Montant minimum de commande : {{ formatPrice(pointSale.minimum_order_amount) }}
  239. </div>
  240. </td>
  241. <td class="column-locality">{{ pointSale.locality }}</td>
  242. <td class="actions">
  243. <template
  244. v-if="(order == null || order.id_point_sale != pointSale.id) && pointSale.maximum_number_orders && pointSale.count_orders && pointSale.count_orders >= pointSale.maximum_number_orders">
  245. <span class="label label-default">
  246. <template v-if="pointSale.is_bread_box">
  247. Déjà réservée
  248. </template>
  249. <template v-else>
  250. Maximum de commande atteint
  251. </template>
  252. </span>
  253. </template>
  254. <template v-else>
  255. <div :class="'form-group' + (pointSale.invalid_code ? ' has-error' : '')">
  256. <form>
  257. <div class="input-group"
  258. v-if="pointSale.code && pointSale.code.length > 0">
  259. <span class="input-group-text">
  260. <i class="bi bi-lock"></i>
  261. </span>
  262. <input v-model="pointsSaleCodes[pointSale.id]" type="password"
  263. placeholder="Code" class="form-control input-code" />
  264. </div>
  265. </form>
  266. </div>
  267. <div v-if="!user && producer.credit == 1 && pointSale.payment_method_credit == 1">
  268. <a :href="urlLogin" class="btn btn-secondary">
  269. <i class="bi bi-box-arrow-in-right"></i>
  270. Connexion obligatoire
  271. </a>
  272. </div>
  273. <div v-else>
  274. <button class="btn btn-primary" @click="pointSaleClick"
  275. :data-code="pointSale.code && pointSale.code.length > 0"
  276. :data-id-point-sale="pointSale.id">
  277. <i class="bi bi-geo-alt"></i>
  278. Choisir
  279. </button>
  280. </div>
  281. </template>
  282. </td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. <div class="alert alert-warning" v-else>
  287. Aucun point de vente disponible pour ce jour de distribution.
  288. </div>
  289. </div>
  290. </div>
  291. </transition>
  292. <transition name="slide">
  293. <div id="content-step-products" v-if="step == 'products'">
  294. <div v-if="!loading">
  295. <div v-if="products.length">
  296. <table id="products" class="table table-bordered">
  297. <thead>
  298. <tr>
  299. <th class="photo">Photo</th>
  300. <th class="name">Nom</th>
  301. <th class="price">Prix unitaire</th>
  302. <th class="quantity">Quantité</th>
  303. <th class="total">Total</th>
  304. </tr>
  305. </thead>
  306. <tbody>
  307. <template v-for="category in categories">
  308. <tr v-if="category.id && countProductsByCategory(category)" :id="'category'+category.id" :class="(categoryCurrent && categoryCurrent.id == category.id) ? 'category-open' : 'category-closed'">
  309. <td class="category-name" colspan="5" @click="setCategoryCurrent(category)">
  310. <!--<span v-if="categoryCurrent && categoryCurrent.id == category.id"
  311. class="bi bi-caret-down-fill"></span>
  312. <span v-else class="bi bi-caret-right-fill"></span>-->
  313. {{ category.name }}
  314. <span class="badge bg-secondary">{{ countProductsByCategory(category) }}<!-- produit<template
  315. v-if="countProductsByCategory(category) > 1">s</template>--></span>
  316. <span v-if="countSelectedProductsByCategory(category) > 0"
  317. class="badge badge-count-selected-products bg-primary">{{ countSelectedProductsByCategory(category) }}<!-- produit<template
  318. v-if="countSelectedProductsByCategory(category) > 1">s</template>--><span> sélectionné<template
  319. v-if="countSelectedProductsByCategory(category) > 1">s</template></span></span>
  320. </td>
  321. </tr>
  322. <template v-if="(categoryCurrent && categoryCurrent.id == category.id) || category.id == null">
  323. <tr v-for="product in products"
  324. v-if="product.id_product_category == category.id && isProductAvailable(product)" class="product-open">
  325. <td class="photo">
  326. <a class="product-photo" :href="product.photo_big" :title="product.name">
  327. <img v-if="product.photo.length" class="photo-product" :src="product.photo"/>
  328. </a>
  329. </td>
  330. <td class="name product-name-description-block">
  331. <span class="name">{{ product.name }}</span>
  332. <span class="other">
  333. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  334. </span>
  335. <div>
  336. <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)"
  337. class="badge bg-danger">Épuisé</span>
  338. </div>
  339. <div class="description" v-if="product.description.length">
  340. {{ product.description }}
  341. </div>
  342. <div class="description-long" v-if="product.recipe.length">
  343. <a href="javascript:void(0);" class="show-more-link">En savoir
  344. plus</a>
  345. <div class="content">
  346. {{ product.recipe }}
  347. </div>
  348. </div>
  349. </td>
  350. <td class="price-unit">
  351. <template v-if="productHasPrice(product)">
  352. <div>
  353. {{ formatPrice(getBestProductPrice(product.id,
  354. product.quantity_form)) }}<br/>
  355. <span class="price-infos">{{ product.wording_unit }}</span>
  356. <template v-if="product.unit == 'piece' && product.weight">
  357. <br />
  358. <span class="price-infos">
  359. {{ formatPrice(product.price_unit_ref) }} / kg
  360. </span>
  361. </template>
  362. </div>
  363. <div v-if="productHasPriceWithFromQuantity(product)"
  364. class="alert alert-info decreasing-prices">
  365. <ul>
  366. <li v-for="price in product.prices"
  367. v-if="price.from_quantity > 0">
  368. <strong>{{ formatPrice(price.price_with_tax)
  369. }}</strong><br/>à partir de {{
  370. price.from_quantity }} {{ product.wording_unit_ref
  371. }}
  372. </li>
  373. </ul>
  374. </div>
  375. </template>
  376. </td>
  377. <td class="td-quantity">
  378. <template v-if="productHasPrice(product)">
  379. <div class="input-group">
  380. <span class="input-group-btn">
  381. <button class="btn btn-secondary btn-moins"
  382. type="button"
  383. @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))"
  384. :disabled="product.quantity_form == 0">
  385. <i class="bi bi-dash-lg"></i></button>
  386. </span>
  387. <input type="text" v-model="product.quantity_form"
  388. class="form-control quantity" readonly="readonly"/>
  389. <span class="input-group-text">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
  390. <span class="input-group-btn">
  391. <button class="btn btn-secondary btn-plus"
  392. type="button"
  393. @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))"
  394. :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0">
  395. <i class="bi bi-plus-lg"></i></button>
  396. </span>
  397. </div>
  398. </template>
  399. </td>
  400. <td class="price-total">
  401. <template
  402. v-if="productHasPrice(product) && product.quantity_form > 0">
  403. {{ formatPrice(getBestProductPrice(product.id,
  404. product.quantity_form) * (product.quantity_form /
  405. product.coefficient_unit )) }}
  406. </template>
  407. </td>
  408. </tr>
  409. </template>
  410. </template>
  411. <tr class="total">
  412. <td class="summary" colspan="4">
  413. <template v-if="priceTotal() > 0">
  414. <h3>Résumé</h3>
  415. <ul>
  416. <li v-for="product in products" v-if="product.quantity_form > 0">
  417. <span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
  418. <span class="name">{{ product.name }}</span>
  419. <!--<span class="other">
  420. <span v-if="product.description.length">/</span>
  421. <span class="description">{{ product.description }}</span>-->
  422. <span class="other">
  423. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  424. </span>
  425. </li>
  426. </ul>
  427. </template>
  428. </td>
  429. <td class="price-total">
  430. <span>{{ priceTotal(true) }}</span>
  431. </td>
  432. </tr>
  433. </tbody>
  434. </table>
  435. <div id="content-step-payment">
  436. <div>
  437. <div class="card delivery" v-if="pointSaleActive.is_home_delivery">
  438. <div class="card-body">
  439. <h5 class="card-title">
  440. <label for="order-comment">
  441. <i class="bi bi-truck"></i>
  442. Adresse de livraison
  443. </label>
  444. </h5>
  445. <div class="card-text">
  446. <form>
  447. <textarea id="deliver-address" v-model="deliveryAddress" class="form-control" required="required"></textarea>
  448. </form>
  449. </div>
  450. </div>
  451. </div>
  452. <div class="card comment">
  453. <div class="card-body">
  454. <h5 class="card-title">
  455. <label for="order-comment">
  456. <i class="bi bi-chat-left"></i>
  457. Commentaire
  458. </label>
  459. </h5>
  460. <div class="card-text">
  461. <form>
  462. <textarea id="order-comment" v-model="comment" class="form-control"></textarea>
  463. </form>
  464. </div>
  465. </div>
  466. </div>
  467. <div id="payment-methods" class="card" v-if="pointSaleActive.payment_method_onsite || pointSaleActive.payment_method_credit || pointSaleActive.payment_method_online">
  468. <div class="card-body">
  469. <h5 class="card-title">
  470. <i class="bi bi-currency-euro"></i>
  471. Paiement
  472. </h5>
  473. <div class="card-text">
  474. <div class="row">
  475. <div class="col-md-4" v-if="isPaymentMethodOnsiteActive()">
  476. <input v-model="paymentMethod" type="radio" class="btn-check" name="payment_method" value="onsite" id="payment-method-onsite" autocomplete="off">
  477. <label class="btn btn-outline-success" for="payment-method-onsite">
  478. <i class="bi bi-wallet2"></i>
  479. Sur place
  480. </label>
  481. </div>
  482. <div class="col-md-4" v-if="isPaymentMethodCreditActive()">
  483. <template v-if="errorCreditMandatoryAndLimit()">
  484. <div class="alert alert-danger">
  485. <i class="bi bi-piggy-bank"></i>
  486. Vous devez
  487. <template v-if="producer.online_payment == 1">
  488. <a href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>">
  489. recharger votre cagnotte</a>
  490. </template>
  491. <template v-else>recharger votre cagnotte</template>
  492. auprès de votre producteur ou supprimer des produits.</span>
  493. Votre producteur n'autorise pas une cagnotte avec un montant inférieur
  494. à {{ formatPrice(producer.credit_limit) }}.<br />
  495. Montant de votre cagnotte : {{ formatPrice(user.credit) }}<br />
  496. Montant de votre commande : {{ priceTotal(true) }}
  497. </div>
  498. </template>
  499. <template v-else>
  500. <input v-model="paymentMethod" type="radio" class="btn-check" name="payment_method" value="credit" id="payment-method-credit" autocomplete="off">
  501. <label class="btn btn-outline-success" for="payment-method-credit">
  502. <i class="bi bi-piggy-bank"></i>
  503. Cagnotte
  504. </label>
  505. <div class="infos">
  506. Montant de ma cagnotte : {{ formatPrice(user.credit) }}<br />
  507. <template v-if="paymentMethod == 'credit'">
  508. <template v-if="order == null || order.amount_paid == 0">
  509. <span v-if="checkCreditLimit(order)">{{ priceTotal(true) }} seront débités</span>
  510. <span v-else>
  511. {{ formatPrice(user.credit) }} seront débités. (Limite de cagnotte à {{ formatPrice(producer.credit_limit) }})<br/>
  512. Restera {{ formatPrice(priceTotal() - user.credit) }} à régler.
  513. </span>
  514. </template>
  515. <template v-else-if="order != null && order.amount_paid > 0 && order.amount_paid < priceTotal()">
  516. <span v-if="checkCreditLimit(order)">{{ formatPrice(priceTotal() - order.amount_paid) }} seront débités</span>
  517. <span v-else>
  518. {{ formatPrice(user.credit) }} seront débités. (Limite de cagnotte à {{ formatPrice(producer.credit_limit) }})<br/>
  519. Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler.
  520. </span>
  521. </template>
  522. <template v-else-if="order != null && order.amount_paid > priceTotal()">
  523. <span>{{ formatPrice(order.amount_paid - priceTotal()) }} seront remboursés</span>
  524. </template>
  525. </template>
  526. </div>
  527. </template>
  528. </div>
  529. <div class="col-md-4" v-if="isPaymentMethodCreditActiveFunctioningUser(false)">
  530. <input v-model="paymentMethod" type="radio" class="btn-check" name="payment_method" value="credit" id="payment-method-credit" autocomplete="off" disabled>
  531. <label class="btn btn-outline-success" for="payment-method-credit">
  532. <i class="bi bi-piggy-bank"></i>
  533. Cagnotte
  534. </label>
  535. <div class="infos">
  536. Sur demande, vous pouvez payer vos commandes via votre
  537. cagnotte sur ce point de vente. N'hésitez pas à en
  538. parler à votre producteur.
  539. </div>
  540. </div>
  541. <div class="col-md-4" v-if="isPaymentMethodOnlineActive()">
  542. <input v-model="paymentMethod" type="radio" class="btn-check" name="payment_method" value="online" id="payment-method-online" autocomplete="off">
  543. <label class="btn btn-outline-success" for="payment-method-online">
  544. <i class="bi bi-credit-card"></i>
  545. Carte bancaire
  546. </label>
  547. <div class="infos">
  548. Paiement sécurisé via la plateforme Stripe.
  549. </div>
  550. </div>
  551. </div>
  552. </div>
  553. </div>
  554. </div>
  555. <template>
  556. <div id="signup-guest" class="card" v-if="!user && producer.option_allow_order_guest">
  557. <div class="card-body">
  558. <h5 class="card-title">
  559. <i class="bi bi-person"></i>
  560. Informations personnelles
  561. </h5>
  562. <div class="card-text">
  563. <form action="#">
  564. <div class="form-group field-signupguest-email required">
  565. <label class="control-label" for="signupguest-email">Email</label>
  566. <input type="email" id="signupguest-email" class="form-control"
  567. name="SignupForm[email]">
  568. <p class="help-block help-block-error"></p>
  569. </div>
  570. <div class="form-group field-signupguest-firstname required">
  571. <label class="control-label" for="signupguest-firstname">Prénom</label>
  572. <input type="text" id="signupguest-firstname" class="form-control"
  573. name="SignupForm[firstname]">
  574. <p class="help-block help-block-error"></p>
  575. </div>
  576. <div class="form-group field-signupguest-lastname required">
  577. <label class="control-label" for="signupguest-lastname">Nom</label>
  578. <input type="text" id="signupguest-lastname" class="form-control"
  579. name="SignupForm[lastname]">
  580. <p class="help-block help-block-error"></p>
  581. </div>
  582. <div class="form-group field-signupguest-phone required">
  583. <label class="control-label" for="signupguest-phone">Téléphone</label>
  584. <input type="text" id="signupguest-phone" class="form-control"
  585. name="SignupForm[phone]">
  586. <p class="help-block help-block-error"></p>
  587. </div>
  588. </form>
  589. </div>
  590. </div>
  591. </div>
  592. <div class="block-actions">
  593. <button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton || errorCreditMandatoryAndLimit() || !oneProductOrdered()">
  594. <span v-if="disableConfirmButton" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
  595. Je confirme ma commande
  596. </button>
  597. <button class="btn btn-primary" v-else @click="confirmClick">
  598. Je confirme ma commande
  599. </button>
  600. </div>
  601. </template>
  602. </div>
  603. </div>
  604. </div>
  605. <div class="alert alert-warning" v-else>
  606. Aucun produit disponible
  607. </div>
  608. </div>
  609. </div>
  610. </transition>
  611. <transition name="slide">
  612. </transition>
  613. </div>
  614. </div>
  615. <!--<div v-if="producer != null && producer.online_payment && producer.option_online_payment_type == 'credit'"
  616. id="credit-online-payment">
  617. <div class="panel panel-default">
  618. <div class="panel-heading">
  619. <i class="glyphicon glyphicon-euro"></i> Paiement en ligne
  620. <a href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>" class="btn btn-sm btn-secondary"><i
  621. class="glyphicon glyphicon-credit-card"></i> Créditer mon compte</a>
  622. </div>
  623. <div class="panel-body">
  624. Vous utilisez le crédit pour régler vos commandes ? Simplifiez les paiements avec votre producteur
  625. en créditant votre compte par carte bancaire.
  626. </div>
  627. </div>
  628. </div>-->
  629. <?= $this->render('_block_infos'); ?>
  630. </div>
  631. </div>
  632. <script type="text/x-template" id="template-step-date">
  633. <li id="step-date" :class="'col-md-4'+((step == 'date') ? ' active' : '')+(first ? ' first' : '')">
  634. <button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-secondary')"
  635. :disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive">
  636. <span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span>
  637. </button>
  638. <div class="info-step" v-if="dateFormat">
  639. {{ dateFormat }}
  640. </div>
  641. </li>
  642. </script>
  643. <script type="text/x-template" id="template-step-point-sale">
  644. <li id="step-point-sale" :class="'col-md-4'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')">
  645. <button @click="changeStep('point-sale')"
  646. :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-secondary')"
  647. :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')">
  648. <span class="button-content"><span
  649. class="glyphicon glyphicon-map-marker"></span> <?= $producerModule->getPointSaleWording($producer); ?></span>
  650. </button>
  651. <div class="info-step" v-if="pointSaleActive">
  652. {{ pointSaleActive.name }}
  653. </div>
  654. </li>
  655. </script>