<{* Template: category.html Description: This template handles the product categories Author: 1260 A/S, @1260-digital Since: 2022-09-01 *}> <{capture name="title"}> <{$category->getName()}> - <{$webshop->getName()}> <{/capture}>
<{if $settings.breadcrumbs.enable_breadcrumbs}>
<{include file="components/breadcrumbs.html"}>
<{/if}>
<{if $settings.categories.enable_category_menu}>
<{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}>
<{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"}> <{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}> <{/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/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}>