Sha256: 778a8ce7e4764e4723234fe653b04a6d5371e58cf1ca42bdca89eeef05a22fb3
Contents?: true
Size: 706 Bytes
Versions: 19
Compression:
Stored size: 706 Bytes
Contents
Spree.ready(function() { $('[data-hook=adjustments_new_coupon_code] #add_coupon_code').click(function() { if ($("#coupon_code").val().length === 0) { return; } Spree.ajax({ type: 'PUT', url: Spree.routes.apply_coupon_code(window.order_number), data: { coupon_code: $("#coupon_code").val(), token: Spree.api_key }, success: function() { window.location.reload(); }, error: function(msg) { if (msg.responseJSON["error"]) { show_flash('error', msg.responseJSON["error"]); } else { show_flash('error', "There was a problem adding this coupon code."); } } }); }); });
Version data entries
19 entries across 19 versions & 1 rubygems