This commit is contained in:
vedatakd 2019-12-26 12:22:35 +03:00
parent 2bdf3b036d
commit 050739c1d7
2 changed files with 67 additions and 1 deletions

View File

@ -1041,8 +1041,18 @@ class AdvsController extends PublicController
} else {
$response['newQuantity'] = $adv->stock;
}
$response['status'] = $status;
$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;
return $response;
}

View 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,
],
],
];