Produits
'photo',
'format' => 'raw',
'contentOptions' => ['class' => 'photo'],
'value' => function ($model) {
if (strlen($model->photo)) {
return '';
}
return '';
}
];
}
$columnsProducts[] = [
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name product-name-description-block'],
'value' => function ($model) {
$html = '' . Html::encode($model->name) . '
';
if (strlen($model->description)) {
$html .= '' . Html::encode($model->description).'
';
}
if (strlen($model->recipe)) {
$html .= '';
}
return $html;
}
];
if ($hasProductWeight) {
$columnsProducts[] = [
'attribute' => 'weight',
'format' => 'raw',
'value' => function ($model) {
if (strlen($model->weight)) {
return $model->weight . ' g';
}
return '';
}
];
}
$columnsProducts[] = [
'attribute' => 'price',
'value' => function ($model) use ($productManager) {
if ($model->price) {
return Price::format($productManager->getPriceWithTax($model)) . ' (' . $productManager->strUnit($model->unit, 'wording_unit', true) . ')';
}
return '';
}
];
?>
query->count()) : ?>
= GridView::widget([
'dataProvider' => $dataProviderProducts,
'summary' => '',
'columns' => $columnsProducts
]); ?>
id]->query->count()): ?>
= Html::encode($category->name) ?>
= GridView::widget([
'dataProvider' => $dataProviderProductsByCategories[$category->id],
'summary' => '',
'columns' => $columnsProducts
]); ?>