app/Plugin/Coupon42/Resource/template/default/coupon_shopping_item.twig line 1

Open in your IDE?
  1. {#
  2.  This file is part of the Coupon plugin
  3.  Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4.  http://www.ec-cube.co.jp/
  5.  For the full copyright and license information, please view the LICENSE
  6.  file that was distributed with this source code.
  7. #}
  8. <script type="text/javascript">
  9.     $(function () {
  10.         $('#coupon_button').on("click", function () {
  11.             $(this).attr('disabled', 'disabled');
  12.             $.ajax({
  13.                 type: 'POST',
  14.                 data: $('#shopping-form').serialize(),
  15.                 url: '{{ url("shopping_redirect_to") }}',
  16.                 success: function(data) {
  17.                     window.location.href = '{{ url('plugin_coupon_shopping') }}';
  18.                 },
  19.                 error: function() {
  20.                     window.location.href = '{{ url('plugin_coupon_shopping') }}';
  21.                 }
  22.             });
  23.             return false;
  24.         });
  25.         // append to layout
  26.         $(".ec-orderPayment").last().after($("#coupon").detach());
  27.     })
  28. </script>
  29. <div id="coupon" class="ec-orderCoupon">
  30.     <div class="ec-rectHeading">
  31.         <h2>{{ 'plugin_coupon.front.shopping.header'|trans }}</h2>
  32.     </div>
  33.     <div id="customer_detail_box" class="column">
  34.         {% if CouponOrder %}
  35.             <strong class="ec-color-red">{{ 'plugin_coupon.front.shopping.message.use_code'|trans({'%code%': CouponOrder.coupon_cd }) }}</strong>
  36.         {% else %}
  37.             {{ 'plugin_coupon.front.shopping.message.empty'|trans }}
  38.         {% endif %}
  39.         <p><a class="ec-inlineBtn" id="coupon_button" href="{{ url('plugin_coupon_shopping') }}">{{ 'plugin_coupon.front.shopping.button.add_coupon'|trans }}</a></p>
  40.     </div>
  41. </div>