-
Notifications
You must be signed in to change notification settings - Fork 7
[3] Enhance out of stock message #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
8506fc4
9a40bb5
1c17902
8531f36
8b40f5e
7d9ea0a
dbf5f74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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> |
| 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> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,9 @@ | |
| </div> | ||
| </td> | ||
| <td class="flex items-center font-medium max-md:w-1/3 md:table-cell *:mx-auto"> | ||
| <x-rapidez-ct::input.quantity/> | ||
| <template v-if="item.is_available"> | ||
| <x-rapidez-ct::input.quantity/> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of scope but we can use the quantity select from the rapidez core? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just like the other feedback, its out of scope and we have issues ready for this subject |
||
| </template> | ||
| </td> | ||
| <td class="flex items-center justify-end text-right font-medium max-md:w-1/3 md:table-cell"> | ||
| @{{ item.prices.row_total_including_tax.value | price }} | ||
|
|
||
| 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> |
Uh oh!
There was an error while loading. Please reload this page.