last from 01 2019
This commit is contained in:
parent
f9fcaac838
commit
ed80b25b85
19 changed files with 626 additions and 341 deletions
|
|
@ -106,5 +106,22 @@ class DraftItem extends Model
|
|||
return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0;
|
||||
}
|
||||
|
||||
public function setPriceAttribute($value)
|
||||
{
|
||||
$value = $this->_format_number($value);
|
||||
$this->attributes['price'] = floatval(str_replace(',', '.', $value));
|
||||
}
|
||||
|
||||
public function getPriceAttribute()
|
||||
{
|
||||
// 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator
|
||||
return number_format(($this->attributes['price']), 2, ',', '.');
|
||||
}
|
||||
|
||||
public function getPriceRaw()
|
||||
{
|
||||
return isset($this->attributes['price']) ? $this->attributes['price'] : 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue