'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'photo'],
'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',
'format' => 'raw',
'value' => function ($model) use ($productModule) {
if ($model->price) {
return Price::format($productModule->getPriceWithTax($model)) . '
' . $productModule->getSolver()->strUnit($model, '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
]); ?>