- Slide-out min-cart
- Total quantity indicator
- Easy deployment & customizable
- Custom cart endpoint support
- Global usage through
window.mini_cart
- Copy files to corresponding directories into your theme
- Modify
theme.liquid
file (follow the sample in layouts folder)
- Add
data-minicart-open
data attribute to trigger open mini cart. - Add
data-minicart-totalCount
to show cart total items quantity.
Sample:
<button data-minicart-open type="button">MINICART - <span data-minicart-totalCount>{{ cart.item_count }}</span></button>
Add window.mini_cart.updateCart()
after add to cart script.
Sample:
_addItemToCart: function(data) {
var params = {
url: '/cart/add.js',
data: $(data).serialize(),
dataType: 'json'
};
$.post(params)
.done(
function(item) {
window.mini_cart.updateCart()
}.bind(this)
)
.fail(
function(response) {
console.error(response)
}.bind(this)
);
}
- Support of Compare at price
🌟 Feel free to Star and PR. sanjar.dev