Jump to content

help for a leek

Recommended Posts

Site URL: http://koekenboer.be

Hi there!

I am a complete leek in building websites. If I put in the code that ecwid provides for the shopping cart, in my case: <div class='ec-cart-widget'></div>, it will appear on the left underneed my logo, plus I am not able to click on it. Can anyone help me what to do to get it to work and get in line with the menu on the top right of the site?

Thank you in advance!

Kind Regards

Link to comment
19 hours ago, annavdburgt said:

Site URL: http://koekenboer.be

Hi there!

I am a complete leek in building websites. If I put in the code that ecwid provides for the shopping cart, in my case: <div class='ec-cart-widget'></div>, it will appear on the left underneed my logo, plus I am not able to click on it. Can anyone help me what to do to get it to work and get in line with the menu on the top right of the site?

Thank you in advance!

Kind Regards

Did you include the script from ecwid as well?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
On 9/27/2021 at 4:50 PM, bangank36 said:

Did you include the script from ecwid as well?

wich is? haha sorry, i really do not know anything about building websites 😛

 

this one?

<script>
    (function (storeId) {
        document.addEventListener("pageChange", function () {
            loadEcwid();
        }, false);
        loadEcwid();

        function loadEcwid() {
            var containerId = 'my-store-' + storeId;
            var container = document.getElementById(containerId);
            var isEcwidPage = container != null;
            var ecwidLoaded = isEcwidPage && container.childNodes.length > 0;
            if (ecwidLoaded && isEcwidPage) return;
            if (!isEcwidPage) {
                window.ecwid_nocssrewrite = true;
                initEcwidIfNecessary(document.body);
                return;
            }

            window.ecwid_script_defer = true;
            window.ecwid_dynamic_widgets = true;
            window.css_selectors_prefix = encodeURIComponent('div#' + containerId);

            initEcwidIfNecessary(container, true);
        }

        function initializeScripts() {
            var initializationScripts = [{
                "widgetType": "ProductBrowser",
                "id": "my-store-" + storeId,
                "arg": ["categoriesPerRow=3", "views=grid(20,3) list(60) table(60)", "categoryView=grid", "searchView=list", "id=my-store-" + storeId, "defaultProductId=" + getValueSave("my-store-" + storeId, "data-default-product-id"), "defaultCategoryId=" + getValueSave("my-store-" + storeId, "data-default-category-id")]
            }];
            if (document.getElementById('my-search-' + storeId)) {
                initializationScripts.push({
                    "widgetType": "SearchWidget",
                    "id": "my-search-" + storeId,
                    "arg": ["id=my-search-" + storeId]
                });
            }
            if (document.getElementById('my-categories-' + storeId)) {
                initializationScripts.push({
                    "widgetType": "CategoriesV2",
                    "id": "my-categories-" + storeId,
                    "arg": ["id=my-categories-" + storeId]
                });
            }
            window._xnext_initialization_scripts = initializationScripts;
        }

        function initEcwidIfNecessary(container, reset) {
            if (typeof Ecwid != 'undefined') {
                if (reset) {
                    Ecwid.destroy();
                    initializeScripts();
                }

                ecwid_onBodyDone();
                Ecwid.init();
            } else {
                initializeScripts();

                var script = document.createElement('script');
                script.charset = 'utf-8';
                script.type = 'text/javascript';
                script.id = 'ecwid-script';
                script.onload = function() {
                    Ecwid.init()
                };
                script.src = 'https://app.ecwid.com/script.js?' + storeId;
                container.appendChild(script);
            }
        }

        // init watch function
        window.onload = watch;

        function watch() {
            var observedAttributeName = "id";
            MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
            var a = new MutationObserver(function (a) {
                var dispatchedId;
                for (var b = 0; b < a.length; b++) {
                    var c = a[b];
                    if ("attributes" === c.type) {
                        var targetId = c.target[observedAttributeName];
                        if (dispatchedId && dispatchedId === targetId) return;
                        dispatchedId = targetId;
                        var d = new Event("pageChange");
                        document.dispatchEvent(d)
                    }
                }
            });
            a.observe(document.body, {attributes: !0, attributeFilter: [observedAttributeName]})
        }

        function getValueSave(id, attribute) {
            var node = document.querySelector("#" + id);
            return !node
                ? ""
                : (!node.getAttribute(attribute)
                    ? ""
                    : node.getAttribute(attribute))
        }
    })(64412512);
</script>

 

Edited by annavdburgt
Link to comment
On 10/1/2021 at 1:25 AM, annavdburgt said:

wich is? haha sorry, i really do not know anything about building websites 😛

 

this one?

<script>
    (function (storeId) {
        document.addEventListener("pageChange", function () {
            loadEcwid();
        }, false);
        loadEcwid();

        function loadEcwid() {
            var containerId = 'my-store-' + storeId;
            var container = document.getElementById(containerId);
            var isEcwidPage = container != null;
            var ecwidLoaded = isEcwidPage && container.childNodes.length > 0;
            if (ecwidLoaded && isEcwidPage) return;
            if (!isEcwidPage) {
                window.ecwid_nocssrewrite = true;
                initEcwidIfNecessary(document.body);
                return;
            }

            window.ecwid_script_defer = true;
            window.ecwid_dynamic_widgets = true;
            window.css_selectors_prefix = encodeURIComponent('div#' + containerId);

            initEcwidIfNecessary(container, true);
        }

        function initializeScripts() {
            var initializationScripts = [{
                "widgetType": "ProductBrowser",
                "id": "my-store-" + storeId,
                "arg": ["categoriesPerRow=3", "views=grid(20,3) list(60) table(60)", "categoryView=grid", "searchView=list", "id=my-store-" + storeId, "defaultProductId=" + getValueSave("my-store-" + storeId, "data-default-product-id"), "defaultCategoryId=" + getValueSave("my-store-" + storeId, "data-default-category-id")]
            }];
            if (document.getElementById('my-search-' + storeId)) {
                initializationScripts.push({
                    "widgetType": "SearchWidget",
                    "id": "my-search-" + storeId,
                    "arg": ["id=my-search-" + storeId]
                });
            }
            if (document.getElementById('my-categories-' + storeId)) {
                initializationScripts.push({
                    "widgetType": "CategoriesV2",
                    "id": "my-categories-" + storeId,
                    "arg": ["id=my-categories-" + storeId]
                });
            }
            window._xnext_initialization_scripts = initializationScripts;
        }

        function initEcwidIfNecessary(container, reset) {
            if (typeof Ecwid != 'undefined') {
                if (reset) {
                    Ecwid.destroy();
                    initializeScripts();
                }

                ecwid_onBodyDone();
                Ecwid.init();
            } else {
                initializeScripts();

                var script = document.createElement('script');
                script.charset = 'utf-8';
                script.type = 'text/javascript';
                script.id = 'ecwid-script';
                script.onload = function() {
                    Ecwid.init()
                };
                script.src = 'https://app.ecwid.com/script.js?' + storeId;
                container.appendChild(script);
            }
        }

        // init watch function
        window.onload = watch;

        function watch() {
            var observedAttributeName = "id";
            MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
            var a = new MutationObserver(function (a) {
                var dispatchedId;
                for (var b = 0; b < a.length; b++) {
                    var c = a[b];
                    if ("attributes" === c.type) {
                        var targetId = c.target[observedAttributeName];
                        if (dispatchedId && dispatchedId === targetId) return;
                        dispatchedId = targetId;
                        var d = new Event("pageChange");
                        document.dispatchEvent(d)
                    }
                }
            });
            a.observe(document.body, {attributes: !0, attributeFilter: [observedAttributeName]})
        }

        function getValueSave(id, attribute) {
            var node = document.querySelector("#" + id);
            return !node
                ? ""
                : (!node.getAttribute(attribute)
                    ? ""
                    : node.getAttribute(attribute))
        }
    })(64412512);
</script>

 

Where is  ecwid icon? I don't see it on homepage

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.