Ver código fonte

Correctif mineur

packProduct
Fabien Normand 3 anos atrás
pai
commit
d35b170a7b
1 arquivos alterados com 6 adições e 2 exclusões
  1. +6
    -2
      Solver/Config/UnitSolver.php

+ 6
- 2
Solver/Config/UnitSolver.php Ver arquivo

@@ -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;
}
}



Carregando…
Cancelar
Salvar