Closed bobitza closed 11 months ago
You have a function in src/Casts/Price.php, this function format price and give from config ex 'eur' => 'EUR' or i have 'ron' => 'Lei' But give me RON not Lei string
src/Casts/Price.php
public function format(?string $key = null): ?string { $currency = $key ? explode('.', $key, 2)[0] : Bazar::getCurrency(); $price = Arr::get( $this->toArray(), $key ?: "{$currency}.default" ); return $price ? Str::currency($price, $currency) : null; }
So need to fix with this
public function format(?string $key = null): ?string { $currency = $key ? explode('.', $key, 2)[0] : Bazar::getCurrency(); //-- $price = Arr::get( $this->toArray(), $key ?: "{$currency}.default" ); //-- return $price ? Str::currency($price, array_search($currency, Bazar::getCurrencies())) : null; }
Description:
You have a function in
src/Casts/Price.php
, this function format price and give from config ex 'eur' => 'EUR' or i have 'ron' => 'Lei' But give me RON not Lei stringSo need to fix with this
Steps To Reproduce: