Browse Source

Produits : disponibilité pour les abonnements

feature/rotating_product
Guillaume Bourgeois 7 months ago
parent
commit
5a69f11984
3 changed files with 14 additions and 12 deletions
  1. +0
    -1
      backend/controllers/SubscriptionController.php
  2. +13
    -10
      backend/views/subscription/_form.php
  3. +1
    -1
      producer/views/subscription/_form.php

+ 0
- 1
backend/controllers/SubscriptionController.php View File

@@ -238,7 +238,6 @@ class SubscriptionController extends BackendController
public function actionDelete(int $id)
{
$subscriptionModule = $this->getSubscriptionModule();
$orderModule = $this->getOrderModule();

$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id);


+ 13
- 10
backend/views/subscription/_form.php View File

@@ -135,24 +135,27 @@ $pointSaleModule = $this->getPointSaleModule();
}
?>
<table class="table table-bordered table-condensed table-hover" id="products">
<tr v-for="product in products">
<td>{{ product.name }}</td>
<tr v-for="product in products" v-if="product.is_available_for_subscriptions == 1 || (product.is_available_for_subscriptions == 0 && product.quantity > 0)">
<td>
{{ product.name }}
<template v-if="product.is_available_for_subscriptions == 0">
<br /><span class="label label-warning">Indisponible pour les abonnements</span>
</template>
</td>
<td>
<input type="hidden" :value="product.step" :name="'product_step_'+product.step" />
<input type="hidden" :value="product.price" :name="'product_price_'+product.price" />
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="button" @click="changeQuantityProductSubscription(false, product)"><span class="glyphicon glyphicon-minus"></span></button>
</span>
<span class="input-group-btn">
<button class="btn btn-default" type="button" @click="changeQuantityProductSubscription(false, product)"><span class="glyphicon glyphicon-minus"></span></button>
</span>
<input v-model="product.quantity" :name="'SubscriptionForm[products][product_'+product.id+']'" class="form-control input-quantity" />
<div class="input-group-addon">
<span>
{{ product.wording_unit }}
</span>
<span>{{ product.wording_unit }}</span>
</div>
<span class="input-group-btn">
<button class="btn btn-default" type="button" @click="changeQuantityProductSubscription(true, product)"><span class="glyphicon glyphicon-plus"></span></button>
</span>
<button class="btn btn-default" type="button" @click="changeQuantityProductSubscription(true, product)"><span class="glyphicon glyphicon-plus"></span></button>
</span>
</div>
</td>
</tr>

+ 1
- 1
producer/views/subscription/_form.php View File

@@ -224,7 +224,7 @@ $orderModule = OrderModule::getInstance();
</tr>
</thead>
<tbody>
<tr v-for="product in products" v-if="checkProductAvailable(product)">
<tr v-for="product in products" v-if="checkProductAvailable(product) && (product.is_available_for_subscriptions == 1 || (product.is_available_for_subscriptions == 0 && product.quantity > 0))">
<td>
<div class="name">{{ product.name }} <span v-if="product.weight">({{ product.weight }}g)</span></div>
<div class="description">{{ product.description }}</div>

Loading…
Cancel
Save