 # CLASSES
 class BuyButton extends ProductComponent
 	constructor: (@element, @productId, buyData = {}, @options) ->
-		if CATALOG_SDK?
-			@SDK = CATALOG_SDK
-			@SDK.getProductWithVariations(@productId).done (json) =>
-				@productData = json
-				@update()
-
 		@sku = buyData.sku || null
 		@quantity = buyData.quantity || 1
 		@seller = buyData.seller || 1

# PLUGIN ENTRY POINT
$.fn.buyButton = (productId, buyData, jsOptions) ->
	defaultOptions = $.extend true, {}, $.fn.buyButton.defaults
	element = this[this.length-1]
	do (element) =>
		$element = $(element)
		domOptions = $element.data()
		options = $.extend(true, defaultOptions, domOptions, jsOptions)


		@accessories = []

		if CATALOG_SDK?
			@SDK = CATALOG_SDK
			@SDK.getProductWithVariations(@productId).done (json) =>
				@productData = json
				@getChangesFromHREF()
				@update()

		@getChangesFromHREF()
		@bindEvents()
		@update()
