custom/plugins/MaxiaListingVariants6/src/Resources/views/storefront/component/product/card/action.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
  2. {% block component_product_box_action_inner %}
  3.     {% set baseConfig = context.extensions.maxiaListingVariants %}
  4.     {% set variantsConfig = product.extensions.maxiaListingVariants %}
  5.     {% set isAvailable = (not product.isCloseout or (product.availableStock >= product.minPurchase)) and product.calculatedMaxPurchase > 0 %}
  6.     {% set isVariantProduct = product.parentId or product.childCount %}
  7.     {% set isParentProduct = product.childCount > 0 %}
  8.     {% if variantsConfig.quickBuyActive %}
  9.         {% set switched = app.request.query.get('switched') %}
  10.         {% set showPopupButton = (not isAvailable or isParentProduct or variantsConfig.isPartialConfiguration)
  11.             and not variantsConfig.isExpanded
  12.             and variantsConfig.hasAvailableVariant
  13.             and switched is null %}
  14.         {% set includeQuickBuyActions = ((isAvailable and not isParentProduct) or showPopupButton)
  15.             and (isVariantProduct or baseConfig.activateForMainProducts) %}
  16.         {% block component_product_box_action_maxia_quickbuy_actions_include %}
  17.             {% if includeQuickBuyActions %}
  18.                 {% block component_product_box_action_maxia_quickbuy_actions %}
  19.                     {# Quantity and cart button #}
  20.                     {% block component_product_box_action_maxia_quickbuy_actions_inner %}
  21.                         <div class="product-action maxia-quickbuy-actions{% if baseConfig.showAdditionalDetailLink %} detail-button-active{% endif %}">
  22.                             {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/listing-actions.html.twig' %}
  23.                         </div>
  24.                     {% endblock %}
  25.                     {% if baseConfig.showAdditionalDetailLink %}
  26.                         {# Show detail button below cart button #}
  27.                         {% block component_product_box_action_maxia_detail_button_extra %}
  28.                             {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/listing-detail-button.html.twig' %}
  29.                         {% endblock %}
  30.                     {% endif %}
  31.                 {% endblock %}
  32.             {% else %}
  33.                 {% if isVariantProduct or baseConfig.activateForMainProducts %}
  34.                     {# Show detail button if product is unavailable #}
  35.                     {% block component_product_box_action_maxia_detail_button %}
  36.                         {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/listing-detail-button.html.twig' %}
  37.                     {% endblock %}
  38.                 {% else %}
  39.                     {# Default buy actions #}
  40.                     {{ block('component_product_box_action_inner') }}
  41.                 {% endif %}
  42.             {% endif %}
  43.         {% endblock %}
  44.     {% else %}
  45.         {{ parent() }}
  46.     {% endif %}
  47.     {% block component_product_box_action_maxia_variants_config %}
  48.         {% if product.extensions.maxiaListingVariants is defined %}
  49.             {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/config.html.twig' %}
  50.         {% endif %}
  51.     {% endblock %}
  52.     {% block component_product_box_action_meta %}
  53.         {{ parent() }}
  54.     {% endblock %}
  55. {% endblock %}