<{* 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"}>
    <{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}>
      <{if $settings.product_card.enable_brand}> <{if $alpine}> <{else}> <{if $products[i]->getBrandName()}>

      <{$products[i]->getBrandName()|escape}>

      <{/if}> <{/if}> <{/if}>

      href="<{$products[i]->getRemoteUrl()}>"<{/if}> <{if $alpine}>:href="product.url"<{/if}> <{if $alpine}>x-text="product.name"<{/if}> > <{if ! $alpine}><{$products[i]->getName()}><{/if}>

      <{if $settings.product_card.enable_category}> <{if !$alpine && $products[i]->getMainCategory()}> <{assign var="productMainCategory" value=$products[i]->getMainCategory()}>

      <{$productMainCategory->getName()}>

      <{/if}> <{/if}>
      <{include file="components/price.html" show_currency=$settings.currency.show product=$products[i] show_from_prefix="true" class="product-card__price" unit_price=true}>
      <{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}> <{/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}>