console.info("--- STORE -----------------------------------------------");
console.info($ == undefined);
console.info($);
store = {
debug: (window.location.origin == "http://bs" || window.location.origin == "https://staging.scan2scan.com"),
debugEventKey: (window.location.origin == "http://bs"),
ok: function () {
this._conf._eventKey = this.debugEventKey ? "development" : this._conf._eventKey;
var _ok = $("#store-" + this._conf._eventKey).length !== 0;
console.warn("##########################################################################################################");
console.warn("### EMBED STORE #store-" + this._conf._eventKey + " :: INIT-OK :: " + (_ok ? "OK" : "NOT OK "));
console.warn("##########################################################################################################");
return _ok;
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
init: function () {
console.warn("##########################################################################################################");
console.warn("### EMBED STORE :: INIT :: IN ############################################################################");
console.info("#store-" + this._conf._eventKey + " :: " + $("#store-" + this._conf._eventKey).length);
console.info(this._conf);
console.info(this._eventInfo);
this.initialize();
console.warn("### EMBED STORE :: INIT :: OUT ###########################################################################");
console.warn("##########################################################################################################");
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
initialize: function () {
console.info("--- initialize :: -------------------------------------------------------");
$("head").append("");
$("head").append("");
$.each(this, function (k, v) {
if (k.indexOf("_") == 0) {
v["_root"] = "$store";
v["_eventKey"] = $store._conf._eventKey;
}
});
this._form._css_prefix_ = "str-";
this.css();
this._store.init(this._eventInfo);
this._comm._initialize();
this.renderStore();
this.next(true);
//------------------------------------------------------------
//--- DEBUG
//------------------------------------------------------------
if (this.debug) {
//this.renderCode();
var div = "
";
var html = "";
html += JSON.stringify(this._eventInfo, null, 2);
$("#atbta-debug-atbta").html(html);
}
//------------------------------------------------------------
//--- DEBUG
//------------------------------------------------------------
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
canNext: function (visible) {
switch (visible) {
case "tickets":
$store._store.update();
var ret = $store._store.hasQuantity();
if (!ret) {
this.renderError("Choose a quantity to purchase");
}
return ret;
case "info":
$store._store.update();
}
return true;
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
next: function (initial) {
console.info("--- next" + (initial ? " :: " + initial : ""));
this.renderError();
var visible = $(".str-section:visible");
if (this.canNext(visible.data("store-section"))) {
var show = null;
var title = "";
console.info("--- next :: -" + visible.data("store-section") + "- :: " + (visible.data("store-section") == "completed"));
if ((visible.data("store-section") + "") == "completed" && initial != true) {
return;
}
switch (visible.data("store-section")) {
case "tickets":
if ($store._store.infos() == null) {
show = "cart";
title = "Checkout";
this.renderCart();
}
else {
show = "info";
title = "Provide Needed Info(s)";
this.renderInfo();
}
break;
case "info":
console.info("infos");
let _valid = this._form.validateUnique();
console.info(_valid);
if (_valid != "uniqueCheck") {
if (_valid == 1) {
show = "cart";
title = "Checkout";
this.renderCart();
}
else {
show = "info";
title = "Provide Needed Info(s)";
console.info(typeof _valid);
this.renderError(typeof _valid == "string" ? _valid : "Provide all required information before continuing.");
}
}
else {
return;
}
break;
case "cart":
title = "Thank You";
show = "completed";
this.renderCompleted();
break;
default:
show = "tickets";
title = $store._eventInfo.eventStoreButton;
break;
}
$("#str-navigation-title").html(title);
if ($(".str-section:visible").data("storeSection") != show) {
$(".str-section:visible").hide();
$("[data-store-section='" + show + "']").show();
if (initial !== true) {
this.scrollUp();
}
}
}
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
nextTo: function (show, title) {
$("#str-navigation-title").html(title);
if ($(".str-section:visible").data("storeSection") != show) {
$(".str-section:visible").hide();
$("[data-store-section='" + show + "']").show();
this.scrollUp();
}
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
back: function (from) {
console.info("back" + (from ? " :: " + from : ""));
this.renderError();
var visible = $(".str-section:visible");
var show = null;
var back = false;
var title = "";
var current = visible.data("store-section");
switch (from ? from : current) {
case "info":
case "code":
$store._store.update();
title = $store._eventInfo.eventStoreButton;
show = "tickets";
break;
case "codeCheckout":
$store._store.update();
if ($store._store.infos() == null) {
show = "cart";
title = "Checkout";
this.renderCart();
}
else {
show = "info";
title = "Provide Needed Info(s)";
this.renderInfo();
}
break;
case "cart":
if ($store._store.infos() == null) {
title = $store._eventInfo.eventStoreButton;
show = "tickets";
}
else {
show = "info";
title = "Provide Needed Info(s)";
back = true;
}
break;
case "payment":
show = "cart";
title = "Cart";
back = true;
break;
case "completed":
show = "payment";
title = "Payment";
back = true;
break;
default:
break;
}
if (show == "tickets") {
$store.renderTickets();
}
$("#str-navigation-title").html(title);
console.info(current + " :: " + show);
$(".str-section:visible").hide();
$("[data-store-section='" + show + "']").show();
this.scrollUp();
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderStore: function () {
console.info("--- renderStore -------------------------------------------------------");
var html = "";
html += this.renderEvent();
html += this.renderNav();
html += this.renderTickets();
html += this.renderCode();
html += this.renderInfo();
html += this.renderCart();
html += this.renderCompleted();
this.content(html);
this.renderTickets();
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderEvent: function () {
return "
" + this._eventInfo.event.name + " Store
" + this._eventInfo.event.startDate + "
";
},
renderNav: function () {
var html = "
";
html += "
";
html += "
";
html += "
";
html += "
";
html += "";
return html;
},
renderError: function (msg) {
$("#str-error").hide();
if (msg) {
console.info(msg);
$("#str-error").html(msg);
$("#str-error").show();
this.scrollUp();
}
},
scrollUp: function () {
$([document.documentElement, document.body]).animate({scrollTop: $(".str-navigation").offset().top - 75}, 500);
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderTickets: function () {
if ($("[data-store-section='tickets']").length == 0) {
return "";
}
var isLocalhost = window.location.hostname == "localhost";
var innerHtml = "";
innerHtml += $store.renderStoreCodes();
$.each(this._eventInfo.products, function (i, ticket) {
innerHtml += $store.renderStoreTicket(ticket, (isLocalhost ? 2 : 0));
});
html = "
";
html += ($store._eventInfo.hasOwnProperty("codes") && $store._eventInfo.codes.length != 0 ? "
Have Promo Code? Click HERE first.
" : "");
html += "
choose quantity for each ticket and press continue
";
html += "
" + innerHtml + "
";
html += ($store._eventInfo.hasOwnProperty("codes") && $store._eventInfo.codes.length != 0 ? "
Have Promo Code? Click HERE first.
" : "");
html += "";
html += $store.renderFbPixel("PageView");
html += "
";
$("[data-store-section='tickets']").html(html);
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderStoreTicket: function (ticket, index) {
console.info("--- renderStoreTicket :: " + ticket.name + " -------------------------------------------------------");
var html = "";
var symbol = $store._eventInfo.currency.symbol;
var max = ticket.maxPurchaseQuantity;
var oprice = ticket.price;
var price = ticket.price;
var discountCodes = $store._store.codes();
var discount = null;
var isAmount = true;
var upto = "";
$.each(discountCodes, function (key, discountCode) {
console.info(discountCode);
if (discount == null && discountCode.skipQuantities && (discountCode.haveProducts || (discountCode.exclusive == "EXCLUSIVE" && discountCode.discountCodeAmountType == "PERCENTAGE"))) {
if (discountCode.groups.length == 0) {
discount = discountCode.price;
isAmount = discountCode.discountCodeAmountType == "AMOUNT";
}
$.each(discountCode.groups, function (g, group) {
$.each(group.products, function (p, product) {
if (ticket.eventProductId == product.eventProductId) {
console.info(discountCode);
discount = discountCode.price;
isAmount = discountCode.discountCodeAmountType == "AMOUNT";
upto = (product.hasOwnProperty("maxQuantity") ? "(up to " + product.maxQuantity + " count)" : "");
}
});
});
}
});
if (price == undefined) {
var different = false;
$.each(ticket.variations, function (v, variation) {
if (price != undefined) {
different |= price != variation.price;
}
oprice = price = (price == undefined || parseFloat(price) > parseFloat(variation.price) ? variation.price : price);
if (variation.hasOwnProperty("maxPurchaseQuantity")) {
if (max == undefined || max > variation.maxPurchaseQuantity) {
max = variation.maxPurchaseQuantity;
}
}
});
var discountAmount = (discount != null ? (isAmount ? discount : price * discount / 100) : 0);
oprice = (different ? "from " : "") + symbol + oprice;
price = (different ? "from " : "") + symbol + parseFloat(price - discountAmount).toFixed(2);
}
else {
var discountAmount = (discount != null ? (isAmount ? discount : price * discount / 100) : 0);
oprice = symbol + oprice;
price = symbol + parseFloat(price - discountAmount).toFixed(2);
}
var quantityHtml = this._store.inputs.quantity(ticket.eventProductId, index + "", "str-item-quantity str-override", max);
html += "
";
html += "
";
html += "
" + ticket.name + "
";
html += "
" + (oprice != price ? upto + price + "
" + oprice + "
" : price) + quantityHtml + "
";
html += "
";
html += "
" + ticket.description + "
";
html += "
";
return html;
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderStoreCodes: function () {
var html = "";
var discountCodes = $store._store.codes();
$.each(discountCodes, function (key, discountCode) {
var code = undefined;
$.each($store._eventInfo.codes, function (i, c) {
if (c.code.toUpperCase() == key.toUpperCase()) {
code = c;
}
});
if (code) {
html += $store.renderStoreCode(discountCode);
}
else {
delete discountCodes[key];
}
});
$store._store.codes(discountCodes);
return html;
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderStoreCode: function (code) {
console.clear();
console.info("--- renderStoreCode ----------------------------------------");
console.info(code);
var symbol = $store._eventInfo.currency.symbol;
var html = "";
var price = 0.00;
var discount = 0.00;
var isAmount = code.discountCodeAmountType == "AMOUNT";
var isPercentage = code.discountCodeAmountType == "PERCENTAGE";
var isExclusive = code.exclusive == "EXCLUSIVE";
var isEach = code.applyTo == "EACH";
var isCollection = code.applyTo == "COLLECTION";
var isDefault = code.applyToType == "DEFAULT";
var isGroups = code.applyToType == "GROUPS";
var haveProducts = code.haveProducts;
$.each(code.groups, function (g, group) {
if (group.hasOwnProperty("count") && group.count > 0) {
if (group.hasOwnProperty("priceEach")) {
price += group.count * group.priceEach;
discount += group.count * group.discountAmountEach;
}
else {
$.each(group.products, function (p, product) {
if (product.hasOwnProperty("count")) {
price += group.count * product.count * product.priceEach;
discount += group.count * product.count * product.discountAmountEach;
}
});
}
}
});
var discountedPrice = "";
if (!haveProducts || code.skipQuantities) {
discountedPrice = (isAmount ? symbol : "") + code.price + (!isAmount ? "%" : "") + "
off" + (code.haveProducts ? " each" : "")+"
";
}
else {
discountedPrice = symbol + parseFloat(price - discount).toFixed(2);
}
html += "
";
if (isCollection || (isEach && isGroups)) {
var allStyle = "vertical-align: middle;font-size: 110%;";
var connectorStyle = allStyle + "font-size: 105%;padding: 0 5px;";
if (group.hasOwnProperty("discountPriceEach")) {
html += "
@
";
html += "
";
html += symbol + parseFloat(group.discountPriceEach).toFixed(2);
html += "
" + symbol + parseFloat(group.priceEach).toFixed(2) + "
";
html += "
";
}
html += "
x
";
html += "
" + group.count + "
";
}
html += "
";
skipQuantities |= code.skipQuantities;
}
});
html += "
IMPORTANT:" + (skipQuantities ? " Select quantities for the products listed below to add to the cart." : " Items listed above will be added to the cart IN ADDITION to those selected below.
");
html += "
";
}
html += "
";
html += "
";
html += "
";
html += this.renderCodeDebug(code);
return html;
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderCode: function (code) {
var codeInput = (this.debug && false ? "P01" : "");
if ($("[data-store-section='code']").length == 0) {
return "";
}
var html = "";
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
if (code) {
console.clear();
console.info("--- renderCode ----------------------------------------");
console.info(code);
var haveCodes = false;
var haveExclusiveCode = false;
$.each($store._store.codes(), function (c, _code) {
haveCodes = true;
haveExclusiveCode |= _code.exclusive == "EXCLUSIVE";
});
code.price = parseFloat(code.price);
code["skipQuantities"] = false;
code["haveProducts"] = false;
$.each(code.groups, function (g, group) {
code.haveProducts |= group.products.length != 0;
});
var symbol = $store._eventInfo.currency.symbol;
var isAmount = code.discountCodeAmountType == "AMOUNT";
var isPercentage = code.discountCodeAmountType == "PERCENTAGE";
var isExclusive = code.exclusive == "EXCLUSIVE";
var isEach = code.applyTo == "EACH";
var isCollection = code.applyTo == "COLLECTION";
var isDefault = code.applyToType == "DEFAULT";
var isGroups = code.applyToType == "GROUPS";
var haveProducts = code.haveProducts;
var canAddDiscountCode = !haveCodes || (isExclusive && !haveCodes) || (!haveExclusiveCode && !isExclusive);
var discount = parseFloat(code.price);
if (canAddDiscountCode && (!haveProducts || (isEach && isDefault))) {
code.skipQuantities = (isExclusive && (haveProducts || (!haveProducts && isAmount)) ? false : true);
$store.processCode(code.code);
return;
}
html += "
";
html += (!canAddDiscountCode ? "
Promo code \"" + code.code + "\" cannot be used with other promo codes in the cart.
" : "");
html += "
";
html += "
";
html += "
" + code.code.toUpperCase() + (isExclusive ? "EXCLUSIVE, cannot be used with any other offer" : "") + "
";
// ##############################################################################################################################
// ##############################################################################################################################
if (code.haveProducts) {
html += "
";
$.each(code.groups, function (g, group) {
html += (g != 0 && isCollection ? "
- OR -
" : "");
html += "
";
var totalGroupPrice = 0.0;
$.each(group.products, function (p, product) {
$.each($store._eventInfo.products, function (j, eventProduct) {
if (eventProduct.eventProductId == product.eventProductId) {
totalGroupPrice += $store.productPrice(eventProduct) * product.quantity;
}
});
});
// ##########################################################################################################################
// ##########################################################################################################################
if (isGroups || isCollection) {
var discountAmount = (isPercentage ? totalGroupPrice * code.price / 100 : code.price);
var discountPrice = totalGroupPrice - discountAmount;
group["priceEach"] = totalGroupPrice;
group["discountPriceEach"] = discountPrice;
group["discountAmountEach"] = discountAmount;
html += "
";
$.each(group.products, function (p, product) {
$.each($store._eventInfo.products, function (j, eventProduct) {
if (eventProduct.eventProductId == product.eventProductId) {
html += "
";
});
}
// ##############################################################################################################################
// ##############################################################################################################################
html += "
";
html += "
";
html += "
";
html += "
";
html += "";
html += ((isExclusive && isGroups) || !canAddDiscountCode ? "" : "");
html += "
";
//------------------------------------------------------------
//--- DEBUG
//------------------------------------------------------------
html += this.renderCodeDebug(code);
if (this.debugEventKey) {
html += "
HAVE CODES: " + haveCodes + " :: HAVE EXCLUSIVE CODES: " + haveExclusiveCode + " :: IS EXCLUSIVE: " + isExclusive + " :: CAN ADD DISCOUNT: " + canAddDiscountCode + "
";
html += "
" + JSON.stringify(code, null, 2) + "
";
}
//------------------------------------------------------------
//--- DEBUG
//------------------------------------------------------------
$("#str-navigation-title").html("Promo Code - " + code.code.toUpperCase());
$("[data-store-section='code']").html(html);
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
else {
if (this.debug) {
var btns = {};
var abtns = [];
$.each($store._eventInfo.codes, function (i, __code) {
btns[__code.code] = "";
abtns.push(__code.code);
});
abtns.sort();
html += "";
html += "";
html += "";
}
else {
html += "
enter your promo code below and press continue
";
html += "";
html += "";
}
$("#str-navigation-title").html("Promo Code");
$("[data-store-section='code']").html(html);
$(".str-section:visible").hide();
$("[data-store-section='code']").show();
$("#str-code").focus();
if (codeInput.length > 0) {
$store.processCode();
}
}
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
},
renderCodeDebug: function (code) {
var html = "";
if (this.debugEventKey) {
html = "
";
html += " " + (code.haveProducts ? "PRODUCTS" : "NO PRODUCTS") + " :: ";
html += " " + (code.skipQuantities ? "SKIP" : "NO SKIP") + " :: ";
html += " " + code.exclusive + " :: ";
html += " " + code.discountCodeAmountType + " :: ";
html += " " + code.applyTo + " :: ";
html += " " + code.applyToType + "";
html += "
";
}
return html;
},
clickCode: function (_code) {
$("#str-code").val(_code);
$store.processCode();
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
productPrice: function (product) {
var different = false;
var symbol = $store._eventInfo.currency.symbol;
var price = product.price;
if (price == undefined) {
$.each(product.variations, function (v, variation) {
if (price != undefined) {
different |= price != variation.price;
}
price = (price == undefined || parseFloat(price) > parseFloat(variation.price) ? variation.price : price);
});
}
return price;
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
processCode: function (_code, _groupid) {
this.renderError();
// ##########################################################################################################################
// ##########################################################################################################################
if (_code) {
var haveGroupCount = false;
var haveProductCounts = false;
var haveProducts = false;
var skipQuantityCheck = false;
console.clear();
console.info("--- processCode :: CODE ----------------------------------------");
console.info(_code);
console.info(_groupid);
$.each($store._eventInfo.codes, function (i, __code) {
if (__code.code == _code) {
var code = JSON.parse(JSON.stringify(__code));
var discountCodes = $store._store.codes();
console.info(discountCodes);
console.info(code);
var isAmount = code.discountCodeAmountType == "AMOUNT";
var isPercentage = code.discountCodeAmountType == "PERCENTAGE";
var isExclusive = code.exclusive == "EXCLUSIVE";
var isEach = code.applyTo == "EACH";
var isCollection = code.applyTo == "COLLECTION";
var isDefault = code.applyToType == "DEFAULT";
var isGroups = code.applyToType == "GROUPS";
haveProducts = code.haveProducts == 1;
console.info(code.haveProducts);
discountCodes[_code] = code;
if (!haveProducts || (isEach && isDefault)) {
console.info("--- SKIP QUANTITY CHECK ---");
skipQuantityCheck = true;
}
else {
if (isExclusive) {
$.each(code.groups, function (g, group) {
if (_groupid == undefined || _groupid == group.eventDiscountCodeGroupId) {
group["count"] = 1;
haveGroupCount = true;
$.each(group.products, function (p, product) {
product["count"] = product.quantity;
haveProductCounts = true;
});
}
else {
delete group["count"];
}
});
}
else {
$.each(code.groups, function (g, group) {
console.info("\t--- GROUP " + g + " -----------------------");
console.info(group);
var groupCount = $("[data-form-item-id='g-" + group.eventDiscountCodeGroupId + "']").html();
if (!isNaN(groupCount)) {
groupCount = parseInt(groupCount);
group["count"] = parseInt(groupCount);
haveGroupCount |= group.count > 0;
}
$.each(group.products, function (p, product) {
console.info("\t\t--- PRODUCT " + product.eventProductId + "-----------------------");
if (haveGroupCount) {
product["count"] = product.quantity;
haveProductCounts = true;
}
else {
var productCount = $("[data-form-item-id='p-" + product.eventProductId + "']").html();
if (!isNaN(productCount)) {
productCount = parseInt(productCount);
if (productCount > 0) {
product["count"] = (product.hasOwnProperty("maxQuantity") && product.maxQuantity < productCount ? product.maxQuantity : productCount);
haveProductCounts = true;
}
}
}
if (product.hasOwnProperty("count") && !group.hasOwnProperty("count")) {
group["count"] = 1;
}
});
});
}
}
$store._store.codes(discountCodes);
}
});
console.info("HAVE GROUPS: " + haveGroupCount + " HAVE PRODUCTS: " + haveProducts + " :: HAVE PRODUCT COUNT: " + haveProductCounts);
if (!haveProducts || (haveProductCounts && haveGroupCount) || skipQuantityCheck) {
$("[data-store-section='code']").html("");
$store.back(haveProducts ? "code" : "code");
}
else {
this.renderError("Make the necessary quantity choices prior to proceeding.");
}
}
// ##########################################################################################################################
// ##########################################################################################################################
else {
console.info("--- processCode :: INPUT ----------------------------------------");
var val = $("#str-code").val().toUpperCase();
var code = null;
$.each($store._eventInfo.codes, function (i, c) {
if (c.code.toUpperCase() == val) {
code = c;
}
});
if (code != null) {
$store.renderCode(code);
return;
}
this.renderError("The promo code you entered is not valid.");
}
// ##########################################################################################################################
// ##########################################################################################################################
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
clearCode: function (code) {
var codes = $store._store.codes();
delete codes[code];
$store._store.codes(codes);
$("[data-store-section='code']").html("");
$store.back("code");
},
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------
renderInfo: function () {
if ($("[data-store-section='info']").length == 0) {
return "";
}
console.info("--- renderInfo ----------------------------------------");
var symbol = $store._eventInfo.currency.symbol;
var accountInfos = this._storage.store("accountInfos");
var infos = this._store.infos();
var html = "
specify information for each ticket below
";
html += "
" + this._form.required() + "
";
$.each(infos, function (ii, info) {
html += "
";
for (var i = 0; i < info.quantity; i++) {
var price = info.price;
var different = false;
var accountInfo = accountInfos[info.eventProductId];
accountInfo = (accountInfo && accountInfo.length > i ? accountInfo = accountInfo[i] : null);
if (info.variations) {
$.each(info.variations, function (v, variation) {
if (variation.price) {
if (price != undefined) {
different |= price != variation.price;
}
else {
price = variation.price;
}
}
});
$.each(info.variations, function (v, variation) {
price = (price == undefined || price > variation.price ? variation.price : price);
});
}
price = (different ? "from " : "") + symbol + price;
html += "
";
if (info.variations) {
var options = null;
var value = (accountInfo && accountInfo["variation"] ? accountInfo["variation"] : "");
$.each(info.variations, function (v, variation) {
options += "";
});
html += "
You should receive a purchase receipt email within the next 5 minutes. If you do not, please check your Spam folder! Mark the email as safe if it landed there so your purchase details are easily accessible in your inbox for the event.
";
/*html += "
If you do not receive an email from us, please email info@bridescan.com for assistance.