     # if this selection conflicts with the previous selection, reset the previous selection
     selected = otherOptionSelector.find("option:selected")
     unless selected.hasClass("in-stock")
-      selected.parent().val("")
+      selected.parent()[0].selectedIndex = 0
 
     # fade out the cart button if selection is not complete
     unless $(".selected").length == 2

window.variantOptions = (params) ->
  options = params['options']
  outOfStockStr = " [품절]"

  # select a variant option
  $(document).on "change", ".variant-option-values", ->
    parent = $(@).parents('.variant-options')
    optionId = $(@).parents(".variant-options").attr("id").split("_")[2]
    optionIndex = $(@).parents(".variant-options").data("index")
    elemId = $(@).find("option:selected").attr("id").split("-")[1]

    # reset options if user selects something that's not in-stock
    unless $(@).hasClass("in-stock")
      $(@).find('.option-value').addClass("in-stock")

    # get list of variants that match this option value
    variants = options[optionId][elemId]
    ids = for key of variants
      key

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

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