Browse Source

[Espace producteur] Abonnements : visibilité produits #1081

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
e343de82ab
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      producer/web/js/vuejs/subscription-form.js

+ 9
- 4
producer/web/js/vuejs/subscription-form.js View File

} }
}, },
dayChange: function () { dayChange: function () {
console.log(this.monday + ' ' + this.tuesday + ' ' + this.wednesday + ' ' +
this.thursday + ' ' + this.friday + ' ' + this.saturday + ' ' + this.sunday);

var count = Number(this.monday) + Number(this.tuesday) + Number(this.wednesday) var count = Number(this.monday) + Number(this.tuesday) + Number(this.wednesday)
+ Number(this.thursday) + Number(this.friday) + Number(this.saturday) + Number(this.thursday) + Number(this.friday) + Number(this.saturday)
+ Number(this.sunday); + Number(this.sunday);
(!this.thursday || (this.thursday && product.thursday)) && (!this.thursday || (this.thursday && product.thursday)) &&
(!this.friday || (this.friday && product.friday)) && (!this.friday || (this.friday && product.friday)) &&
(!this.saturday || (this.saturday && product.saturday)) && (!this.saturday || (this.saturday && product.saturday)) &&
(!this.sunday || (this.sunday && product.sunday)) ;
(!this.sunday || (this.sunday && product.sunday)) &&
(
(product.available_on_points_sale && !this.checkProductPointSaleInclude(product))
|| (!product.available_on_points_sale && this.checkProductPointSaleInclude(product))
)
;


if (!available) { if (!available) {
product.quantity_form = 0; product.quantity_form = 0;


return available; return available;
}, },
checkProductPointSaleInclude: function(product) {
return this.idPointSaleActive && product.product_point_sale_array.includes(parseInt(this.idPointSaleActive));
},
checkOneProductAvailable: function () { checkOneProductAvailable: function () {
var count = 0; var count = 0;
for (key in this.products) { for (key in this.products) {

Loading…
Cancel
Save