-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f656c4
commit 499c6a1
Showing
5 changed files
with
23 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
<td class="flex max-md:w-1/2 md:table-cell"> | ||
@include('rapidez-ct::cart.partials.product.alert') | ||
<div class="flex flex-col items-start"> | ||
<a :href="item.product.url_key + item.product.url_suffix | url"> | ||
<div dusk="cart-item-name">@{{ item.product.name }}</div> | ||
<div> | ||
<a :href="item.product.url_key + item.product.url_suffix | url" dusk="cart-item-name">@{{ item.product.name }}</a> | ||
<div v-for="option in item.configurable_options"> | ||
@{{ option.option_label }}: @{{ option.value_label }} | ||
</div> | ||
<div v-for="option in item.customizable_options"> | ||
@{{ option.label }}: @{{ option.values[0].label || option.values[0].value }} | ||
</div> | ||
<div v-if="!item.is_available" class="text-ct-error text-balance bg-ct-error/5 my-2 max-w-sm p-2"> | ||
@lang('This product is out of stock, remove it to continue your order.') | ||
</div> | ||
<div v-for="option in config.cart_attributes"> | ||
<template v-if="item.product.attribute_values?.[option] && typeof item.product.attribute_values[option] === 'object'"> | ||
@{{ option }}: <span v-html="item.product.attribute_values[option]?.join(', ')"></span> | ||
</template> | ||
</div> | ||
</a> | ||
</div> | ||
@include('rapidez-ct::cart.partials.product.remove-button') | ||
</div> | ||
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<td class="h-24 w-32 !pl-0 max-md:flex max-md:w-1/2"> | ||
<img | ||
v-if="item.product.image" | ||
v-bind:class="{'opacity-20' : !item.is_available}" | ||
class="object-contain" | ||
:alt="item.product.name" | ||
:src="resizedPath(item.product.image.url + '.webp', '200')" | ||
/> | ||
<x-rapidez::no-image v-else /> | ||
</td> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
resources/views/cart/partials/product/remove-button.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
<graphql-mutation | ||
v-slot="{ mutate }" | ||
:query="'mutation ($cart_id: String!, $cart_item_id: Int) { removeItemFromCart(input: { cart_id: $cart_id, cart_item_id: $cart_item_id }) { ...cart } } ' + config.fragments.cart" | ||
:variables="{ cart_id: mask, cart_item_id: item.id }" | ||
:notify="{ message: item.product.name+' '+config.translations.cart.remove }" | ||
:notify="{ message: item.product.name + ' ' + config.translations.cart.remove }" | ||
:callback="updateCart" | ||
:error-callback="checkResponseForExpiredCart" | ||
v-slot="{ mutate }" | ||
> | ||
<button v-on:click="mutate" class="text-ct-inactive mt-1 text-xs hover:underline" :dusk="'item-delete-' + index"> | ||
<button | ||
v-on:click="mutate" | ||
class="text-ct-inactive mt-1 text-xs hover:underline" | ||
v-bind:class="{'!text-ct-error !underline' : !item.is_available}" | ||
:dusk="'item-delete-' + index" | ||
> | ||
@lang('Remove') | ||
</button> | ||
</graphql-mutation> |