Your IP : 3.138.111.28


Current Path : /home/bitrix/ext_www/coffe.land/include/head/
Upload File :
Current File : /home/bitrix/ext_www/coffe.land/include/head/head_minicart.php

<div id="minicart" class="header-minicart">
    <div data-target-element="#header-cart" class="skip-link skip-cart  no-count">
        <em class="icon icon-shopping-cart"></em>
        <span class="label">Пусто</span>
        <em id="closecart" class="fa caret"></em>
    </div>
    <div id="header-cart" class="block block-cart skip-content">
        <div id="minicart-error-message" class="minicart-message"></div>
        <div id="minicart-success-message" class="minicart-message"></div>
        <div class="minicart-wrapper">
            <p class="block-subtitle">
                Добавленный продукт(ы) <a class="close skip-link-close" href="#"
                                          title="Закрыть">&times;</a>
            </p>
            <p class="empty">В корзину ничего не добавлено.</p>
        </div>
        <script type="text/javascript">
            _Lbt.cart.empty();
        </script>
    </div>
</div>

<script>
    $( document ).ready(function() {
        $('#minicart').load('/ajax/cart.php #minicart');

        $('#minicart').click(function () {
            console.log("click");
            $('#header-cart').toggle();
        });
    });

    $( document ).ready(function () {
        $('.itemchquan').change(function () {
            var productid = $(this).attr("itemid");
            var quantity = $(this).val();

            console.log("Product id: "+productid);
            console.log("Product q: "+quantity);

            $.get( "/ajax/basket.php?id="+productid+"&count="+quantity, function( data ) {
                reloadnMiniCart();
            });
        })
    });


    function reloadnMiniCart() {
        $('#minicart').load('/ajax/cart.php #minicart', { limit: 10 }, function() {
            $('#header-cart').toggle();
        });

    }
</script>