Bläddra i källkod

[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 år sedan
förälder
incheckning
90c5cac9a6
3 ändrade filer med 18 tillägg och 7 borttagningar
  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 Visa fil

@@ -678,7 +678,7 @@ class OrderController extends ProducerBaseController
'option_order_entry_point' => $producer->option_order_entry_point,
'option_delivery' => $producer->option_delivery,
'online_payment' => $producer->online_payment,
'option_online_payment_type' => $producer->online_payment,
'option_online_payment_type' => $producer->online_payment
];

// Distributions
@@ -765,7 +765,7 @@ class OrderController extends ProducerBaseController
}

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

+ 15
- 5
producer/views/order/order.php Visa fil

@@ -44,12 +44,13 @@ use common\models\Distribution ;

$this->setTitle('Commander') ;

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

?>

<script>
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>

@@ -242,10 +243,19 @@ $producer = GlobalParam::getCurrentProducer() ;
<input v-model="pointsSaleCodes[pointSale.id]" type="password" placeholder="Code" class="form-control input-code" />
</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>
</td>
</tr>

+ 1
- 0
producer/web/js/vuejs/order-order.js Visa fil

@@ -27,6 +27,7 @@ var app = new Vue({
disableConfirmButton: false,
delivery: false,
deliveryAddress: null,
urlLogin: '#',
calendar: {
mode: 'single',
attrs: [],

Laddar…
Avbryt
Spara