var woo = {}; (function($) { //Keys required for accessing the woocommerce api calls (Referenced in woo.getRatePlan, woo.getCoreProduct, and woo.displayProtectionPlan) var consumer_key = "ck_63c6c0c6c1a22a78c0cbfdc9f344f74ba6c42f3b"; var consumer_secret = "cs_71499bc1c4a6429ff1c6aca680a97b0cc74b2d95"; var _self = this; _self.productInfo = undefined; //Stores product information retrieved from API call _self.productVariations = undefined;//Stores product variation information from API call in woo.getRatePlan _self.cart = undefined; //Stores the cart object created in woo.displayFallDetection _self.productName = undefined; //Stores that name of the product given in woo.getRatePlan //Function to parse together the html for the product cards based on the product JSON object sent woo.createRateButtons = function(product) { //regularPrice = parseFloat(product.regular_price).toFixed(2); var card = ''; var ratePromotions = ''; var displayPrice; salePrice = parseFloat(product.sale_price).toFixed(2); ratePromotions = product.attributes[6].option.split(","); specialOffer = product.attributes[7].option.split(","); dPrice = parseFloat(product.price).toFixed(2); ratePlan = product.attributes[1].option; product_id = product.id; noidea = product.attributes[1].option; card += ' Order Now '; //"Select'; return card; }; //Function to parse together the html for the rate plan cards based on the product JSON object sent woo.createRateCard = function(product) { //regularPrice = parseFloat(product.regular_price).toFixed(2); var card = ''; var ratePromotions = ''; var displayPrice; salePrice = parseFloat(product.sale_price).toFixed(2); ratePromotions = product.attributes[6].option.split(","); specialOffer = product.attributes[7].option.split(","); dPrice = parseFloat(product.price).toFixed(2); ratePlan = product.attributes[1].option; card += '
$'+dPrice+'/mo. '+specialOffer+'
' + ''+ratePromotions+'
' + ''+ratePromotions+'
' + '