瀏覽代碼

Produits : disponibilité pour les abonnements

feature/rotating_product
Guillaume Bourgeois 4 月之前
父節點
當前提交
5a69f11984
共有 3 個檔案被更改,包括 14 行新增12 行删除
  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 查看文件

public function actionDelete(int $id) public function actionDelete(int $id)
{ {
$subscriptionModule = $this->getSubscriptionModule(); $subscriptionModule = $this->getSubscriptionModule();
$orderModule = $this->getOrderModule();


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



+ 13
- 10
backend/views/subscription/_form.php 查看文件

} }
?> ?>
<table class="table table-bordered table-condensed table-hover" id="products"> <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> <td>
<input type="hidden" :value="product.step" :name="'product_step_'+product.step" /> <input type="hidden" :value="product.step" :name="'product_step_'+product.step" />
<input type="hidden" :value="product.price" :name="'product_price_'+product.price" /> <input type="hidden" :value="product.price" :name="'product_price_'+product.price" />
<div class="input-group"> <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" /> <input v-model="product.quantity" :name="'SubscriptionForm[products][product_'+product.id+']'" class="form-control input-quantity" />
<div class="input-group-addon"> <div class="input-group-addon">
<span>
{{ product.wording_unit }}
</span>
<span>{{ product.wording_unit }}</span>
</div> </div>
<span class="input-group-btn"> <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> </div>
</td> </td>
</tr> </tr>

+ 1
- 1
producer/views/subscription/_form.php 查看文件

</tr> </tr>
</thead> </thead>
<tbody> <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> <td>
<div class="name">{{ product.name }} <span v-if="product.weight">({{ product.weight }}g)</span></div> <div class="name">{{ product.name }} <span v-if="product.weight">({{ product.weight }}g)</span></div>
<div class="description">{{ product.description }}</div> <div class="description">{{ product.description }}</div>

Loading…
取消
儲存