 window.variantOptions = (params) ->
   options = params['options']
+  outOfStockStr = " [품절]"
 
   # select a variant option
   $(document).on "change", ".variant-option-values", ->

        if typeof variant[id] == "object"
          if variant[id].in_stock
            $("#option-#{key}").addClass("in-stock")
            $("#option-#{key}").text($("#option-#{key}").text().replace("[X] ", "") )
          if $("#option-#{key}").val() == $(@).val()
            $('#variant_id').val(variant[id].id)
            $('#cart-form button[type=submit]').attr('disabled', false)

    otherOptionSelector = $("#option_type_" + otherOptionId)
    otherOptionSelector.find(".option-value").removeClass("in-stock")
    otherOptionSelector.find(".option-value").each ->
      text = $(@).text().replace(outOfStockStr, "")
      $(@).text(text + outOfStockStr)

    # ...then re-enable the ones that are available, and find the variant_id if both options have been selected
    variant_id
