 					skuDimensionValue = sku.dimensions[dimension]
 					# If the dimension value matches, enable the button
 					if skuDimensionValue is value
-						selectors.itemDimensionValueInput(dimension, value, $template).removeAttr('disabled')
+						selectors.itemDimensionValueInput(dimension, value, context).removeAttr('disabled')
 					# If the dimension value matches and this sku is available, show as selectable
 					if skuDimensionValue is value and sku.available
-						selectors.itemDimensionValueInput(dimension, value, $template).removeClass('item_unavaliable')
-						selectors.itemDimensionValueLabel(dimension, value, $template).removeClass('disabled item_unavaliable')
+						selectors.itemDimensionValueInput(dimension, value, context).removeClass('item_unavaliable')
+						selectors.itemDimensionValueLabel(dimension, value, context).removeClass('disabled item_unavaliable')
 
 
 $.fn.skuSelector = (productId, name, dimensions, skus, options = {}) ->

	el = (if available.length > 0 then available else dimArray).filter('input:enabled')[0]
	$(el).attr('checked', 'checked').change() if dimArray.length > 0

updatePrice = (sku, options, template) ->
	if sku and sku.available
		updatePriceAvailable(sku, options, template)
	else
		updatePriceUnavailable(options, template)

updatePriceAvailable = (sku, options, template) ->
	listPrice = formatCurrency sku.listPrice
	bestPrice = formatCurrency sku.bestPrice
	installments = sku.installments
	installmentValue = formatCurrency sku.installmentsValue

	# Modifica href do botão comprar
	options.updateBuyButtonURL($.skuSelector.getAddUrlForSku(sku.sku), template)
	options.selectors.price(template).show()
	options.selectors.buyButton(template).show()
	options.selectors.listPriceValue(template).text("R$ #{listPrice}")
	options.selectors.bestPriceValue(template).text("R$ #{bestPrice}")
	if installments > 1
		options.selectors.installment(template).text("ou até #{installments}x de R$ #{installmentValue}")

updatePriceUnavailable = (options, template) ->
	# Modifica href do botão comprar
	options.updateBuyButtonURL('javascript:void(0);', template)
	options.selectors.price(template).hide()
	options.selectors.buyButton(template).hide()
	# $('.notifyme-skuid').val()

# Sanitizes text: "Caçoá (teste 2)" becomes "cacoateste2"

	if value? and not isNaN value
		return parseFloat(value/100).toFixed(2).replace('.',',').replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.')
	else
		return "Grátis"