checkout, register, payment,

checkout correction,
register wizard,
payment packege,
This commit is contained in:
Kevin Adametz 2019-03-02 00:08:11 +01:00
parent 6e3adac4d7
commit 446bc4561b
48 changed files with 2580 additions and 1493 deletions

View file

@ -80,6 +80,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
*/
class Product extends Model
{
protected $table = 'products';
protected $casts = [
@ -89,7 +91,8 @@ class Product extends Model
'icons' => 'array',
'trans_description' => 'array',
'trans_usage' => 'array',
'trans_ingredients' => 'array'
'trans_ingredients' => 'array',
'action' => 'array'
];
use Sluggable;
@ -114,7 +117,21 @@ class Product extends Model
'ingredients',
'pos',
'amount',
'active'
'active',
'show_at',
'action'
];
public $showATs = [
0 => 'nur User Shop',
1 => 'User + Berater Shop',
2 => 'nur Berater Shop',
3 => 'Registrierung Shop',
];
public $actions = [
0 => 'payment_for_account',
1 => 'payment_for_shop',
];
public function sluggable()
@ -139,7 +156,12 @@ class Product extends Model
}
public function getActionName($id = 0){
if(isset($this->actions[$id])){
return $this->actions[$id];
}
return false;
}
public function _format_number($value){
return preg_replace("/[^0-9,]/", "", $value);
}
@ -163,6 +185,9 @@ class Product extends Model
public function getFormattedPrice()
{
if(!isset($this->attributes['price'])){
return "";
}
if(\App::getLocale() == "en"){
return number_format($this->attributes['price'], 2, '.', ',');
}
@ -171,6 +196,9 @@ class Product extends Model
public function getFormattedPriceEk()
{
if(!isset($this->attributes['price_ek'])){
return "";
}
if(\App::getLocale() == "en"){
return number_format($this->attributes['price_ek'], 2, '.', ',');
}
@ -179,6 +207,9 @@ class Product extends Model
public function getFormattedTax()
{
if(!isset($this->attributes['tax'])){
return "";
}
if(\App::getLocale() == "en"){
return number_format($this->attributes['tax'], 2, '.', ',');
}
@ -187,6 +218,9 @@ class Product extends Model
public function getFormattedPriceOld()
{
if(!isset($this->attributes['price_old'])){
return "";
}
if(\App::getLocale() == "en"){
return number_format($this->attributes['price_old'], 2, '.', ',');
}