var wc_add_to_cart_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","i18n_view_cart":"View cart","cart_url":"https:\/\/www.tristarhatsco.com\/cart","is_cart":"","cart_redirect_after_add":"no"};
var wc_single_product_params = {"i18n_required_rating_text":"Please select a rating","review_rating_required":"yes","flexslider":{"rtl":false,"animation":"slide","smoothHeight":true,"directionNav":false,"controlNav":"thumbnails","slideshow":false,"animationSpeed":500,"animationLoop":false,"allowOneSlide":false},"zoom_enabled":"1","zoom_options":[],"photoswipe_enabled":"1","photoswipe_options":{"shareEl":false,"closeOnScroll":false,"history":false,"hideAnimationDuration":0,"showAnimationDuration":0},"flexslider_enabled":"1"};
var xoo_wsc_params = {"adminurl":"https:\/\/www.tristarhatsco.com\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","qtyUpdateDelay":"500","notificationTime":"5000","html":{"successNotice":"<ul class=\"xoo-wsc-notices\"><li class=\"xoo-wsc-notice-success\"><span class=\"xoo-wsc-icon-check_circle\"><\/span>%s%<\/li><\/ul>","errorNotice":"<ul class=\"xoo-wsc-notices\"><li class=\"xoo-wsc-notice-error\"><span class=\"xoo-wsc-icon-cross\"><\/span>%s%<\/li><\/ul>"},"strings":{"maxQtyError":"Only %s% in stock","stepQtyError":"Quantity can only be purchased in multiple of %s%","calculateCheckout":"Please use checkout form to calculate shipping","couponEmpty":"Please enter promo code"},"isCheckout":"","isCart":"","sliderAutoClose":"1","shippingEnabled":"1","couponsEnabled":"1","autoOpenCart":"yes","addedToCart":"","ajaxAddToCart":"yes","skipAjaxForData":[],"showBasket":"hide_empty","flyToCart":"no","productFlyClass":"","refreshCart":"no","fetchDelay":"200","triggerClass":""};
jQuery(function($){
var firstHeader = $('.header-1');
var secondHeader = $('.header-2');
var headerSection = $('.header-section');
headerSection.wrap('<div class="header-placeholder"></div>');
var headerWrap = $('.header-placeholder');
var headerHeight = firstHeader.outerHeight();
headerWrap.css('height', headerHeight);
secondHeader.hide();
$(window).scroll(function() {
var topPosition = $(window).scrollTop();
if (topPosition >= 400) {
firstHeader.slideUp();
secondHeader.slideDown();
}
if (topPosition == 0) {
secondHeader.slideUp();
firstHeader.slideDown();
}
});
});
var sbiajaxurl = "https://www.tristarhatsco.com/wp-admin/admin-ajax.php";
(function () {
var c = document.body.className;
c = c.replace(/woocommerce-no-js/, 'woocommerce-js');
document.body.className = c;
})();
jQuery(document).ready(function($){ // wait for jQuery to load
$(".et-search-form").append('<input type="hidden" name="post_type" value="product" />'); // dynamically add the input below the search box that tells the search that the post type to search are products.
$(".et_pb_menu__search-form").each(function() { // now for each search box from the Divi module
$(this).append('<input type="hidden" name="post_type" value="product" />'); // add that input there too
});
});
var PayPalCommerceGateway = {"url":"https:\/\/www.paypal.com\/sdk\/js?client-id=Ab-_edzxAFStRDwM28MMOXUrgRfPP__Rw0dX8CUEmZZi06K6zzvt5_FdPZ4LgBkXdr30jgkWuVrf8APU¤cy=USD&integration-date=2024-11-05&components=buttons,funding-eligibility,buttons,fastlane,fastlane&vault=false&commit=false&intent=capture&disable-funding=card,paylater&enable-funding=venmo","url_params":{"client-id":"Ab-_edzxAFStRDwM28MMOXUrgRfPP__Rw0dX8CUEmZZi06K6zzvt5_FdPZ4LgBkXdr30jgkWuVrf8APU","currency":"USD","integration-date":"2024-11-05","components":"buttons,funding-eligibility,buttons,fastlane,fastlane","vault":"false","commit":"false","intent":"capture","disable-funding":"card,paylater","enable-funding":"venmo"},"script_attributes":{"data-partner-attribution-id":"Woo_PPCP","data-page-type":"product-details"},"client_id":"Ab-_edzxAFStRDwM28MMOXUrgRfPP__Rw0dX8CUEmZZi06K6zzvt5_FdPZ4LgBkXdr30jgkWuVrf8APU","currency":"USD","data_client_id":{"set_attribute":false,"endpoint":"\/?wc-ajax=ppc-data-client-id","nonce":"f53ed280f1","user":0,"has_subscriptions":false,"paypal_subscriptions_enabled":false},"redirect":"https:\/\/www.tristarhatsco.com\/checkout","context":"product","ajax":{"simulate_cart":{"endpoint":"\/?wc-ajax=ppc-simulate-cart","nonce":"63646c9a26"},"change_cart":{"endpoint":"\/?wc-ajax=ppc-change-cart","nonce":"e1afba9e8b"},"create_order":{"endpoint":"\/?wc-ajax=ppc-create-order","nonce":"70f481a356"},"approve_order":{"endpoint":"\/?wc-ajax=ppc-approve-order","nonce":"ef9d4ce046"},"approve_subscription":{"endpoint":"\/?wc-ajax=ppc-approve-subscription","nonce":"e17fb0d5dd"},"vault_paypal":{"endpoint":"\/?wc-ajax=ppc-vault-paypal","nonce":"414e4dbf64"},"save_checkout_form":{"endpoint":"\/?wc-ajax=ppc-save-checkout-form","nonce":"31bb72bdfe"},"validate_checkout":{"endpoint":"\/?wc-ajax=ppc-validate-checkout","nonce":"f955f95490"},"cart_script_params":{"endpoint":"\/?wc-ajax=ppc-cart-script-params"},"create_setup_token":{"endpoint":"\/?wc-ajax=ppc-create-setup-token","nonce":"34564b9468"},"create_payment_token":{"endpoint":"\/?wc-ajax=ppc-create-payment-token","nonce":"16d28515e4"},"create_payment_token_for_guest":{"endpoint":"\/?wc-ajax=ppc-update-customer-id","nonce":"c32773ac7c"},"update_shipping":{"endpoint":"\/?wc-ajax=ppc-update-shipping","nonce":"8f6a473de5"},"update_customer_shipping":{"shipping_options":{"endpoint":"https:\/\/www.tristarhatsco.com\/wp-json\/wc\/store\/cart\/select-shipping-rate"},"shipping_address":{"cart_endpoint":"https:\/\/www.tristarhatsco.com\/wp-json\/wc\/store\/cart\/","update_customer_endpoint":"https:\/\/www.tristarhatsco.com\/wp-json\/wc\/store\/cart\/update-customer"},"wp_rest_nonce":"11016ce1a6","update_shipping_method":"\/?wc-ajax=update_shipping_method"}},"cart_contains_subscription":"","subscription_plan_id":"","vault_v3_enabled":"1","variable_paypal_subscription_variations":[],"variable_paypal_subscription_variation_from_cart":"","subscription_product_allowed":"","locations_with_subscription_product":{"product":false,"payorder":false,"cart":false},"enforce_vault":"","can_save_vault_token":"","is_free_trial_cart":"","vaulted_paypal_email":"","bn_codes":{"checkout":"Woo_PPCP","cart":"Woo_PPCP","mini-cart":"Woo_PPCP","product":"Woo_PPCP"},"payer":null,"button":{"wrapper":"#ppc-button-ppcp-gateway","is_disabled":false,"mini_cart_wrapper":"#ppc-button-minicart","is_mini_cart_disabled":false,"cancel_wrapper":"#ppcp-cancel","mini_cart_style":{"layout":"vertical","color":"gold","shape":"pill","label":"paypal","tagline":false,"height":25},"style":{"layout":"horizontal","color":"gold","shape":"rect","label":"paypal","tagline":"true"}},"separate_buttons":{"card":{"id":"ppcp-card-button-gateway","wrapper":"#ppc-button-ppcp-card-button-gateway","style":{"shape":"pill","color":"black","layout":"horizontal"}}},"hosted_fields":{"wrapper":"#ppcp-hosted-fields","labels":{"credit_card_number":"","cvv":"","mm_yy":"MM\/YY","fields_empty":"Card payment details are missing. Please fill in all required fields.","fields_not_valid":"Unfortunately, your credit card details are not valid.","card_not_supported":"Unfortunately, we do not support your credit card.","cardholder_name_required":"Cardholder's first and last name are required, please fill the checkout form required fields."},"valid_cards":["mastercard","visa","amex","discover","american-express","master-card"],"contingency":"NO_3D_SECURE"},"messages":[],"labels":{"error":{"generic":"Something went wrong. Please try again or choose another payment source.","required":{"generic":"Required form fields are not filled.","field":"%s is a required field.","elements":{"terms":"Please read and accept the terms and conditions to proceed with your order."}}},"billing_field":"Billing %s","shipping_field":"Shipping %s"},"simulate_cart":{"enabled":true,"throttling":5000},"order_id":"0","single_product_buttons_enabled":"","mini_cart_buttons_enabled":"1","basic_checkout_validation_enabled":"","early_checkout_validation_enabled":"1","funding_sources_without_redirect":["paypal","paylater","venmo","card"],"user":{"is_logged":false,"has_wc_card_payment_tokens":false},"should_handle_shipping_in_paypal":"","needShipping":"","vaultingEnabled":"","productType":"simple","manualRenewalEnabled":"","axo":{"sdk_client_token":"eyJraWQiOiI0ZTE3Y2Y5ZGQ3YzA0OTg5ODVhOWIyNjYyMGU1OTI0YyIsInR5cCI6IkpXVCIsImFsZyI6IkVTMjU2In0.eyJpc3MiOiJodHRwczovL2FwaS5wYXlwYWwuY29tIiwiYXVkIjpbImh0dHBzOi8vYXBpLmJyYWludHJlZWdhdGV3YXkuY29tIiwidHJpc3RhcmhhdHNjby5jb20iXSwic3ViIjoiRkpSR1Q0MzY3MzRKQyIsImFjciI6WyJjbGllbnQiXSwic2NvcGUiOlsiQnJhaW50cmVlOlZhdWx0Il0sIm9wdGlvbnMiOnt9LCJheiI6ImRjZzAxLnBoeCIsImV4dGVybmFsX2lkIjpbIlBheVBhbDpGSlJHVDQzNjczNEpDIiwiQnJhaW50cmVlOjR5OXh4NG5zcnB0OHptOG4iXSwiZXhwIjoxNzMzNDA5NjQ1LCJpYXQiOjE3MzM0MDg3NDUsImp0aSI6IlUyQUFQZlg1UG10aWZrTVYxNDFhWGdPS21uUHk1MUhxYVpnMWFRVkJqYWZRWDIwVFNoaEEwUVpTVW9Oa1lhTzVXQXdiUk05YmZ3R2RVanVfSEg4UXk2NkJzaHNISTZYeDVIT1FuSHZMMUlOZXFGbE5BRXBrQ1piVy1feUhwaUlBIn0._g00cRteZ7Qracor1rq2oTVIZcqQ7n2B_vmbek-6lI26Q3GlfZCm47NJgNz3o0ZSUZ1OxRQMVvsVhVYMGEwmdw"}};
var DIVI = {"item_count":"%d Item","items_count":"%d Items"};
var et_builder_utils_params = {"condition":{"diviTheme":true,"extraTheme":false},"scrollLocations":["app","top"],"builderScrollLocations":{"desktop":"app","tablet":"app","phone":"app"},"onloadScrollLocation":"app","builderType":"fe"};
var et_frontend_scripts = {"builderCssContainerPrefix":"#et-boc","builderCssLayoutPrefix":"#et-boc .et-l"};
var et_pb_custom = {"ajaxurl":"https:\/\/www.tristarhatsco.com\/wp-admin\/admin-ajax.php","images_uri":"https:\/\/www.tristarhatsco.com\/wp-content\/themes\/Divi\/images","builder_images_uri":"https:\/\/www.tristarhatsco.com\/wp-content\/themes\/Divi\/includes\/builder\/images","et_frontend_nonce":"7c39aff64f","subscription_failed":"Please, check the fields below to make sure you entered the correct information.","et_ab_log_nonce":"4033071f49","fill_message":"Please, fill in the following fields:","contact_error_message":"Please, fix the following errors:","invalid":"Invalid email","captcha":"Captcha","prev":"Prev","previous":"Previous","next":"Next","wrong_captcha":"You entered the wrong number in captcha.","wrong_checkbox":"Checkbox","ignore_waypoints":"no","is_divi_theme_used":"1","widget_search_selector":".widget_search","ab_tests":[],"is_ab_testing_active":"","page_id":"162","unique_test_id":"","ab_bounce_rate":"5","is_cache_plugin_active":"yes","is_shortcode_tracking":"","tinymce_uri":"https:\/\/www.tristarhatsco.com\/wp-content\/themes\/Divi\/includes\/builder\/frontend-builder\/assets\/vendors","accent_color":"#4c4c4c","waypoints_options":[]};
var et_pb_box_shadow_elements = [];
var q2w3_sidebar_options = [{"sidebar":"sidebar-1","use_sticky_position":false,"margin_top":150,"margin_bottom":0,"stop_elements_selectors":"","screen_max_width":0,"screen_max_height":0,"widgets":["#nav_menu-2"]}];
var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/www.tristarhatsco.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}};