mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
parent
2bdf3b036d
commit
050739c1d7
@ -1041,8 +1041,18 @@ class AdvsController extends PublicController
|
|||||||
} else {
|
} else {
|
||||||
$response['newQuantity'] = $adv->stock;
|
$response['newQuantity'] = $adv->stock;
|
||||||
}
|
}
|
||||||
$response['status'] = $status;
|
|
||||||
$response['newPrice'] = $adv->price * $response['newQuantity'];
|
$response['newPrice'] = $adv->price * $response['newQuantity'];
|
||||||
|
|
||||||
|
$separator = ",";
|
||||||
|
$decimals = 2;
|
||||||
|
$point = ".";
|
||||||
|
|
||||||
|
$response['newPrice'] = number_format($response['newPrice'], $decimals, $point, str_replace(' ', ' ', $separator));
|
||||||
|
$symbol = config('streams::currencies.supported.' . strtoupper(setting_value('streams::currency')) . '.symbol');
|
||||||
|
|
||||||
|
$response['newPrice'] = $symbol . $response['newPrice'];
|
||||||
|
$response['status'] = $status;
|
||||||
$response['maxQuantity'] = $adv->stock;
|
$response['maxQuantity'] = $adv->stock;
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|||||||
56
resources/streams/config/currencies.php
Normal file
56
resources/streams/config/currencies.php
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Enabled Currencies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Define an array of currencies enabled for translatable input.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'enabled' => explode(',', env('ENABLED_CURRENCIES', 'USD')),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Currency
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The default currency will be used if one can not
|
||||||
|
| be determined automatically.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('DEFAULT_CURRENCY', 'USD'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Supported Currencies
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| In order to enable a currency or use it at all
|
||||||
|
| the ISO currency code MUST be in this array.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'supported' => [
|
||||||
|
'USD' => [
|
||||||
|
'name' => 'US Dollar',
|
||||||
|
'direction' => 'ltr',
|
||||||
|
'symbol' => '$',
|
||||||
|
'separator' => ',',
|
||||||
|
'point' => '.',
|
||||||
|
'decimals' => 2,
|
||||||
|
],
|
||||||
|
'TRY' => [
|
||||||
|
'name' => 'Türk Lirası',
|
||||||
|
'direction' => 'ltr',
|
||||||
|
'symbol' => '₺',
|
||||||
|
'separator' => ',',
|
||||||
|
'point' => '.',
|
||||||
|
'decimals' => 2,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
Loading…
Reference in New Issue
Block a user