Promotion Frontend dynamic

This commit is contained in:
Kevin Adametz 2021-11-26 18:23:10 +01:00
parent c9e1545693
commit 1cc8e025a1
29 changed files with 551 additions and 163 deletions

View file

@ -47,7 +47,12 @@ class ShippingPrice extends Model
protected $table = 'shipping_prices';
protected $fillable = [
'shipping_id', 'price', 'price_comp', 'num_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to',
'shipping_id', 'price', 'price_comp', 'num_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to', 'shipping_for',
];
public static $shippingForTypes = [
1 => 'Berater Bestellungen',
2 => 'Shop Bestellungen',
];
public function shipping()
@ -55,6 +60,9 @@ class ShippingPrice extends Model
return $this->belongsTo('App\Models\Shipping', 'shipping_id');
}
public function getShippingForType(){
return isset(self::$shippingForTypes[$this->shipping_for]) ? self::$shippingForTypes[$this->shipping_for] : "";
}
public function setPriceAttribute($value)
{