{% set assets = assets|default(boldr_cms_get_assets()) %}
{% do assets.addJsFile(asset('assets/js/shop.js')) %}
{% set cart = boldr_shop_get_cart() %}
{% set isShop = true %}
{% extends 'base.html.twig' %}
{% block head %}
{{ parent() }}
<script>
let currentCurrency = {{ boldr_shop_get_currency()|json_encode|raw }};
const ALLERGEN_IMAGE_URL = '{{ asset('/assets/images/allergens/' ~ app.request.locale ~ '/ALLERGEN.png') }}';
</script>
{% endblock %}
{% block header_wrapper_content %}
{{ parent() }}
<div class="subheader-filter-search">
<div class="subheader-filter-search-controls">
<div class="subheader-filter">
{# Filter op #}
<a href="#" class="subheader-filter-button boldr-button boldr-button-outline-light">
<i class="icon-filter"></i>
<span class="boldr-button-text">{{ 'filter_by'|trans({}, 'HelensBakery') }}</span>
<i class="icon-chevron-down"></i>
<span class="subheader-filter-button-count"></span>
</a>
<div class="subheader-filter-dropdown hide-past-scroll">
<div class="form-label-control">
<input id="subheader-filter-choice-beef" type="checkbox" data-property="beef" />
<label for="subheader-filter-choice-beef"><i class="icon-rundvlees"></i> {{ '100percent_beef'|trans({}, 'HelensBakery') }}</label>
</div>
<div class="form-label-control">
<input id="subheader-filter-choice-vegan" type="checkbox" data-property="vegan" />
<label for="subheader-filter-choice-vegan"><i class="icon-vegan"></i> {{ 'vegan'|trans({}, 'HelensBakery') }}</label>
</div>
<div class="form-label-control">
<input id="subheader-filter-choice-vegetarian" type="checkbox" data-property="vegetarian" />
<label for="subheader-filter-choice-vegetarian"><i class="icon-vegetarian"></i> {{ 'vegetarian'|trans({}, 'HelensBakery') }}</label>
</div>
{# <div class="form-label-control">
<input id="subheader-filter-choice-fish" type="checkbox" data-property="fish" />
<label for="subheader-filter-choice-fish"><i class="icon-vis"></i> Vis</label>
</div> #}
<div class="form-label-control">
<input id="subheader-filter-choice-homemade" type="checkbox" data-property="homemade" />
<label for="subheader-filter-choice-homemade"><i class="icon-homemade"></i></label>
</div>
</div>
</div>
{# Zoeken #}
<input type="search" class="subheader-search-input" placeholder="{{ 'search'|trans({}, 'HelensBakery') }}" />
</div>
{#
<div class="subheader-shop-switcher">
<a href="#" class="subheader-shop-switcher-button boldr-button boldr-button-outline-light">
<span class="boldr-button-text">Locatie: {{ cart.shop.name }}</span>
<i class="icon-chevron-down"></i>
</a>
<div class="subheader-shop-switcher-dropdown">
{% for shop in boldr_multishop_get_shops() %}
<a data-id="{{ shop.id }}">{{ shop.name }}</a>
{% endfor %}
</div>
</div>
#}
</div>
<div class="subheader-categories">
{# Categories #}
{% for category in categories %}
{% set categoryCatalogProducts = catalogProducts|filter(catalogProduct => category in catalogProduct.product.categories) %}
{% if categoryCatalogProducts|length > 0 %}
<a href="#" data-id="{{ category.id }}">
{{ category.name }}
</a>
{% endif %}
{% endfor %}
</div>
{% endblock %}
{% block overlays %}
<div class="overlay" id="overlay-add-product">
<a href="#" class="overlay-close">
<i class="icon-plus"></i>
</a>
<div class="overlay-content overlay-add-product">
{% if not cart.canItemsBeModified %}
<div style="padding: 20px">
<p>
{{ 'cant_add_while_paying'|trans({}, 'HelensBakery') }}
</p>
<div class="order-window-cart-next-states">
{% for nextState in cart.nextStates %}
<a href="{{ nextState.url }}" class="order-window-cart-next-state boldr-button boldr-button-highlight">
{{ nextState.buttonText }}
</a>
{% endfor %}
</div>
</div>
{% endif %}
<div class="overlay-add-product-content" {{ not cart.canItemsBeModified ? 'style="display: none"' }}>
<div class="overlay-add-product-info">
<div class="overlay-add-product-info-header">
<a class="overlay-add-product-info-header-close-mobile">
<i class="icon-arrow-left"></i>
</a>
{# Heading image #}
<img class="overlay-add-product-info-header-image" />
<div class="overlay-add-product-info-header-allergens">
<div class="overlay-add-product-info-header-allergens-title">{{ 'allergen_information'|trans({}, 'HelensBakery') }}:</div>
<div class="overlay-add-product-info-header-allergens-list">
{% for allergen in ['celery', 'egg', 'fish', 'gluten', 'lupine', 'milk', 'mollusks', 'mustard', 'nuts', 'peanut', 'sesame', 'shellfish', 'soy', 'sulfites'] %}
<img src="{{ asset('/assets/images/allergens/' ~ app.request.locale ~ '/' ~ allergen ~ '.png') }}" class="overlay-add-product-info-header-allergen" data-name="{{ allergen }}">
{% endfor %}
</div>
</div>
</div>
<div class="overlay-add-product-info-content">
{# Product details #}
<span class="overlay-add-product-info-name"></span>
<span class="overlay-add-product-info-details"></span>
{# Options #}
<div class="overlay-add-product-info-options"></div>
</div>
</div>
<div class="overlay-add-product-extra">
<span class="overlay-add-product-extra-heading">{{ 'shop.add_extras'|trans }}</span>
{% for category in categories|filter(category => category.hbVisibleInExtras) %}
{% set categoryCatalogProducts = catalogProducts|filter(catalogProduct => category in catalogProduct.product.categories) %}
{% if categoryCatalogProducts|length > 0 %}
<div class="overlay-add-product-extra-category">
<span class="overlay-add-product-extra-category-selection-count">
0
</span>
<div class="overlay-add-product-extra-category-heading">
<span class="overlay-add-product-extra-category-name">
{{ category.name }}
</span>
<a href="#" class="overlay-add-product-extra-category-toggle">
<i class="icon-plus"></i>
<i class="icon-minus"></i>
</a>
</div>
<div class="overlay-add-product-extra-category-products-wrapper">
<div class="overlay-add-product-extra-category-products">
{% for catalogProduct in categoryCatalogProducts|sort((a, b) => a.product.name <=> b.product.name) %}
<div class="overlay-add-product-extra-product" data-product-variant-id="{{ catalogProduct.variants[0].productVariant.id }}"
data-product-id="{{ catalogProduct.product.id }}"
data-price="{{ catalogProduct.variants[0].totalPrice }}">
<div class="overlay-add-product-extra-product-info">
<span class="overlay-add-product-extra-product-name">
{{ catalogProduct.product.name }}
</span>
<span class="overlay-add-product-extra-product-price">
+ {{ boldr_shop_format_currency(catalogProduct.variants[0].totalPrice, catalogProduct.variants[0].currency.isoCode) }}
</span>
</div>
<div class="overlay-add-product-extra-product-image-and-controls">
{% if catalogProduct.product.primaryImage is not null %}
<img src="{{ catalogProduct.product.primaryImage.attachment.Sizes.small }}" class="overlay-add-product-extra-product-image" />
{% endif %}
<div class="overlay-add-product-extra-product-controls">
<a href="#" class="overlay-add-product-extra-product-minus">
<i class="icon-minus"></i>
</a>
<span class="overlay-add-product-extra-product-quantity">0</span>
<a href="#" class="overlay-add-product-extra-product-plus">
<i class="icon-plus"></i>
</a>
</div>
</div>
</div>
{% endfor %}
<div class="overlay-add-product-extra-product-spacer"></div>
<div class="overlay-add-product-extra-product-spacer"></div>
<div class="overlay-add-product-extra-product-spacer"></div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
<div class="overlay-add-product-add" {{ not cart.canItemsBeModified ? 'style="display: none"' }}>
<div class="overlay-add-product-add-prices">
<span class="overlay-add-product-add-price">
€3.20
</span>
<span class="overlay-add-product-add-additional-price">
</span>
</div>
<a href="#" class="boldr-button boldr-button-medium boldr-button-highlight overlay-add-product-add-button">
<span class="text-mobile">{{ 'add'|trans({}, 'HelensBakery') }}</span>
<span class="text-desktop">{{ 'add_to_cart'|trans({}, 'HelensBakery') }}</span>
</a>
</div>
</div>
</div>
{% endblock %}
{% block body %}
{# Products #}
<div class="order-window {{ cart.items|length > 0 ? 'order-window-cart-visible' }}">
<div class="product-list-wrapper">
<div class="product-list">
{% for category in categories %}
{% set categoryCatalogProducts = catalogProducts|filter(catalogProduct => category in catalogProduct.product.categories) %}
{% if categoryCatalogProducts|length > 0 %}
<div class="product-list-category" data-id="{{ category.id }}" data-show-extras="{{ category.hbShowExtras ? 'true' : 'false' }}">
<div class="product-list-category-header">
{{ category.name }}
</div>
<div class="product-list-category-products">
{% for catalogProduct in categoryCatalogProducts|sort((a, b) => a.product.name|split('.')[0] <=> b.product.name|split('.')[0]) %}
{% set variant = catalogProduct.variants[0] %}
<div class="product-list-product" data-product-variant-id="{{ variant.productVariant.id }}"
data-price="{{ variant.totalPrice }}"
data-new="{{ catalogProduct.product.new ? 'true' : 'false' }}"
data-homemade="{{ catalogProduct.product.homemade ? 'true' : 'false' }}"
data-vegan="{{ catalogProduct.product.vegan ? 'true' : 'false' }}"
data-vegetarian="{{ catalogProduct.product.vegetarian ? 'true' : 'false' }}"
data-fish="{{ catalogProduct.product.fish ? 'true' : 'false' }}"
data-beef="{{ catalogProduct.product.beef ? 'true' : 'false' }}"
data-image-large="{{ catalogProduct.product.primaryImage is not null ? catalogProduct.product.primaryImage.attachment.sizes.large }}"
data-allergen-gluten="{{ variant.productVariant.allergens.gluten ? 'true' : 'false' }}"
data-allergen-egg="{{ variant.productVariant.allergens.egg ? 'true' : 'false' }}"
data-allergen-fish="{{ variant.productVariant.allergens.fish ? 'true' : 'false' }}"
data-allergen-peanut="{{ variant.productVariant.allergens.peanut ? 'true' : 'false' }}"
data-allergen-nuts="{{ variant.productVariant.allergens.nuts ? 'true' : 'false' }}"
data-allergen-soy="{{ variant.productVariant.allergens.soy ? 'true' : 'false' }}"
data-allergen-milk="{{ variant.productVariant.allergens.milk ? 'true' : 'false' }}"
data-allergen-shellfish="{{ variant.productVariant.allergens.shellfish ? 'true' : 'false' }}"
data-allergen-mollusks="{{ variant.productVariant.allergens.mollusks ? 'true' : 'false' }}"
data-allergen-celery="{{ variant.productVariant.allergens.celery ? 'true' : 'false' }}"
data-allergen-mustard="{{ variant.productVariant.allergens.mustard ? 'true' : 'false' }}"
data-allergen-sesame="{{ variant.productVariant.allergens.sesame ? 'true' : 'false' }}"
data-allergen-sulfites="{{ variant.productVariant.allergens.sulfites ? 'true' : 'false' }}"
data-allergen-lupine="{{ variant.productVariant.allergens.lupine ? 'true' : 'false' }}"
>
{% if catalogProduct.product.primaryImage %}
<div class="product-list-product-header">
<img src="{{ catalogProduct.product.primaryImage.attachment.sizes.medium }}" style="object-fit: {{ catalogProduct.product.primaryImage.cover ? 'cover' : 'contain' }}; object-position: {{ catalogProduct.product.primaryImage.positionX ~ ' ' ~ catalogProduct.product.primaryImage.positionY }}" class="product-list-product-image" />
{% if catalogProduct.product.new %}
<span class="badge-new">{{ 'new'|trans({}, 'HelensBakery') }}</span>
{% endif %}
<div class="product-list-product-variants">
{% if catalogProduct.product.homemade %}
<i class="icon-homemade" title="Homemade"></i>
{% endif %}
{% if catalogProduct.product.vegan %}
<i class="icon-vegan" title="{{ 'vegan'|trans({}, 'HelensBakery') }}"></i>
{% endif %}
{% if catalogProduct.product.vegetarian %}
<i class="icon-vegetarian" title="{{ 'vegetarian'|trans({}, 'HelensBakery') }}"></i>
{% endif %}
{% if catalogProduct.product.fish %}
<i class="icon-vis" title="Vis"></i>
{% endif %}
{% if catalogProduct.product.beef %}
<i class="icon-rundvlees" title="{{ '100percent_beef'|trans({}, 'HelensBakery') }}"></i>
{% endif %}
</div>
</div>
{% endif %}
<div class="product-list-product-info">
<span class="product-list-product-name">
{{ catalogProduct.product.name }}
{% if not variant.inStock %}
{{ 'sold_out'|trans({}, 'HelensBakery') }}
{% endif %}
</span>
<span class="product-list-product-details">
{{ catalogProduct.product.description|default(catalogProduct.product.ingredients|map(ingredient => ingredient.name)|join(', '))|striptags|raw }}
</span>
<span class="product-list-product-price">
{{ boldr_shop_format_currency(variant.totalPrice, variant.currency.isoCode) }}
</span>
</div>
<a class="product-list-product-add" href="#">
<i class="icon-plus"></i>
</a>
</div>
{% endfor %}
<div class="product-list-product-spacer"></div>
<div class="product-list-product-spacer"></div>
<div class="product-list-product-spacer"></div>
</div>
</div>
{% endif %}
{% endfor %}
<div class="product-list-refine-search">
<span>{{ 'search_no_products'|trans({}, 'HelensBakery') }}</span>
<a href="#" class="product-list-refine-search-clear boldr-button boldr-button-filled">{{ 'show_all_products'|trans({}, 'HelensBakery') }}</a>
</div>
</div>
</div>
<div class="order-window-cart-wrapper">
<div class="order-window-cart">
<div class="order-window-cart-body">
<div class="order-window-cart-title">
<span>{{ 'my_order'|trans({}, 'HelensBakery') }}</span>
<i class="order-window-cart-title-close icon-chevron-down"></i>
</div>
<div class="order-window-cart-products">
<div class="order-window-cart-mobile-empty">
<span class="order-window-cart-mobile-empty-text">{{ 'no_products_in_cart'|trans({}, 'HelensBakery') }}</span>
<a id="order-window-cart-mobile-empty-close" class="boldr-button boldr-button-filled">
{{ 'add_product'|trans({}, 'HelensBakery') }}
</a>
</div>
{% for orderItem in cart.items %}
<div class="order-window-cart-product" data-order-item-id="{{ orderItem.id }}" data-quantity="{{ orderItem.quantity }}">
<span class="order-window-cart-product-quantity">{{ orderItem.quantity }}x</span>
<div class="order-window-cart-product-info">
<div class="order-window-cart-product-name-price">
<span class="order-window-cart-product-name">{{ orderItem.productVariant.name }}</span>
<span class="order-window-cart-product-price">
{{ boldr_shop_format_currency(orderItem.price.totalPriceExcludingModifiers, cart.currency.isoCode) }}
</span>
</div>
<div class="order-window-cart-product-modifiers">
{% for modifier in orderItem.price.modifiers %}
<div class="order-window-cart-product-modifier">
<span class="order-window-cart-product-modifier-name">
{{ modifier.quantity > 1 ? modifier.quantity ~ 'x' }} {{ modifier.name }}
</span>
<span class="order-window-cart-product-modifier-amount">
{{ modifier.amount < 0 ? '-' : '+' }} {{ boldr_shop_format_currency(modifier.amount|abs, cart.currency.isoCode) }}
</span>
</div>
{% endfor %}
</div>
<div class="order-window-cart-product-option-values">
{% for optionValue in orderItem.optionValues %}
<div class="order-window-cart-product-option-value">
{% if optionValue.name %}
{{ optionValue.name }}:
{% endif %}
{{ optionValue.text }}
</div>
{% endfor %}
</div>
{% set allergens = ['celery', 'egg', 'fish', 'gluten', 'lupine', 'milk', 'mollusks', 'mustard', 'nuts', 'peanut', 'sesame', 'shellfish', 'soy', 'sulfites'] %}
{% set hasAllergens = allergens|reduce((c, v) => c or attribute(orderItem.productVariant.allergens, v), false) %}
{% if hasAllergens %}
<div class="order-window-cart-product-allergens">
<span class="order-window-cart-product-allergens-label">{{ 'allergen_information'|trans({}, 'HelensBakery') }}:</span>
{% for allergen in allergens %}
{% if attribute(orderItem.productVariant.allergens, allergen) %}
<img src="{{ asset('/assets/images/allergens/' ~ app.request.locale ~ '/' ~ allergen ~ '.png') }}" class="order-window-cart-product-allergen" data-name="{{ allergen }}">
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if cart.canItemsBeModified %}
<div class="order-window-cart-product-quantity-buttons">
<a href="#" class="order-window-cart-product-quantity-remove">
<i class="icon-minus"></i>
</a>
<a href="#" class="order-window-cart-product-quantity-add">
<i class="icon-plus"></i>
</a>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
<div class="order-window-cart-subtotal-modifiers" {{ cart.total == cart.subtotal ? 'style="display: none"' }}>
<div class="order-window-cart-subtotal">
<span class="order-window-cart-subtotal-text">{{ 'sub_total'|trans({}, 'HelensBakery') }}</span>
<span id="order-window-cart-subtotal-amount" class="order-window-cart-subtotal-amount">{{ boldr_shop_format_currency(cart.subtotal, cart.currency.isoCode) }}</span>
</div>
<div class="order-window-cart-modifiers">
{% for modifier in cart.price.modifiers %}
<div class="order-window-cart-subtotal">
<span class="order-window-cart-subtotal-text">{{ modifier.name }}</span>
<span class="order-window-cart-subtotal-amount">{{ (modifier.amount < 0 ? '- ' : '') ~ boldr_shop_format_currency(modifier.amount|abs, cart.currency.isoCode) }}</span>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="order-window-cart-footer">
<div class="order-window-cart-subtotal">
<span class="order-window-cart-subtotal-text">{{ 'total'|trans({}, 'HelensBakery') }}</span>
<span id="order-window-cart-total-amount" class="order-window-cart-subtotal-amount">{{ boldr_shop_format_currency(cart.total, cart.currency.isoCode) }}</span>
</div>
{% if not cart.canItemsBeModified %}
<p>
{{ 'cant_add_while_paying'|trans({}, 'HelensBakery') }}
</p>
{% endif %}
<div class="order-window-cart-next-states">
{% for nextState in cart.nextStates %}
<a href="{{ nextState.url }}" class="order-window-cart-next-state boldr-button boldr-button-highlight">
{{ nextState.buttonText }}
</a>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}