//resources app.siteDefaultLocale = "en-US"; app.siteBrandID = "DC"; app.resources.MISSINGCHK = "Please tick the box above before validating your order."; app.resources.MISSINGVAL = "Please Enter {0}"; app.resources.MISSINGCITY = "Please enter your city"; app.resources.SERVER_ERROR = "Server connection failed!"; app.resources.MISSING_LIB = "jQuery is undefined."; app.resources.BAD_RESPONSE = "Bad response, Parser error"; app.resources.INVALID_ADDRESS = "The address is not correct"; app.resources.INVALID_PHONE = "Please specify a valid phone number."; app.resources.INVALID_EMAIL = "Please enter a valid email address.", app.resources.EMAIL_WARNING = "The email was not found and/or could not be checked.", app.resources.INVALID_CPF = "forms.address.CPF.field.invalid"; app.resources.INVALID_CITY = "City not recognized", app.resources.DOB_INCOMPLETE = "The date of birth is incomplete."; app.resources.DOB_AGE_ERROR = "Sorry, you need to be at least 13 years old to continue."; app.resources.EQUALTO = "Please enter the same value again.", app.resources.EQUALTOEMAIL = "Please confirm email address", app.resources.INVALID_EMAILLIST = "The following email addresses are not correct:"; app.resources.REMOVE = "Remove"; app.resources.CLOSE = "Close"; app.resources.NEXT = "global.next"; app.resources.PREV = "Previous"; app.resources.QTY = "Qty"; app.resources.PLEASE_SELECT = "- please select -"; app.resources.MISSING_CREDIT_CARD_DATA = "Please fill all required credit card data."; app.resources.CLICK_TO_EDIT = "click to edit"; app.resources.SUBMIT = "Submit"; app.resources.WRONG_DATE_FORMAT = "Please enter a date in the format mm/dd/yy"; app.resources.PRINT_NOW = "print now"; // Countrys app.resources.countrysSelector = {}; app.resources.countrysSelector.regionAmericas = "Americas"; app.resources.countrysSelector.regionApac = "APAC / ASIA"; app.resources.countrysSelector.regionEurope = "Europe"; app.resources.countrysSelector.regionAfrica = "Africa"; app.resources.countrysSelector.europe = "Europe"; app.resources.countrysSelector.international = "International"; // Other State select option app.resources.otherStateOptionName = "Other"; app.resources.otherStateOptionValue = "OTHER"; // Date Picker localisation app.resources.dates = {}; app.resources.dates['TODAY'] = "Today"; app.resources.dates['WEEKHEADER'] = "CW"; app.resources.dates['DATE_FORMAT'] = "mm/dd/yy"; app.resources.dates['MONTH'] = [ "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" ]; app.resources.dates['MONTH_SHORT'] = [ "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ]; app.resources.dates['DAY_NAMES'] = [ "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" ]; app.resources.dates['DAY_NAMES_SHORT'] = [ "Sun" , "Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" ]; app.resources.dates['DAY_NAMES_MIN'] = [ "S" , "M" , "T" , "W" , "Th" , "F" , "S" ]; // product availability messages app.resources["IN_STOCK"] = "In Stock"; app.resources["QTY_IN_STOCK"] = "{0} Item(s) In Stock"; app.resources["PREORDER"] = "Pre-Order"; app.resources["QTY_PREORDER"] = "{0} item(s) are available for pre-order."; app.resources["REMAIN_PREORDER"] = "The remaining items are available for pre-order."; app.resources["BACKORDER"] = "Back Order"; app.resources["QTY_BACKORDER"] = "Back Order {0} item(s)"; app.resources["REMAIN_BACKORDER"] = "The remaining items are available on back order."; app.resources["NOT_AVAILABLE"] = "Not available."; app.resources["REMAIN_NOT_AVAILABLE"] = "The remaining items are currently not available. Please adjust the quantity."; app.resources["IN_STOCK_DATE"] = "The expected in-stock date is {0}."; app.resources["NON_SELECTED"] = "Not Selected"; app.resources["MISSING_VAL"] = "Select {0}"; app.resources["SIZECHART_TITLE"] = "Size Chart"; app.resources["SEND_TO_FRIEND"] = "Send to a Friend"; app.resources["MISSING_VAL"] = "Select {0}"; //shipping resources app.resources["SHIP_STATE_LABEL"] ="State"; app.resources["SHIP_PROVINCE_LABEL"] ="State"; app.resources["SHIP_QualifiesFor"] = "This shipment qualifies for"; app.resources["STOREPICKUP"] = "Select pickup location"; app.resources["STOREPICKUP_POSTCODE"] = "Postcode value is required."; app.resources["STOREPICKUP_NO_GEO_MATCH"] = "Your current location seems to be outside of our shipping area. Please type an address to search directly."; app.resources["STOREPICKUP_GEO_TOOLTIP"] = "Click to use your current location."; app.resources["STOREPICKUP_EMPTY_RESULT"] = "No results found"; app.resources["STOREPICKUP_SERVICE_ERROR"] = "This service is temporarily unavailable. Please try again or choose a different delivery method."; app.resources["STOREPICKUP_ADDRESS_NOT_SHIPPABLE"] = "We do not deliver this location. Please provide a different shipping address or refer to our shipping section or customer service staff."; app.resources["SHIP_TO_COUNTRY_POST_LABEL"] = "(shipping to)"; //shipping resources app.resources["BILL_GC"] = "GIFT_CERTIFICATE"; //billing resources app.resources["CREDIT_CARD_TYPE"] = "dwfrm_billing_paymentMethods_creditCard_type"; // bonus products messages app.resources["BONUS_PRODUCTS"] = "Bonus Product(s)"; app.resources["SELECT_BONUS_PRODUCT"] = "Select or Update"; app.resources["BONUS_PRODUCT_MAX"] = "The maximum number of bonus products have been selected. Please remove one in order to add additional bonus products."; app.resources["SIMPLE_SEARCH"] = "Enter Keyword or Item #"; // Gift Cert resources app.resources["REG_ADDR_ERROR"] = "Couldn't Load Address"; app.resources["GIFTCARD_CAN_NOT_BE_VALIDATED"] = "We're sorry, but the gift card number you entered is not correct."; app.resources.loyalty = {}; app.resources.loyalty.notifyTCChange = "false"; app.resources.loyalty.getCustomerAcceptationUrl = "/on/demandware.store/Sites-DC-US-Site/en_US/Account-LoyaltyGetTcAcceptationValue"; app.resources.loyalty.setCustomerAcceptationUrl = "/on/demandware.store/Sites-DC-US-Site/en_US/Account-LoyaltySetTcAcceptationValue"; app.resources.loyalty.getTcAcceptationPop = "/on/demandware.store/Sites-DC-US-Site/en_US/Account-LoyaltyGetTcAcceptationPopup"; app.resources.loyalty.saveCustomerEmailUrl = "/on/demandware.store/Sites-DC-US-Site/en_US/Account-LoyaltySaveCustomerEmail"; //Store pickup page app.resources.storepickup = {}; app.resources.storepickup.storesicon = "https://www.dcshoes.com/on/demandware.static/Sites-DC-US-Site/-/default/dwa0b16e66/images/icons/pushpin.png"; app.resources.storepickup.selectlabel = "Select"; app.resources.storepickup.storeicons_url = "/on/demandware.static/-/Sites-DC-US-Library/en_US/v1591394494561/REPLACEME"; app.resources.storepickup.storeicons_config = null; // as JSON String app.resources.storepickup.deliveryTimeText1 = "checkout.pickstore.deliveryTimeText1"; app.resources.storepickup.deliveryTimeText2 = "checkout.pickstore.deliveryTimeText2"; app.resources.storepickup.noresultstitle = "No Results Found"; app.resources.storepickup.emptysearchfieldmsg = "checkout.pickstore.emptysearchfieldmsg"; //Store locator page app.resources.storelocator = {}; app.resources.storelocator.dwClientID = "13d00e86-f1e5-4c51-abf5-af0c25ebf069"; app.resources.storelocator.sendlabel = "Send address via"; app.resources.storelocator.emaillink = "Email"; app.resources.storelocator.viewstorehours = "View Store Hours"; app.resources.storelocator.phonelabel = "Tel:"; app.resources.storelocator.dayrange = "From Monday to Sunday"; app.resources.storelocator.monday = "Monday"; app.resources.storelocator.tuesday = "Tuesday"; app.resources.storelocator.wednesday = "Wednesday"; app.resources.storelocator.thursday = "Thursday"; app.resources.storelocator.friday = "Friday"; app.resources.storelocator.saturday = "Saturday"; app.resources.storelocator.sunday = "Sunday"; app.resources.storelocator.hoursrange = "from %OPEN% to %CLOSE%"; app.resources.storelocator.storesicon = "/on/demandware.static/Sites-DC-US-Site/-/default/dw39627f9b/images/icons/stores-icon.png"; app.resources.storelocator.outletsicon = "/on/demandware.static/Sites-DC-US-Site/-/default/dw72440daa/images/icons/outlets-icon.png"; app.resources.storelocator.boardridersclubicon = "/on/demandware.static/Sites-DC-US-Site/-/en_US/v1591394494561/images/icons/boardridersclub-icon.png"; app.resources.storelocator.dealersicon = "/on/demandware.static/Sites-DC-US-Site/-/default/dwe0c2eac3/images/icons/authorized-dealers-icon.png"; app.resources.storelocator.providerURL = "https://dev.virtualearth.net/REST/v1/Locations?query="; app.resources.storelocator.providerKey = "Ait6vo6o9O126kS5OYoHkOclWg3-DY4ifecpLP3b3r49sPbXI-RoLy2fAdvP7vg_"; app.resources.storelocator.defaultLocations = '{"US":{"latitude":33.740053530431425,"longitude":-118.03146985054013},"FR":{"latitude":46.227638,"longitude":2.213749000000007},"DE":{"latitude":51.165691,"longitude":10.451526},"CH":{"latitude":46.818188,"longitude":8.227511999999933},"DK":{"latitude":56.26392,"longitude":9.50178500000004},"GB":{"latitude":55.378051,"longitude":-3.43597299999999},"RU":{"latitude":61.52401,"longitude":105.31875600000001},"ES":{"latitude":40.46366700000001,"longitude":-3.7492200000000366},"IE":{"latitude":53.41291,"longitude":-8.243889999999965},"IT":{"latitude":41.87194,"longitude":12.56738},"NL":{"latitude":52.132633,"longitude":5.2912659999999505},"BE":{"latitude":50.503887,"longitude":4.4699359999999615},"LU":{"latitude":49.815273,"longitude":6.129583000000025},"PT":{"latitude":39.39987199999999,"longitude":-8.224454000000037},"FI":{"latitude":61.92410999999999,"longitude":25.748151000000007},"BR":{"latitude":-23.5261522,"longitude":-46.6451321}}'; app.resources.storelocator.closeByCountry = 'null'; app.resources.storelocator.storeLocatorFilterOnline = "false"; app.resources.storelocator.noresultstitle = "No Results Found"; app.resources.storelocator.noresultsfound = "No locations were found using your search criteria"; app.resources.storelocator.noresultshelp = "Please ensure that you entered a city and state/province"; // Product tile app.resources.COLOR = "Color"; app.resources.COLORS = "Colors"; app.resources["GIFT_CERT_BALANCE"] = "/on/demandware.store/Sites-DC-US-Site/en_US/GiftCert-CheckBalance"; app.resources["GIFT_CERT_CUR_BALANCE"] = "Your current gift certificate balance is"; app.resources["GIFT_CERT_MISSINGCODE"] = "Please enter Gift Certificate Code"; app.resources["GIFT_CERT_INVALIDCODE"] = "Please check Gift Certificate Code"; app.resources["GIFT_CERT_ERROR"] = "Please enter the correct information"; app.resources["GIFT_BALANCE_ERROR_CODE"] = "Please enter a gift certificate code"; app.resources["GIFT_BALANCE_ERROR_PIN"] = "Please enter a pin code"; app.resources["GIFT_BALANCE_ERROR_DIGIT"] = "Pin code must be 4 digits"; app.resources["WISHLIST_PROGRESS_IMAGE"] = "/on/demandware.static/Sites-DC-US-Site/-/default/dwb1015b2c/images/loading-progress-98x22.gif"; // PDP app.resources["SAVED_FOR_LATER"] = "Saved in your wishlist"; app.resources["SAVE_FOR_LATER"] = "Save"; // Cart Wishlist app.resources["ADD_TO_WISHLIST"] = "Add to Wishlist"; app.resources["VIEW_IN_WISHLIST"] = "View In Favorites"; app.resources.verticalVideoLocation = "//vod.boardriders.com/DC/vertical-pdp/"; app.resources["PHONE_VALIDATION"] = {"US":{"mask":"(999) 999-9999","placeholder":"(___) ___-____","regex":"^(\\+0?1\\s)?\\(?\\d{3}\\)?[\\s.-]\\d{3}[\\s.-]\\d{4}$|^[a-zA-Z0-9]{7,20}$"},"CA":{"mask":"(999) 999-9999","placeholder":"(___) ___-____","regex":"^(\\+0?1\\s)?\\(?\\d{3}\\)?[\\s.-]\\d{3}[\\s.-]\\d{4}$|^[a-zA-Z0-9]{7,20}$"},"BR":{"mask":"(99)99999-9999","multiMask":["(00)00000-0000","(00)0000-00009"],"placeholder":"(__)____-____","regex":"^([0-9]{2})?(\\([0-9]{2}\\))([0-9]{4}|[0-9]{5})-[0-9]{4}$"},"NL":{"regex":"^[\\+]*([\\-0-9][ ]*){7,15}$"},"default":{"regex":"^[\\+]*([\\-0-9][ ]*){7,20}$"}}; app.resources["ZIP_MASK"] = ""; app.resources["ZIP_PLACEHOLDER"] = "0"; app.resources["CPF_MASK"] = "0"; app.resources["CPF_PLACEHOLDER"] = "0"; app.resources["GIFT_CARD_LIMIT"] = "Oops! Please enter a gift card value between $25 and $500."; app.resources["GIFT_CARD_SELECT"] = "Select or indicate amount."; app.resources["MONEY"] = "$0.00"; app.resources["CITY_VALIDATION"] = '^[^0-9]+$'; //The follow snippet is executed to pass some Demandare URLs into the script app.minicart.url = "/on/demandware.store/Sites-DC-US-Site/en_US/Cart-MiniAddProduct"; app.URLs.addProductToCart = "/on/demandware.store/Sites-DC-US-Site/en_US/Cart-AddProduct"; app.URLs.updateLineItem = "/on/demandware.store/Sites-DC-US-Site/en_US/Cart-UpdateLineItem"; app.URLs.wishlistAddress = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Wishlist-SetShippingAddress?AddressID="; app.URLs.viewWishlist = "/on/demandware.store/Sites-DC-US-Site/en_US/Wishlist-Show"; app.URLs.addProductToWishlist = "/on/demandware.store/Sites-DC-US-Site/en_US/Wishlist-Add"; app.URLs.removeProductFromWishlist = "/on/demandware.store/Sites-DC-US-Site/en_US/Wishlist-Remove"; app.URLs.SetShippingContext = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Hooking-SetShippingContext"; app.URLs.SetLocalization = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Geolocation-SetLocalization"; // S.E.O links scripting app.URLs.userLogin = "https://www.dcshoes.com/account/"; app.URLs.userRegister = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Account-StartRegister"; app.URLs.renderForm = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Addresses-RenderForm"; app.URLs.sizeChartShow = "/on/demandware.store/Sites-DC-US-Site/en_US/SizeChart-Show"; app.URLs.accountShow = "https://www.dcshoes.com/account/"; app.URLs.contactUs = "/customer-service/contact-us/"; app.URLs.logOut = "https://www.dcshoes.com/account/logout/"; app.URLs.getShippingMethodsList = "/on/demandware.store/Sites-DC-US-Site/en_US/COShipping-UpdateShippingMethodList"; app.URLs.updateOrderTotals = "/on/demandware.store/Sites-DC-US-Site/en_US/COBilling-UpdateOrderTotals"; app.URLs.storeBillingAddress = "/on/demandware.store/Sites-DC-US-Site/en_US/COShipping-StoreUnsavedBillingAddress"; app.URLs.getProductDetail = "/on/demandware.store/Sites-DC-US-Site/en_US/Product-Detail"; app.URLs.getProductUrl = "/on/demandware.store/Sites-DC-US-Site/en_US/Product-Show"; app.URLs.searchUrl = "/search/"; app.URLs.getVariants = "/on/demandware.store/Sites-DC-US-Site/en_US/Product-GetVariants"; app.URLs.getAvailability = "/on/demandware.store/Sites-DC-US-Site/en_US/Product-GetAvailability"; app.URLs.loadingSmallImg = "/on/demandware.static/Sites-DC-US-Site/-/default/dw5491f2fa/images/loading-small.gif"; app.URLs.formatMoney = "/on/demandware.store/Sites-DC-US-Site/en_US/Product-FormatPrices"; app.URLs.removeImg = "/on/demandware.static/Sites-DC-US-Site/-/default/dwffed2735/images/icon_remove.gif"; app.URLs.searchsuggest = "/on/demandware.store/Sites-DC-US-Site/en_US/Search-GetSuggestions"; app.URLs.searchnavigation = "/on/demandware.store/Sites-DC-US-Site/en_US/Search-IncludeLeftNavigation"; app.URLs.submitDialogURL = 'https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Page-AppResources'; app.URLs.productNav = "/on/demandware.store/Sites-DC-US-Site/en_US/Product-Productnav"; app.URLs.SeverConnectionError = "Server connection failed!"; app.URLs.quickview_product_url = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Proxy-Product2JSON"; app.URLs.PIConfirmDelete = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/PaymentInstruments-ConfirmDelete"; app.URLs.addressConfirmDelete = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/Address-ConfirmDelete"; app.URLs.pageInclude = "/on/demandware.store/Sites-DC-US-Site/en_US/Page-Include"; app.URLs.findInStoreTemplate = "/on/demandware.store/Sites-DC-US-Site/en_US/FindInStore-Show"; app.URLs.findInStoreSearch = "/on/demandware.store/Sites-DC-US-Site/en_US/FindInStore-ProductSearch"; app.URLs.findInStoreLineItems = "/on/demandware.store/Sites-DC-US-Site/en_US/FindInStore-DisplayStores"; app.URLs.cartShow = "https://www.dcshoes.com/cart/"; app.resources["NO_STORES_FOUND"] = "Sorry, but there were no stores found in this area with inventory in stock. Please try using the search box above to search in other areas."; app.resources["phone_input_no_results_text"] = "No results found"; app.resources.getOtherRegionWebsiteJSON = "/on/demandware.store/Sites-DC-US-Site/en_US/Home-GetOtherRegionsWebsiteJSON"; // DQE - Preferences app.DqeProxyUrl = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/DQE-Proxy"; app.DqeEmailCheckEnabled = false; app.DqePhoneCheckEnabled = false; app.DqeAddressCheckEnabled = false; app.DqeClientRNVPCheckEnabled = false; app.DqeEmailAutocheck = false; app.DqeEmailSuggest = false; app.DqePhoneAutocheck = false; app.DqePhoneNumberFormat = 2; app.DqeCitySearch = 0; app.DqeSearchDelay = 500; app.DqeSingleSearchDelay = 1000; app.DqeZipPatterns = null; // form validation zip patterns app.FormValidationZipPatterns = { "AT": "^\\d{4}$", "BE": "^\\d{4}$", "BR": "^\\d{5}([\\-]?)(\\d{3})$", "CA": "^[AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\\d[AaBbCcEeGgHhJ-Nj-nPpRrSsTtV-Zv-z][ ]?\\d[AaBbCcEeGgHhJ-Nj-nPpRrSsTtV-Zv-z]\\d$", "CH": "^\\d{4}$", "DE": "^\\d{5}$", "DK": "^\\d{4}$", "ES": "^\\d{5}$", "FI": "^\\d{5}$", "FR": "^\\d{5}$", "GB": "^[A-Pa-pR-Ur-uWYZwyz](([A-Ha-hK-Yk-y]?\\d\\d?)|(\\d[A-Ha-hJKPSTUWjkpstuw])|([A-Ha-hK-Yk-y]\\d[ABEHMNPRabehmnprV-Yv-y]))\\s?\\d[ABabD-Hd-hJLNjlnP-Up-uW-Zw-z]{2}$", "IT": "^\\d{5}$", "LU": "^\\d{4}$", "NL": "^\\d{4}[ ][A-Z]{2}$", "PT": "^\\d{4}([\\-]\\d{3})?$", "US": "^((\\d{5}[ -]{1,1}\\d{4})|(\\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\\d[A-Za-z]\\s?\\d[A-Za-z]\\d))$" }; //Geolocation references app.globalRedirectURL = "http://global.dcshoes.com"; // translations for ARIA attributes app.resources.aria = {}; app.resources.aria.closesearch = "Close Search"; // Abandonned cart preferences app.resources.abandonedCart = { enabled : false, provider : "None", storeEmailUrl : "/on/demandware.store/Sites-DC-US-Site/en_US/AbandonedCart-StoreEmail", storeNpkUrl : "/on/demandware.store/Sites-DC-US-Site/en_US/AbandonedCart-StoreNpk" }; // Country Context Preferences // switched on or off via site preference > general > Site Configuration app.resources.categoryContext = { enabled: false, setCategoryContextUrl: "/on/demandware.store/Sites-DC-US-Site/en_US/CategoryContext-Set", cookieName: "brCategoryContext", contextUrls: {"fit-guide":"/fit-guide/","size-chart":"/size-chart/","men":"/mens/","women":"/womens/","kids":"/kids/","skate":"/skate/","snow":"/snow/","sales":"/sale/","good-deals":"/private-sale/","special-offer":"/deals-of-the-week/","gift-card":"/gift-card/","alt1":"/alt1/"} }; // Tracking app.resources.tracking = { OmnitureTrackingServer : "null" }; // translation of jQuery validate (function ($) { $.extend($.validator.messages, { required : "This field is required.", remote : "Please fix this field.", email : "Please enter a valid email address.", url : "Please enter a valid URL.", cpf : "forms.address.CPF.field.invalid", date : "Please enter a valid date.", dateISO : "Please enter a valid date (ISO).", number : "Please enter a valid number.", digits : "Please enter only digits.", creditcard : "Please enter a valid credit card number.", equalTo : "Please enter the same value again.", equalToIgnoreCase : "Please enter the same value again.", maxlength : $.validator.format("Please enter no more than {0} characters."), minlength : $.validator.format("Please enter at least {0} characters."), rangelength : $.validator.format("Please enter a value between {0} and {1} characters long."), range : $.validator.format("Please enter a value between {0} and {1}."), max : $.validator.format("Please enter a value less than or equal to {0}."), min : $.validator.format("Please enter a value greater than or equal to {0}."), emailConfirmIgnoreCase : "Please confirm email address.", validateCountryState : "Please select a state associated with the selected country.", regex : "Your input appears to be in the wrong format.", zip : { DE : "Bitte gib deine Postleitzahl mit 5 Ziffern an", US : "Please provide your zip code in the format: XXXXX or XXXXX-XXXX (digits only).", FR : "Please provide your postal code with 5 digits.", CA : "Please provide your postal code in a format like J8R 2A5.", GB : "Please provide your postal code in a format like YO31 1EB.", NL : "Please provide your postal code in a format like 1114 AA.", PT : "Please provide your postal code in a format like 1114-185.", IE : "Please provide your postal code in a format like D02 AF30.", BR : "global.zip.validation.hint.format", ES : "Your entered postal code does not match with a city in our database.", IT : "Your entered postal code does not match with a city in our database.", AT : "Your entered postal code does not match with a city in our database.", BE : "Your entered postal code does not match with a city in our database.", CH : "Your entered postal code does not match with a city in our database.", DK : "Your entered postal code does not match with a city in our database.", FI : "Your entered postal code does not match with a city in our database.", LU : "Your entered postal code does not match with a city in our database." } }); $.validator.customOptions = { showRequiredMessages : true }; // Pre init // initialize the category context feature, if enabled if (app.resources.categoryContext.enabled) { app.processPageContext(); // we check if we have a cookie var oldCookieJson = $.cookie.json; $.cookie.json = false; var categoryContextCookie = $.cookie(app.resources.categoryContext.cookieName); $.cookie.json = oldCookieJson; var currentCategoryContext = app.PageContext.firstLevelCategoryId; // we check if we are on a certain category page // do we need to override the cookie with a new value? if (currentCategoryContext && currentCategoryContext !== categoryContextCookie) { categoryContextCookie = currentCategoryContext; $.get(app.resources.categoryContext.setCategoryContextUrl + '?categoryContext=' + encodeURIComponent(categoryContextCookie)); } // add the class, if we have a value if (categoryContextCookie) { $('body').addClass('category-context-' + categoryContextCookie); } } }(jQuery)); (function() { // address verification URLs app.URLs.checkAVS = "https://www.dcshoes.com/on/demandware.store/Sites-DC-US-Site/en_US/HookAvalara-ValidateAddress"; var shippingAddressPrefix = "shippingAddress_addressFields"; var checkoutForm = $("form[name$='_singleshipping']"); function updateForm(radioButton) { if (radioButton && radioButton.length) { var addressPrefix = shippingAddressPrefix, miscBillingDetails = { 'salutation': checkoutForm.find("select[id$='" + addressPrefix + "_salutation']").val(), 'firstName': $.trim(checkoutForm.find("input[id$='" + addressPrefix + "_firstName']").val()), 'lastName': $.trim(checkoutForm.find("input[id$='" + addressPrefix + "_lastName']").val()), 'phone': $.trim(checkoutForm.find("input[id$='" + addressPrefix + "_phone']").val()) }; //Populate the form fields based on the suggested address checkoutForm.find("select[id$='" + addressPrefix + "_salutation']").val(miscBillingDetails.salutation); checkoutForm.find("input[id$='" + addressPrefix + "_firstName']").val(miscBillingDetails.firstName); checkoutForm.find("input[id$='" + addressPrefix + "_lastName']").val(miscBillingDetails.lastName); checkoutForm.find("input[id$='" + addressPrefix + "_phone']").val(miscBillingDetails.phone); checkoutForm.find("input[id$='" + addressPrefix + "_address1']").val(radioButton.data("suggestion-address1")); checkoutForm.find("input[id$='" + addressPrefix + "_address2']").val(radioButton.data("suggestion-address2")); checkoutForm.find("input[id$='" + addressPrefix + "_city']").val(radioButton.data("suggestion-city")); checkoutForm.find("select[id$='" + addressPrefix + "_stateCode']").val(radioButton.data("suggestion-state")); checkoutForm.find("input[id$='" + addressPrefix + "_zip']").val(radioButton.attr("data-suggestion-zip")); checkoutForm.find("select[id$='" + addressPrefix + "_countryCode']").val(radioButton.data("suggestion-country")); checkoutForm.find("input[id$='" + addressPrefix + "_avsResult']").val(radioButton.data("suggestion-avs_result")); checkoutForm.find("input[id$='" + addressPrefix + "_addressHash']").val(radioButton.data("suggestion-address_hash")); } } for (var namespace in Widgets.widgetExecutions) { Widgets.widgetExecutions[namespace][Widgets.widgetExecutions[namespace].length] = 'addressValidation'; Widgets.widgetExecutions[namespace][Widgets.widgetExecutions[namespace].length] = 'boxselect'; } Widgets.widgetExecutions.overlay.push('shippingFormSubmit'); Widgets.registered['shippingFormSubmit'] = function () { checkoutForm.submit(); }; // the box select - select based on classes Widgets.registered['boxselect'] = function () { //highlight first address
which should be the validated/suggested address $('.suggested-address:first').addClass('selected'); //Wire Click Event for address
's $(".suggested-address").on("click", function() { var rb = $(this).find('input[name="address"]:radio'); rb.prop("checked", true); $('.suggested-address').removeClass('selected'); rb.parent().parent().addClass('selected'); // update the form //updateForm(rb); }); }; // the city - zip select and validation widget Widgets.registered['addressValidation'] = function (elem) { var submitButton = checkoutForm.find("button[name$='_singleshipping_save'], input[name$='_singleshipping_save']"); elem.click(function (e) { if (!checkoutForm.valid()) { var checkoutFormValidator = checkoutForm.validate(); checkoutFormValidator.form(); return false; } // are we in registered checkout? If yes, we don't verify (cause the address was already verified) if ($('.registered-address-select').length > 0) { return true; } if ($(".activate-suggested-address").length <= 0) { e.preventDefault(); } // e.preventDefault() prevents save from be ing added to the CurrentHttpParameterMap, so add hack to include it so the form submits properly if ($("#artificial-save").length == 0) { var input = $("") .attr("type", "hidden") .attr("name", submitButton.attr("name")) .attr("id", "artificial-save") .val("save"); checkoutForm.append($(input)); } // @todo - this might be needed to also rely on the address configuration var shipFields = [ 'firstName', 'lastName', 'address1', 'address2', 'additionalInformation', 'city', 'stateCode', 'zip', 'countryCode', 'phone', 'email' ], addrVal = function (id, prefix, type) { type = type || 'input'; return $.trim(checkoutForm.find(type + "[id$='" + prefix + "_" + id + "']").val()) || ''; }, addrObj = function (arr, formPrefix, objPrefix) { var obj = {}, type, selects = ['stateCode', 'countryCode']; objPrefix = objPrefix + '_'; arr.forEach(function(m){ type = selects.indexOf(m) > -1 ? 'select' : 'input'; obj[objPrefix + m] = addrVal(m, formPrefix, type); }); return obj; }; var shipToAddress = addrObj(shipFields, shippingAddressPrefix, 'shipTo'); shipToAddress.differentShipping = true; // <-- https://jira.quiksilver.com/browse/ECOM-9634 - this needs to be here, to distinguish it from the legacy EU case var validShipCountries = []; for(var i in app.availableShippingCountries){ validShipCountries.push(app.availableShippingCountries[i].value) } var isValidShipCountry = validShipCountries.indexOf(shipToAddress.shipTo_countryCode) > -1; if ( isValidShipCountry ) { app.showProgress(null); app.ajax.load({ url: app.URLs.checkAVS, async: false, data: shipToAddress, callback: function (response) { // allow OK & service response errors to pass unhindered response = $.trim(response); if (response === "OK" || !response || (typeof response === 'object' && 'Success' in response && !response.Success)) { checkoutForm.submit(); } else { $.colorbox({ html: response, maxWidth: '100%', className: 'r-colorbox-checkAVS', innerHeight: 'auto', fixed: true, onComplete: function () { app.hideProgress(); OverlayUtils.enhanceDOM($('#cboxContent')); //updateForm($('input.activate-suggested-address:checked')); $(".btn_usethisaddress").prop('type', 'button').on("click", function (e) { updateForm($('input.activate-suggested-address:checked')); app.showProgress(); checkoutForm.submit(); }); // those two buttons are not submits anymore - just buttons, to avoid triggering the ajax forms $(".btn_canceladdress").prop('type', 'button').on("click", function (e) { e.preventDefault(); $.colorbox.close(); }); } }); } } }); }else{ $('#no-shipping').slideDown(); } }); }; if (!Object.assign) { // Polyfill Object.assign Object.defineProperty(Object, 'assign', { enumerable: false, configurable: true, writable: true, value: function(target, firstSource) { 'use strict'; if (target === undefined || target === null) { throw new TypeError('Cannot convert first argument to object'); } var to = Object(target); for (var i = 1; i < arguments.length; i++) { var nextSource = arguments[i]; if (nextSource === undefined || nextSource === null) { continue; } var keysArray = Object.keys(Object(nextSource)); for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { var nextKey = keysArray[nextIndex]; var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); if (desc !== undefined && desc.enumerable) { to[nextKey] = nextSource[nextKey]; } } } return to; } }); } })(); // // filling the year select var maxYear = ((new Date).getFullYear()) - 12; var yearSelect = $('#dwfrm_signup_birthdayfields_year'); for (i = maxYear; i > 1896; i--){ yearSelect.append(''); } /* // preselect the fields $( '#dwfrm_signup_birthdayfields_day option[value=' + daySelect.attr('data-targeted-value') + ']').attr('selected','selected'); $( '#dwfrm_signup_birthdayfields_month option[value=' + monthSelect.attr('data-targeted-value') + ']').attr('selected','selected'); */ $('#dwfrm_signup_birthdayfields_year option[value="' + yearSelect.attr('data-targeted-value') + '"]').attr('selected','selected'); // set up the interest checkboxes from DW profile.custom.interests var interests = ''.split(','); if (interests != '') { for (var i = 0; i < interests.length; i++) { $('#dwfrm_signup_'+interests[i]).prop('checked', 'checked'); } } // check or uncheck all checkboxes $("#dwfrm_signup_all").bind("change", function () { $('.form-interests input:checkbox').prop('checked', this.checked); }); // fill the hidden form field selectedInterests $(".form-interests input:checkbox").bind("change", function () { var target = $('#dwfrm_signup_selectedInterests'); if ($(this).attr('name') != $("#dwfrm_signup_all").attr('name')) $("#dwfrm_signup_all").prop('checked', ''); target.attr('value', ''); $('.form-interests input:checkbox').each(function ( index, value ) { //if( value.checked && $(value).attr('name')!='dwfrm_signup_all') { if( value.checked ) { if ( target.attr('value') == "" ) target.attr('value', target.attr('value') + ',' + $(value).attr('name') + ','); else target.attr('value', target.attr('value') + $(value).attr('name') + ',' ); } }); target.attr('value', target.attr('value').replace(new RegExp('dwfrm_signup_', 'g'), '') ); target.attr('value', target.attr('value').substring(1, target.attr('value').length - 1) ); }); /* UN-CACHED APP VARIABLES - START */ // Countrys app.resources.sessioncountrycode = "us"; app.resources.sessioncountry= "United States"; //Store pickup page app.resources.storepickup.sessionlocale = "en"; app.resources.storepickup.currency_symbol = "$"; app.resources["WISHLIST_LIST"] = ""; //Geolocation references app.resources["GEO_COUNTRY_CODE"] = "PT"; app.resources["SHIP_TO_COUNTRY_CODE"]= "US"; /* UN-CACHED APP VARIABLES - END */