瀏覽代碼

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

dev
Guillaume Bourgeois 5 年之前
父節點
當前提交
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'],

Loading…
取消
儲存