Currency recalc, design
This commit is contained in:
@@ -52,8 +52,9 @@ class ProductsCompareController extends Controller
|
||||
$coef = floatval(CurrencyRates::where('currency',$currency)->first()->rate);
|
||||
}
|
||||
|
||||
$products = $products->map(function ($product) use ($currencyRates, $coef) {
|
||||
$products = $products->map(function ($product) use ($currencyRates, $coef, $cHash) {
|
||||
$product["salesPrice"] = round(floatval(($product["salesPrice"]) / $currencyRates[$product["country"]]) * $coef, 2);
|
||||
$product["countryName"] = $cHash[$product["country"]];
|
||||
return $product;
|
||||
});
|
||||
Log::info("{products}", ["products" => $products]);
|
||||
|
||||
Reference in New Issue
Block a user