src/Models/Database/Product.php
public function getPriceAttribute($val)
    {
        $currentCurrencyCode = Session::get('currency_code');

        if (null === $currentCurrencyCode) {
            return $val;
        }

        $siteCurrency = App::get(SiteCurrencyInterface::class);
        $model = $siteCurrency->findByCode($currentCurrencyCode);

        return $val * $model->conversion_rate;
    }
public function getPriceAttribute($val)
    {
        $currentCurrencyCode = Session::get('currency_code');

        if (null === $currentCurrencyCode) {
            return $val;
        }

        $siteCurrency = App::get(SiteCurrencyInterface::class);
        $model = $siteCurrency->findByCode($currentCurrencyCode);

        return $val * $model->conversion_rate;
    }
public function getPriceAttribute ( $ val ) { $ currentCurrencyCode = Session :: get ( 'currency_code' ) ; if ( null === $ currentCurrencyCode ) { return $ val ; } $ siteCurrency = App :: get ( SiteCurrencyInterface :: class ) ; $ model = $ siteCurrency -> findByCode ( $ currentCurrencyCode ) ; return $ val * $ model -> conversion_rate ; }
Get the Price for the Product

@param float $val
@return float $price
Get the Price for the Product