$(function() { sbjs.init(); var default_cart_id = '373-373'; var real_cart_id = ''; real_cart_id = getCookie('cart_id'); $('#cart_id').text(real_cart_id != undefined && real_cart_id ? real_cart_id : default_cart_id); var region_name = getCookie('region_name'); if(region_name) $('body').attr('data-current-city', region_name); var default_phone = '8 800 555-28-00'; var real_phone = ''; real_phone = getCookie('sbjs_phone'); $('.header-contacts__tel.sb-phone>a').text(real_phone != undefined && real_phone ? unescape(real_phone) : default_phone); $('.header-contacts__tel.sb-phone>a').attr('href', 'tel:'+ (real_phone != undefined && real_phone ? unescape(real_phone) : default_phone)); }); function getCookie(name) { var value = "; " + document.cookie; var parts = value.split("; " + name + "="); if (parts.length == 2) return parts.pop().split(";").shift(); }