Skip to content

Commit f977d90

Browse files
committed
Added cart to docs
1 parent f59c377 commit f977d90

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ nav:
3939
url: '#helper-classes'
4040
- title: Sass mixins
4141
url: '#sass-mixins'
42+
- title: 'Cart'
43+
url: '#cart'
44+
4245
# Collections ================================================================
4346
collections:
4447
documentation:

docs/_documentation/cart.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: "Cartfox"
3+
handle: "cart"
4+
category: "cart"
5+
---
6+
Concrete uses [Cartfox🛒🦊](https://github.com/Elkfox/Cartfox) for all things ajax-y and cart-ish. If you're developing with Slate you can find an un-minified version in `/src/scripts/vendor/concrete.cart.js`. Upon deployment this will be minified into the `vendor.js`.
7+
8+
As you can see in the `/layout/theme.liquid` Cartfox is initialized here using Concrete's default elemnts for selectors. if you wish to changes class names or apply different selectors you can do so here.
9+
10+
{% highlight javascript %}
11+
var cart;
12+
$(document).ready(function() {
13+
cart = new Cartfox.Cart({{ cart | json }}, {
14+
addItem: '#AddToCart',
15+
cartItemCount: "#CartItemCount",
16+
cartTotal: "#CartTotal, .cart-total",
17+
decreaseQuantity: "[data-minus-one]",
18+
increaseQuantity: "[data-plus-one]",
19+
itemQuantity: '.item-qty',
20+
removeItem: '.removeItem',
21+
emptyTemplate: '#CartTemplate',
22+
itemsContainer: '#PopupCart .items'
23+
});
24+
});
25+
{% endhighlight %}

0 commit comments

Comments
 (0)