Merge pull request #994 from openclassify/muammertop

#3568 product detail currency
This commit is contained in:
Fatih Alp 2021-03-16 17:02:58 +03:00 committed by GitHub
commit 81fa291795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\Streams\Platform\Message\MessageBag;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Anomaly\Streams\Platform\Model\Complaints\ComplaintsComplainTypesEntryModel;
use Anomaly\Streams\Platform\Support\Currency;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Http\Request;
@ -1254,14 +1255,7 @@ class AdvsController extends PublicController
$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($adv->currency) . '.symbol');
$response['newPrice'] = $symbol . $response['newPrice'];
$response['newPrice'] = app(Currency::class)->format($response['newPrice'], strtoupper($adv->currency));
$response['status'] = $status;
$response['maxQuantity'] = $adv->stock;
return $response;