Skip to content

Commit b6a5555

Browse files
fixes
1 parent 598f57f commit b6a5555

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/base/controllers/Admin/Commerce/Dashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected function collectData(DateTime $to, ?DateTime $from = null): array
152152
? ($product->getSku() ?: $product->getName())
153153
: $product->getName();
154154
$stock = ($product instanceof PhysicalProductInterface)
155-
? $product->getProductStock()->getCurrentQuantity()
155+
? $product->getProductStock()?->getCurrentQuantity()
156156
: $this->getUtils()->translate('unlimited', locale: $this->getCurrentLocale());
157157
} catch (\Exception $e) {
158158
$label = 'n/a';

templates/admin/commerce/dashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class="tab-pane fade <?= $first ? 'show active' : '' ?>"
194194
<tr>
195195
<td><?= htmlspecialchars($item['product']) ?></td>
196196
<td class="text-right"><?= (int)$item['total_qty'] ?></td>
197-
<td class="text-right"><?= htmlspecialchars($item['stock']) ?></td>
197+
<td class="text-right"><?= htmlspecialchars((string)$item['stock']) ?></td>
198198
</tr>
199199
<?php endforeach; ?>
200200
</tbody>

0 commit comments

Comments
 (0)