Skip to content

Commit

Permalink
Merge pull request bagisto#7689 from jitendra-webkul/2.0.0
Browse files Browse the repository at this point in the history
Included options information with cart items
  • Loading branch information
jitendra-webkul committed Jun 22, 2023
2 parents b7eb466 + b455fd0 commit 0fd173a
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function toArray($request)
'formatted_price' => core()->formatPrice($this->price),
'total' => $this->total,
'formatted_total' => core()->formatPrice($this->total),
'options' => $this->additional,
'options' => $this->resource->additional['attributes'] ?? [],
'base_image' => $this->product->getTypeInstance()->getBaseImage($this)
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,31 @@ class="text-[16px] font-medium"
v-text="item.name"
>
</p>

<div
class="grid gap-x-[10px] gap-y-[6px] select-none"
v-if="item.options.length"
>
<div class="grid gap-[8px]">
<div class="" v-for="option in item.options">
<p class="text-[14px] font-medium">
@{{ option.attribute_name + ':' }}
</p>

<p class="text-[14px]">
@{{ option.option_label }}
</p>
</div>

</div>
</div>

<span
class="text-[#0A49A7] cursor-pointer"
@click="removeItem(item.id)"
>
@lang('shop::app.checkout.cart.remove')
</span>
</span>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
<script type="text/x-template" id="v-mini-cart-template">
<x-shop::drawer>
<x-slot:toggle>
<span class="icon-cart text-[24px] cursor-pointer"></span>
<span class="relative">
<span class="icon-cart text-[24px] cursor-pointer"></span>

<span
class="absolute py-[5px] px-[7px] top-[-15px] left-[18px] rounded-[44px] bg-[#060C3B] text-[#fff] text-[10px] font-semibold leading-[9px]"
v-if="cart?.items_count"
>
@{{ cart.items_count }}
</span>
</span>
</x-slot:toggle>

<x-slot:header>
Expand Down Expand Up @@ -47,6 +56,39 @@ class="text-[18px]"
>
</p>
</div>

<div
class="grid gap-x-[10px] gap-y-[6px] select-none"
v-if="item.options.length"
>
<div class="">
<p
class="flex gap-x-[15px] text-[16px] items-center cursor-pointer"
@click="item.option_show = ! item.option_show"
>
<!-- @translations -->
@lang('See Details')

<span
class="text-[24px]"
:class="{'icon-arrow-up': item.option_show, 'icon-arrow-down': ! item.option_show}"
></span>
</p>
</div>

<div class="grid gap-[8px]" v-show="item.option_show">
<div class="" v-for="option in item.options">
<p class="text-[14px] font-medium">
@{{ option.attribute_name + ':' }}
</p>

<p class="text-[14px]">
@{{ option.option_label }}
</p>
</div>

</div>
</div>

<div class="flex gap-[20px] items-center flex-wrap">
<x-shop::quantity-changer
Expand Down Expand Up @@ -74,12 +116,7 @@ class="pb-[30px]"
v-else
>
<div class="grid gap-y-[20px] b-0 place-items-center">
<img
src="{{ bagisto_asset('images/thank-you.png') }}"
class=""
alt=""
title=""
>
<img src="{{ bagisto_asset('images/thank-you.png') }}">

<p class="text-[20px]">
@lang('shop::app.checkout.cart.empty-cart')
Expand Down
1 change: 0 additions & 1 deletion public/themes/default/build/assets/app-448f5cd1.css

This file was deleted.

1 change: 1 addition & 0 deletions public/themes/default/build/assets/app-7bdccf29.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/themes/default/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"src/Resources/assets/css/app.css": {
"file": "assets/app-448f5cd1.css",
"file": "assets/app-7bdccf29.css",
"isEntry": true,
"src": "src/Resources/assets/css/app.css"
},
Expand Down

0 comments on commit 0fd173a

Please sign in to comment.