payment Card first 4 payments inc. mails

This commit is contained in:
Kevin Adametz 2019-02-28 18:09:54 +01:00
parent c20deac3fe
commit 6e3adac4d7
38 changed files with 3063 additions and 921 deletions

View file

@ -6,5 +6,34 @@ use Illuminate\Database\Eloquent\Model;
class ShoppingOrderItem extends Model
{
//
}
protected $table = 'shopping_order_items';
protected $fillable = [
'shopping_order_id',
'row_id',
'product_id',
'qty',
'price',
'slug',
];
public function shopping_order()
{
return $this->belongsTo('App\Models\ShoppingOrder','shopping_order_id');
}
public function product()
{
return $this->belongsTo('App\Models\Product','product_id');
}
public function getFormattedPrice()
{
if (\App::getLocale() == "en") {
return number_format($this->attributes['price'], 2, '.', ',');
}
return number_format($this->attributes['price'], 2, ',', '.');
}
}