Simple. Fresh, Unique.
...and honestly fun.




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3930.0 ; var selectModifier = "{ID:$.ID, V: $.V.Name}", CMSortDDLValue = '4', UseFilters = CBool(true), IsPaging = CBool('True'), NumProdsPerPage, PageNumber = ''; IsPaging=true; var eProductSort = { SortOrderProductID: 0, SortOrderProductName: 1, SortOrderProductPrice: 2, SortOrderProductPartNo: 3, SortOrderProductDefault: 4, SortOrderProdID: 5 }; var iterations; var eFilterCustomType = { Attribute: "Attribute", Property: "Property", Price: "Price", Brand: "Brand", Category:"Category" }; var _products, _productsFiltered, _modifiersLK, _priceBreaksLK, _productPropertyLK, _productPriceLK, _productFilters, _brandList, _shopID, _categoryID, _dsn; var _ajaxTimeout = 20000; _categoryID = 109;//local=287, remoto =94 var byBrand = []; var byPrice = []; var byAttribute = []; var byProperty = []; var byCategory = []; var FILTER_SAVE_ID = 'filter_88'; var FILTER_SAVE_PAGENUM = 'filter_88_PageNum'; var FILTER_SAVE_SORT_ID = 'filter_sort_88'; var FILTER_SAVE_PAGENUM = 'filter_88_PageNum'; var RESTHost = window.location.protocol + "//" + window.location.host; String.prototype.PadLeft = function PadLeft(length, leadingChar) { if (leadingChar === undefined) leadingChar = "0"; return this.length < length ? (leadingChar + this).PadLeft(length, leadingChar) : this; }; var FilterChanged = false; var filterPriceTimer, priceKeypressTimer; function WebService(metodo, ok, params, type) { var started = new Date(); $.ajax({ type: (type ? type : "POST"), contentType: "application/json; charset=utf-8", dataType: "json", url: RESTHost + metodo, data: JSON.stringify(params), timeout: _ajaxTimeout, success: function (response, textStatus, jqXHR) { var dif = new Date() - started; ok(response, params); } }); } Array.prototype.sortNumber = function sortNumber() { return this.sort(function (a, b) { return a - b; }) } window.addEventListener('load', function () { PageNumber = 1; IsPaging = false NumProdsPerPage = 99999999; if (typeof dataTest === 'undefined') { UseFilters = true; IsPaging = true; LoadProductsWS(_categoryID); PageNumber = 1; } else { FilterCustomInit(dataTest); } }); function FilterCustomInit(data) { _products = data.Products; var maxprodstoshow = _products.length; if (_products.length == 0) { $("#productsResult").attr("class", "").html('

There are currently no products.
Please check back soon.

') } else { _modifiersLK = Enumerable.From(_products).SelectMany("$.Modifiers").Where("$.ID != null").ToLookup("$.Type").ToEnumerable().ToObject("$.Key()", "$.Select('$.ID').Distinct().Select('$').ToArray()") _brandList = ArrayDistinctSortInsensitive(Enumerable.From(_products).Select("$.Product.Brand.Name").Distinct().ToArray()); _productsFiltered = _products; _productFilters = data.Filters; for(var x=0;x<_productFilters.length;x++){ if(_productFilters[x].Type == "Category"){ _productFilters[x] = {"Name":_productFilters[x].Name, Type: "Category", ID:_productFilters[x].Name, "Cats": Enumerable.From(_productFilters[x].CategoryItems).Select(function(x){ return { "N": x.N, "V": x.ID, C:0, S:false} }).ToArray()}; } } _priceBreaksLK = data.PriceBreaks; _productPriceLK = Enumerable.From(_products).Select("$.Product").ToObject("$.ID", "$.Price"); _shopID = data.ShopID; _dsn = 'honestlymargocom'; var _lkPropNames = _productFilters.Where('$.Type=="Property"').ToObject("$.Property.ID", "$.Property.Name"); if(dataTest.PropsAll != null){ _lkPropNames=dataTest.PropsAll.Select('$').ToObject("$.ID", "$.PropertyName"); } for (var i = 0; i < maxprodstoshow; i++) { var p = _products[i].Product;/* if (p.PageID == null) p.PageID = data.DefaultPageID; p.URL = '/' + makeLinkSafe('prod-84-1-' + p.ID + '-88') + '/' + makeLinkSafe(p.Name).toLowerCase() + '.htm';*/ p.PageID = data.DefaultPageID; if (p.URL!=null && p.URL !=""){ p.PageID = p.URL; } p.URL = '/' + makeLinkSafe('prod-' + p.PageID + '-1-' + p.ID + '-88') + '/' + makeLinkSafe(p.Name).toLowerCase() + '.htm'; p.ImageSource = p.Image; p.FinalPrice = p.Price; var pbs = _priceBreaksLK[p.ID]; p.IsSalePrice = false; if(pbs){ var prodPBs=[]; var prevQty = 0; pbs = pbs.OrderBy('$.Quantity').ToArray(); for(var j=0;j j){ //write next pb - 1 prodPBs.push({Q:"1-" + (pbs[j+1].Quantity-1), P:low.Round2Decimals()}); } } else { var nextQty; if (pbs.length-1 == j) { nextQty = pb.Quantity + "+"; } else { nextQty = pb.Quantity + "-" + (pbs[j+1].Quantity-1); } if(j==0 && (pb.Quantity > 1)){ if(pb.Quantity-1 == 1){ prodPBs.push({Q:"1",P:p.Price.Round2Decimals()}); }else{ prodPBs.push({Q:"1-" + (pb.Quantity-1),P:p.Price.Round2Decimals()}); } } prodPBs.push({Q:nextQty,P:low.Round2Decimals()}); } p.FinalPrice = Math.min(p.FinalPrice,low); } p.PBRange=prodPBs; p.PriceBreak = p.FinalPrice; } p.HasPriceBreak = p.Price!=p.FinalPrice; var p = _products[i]; if(p.Properties){ var newProps=[]; for(var x=0;x= 0").ToArray(); for (var i = 0; i < _productFilters.length; i++) { var pf = _productFilters[i]; pf.Display = true; if (pf.Type == "Attribute") { var aFound = false; for (var a = 0; a < pf.Attributes.length; a++) { var at = pf.Attributes[a]; if (_modifiersLK[at.TypeID] != undefined) { var ml = _modifiersLK[at.TypeID]; at.Modifiers = Enumerable.From(at.Modifiers).Join(ml, "$.ID", "$", "outer, inner => outer").Distinct("$.ID").Select("$").ToArray().sort(); at.Display = at.Modifiers.length > 0; aFound = aFound || at.Modifiers.length > 0;//if at least one have modifiers then show this filter } } pf.Display = aFound; } if (pf.Type == eFilterCustomType.Property) { if (pf.Property.IsList) { debugger } else { pf.Display = (_productPropertyLK[pf.Property.ID] != undefined) && _productPropertyLK[pf.Property.ID].length>1; if(pf.Display){ for (var pi = 0; pi < _products.length; pi++) { var prod = _products[pi].Product; var b=false; var props = _products[pi].Properties; for (var p=0;p < props.length;p++){ var prop = props[p]; if(prop.ID.toString() == pf.Property.ID.toString()){ b=true; break; } } if(!b){ props.push({ID:pf.Property.ID, V:""}); } } } } } if (pf.Type == eFilterCustomType.Brand) { pf.Brands = Enumerable.From(_brandList).Select("{V:$}").ToArray(); } if (pf.Type == eFilterCustomType.Category) { pf.Display = Enumerable.From(pf.Cats).Where("$.V!='88'").Count()>0; } if (pf.Type == eFilterCustomType.Price) { var values = Enumerable.From(_products).Select("isNaN(parseFloat($.Product.FinalPrice))?0:parseFloat($.Product.FinalPrice)").Distinct().ToArray().sort(SortArrayNumber); if (values.length > 1) {} else { pf.Display = false; } } } _productFilters.Paging = 999999; PageNumber = 1; _productFilters.PageCurrent = PageNumber; DoFilter(); } } function SortArrayNumber(a, b) { return a - b; } function LoadProductsWS(catid) { WebService("/723/products/GetByCategory?catID=" + catid, function (data) { dataTest = data; FilterCustomInit(dataTest); }, {}, "GET"); } function ArrayDistinctSortInsensitive(ary) { var res = []; for (var i = 0; i < ary.length; i++) { var bFound = false; for (var x = 0; x < res.length; x++) { if (res[x].toLowerCase() == ary[i].toLowerCase()) { bFound = true; break; } } if (!bFound) res.push(ary[i]); } return res.sort(function (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); }); } var ini = new Date().getTime(); var elapsed = 0; function CountModifierInProds(prodList, modifierID) { var mIdsMatch = []; var bFoundProduct = false; for (var p=0; p= min); } if (!isNaN(max) && max != "") { b = b && (value <= max); } return b; } Number.prototype.Round2Decimals = function () { return parseFloat(Math.round(this * 100) / 100).toFixed(2); }; function makeLinkSafe(sVal) { sVal = sVal.replace(/[\s|\/]/g, '-'); return sVal.replace(/[^a-z0-9\-\_\|]/gi, ''); } function CBool(value) { return (value.toString().toLowerCase() == "true" || value == true); } function setFeaturedHeight() { setTimeout(function () { $('.featured-best-sellers-container.featured-products .featured-img').each(function () { $(this).css('max-height', $(this).width()); $(this).css('height', '100%'); $(this).css('height', $(this).width()); }); var featProdHeight = $('.featured-best-sellers-container.featured-products .featured-item .featured-img').height(), prevArrow = $('.featured-best-sellers-container.featured-products .slick-prev'), nextArrow = $('.featured-best-sellers-container.featured-products .slick-next'); prevArrow.css('top', (featProdHeight - prevArrow.height()) / 2 + "px"); nextArrow.css('top', (featProdHeight - nextArrow.height()) / 2 + "px"); }, 300) } $(document).ready(function() { setFeaturedHeight(); }); window.addEventListener("resize", function() { setFeaturedHeight(); }, false);
We're one of the Oprah - Approved Beauty Favorites!