Bladeren bron

Merge branch 'develop' of https://forge.laclic.fr/Laclic/CaracoleBundle into develop

packProduct
Charly 3 jaren geleden
bovenliggende
commit
e9022dd930
1 gewijzigde bestanden met toevoegingen van 6 en 2 verwijderingen
  1. +6
    -2
      Solver/Config/UnitSolver.php

+ 6
- 2
Solver/Config/UnitSolver.php Bestand weergeven

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



Laden…
Annuleren
Opslaan