浏览代码

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

packProduct
Charly 3 年前
父节点
当前提交
e9022dd930
共有 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;
}
}



正在加载...
取消
保存