@@ -113,7 +113,7 @@ Produits disponibles : | |||
$fromName = $producer->name ; | |||
$linkProducer = 'https://'.$producer->slug.'.souke.fr'; | |||
$linkUnsubscribe = \Yii::$app->urlManagerProducer->createAbsoluteUrl(['newsletter/unsubscribe', 'slug_producer' => $producer->slug]); | |||
$linkUnsubscribe = $linkProducer.'/newsletter/unsubscribe'; | |||
// Message inscription newsletter | |||
$messageAutoText .= " |
@@ -13,7 +13,7 @@ class OrderStatusSolver extends AbstractSolver | |||
$this->orderStatusDefinition = $this->loadService(OrderStatusDefinition::class); | |||
} | |||
public function getLabel(string $orderStatusAlias): string | |||
public function getLabel(string $orderStatusAlias = null): string | |||
{ | |||
$orderStatusArray = $this->orderStatusDefinition->getOrderStatusList(); | |||
@@ -37,7 +37,7 @@ class ProductPriceBuilder extends AbstractBuilder | |||
} | |||
if($quantityFrom) { | |||
$productPrice->quantity_from = $quantityFrom; | |||
$productPrice->from_quantity = $quantityFrom; | |||
} | |||
return $productPrice; |
@@ -431,7 +431,10 @@ class OrderController extends ProducerBaseController | |||
$availableProducts = $orderModule->findProductDistributionsByDistribution($distribution); | |||
foreach ($productsArray as $product) { | |||
if (isset($availableProducts[$product->id])) { | |||
if (isset($availableProducts[$product->id]) | |||
&& $availableProducts[$product->id] | |||
&& $availableProducts[$product->id]['active']) { | |||
$productOrder = new ProductOrder(); | |||
$productOrder->id_order = $order->id; | |||
$productOrder->id_product = $product->id; |
@@ -433,7 +433,7 @@ $this->setMeta('description', $producerModule->getSeoGenerator()->generateMetaDe | |||
<template v-if="priceTotal() > 0"> | |||
<h3>Résumé</h3> | |||
<ul> | |||
<li v-for="product in products" v-if="product.quantity_form > 0"> | |||
<li v-for="product in products" v-if="isProductAvailable(product) && product.quantity_form > 0"> | |||
<span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }}</span> | |||
<span class="name">{{ product.name }}</span> | |||
<!--<span class="other"> |
@@ -539,7 +539,8 @@ var app = new Vue({ | |||
}, | |||
oneProductOrdered: function() { | |||
for(var key in this.products) { | |||
if(this.products[key].quantity_form > 0) { | |||
if(this.isProductAvailable(this.products[key]) | |||
&& this.products[key].quantity_form > 0) { | |||
return true ; | |||
} | |||
} | |||
@@ -548,7 +549,8 @@ var app = new Vue({ | |||
countProductOrdered: function() { | |||
var count = 0 ; | |||
for(var key in this.products) { | |||
if(this.products[key].quantity_form > 0) { | |||
if(this.isProductAvailable(this.products[key]) | |||
&& this.products[key].quantity_form > 0) { | |||
if(this.products[key].unit != 'piece') { | |||
count ++ ; | |||
} | |||
@@ -563,7 +565,7 @@ var app = new Vue({ | |||
var price = 0 ; | |||
for(var key in this.products) { | |||
var quantity = this.products[key].quantity_form; | |||
if(quantity > 0) { | |||
if(this.isProductAvailable(this.products[key]) && quantity > 0) { | |||
price += (quantity / this.products[key].unit_coefficient) * this.getBestProductPrice(this.products[key].id, this.products[key].quantity_form); | |||
} | |||
} | |||
@@ -727,8 +729,10 @@ var app = new Vue({ | |||
getProductsArray: function() { | |||
var productsArray = {} ; | |||
for(var key in this.products) { | |||
if( this.products[key].quantity_form != null && | |||
this.products[key].quantity_form > 0) { | |||
if( this.isProductAvailable(this.products[key]) | |||
&& this.products[key].quantity_form != null | |||
&& this.products[key].quantity_form > 0) { | |||
productsArray[this.products[key].id] = this.products[key].quantity_form ; | |||
} | |||
} |