Skip to content

Shopify MiniCart JS is a shorthand code for fast Shopify mini cart integration. It provides a fancy mini cart slider and 100% customizable. Simple and beautiful!

Notifications You must be signed in to change notification settings

Sanj718/Shopify-MinicartJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopify MiniCart JS

Features 🚀

  • Slide-out min-cart
  • Total quantity indicator
  • Easy deployment & customizable
  • Custom cart endpoint support
  • Global usage through window.mini_cart

Integration ⚙️

  1. Copy files to corresponding directories into your theme
  2. Modify theme.liquid file (follow the sample in layouts folder)

Usage ✅

  1. Add data-minicart-open data attribute to trigger open mini cart.
  2. 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)
        );
    }

TODO ⏳
  • Support of Compare at price

🌟 Feel free to Star and PR. sanjar.dev

About

Shopify MiniCart JS is a shorthand code for fast Shopify mini cart integration. It provides a fancy mini cart slider and 100% customizable. Simple and beautiful!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published