Sha256: 221426a95b242778858a0860c1edc91fb66c199e082519fa0c64cbc602652c6a
Contents?: true
Size: 727 Bytes
Versions: 76
Compression:
Stored size: 727 Bytes
Contents
/* global order_number, show_flash */ $(function () { $('[data-hook=adjustments_new_coupon_code] #add_coupon_code').click(function () { var couponCode = $('#coupon_code').val() if (couponCode.length === 0) { return } $.ajax({ type: 'PUT', url: Spree.url(Spree.routes.apply_coupon_code(order_number)), data: { coupon_code: couponCode, token: Spree.api_key } }).done(function () { window.location.reload() }).fail(function (message) { if (message.responseJSON['error']) { show_flash('error', message.responseJSON['error']) } else { show_flash('error', 'There was a problem adding this coupon code.') } }) }) })
Version data entries
76 entries across 76 versions & 1 rubygems