Promotion Frontend dynamic

This commit is contained in:
Kevin Adametz 2021-11-26 18:23:10 +01:00
parent c9e1545693
commit 1cc8e025a1
29 changed files with 551 additions and 163 deletions

View file

@ -296,7 +296,13 @@ class Product extends Model
return $this->hasMany(ProductIngredient::class, 'product_ingredients', 'id');
}
public function getShortCopy($clean = false, $len = false){
$ret = $this->short_copy ? $this->short_copy : $this->description;
if($len && $clean){
return substr_ellipsis($ret, $len, $clean);
}
return $ret;
}
public function getActionName($id = 0){
if(isset($this->actions[$id])){
return $this->actions[$id];