Browse Source

[Producer] Paramètres : correctifs option "Commander en tant que visiteur" #310

Obligation d'être connecté lors d'une commande dans un point de vente où le crédit est activé
refactoring
Guillaume Bourgeois 2 years ago
parent
commit
90c5cac9a6
3 changed files with 18 additions and 7 deletions
  1. +2
    -2
      producer/controllers/OrderController.php
  2. +15
    -5
      producer/views/order/order.php
  3. +1
    -0
      producer/web/js/vuejs/order-order.js

+ 2
- 2
producer/controllers/OrderController.php View File

'option_order_entry_point' => $producer->option_order_entry_point, 'option_order_entry_point' => $producer->option_order_entry_point,
'option_delivery' => $producer->option_delivery, 'option_delivery' => $producer->option_delivery,
'online_payment' => $producer->online_payment, 'online_payment' => $producer->online_payment,
'option_online_payment_type' => $producer->online_payment,
'option_online_payment_type' => $producer->online_payment
]; ];


// Distributions // Distributions
} }


$json['user'] = false; $json['user'] = false;
if ($userProducer) {
if ($user && $userProducer) {
$json['user'] = [ $json['user'] = [
'address' => $user->address, 'address' => $user->address,
'credit' => $userProducer->credit, 'credit' => $userProducer->credit,

+ 15
- 5
producer/views/order/order.php View File



$this->setTitle('Commander') ; $this->setTitle('Commander') ;


$producer = GlobalParam::getCurrentProducer() ;
$producer = $this->context->getProducer();


?> ?>


<script> <script>
var appInitValues = { var appInitValues = {
urlLogin: '<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducer()->id, 'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducer()->slug])]) ?>'
}; };
</script> </script>


<input v-model="pointsSaleCodes[pointSale.id]" type="password" placeholder="Code" class="form-control input-code" /> <input v-model="pointsSaleCodes[pointSale.id]" type="password" placeholder="Code" class="form-control input-code" />
</div> </div>
</div> </div>
<button class="btn btn-primary" @click="pointSaleClick" :data-code="pointSale.code.length > 0" :data-id-point-sale="pointSale.id">
<span class="glyphicon glyphicon-map-marker"></span>
Choisir
</button>

<div v-if="!user && producer.credit == 1 && pointSale.credit == 1 && pointSale.credit_functioning == 'mandatory'">
<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.length > 0" :data-id-point-sale="pointSale.id">
<span class="glyphicon glyphicon-map-marker"></span>
Choisir
</button>
</div>
</template> </template>
</td> </td>
</tr> </tr>

+ 1
- 0
producer/web/js/vuejs/order-order.js View File

disableConfirmButton: false, disableConfirmButton: false,
delivery: false, delivery: false,
deliveryAddress: null, deliveryAddress: null,
urlLogin: '#',
calendar: { calendar: {
mode: 'single', mode: 'single',
attrs: [], attrs: [],

Loading…
Cancel
Save