custom/plugins/sw-asus/src/Resources/views/storefront/page/product-detail/buy-widget.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
  2. {% block page_product_detail_buy_container %}
  3.     <script>
  4.         console.log("EasyCredit Ratenkauf: Buy widget form loaded");
  5.         document.addEventListener("DOMContentLoaded", () => {
  6.         const observer = new MutationObserver(() => {
  7.             const easyCreditBtn = document.querySelector("easycredit-express-button");
  8.             console.log(easyCreditBtn);
  9.             if (!easyCreditBtn || !easyCreditBtn.shadowRoot) return;
  10.             console.log("EasyCredit Ratenkauf: Shadow DOM found");
  11.             const longText = easyCreditBtn.shadowRoot.querySelector(".long");
  12.             const shortText = easyCreditBtn.shadowRoot.querySelector(".short");
  13.             if (longText && shortText) {
  14.                 console.log("applying styles");
  15.                 longText.style.fontSize = "8pt";
  16.                 shortText.style.fontSize = "8pt";
  17.                 observer.disconnect(); // Stop observing once applied
  18.             }
  19.         });
  20.         observer.observe(document.body, { childList: true, subtree: true });
  21.     });
  22.     </script>
  23.     <div itemprop="offers" class="detail-offers"
  24.          itemscope
  25.          itemtype="{% if page.product.calculatedPrices|length > 1 %}http://schema.org/AggregateOffer{% else %}http://schema.org/Offer{% endif %}">
  26.         {% block page_product_detail_data %}
  27.             {% block page_product_detail_data_rich_snippet_url %}
  28.                 {{ parent() }}
  29.             {% endblock %}
  30.             {% block page_product_detail_data_rich_snippet_price_range %}
  31.                 {{ parent() }}
  32.             {% endblock %}
  33.             {% block page_product_detail_data_rich_snippet_price_currency %}
  34.                 {{ parent() }}
  35.             {% endblock %}
  36.             {% set remoteClickOptions = {
  37.                 selector: "#review-tab",
  38.                 scrollToElement: true
  39.             } %}
  40.             {% block page_product_detail_reviews %}
  41.                 {{ parent() }}
  42.             {% endblock %}
  43.         {% endblock %}
  44.         {% block page_product_detail_configurator_include %}
  45.         {% endblock %}
  46.         {% block page_product_detail_price %}
  47.             {{ parent() }}
  48.         {% endblock %}
  49.         {% block page_product_detail_tax %}
  50.             <div class="product-detail-tax-container">
  51.                 {% if context.taxState == "gross" %}
  52.                     {% if page.product.calculatedPrice.totalPrice >= 20 %}
  53.                         {% set taxText = "general.grossTaxInformationFree"|trans|sw_sanitize %}
  54.                     {% else %}
  55.                         {% set taxText = "general.grossTaxInformation"|trans|sw_sanitize %}
  56.                     {% endif %}
  57.                 {% else %}
  58.                     {% if page.product.calculatedPrice.totalPrice >= 20 %}
  59.                         {% set taxText = "general.netTaxInformationFree"|trans|sw_sanitize %}
  60.                     {% else %}
  61.                         {% set taxText = "general.netTaxInformation"|trans|sw_sanitize %}
  62.                     {% endif %}
  63.                 {% endif %}
  64.                 <p class="product-detail-tax">
  65.                     {% block page_product_detail_tax_link %}
  66.                         <a class="product-detail-tax-link"
  67.                            href="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}"
  68.                            title="{{ taxText }}"
  69.                            data-toggle="modal"
  70.                            data-url="{{ path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') }) }}">
  71.                             {{ taxText }}
  72.                         </a>
  73.                     {% endblock %}
  74.                 </p>
  75.             </div>
  76.         {% endblock %}
  77.         {% block page_product_detail_delivery_informations %}
  78.             <div class="product-detail-delivery-information">
  79.                 <div class="product-detail-delivery-information__free">
  80.                     {% sw_icon 'check_circle' style {'pack':'default', 'size': 'md'} %}
  81.                     {% if page.product.calculatedPrice.totalPrice >= 20 %}
  82.                         <span>{{ 'productDetailDelivery.Shipping'|trans|sw_sanitize }}</span>
  83.                     {% else %}
  84.                         <span>{{ 'productDetailDelivery.freeShipping'|trans|sw_sanitize }}</span>
  85.                     {% endif %}
  86.                 </div>
  87.                 <div class="product-detail-delivery-information__shipping {% if page.product.availableStock > 0 %} product-detail-delivery-information__shipping--available{% endif %}">
  88.                     {% sw_icon 'delivery' style {'pack':'default', 'size': 'md'} %}
  89.                     {% if page.product.availableStock > 0 %}
  90.                         <div class="label">{{ 'productDetailDelivery.delivery'|trans|sw_sanitize }}</div>
  91.                     {% else %}
  92.                         <div class="label">{{ 'productDetailDelivery.nodelivery'|trans|sw_sanitize }}</div>
  93.                     {% endif %}
  94.                 </div>
  95.                 <div class="product-detail-delivery-information__time">
  96.                     {% sw_include '@Storefront/storefront/component/delivery-information.html.twig' %}
  97.                 </div>
  98.             </div>
  99.         {% endblock %}
  100.         {% if page.product.parentId and page.configuratorSettings|length > 0 %}
  101.             <div class="product-detail-configurator-container">
  102.                 {% sw_include '@Storefront/storefront/page/product-detail/configurator.html.twig' %}
  103.             </div>
  104.         {% endif %}
  105.         {{ parent() }}
  106.         {% sw_include '@Storefront/storefront/component/wishlist/add_wishlist_modal/add-button.html.twig' ignore missing with {productId: page.product.id } %}
  107.     </div>
  108. {% endblock %}
  109. {% block page_product_detail_ordernumber_container %}
  110.     {# remove #}
  111. {% endblock %}