From 7fb9f5214d9225e0e2d43319c602316e3da5661e Mon Sep 17 00:00:00 2001 From: Vinod Sowdagar <53818758+vinodsowdagar@users.noreply.github.com> Date: Mon, 13 May 2024 09:44:23 +0200 Subject: [PATCH] PLGMAG2V2-755: Typecast getRate return value to float (#697) --- Util/TaxUtil.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Util/TaxUtil.php b/Util/TaxUtil.php index 83520a9..cc298be 100644 --- a/Util/TaxUtil.php +++ b/Util/TaxUtil.php @@ -17,6 +17,7 @@ use Magento\Customer\Model\Session; use Magento\Customer\Model\Vat; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Quote\Api\Data\CartInterface; @@ -90,6 +91,7 @@ public function getShippingTaxRate(OrderInterface $order): float * @param CartInterface $cart * @param $taxRateId * @return float + * @throws LocalizedException */ public function getTaxRateByTaxRateIdAndCart(CartInterface $cart, $taxRateId): float { @@ -100,7 +102,7 @@ public function getTaxRateByTaxRateIdAndCart(CartInterface $cart, $taxRateId): f $cart->getStore() ); - return $this->calculation->getRate($request->setProductClassId($taxRateId)); + return (float)$this->calculation->getRate($request->setProductClassId($taxRateId)); } /**