Skip to content

Commit

Permalink
fixed cancel issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shivendra-webkul committed Jun 23, 2023
1 parent e5d725f commit 109495a
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@
</div>

@if ($order->canCancel())
<div class="flex items-center gap-x-[10px] border border-[#E9E9E9] rounded-[12px] py-[12px] px-[20px] cursor-pointer">
<x-shop::form
id="cancelOrderForm"
action="{{ route('shop.customers.account.orders.cancel', $order->id) }}"
>
</x-shop::form>

<a
class="flex items-center gap-x-[10px] border border-[#E9E9E9] rounded-[12px] py-[12px] px-[20px] cursor-pointer"
href="javascript:void(0);"
onclick="cancelOrder('@lang('shop::app.customers.account.orders.view.cancel-confirm-msg')')"
>
@lang('shop::app.customer.account.order.view.cancel-btn-title')
</div>
</a>
@endif
</div>

Expand Down Expand Up @@ -935,4 +945,15 @@ class="px-6 py-[16px] text-black font-medium"
</div>
</div>
</div>

<script>
function cancelOrder(message) {
if (! confirm(message)) {
return;
}
const form = document.getElementById('cancelOrderForm');
form.submit();
}
</script>
</x-shop::layouts.account>

0 comments on commit 109495a

Please sign in to comment.