Browse Source

[Boutique] Commander : désactivation de la mise à jour automatique des quantités produits si le module accessoire n'est pas activé

develop
Guillaume Bourgeois 4 months ago
parent
commit
a9dc06335b
3 changed files with 8 additions and 4 deletions
  1. +2
    -1
      producer/controllers/OrderController.php
  2. +1
    -1
      producer/views/order/order.php
  3. +5
    -2
      producer/web/js/vuejs/order-order.js

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

'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,
'has_specific_delays' => $this->getProducerModule()->getSolver()->hasSpecificDelays($producer)
'has_specific_delays' => $this->getProducerModule()->getSolver()->hasSpecificDelays($producer),
'feature_product_accessory_enabled' => $this->getFeatureModule()->getChecker()->isEnabled(Feature::ALIAS_PRODUCT_ACCESSORY),
]; ];
} }



+ 1
- 1
producer/views/order/order.php View File

<span v-if="product.weight">({{ product.weight }}&nbsp;g)</span> <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
</span> </span>
<div> <div>
<span v-if="product.quantity_max != null && (product.quantity_remaining <= 0 || product.quantity_remaining * product.coefficient_unit < product.step)"
<span v-if="product.quantity_max != null && (product.quantity_remaining <= 0 || product.quantity_remaining * product.coefficient_unit < product.step || product.quantity_form >= product.quantity_max * product.coefficient_unit)"
class="badge bg-danger">Épuisé</span> class="badge bg-danger">Épuisé</span>
</div> </div>
<div class="description" v-if="product.description.length"> <div class="description" v-if="product.description.length">

+ 5
- 2
producer/web/js/vuejs/order-order.js View File

app.products = response.products; app.products = response.products;
app.loadingProducts = false; app.loadingProducts = false;
}, 'json'); }, 'json');
}.bind(this, app), 300);
}.bind(this, app), 500);


return; return;
} }
) { ) {
var theQuantity = parseFloat(this.products[product.index].quantity_form) + parseFloat(quantity); var theQuantity = parseFloat(this.products[product.index].quantity_form) + parseFloat(quantity);
this.products[product.index].quantity_form = parseFloat(theQuantity.toFixed(2)) ; this.products[product.index].quantity_form = parseFloat(theQuantity.toFixed(2)) ;
this.init('first', true);

if(this.producer.feature_product_accessory_enabled) {
this.init('first', true);
}
} }
}, },
oneProductOrdered: function() { oneProductOrdered: function() {

Loading…
Cancel
Save