templates/Slivki/offers/buy_button.html.twig line 1

Open in your IDE?
  1. {% set additionalButtonCaption = additionalButtonCaption is defined and not offerIsFreeForUser ? additionalButtonCaption : '' %}
  2. {% if not pastOffer and offer.getFreeCodesCount() > 0 %}
  3.     <a style="display: none" class="button button--primary button--block" id="buyCodeButtonFake"><img src="/images/loading-animation.gif"/>&nbsp;</a>
  4.     {% if (offer.getID() == constant('Slivki\\Entity\\Offer::PETROL_OFFER_ID')) %}
  5.         <a onclick="if (window.google_tag_manager) {ga('send', 'event', 'Buy code', 'Click', '{{ getURL("Slivki:Default:details", offer.getID()) }}');}ym(20933521,'reachGoal','getcode-click');document.location='/oplata-promokoda-azs'"
  6.            class="button button--block {{ isMobileDevice() ? 'mobile'}} by-code-button text-uppercase" id="buyCodeButton">
  7.         {% if offerIsFreeForUser %}
  8.             БЕСПЛАТНЫЙ ПРОМОКОД {{ additionalButtonCaption|raw }}
  9.         {% else %}
  10.             {{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}
  11.         {% endif %}
  12.             </a>
  13.     {% else %}
  14.         {% if (buyCodePopup == '') %}
  15.             {% if isMobileDevice() or oldDetails is defined %}
  16.                 <a onclick="if (window.google_tag_manager) {ga('send', 'event', 'Buy code', 'Click', '{{ getURL("Slivki:Default:details", offer.getID()) }}');} ym(20933521,'reachGoal','getcode-click'); {{ isMobileDevice() ? 'document.location="/oplata/' ~ offer.getID() ~ '"' }};"
  17.                    class="{{ isMobileDevice() ? 'mobile' : 'old-details'}} d-flex justify-content-center align-items-center text-uppercase button-by-code button" id="buyCodeButton">
  18.                     {{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}
  19.                 </a>
  20.             {% else %}
  21.                 <a data-toggle="tab" role="tab" href="#offerSelectPromocodeAmount" class="d-flex justify-content-center align-items-center text-uppercase button-by-code button">{{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}</a>
  22.             {% endif %}
  23.         {% else %}
  24.             {% if isMobileDevice() %}
  25.                 <a onclick="if (window.google_tag_manager) {ga('send', 'event', 'Buy code', 'Click', '{{ getURL("Slivki:Default:details", offer.getID()) }}');} ym(20933521,'reachGoal','getcode-click'); document.location='{{ buyCodePopup == '#confirmBox' ? '/oplata-balance/' : '/oplata/'}}{{ offer.getID() }}'"
  26.                    class="{{ isMobileDevice() ? 'mobile'}} d-flex justify-content-center align-items-center text-uppercase button-by-code button" id="buyCodeButton">
  27.                     {{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}
  28.                 </a>
  29.             {% else %}
  30.                 {% if offer.isBuyCodeInAppOnly() and app.user() %}
  31.                     <a class="{{ isMobileDevice() ? 'mobile'}} d-flex justify-content-center align-items-center text-uppercase button-by-code button" data-toggle="modal"
  32.                        data-target="#byCodesAlwaysApp" id="buyCodeButton">
  33.                         {{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}
  34.                     </a>
  35.                     {% elseif not offer.isBuyCodeInAppOnly() and app.user()  %}
  36.                         <a onclick="if (window.google_tag_manager) {ga('send', 'event', 'Buy code', 'Click', '{{ getURL("Slivki:Default:details", offer.getID()) }}');} ym(20933521,'reachGoal','getcode-click');"
  37.                            class="{{ isMobileDevice() ? 'mobile'}} d-flex justify-content-center align-items-center text-uppercase button-by-code button" data-toggle="modal"
  38.                            data-target="{{ buyCodePopup }}" id="buyCodeButton">
  39.                             {{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}
  40.                         </a>
  41.                         {% elseif not offer.isBuyCodeInAppOnly() and not app.user() or offer.isBuyCodeInAppOnly() and not app.user()  %}
  42.                             <a class="{{ isMobileDevice() ? 'mobile'}} d-flex justify-content-center align-items-center text-uppercase button-by-code button" data-toggle="modal" data-target=".modal-auth" id="buyCodeButton">
  43.                                 {{ buyButtonLabel|raw }} {{ additionalButtonCaption|raw }}
  44.                             </a>
  45.                 {% endif %}
  46.             {% endif %}
  47.         {% endif %}
  48.     {% endif %}
  49. {% endif %}