Sha256: 1e11d9a5167052adcaa026418aff9e0a6f0f797b06129718966edce2bc0fc958
Contents?: true
Size: 724 Bytes
Versions: 85
Compression:
Stored size: 724 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: 'POST', url: Spree.pathFor('api/orders/' + window.order_number + '/coupon_codes'), 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
85 entries across 85 versions & 1 rubygems