payment Card first 4 payments inc. mails
This commit is contained in:
parent
c20deac3fe
commit
6e3adac4d7
38 changed files with 3063 additions and 921 deletions
|
|
@ -6,5 +6,77 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class ShoppingOrder extends Model
|
||||
{
|
||||
//
|
||||
protected $table = 'shopping_orders';
|
||||
|
||||
protected $fillable = [
|
||||
'shopping_user_id',
|
||||
'country_id',
|
||||
'user_shop_id',
|
||||
'total',
|
||||
'shipping',
|
||||
'subtotal',
|
||||
'tax_rate',
|
||||
'tax',
|
||||
'total_shipping',
|
||||
'weight',
|
||||
];
|
||||
|
||||
|
||||
public function shopping_user()
|
||||
{
|
||||
return $this->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, ',', '.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue