Skip to content

Commit

Permalink
fix(shops): fix error adding uncategorized items as shop stock, stock…
Browse files Browse the repository at this point in the history
… modal display (corowne#987)

* Fixes Undefined array key "" error on items without a category

* Adds img-fluid to the stock modal

---------

Co-authored-by: LostInProgres <[email protected]>
  • Loading branch information
LostInProgres and LostInProgres authored Jun 27, 2024
1 parent 840a3d1 commit 8da3a23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/shops/_stock_modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="text-center">Invalid item selected.</div>
@else
<div class="text-center mb-3">
<div class="mb-1"><a href="{{ $stock->item->idUrl }}"><img src="{{ $stock->item->imageUrl }}" alt="{{ $stock->item->name }}" /></a></div>
<div class="mb-1"><a href="{{ $stock->item->idUrl }}"><img class="img-fluid" src="{{ $stock->item->imageUrl }}" alt="{{ $stock->item->name }}" /></a></div>
<div><a href="{{ $stock->item->idUrl }}"><strong>{{ $stock->item->name }}</strong></a></div>
<div><strong>Cost: </strong> {!! $stock->currency->display($stock->cost) !!}</div>
@if ($stock->is_limited_stock)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/shops/shop.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@foreach ($items as $categoryId => $categoryItems)
@php
$visible = '';
if (!$categories[$categoryId]->is_visible) {
if ($categoryId && !$categories[$categoryId]->is_visible) {
$visible = '<i class="fas fa-eye-slash mr-1"></i>';
}
@endphp
Expand Down

0 comments on commit 8da3a23

Please sign in to comment.