Skip to content
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

Enhance out of stock message #144

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"Select an address": "Selecteer een adres",
"Select as billing": "Selecteer als factuuradres",
"Select as shipping": "Selecteer als verzendadres",
"This product is out of stock": "Dit product is op dit moment niet op voorraad",
"Send": "Versturen",
"Step 1 of 4": "Stap 1 van 4",
"Step :step out of :total": "Stap :step van :total",
Expand Down
10 changes: 5 additions & 5 deletions resources/views/cart/partials/product/description.blade.php
Original file line number Diff line number Diff line change
@@ -1,23 +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 class="text-red-600" v-if="!canOrderCartItem(item)">
@lang('This product it out of stock, remove it to continue your order.')
<div v-if="!canOrderCartItem(item)" class="text-ct-error text-balance bg-ct-error/5 my-2 max-w-sm p-2">
JimmyHoenderdaal marked this conversation as resolved.
Show resolved Hide resolved
@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>
9 changes: 7 additions & 2 deletions resources/views/cart/partials/product/image.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<td class="h-24 w-32 !pl-0 max-md:flex max-md:w-1/2">
<img v-if="item.product.image" class="object-contain" :alt="item.product.name" :src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento' + item.product.image.url.replace(config.media_url, '') + '.webp'">
<img
v-if="item.product.image"
v-bind:class="{'opacity-20' : !canOrderCartItem(item)}"
JimmyHoenderdaal marked this conversation as resolved.
Show resolved Hide resolved
class="object-contain"
:alt="item.product.name"
:src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento' + item.product.image.url.replace(config.media_url, '') + '.webp'"
>
<x-rapidez::no-image v-else />
</td>

4 changes: 3 additions & 1 deletion resources/views/cart/partials/product/price.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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="canOrderCartItem(item)">
<x-rapidez-ct::input.quantity/>
</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 }}
Expand Down