瀏覽代碼

UnitSolver : correctif getWeight()

packProduct
Guillaume 2 年之前
父節點
當前提交
3773fe4ecc
共有 1 個文件被更改,包括 5 次插入8 次删除
  1. +5
    -8
      Solver/Config/UnitSolver.php

+ 5
- 8
Solver/Config/UnitSolver.php 查看文件

@@ -2,20 +2,17 @@

namespace Lc\CaracoleBundle\Solver\Config;



use Lc\CaracoleBundle\Model\Config\UnitInterface;

class UnitSolver
{
public function getWeight(UnitInterface $unit, float $quantityProduct, ?int $quantity){
if($quantity) {
public function getWeight(UnitInterface $unit, float $quantityProduct, ?float $quantity)
{
if ($quantity) {
return ($quantityProduct / $unit->getCoefficient()) * $quantity;
}else{
}
else {
return 0;
}
}


}

Loading…
取消
儲存