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

Version Path
solidus_backend-2.6.6 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.7.4 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.7.3 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.5 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.5.2 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.7.2 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.4 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.5.1 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.3 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.7.1 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.2 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.7.0 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.1 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.0 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.6.0.rc1 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.5.0 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.5.0.rc1 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.5.0.beta2 app/assets/javascripts/spree/backend/adjustments.js
solidus_backend-2.5.0.beta1 app/assets/javascripts/spree/backend/adjustments.js