13050 - U.S. Marine Dress Uniform, 1859 (2023)

';strHtml += 'Quantity Available:';strHtml += '';jQuery(strHtml).prependTo(this.container.find(".quantity_field_container"));} catch(ex){ecommerce.logException(ex);}};//update quantity available informationAddToCartView.prototype.updateQuantityAvailableInformation = function(display, hasQuantityAvailable, quantityAvailable){try {var $quantityAvailableInfo = jQuery(this.container).find("#quantity_available_info");if (hasQuantityAvailable){$quantityAvailableInfo.addClass("available_quantity");$quantityAvailableInfo.removeClass("no_available_quantity");}else{$quantityAvailableInfo.removeClass("available_quantity");$quantityAvailableInfo.addClass("no_available_quantity");}if (display){$quantityAvailableInfo.show();}else{$quantityAvailableInfo.hide();}$quantityAvailableInfo.find("#quantity_available_number").html(quantityAvailable);} catch(ex){ecommerce.logException(ex);}};AddToCartView.prototype.resetForm = function(){try {jQuery(this.container).find('form[name="add_to_cart_form"]')[0].reset();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.clearAllSelectAttributes = function(){try {// this in needed in browsers that do not support hiding select options with CSS.this.restoreAllAttributeSelectOptions();jQuery(this.container).find('[name="ProductAttributeOptionIDs"]').val("");jQuery(this.container).find('[name="ProductAttributeOptionIDs"]').trigger("change");} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.createClearAllAttributesButton = function(){try {var strHtml = '

';var $clearAllAttributesButton = jQuery(strHtml);this.container.find(".js-attributes-container").prepend($clearAllAttributesButton);return $clearAllAttributesButton;} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.createBottomClearAllAttributesButton = function(){try {var strHtml = '

';var $clearAllAttributesButton = jQuery(strHtml);this.container.find(".js-attributes-container").after($clearAllAttributesButton);return $clearAllAttributesButton;} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.addIsVariantAttributeClass = function(productAttribute){try {if (productAttribute.ISVARIANTATTRIBUTE){return " is-variant-attribute";}return "";} catch(ex){ecommerce.logException(ex);}}//create attribute selection for custom optionsAddToCartView.prototype.createAttributeSelection = function(productAttribute, onChange, openAttributeOptionSelectionWindow, showOptionPreview){try {var isInProductAttributeGrid = productAttribute.ISINPRODUCTATTRIBUTEGRID;var selectedOption = productAttribute.SELECTEDVALUE;strHtml = '

';var $attributeContainer = jQuery(strHtml);var $selectControl = $attributeContainer.find("select");var objAttributeSelectOptions = new AttributeSelectOptions($selectControl);$selectControl.data("AttributeSelectOptions", objAttributeSelectOptions);this.container.find(".js-attributes-container").append($attributeContainer);jQuery(this.container).find("#ProductAttributeOptionID_" + productAttribute.PRODUCTATTRIBUTEID).on("keyup change paste", function(){onChange( productAttribute.PRODUCTATTRIBUTEID, jQuery(this).val() );});jQuery(this.container).find("[data-productattributeid='" + productAttribute.PRODUCTATTRIBUTEID + "'] input[type='radio'].attributeoption").on("keyup click paste", function(e){onChange( productAttribute.PRODUCTATTRIBUTEID, jQuery(this).val() );});jQuery(this.container).find(".open-attribute-selection-window[data-attributeid='" + productAttribute.PRODUCTATTRIBUTEID + "']").on("click", function(){openAttributeOptionSelectionWindow( productAttribute.PRODUCTATTRIBUTEID, jQuery(this).val() );});if (!productAttribute.SHOWTHUMBNAILS && productAttribute.HASIMAGES){jQuery(this.container).find("#ProductAttributeOptionID_" + productAttribute.PRODUCTATTRIBUTEID).on("change", function(){showOptionPreview( productAttribute.PRODUCTATTRIBUTEID, jQuery(this).val() );});}if (productAttribute.SHOWTHUMBNAILS){var v = this;jQuery(this.container).find(".viewMoreAttributeOptions[data-attributeid='" + productAttribute.PRODUCTATTRIBUTEID +"']").click(function(){v.viewMoreAttributeOptions(productAttribute, onChange);return false;});jQuery(this.container).find(".hideMoreAttributeOptions[data-attributeid='" + productAttribute.PRODUCTATTRIBUTEID +"']").click(function(){v.hideMoreAttributeOptions(productAttribute);return false;});this.addAttributeOptionTooltips(productAttribute.PRODUCTATTRIBUTEID, false);if (selectedOption != ''){var strSelector = "[data-productattributeid='" + productAttribute.PRODUCTATTRIBUTEID + "'] input[type='radio'][value='" + selectedOption + "'].attributeoption";if (jQuery(this.container).find(strSelector).length > 0){if( this.customAttributeCount >= 1 ){jQuery(this.container).find(strSelector).attr("checked", "checked").trigger("click");}}else{strHtml = '';//if not loaded yet, use a hidden input field to store value selectedjQuery(this.container).find(".add_to_cart_form").append(strHtml);$hiddenSelectedValue = jQuery(this.container).find('[name="ProductAttributeOptionIDs_' + productAttribute.PRODUCTATTRIBUTEID + '"].hiddenSelectedValue');if( this.customAttributeCount >= 1 ){$hiddenSelectedValue.change( function(){onChange(productAttribute.PRODUCTATTRIBUTEID, selectedOption);});$hiddenSelectedValue.trigger("change");}}}}} catch(ex){ecommerce.logException(ex);}}//product attribute gridAddToCartView.prototype.createAttributeGrid = function(useAttributeGrid, quantityFieldLabel, attribute1, attribute2, onChangeUseAttributeGrid, onChangeAttributeGridQuantities, priceAdjustments){try {var is2D = typeof attribute2 != "undefined";var strHtml = '

';strHtml += '

';strHtml += '';strHtml += '';strHtml += '

';strHtml += '

';this.container.find(".js-attributes-container").append(strHtml);jQuery("#UseAttributeGridField").change(function(){onChangeUseAttributeGrid(jQuery(this).attr("checked") == "checked");});var v = this;jQuery(".quantity-grid-quantity-field").on("change keyup paste", function(){onChangeAttributeGridQuantities(v.getAttributeGridQuantities());});} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.getAttributeGridQuantities = function(){try {var attributeGridQuantities = [];jQuery(".quantity-grid-quantity-field").each(function(){attributeGridQuantities.push({optionX: jQuery(this).closest(".attribute-grid-quantity-container").data("optionxid"),optionY: jQuery(this).closest(".attribute-grid-quantity-container").data("optionyid"),quantity: jQuery(this).val()});});return attributeGridQuantities;} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showAttributeGrid = function(onLoad){try {jQuery(this.container).find(".quantity_field_container").hide();var add_to_cart_form = jQuery(".add_to_cart_form_container").appendTo(".attribute-grid-add-to-cart-container");//hide all the attribute grid attributesjQuery(".product-attribute.attribute-grid-product-attribute").hide();jQuery(".attribute-grid-add-to-cart-container").show();jQuery(".attribute-grid-container").show();if (!onLoad){jQuery('html, body').animate({scrollTop: jQuery(".attribute-grid-add-to-cart-container").offset().top}, 300);}} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideAttributeGrid = function(){try {jQuery(this.container).find(".quantity_field_container").show();var add_to_cart_form = jQuery(".add_to_cart_form_container").appendTo(".add-to-cart-region");//show all the attribute grid attributesjQuery(".product-attribute.attribute-grid-product-attribute").show();jQuery(".attribute-grid-add-to-cart-container").hide();jQuery(".attribute-grid-container").hide();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.renderImageOptionHtml = function(option){try {var width = 30;if (option.IMAGE.length){return '13050 - U.S. Marine Dress Uniform, 1859 (1)';}else{return '13050 - U.S. Marine Dress Uniform, 1859 (2)';}} catch(ex){ecommerce.logException(ex);}};AddToCartView.prototype.markAttributeGridCombinationAsNA = function(optionx, optiony){try {var strSel = ".attribute-grid-quantity-container[data-optionxid='" + optionx + "']";if (typeof optiony != "undefined"){strSel += "[data-optionyid='" + optiony + "']";}var container = jQuery(this.container).find(strSel);container.find(".not-available-combination").show();container.find(".quantity-grid-quantity-field").hide();container.find(".attribute-grid-price-adjustment").hide();} catch(ex){ecommerce.logException(ex);}}//set the quantity field in attribute grid.AddToCartView.prototype.updateAttributeGridQuantityField = function(optionX, optionY , value){try {var strSel = '#Quantity_' + optionX;if (typeof optionY != "undefined"){strSel += '_' + optionY;}var container = jQuery(this.container).find(strSel).val(value);} catch(ex){ecommerce.logException(ex);}}//show error for attribute grid quantityAddToCartView.prototype.showErrorForQuantityGridField = function(optionX, optionY){try {var strSel = '#Quantity_' + optionX;if (typeof optionY != "undefined"){strSel += '_' + optionY;}jQuery(this.container).find(strSel).addClass("erroneous-quantity");} catch(ex){ecommerce.logException(ex);}}//hide error for attribute grid quantityAddToCartView.prototype.hideErrorForQuantityGridField = function(optionX, optionY){try {var strSel = '#Quantity_' + optionX;if (typeof optionY != "undefined"){strSel += '_' + optionY;}jQuery(this.container).find(strSel).removeClass("erroneous-quantity");} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.updateAttributeGridCombination = function(optionx, optiony , priceAdjustment, priceAdjustmentPoints){try {var strSel = ".attribute-grid-quantity-container[data-optionxid='" + optionx + "']";if (typeof optiony != "undefined"){strSel += "[data-optionyid='" + optiony + "']";}var container = jQuery(this.container).find(strSel);container.find(".not-available-combination").hide();container.find(".quantity-grid-quantity-field").show();var strHtml = priceAdjustment;if (priceAdjustmentPoints != ''){strHtml += (priceAdjustment != '' ? "
" : "") + priceAdjustmentPoints;}container.find(".attribute-grid-price-adjustment").html(strHtml);container.find(".attribute-grid-price-adjustment").show();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.renderQuantityField = function(optionX, optionY, priceAdjustment){try {var strFieldName = 'Quantity_' + optionX.PRODUCTATTRIBUTEOPTIONID;if (typeof optionY != "undefined"){strFieldName += '_' + optionY.PRODUCTATTRIBUTEOPTIONID;}var strHtml = '

';strHtml += '

';strHtml += '

';strHtml += '

';strHtml += '';strHtml += '

';strHtml += '

';strHtml += '

';strHtml += '';strHtml += '

' + priceAdjustment + '

';strHtml += '

';strHtml += '

';strHtml += '

(Video) January 2022 Unboxing

';strHtml += '

';return strHtml;} catch(ex){ecommerce.logException(ex);}};//if selecting from the opener window an attribute( like ACHS )AddToCartView.prototype.setAttributeOption = function(intProductAttributeID, intProductAttributeOptionID){try {jQuery(this.container).find("#ProductAttributeOptionID_"+intProductAttributeID).val(intProductAttributeOptionID).change();} catch(ex){ecommerce.logException(ex);}};//change the preview image based on the option selected(when not using swatches)AddToCartView.prototype.showOptionPreview = function(intProductAttributeID, strImage){try {if (strImage != ''){jQuery(this.container).find("#option_preview_"+intProductAttributeID).attr("src", strImage).show();}else{jQuery(this.container).find("#option_preview_"+intProductAttributeID).hide();}} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.resetGridAttribute = function(intProductAttributeID){try {_$attributeControlContainer = jQuery(this.container).find(".attributeSelectionWithImages[data-productattributeid='" + intProductAttributeID + "' ]" );_$attributeControlContainer.find("li[data-optionid]").removeClass( 'not-eligible' );_$attributeControlContainer.find("li[data-optionid]").removeClass( 'not-eligible-and-disabled' );_$attributeControlContainer.find("input[type='radio'].attributeoption:checked").prop('checked', false).trigger("change");_$attributeControlContainer.find("input[type='radio']").prop('disabled', false);$attributeOptionList = _$attributeControlContainer.find( ".attributeOptionList" );$allOptions = $attributeOptionList.find(".attributeoptioncontainer");$allOptions.removeClass("attribute-option-hightlight");_$attributeControlContainer.find( ".attributeCaption[ data-attributeid='" + intProductAttributeID + "' ]" ).html("");} catch(ex){ecommerce.logException(ex);}}//change event for attribute optionAddToCartView.prototype.updateAttributeOptionSelection = function(intProductAttributeID, intProductAttributeOptionID, strCaptionSelected){try {$attributeOptionList = jQuery( ".attributeOptionList[data-productattributeid='" + intProductAttributeID + "' ]" );$allOptions = $attributeOptionList.find(".attributeoptioncontainer");$selectedOption = $allOptions.filter("[ data-optionid='" + intProductAttributeOptionID + "' ]");if( $selectedOption.hasClass("attribute-option-hightlight") ){// unfade all options$attributeOptionList.parents(".attributeSelectionWithImages").removeClass("attribute-option-selected");// uncheck selected option$allOptions.removeClass("attribute-option-hightlight");$selectedOption.removeClass("attribute-option-hightlight");jQuery( ".attributeCaption[ data-attributeid='" + intProductAttributeID + "' ]" ).html( '' );jQuery( ".attributeOptionList[data-productattributeid='" + intProductAttributeID + "' ] [ data-optionid='" + intProductAttributeOptionID + "' ] input" ).prop('checked', false);}else{// fade out all options$attributeOptionList.parents(".attributeSelectionWithImages").addClass("attribute-option-selected");// highlight selected option$allOptions.removeClass("attribute-option-hightlight");$selectedOption.addClass("attribute-option-hightlight");jQuery( ".attributeCaption[ data-attributeid='" + intProductAttributeID + "' ]" ).html( strCaptionSelected );}} catch(ex){ecommerce.logException(ex);}}//common ground, as to what to return to the controller, for the attributes selectedAddToCartView.prototype.getProductAttributeSelectedValues = function(){try {var productAttributes = {};var selector = "select[name='ProductAttributeOptionIDs'], .attribute-type-dropdown-state-country select"+ ", input[type='radio'].attributeoption:checked, .attribute-type-singleline input[type='text'], .attribute-type-date input[type='text']"+ ", .attribute-type-textarea textarea, .product-attribute-file-upload input[type='file']";//map all attribute select dropdowns to their selected valuesif (jQuery("#UseAttributeGridField").length && jQuery("#UseAttributeGridField").attr("checked") == "checked"){jQuery(".attribute-grid-add-to-cart-container").filter(function(){var $attribute = jQuery(this);if ($attribute.hasClass("custom-options-attribute")&& $attribute.hasClass("attribute-grid-product-attribute")){return false;}return true;}).find(selector).each(function(){productAttributes[jQuery(this).data("attributeid")] = jQuery(this).val();});}else{jQuery(this.container).find(selector).each(function(){productAttributes[jQuery(this).data("attributeid")] = jQuery(this).val();});}return productAttributes;} catch(ex){ecommerce.logException(ex);}}//Create attribute option thumbnail, to selectAddToCartView.prototype.createImageAttributeOption = function(productAttributeID, option, lazyLoaded){try {strHtml = '

  • ';var strID = 'Radio_' + productAttributeID + '_' + option.PRODUCTATTRIBUTEOPTIONID;strHtml += '';strHtml += '';strHtml += '
  • ';return strHtml;} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.addAttributeOptionTooltips = function(productAttributeID, lazyLoaded){try {var $attributeOptions = jQuery(this.container).find("#attributeOptionList_" + productAttributeID + " li.js-tooltip" + (lazyLoaded ? ".lazyLoadedOption" : ""));$attributeOptions.each(function(){jQuery(this).tooltipsy({offset: [1, 0],content: "

    13050 - U.S. Marine Dress Uniform, 1859 (5)

    "});});setTimeout(function(){$attributeOptions.each(function(){( new Image() ).src = jQuery(this).data("tooltipimage");});}, 300);jQuery(window).scroll(function(){$attributeOptions.each(function(){jQuery(this).data("tooltipsy").hide();});});} catch(ex){ecommerce.logException(ex);}}//AddToCartView all attribute optionsAddToCartView.prototype.viewMoreAttributeOptions = function(productAttribute, onChange){try {var productAttributeID = productAttribute.PRODUCTATTRIBUTEID;var $attributeOptionList = jQuery(this.container).find("#attributeOptionList_" + productAttributeID);//if the rest of the options need to be rendered then do so.$attributeOptionList.data("expanded", true);if ($attributeOptionList.data("rendered") === false){var numberOfItemsBeforeExpanding = 8;var checkedOption = jQuery(this.container).find("[name='ProductAttributeOptionIDs_" + productAttributeID + "']:checked");var selectedValue = checkedOption.val();//remove hidden selected option since we will now show itjQuery("[name='ProductAttributeOptionIDs_" + productAttributeID + "'].hiddenSelectedValue").remove();var strHtml = "";for (var i = numberOfItemsBeforeExpanding; i < productAttribute.OPTIONS.length; i++){strHtml += this.createImageAttributeOption(productAttributeID, productAttribute.OPTIONS[i], true);}$attributeOptionList.append(strHtml);$attributeOptionList.find(".lazyLoadedOption input[type='radio']").change(function(){onChange(productAttributeID, jQuery(this).val());});if (selectedValue != ""){var strSelector = "[data-productattributeid='" + productAttribute.PRODUCTATTRIBUTEID + "'] input[type='radio'][value='" + selectedValue + "'].attributeoption";jQuery(this.container).find(strSelector).attr("checked", "checked").trigger("change");}jQuery(this.container).find("#attributeOptionList_" + productAttributeID + " .hideUnlessExpanded").hide();this.renderAttributeOptionImagesSlowly(productAttributeID);this.addAttributeOptionTooltips(productAttributeID, true);$attributeOptionList.data("rendered", true);}else{jQuery(this.container).find("#attributeOptionList_" + productAttributeID + " .hideUnlessExpanded").show();jQuery(this.container).find(".hideMoreAttributeOptions[data-attributeid='" + productAttributeID + "']").show();}jQuery(this.container).find(".viewMoreAttributeOptions[data-attributeid='" + productAttributeID + "']").hide();} catch(ex){ecommerce.logException(ex);}}//the purpose of this function, is to disallow showing attribute images before they are loaded//assuming we have a lot of options, with images that take a while to load.AddToCartView.prototype.renderAttributeOptionImagesSlowly = function(productAttributeID){try {jQuery(this.container).find("[data-attributeid='" + productAttributeID + "'].spinner-loader-wrapper").show();if(typeof this.numImagesToWait == "undefined"){this.numImagesToWait = {};}if(typeof numImagesLoaded == "undefined"){this.numImagesLoaded = {};}var numImagesBeforeExpanding = 8;//find out how many images are waiting for loading for this product attributevar v = this;jQuery(document).ready(function(){var attributeLoaderIdentified = "p_" + productAttributeID;v.numImagesToWait[attributeLoaderIdentified] = jQuery(v.container).find("#attributeOptionList_" + productAttributeID + " img.track-loading").length;v.numImagesLoaded[attributeLoaderIdentified] = numImagesBeforeExpanding;if (v.numImagesToWait[attributeLoaderIdentified] == 0){//once the images we are waiting for are loaded//(except for the tooltip ones, lets not wait for those as well).//then hide the overlay and show the images.jQuery(v.container).find("#attributeOptionList_" + productAttributeID + " .hideUnlessExpanded").show();jQuery("[data-attributeID='" + productAttributeID + "'].spinner-loader-wrapper").hide();jQuery(".hideMoreAttributeOptions[data-attributeid='" + productAttributeID + "']").show();}jQuery(v.container).find("#attributeOptionList_" + productAttributeID + " img.track-loading").on("load",function(){//decrement the number of images we are waiting for loading.v.numImagesToWait[attributeLoaderIdentified]--;v.numImagesLoaded[attributeLoaderIdentified]++;if (v.numImagesToWait[attributeLoaderIdentified] == 0){//once the images we are waiting for are loaded//(except for the tooltip ones, lets not wait for those as well).//then hide the overlay and show the images.jQuery(v.container).find("#attributeOptionList_" + productAttributeID + " .hideUnlessExpanded").show();jQuery("[data-attributeID='" + productAttributeID + "'].spinner-loader-wrapper").hide();jQuery(".hideMoreAttributeOptions[data-attributeid='" + productAttributeID + "']").show();}//if a couple of rows managed to load, then show themelse if (v.numImagesLoaded[attributeLoaderIdentified] > numImagesBeforeExpanding&& v.numImagesLoaded[attributeLoaderIdentified] % (v.getAttributeOptionsPerRow() * 2) == 0){var startIndex = 0;var endIndex = v.numImagesLoaded[attributeLoaderIdentified] - v.getAttributeOptionsPerRow();jQuery(v.container).find("#attributeOptionList_" + productAttributeID + " .hideUnlessExpanded").slice(startIndex, endIndex).slideDown();}});});} catch(ex){ecommerce.logException(ex);}}//calculate how many children can fit per row.AddToCartView.prototype.getAttributeOptionsPerRow = function(){try {if(typeof this.childrenPerRow == "undefined"){var oneItemWidth = 0;var containerWidth = 0;//calculate how many attribute option images, can fit in a row, hide the rest.jQuery(this.container).find(".attributeSelectionWithImages ul").each(function(){if (jQuery(this).find("li").length > 1){//show just the first two, in order to be able to make calculations!jQuery(this).find("li:first").show();jQuery(this).find("li:eq(1)").show();firstChild = jQuery(this).find("li")[0];secondChild = jQuery(this).find("li")[1];containerWidth = jQuery(this).width();oneItemWidth = secondChild.offsetLeft - firstChild.offsetLeft;if (oneItemWidth == 0){oneItemWidth = jQuery(this).find("li:first").outerWidth(true);}return false;}});if (oneItemWidth > 0){var childrenPerRow = Math.floor(containerWidth / oneItemWidth);//now that we know how many children can fit, hide the rest.jQuery(this.container).find(".attributeSelectionWithImages ul").each(function(){numberOfRows = 1;numberOfVisibleItems = childrenPerRow * numberOfRows;jQuery(this).children("li").removeClass("hideUnlessExpanded");//add class hide unless expanded, to children under the first rowjQuery(this).children("li:gt(" + (numberOfVisibleItems - 1) + ")").addClass("hideUnlessExpanded");$loadedAttributeOptions = jQuery(this).children("li");$loadedAttributeOptions.show();blnShowExpandToggle = numberOfVisibleItems < jQuery(this).data("totaloptions");if ($loadedAttributeOptions.length < jQuery(this).data("totaloptions")){blnShowExpandToggle = true;}if (blnShowExpandToggle){if (jQuery(this).data("expanded")){jQuery(".viewMoreAttributeOptions[data-attributeid='" + jQuery(this).data("productattributeid") + "']").hide();jQuery(".hideMoreAttributeOptions[data-attributeid='" + jQuery(this).data("productattributeid") + "']").show();} else {//if this was not previously expanded and now it has been resized, hide all the hidden items, and shoe the view more option$loadedAttributeOptions.filter(".hideUnlessExpanded").hide();jQuery(".viewMoreAttributeOptions[data-attributeid='" + jQuery(this).data("productattributeid") + "']").show();jQuery(".hideMoreAttributeOptions[data-attributeid='" + jQuery(this).data("productattributeid") + "']").hide();}} else {//if all options can fit into the collapsed rows, then just hide the viewmore/hide options and just show everythingjQuery(".viewMoreAttributeOptions[data-attributeid='" + jQuery(this).data("productattributeid") + "']").hide();jQuery(".hideMoreAttributeOptions[data-attributeid='" + jQuery(this).data("productattributeid") + "']").hide();}});this.childrenPerRow = childrenPerRow;return childrenPerRow;}else{jQuery(".viewMoreAttributeOptions").hide();jQuery(".hideMoreAttributeOptions").hide();jQuery(".attributeSelectionWithImages ul li").show();}}else{return this.childrenPerRow;}} catch(ex){ecommerce.logException(ex);}}//Collapse attribute optionsAddToCartView.prototype.hideMoreAttributeOptions = function(productAttribute){try {var productAttributeID = productAttribute.PRODUCTATTRIBUTEID;jQuery(this.container).find("#attributeOptionList_" + productAttributeID).data("expanded", false);jQuery(this.container).find("#attributeOptionList_" + productAttributeID + " .hideUnlessExpanded").hide();jQuery(this.container).find(".viewMoreAttributeOptions[data-attributeid='" + productAttributeID + "']").show();jQuery(this.container).find(".hideMoreAttributeOptions[data-attributeid='" + productAttributeID + "']").hide();} catch(ex){ecommerce.logException(ex);}}//create single line text attributeAddToCartView.prototype.createSingleLineTextAttribute = function(productAttribute){try {var strHtml = '

    ';strHtml+= '

    ';strHtml+= '
    ';strHtml+= '';strHtml+= '

    ';this.container.find(".js-attributes-container").append(strHtml);} catch(ex){ecommerce.logException(ex);}}//create state and country dropdownsAddToCartView.prototype.createCountryDropdown = function(productAttribute, countries){try {this.createAttributeDropdown(productAttribute, countries);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.createStateDropdown = function(productAttribute, states){try {this.createAttributeDropdown(productAttribute, states);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.createAttributeDropdown = function(productAttribute, options){try {var strRequiredClass = "";if(productAttribute.ISREQUIRED){strRequiredClass = " attributeSelectionLabelRequired";}var strHtml = '

    'strHtml += '';strHtml += '';strHtml += '

    ';var $attributeContainer = jQuery(strHtml);var $selectControl = $attributeContainer.find("select");var objAttributeSelectOptions = new AttributeSelectOptions($selectControl);$selectControl.data("AttributeSelectOptions", objAttributeSelectOptions);this.container.find(".js-attributes-container").append($attributeContainer);} catch(ex){ecommerce.logException(ex);}}//create text area attributeAddToCartView.prototype.createTextAreaAttribute = function(productAttribute){try {var strRequiredClass = "";if(productAttribute.ISREQUIRED){strRequiredClass = " attributeSelectionLabelRequired";}var strHtml = '

    ';strHtml += '';strHtml += '';strHtml += '

    ';this.container.find(".js-attributes-container").append(strHtml);} catch(ex){ecommerce.logException(ex);}}//create date attributeAddToCartView.prototype.createDateAttribute = function(productAttribute){try {var strRequiredClass = "";if(productAttribute.ISREQUIRED){strRequiredClass = " attributeSelectionLabelRequired";}var strHtml = '

    ';strHtml += '';strHtml += '';strHtml += '

    ';strHtml += "'%name%' must be a valid date, format yyyy-mm-dd.".replace("%name%", productAttribute.Name);strHtml += '

    ';strHtml += '

    ';this.container.find(".js-attributes-container").append(strHtml);this.container.find(".attribute-datepicker").datepicker({dateFormat: 'yy-mm-dd',showOn: "both",buttonImage: "/core/public/shared/assets/images/calendar.gif",buttonImageOnly: true,buttonText: 'Click for Calendar',changeMonth: true,yearRange: "-100:+25",changeYear: true});} catch(ex){ecommerce.logException(ex);}}//create file upload attributeAddToCartView.prototype.createFileUploadAttribute = function(productAttribute){try {var strHtml = '

    ';strHtml += '

    ';strHtml += '';strHtml += '';strHtml += '

    ';strHtml += '

    ';strHtml += 'Accepted Formats: ' + productAttribute.ACCEPTEDFORMATS;strHtml += '

    ';if (productAttribute.SPECIALINSTRUCTIONS != ''){strHtml += '

    ' + productAttribute.SPECIALINSTRUCTIONS + '

    ';}strHtml += '

    ';this.container.find(".js-attributes-container").append(strHtml);} catch(ex){ecommerce.logException(ex);}}//update variant nameAddToCartView.prototype.setVariantName = function(name){try {jQuery(this.container).find("#variant-name").html(name);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.updatePrice = function(prices){try {//update the item pricejQuery(this.container).find(".product-prices").html(prices);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideItemPrice = function(){try {return;} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.getUseRewardPoints = function(){try {return jQuery(this.container).find("input[ name='PurchaseWithPoints' ]:checked").val();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.updateRewardPoints = function(points){try {//update the item pricejQuery(this.container).find(".product-reward-points").html(points);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.updateSKUNumber = function(skunumber){try {// Update SKU NumberjQuery(this.container).find("#sku-number").html(skunumber);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.updateUPC = function(intUPC){try {jQuery(this.container).find(".product-upc").toggle(intUPC.toString().length > 0);jQuery(this.container).find("#upc").html(intUPC);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.updateWeight = function(weight){try {// Update WeightjQuery(this.container).find("#weight").html(weight + ' lbs');} catch(ex){ecommerce.logException(ex);}}//update view based on new price(if we changed to a variant), images etc.AddToCartView.prototype.updatePicturesView = function(productImages){try {blnHasSetupSlider = true;jQuery(".main-slider").removeData("slider");var strImages = "";var intMinToBeConsideredLarge = 500;if (productImages.length > 1){strImages += '

    ';strImages += '

    ';var hasLargeImageDimensions = false;for (var i = 0; i < productImages.length; i++){var productImage = productImages[i];hasLargeImageDimensions = hasLargeImageDimensions || productImage.ColorboxDimensions.split('x')[0] > intMinToBeConsideredLarge;strImages += '

    ';strImages += '

    ';strImages += '13050 - U.S. Marine Dress Uniform, 1859 (6) 0){strImages += 'data-lazy="/media/products/' + productImage.IMAGE + '?dimensions=' + productImage.LargeDimensions + '"';strImages += 'src="/core/public/shared/assets/images/space.gif"';}else{strImages += 'src="/media/products/' + productImage.IMAGE + '?dimensions=' + productImage.LargeDimensions + '"';}strImages += 'alt="' + productImage.IMAGEALTTEXT + '"';strImages += 'title="' + productImage.IMAGEALTTEXT + '"';strImages += 'style="border: 0;"';strImages += 'role="link"';strImages += '/>';strImages += '

    ';strImages += '

    ';}strImages += '

    ';strImages += '

    ';strImages += '

    ';if (hasLargeImageDimensions){strImages += '

    ';strImages += '13050 - U.S. Marine Dress Uniform, 1859 (7) Click Image to Zoom';strImages += '

    ';}strImages += '

    ';for (var i = 0; i < productImages.length; i++){var productImage = productImages[i];strImages += '

    ';strImages += '

    ';strImages += '

    ';strImages += '13050 - U.S. Marine Dress Uniform, 1859 (8) 4 ){strImages += 'data-lazy="/media/products/' + productImage.IMAGE + '?dimensions=' + productImage.ThumbnailDimensions + '"';strImages += 'src="/core/public/shared/assets/images/space.gif"';}else{strImages += 'src="/media/products/' + productImage.IMAGE + '?dimensions=' + productImage.ThumbnailDimensions + '"';}strImages += 'alt="' + productImage.IMAGEALTTEXT + '"';strImages += 'title="' + productImage.IMAGEALTTEXT + '"';strImages += 'style="border: 0;"';strImages += 'role="link"';strImages += '/>';strImages += '

    ';strImages += '

    ';strImages += '

    ';}strImages += '

    ';}else if (productImages.length == 1){var productImage = productImages[0];var imagePath = '/media/products/' + productImage.IMAGE;var hasLargeImageDimensions = productImage.ColorboxDimensions.split('x')[0] > intMinToBeConsideredLarge;strImages += '

    ';strImages += '

    ';strImages += '

    ';strImages += '13050 - U.S. Marine Dress Uniform, 1859 (9)';strImages += '

    ';strImages += '

    ';strImages += '

    ';strImages += '

    ';if (hasLargeImageDimensions){strImages += '

    ';strImages += '13050 - U.S. Marine Dress Uniform, 1859 (10) Click Image to Zoom';strImages += '

    ';}}// Set up the html inside the sliderjQuery(".product-details-slideshow").html(strImages);// Set up the slider in the divthis.renderSlider(); } catch(ex){ecommerce.logException(ex);}}//set subtotal on the view, after calculationsAddToCartView.prototype.setSubtotalRow = function(subtotal, pointsSubtotal, hasPrice, includeRewardPointsSelect, hasRewardPoints){try {var strPrice = subtotal;if (includeRewardPointsSelect){var strPoints = pointsSubtotal;var strHtml = '

    ';strHtml += '

    Subtotal

    ';strHtml += '

    ';strHtml += '

    ';strHtml += '

    ';strHtml += '

    ';strHtml += '

    ';jQuery(this.container).find(".subtotal_row").html(strHtml);}else{var strHtml = '

    Subtotal

    ' + strPrice + ''jQuery(this.container).find(".subtotal_row").html(strHtml);}} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideSubtotalRow = function(){try {jQuery(this.container).find(".subtotal_row").hide();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showSubtotalRow = function(){try {jQuery(this.container).find(".subtotal_row").show();} catch(ex){ecommerce.logException(ex);}}//create add to cart buttonAddToCartView.prototype.createAddToCartButton = function(onClick){try {jQuery('').appendTo(this.container.find(".submit_row")).click(function(){onClick("btn-add-to-cart");});} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.enableAddToCartButton = function(onClick){try {jQuery(this.container).find("#AddToCart").prop("disabled", false);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.disableAddToCartButton = function(onClick){try {jQuery(this.container).find("#AddToCart").prop("disabled", true);} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showAddToCartButton = function(onClick){try {jQuery(this.container).find("#AddToCart").show();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideAddToCartButton = function(onClick){try {jQuery(this.container).find("#AddToCart").hide();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showAddedToCartMessage = function(){try {jQuery(this.container).find(".added-to-cart-message").show();jQuery(this.container).find("#AddToCart").hide();} catch(ex){ecommerce.logException(ex);}}//create wishlist buttonAddToCartView.prototype.createWishlistButton = function(onClick){try {jQuery('').appendTo(this.container.find(".submit_row")).click(function(){onClick("btn-add-to-wishlist");});} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showWishlistButton = function(){try {this.container.find("#AddToWishList").show();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideWishlistButton = function(){try {this.container.find("#AddToWishList").hide();} catch(ex){ecommerce.logException(ex);}}//create view wishlist linkAddToCartView.prototype.createViewWishlistLink = function(){try {var strHtml = '

    ';strHtml += 'View Wishlist';strHtml += '

    'jQuery(strHtml).appendTo(this.container.find(".add_to_cart_form_container"));} catch(ex){ecommerce.logException(ex);}}//create favorites buttonAddToCartView.prototype.createFavoritesButton = function(onClick){try {jQuery('').appendTo(this.container.find(".submit_row")).click(function(){onClick("btn-add-to-favorites");});} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showFavoritesButton = function(){try {this.container.find("#AddToFavorites").show();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideFavoritesButton = function(){try {this.container.find("#AddToFavorites").hide();} catch(ex){ecommerce.logException(ex);}}//create view favorites linkAddToCartView.prototype.createViewFavoritesLink = function(){try {var strHtml = '

    ';strHtml += 'View Favorites';strHtml += '

    'jQuery(strHtml).appendTo(this.container.find(".add_to_cart_form_container"));} catch(ex){ecommerce.logException(ex);}}//create out of stock messageAddToCartView.prototype.createOutOfStockMessage = function() {try {jQuery('Out of stock').appendTo(this.container.find(".submit_row"));} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showOutOfStockMessage = function() {try {jQuery(this.container).find("#OutOfStock").show();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideOutOfStockMessage = function() {try {jQuery(this.container).find("#OutOfStock").hide();} catch(ex){ecommerce.logException(ex);}}//create product availability formAddToCartView.prototype.toggleProductAvailabilityForm = function() {jQuery(this.container).find("#product-availability").toggle();}AddToCartView.prototype.createProductAvailabilityForm = function() {var fullScope = this;var strHtml = '

    ';jQuery(strHtml).appendTo(this.container.find(".submit_row")).on('click', function() {fullScope.toggleProductAvailabilityForm();});var strHtml = '

    ';strHtml += '

    Please enter your details in order to receive email notification once this product is available:

    ';strHtml += '

    ';strHtml += ' ';strHtml += ' ';strHtml += '

    ';strHtml += ' ';strHtml += '

    ';strHtml += '

    ';strHtml += '

    ';jQuery(strHtml).appendTo(this.container.find(".submit_row"));jQuery('#emailAddress').keypress( function( event ) {var keycode = ( event.keyCode ? event.keyCode : event.which );if ( keycode == '13' ) {jQuery('#btn-product-availability-notification').click();event.preventDefault();return false;}});jQuery('#btn-product-availability-notification').on('click', function() {jQuery( '.product-availability-notification-message' ).hide();jQuery( '.product-availability-notification-error' ).hide();jQuery.ajax({url: "/ecommerce/4471/subscribe",type: 'POST',data: {"emailAddress": jQuery("#emailAddress").val()},success: function (data){if( data.SUCCESS ){jQuery( '.product-availability-notification-message' ).html( data.MESSAGE );jQuery( '.product-availability-notification-error' ).hide();jQuery( '.product-availability-notification-message' ).show();} else {jQuery( '.product-availability-notification-error' ).html( data.MESSAGE );jQuery( '.product-availability-notification-error' ).show();jQuery( '.product-availability-notification-message' ).hide();}},error: function (data){jQuery( '.product-availability-notification-error' ).html( data.MESSAGE );jQuery( '.product-availability-notification-error' ).show();jQuery( '.product-availability-notification-message' ).hide();}});});fullScope.toggleProductAvailabilityForm();}AddToCartView.prototype.showProductAvailabilityButton = function() {jQuery(this.container).find("#NotifyWhenAvailable").show();}AddToCartView.prototype.hideProductAvailabilityButton = function() {jQuery(this.container).find("#NotifyWhenAvailable").hide();}//Create availability informationAddToCartView.prototype.createAvailabilityInformation = function(showOnlineAvailability, isAvailableOnline, onlineAvailabilityMessage, showStoreAvailability, isAvailableInStore, storeAvailabilityMessage){try {var strHtml = '';if (showOnlineAvailability){strHtml += '' + onlineAvailabilityMessage + '
    ';}if (showStoreAvailability){strHtml += '' + storeAvailabilityMessage + '
    ';}jQuery(strHtml).appendTo(this.container.find(".availability_box"));} catch(ex){ecommerce.logException(ex);}}//show combination is invalid messageAddToCartView.prototype.showCombinationIsInvalid = function() {try {jQuery(this.container).find(".notavailable_row").show();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.hideCombinationIsInvalid = function() {try {jQuery(this.container).find(".notavailable_row").hide();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.renderSlider = function (intVariantIndex){try {jQuery('.main-slider').on("init", function(event, slick){jQuery(this).find('.main-slide img').animate({opacity: 1});});jQuery('.main-slider').slick({arrows: false,slidesToShow: 1,slidesToScroll: 1,fade: true,draggable: false,infinite: true,lazyLoad: 'ondemand',speed: 100,responsive: [{breakpoint: 720,settings: {draggable: true}}]});jQuery('.carousel-slider').slick({prevArrow: "",nextArrow: "",slidesToShow: 4,slidesToScroll: 4,infinite: true});jQuery('.carousel-slider .mini-slide[data-slick-index="0"]').find(".mini-slide-image-outer-wrapper").addClass('selected');jQuery('.carousel-slider').on("click keypress", ".slick-slide", function(){if (e.type == 'keypress' && e.keyCode != 13){return;}var currentSlide = jQuery(this).data('slick-index');jQuery('.main-slider').slick("slickGoTo", parseInt(currentSlide));jQuery('.carousel-slider .mini-slide-image-outer-wrapper').removeClass('selected');jQuery('.carousel-slider .mini-slide[data-slick-index="' + currentSlide + '"]').find(".mini-slide-image-outer-wrapper").addClass('selected');});setupMagnificPopup();} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.showMessages = function( messages){try {alert(messages.join('\n'));} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.disableNonEligibleOptions = function(aryAllVariantExcludedOptionIDs,arySelectionUpperHierarchyAttributeIDs,intCurrentlyClickedProductAttributeID){try {// Clear all "greyed out"this.container.find( 'li[data-optionid]' ).removeClass( 'not-eligible' );this.container.find( 'li[data-optionid]' ).removeClass( 'not-eligible-and-disabled' );this.container.find( 'li[data-optionid] input' ).removeAttr('disabled');this.container.find( 'select.attributeSelection option' ).removeAttr('disabled');this.container.find( 'select.attributeSelection option' ).removeClass( 'not-eligible' );this.container.find( 'select.attributeSelection option' ).removeClass( 'not-eligible-and-disabled' );// "Grey out" all excluded optionsfor (var i = 0; i < aryAllVariantExcludedOptionIDs.length; i++) {if( !this.container.find( 'li[data-optionid="' + aryAllVariantExcludedOptionIDs[i] + '"]' ).hasClass( 'not-eligible' ) ){// "Grey out" imagesthis.container.find( 'li[data-optionid="' + aryAllVariantExcludedOptionIDs[i] + '"]' ).addClass( 'not-eligible' );this.container.find( 'li[data-optionid="' + aryAllVariantExcludedOptionIDs[i] + '"] input' ).attr('disabled','disabled');}if( !this.container.find( 'select.attributeSelection option[value="' + aryAllVariantExcludedOptionIDs[i] + '"]' ).hasClass( 'not-eligible' ) ){// "Grey out" dropdown optionsthis.container.find( 'select.attributeSelection option[value="' + aryAllVariantExcludedOptionIDs[i] + '"]' ).attr('disabled','disabled');this.container.find( 'select.attributeSelection option[value="' + aryAllVariantExcludedOptionIDs[i] + '"]' ).addClass( 'not-eligible' );}}} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.restoreAllAttributeSelectOptions = function(){try {this.container.find("select.attributeSelection").each(function(){jQuery(this).data("AttributeSelectOptions").reattachAll();})} catch(ex){ecommerce.logException(ex);}}AddToCartView.prototype.detachNotEligibleOptions = function(){try {this.container.find("select.attributeSelection").each(function(){jQuery(this).data("AttributeSelectOptions").detachOptions(".not-eligible-and-disabled");})} catch(ex){ecommerce.logException(ex);}}

    Top Articles
    Latest Posts
    Article information

    Author: Chrissy Homenick

    Last Updated: 12/27/2022

    Views: 5934

    Rating: 4.3 / 5 (74 voted)

    Reviews: 89% of readers found this page helpful

    Author information

    Name: Chrissy Homenick

    Birthday: 2001-10-22

    Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

    Phone: +96619177651654

    Job: Mining Representative

    Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

    Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.