Browse Source

Merge branch 'develop'

master
Guillaume Bourgeois 2 months ago
parent
commit
b26abdcd59
6 changed files with 17 additions and 10 deletions
  1. +1
    -1
      domain/Communication/Email/EmailGenerator.php
  2. +1
    -1
      domain/Order/OrderStatus/OrderStatusSolver.php
  3. +1
    -1
      domain/Product/ProductPrice/Service/ProductPriceBuilder.php
  4. +4
    -1
      producer/controllers/OrderController.php
  5. +1
    -1
      producer/views/order/order.php
  6. +9
    -5
      producer/web/js/vuejs/order-order.js

+ 1
- 1
domain/Communication/Email/EmailGenerator.php View File

$fromName = $producer->name ; $fromName = $producer->name ;


$linkProducer = 'https://'.$producer->slug.'.souke.fr'; $linkProducer = 'https://'.$producer->slug.'.souke.fr';
$linkUnsubscribe = \Yii::$app->urlManagerProducer->createAbsoluteUrl(['newsletter/unsubscribe', 'slug_producer' => $producer->slug]);
$linkUnsubscribe = $linkProducer.'/newsletter/unsubscribe';


// Message inscription newsletter // Message inscription newsletter
$messageAutoText .= " $messageAutoText .= "

+ 1
- 1
domain/Order/OrderStatus/OrderStatusSolver.php View File

$this->orderStatusDefinition = $this->loadService(OrderStatusDefinition::class); $this->orderStatusDefinition = $this->loadService(OrderStatusDefinition::class);
} }


public function getLabel(string $orderStatusAlias): string
public function getLabel(string $orderStatusAlias = null): string
{ {
$orderStatusArray = $this->orderStatusDefinition->getOrderStatusList(); $orderStatusArray = $this->orderStatusDefinition->getOrderStatusList();



+ 1
- 1
domain/Product/ProductPrice/Service/ProductPriceBuilder.php View File

} }


if($quantityFrom) { if($quantityFrom) {
$productPrice->quantity_from = $quantityFrom;
$productPrice->from_quantity = $quantityFrom;
} }


return $productPrice; return $productPrice;

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



$availableProducts = $orderModule->findProductDistributionsByDistribution($distribution); $availableProducts = $orderModule->findProductDistributionsByDistribution($distribution);
foreach ($productsArray as $product) { 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 = new ProductOrder();
$productOrder->id_order = $order->id; $productOrder->id_order = $order->id;
$productOrder->id_product = $product->id; $productOrder->id_product = $product->id;

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

<template v-if="priceTotal() > 0"> <template v-if="priceTotal() > 0">
<h3>Résumé</h3> <h3>Résumé</h3>
<ul> <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="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
<span class="name">{{ product.name }}</span> <span class="name">{{ product.name }}</span>
<!--<span class="other"> <!--<span class="other">

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

}, },
oneProductOrdered: function() { oneProductOrdered: function() {
for(var key in this.products) { 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 ; return true ;
} }
} }
countProductOrdered: function() { countProductOrdered: function() {
var count = 0 ; var count = 0 ;
for(var key in this.products) { 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') { if(this.products[key].unit != 'piece') {
count ++ ; count ++ ;
} }
var price = 0 ; var price = 0 ;
for(var key in this.products) { for(var key in this.products) {
var quantity = this.products[key].quantity_form; 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); price += (quantity / this.products[key].unit_coefficient) * this.getBestProductPrice(this.products[key].id, this.products[key].quantity_form);
} }
} }
getProductsArray: function() { getProductsArray: function() {
var productsArray = {} ; var productsArray = {} ;
for(var key in this.products) { 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 ; productsArray[this.products[key].id] = this.products[key].quantity_form ;
} }
} }

Loading…
Cancel
Save