Shopify – Updating Cart Drawer When Open

Note: This applies to themes built on Timber, it may not work on your theme.

This was easy to fix, but only because user Benecke who opened an issue on GitHub was good enough to come back later and update what he did to actually fix the issue.

The only thing worse than not doing that is coming back and writing Thanks, problem solved! without actually explaining what they did to solve it. Damn those fools to hell!!

https://github.com/Shopify/Timber/issues/618
ajaxCart.load();
And you’d include that at the end of the $.ajax({}) method in the snippets/ajaxify-cart.liquid file;
// Add to cart.
$.ajax({
    url: _config.shopifyAjaxAddURL,
    dataType: 'json',
    type: 'post',
    data: $addToCartForm.serialize(),
    success: function (itemData) {
        // Re-enable add to cart button.
        $addToCartBtn.addClass('inverted');
        _setText($addToCartBtn, _config.addedToCartBtnLabel);
        _showFeedback('success', '<i class="fa fa-check"></i> Added to cart! <a href="/cart">View cart</a> or <a href="/collections/all">continue shopping</a>.', $addToCartForm);
        window.setTimeout(function () {
            $addToCartBtn.prop('disabled', false).removeClass('disabled').removeClass('inverted');
            _setText($addToCartBtn, _config.addToCartBtnLabel);
        }, _config.howLongTillBtnReturnsToNormal);
        // Update cart count and show cart link.
        $.getJSON(_config.shopifyAjaxCartURL, function (cart) {
            if (_config.cartCountSelector && $(_config.cartCountSelector).size()) {
                var value = $(_config.cartCountSelector).html() || '0';
                $(_config.cartCountSelector).html(value.replace(/[0-9]+/, cart.item_count)).removeClass('hidden-count');
            }
            $('.cart-counter').html(cart.item_count);
            if (_config.cartTotalSelector && $(_config.cartTotalSelector).size()) {
                if (typeof Currency !== 'undefined' && typeof Currency.moneyFormats !== 'undefined') {
                    var newCurrency = '';
                    if ($('[name="currencies"]').size()) {
                        newCurrency = $('[name="currencies"]').val();
                    }
                    else if ($('#currencies span.selected').size()) {
                        newCurrency = $('#currencies span.selected').attr('data-currency');
                    }
                    if (newCurrency) {
                        $(_config.cartTotalSelector).html('<span class=money>' + Shopify.formatMoney(Currency.convert(cart.total_price, "{{ shop.currency }}", newCurrency), Currency.money_format[newCurrency]) + '</span>');
                    }
                    else {
                        $(_config.cartTotalSelector).html(Shopify.formatMoney(cart.total_price, "{{ shop.money_format | remove: "'" | remove: '"' }}"));
                    }
                }
                else {
                    $(_config.cartTotalSelector).html(Shopify.formatMoney(cart.total_price, "{{ shop.money_format | remove: "'" | remove: '"' }}"));
                }
            }
            ;
        });
        // Here we are here folks
        ajaxCart.load();
    },