custom/plugins/SwagPayPal/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_container %}
  3.     {{ parent() }}
  4.     {% block page_product_detail_buy_container_paypal %}
  5.         {% set buyable = product.available and product.childCount <= 0 and product.calculatedMaxPurchase > 0 %}
  6.         {% if buyable %}
  7.             {# @var \Swag\PayPal\Checkout\ExpressCheckout\ExpressCheckoutButtonData expressSettings #}
  8.             {% set expressSettings = page.extensions[constant('Swag\\PayPal\\Checkout\\ExpressCheckout\\ExpressCheckoutSubscriber::PAYPAL_EXPRESS_CHECKOUT_BUTTON_DATA_EXTENSION_ID')] %}
  9.             {% if expressSettings.productDetailEnabled %}
  10.                 <div class="form-row mt-3 justify-content-end">
  11.                     <div class="col-8"
  12.                          data-swag-paypal-express-button="true"
  13.                          data-swag-pay-pal-express-button-add-line-item-token="{{ sw_csrf('frontend.checkout.line-item.add', {"mode": "token"}) }}"
  14.                          data-swag-pay-pal-express-button-approve-payment-token="{{ sw_csrf('paypal.approve_payment', {"mode": "token"}) }}"
  15.                          data-swag-pay-pal-express-button-options="{{ expressSettings|json_encode }}">
  16.                     </div>
  17.                 </div>
  18.             {% endif %}
  19.         {% endif %}
  20.         {# @var \Swag\PayPal\Installment\Banner\BannerData installmentBanner #}
  21.         {% set installmentBanner = page.extensions[constant('Swag\\PayPal\\Installment\\Banner\\InstallmentBannerSubscriber::PAYPAL_INSTALLMENT_BANNER_DATA_EXTENSION_ID')] %}
  22.         {% if installmentBanner is not null %}
  23.             <div class="form-row mt-3 mb-4 justify-content-end">
  24.                 <div class="{{ buyable ? 'col-8' : 'col-12' }}" data-swag-paypal-installment-banner="true"
  25.                      data-swag-pay-pal-installment-banner-options="{{ installmentBanner|json_encode }}">
  26.                 </div>
  27.             </div>
  28.         {% endif %}
  29.     {% endblock %}
  30. {% endblock %}