Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
T
test-webshop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Artem
test-webshop
Commits
1cc9a314
Commit
1cc9a314
authored
May 14, 2020
by
Artem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bootstrap modal for clear cart button
parent
b5669a51
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
28 deletions
+37
-28
orders.css
public/css/profile/orders.css
+3
-0
cart.js
public/js/cart.js
+0
-10
cart.blade.php
resources/views/cart.blade.php
+28
-12
orders.blade.php
resources/views/profile/orders.blade.php
+6
-6
No files found.
public/css/profile/orders.css
View file @
1cc9a314
...
...
@@ -20,3 +20,6 @@
text-align
:
right
;
}
.order-item
:hover
{
background-color
:
lightgoldenrodyellow
;
}
public/js/cart.js
View file @
1cc9a314
...
...
@@ -40,15 +40,5 @@ function setRemoveItemEventListener() {
});
}
function
setClearCartEventListener
()
{
document
.
querySelector
(
'.js-clear-cart-btn'
).
addEventListener
(
'click'
,
function
(
e
)
{
const
isSure
=
confirm
(
'Are you sure you want to delete all items from cart?'
);
if
(
!
isSure
)
{
e
.
preventDefault
();
}
})
}
setUpdateCartQtyEventListener
();
setRemoveItemEventListener
();
setClearCartEventListener
();
resources/views/cart.blade.php
View file @
1cc9a314
...
...
@@ -5,11 +5,31 @@
<div class="
container
">
@if(Session::has('cart'))
<div class="
modal
fade
" id="
staticBackdrop
" tabindex="
-
1
" role="
dialog
" aria-labelledby="
staticBackdrop
Label
" aria-hidden="
true
">
<div class="
modal
fade
" id="
clearCartModal
" tabindex="
-
1
" role="
dialog
" aria-labelledby="
clearCartModal
Label
" aria-hidden="
true
">
<div class="
modal
-
dialog
" role="
document
" style="
margin
-
top
:
150
px
;
">
<div class="
modal
-
content
">
<div class="
modal
-
header
">
<h5 class="
modal
-
title
" id="
staticBackdropLabel
">Are you sure you want to place the order?</h5>
<h5 class="
modal
-
title
" id="
clearCartModalLabel
">Are you sure you want to delete all items from cart?</h5>
<button type="
button
" class="
close
" data-dismiss="
modal
" aria-label="
Close
">
<span aria-hidden="
true
">×</span>
</button>
</div>
<div class="
modal
-
body
d
-
flex
justify
-
content
-
between
">
<form action="
{{
route
(
'cart.clearCart'
)
}}
" method="
POST
">
@csrf
<button class="
btn
btn
-
danger
">Clear cart</button>
</form>
<button type="
button
" class="
btn
btn
-
secondary
" data-dismiss="
modal
">Close</button>
</div>
</div>
</div>
</div>
<div class="
modal
fade
" id="
placeOrderModal
" tabindex="
-
1
" role="
dialog
" aria-labelledby="
placeOrderModalLabel
" aria-hidden="
true
">
<div class="
modal
-
dialog
" role="
document
" style="
margin
-
top
:
150
px
;
">
<div class="
modal
-
content
">
<div class="
modal
-
header
">
<h5 class="
modal
-
title
" id="
placeOrderModalLabel
">Are you sure you want to place the order?</h5>
<button type="
button
" class="
close
" data-dismiss="
modal
" aria-label="
Close
">
<span aria-hidden="
true
">×</span>
</button>
...
...
@@ -33,10 +53,10 @@
<th style="
width
:
10
%
">Quantity</th>
<th style="
width
:
15
%
" class="
text
-
center
">Subtotal</th>
<th style="
width
:
15
%
" class="
text
-
right
">
<
form action="
{{
route
(
'cart.clearCart'
)
}}
" method="
POST
">
@csrf
<button class="
js
-
clear
-
cart
-
btn
btn
btn
-
danger
btn
-
sm
ml
-
auto
">Clear cart</button>
</form
>
<
button class="
btn
btn
-
danger
btn
-
sm
ml
-
auto
"
data-toggle="
modal
"
data-target="
#clearCartModal"
>
Clear
cart
</
button
>
</
th
>
</
tr
>
</
thead
>
...
...
@@ -80,13 +100,9 @@
data-action="
{{
route
(
'cart.updateQtyInCart'
)
}}
"
>Update quantity</button>
</td>
<td class="
hidden
-
xs
text
-
center
"><
strong>Total € {{
$cart->total_price
}}</strong
></td>
<td class="
hidden
-
xs
text
-
center
"><
b>Total € {{
$cart->total_price
}}</b
></td>
<td>
{{-- <form action="
{{
route
(
'order.sendOrder'
)
}}
" method="
POST
">--}}
{{-- @csrf--}}
{{-- <button class="
btn
btn
-
success
btn
-
block
">Send order</button>--}}
{{-- </form>--}}
<button class="
btn
btn
-
success
btn
-
block
" data-toggle="
modal
" data-target="
#staticBackdrop">
<button class="
btn
btn
-
success
btn
-
block
" data-toggle="
modal
" data-target="
#placeOrderModal">
Send
order
</
button
>
</
td
>
...
...
resources/views/profile/orders.blade.php
View file @
1cc9a314
...
...
@@ -14,14 +14,14 @@
data-toggle="
collapse
"
data-target="
#{{ 'order_' . $order->id }}"
>
<
div
class
="
mr
-
5
">Order# {{
$order->id
}}</div>
<
div
style
=
"width: 150px;
"
>
Order
# {{ $order->id }}</div>
<
div
>
{{
$order
->
created_at
->
format
(
'jS F Y G:i'
)
}}
</
div
>
<
div
class
="
ml
-
auto
">{{
$order->total_qty
}} {{ (
$order->total_qty
=== 1) ? 'item' : 'items' }}, total price {{
$order->total_price
}} EUR</div>
</div>
<div class="
collapse
" id="
{{
'order_'
.
$order
->
id
}}
">
@foreach(
$order->products
as
$product
)
<ul class="
list
-
group
list
-
group
-
flush
">
<li class="
list
-
group
-
item
">
<ul class="
list
-
group
list
-
group
-
flush
">
@foreach(
$order->products
as
$product
)
<li class="
list
-
group
-
item
order
-
item
">
<a href="
{{
$product
->
product
->
path
()
}}
">{{
$product->ordered_reference
}}</a>
<div class="
d
-
flex
">
<div>{{
$product->ordered_price
}} EUR</div>
...
...
@@ -29,8 +29,8 @@
<div class="
subtotal
-
price
">{{
$product->subtotal_price
}} EUR</div>
</div>
</li>
</ul>
@endforeach
@endforeach
</ul>
</div>
</div>
@endforeach
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment