mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Adding a cart icon with count
This commit is contained in:
@@ -2,9 +2,19 @@
|
||||
nav.top-bar
|
||||
margin-bottom: 0px
|
||||
a.icon
|
||||
line-height: auto
|
||||
font-size: 1.75em
|
||||
&:hover
|
||||
text-decoration: none
|
||||
height: 45px
|
||||
color: white
|
||||
i
|
||||
font-size: 29px
|
||||
line-height: 45px
|
||||
span
|
||||
font-size: 13px
|
||||
display: inline-block
|
||||
line-height: 45px
|
||||
height: 45px
|
||||
vertical-align: top
|
||||
|
||||
body > section[role='main']
|
||||
padding: 0px
|
||||
|
||||
@@ -18,5 +18,9 @@ module Spree
|
||||
def last_completed_order
|
||||
spree_current_user.orders.complete.last
|
||||
end
|
||||
|
||||
def cart_count
|
||||
current_order.andand.line_items.count || 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,3 +10,12 @@
|
||||
= render 'shared/signed_out'
|
||||
- else
|
||||
= render 'shared/signed_in'
|
||||
|
||||
%section.top-bar-section
|
||||
%ul.right
|
||||
%li.cart
|
||||
%a.icon{href: cart_url}
|
||||
%i.fi-shopping-cart
|
||||
%span
|
||||
= cart_count
|
||||
items
|
||||
|
||||
Reference in New Issue
Block a user