Skip to content

Commit

Permalink
Changed price type from string to float
Browse files Browse the repository at this point in the history
  • Loading branch information
ihorvansach committed May 29, 2023
1 parent a918e82 commit 79245d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Model/AbstractDataLayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,20 @@ protected function getCurrentCurrencyCode(): string
* Format price
*
* @param float $price
* @return string
* @return float
*/
protected function formatPrice(float $price): string
protected function formatPrice(float $price): float
{
return number_format($price, 2, '.', '');
return (float)number_format($price, 2, '.', '');
}

/**
* Get product price
*
* @param Product $product
* @return string
* @return float
*/
protected function getPrice(Product $product): string
protected function getPrice(Product $product): float
{
$priceInfo = $product->getPriceInfo()->getPrice('final_price')->getAmount();
$price = $priceInfo->getValue();
Expand Down

0 comments on commit 79245d9

Please sign in to comment.