-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8506fc4
Enhance out of stock message
JimmyHoenderdaal 9a40bb5
Replace v-if check variable
JimmyHoenderdaal 1c17902
Merge branch 'master' of github.com:rapidez/checkout-theme into feat/…
JimmyHoenderdaal 8531f36
Use correct variable
JimmyHoenderdaal 8b40f5e
Merge branch 'master' of github.com:rapidez/checkout-theme into feat/…
JimmyHoenderdaal 7d9ea0a
Remove duplicate translations
JimmyHoenderdaal dbf5f74
Fix translation
JimmyHoenderdaal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 comment
The 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