Browse Source

Correctif mineur

packProduct
Fabien Normand 3 years ago
parent
commit
d35b170a7b
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      Solver/Config/UnitSolver.php

+ 6
- 2
Solver/Config/UnitSolver.php View File

class UnitSolver 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…
Cancel
Save