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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
  2. {% block page_product_detail_buy_button %}
  3.     {{ parent() }}
  4.     {% set ivyPrice = 0 %}
  5.     {% set taxrate = page.product.tax.taxrate %}
  6.     {% if page.product.calculatedPrices|length > 1 %}
  7.         {% set lowestPrice = false %}
  8.         {% set highestPrice = false %}
  9.         {% for price in page.product.calculatedPrices %}
  10.             {% if not lowestPrice or price.unitPrice < lowestPrice %}
  11.                 {% set lowestPrice = price.unitPrice %}
  12.             {% endif %}
  13.             {% if not highestPrice or price.unitPrice > highestPrice %}
  14.                 {% set highestPrice = price.unitPrice %}
  15.             {% endif %}
  16.         {% endfor %}
  17.         {% if  highestPrice > ivyPrice %}
  18.             {% set ivyPrice = highestPrice %}
  19.         {% endif %}
  20.     {% else %}
  21.         {% set ivyPrice = page.product.calculatedPrice.UnitPrice  %}
  22.     {% endif %}
  23.     {% if  taxrate > 0 %}
  24.         {% set ivyPrice = ivyPrice / (100+taxrate) *100  %}
  25.     {% endif %}
  26.     {% if config('WizmoGmbhIvyPayment.config.showDetailBtn') %}
  27.         <div class="ivy--express-checkout-btn"
  28.                 data-action="{{ path('frontend.ivyexpress.start') }}"
  29.                 data-add-to-ivycart="true">
  30.             <div
  31.                 class="ivy-checkout-button"
  32.                 style="visibility: hidden"
  33.                 data-cart-value="{{ ivyPrice }}"
  34.                 data-shop-category="{{ page.IvyMcc}}"
  35.                 data-locale="{{ 'ivypaymentplugin.ivy-modal.ivyLocale'|trans|sw_sanitize }}"
  36.                 data-currency-code="{{ context.currency.isoCode }}"
  37.                 data-theme = "{% if config('WizmoGmbhIvyPayment.config.darkThemeDetail') %}dark{% else %}light{% endif %}"
  38.             ></div>
  39.             <template data-src="{{ page.IvyButtonUrl }}"></template>
  40.         </div>
  41.     {% endif %}
  42. {% endblock %}