Minor presentation fixes for ordering, and npm updates
This commit is contained in:
@@ -78,9 +78,12 @@ class Product extends Model
|
||||
return $this->setup_cost + ( $this->default_cost * array_get($table,$this->price_recurr_default) * $this->contract_term);
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
public function getNameAttribute(Language $lo=NULL)
|
||||
{
|
||||
return $this->name(Auth::user()->language);
|
||||
if (is_null($lo))
|
||||
$lo = $this->getDefaultLanguage();
|
||||
|
||||
return $this->descriptions->where('language_id',$lo->id)->first()->description_short;
|
||||
}
|
||||
|
||||
public function getProductTypeAttribute()
|
||||
@@ -123,7 +126,7 @@ class Product extends Model
|
||||
if (is_null($lo))
|
||||
$lo = $this->getDefaultLanguage();
|
||||
|
||||
return $this->descriptions->where('language_id',$lo->id)->first()->description_short;
|
||||
return $this->descriptions->where('language_id',$lo->id)->first()->description_full;
|
||||
}
|
||||
|
||||
public function orderValidation(Request $request)
|
||||
|
@@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class ProductTranslate extends Model
|
||||
{
|
||||
protected $table = 'ab_product_translate';
|
||||
|
||||
public function getDescriptionFullAttribute($value)
|
||||
{
|
||||
return unserialize($value);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user