Ver código fonte

[Boutique] Commander : affichage du prix au kg pour les produits vendus à la pièce

feature/souke
Guillaume Bourgeois 10 meses atrás
pai
commit
0d0b4af69b
5 arquivos alterados com 48 adições e 20 exclusões
  1. +19
    -0
      common/logic/Product/Product/Service/ProductSolver.php
  2. +1
    -0
      producer/controllers/OrderController.php
  3. +7
    -1
      producer/views/order/order.php
  4. +19
    -18
      producer/web/css/screen.css
  5. +2
    -1
      producer/web/sass/order/_order.scss

+ 19
- 0
common/logic/Product/Product/Service/ProductSolver.php Ver arquivo

@@ -7,6 +7,7 @@ use common\helpers\Price;
use common\logic\AbstractService;
use common\logic\Config\Unit\Service\UnitDefinition;
use common\logic\Config\Unit\Service\UnitSolver;
use common\logic\Order\ProductOrder\Model\ProductOrder;
use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\PointSale\PointSale\Service\PointSaleSolver;
use common\logic\Product\Product\Model\Product;
@@ -98,6 +99,24 @@ class ProductSolver extends AbstractService implements SolverInterface
return $product->price;
}

public function getPriceUnitReference(Product $product): ?float
{
$productPrice = $product->price;
if($product->unit == 'piece') {
if($product->weight) {
$price = (1000 * $productPrice) / $product->weight;
}
else {
return null;
}
}
else {
$price = $product->price;
}

return $price;
}

/**
* Retourne le prix du produit avec taxe
*/

+ 1
- 0
producer/controllers/OrderController.php Ver arquivo

@@ -922,6 +922,7 @@ class OrderController extends ProducerBaseController
[
'unit_coefficient' => Product::$unitsArray[$product->unit]['coefficient'],
'prices' => $productModule->getPriceArray($product, $user, $pointSale),
'price_unit_ref' => $productModule->getSolver()->getPriceUnitReference($product),
'productDistribution' => $product['productDistribution'],
'productPointSale' => $product['productPointSale'],
]

+ 7
- 1
producer/views/order/order.php Ver arquivo

@@ -356,7 +356,13 @@ $this->setTitle('Commander');
<div>
{{ formatPrice(getBestProductPrice(product.id,
product.quantity_form)) }}<br/>
<span class="unit">{{ product.wording_unit }}</span>
<span class="price-infos">{{ product.wording_unit }}</span>
<template v-if="product.unit == 'piece' && product.weight">
<br />
<span class="price-infos">
{{ formatPrice(product.price_unit_ref) }} / kg
</span>
</template>
</div>
<div v-if="productHasPriceWithFromQuantity(product)"
class="alert alert-info decreasing-prices">

+ 19
- 18
producer/web/css/screen.css Ver arquivo

@@ -1545,20 +1545,21 @@ termes.
text-align: center;
}
/* line 309, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .price-unit .unit, .order-order #main #app-order-order table#products .price-total .unit {
.order-order #main #app-order-order table#products .price-unit .price-infos, .order-order #main #app-order-order table#products .price-total .price-infos {
color: gray;
font-size: 13px;
line-height: 15px;
}
/* line 314, ../sass/order/_order.scss */
/* line 315, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity {
width: 175px;
}
/* line 316, ../sass/order/_order.scss */
/* line 317, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity input.quantity {
text-align: center;
border-right: 0px none;
}
/* line 320, ../sass/order/_order.scss */
/* line 321, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products .td-quantity .input-group-addon {
padding: 5px;
padding-left: 0px;
@@ -1566,69 +1567,69 @@ termes.
border-left: 0px none;
border-right: 0px none;
}
/* line 331, ../sass/order/_order.scss */
/* line 332, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary h3 {
margin-top: 0px;
font-family: "capsuularegular";
text-transform: none;
margin-bottom: 5px;
}
/* line 338, ../sass/order/_order.scss */
/* line 339, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul {
margin-bottom: 15px;
padding-left: 20px;
font-size: 23px;
}
/* line 345, ../sass/order/_order.scss */
/* line 346, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .quantity {
font-size: 18px;
}
/* line 349, ../sass/order/_order.scss */
/* line 350, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .name {
font-family: "capsuularegular";
font-size: 24px;
}
/* line 353, ../sass/order/_order.scss */
/* line 354, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .summary ul li .other {
font-family: "capsuularegular";
font-size: 18px;
}
/* line 361, ../sass/order/_order.scss */
/* line 362, ../sass/order/_order.scss */
.order-order #main #app-order-order table#products tr.total .price-total {
font-size: 23px;
}
/* line 369, ../sass/order/_order.scss */
/* line 370, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .delivery {
margin-bottom: 20px;
}
/* line 372, ../sass/order/_order.scss */
/* line 373, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .delivery .delivery-home {
margin-bottom: 20px;
}
/* line 381, ../sass/order/_order.scss */
/* line 382, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .comment {
margin-bottom: 20px;
}
/* line 386, ../sass/order/_order.scss */
/* line 387, ../sass/order/_order.scss */
.order-order #main #app-order-order #content-step-payment .credit .info {
margin-left: 20px;
color: gray;
}
/* line 393, ../sass/order/_order.scss */
/* line 394, ../sass/order/_order.scss */
.order-order #main #app-order-order #specific-delays {
margin-top: 15px;
}
/* line 401, ../sass/order/_order.scss */
/* line 402, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos {
margin-top: 30px;
}
/* line 403, ../sass/order/_order.scss */
/* line 404, ../sass/order/_order.scss */
.order-order #main #app-order-order #infos .panel-body {
padding-top: 0px;
white-space: pre-line;
}

/* line 413, ../sass/order/_order.scss */
/* line 414, ../sass/order/_order.scss */
#main #content .panel h3 {
font-family: "highvoltageregular";
margin: 0px;

+ 2
- 1
producer/web/sass/order/_order.scss Ver arquivo

@@ -306,9 +306,10 @@
width: 135px ;
text-align: center ;
.unit {
.price-infos {
color: gray ;
font-size: 13px ;
line-height: 15px;
}
}
.td-quantity {

Carregando…
Cancelar
Salvar