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

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

    # if this selection conflicts with the previous selection, reset the previous selection
    selected = otherOptionSelector.find("option:selected")
    unless selected.hasClass("in-stock")
      selected.parent()[0].selectedIndex = 0

    # fade out the cart button if selection is not complete
    unless $(".selected").length == 2
