diff --git a/assets/findify-analytics.js b/assets/findify-analytics.js index caa5cd0..85475e0 100644 --- a/assets/findify-analytics.js +++ b/assets/findify-analytics.js @@ -2,14 +2,15 @@ /** * productPageAnalyticsTagSelectorId can be found in findify-head-injector */ - const productPageAnalyticsTagSelectorId = "findify-analytics-product"; + const productPageAnalyticsTagSelectorId = 'findify-analytics-product'; + const isProductDetails = () => !!document.getElementById(productPageAnalyticsTagSelectorId); const getPageType = () => { - if (isProductDetails()) return "product-details"; - if (findify.utils.isSearch()) return "search-results"; - if (findify.utils.isCollection()) return "smart-collection"; + if (isProductDetails()) return 'product-details'; + if (findify.utils.isSearch()) return 'search-results'; + if (findify.utils.isCollection()) return 'smart-collection'; }; const viewPageEvent = () => { @@ -18,24 +19,53 @@ const ref = window.document.referrer; const url = window.location.href; const page_type = getPageType(); + const itemId = document + .getElementById(productPageAnalyticsTagSelectorId) + ?.getAttribute('data-findify-item-id'); + const variantId = document + .getElementById(productPageAnalyticsTagSelectorId) + ?.getAttribute('data-findify-variant-item-id'); + + const sendEvent = (...props) => + findify.core.analytics.sendEvent('view-page', ...props); try { - findify.core.analytics.sendEvent("view-page", { + sendEvent({ width, height, ref, url, page_type, + item_id: itemId, + variant_item_id: variantId, }); } catch (error) { - console.error("Error sending view-page event", error); + console.error('Error sending view-page event', error); } }; - const updateCartEvent = () => {}; + const updateCartEvent = () => { + const cart = document.querySelector('[data-findify-event="update-cart"]'); + const cartItems = cart && Array.prototype.slice.call(cart.children); + const items = + cartItems.map((item) => { + return { + item_id: item.getAttribute('data-findify-item-id'), + variant_item_id: item.getAttribute('data-findify-variant-item-id'), + unit_price: item.getAttribute('data-findify-unit-price'), + quantity: item.getAttribute('data-findify-quantity'), + }; + }) || []; + + try { + findify.core.analytics.sendEvent('update-cart', { line_items: items }); + } catch (error) { + console.error('Error sending update-cart event', error); + } + }; - setTimeout(() => { + findify.core.init.then(() => { viewPageEvent(); updateCartEvent(); - }, 1000); + }); })(); diff --git a/assets/findify-content.js b/assets/findify-content.js index a9ca6f4..6b8024a 100644 --- a/assets/findify-content.js +++ b/assets/findify-content.js @@ -1,100 +1,158 @@ -/* - * Description: Bind infinite scroll event on window, and checking the div with id if shown and active and reached - * @return void; - */ -const initFindifyContentEvents = () => { - const contentIntegrations = Object.keys(findify.grid.liquid?.contents).map((id) => ({ - id, - })); - contentIntegrations.forEach(({ id }) => { - const infiniteScrollElement = document.getElementById( - `${id}-infinite-scroll` - ); - - /* - * @return boolean; - */ - const isContentDisplayed = () => { - return document.getElementById(`${id}-content`).style.display === "block"; - }; - - const hasNextPage = (currentPage, lastPage) => currentPage <= lastPage; - - const scrollEventOptions = { passive: true }; - - const onScrollFunction = async () => { - const currentPage = - findify.contents.state[id].meta.offset / - findify.contents.state[id].meta.limit + - 1; - const lastPage = Math.ceil( - findify.contents.state[id].meta.total / - findify.contents.state[id].meta.limit - ); - if ( - isContentDisplayed() && - !findify.contents.state[id].loading && - findify.utils.isInViewport(infiniteScrollElement) && - hasNextPage(currentPage, lastPage) - ) { - findify.contents.state[id] = { - ...findify.contents.state[id], - loading: true, - }; - - const offset = - findify.contents.state[id].meta.offset + - findify.contents.state[id].meta.limit; - const contentToLoad = { - [id]: { - title: findify.grid.liquid?.contents[id].title, - }, - }; - const response = await findify.contents.api(contentToLoad, { - offset, - }); - await findify.grid.renderContents({ - [id]: { - ...response[id], - items: [...response[id].items].splice( - response[id].meta.offset, - response[id].meta.offset - ), - }, - }); - - const updatedPage = offset / findify.contents.state[id].meta.limit + 1; - if (lastPage <= updatedPage) { - removeLoader(); - } - findify.contents.state[id].loading = false; - } - }; - - const removeLoader = () => { - infiniteScrollElement?.remove(); - window.removeEventListener( - "scroll", - onScrollFunction, - scrollEventOptions - ); - }; - - const lastPage = Math.ceil( - findify.contents.state[id].meta.total / - findify.contents.state[id].meta.limit - ); - const currentPage = - findify.contents.state[id].meta.offset / - findify.contents.state[id].meta.limit + - 1; - if ( - lastPage <= currentPage || - findify.contents.state[id].meta.total === 0 - ) { - removeLoader(); - } else { - window.addEventListener("scroll", onScrollFunction, scrollEventOptions); - } - }); -}; +/* + * Description: Bind infinite scroll event on window, and checking the div with id if shown and active and reached + * @return void; + */ +const initFindifyContentEvents = () => { + const contentIntegrations = Object.keys(findify.grid.liquid?.contents).map((id) => ({ + id, + })); + + const updateActivePage = async (page, content_id) => { + const contentSelector = `#${content_id}-content`; + const offset = (page - 1) * findify.contents.state[content_id].meta.limit; + window.scrollTo({ top: 0, behavior: "smooth" }); + + const contentToLoad = { + [content_id]: { + title: findify.grid.liquid?.contents[content_id].title, + }, + }; + + const response = await findify.contents.api( + contentToLoad, + { + offset, + limit: findify.contents.state[content_id].meta.limit, + }, + true + ); + + await findify.pagination.render( + response[content_id]?.meta, + `#${content_id}-content` + ); + // findify.utils.executeElementScripts( + // document.querySelector(`#${id}-content #findify-pagination`) + // ); + + await findify.grid.renderContents( + { + [content_id]: { + ...response[content_id], + items: [...response[content_id].items], + }, + }, + false, + true + ); + }; + + contentIntegrations.forEach(({ id }) => { + const infiniteScrollElement = document.getElementById( + `${id}-infinite-scroll` + ); + + /* + * @return boolean; + */ + const isContentDisplayed = () => { + return document.getElementById(`${id}-content`).style.display === "block"; + }; + + const hasNextPage = (currentPage, lastPage) => currentPage <= lastPage; + + const scrollEventOptions = { passive: true }; + + const onScrollFunction = async () => { + const currentPage = + findify.contents.state[id].meta.offset / + findify.contents.state[id].meta.limit + + 1; + const lastPage = Math.ceil( + findify.contents.state[id].meta.total / + findify.contents.state[id].meta.limit + ); + if ( + isContentDisplayed() && + !findify.contents.state[id].loading && + findify.utils.isInViewport(infiniteScrollElement) && + hasNextPage(currentPage, lastPage) + ) { + findify.contents.state[id] = { + ...findify.contents.state[id], + loading: true, + }; + + const offset = + findify.contents.state[id].meta.offset + + findify.contents.state[id].meta.limit; + const contentToLoad = { + [id]: { + title: findify.grid.liquid?.contents[id].title, + }, + }; + const response = await findify.contents.api(contentToLoad, { + offset, + }); + await findify.grid.renderContents({ + [id]: { + ...response[id], + items: [...response[id].items].splice( + response[id].meta.offset, + response[id].meta.offset + ), + }, + }); + + const updatedPage = offset / findify.contents.state[id].meta.limit + 1; + if (lastPage <= updatedPage) { + removeLoader(); + } + findify.contents.state[id].loading = false; + } + }; + + const removeLoader = () => { + infiniteScrollElement?.remove(); + window.removeEventListener( + "scroll", + onScrollFunction, + scrollEventOptions + ); + }; + + const lastPage = Math.ceil( + findify.contents.state[id].meta.total / + findify.contents.state[id].meta.limit + ); + const currentPage = + findify.contents.state[id].meta.offset / + findify.contents.state[id].meta.limit + + 1; + if ( + lastPage <= currentPage || + findify.contents.state[id].meta.total === 0 + ) { + removeLoader(); + } else { + window.addEventListener("scroll", onScrollFunction, scrollEventOptions); + } + // pagination + + const initPagination = () => { + const links = document.querySelectorAll( + `#${id}-content .pagination__item.link` + ); + + links.forEach((link) => + link.addEventListener("click", async (e) => { + e.preventDefault(); + const page = link.getAttribute("data-value"); + page && (await updateActivePage(page, id)); + initPagination(); + }) + ); + }; + initPagination(); + }); +}; diff --git a/assets/findify-product-card.js b/assets/findify-product-card.js index 301b080..f8e51f1 100644 --- a/assets/findify-product-card.js +++ b/assets/findify-product-card.js @@ -30,7 +30,7 @@ const savePosition = (id, page) => { } const initOnProductCardClick = (id, page, properties) => { - document.getElementById(id).addEventListener("click", (e) => { + document.querySelector(`.${properties.widget}_${id}`).addEventListener("click", (e) => { initProductCardAnalytics(id, properties); savePosition(id, page); }); diff --git a/locales/ar.json b/locales/ar.json index 95baa7d..a3cb411 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -25,7 +25,9 @@ "results_count": "عرض {{ count }} من نتائج", "results_count_for": " عرض {{ count }} من نتائج لـ \"{{ term }}\"", "no_results_for": "لا توجد نتائج لـ", - "no_results_message": "يرجى التحقق من التهجئة أو محاولة مصطلح بحث آخر" + "no_results_message": "يرجى التحقق من التهجئة أو محاولة مصطلح بحث آخر", + "results_count_for_corrected_query": "عرض {{ count }} نتائج لـ \"{{ corrected_term }}\". 0 نتائج لـ \"{{ term }}\".", + "results_count_for_partial_query": "عرض 0 نتائج لـ \"{{ term }}\". عرض النتائج التي تتطابق جزئيًا بدلاً من ذلك." }, "collections": { "products_count": "{{ count }} المنتجات", diff --git a/locales/da.json b/locales/da.json index fbeea89..bd7106b 100644 --- a/locales/da.json +++ b/locales/da.json @@ -25,7 +25,9 @@ "results_count": "Viser {{ count }} resultater", "results_count_for": "Viser {{ count }} resultater for\"{{ term }}\"", "no_results_for": "Ingen resultater for", - "no_results_message": "Venligst tjek stavningen eller prøv et andet søgeord" + "no_results_message": "Venligst tjek stavningen eller prøv et andet søgeord", + "results_count_for_corrected_query": "Viser {{ count }} resultater for \"{{ corrected_term }}\". 0 resultater for \"{{ term }}\".", + "results_count_for_partial_query": "Viser 0 resultater for \"{{ term }}\". Viser resultater, der delvist matcher i stedet." }, "collections": { "products_count": "{{ count }} produkter", diff --git a/locales/de.json b/locales/de.json index 3deaeff..c883afc 100644 --- a/locales/de.json +++ b/locales/de.json @@ -25,7 +25,9 @@ "results_count": "{{ count }} Ergebnisse werden angezeigt", "results_count_for": " {{ count }} Ergebnisse werden angezeigt für \"{{ term }}\"", "no_results_for": "Keine Ergebnisse für", - "no_results_message": "Bitte überprüfen Sie die Rechtschreibung oder versuchen Sie es mit einem anderen Suchbegriff" + "no_results_message": "Bitte überprüfen Sie die Rechtschreibung oder versuchen Sie es mit einem anderen Suchbegriff", + "results_count_for_corrected_query": "Es werden {{ count }} Ergebnisse für \"{{ corrected_term }}\" angezeigt. 0 Ergebnisse für \"{{ term }}\".", + "results_count_for_partial_query": "Es werden 0 Ergebnisse für \"{{ term }}\" angezeigt. Stattdessen werden Ergebnisse angezeigt, die teilweise übereinstimmen." }, "collections": { "products_count": "{{ count }} produkte", diff --git a/locales/en.default.json b/locales/en.default.json index 3d3b7bc..3d8799a 100644 --- a/locales/en.default.json +++ b/locales/en.default.json @@ -25,7 +25,9 @@ "results_count": "Showing {{ count }} results", "results_count_for": "Showing {{ count }} results for \"{{ term }}\"", "no_results_for": "No results for", - "no_results_message": "Please check the spelling or try another search term" + "no_results_message": "Please check the spelling or try another search term", + "results_count_for_corrected_query": "Showing {{ count }} Results For \"{{ corrected_term }}\". 0 Results For \"{{ term }}\".", + "results_count_for_partial_query": "Showing 0 Results For \"{{ term }}\". Showing Results That PartiallyMatch Instead." }, "collections": { "products_count": "{{ count }} products", diff --git a/locales/es.json b/locales/es.json index 0fed20b..d4a3a5a 100644 --- a/locales/es.json +++ b/locales/es.json @@ -25,7 +25,9 @@ "results_count": "Se muestran {{ count }} resultados", "results_count_for": " Se muestran {{ count }} resultados para \"{{ term }}\"", "no_results_for": " No hemos encontrado ningún resultado para ", - "no_results_message": "Por favor, verifica la ortografía o intenta con otro término de búsqueda" + "no_results_message": "Por favor, verifica la ortografía o intenta con otro término de búsqueda", + "results_count_for_corrected_query": "Kuvatakse {{ count }} tulemused päringule \"{{ corrected_term }}\". 0 tulemust päringule \"{{ term }}\".", + "results_count_for_partial_query": "Kuvatakse 0 tulemust päringule \"{{ term }}\". Selle asemel kuvatakse tulemused, mis osaliselt vastavad." }, "collections": { "products_count": "{{ count }} productos", diff --git a/locales/fi.json b/locales/fi.json index a768873..5fb7021 100644 --- a/locales/fi.json +++ b/locales/fi.json @@ -25,7 +25,9 @@ "results_count": "Näyttää {{ count }} tulosta", "results_count_for": "Näyttää {{ count }} tulosta tuotteelle \"{{ term }}\"", "no_results_for": "Ei tuloksia", - "no_results_message": "Tarkista oikeinkirjoitus tai kokeile toista hakusanaa" + "no_results_message": "Tarkista oikeinkirjoitus tai kokeile toista hakusanaa", + "results_count_for_corrected_query": "Näytetään {{ count }} tulokset haulle \"{{ corrected_term }}\". 0 tulosta haulle \"{{ term }}\".", + "results_count_for_partial_query": "Näytetään 0 tulosta haulle \"{{ term }}\". Näytetään sen sijaan osittain vastaavat tulokset." }, "collections": { "products_count": "{{ count }} tuotteet", diff --git a/locales/fr.json b/locales/fr.json index f7e5c73..6acf222 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -25,7 +25,9 @@ "results_count": "Afficher {{ count }} résultats", "results_count_for": "Afficher {{ count }} résultats pour \"{{ term }}\"", "no_results_for": "Aucun résultat pour", - "no_results_message": "Veuillez vérifier l'orthographe ou essayer un autre terme de recherche" + "no_results_message": "Veuillez vérifier l'orthographe ou essayer un autre terme de recherche", + "results_count_for_corrected_query": "Affichage de {{ count }} résultats pour \"{{ corrected_term }}\". 0 résultats pour \"{{ term }}\".", + "results_count_for_partial_query": "Affichage de 0 résultats pour \"{{ term }}\". Affichage des résultats qui correspondent partiellement à la place." }, "collections": { "products_count": "{{ count }} produits", diff --git a/locales/it.json b/locales/it.json index 74c061a..c272528 100644 --- a/locales/it.json +++ b/locales/it.json @@ -25,7 +25,9 @@ "results_count": "Mostrati {{ count }} risultati", "results_count_for": "Mostrati {{ count }} risultati per \"{{ term }}\"", "no_results_for": "Nessun risultato per", - "no_results_message": "Controlla i parametri di ricerca e riprova" + "no_results_message": "Controlla i parametri di ricerca e riprova", + "results_count_for_corrected_query": "Visualizzazione di {{ count }} risultati per \"{{ corrected_term }}\". 0 risultati per \"{{ term }}\".", + "results_count_for_partial_query": "Visualizzazione di 0 risultati per \"{{ term }}\". Vengono invece visualizzati i risultati che corrispondono parzialmente." }, "collections": { "products_count": "{{ count }} prodotti", diff --git a/locales/nl.json b/locales/nl.json index 1ac4c79..4d9d951 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -25,7 +25,9 @@ "results_count": " {{ count }} resultaten getoond", "results_count_for": " {{ count }} resultaten getoond voor \"{{ term }}\"", "no_results_for": "Geen resultaten voor", - "no_results_message": "Controleer alstublieft de spelling of probeer een ander zoekterm" + "no_results_message": "Controleer alstublieft de spelling of probeer een ander zoekterm", + "results_count_for_corrected_query": "Toont {{ count }} resultaten voor \"{{ corrected_term }}\". 0 resultaten voor \"{{ term }}\".", + "results_count_for_partial_query": "Toont 0 resultaten voor \"{{ term }}\". Resultaten weergeven die gedeeltelijk overeenkomen." }, "collections": { "products_count": "{{ count }} producten", diff --git a/locales/no.json b/locales/no.json index 342834a..74440e9 100644 --- a/locales/no.json +++ b/locales/no.json @@ -25,7 +25,9 @@ "results_count": "Viser {{ count }} resultater", "results_count_for": " Viser {{ count }} resultater for \"{{ term }}\"", "no_results_for": "Ingen resultater for", - "no_results_message": " Vennligst sjekk stavingen eller prøv et annet søkeord " + "no_results_message": " Vennligst sjekk stavingen eller prøv et annet søkeord ", + "results_count_for_corrected_query": "Viser {{ count }} resultater for \"{{ corrected_term }}\". 0 resultater for \"{{ term }}\".", + "results_count_for_partial_query": "Viser 0 resultater for \"{{ term }}\". Viser resultater som delvis samsvarer i stedet." }, "collections": { "products_count": "{{ count }} produkter", diff --git a/locales/pl.json b/locales/pl.json index 769aafb..e5bc6a9 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -25,7 +25,9 @@ "results_count": "Wyświetlanie {{ count }} wyników", "results_count_for": "Wyświetlanie {{ count }} wyników dla \"{{ term }}\"", "no_results_for": "Brak wyników dla ", - "no_results_message": "Proszę sprawdzić pisownię lub spróbować innego terminu wyszukiwania" + "no_results_message": "Proszę sprawdzić pisownię lub spróbować innego terminu wyszukiwania", + "results_count_for_corrected_query": "Wyświetlanie {{ count }} wyników dla „{{ corrected_term }}”. 0 wyników dla \"{{ term }}\".", + "results_count_for_partial_query": "Wyświetlanie 0 wyników dla „{{ term }}”. Zamiast tego wyświetlanie wyników, które są częściowo zgodne." }, "collections": { "products_count": "{{ count }} produkty", diff --git a/locales/pt-PT.json b/locales/pt-PT.json index b37eca9..c2ea6ad 100644 --- a/locales/pt-PT.json +++ b/locales/pt-PT.json @@ -25,7 +25,9 @@ "results_count": "A mostrar {{ count }} resultados", "results_count_for": "A mostrar {{ count }} resultados para \"{{ term }}\"", "no_results_for": "Sem resultados para", - "no_results_message": "Por favor, verifique a ortografia ou tente outro termo de pesquisa" + "no_results_message": "Por favor, verifique a ortografia ou tente outro termo de pesquisa", + "results_count_for_corrected_query": "Mostrando {{ count }} resultados para \"{{ corrected_term }}\". 0 Resultados para \"{{ term }}\".", + "results_count_for_partial_query": "Exibindo 0 resultados para \"{{ term }}\". Mostrando resultados que correspondem parcialmente." }, "collections": { "products_count": "{{ count }} produtos", diff --git a/locales/sv.json b/locales/sv.json index 9aac792..677c0b5 100644 --- a/locales/sv.json +++ b/locales/sv.json @@ -25,7 +25,9 @@ "results_count": "Visar {{ count }} resultat", "results_count_for": "Visar {{ count }} resultat för \"{{ term }}\"", "no_results_for": "Inga resultat för", - "no_results_message": " Vänligen kontrollera stavningen eller prova med ett annat sökord" + "no_results_message": " Vänligen kontrollera stavningen eller prova med ett annat sökord", + "results_count_for_corrected_query": "Visar {{ count }} resultat för \"{{ corrected_term }}\". 0 resultat för \"{{ term }}\".", + "results_count_for_partial_query": "Visar 0 resultat för \"{{ term }}\". Visar resultat som delvis matchar istället." }, "collections": { "products_count": "{{ count }} produkter", diff --git a/sections/findify-grid-collection.liquid b/sections/findify-grid-collection.liquid index 848b0e4..3e15075 100644 --- a/sections/findify-grid-collection.liquid +++ b/sections/findify-grid-collection.liquid @@ -1,5 +1,6 @@ {%- assign page_url = content_for_header | split: '"pageurl":"' | last | split: '"' | first | split: request.host | last | replace: '\/', '/' | replace: '%20', ' ' | replace: '\u0026', '&' | replace: '%7C', '|' | replace: '%27', "'" -%} {%- assign query_parameters = page_url | split: 'sections=findify-grid-collection&' | last -%} + {% include 'findify-grid-connector' %} {% assign findify_filters_component_id = 'findify-filters-sidebar' %} @@ -26,21 +27,25 @@
{% if desktop_filter_layout != 'drawer' %} {% render 'findify-toolbar-desktop' - , results_count: products_count - , is_collection: true - , terms: terms - , sort_options: sort_options - , default_sort_by: default_sort_by - , sort_by: sort_by - , active_filters: active_filters - , color_layout: color_layout - , filter_component_id: findify_filters_component_id - %} + , results_count: products_count + , is_collection: true + , terms: terms + , corrected_q: corrected_q + , query_type: query_type + , sort_options: sort_options + , default_sort_by: default_sort_by + , sort_by: sort_by + , active_filters: active_filters + , color_layout: color_layout + , filter_component_id: findify_filters_component_id + %} {% endif %} {% render 'findify-toolbar-mobile' , results_count: products_count , is_collection: true , terms: terms + , corrected_q: corrected_q + , query_type: query_type , sort_options: sort_options , default_sort_by: default_sort_by , sort_by: sort_by @@ -112,7 +117,18 @@
{% endif %} - + diff --git a/sections/findify-pagination.liquid b/sections/findify-pagination.liquid index 8bf897d..cd60a6c 100644 --- a/sections/findify-pagination.liquid +++ b/sections/findify-pagination.liquid @@ -41,6 +41,7 @@ {%- if previous -%}
  • @@ -62,6 +63,7 @@ {%- if is_link -%} {{ title }} {%- else -%} @@ -82,6 +84,7 @@ {%- if next -%}
  • diff --git a/sections/findify-product-card.liquid b/sections/findify-product-card.liquid index 8a85fc2..ae58195 100644 --- a/sections/findify-product-card.liquid +++ b/sections/findify-product-card.liquid @@ -3,7 +3,7 @@
    @@ -31,7 +33,7 @@ slidesPerView: "{{ desktop_slide_per_view }}", breakpoints: { 320: { - slidesPerView: 2, + slidesPerView: "{{ mobile_slide_per_view }}", spaceBetween: 20, }, 480: { diff --git a/snippets/findify-content-grid.liquid b/snippets/findify-content-grid.liquid index fddc150..6d553f8 100644 --- a/snippets/findify-content-grid.liquid +++ b/snippets/findify-content-grid.liquid @@ -4,6 +4,9 @@
    - {% render 'findify-lazy-loading-pagination' - , id: content_id %} + {% if content_lazy_loading_pagination == 'true' %} + {% render 'findify-lazy-loading-pagination', id: content_id %} + {% else %} +
    + {% endif %}
    \ No newline at end of file diff --git a/snippets/findify-grid-connector.liquid b/snippets/findify-grid-connector.liquid index fa18b51..651e0fd 100644 --- a/snippets/findify-grid-connector.liquid +++ b/snippets/findify-grid-connector.liquid @@ -31,6 +31,14 @@ assign terms = page_url | split: 'terms=' | last | split: '&' | first # string endcomment endif + if page_url contains 'corrected_q=' + assign corrected_q = page_url | split: 'corrected_q=' | last | split: '&' | first + # string endcomment + endif + if page_url contains 'query_type=' + assign query_type = page_url | split: 'query_type=' | last | split: '&' | first + # string endcomment + endif assign types = page_url | split: 'types=' | last | split: '&' | first | split: ';' # string[] endcomment @@ -83,6 +91,9 @@ # 'tab' [ ] # Grid Settings and configurations + assign desktop_products_per_view = query_parameters | split: 'desktop_products_per_view:' | last | split: '|' | first | split: '&' | first + assign mobile_products_per_view = query_parameters | split: 'mobile_products_per_view:' | last | split: '|' | first | split: '&' | first + assign settingsObj = page_url | split: 'settingsObj=' | last | split: '&' | first assign color_layout = settingsObj | split: 'color_filter:' | last | split: '|' | first diff --git a/snippets/findify-head-injector.liquid b/snippets/findify-head-injector.liquid index 0013a86..e242ba2 100644 --- a/snippets/findify-head-injector.liquid +++ b/snippets/findify-head-injector.liquid @@ -6,21 +6,20 @@ data-findify-variant-item-id="{{product.selected_or_first_available_variant.id}}">
    {% endif %} -{% if cart %} -
    - {% for item in cart.items %} -
    - {% endfor %} -
    -{% endif %} + +
    + {% for item in cart.items %} +
    + {% endfor %} +