diff --git a/src/Services/Freight.php b/src/Services/Freight.php index 78f8003..fc40117 100644 --- a/src/Services/Freight.php +++ b/src/Services/Freight.php @@ -343,10 +343,14 @@ protected function transformCorreiosService(array $service) ]; } + $price = preg_replace("/[^0-9.,]*/", "", $service['Valor']); + $price = str_replace(".", "", $price); + $price = str_replace(",", ".", $price); + return [ 'name' => $this->friendlyServiceName($service['Codigo']), 'code' => $service['Codigo'], - 'price' => floatval(str_replace(',', '.', $service['Valor'])), + 'price' => floatval($price), 'deadline' => intval($service['PrazoEntrega']), 'error' => $error, ];