Kaynağa Gözat

UnitSolver : correctif getWeight()

packProduct
Guillaume 2 yıl önce
ebeveyn
işleme
3773fe4ecc
1 değiştirilmiş dosya ile 5 ekleme ve 8 silme
  1. +5
    -8
      Solver/Config/UnitSolver.php

+ 5
- 8
Solver/Config/UnitSolver.php Dosyayı Görüntüle

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


}

Yükleniyor…
İptal
Kaydet