var breeze_prefetch = {"local_url":"https:\/\/www.awbtextiles.co.uk","ignore_remote_prefetch":"1","ignore_list":["\/?wc-api=wc_facebook_get_feed_data&secret=c8d62128fafbc6d8ec3b4bc238dc8b20","\/basket\/","\/checkout\/","\/my-account\/","\/basket\/","\/checkout\/","\/my-account\/","\/wp-admin\/"]};
jQuery(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"d MM yy","firstDay":1,"isRTL":false});});
var wc_add_to_cart_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","i18n_view_cart":"View basket","cart_url":"https:\/\/www.awbtextiles.co.uk\/basket\/","is_cart":"","cart_redirect_after_add":"no"};
var woocommerce_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%"};
var wpm = {"ajax_url":"https:\/\/www.awbtextiles.co.uk\/wp-admin\/admin-ajax.php","root":"https:\/\/www.awbtextiles.co.uk\/wp-json\/","nonce_wp_rest":"cc98f8858c","nonce_ajax":"56a0c3bb52"};
var dataLayer_content = {"visitorLoginState":"logged-out","visitorType":"visitor-logged-out","visitorEmail":"","visitorEmailHash":"","visitorRegistrationDate":"","visitorUsername":"","pagePostType":"product","pagePostType2":"tax-product","pageCategory":[],"cartContent":{"totals":{"applied_coupons":[],"discount_total":0,"subtotal":0,"total":0},"items":[]}};
dataLayer.push( dataLayer_content );
We have an extensive range of Scruffs and Portwest workwear clothing along with our premium brand carhartt, high-vis safety gear and more casual styles.
if(window.hasOwnProperty("jQuery")){
// jQuery
jQuery(document).ajaxComplete(function(event,request, settings){if( settings.url.includes("add_to_cart")
|| settings.url.includes("remove_from_cart")
|| settings.url.includes("removed_item")
|| settings.url.includes("remove_item")
|| settings.url.includes("get_refreshed_fragments")
){request = jQuery.ajax({
type : "POST",
url : "https://www.awbtextiles.co.uk/wp-admin/admin-ajax.php",
data: {
action:'get_cart'
},
});request.done(function (response, textStatus, jqXHR){
var clerk_productids = response;
var clerk_last_productids = [];
if( localStorage.getItem('clerk_productids') !== null ){
clerk_last_productids = localStorage.getItem('clerk_productids').split(",");
clerk_last_productids = clerk_last_productids.map(Number);
}
//sort
clerk_productids = clerk_productids.sort((a, b) => a - b);
clerk_last_productids = clerk_last_productids.sort((a, b) => a - b);
// compare
if(JSON.stringify(clerk_productids) == JSON.stringify(clerk_last_productids)){
// if equal - maybe compare content??
// console.log('equal: ', clerk_productids, clerk_last_productids)
}else{
// if not equal send cart to clerk
//console.log('not equal: ', clerk_productids, clerk_last_productids)
Clerk('cart', 'set', clerk_productids);
}
// save for next compare
localStorage.setItem("clerk_productids", clerk_productids);
});request.fail(function (jqXHR, textStatus, errorThrown){
console.error(
"The following error occurred: "+
textStatus, errorThrown
);
});
}
});}else{
// no jQuery
// Store a reference to the native method
let open = XMLHttpRequest.prototype.open;// Overwrite the native method
XMLHttpRequest.prototype.open = function() {
// Assign an event listener
this.addEventListener("load", function(){if( this.responseURL.includes("add_to_cart")
|| this.responseURL.includes("remove_from_cart")
|| this.responseURL.includes("removed_item")
|| this.responseURL.includes("remove_item")
|| this.responseURL.includes("get_refreshed_fragments")
){
// get cart here
data = "action=get_cart";const request = new XMLHttpRequest();request.addEventListener('load', function () {
if (this.readyState === 4 && this.status === 200) {
var response = this.responseText.replace('[', '').replace(']', '');
var clerk_productids = [];
clerk_productids = response.split(",")
clerk_productids = clerk_productids.map(Number);
var clerk_last_productids = [];
if( localStorage.getItem('clerk_productids') !== null ){
clerk_last_productids = localStorage.getItem('clerk_productids').split(",");
clerk_last_productids = clerk_last_productids.map(Number);
}
//sort
clerk_productids = clerk_productids.sort((a, b) => a - b);
clerk_last_productids = clerk_last_productids.sort((a, b) => a - b);
// compare
if(JSON.stringify(clerk_productids) == JSON.stringify(clerk_last_productids)){
// if equal - do nothing
// console.log('equal: ', clerk_productids, clerk_last_productids)
}else{
// if not equal send cart to clerk
// console.log('not equal: ', clerk_productids, clerk_last_productids)
Clerk('cart', 'set', clerk_productids);
}
// save for next compare
localStorage.setItem("clerk_productids", clerk_productids);
}
});request.open('POST', "https://www.awbtextiles.co.uk/wp-admin/admin-ajax.php", true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.send(data);}}, false);// Call the stored reference to the native method
open.apply(this, arguments);
};}
(function () {
var c = document.body.className;
c = c.replace(/woocommerce-no-js/, 'woocommerce-js');
document.body.className = c;
})();
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":"","zoom_options":[],"photoswipe_enabled":"","photoswipe_options":{"shareEl":false,"closeOnScroll":false,"history":false,"hideAnimationDuration":0,"showAnimationDuration":0},"flexslider_enabled":""};
var pewc_vars = {"ajaxurl":"https:\/\/www.awbtextiles.co.uk\/wp-admin\/admin-ajax.php","currency_symbol":"\u00a3","decimal_separator":".","thousand_separator":",","decimals":"2","price_format":"%1$s%2$s","currency_pos":"left","variable_1":"","variable_2":"","variable_3":"","enable_tooltips":"no","dequeue_tooltips":"","separator":" + ","update_price":"no","disable_qty":"1","product_gallery":".images","product_img_wrap":".woocommerce-product-gallery__image, .woocommerce-product-gallery__image--placeholder","calculations_timer":"0","conditions_timer":"0","remove_spaces":"no","math_round":"no","disable_button_calcs":"no","disable_button_uploads":"no","null_signifier":"*","disable_wcfad_label":"no","zero_missing_field":"no","set_initial_key":"no","pdf_count":"no","layer_parent":"woocommerce-product-gallery__wrapper","multiply_independent":"no","post_id":"107399","accordion_toggle":"","close_accordion":"no","reset_fields":"no","set_child_quantity_default":"no"};
var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"ajaxurl":"https:\/\/www.awbtextiles.co.uk\/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","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}};
var wc_swatches_params = {"ajax_url":"https:\/\/www.awbtextiles.co.uk\/wp-admin\/admin-ajax.php"};
var dbadger_i18n_params = {"cookieMessage":"We use cookies to track usage & preferences. By continuing to use this website, you agree that this is ok.","cookieDisabled":"","acceptButton":"1","acceptText":"I Understand","policyButton":"","policyText":"Cookie Policy","policyURL":"https:\/\/www.awbtextiles.co.uk\/privacy\/","acceptOnScroll":"1","lazyLoadThreshold":"300","lg_mode":"lg-slide","lg_captions":"1","lg_controls":"1","lg_download":"","lg_counter":"","lg_thumbs":"1","lg_autoplay":"1","lg_fullscreen":"1","lg_zoom":"1","lg_share":"1","nav_breakpoint":"1200","sticky_nav_breakpoint":"","animate_things":"","things_to_animate":"","animation_threshold":"","woo_gallery_columns":"6","things_to_resize":"","post_things_to_resize":"","use_WC_Additional_Variation_Images":"","zoom":"1"};
var cwginstock = {"ajax_url":"https:\/\/www.awbtextiles.co.uk\/wp-admin\/admin-ajax.php","default_ajax_url":"https:\/\/www.awbtextiles.co.uk\/wp-admin\/admin-ajax.php","security":"bd55b098f0","user_id":"0","security_error":"Something went wrong, please try after sometime","empty_name":"Name cannot be empty","empty_quantity":"Quantity cannot be empty","empty_email":"Email Address cannot be empty","invalid_email":"Please enter valid Email Address","is_popup":"no","phone_field":"2","phone_field_error":["Please enter valid Phone Number","Please enter valid Phone Number","Phone Number too short","Phone Number too long","Please enter valid Phone Number"],"phone_utils_js":"","is_phone_field_optional":"2","is_quantity_field_optional":"2","hide_country_placeholder":"2","default_country_code":"","custom_country_placeholder":"","enable_recaptcha":"2","recaptcha_site_key":"6Lcpq9kUAAAAAC8FCEmH6BMWbb4P8x-zVMa0JoRf","enable_recaptcha_verify":"2","recaptcha_secret_present":"yes","is_v3_recaptcha":"no"};