public function getQuantityInherited(ProductFamilyInterface $productFamily): ?float | public function getQuantityInherited(ProductFamilyInterface $productFamily): ?float | ||||
{ | { | ||||
return $productFamily->getQuantity(); | |||||
if($productFamily->getQuantity()){ | |||||
return $productFamily->getQuantity(); | |||||
}else{ | |||||
return 1; | |||||
} | |||||
} | } | ||||
public function getUnitInherited(ProductFamilyInterface $productFamily) | public function getUnitInherited(ProductFamilyInterface $productFamily) |
{ | { | ||||
if ($product->getQuantity()) { | if ($product->getQuantity()) { | ||||
return $product->getQuantity(); | return $product->getQuantity(); | ||||
} else { | |||||
} else if($product->getProductFamily()->getQuantity()){ | |||||
return $product->getProductFamily()->getQuantity(); | return $product->getProductFamily()->getQuantity(); | ||||
}else{ | |||||
return 1; | |||||
} | } | ||||
} | } | ||||