User Order all Margins / Checkout
This commit is contained in:
parent
a96d7d5c77
commit
224bf9e951
92 changed files with 3551 additions and 561 deletions
|
|
@ -103,13 +103,20 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @property-read int|null $country_prices_count
|
||||
* @property int|null $wp_number
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Product whereWpNumber($value)
|
||||
* @property bool|null $shipping_addon
|
||||
* @property bool|null $single_commission
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Product whereShippingAddon($value)
|
||||
* @property-read int|null $ingredients_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductIngredient[] $product_ingredients
|
||||
* @property-read int|null $product_ingredients_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Ingredient[] $p_ingredients
|
||||
* @property-read int|null $p_ingredients_count
|
||||
* @property bool $amount_commission
|
||||
* @property string|null $value_commission
|
||||
* @property string|null $partner_commission
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereAmountCommission($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Product wherePartnerCommission($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereSingleCommission($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Product whereValueCommission($value)
|
||||
*/
|
||||
class Product extends Model
|
||||
{
|
||||
|
|
@ -132,7 +139,8 @@ class Product extends Model
|
|||
'trans_ingredients' => 'array',
|
||||
'action' => 'array',
|
||||
'wp_number' => 'int',
|
||||
'shipping_addon' => 'bool',
|
||||
'single_commission' => 'bool',
|
||||
'amount_commission' => 'bool',
|
||||
'active' => 'bool'
|
||||
];
|
||||
use Sluggable;
|
||||
|
|
@ -164,7 +172,10 @@ class Product extends Model
|
|||
'amount',
|
||||
'active',
|
||||
'show_at',
|
||||
'shipping_addon',
|
||||
'single_commission',
|
||||
'amount_commission',
|
||||
'value_commission',
|
||||
'partner_commission',
|
||||
'identifier',
|
||||
'action',
|
||||
'upgrade_to_id'
|
||||
|
|
@ -175,8 +186,8 @@ class Product extends Model
|
|||
'show_upgrade' => 'Kann geupdatet werden',
|
||||
'show_order' => 'Wird immer als Option angezeigt',
|
||||
'upgrade' => 'Produktupgrade zur Produkt ID',
|
||||
'upgrade_member' => 'Beraterupgrade zur Karriere ID',
|
||||
//'proportional_voucher' => 'Anteiliger Gutschein Berater',
|
||||
'upgrade_member' => 'Vertriebspartnerupgrade zur Karriere ID',
|
||||
//'proportional_voucher' => 'Anteiliger Gutschein Vertriebspartner',
|
||||
|
||||
|
||||
];
|
||||
|
|
@ -190,12 +201,12 @@ class Product extends Model
|
|||
|
||||
public $showATs = [
|
||||
0 => 'Nur Kunden Bestellungen',
|
||||
1 => 'Kunden + Berater Bestellungen',
|
||||
2 => 'Nur Berater Bestellungen',
|
||||
3 => 'Registrierung / Mitgliedschaft Berater',
|
||||
4 => 'Nur Mitgliedschaft Berater',
|
||||
//5 => 'Onboarding Berater',
|
||||
//6 => 'Onboarding Berater + Berater Shop',
|
||||
1 => 'Kunden + Vertriebspartner Bestellungen',
|
||||
2 => 'Nur Vertriebspartner Bestellungen',
|
||||
3 => 'Registrierung / Mitgliedschaft Vertriebspartner',
|
||||
4 => 'Nur Mitgliedschaft Vertriebspartner',
|
||||
//5 => 'Onboarding Vertriebspartner',
|
||||
//6 => 'Onboarding Vertriebspartner + Vertriebspartner Shop',
|
||||
7 => 'zur internen Berechnung',
|
||||
|
||||
];
|
||||
|
|
@ -279,6 +290,14 @@ class Product extends Model
|
|||
$this->attributes['price_old'] = $value ? Util::reFormatNumber($value) : null;
|
||||
}
|
||||
|
||||
public function setValueCommissionAttribute( $value ) {
|
||||
$this->attributes['value_commission'] = $value ? Util::reFormatNumber($value) : 0;
|
||||
}
|
||||
|
||||
public function setPartnerCommissionAttribute( $value ) {
|
||||
$this->attributes['partner_commission'] = $value ? Util::reFormatNumber($value) : 0;
|
||||
}
|
||||
|
||||
public function getFormattedPrice()
|
||||
{
|
||||
return isset($this->attributes['price']) ? Util::formatNumber($this->attributes['price']) : "";
|
||||
|
|
@ -298,6 +317,16 @@ class Product extends Model
|
|||
{
|
||||
return isset($this->attributes['price_old']) ? Util::formatNumber($this->attributes['price_old']) : "";
|
||||
}
|
||||
public function getFormattedValueCommission()
|
||||
{
|
||||
return isset($this->attributes['value_commission']) ? Util::formatNumber($this->attributes['value_commission']) : 0;
|
||||
}
|
||||
|
||||
public function getFormattedPartnerCommission()
|
||||
{
|
||||
return isset($this->attributes['partner_commission']) ? Util::formatNumber($this->attributes['partner_commission']) : 0;
|
||||
}
|
||||
|
||||
|
||||
/*price by user Factor*/
|
||||
private function calcPriceUserFactor($price){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue