belongsTo('App\Models\ShoppingUser','shopping_user_id'); } public function country() { return $this->belongsTo('App\Models\Country','country_id'); } public function user_shop() { return $this->belongsTo('App\Models\UserShop','user_shop_id'); } public function shopping_order_items(){ return $this->hasMany('App\Models\ShoppingOrderItem', 'shopping_order_id'); } public function shopping_payments(){ return $this->hasMany('App\Models\ShoppingPayment', 'shopping_order_id'); } public function _format_number($value) { return preg_replace("/[^0-9,]/", "", $value); } public function getFormattedShipping() { if (\App::getLocale() == "en") { return number_format($this->attributes['shipping'], 2, '.', ','); } return number_format($this->attributes['shipping'], 2, ',', '.'); } public function getFormattedTotalShipping() { if (\App::getLocale() == "en") { return number_format($this->attributes['total_shipping'], 2, '.', ','); } return number_format($this->attributes['total_shipping'], 2, ',', '.'); } public function getFormattedPrice() { if (\App::getLocale() == "en") { return number_format($this->attributes['price'], 2, '.', ','); } return number_format($this->attributes['price'], 2, ',', '.'); } }