$dataTable .= '<td>' . Html::encode($product['comment']) . '</td>';
// Изображения
- $dataTable .= '<td>';
- $images = $product->imagesWriteOffsErp;
+ $forWidget = false;
if (!empty($images)) {
- $dataTable .= '<div style="display: flex; flex-wrap: wrap; gap: 5px;">';
- foreach ($images as $image) {
- $dataTable .= Html::a(
- Html::img($image->url, ['style' => 'max-width: 100px; max-height: 100px;']),
- $image->url,
- [
- 'data-fancybox' => 'gallery',
- 'data-caption' => $product->name
- ]
- );
+ if ($forWidget) {
+ $dataTable .= '<div class="gallery-container">';
+ $dataTable .= dosamigos\gallery\Gallery::widget(['items' => $images]);
+ $dataTable .= '</div>';
+ } else {
+ $dataTable .= implode('', $images);
}
- $dataTable .= '</div>';
}
$dataTable .= '</td>';
-
+
// Видео
$dataTable .= '<td>';
$video = $product->video;