Custom Price / Land / User Order Homeparty
This commit is contained in:
parent
d46824a4ac
commit
51d81d8ec6
55 changed files with 1951 additions and 681 deletions
|
|
@ -188,5 +188,29 @@ class HomepartyUserOrderItem extends Model
|
|||
{
|
||||
return (float) (($this->attributes['price'] - $this->attributes['ek-price']) * $this->attributes['qty']);
|
||||
}
|
||||
|
||||
|
||||
public function getCurrencyByKey($key)
|
||||
{
|
||||
$rNumber = 0;
|
||||
if($this->homeparty && $this->homeparty->isPriceCurrency()){
|
||||
$user_country = $this->homeparty->getUserCountry();
|
||||
$faktor = isset($user_country->currency_faktor) ? $user_country->currency_faktor : 1;
|
||||
switch ($key) {
|
||||
case 'TotalIncomePrice':
|
||||
$rNumber = $this->geTotalIncomePrice() * $faktor;
|
||||
break;
|
||||
case 'TotalPrice':
|
||||
$rNumber = $this->getTotalPrice() * $faktor;
|
||||
break;
|
||||
case 'TotalEKPrice':
|
||||
$rNumber = $this->geTotalEKPrice() * $faktor;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return formatNumber($rNumber);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue