<{assign var="categories" value=$webshop->getCategories()}>
<{foreach from=$categories item="cat" name="i"}>
<{if $cat->getInMenu() && !$cat->isFront()}>
<{assign var="children" value=$cat->getChildren()}>
<{assign var="parents" value=$cat->getParents()}>
<{assign var="cnt" value=$children|@count}>
<{assign var="current_url_without_query_param" value="?"|explode:$current_url}>
-
<{$cat->getName()|escape}>
<{include file="components/categories.html" categories=$children level="1"}>
<{/if}>
<{/foreach}>
<{if $pager}>
<{assign var="pages" value=$pager->render()}>
<{if $pages}>
<{math assign="total_pages" equation="x/y" x=$pager_array.total y=$pager_array.max}>
<{t x=$get.p+1 y=$total_pages|ceil}>Page {x} of {y}<{/t}>
<{/if}>
<{/if}>
<{if $category->getName()}>
<{$category->getName()}>
<{/if}>
<{if $category->getDescriptionA()}>
<{if $settings.categories.enable_collapse_desription_a}>
<{include file="components/wysiwyg.html" content=$category->getDescriptionA() template=$category}>
<{else}>
<{include file="components/wysiwyg.html" content=$category->getDescriptionA() template=$category}>
<{/if}>
<{/if}>
<{if $category->getBlogPosts()}>
<{include file="components/blog-grid.html" template=$category}>
<{/if}>
<{if !$get.p }>
<{assign var="childCategories" value=$category->getChildren()}>
<{if $childCategories}>
<{if $settings.categories.enable_subcategory_title}>
<{t x=$category->getName()}>Udvalgte kategorier<{/t}>
<{/if}>
<{assign var="category_layout" value=$settings.categories.category_layout}>
<{if $category_layout === "category_preview"}>
<{else}>
<{section name="j" loop=$childCategories}>
<{include file="components/category.html" type="listitem" class="categories__list-item" category=$childCategories[j]}>
<{/section}>
<{/if}>
<{/if}>
<{/if}>
<{if $category_layout === "category_preview"}>
<{foreach from=$childCategories item=$childCategory }>
-
<{assign var="products" value=$childCategory->getPopularProducts(3, 1000)}>
<{assign var="count" value="3"}>
<{if !$products}>
<{assign var="products" value=$childCategory->getOnlineProducts($count)}>
<{/if}>
<{section name="i" loop=$products start=0 max=$count}>
-
<{include file="components/image.html" width="370" height="370" sizes="165,360,345,220,370" class="product-card__picture" product=$products[i] alpine=$alpine}>
<{include file="components/price.html" show_currency=$settings.currency.show product=$products[i] show_from_prefix="true" class="product-card__price"}>
<{assign var="metaValues" value=$products[i]->getMetaValues()}>
<{/section}>
<{/foreach}>
<{else }>
<{if $products}>
<{if !$get.p }>
<{assign var="popular_products" value=$category->getPopularProducts()}>
<{if $settings.categories.enable_popular_products && ($popular_products|@count > 0 || $settings.integrations.enable_clerk)}>
<{t x=$category->getName()}>Popular items in {x}<{/t}>
<{if $settings.integrations.enable_clerk}>
<{include file="components/external-product-loop.html" placeholder=false list_item_class="swiper-slide" external="clerk" max="10" }>
<{else}>
<{include file="components/product-loop.html" products=$popular_products autofill="true" list_item_class="swiper-slide"}>
<{/if}>
<{/if}>
<{/if}>
<{if $products && $category->getBlogPosts()}>
<{t x=$category->getName()}>All items in {x}<{/t}>
<{/if}>
<{if $get.atags || $get.brands || $get.categories || $get.sort }>
<{assign var="hasInitialFilters" value=true}>
<{else}>
<{assign var="hasInitialFilters" value=false}>
<{/if}>
<{if $settings.categories.enable_filter}>
<{include file="components/product-filter.html" template=$category}>
<{/if}>
<{* Server-side rendered initial products *}>
<{if ! $hasInitialFilters }>
<{section name="i" loop=$products}>
-
<{include file="components/product-card.html" product=$products[i]}>
<{/section}>
<{/if}>
<{* Client-side rendered products *}>
-
<{include file="components/product-card-js.html" alpine=true}>
-
<{t}>Loading...<{/t}>
-
<{t}>No results...<{/t}>
<{include file="components/page-blocks.html"}>
<{if $pager}>
<{assign var="pages" value=$pager->render()}>
<{if $pages}>
<{/if}>
<{/if}>
<{else}>
<{if !$childCategories && !$category->getBlogPosts()}>
<{t}>No products found<{/t}>
<{/if}>
<{/if}>
<{/if}>
<{if $settings.categories.enable_collapse_desription_b}>
<{include file="components/wysiwyg.html" content=$category->getDescriptionB() template=$category}>
<{else}>
<{include file="components/wysiwyg.html" content=$category->getDescriptionB() template=$category}>
<{/if}>