-
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
4e75206
commit e870b31
Showing
11 changed files
with
143 additions
and
89 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
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
19 changes: 12 additions & 7 deletions
19
resources/views/cart/partials/product/description.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,14 +1,19 @@ | ||
<td class="flex max-md:w-1/2 md:table-cell"> | ||
<div class="flex flex-col items-start"> | ||
<a :href="item.url | url"> | ||
<div dusk="cart-item-name">@{{ item.name }}</div> | ||
<div v-for="(optionValue, option) in item.options"> | ||
@{{ option }}: @{{ optionValue }} | ||
<a :href="item.product.url_key + item.product.url_suffix | url"> | ||
<div dusk="cart-item-name">@{{ item.product.name }}</div> | ||
<div v-for="option in item.configurable_options"> | ||
@{{ option.option_label }}: @{{ option.value_label }} | ||
</div> | ||
<div v-for="option in cart?.items2?.find((item) => item.item_id == itemId).options.filter((option) => !['info_buyRequest', 'option_ids'].includes(option.code) && option.label)"> | ||
@{{ option.label }}: @{{ option.value.title || option.value }} | ||
<div v-for="option in item.customizable_options"> | ||
@{{ option.label }}: @{{ option.values[0].label || option.values[0].value }} | ||
</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> | ||
@include('rapidez-ct::cart.partials.product.remove-button') | ||
</div> | ||
</td> | ||
</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,4 +1,5 @@ | ||
<td class="h-24 w-40 !pl-0 max-md:flex max-md:w-1/2"> | ||
<img v-if="item.image" class="object-contain" :alt="item.name" :src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento/catalog/product' + item.image + '.webp'"> | ||
<img v-if="item.image" class="object-contain" :alt="item.product.name" :src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento/catalog/product' + item.product.image.url.replace(config.media_url, '') + '.webp'"> | ||
<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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<td class="flex items-center font-medium max-md:w-1/3 md:table-cell"> | ||
<div v-if="item.specialPrice"> | ||
@{{ item.specialPrice | price }} | ||
<div v-if="item.prices.specialPrice"> | ||
@{{ item.prices.specialPrice | price }} | ||
</div> | ||
<div :class="{ 'line-through text-xs text-ct-inactive font-normal': item.specialPrice }"> | ||
@{{ item.price | price }} | ||
<div :class="{ 'line-through text-xs text-ct-inactive font-normal': item.prices.specialPrice }"> | ||
@{{ item.prices.price_including_tax.value | price }} | ||
</div> | ||
</td> | ||
<td class="flex items-center font-medium max-md:w-1/3 md:table-cell [&>*]:mx-auto"> | ||
<td class="flex items-center font-medium max-md:w-1/3 md:table-cell *:mx-auto"> | ||
<x-rapidez-ct::input.quantity/> | ||
</td> | ||
<td class="flex items-center justify-end text-right font-medium max-md:w-1/3 md:table-cell"> | ||
@{{ item.total | price }} | ||
</td> | ||
@{{ item.prices.row_total_including_tax.value | price }} | ||
</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
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
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,31 @@ | ||
<div class="flex w-20 overflow-hidden rounded border"> | ||
<button | ||
class="flex-1 bg-ct-inactive-100 transition hover:bg-opacity-80" | ||
v-on:click="item.qty <= item.min_sale_qty ? item.qty = item.qty : item.qty = +item.qty - item.qty_increments;changeQty(item)" | ||
>-</button> | ||
<input | ||
class="h-10 w-2/5 border-none px-0 text-center text-sm [appearance:textfield] focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" | ||
name="qty" | ||
type="number" | ||
{{ $attributes }} | ||
v-model="item.qty" | ||
v-on:change="changeQty(item)" | ||
v-bind:min="item.min_sale_qty > item.qty_increments ? item.min_sale_qty : item.qty_increments" | ||
v-bind:step="item.qty_increments" | ||
/> | ||
<button | ||
class="flex-1 bg-ct-inactive-100 transition hover:bg-opacity-80" | ||
v-on:click="item.qty = +item.qty + item.qty_increments;changeQty(item)" | ||
>+</button> | ||
</div> | ||
|
||
<graphql-mutation | ||
:query="'mutation ($cart_id: String!, $cart_item_id: Int, $quantity: Float) { updateCartItems(input: { cart_id: $cart_id, cart_items: [{ cart_item_id: $cart_item_id, quantity: $quantity }] }) { cart { ' + config.queries.cart + ' } } }'" | ||
:variables="{ cart_id: mask, cart_item_id: item.id, quantity: item.quantity }" | ||
:callback="updateCart" | ||
:error-callback="checkResponseForExpiredCart" | ||
v-slot="{ mutate, variables }" | ||
> | ||
<form v-on:submit.prevent="mutate" class="flex w-20 overflow-hidden rounded border"> | ||
<button | ||
class="flex-1 bg-ct-inactive-100 transition hover:bg-opacity-80" | ||
v-on:click.prevent="variables.quantity <= (item.product.stock_item?.min_sale_qty || 1) ? variables.quantity = variables.quantity : variables.quantity = +variables.quantity - (item.product.stock_item?.qty_increments || 1);mutate()" | ||
>-</button> | ||
<input | ||
class="h-10 w-2/5 border-none px-0 text-center text-sm [appearance:textfield] focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" | ||
name="qty" | ||
type="number" | ||
{{ $attributes }} | ||
v-model="variables.quantity" | ||
v-on:change="mutate" | ||
v-bind:min="Math.max(item.product.stock_item?.min_sale_qty, item.product.stock_item?.qty_increments) || null" | ||
v-bind:max="item.product.stock_item?.max_sale_qty" | ||
v-bind:step="item.qty_increments" | ||
v-bind:dusk="'qty-'+index" | ||
/> | ||
<button | ||
class="flex-1 bg-ct-inactive-100 transition hover:bg-opacity-80" | ||
v-on:click.prevent="variables.quantity = +variables.quantity + (item.product.stock_item?.qty_increments || 1);mutate()" | ||
>+</button> | ||
</form> | ||
</graphql-mutation> |