WEB SYSTEMS PRO
Platforma e-commerce

Konfiguracja koszyka

199 PLN

* Cena netto, należy doliczyć 23% VAT

Kod produktu:WSP-110-PL
Wersja
1.1.1.1.wsp
Aktualizacja
27.10.2021
LicencjaWeb Systems Pro
Wersja1.1.1.1.wsp
Aktualizacja28 października 2021


Konfiguracja koszyka krok po kroku

Możesz skonfigurować dynamiczne sprawdzanie dostępności komponentów na stronie koszyka, gdy ilość towaru zostanie zmieniona lub usunięta.

Ponieważ nie możesz tego zrobić bez wprowadzania zmian w motywie projektu, musisz wykonać następujące czynności.

  1. Przejdź na stronę Sklep -> Witryna -> Szablony -> cart.js

  2. Dodaj kod do funkcji odpowiedzialnej za śledzenie zmian ilości towaru:

        if (typeof $.itemsetsFrontend !== 'undefined') {
            $.itemsetsFrontend.quantityChange(that);
        }

    gdzie that jest polem z ilością towaru (obiekt jQuery)

  3. Dodaj kod do funkcji odpowiedzialnej za śledzenie usuwania towaru:

        if (typeof $.itemsetsFrontend !== 'undefined') {
            $.itemsetsFrontend.cartDelete(that);
        }

    gdzie that jest wciśnięty przycisk usuwania (obiekt jQuery)

Jeśli nie masz pewności co do swojej wiedzy - skontaktuj się z twórcą motywu. To zadanie nie zajmie mu więcej niż dwie minuty.

Rozważ przykłady niektórych motywów projektowych:

Motyw projektu Domyślny 4.0

Mniej więcej taka sama kolejność pracy w motywach ascetycznych, Clear, Nifty, Custom, Facebook, Sidebar, Vkontakte i wielu innych.

  1. Znajdź kod 

        $(".cart input.qty").change(function () {
            var that = $(this);
            if (that.val() > 0) {
                var row = that.closest('div.row');
                if (that.val()) {
                    $.post('save/', {html: 1, id: row.data('id'), quantity: that.val()}, function (response) {
                        row.find('.item-total').html(response.data.item_total);
                        if (response.data.q) {
                            that.val(response.data.q);
                        }
                        if (response.data.error) {
                            alert(response.data.error);
                        } else {
                            that.removeClass('error');
                        }
                        updateCart(response.data);
                    }, "json");
                }
            } else {
                that.val(1);
            }
        });

  2. I dodaj kod po "updateCart(response.data)", aby wyszło tak:

        $(".cart input.qty").change(function () {
            var that = $(this);
            if (that.val() > 0) {
                var row = that.closest('div.row');
                if (that.val()) {
                    $.post('save/', {html: 1, id: row.data('id'), quantity: that.val()}, function (response) {
                        row.find('.item-total').html(response.data.item_total);
                        if (response.data.q) {
                            that.val(response.data.q);
                        }
                        if (response.data.error) {
                            alert(response.data.error);
                        } else {
                            that.removeClass('error');
                        }
                        updateCart(response.data);
                        if (typeof $.itemsetsFrontend !== 'undefined') {
                            $.itemsetsFrontend.quantityChange(that);
                        }

                    }, "json");
                }
            } else {
                that.val(1);
            }
        });

  3. Znajdź kod 

        $(".cart a.delete").click(function () {
            var row = $(this).closest('div.row');
            $.post('delete/', {html: 1, id: row.data('id')}, function (response) {
                if (response.data.count == 0) {
                    location.reload();
                }
                row.remove();
                updateCart(response.data);
                }, "json");
            return false;
        });

  4. I dodaj na początku wiersz "var that = $(this);" i po "updateCart(response.data)" kod, aby wyszło tak:

        $(".cart a.delete").click(function () {
            var that = $(this);
            var row = $(this).closest('div.row');
            $.post('delete/', {html: 1, id: row.data('id')}, function (response) {
                if (response.data.count == 0) {
                    location.reload();
                }
                row.remove();
                updateCart(response.data);
                if (typeof $.itemsetsFrontend !== 'undefined') {
                    $.itemsetsFrontend.cartDelete(that);
                }

            }, "json");
            return false;
        });