{#
This file is part of the Coupon plugin
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
<script type="text/javascript">
$(function () {
$('#coupon_button').on("click", function () {
$(this).attr('disabled', 'disabled');
$.ajax({
type: 'POST',
data: $('#shopping-form').serialize(),
url: '{{ url("shopping_redirect_to") }}',
success: function(data) {
window.location.href = '{{ url('plugin_coupon_shopping') }}';
},
error: function() {
window.location.href = '{{ url('plugin_coupon_shopping') }}';
}
});
return false;
});
// append to layout
$(".ec-orderPayment").last().after($("#coupon").detach());
})
</script>
<div id="coupon" class="ec-orderCoupon">
<div class="ec-rectHeading">
<h2>{{ 'plugin_coupon.front.shopping.header'|trans }}</h2>
</div>
<div id="customer_detail_box" class="column">
{% if CouponOrder %}
<strong class="ec-color-red">{{ 'plugin_coupon.front.shopping.message.use_code'|trans({'%code%': CouponOrder.coupon_cd }) }}</strong>
{% else %}
{{ 'plugin_coupon.front.shopping.message.empty'|trans }}
{% endif %}
<p><a class="ec-inlineBtn" id="coupon_button" href="{{ url('plugin_coupon_shopping') }}">{{ 'plugin_coupon.front.shopping.button.add_coupon'|trans }}</a></p>
</div>
</div>