Skip to content

Instantly share code, notes, and snippets.

View KhalilAhmadDanish's full-sized avatar

Khalil Ahmad Danish KhalilAhmadDanish

  • Herat , Afghanistan
View GitHub Profile
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script>
var cartCount = {{ cart.item_count }};
$(document)
.ready(function() {
@KhalilAhmadDanish
KhalilAhmadDanish / ajax-cart.js
Created August 5, 2022 12:31 — forked from marioloncarek/ajax-cart.js
complete shopify ajax cart solution with drawer and modal, adding and removing products - ugly AF
const defaults = {
cartModal: '.js-ajax-cart-modal', // classname
cartModalContent: '.js-ajax-cart-modal-content', // classname
cartModalClose: '.js-ajax-cart-modal-close', // classname
cartDrawer: '.js-ajax-cart-drawer', // classname
cartDrawerContent: '.js-ajax-cart-drawer-content', // classname
cartDrawerClose: '.js-ajax-cart-drawer-close', // classname
cartDrawerTrigger: '.js-ajax-cart-drawer-trigger', // classname
cartOverlay: '.js-ajax-cart-overlay', // classname
cartCounter: '.js-ajax-cart-counter', // classname