{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{# Remove price range if quick buy is active #}
{% block component_product_box_price_info %}
{% set baseConfig = context.extensions.maxiaListingVariants %}
{% set variantsConfig = product.extensions.maxiaListingVariants %}
{% if baseConfig.pluginEnabled and product.parentId and variantsConfig.quickBuyActive
and variantsConfig.selection is not empty %}
{% set productOriginal = product %}
{% set product = {
priceRange: false,
calculatedPrice: (product.calculatedPrices.count > 0) ? product.calculatedPrices.first : product.calculatedPrice,
calculatedPrices: null,
calculatedListingPrice: product.calculatedListingPrice,
calculatedCheapestPrice: product.calculatedCheapestPrice,
packUnit: product.packUnit,
unit: product.unit,
purchaseUnit: product.purchaseUnit,
translated: product.translated
} %}
{% endif %}
{{ parent() }}
{% if baseConfig.pluginEnabled and variantsConfig.quickBuyActive %}
{% set product = productOriginal %}
{% endif %}
{% endblock %}