Skip to content

Commit

Permalink
Show configured variant image in the cart (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG authored Jan 7, 2025
1 parent 0ad6ef5 commit 62b4b9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/views/cart/item.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
<td class="w-24">
<a :href="item.product.url_key + item.product.url_suffix | url">
<img
v-if="item.configured_variant?.image"
class="mx-auto"
:alt="item.product.name"
:src="resizedPath(item.configured_variant.image.url + '.webp', '80x80')"
height="80"
/>
<img
v-else-if="item.product.image"
class="mx-auto"
:alt="item.product.name"
:src="resizedPath(item.product.image.url + '.webp', '80x80')"
Expand Down
3 changes: 3 additions & 0 deletions resources/views/cart/queries/fragments/cart.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ fragment cart on Cart {
option_label
value_label
}
configured_variant {
...product
}
}
... on BundleCartItem {
@include('rapidez::cart.queries.partials.customizable_options')
Expand Down

0 comments on commit 62b4b9a

Please sign in to comment.