diff --git a/src/Sylius/Component/Shipping/Calculator/FlatRateCalculator.php b/src/Sylius/Component/Shipping/Calculator/FlatRateCalculator.php index 994699373ae..de20bdc1169 100644 --- a/src/Sylius/Component/Shipping/Calculator/FlatRateCalculator.php +++ b/src/Sylius/Component/Shipping/Calculator/FlatRateCalculator.php @@ -28,7 +28,7 @@ class FlatRateCalculator extends Calculator */ public function calculate(ShippingSubjectInterface $subject, array $configuration) { - return $configuration['amount']; + return (int)$configuration['amount']; } /** diff --git a/src/Sylius/Component/Shipping/Calculator/FlexibleRateCalculator.php b/src/Sylius/Component/Shipping/Calculator/FlexibleRateCalculator.php index ab3ce1dbe25..5029ef1c1d3 100644 --- a/src/Sylius/Component/Shipping/Calculator/FlexibleRateCalculator.php +++ b/src/Sylius/Component/Shipping/Calculator/FlexibleRateCalculator.php @@ -41,7 +41,7 @@ public function calculate(ShippingSubjectInterface $subject, array $configuratio $additionalItems = $additionalItemLimit >= $additionalItems ? $additionalItems : $additionalItemLimit; } - return $firstItemCost + ($additionalItems * $additionalItemCost); + return (int)($firstItemCost + ($additionalItems * $additionalItemCost)); } /** diff --git a/src/Sylius/Component/Shipping/Calculator/PerItemRateCalculator.php b/src/Sylius/Component/Shipping/Calculator/PerItemRateCalculator.php index eeab8f9339d..585db6f7e42 100644 --- a/src/Sylius/Component/Shipping/Calculator/PerItemRateCalculator.php +++ b/src/Sylius/Component/Shipping/Calculator/PerItemRateCalculator.php @@ -26,7 +26,7 @@ class PerItemRateCalculator extends Calculator */ public function calculate(ShippingSubjectInterface $subject, array $configuration) { - return $configuration['amount'] * $subject->getShippingItemCount(); + return (int)($configuration['amount'] * $subject->getShippingItemCount()); } /**