Sha256: 60a0f77d9972506b3a28bd75105602eb1acf7bab2a2872e217358acd7b3b698b

Contents?: true

Size: 571 Bytes

Versions: 26

Compression:

Stored size: 571 Bytes

Contents

$(@).ready( ->
  $('[data-hook=adjustments_new_coupon_code] #add_coupon_code').click ->
    return if $("#coupon_code").val().length == 0
    Spree.ajax
      type: 'PUT'
      url: Spree.routes.apply_coupon_code(order_number)
      data:
        coupon_code: $("#coupon_code").val()
        token: Spree.api_key
      success: ->
        window.location.reload()
      error: (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

26 entries across 26 versions & 1 rubygems

Version Path
solidus_backend-2.2.2 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.1.1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.0.3 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-1.4.2 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-1.3.2 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.0.2 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-1.4.1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.2.1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.2.0 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.2.0.rc1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.2.0.beta1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.1.0 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.1.0.rc1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.0.1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.1.0.beta1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.0.0 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-1.4.0 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.0.0.rc1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-1.4.0.rc1 app/assets/javascripts/spree/backend/adjustments.js.coffee
solidus_backend-2.0.0.beta1 app/assets/javascripts/spree/backend/adjustments.js.coffee