瀏覽代碼

Correctif mineur

packProduct
Fabien Normand 3 年之前
父節點
當前提交
d35b170a7b
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. +6
    -2
      Solver/Config/UnitSolver.php

+ 6
- 2
Solver/Config/UnitSolver.php 查看文件

@@ -9,8 +9,12 @@ use Lc\CaracoleBundle\Model\Config\UnitInterface;
class UnitSolver
{

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



Loading…
取消
儲存