Abo Einmalprodukte und Bestätigung abschließen
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2bdc9ada3c
commit
2269ce031f
57 changed files with 3647 additions and 371 deletions
|
|
@ -24,7 +24,7 @@ use Yard;
|
|||
* @property Carbon|null $updated_at
|
||||
* @property Product $product
|
||||
* @property UserAbo $user_abo
|
||||
* @package App\Models
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboItem newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboItem newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboItem query()
|
||||
|
|
@ -36,55 +36,57 @@ use Yard;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboItem whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboItem whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboItem whereUserAboId($value)
|
||||
*
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class UserAboItem extends Model
|
||||
{
|
||||
protected $table = 'user_abo_items';
|
||||
protected $table = 'user_abo_items';
|
||||
|
||||
protected $casts = [
|
||||
'user_abo_id' => 'int',
|
||||
'product_id' => 'int',
|
||||
'comp' => 'int',
|
||||
'qty' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
protected $casts = [
|
||||
'user_abo_id' => 'int',
|
||||
'product_id' => 'int',
|
||||
'comp' => 'int',
|
||||
'qty' => 'int',
|
||||
'status' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_abo_id',
|
||||
'product_id',
|
||||
'comp',
|
||||
'qty',
|
||||
'status'
|
||||
];
|
||||
protected $fillable = [
|
||||
'user_abo_id',
|
||||
'product_id',
|
||||
'comp',
|
||||
'qty',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
public function user_abo()
|
||||
{
|
||||
return $this->belongsTo(UserAbo::class);
|
||||
}
|
||||
public function user_abo()
|
||||
{
|
||||
return $this->belongsTo(UserAbo::class);
|
||||
}
|
||||
|
||||
public function getPrice()
|
||||
{
|
||||
$ufactor = $this->user_abo->is_for === 'me' ? true : false;
|
||||
$tax_free = $ufactor ? true : Yard::instance('shopping')->getUserTaxFree();
|
||||
$userCountry = Yard::instance('shopping')->getUserCountry();
|
||||
return $this->product->getPriceWith($tax_free, $ufactor, $userCountry);
|
||||
}
|
||||
public function getPrice()
|
||||
{
|
||||
$ufactor = $this->user_abo->is_for === 'me' ? true : false;
|
||||
$tax_free = $ufactor ? true : Yard::instance(\App\Services\AboOrderCart::INSTANCE)->getUserTaxFree();
|
||||
$userCountry = Yard::instance(\App\Services\AboOrderCart::INSTANCE)->getUserCountry();
|
||||
|
||||
return $this->product->getPriceWith($tax_free, $ufactor, $userCountry);
|
||||
}
|
||||
|
||||
public function getFormattedPrice(){
|
||||
/** der Preis wird für den User berechnet */
|
||||
return Util::formatNumber($this->getPrice());
|
||||
}
|
||||
public function getFormattedPrice()
|
||||
{
|
||||
/** der Preis wird für den User berechnet */
|
||||
return Util::formatNumber($this->getPrice());
|
||||
}
|
||||
|
||||
|
||||
public function getFormattedTotalPrice(){
|
||||
/** der Preis wird für den User berechnet */
|
||||
return Util::formatNumber($this->getPrice() * $this->qty);
|
||||
}
|
||||
public function getFormattedTotalPrice()
|
||||
{
|
||||
/** der Preis wird für den User berechnet */
|
||||
return Util::formatNumber($this->getPrice() * $this->qty);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue