Просмотр исходного кода

Vente au kilo : affchage du prix du produit dans la liste (backend)

dev
Guillaume Bourgeois 5 лет назад
Родитель
Сommit
80fc523327
1 измененных файлов: 23 добавлений и 0 удалений
  1. +23
    -0
      backend/views/product/index.php

+ 23
- 0
backend/views/product/index.php Просмотреть файл

@@ -76,6 +76,29 @@ $this->addButton(['label' => 'Nouveau produit <span class="glyphicon glyphicon-p
],
'name',
'description',
[
'attribute' => 'price',
'value' => function($model) {
$return = '' ;
if($model->price) {
$return = Price::format($model->price).' (' ;
if($model->unit == 'piece') {
$return .= 'la pièce' ;
}
elseif(in_array($model->unit, ['g','kg'])) {
$return .= 'le kg' ;
}
elseif(in_array($model->unit, ['mL','L'])) {
$return .= 'le litre' ;
}
$return .= ')' ;
}
return $return ;
}
],
[
'attribute' => 'active',
'headerOptions' => ['class' => 'active'],

Загрузка…
Отмена
Сохранить