| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050 |
- var timer = null;
- $(function() {
- var demo1 = $("#banner").slippry({
- // transition: 'fade',
- // useCSS: true,
- // speed: 1000,
- // pause: 3000,
- // auto: true,
- responsive: true
- // autoHover: false
- });
- });
- $(window).ready(function() {
-
- $(".nav").sticky({ topSpacing: 80 });
- $('.logo').sticky({ topSpacing: 0 });
- $('.top-middle').sticky({ topSpacing: 0 });
- $('#mobile-nav').sticky({ topSpacing: 0 });
-
-
- $.get('/cart/minicart/load',function(data) {
- $('#minicart').html(data);
- });
-
-
- $('.cart').hover(function() {
- $('#minicart').show();
- },function() {
- $('#minicart').hide();
- });
-
-
- $('.tab-nav-link').on('click',function(e) {
- e.preventDefault();
- var anchor = $(this).attr('href');
- $('.content').hide();
- $(anchor).show();
- });
-
-
- $('#chBox').on('click',function() {
- if ($(this).is(':checked')) {
- $('#billingDetails').slideUp();
- }
- else {
- $('#billingDetails').slideDown();
- }
- });
-
-
- $('#password').keypress(function(e) {
- if (e.keyCode===13) {
- login();
- }
- });
-
-
- //Alert bars
- var barTimer = setInterval(function() {
- $('.bar').fadeOut('slow');
- clearInterval(barTimer);
- },5000);
-
-
- //Range slider
- var ranger = document.getElementById('range');
- noUiSlider.create(ranger,{
- start: [0,maxPrice],
- step: 10,
- range: {
- 'min': 0,
- 'max': maxPrice
- }
- });
-
- if (actualMin!=='' && actualMax!=='' && actualMin>0 && actualMax>0) {
- ranger.noUiSlider.set([actualMin,actualMax]);
- }
-
- //Ranger event handler
- ranger.noUiSlider.on('update',function (values,handle) {
- if (handle) {
- var mp = values[handle].replace('.00','');
- mp = mp.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ");
- $('#maxPrice').html(mp);
- $('#maxval').val(values[handle].replace('.00',''));
- }
- else {
- var mp = values[handle].replace('.00','');
- mp = mp.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ");
- $('#minPrice').html(mp);
- $('#minval').val(values[handle].replace('.00',''));
- }
- });
- //End of range slider
-
- $('#accept').parent('div').children('label').children('span').on('click',function() {
- alert('ok');
- });
-
- });
- function searchEnter(e) {
- if (e.keyCode===13) {
- searchClick();
- }
- }
- function searchEnterMobile(e) {
- if (e.keyCode===13) {
- searchClickMobile();
- }
- }
- function searchClick() {
- var keyword = $('#search').val();
- if (keyword!=='') {
- var categories = [];
- var categoryJSON = '';
-
- $('.category_checkbox').each(function() {
- if ($(this).is(':checked')) {
- categories.push($(this).attr('data-category-id'));
- }
- });
-
- categoryJSON = JSON.stringify(categories);
- window.location='/search/index/'+keyword+'/?categories='+categoryJSON;
- }
- else {
- $('.search').addClass('error-empty');
- }
- }
- function searchClickMobile() {
- var keyword = $('#search-mobile').val();
- if (keyword!=='') {
- var categories = [];
- var categoryJSON = '';
-
- $('.category_checkbox').each(function() {
- if ($(this).is(':checked')) {
- categories.push($(this).attr('data-category-id'));
- }
- });
-
- categoryJSON = JSON.stringify(categories);
- window.location='/search/index/'+keyword+'/?categories='+categoryJSON;
- }
- else {
- $('.search').addClass('error-empty');
- }
- }
- function add_to_cart(product_id) {
- var hasError = false;
- var animdelay = null;
-
- if (product_id!=='') {
- if (has_numberbox()) {
- var options = {};
-
- $('.options').each(function() {
- if ($(this).val!=='') {
- options[$(this).attr('name')] = $(this).val();
- }
- });
-
- options = JSON.stringify(options);
-
- if ($('li').hasClass('color-box')) {
- if ($('#color').val()==='') {
- hasError = true;
- }
- else {
- hasError = false;
- }
- }
-
- if (hasError) {
- //$('.color-error').show();
- if (lang==='hu') {
- open_modal('#error-message','Kérjük válasszon színt!');
- }
- else {
- open_modal('#error-message','Please choose color!');
- }
- }
- else {
- $('#cart_icon').addClass('animated bounce');
- $('#cart-mobiled').addClass('animated bounce');
-
- $.post('/cart/add/'+product_id,{options: options, qnt: numberbox_get()},function(data) {
- $('#minicart').html(data);
- update_mini_cart();
- animdelay = setInterval(function() {
- $('#cart_icon').removeClass('animated bounce');
- $('#cart-mobiled').removeClass('animated bounce');
- },3000);
- return true;
- });
- }
- }
- else {
- numberbox_error();
- }
- }
- else {
- return false;
- }
- }
- function delete_from_cart(product_id,reload,url) {
- if (product_id!=='') {
- $.get('/cart/delete/'+product_id,function(data) {
- if (reload===true) {
- if (url) {
- window.location=url;
- }
- else {
- window.location='/cart';
- }
- }
- $('#minicart').html(data);
- update_mini_cart();
- return true;
- });
- }
- else {
- return false;
- }
- }
- function delete_direct_from_cart(cartitem_id,reload,url) {
- if (cartitem_id!=='') {
- $.get('/cart/deletedirect/'+cartitem_id,function(data) {
- if (reload===true) {
- if (url) {
- window.location=url;
- }
- else {
- window.location='/cart';
- }
- }
- $('#minicart').html(data);
- update_mini_cart();
- return true;
- });
- }
- else {
- return false;
- }
- }
- function inc_cart_item(cart_item_id,obj) {
- if (cart_item_id) {
- $.getJSON('/cart/increment/'+cart_item_id,function(data) {
- $('#cart_item_qnt_'+cart_item_id).val(data['qnt']);
- $('#cart_direct_item_'+cart_item_id).val(data['qnt']);
- $('#item_price_'+cart_item_id).html(data['item_price']+' Ft');
- $('#sumprice').html(data['sum_price']+' Ft');
- $('#summa').html(data['sum_price']+' Ft');
-
- update_mini_cart();
- });
- }
- else {
- return false;
- }
- }
- function dec_cart_item(cart_item_id) {
- if (cart_item_id) {
- $.getJSON('/cart/decrement/'+cart_item_id,function(data) {
- $('#cart_item_qnt_'+cart_item_id).val(data['qnt']);
- $('#cart_direct_item_'+cart_item_id).val(data['qnt']);
- $('#item_price_'+cart_item_id).html(data['item_price']+' Ft');
- $('#sumprice').html(data['sum_price']+' Ft');
- $('#summa').html(data['sum_price']+' Ft');
-
- update_mini_cart();
- });
- }
- else {
- return false;
- }
- }
- function inc_product_item(cart_item_id) {
- if (cart_item_id) {
- $.getJSON('/cart/increment/'+cart_item_id,function(data) {
- $('#cart_item_qnt_'+cart_item_id).html(data['qnt']);
- $('#item_price_'+cart_item_id).html(data['item_price']+' Ft');
- $('#sumprice').html(data['sum_price']+' Ft');
- $('#summa').html(data['sum_price']+' Ft');
- update_mini_cart();
- });
- }
- else {
- return false;
- }
- }
- function dec_product_item(cart_item_id) {
- if (cart_item_id) {
- $.getJSON('/cart/decrement/'+cart_item_id,function(data) {
- $('#cart_item_qnt_'+cart_item_id).html(data['qnt']);
- $('#item_price_'+cart_item_id).html(data['item_price']+' Ft');
- $('#sumprice').html(data['sum_price']+' Ft');
- $('#summa').html(data['sum_price']+' Ft');
- update_mini_cart();
- });
- }
- else {
- return false;
- }
- }
- function isEmail(email) {
- var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
- return regex.test(email);
- }
- function send_order(type,editor) {
- var hasError = false;
-
- $('#sendorder').attr('disabled','true');
-
- if ($('#vnev').val()==='') {
- hasError = true;
- $('#vnev').parent('div').addClass('error');
- }
- else {
- $('#vnev').parent('div').removeClass('error');
- }
- if ($('#knev').val()==='') {
- hasError = true;
- $('#knev').parent('div').addClass('error');
- }
- else {
- $('#knev').parent('div').removeClass('error');
- }
- if ($('#email').val()==='') {
- hasError = true;
- $('#email').parent('div').addClass('error');
- }
- else {
- $('#email').parent('div').removeClass('error');
- }
- if (!isEmail($('#email').val())) {
- hasError = true;
- $('#email').parent('div').addClass('error');
- }
- else {
- $('#email').parent('div').removeClass('error');
- }
-
- if (editor!=='sales') {
- if ($('#accept').is(':checked')===false) {
- hasError = true;
- //$('#accept').parent('div').css('border','solid 2px #E05E73');
- $('#accept').parent('div').children('label').children('span').css('border','solid 2px #E05E73');
- }
- else {
- $('#accept').parent('div').parent('div').removeClass('error');
- $('#accept').parent('div').children('label').children('span').css('border','2px solid #b7c0c7');
- }
- }
- // if ($('#pass1').val()==='') {
- // hasError = true;
- // $('#pass1').parent('div').addClass('error');
- // }
- // else {
- // $('#pass1').parent('div').removeClass('error');
- // }
- //
- // if ($('#pass1').val()!==$('#pass2').val() || $('#pass2').val()==='') {
- // hasError = true;
- // $('#pass2').parent('div').addClass('error');
- // }
- // else {
- // $('#pass2').parent('div').removeClass('error');
- // }
-
- if ($('#tel').val()==='') {
- hasError = true;
- $('#tel').parent('div').addClass('error');
- }
- else {
- $('#tel').parent('div').removeClass('error');
- }
-
- if (editor==='sales') {
- if ($('#ajanlat_ervenyesseg').val()==='') {
- hasError = true;
- $('#ajanlat_ervenyesseg').parent('div').addClass('error');
- }
- else {
- $('#ajanlat_ervenyesseg').parent('div').removeClass('error');
- }
-
- if ($('#szallitasi_ido').val()==='') {
- hasError = true;
- $('#szallitasi_ido').parent('div').addClass('error');
- }
- else {
- $('#szallitasi_ido').parent('div').removeClass('error');
- }
- }
- // if ($('#irsz').val()==='') {
- // hasError = true;
- // $('#irsz').parent('div').parent('div').addClass('error');
- // }
- // else {
- // $('#irsz').parent('div').parent('div').removeClass('error');
- // }
- //
- // if ($('#telepules').val()==='') {
- // hasError = true;
- // $('#telepules').parent('div').parent('div').addClass('error');
- // }
- // else {
- // $('#telepules').parent('div').parent('div').removeClass('error');
- // }
- //
- // if ($('#utca').val()==='') {
- // hasError = true;
- // $('#utca').parent('div').addClass('error');
- // }
- // else {
- // $('#utca').parent('div').removeClass('error');
- // }
-
- // if (!$('#chBox').is(':checked')) {
- // if ($('#sznev').val()==='') {
- // hasError = true;
- // $('#sznev').parent('div').addClass('error');
- // }
- // else {
- // $('#sznev').parent('div').removeClass('error');
- // }
- //
- // if ($('#szirsz').val()==='') {
- // hasError = true;
- // $('#szirsz').parent('div').parent('div').addClass('error');
- // }
- // else {
- // $('#szirsz').parent('div').parent('div').removeClass('error');
- // }
- //
- // if ($('#sztelepules').val()==='') {
- // hasError = true;
- // $('#sztelepules').parent('div').parent('div').addClass('error');
- // }
- // else {
- // $('#sztelepules').parent('div').parent('div').removeClass('error');
- // }
- //
- // if ($('#szutca').val()==='') {
- // hasError = true;
- // $('#szutca').parent('div').addClass('error');
- // }
- // else {
- // $('#szutca').parent('div').removeClass('error');
- // }
- // }
-
- $('#send_type').val(type);
-
- if (hasError===false) {
- $('#sendFRM').submit();
- }
- else {
- $('#sendorder').removeAttr('disabled');
- if (lang==='hu') {
- open_modal('#error-message','Kérjük ellenőrizze a megadott adatokat!');
- }
- else {
- open_modal('#error-message','Please check order details!');
- }
- }
- }
- function login(error1,error2) {
- var user = $('#username').val();
- var pass = $('#password').val();
-
- if (user!=='' && pass!=='') {
- $.getJSON('/user/auth/login',{username: user, password: pass},function(data) {
- if (data.status===true) {
- //$('.login-reg').hide();
- $('.links').html('<ul><li><a href="/order/inbox">Beérkezett ajánlatok</li><li><a href="/order/sent">Elküldött ajánlatok</li><li><a href="/user/auth/logout">Kilépés</li></ul>');
- $('.login-reg').html(data.userbox);
- $('.links').html(data.usermenu);
- }
- else {
- $('#container_user').addClass('error');
- $('#user_error_msg').html(data.message);
- $('#container_password').addClass('error');
- }
- });
- }
- else {
- $('#container_user').addClass('error');
- $('#container_password').addClass('error');
- $('#user_error_msg').html(error1);
- $('#password_error_msg').html(error2);
- }
- }
- function login_mobile(error1,error2) {
- var user = $('#username2').val();
- var pass = $('#password2').val();
-
- if (user!=='' && pass!=='') {
- $.getJSON('/user/auth/login',{username: user, password: pass},function(data) {
- if (data.status===true) {
- //$('.login-reg').hide();
- window.location='/order/inbox';
- }
- else {
- $('#container_user2').addClass('error');
- $('#user_error_msg2').html(data.message);
- $('#container_password2').addClass('error');
- }
- });
- }
- else {
- $('#container_user2').addClass('error');
- $('#container_password2').addClass('error');
- $('#user_error_msg2').html(error1);
- $('#password_error_msg2').html(error2);
- }
- }
- function user_login() {
- var user = $('#login_username').val();
- var pass = $('#login_password').val();
- var redirect = $('#login_redirect').val();
-
- if (user!=='' && pass!=='') {
- $.getJSON('/user/auth/login',{username: user, password: pass},function(data) {
- if (data.status===true) {
- window.location=redirect;
- }
- else {
- $('#login_username_container').addClass('error');
- $('#login_error_text').html(data.message);
- $('#login_password_container').addClass('error');
- }
- });
- }
- else {
- $('#login_username_container').addClass('error');
- $('#login_password_container').addClass('error');
- $('#login_error_text').html('Kérjük adja meg a belépési adatokat!');
- }
- }
- function user_reminder(error) {
- var user = $('#username').val();
-
- if (user!=='') {
- $.post('/user/reminder/send',{login_username: user},function(data) {
- $('#userboxfrm').hide();
- $('#response_text').html(data);
- $('#usermessage').show();
- });
- }
- else {
- $('#container_user').addClass('error');
- $('#user_error_msg').html(error);
- }
- }
- function add_new_product() {
- $('#addnew').toggle();
- }
- function add_product_to_cart() {
- var nev = $('#termeknev').val();
- var ar = $('#termekar').val();
- var leiras = $('#termekleiras').val();
- var error = false;
- if (nev==='') {
- error = true;
- $('#termeknev').parent('div').parent('div').addClass('error');
- }
-
- if (ar==='') {
- error = true;
- $('#termekar').parent('div').parent('div').addClass('error');
- }
-
- if (!error) {
- $.post('/order/products/add',{nev: nev, ar: ar, leiras: leiras},function(data) {
- window.location.reload();
- });
- }
- }
- function update_item_number_value(cart_item_id,number,obj) {
- if (cart_item_id && number>0) {
- $.getJSON('/cart/update/'+cart_item_id+'/',{qnt: number},function(data) {
- $('#cart_item_qnt_'+cart_item_id).html(data['qnt']);
- $('#cart_direct_item_'+cart_item_id).val(data['qnt']);
- $('#item_price_'+cart_item_id).html(data['item_price']+' Ft');
- $('#sumprice').html(data['sum_price']+' Ft');
- $('#summa').html(data['sum_price']+' Ft');
-
- update_mini_cart();
- });
- }
- else {
- return false;
- }
- }
- function update_item_price(cart_item_id,price) {
- if (cart_item_id) {
- $.post('/cart/updateprice/'+cart_item_id,{price: price},function(data) {
- $('#cart_wrapper').html(data);
- input_initialization();
- update_mini_cart();
- });
- }
- }
- function resert_price(cart_item_id) {
- if (cart_item_id) {
- $.post('/cart/resetprice/'+cart_item_id,function(data) {
- $('#cart_wrapper').html(data);
- input_initialization();
- update_mini_cart();
- });
- }
- }
- function update_mini_cart() {
- $.get('/cart/minicart',function(data) {
- $('#minicart').html(data);
- });
-
- $.getJSON('/cart/cartinfo',function(data) {
- if (data['sumqnt']==null) data['sumqnt'] = '0';
- if (lang==='hu') {
- $('#mini_sumqnt').html(data['sumqnt']+' termék');
- $('#prodnumber').html(data['sumqnt']);
- $('#mini_sumprice').html(data['sumprice']+' Ft');
- }
- else {
- $('#mini_sumqnt').html(data['sumqnt']+' products');
- $('#prodnumber').html(data['sumqnt']);
- $('#mini_sumprice').html(data['sumprice']+' Ft');
- }
- });
- }
- function add_direct_product() {
- var prod_name = $('#direct_cartitem_procut_name').val();
- var prod_desc = $('#direct_cartitem_product_desc').val();
- var prod_price = parseInt($('#direct_cartitem_product_price').val());
- var prod_qnt = parseInt($('#direct_cartitem_product_qnt').val());
-
- var hasError = false;
-
- var file_data = $('#kep').prop('files')[0];
- var form_data = new FormData();
-
- form_data.append('file', file_data);
- form_data.append('prod_name',prod_name);
- form_data.append('prod_price',prod_price);
- form_data.append('prod_qnt',prod_qnt);
- form_data.append('prod_desc',prod_desc);
-
- if (prod_name==='') {
- $('#direct_cartitem_procut_name').addClass('input-error');
- hasError = true;
- }
- if (prod_price==='') {
- $('#direct_cartitem_product_price').addClass('input-error');
- hasError = true;
- }
- if (prod_qnt==='' || prod_qnt===0) {
- $('#direct_cartitem_product_qnt').addClass('input-error');
- hasError = true;
- }
-
- if (!hasError) {
- $.ajax({
- url: '/cart/adddirect/',
- dataType: 'text',
- cache: false,
- contentType: false,
- processData: false,
- data: form_data,
- type: 'post',
- success: function(data) {
- $('#cart_wrapper').html(data);
- input_initialization();
- update_mini_cart();
- }
- });
- // $.post('/cart/adddirect/',{prod_name: prod_name, prod_price: prod_price, prod_qnt: prod_qnt, prod_desc: prod_desc},function(data) {
- // $('#cart_wrapper').html(data);
- // input_initialization();
- // update_mini_cart();
- // });
- }
- }
- function add_direct_product_item(id) {
- var hash_name = '#direct_cartitem_procut_name_'+id;
- var hash_desc = '#direct_cartitem_product_desc_'+id;
- var hash_price = '#direct_cartitem_product_price_'+id;
- var hash_qnt = '#direct_cartitem_product_qnt_'+id;
-
- var prod_name = $(hash_name).val();
- var prod_desc = $(hash_desc).val();
- var prod_price = parseInt($(hash_price).val());
- var prod_qnt = parseInt($(hash_qnt).val());
-
- var hasError = false;
-
- if (prod_name==='') {
- $('#direct_cartitem_procut_name').addClass('input-error');
- hasError = true;
- }
- if (prod_price==='') {
- $('#direct_cartitem_product_price').addClass('input-error');
- hasError = true;
- }
- if (prod_qnt==='' || prod_qnt===0) {
- $('#direct_cartitem_product_qnt').addClass('input-error');
- hasError = true;
- }
-
- if (!hasError) {
- $.post('/cart/adddirect/',{prod_id: id, prod_name: prod_name, prod_price: prod_price, prod_qnt: prod_qnt, prod_desc: prod_desc},function(data) {
- $('#cart_wrapper').html(data);
- input_initialization();
- update_mini_cart();
- });
- }
- }
- function set_orig_price_visibility(cart_item_id) {
- if (cart_item_id) {
- $.post('/cart/setorigprice/'+cart_item_id,function(data) {
-
- });
- }
- else {
- return false;
- }
- }
- function select_color(obj) {
- $('.color-box').html(' ');
- $('.color-error').hide();
-
- if (obj) {
- var color = $(obj).attr('data-color');
- $('#color').val(color);
- $(obj).html('<i class="fa fa-check"></i>');
- }
- else {
- $(obj).html(' ');
- $('#color').val('');
- }
- }
- function checkit(obj) {
- if ($(obj).children('span').children('i').hasClass('checkedin')) {
- $(obj).children('span').children('i').removeClass('checkedin');
- $(obj).css('border','none');
- }
- else {
- $(obj).children('span').children('i').addClass('checkedin');
- }
- }
- function modalSendEmail(url) {
- var dialog = nanoModal("Valóban el szertené küldeni az árajánlatot az ügyfélnek?",{
- overlayClose: false,
- buttons: [
- {text: "Igen", handler: function(modal) { window.location = url; }, primary: true },
- {text: "Nem", handler: "hide"}
- ]
- });
-
- dialog.show();
- }
- function sendSearch() {
- var cid = '';
- var list = '';
-
- $('.ccategories').each(function() {
- if ($(this).attr('data-cid')!=='' && $(this).children('span').children('i').hasClass('checkedin')) {
- list+= $(this).attr('data-cid')+',';
- }
- });
- $('#categories_list').val(list);
-
- list = '';
- var colors = '';
-
- $('.filtered').each(function() {
- colors+= $(this).children('label').attr('data-id')+',';
- });
- $('#colors_list').val(colors);
-
- list = '';
- $('.cmaterials').each(function() {
- if ($(this).attr('data-cid')!=='' && $(this).children('span').children('i').hasClass('checkedin')) {
- list+= $(this).attr('data-cid')+',';
- }
- });
- $('#materials_list').val(list);
- }
- function filterit(obj) {
- if ($(obj).parent('li').hasClass('filtered')) {
- $(obj).parent('li').removeClass('filtered');
- $(obj).parent('li').css('border-color','transparent');
- }
- else {
- $(obj).parent('li').addClass('filtered');
- var bg = $(obj).parent('li').attr('data-over');
- $(obj).parent('li').css('border-color','#666565');
- }
- }
- function filter() {
- var catid = $('#cid').val();
- var colors = '';
- var materials = '';
- var maxprice = $('#maxPrice').val();
- var minprice = $('#minPrice').val();
- var keyword = $('#filter_keyword').val();
- var slug = $('#cslug').val();
-
- $('.product-list-2').html($('.product-list-2').attr('data-msg'));
-
- $('.sccolor').each(function() {
- if ($(this).parent('li').hasClass('filtered')) {
- colors+= $(this).attr('data-id')+',';
- }
- });
-
- $('.scmaterial').each(function() {
- if ($(this).parent('li').hasClass('filtered')) {
- materials+= $(this).attr('data-id')+',';
- }
- });
-
- $.post('/categories/filter/'+slug,{colors: colors, materials: materials, minprice: minprice, maxprice: maxprice, keyword: keyword, category: catid},function(data) {
- $('.product-list-2').html(data);
- });
- }
- function selectSales(obj) {
- if (obj && $(obj).val()!=='' && $(obj).val()!=='0') {
- $.post('/order/sales/set',{orderid: $(obj).attr('data-orderid'), salesid: $(obj).val()});
- return true;
- }
- else {
- return false;
- }
- }
- function setPrintColor(obj) {
- var id = $(obj).attr('data-cartitemid');
- var ertek = $(obj).val();
-
- if (ertek!=='' && ertek!=='Nem kérek emblémát') {
- $('#printing_locations_'+id).show();
- }
- else {
- $('#printing_locations_'+id).hide();
- }
-
- $.post('/order/printing/color',{
- id: id,
- ertek: ertek
- });
-
- return true;
- }
- function setPrintPosition(obj) {
- var id = $(obj).attr('data-cartitemid');
- var ertek = $(obj).val();
-
- $.post('/order/printing/position',{
- id: id,
- ertek: ertek
- });
-
- return true;
- }
- function show_mobile_menu() {
- $('#mobile-menu').slideToggle('fast');
- if ($('#mobile-search').is(':visible')) $('#mobile-search').hide();
- if ($('#mobile-login').is(':visible')) $('#mobile-login').hide();
- }
- function show_mobile_search() {
- $('#mobile-search').slideToggle('fast');
- if ($('#mobile-login').is(':visible')) $('#mobile-login').hide();
- if ($('#mobile-menu').is(':visible')) $('#mobile-menu').hide();
- }
- function show_mobile_login() {
- $('#mobile-login').slideToggle('fast');
- if ($('#mobile-menu').is(':visible')) $('#mobile-menu').hide();
- if ($('#mobile-search').is(':visible')) $('#mobile-search').hide();
- }
- function show_mobile_cart(url) {
- window.location=url;
- }
- function reminder() {
- $('#container_password').hide();
- $('#sendlogin').hide();
- $('#login_title').hide();
-
- $('#sendpwreminder').show();
- $('#reminder_title').show();
- }
- function back_to_login() {
- $('#sendpwreminder').hide();
- $('#reminder_title').hide();
-
- $('#container_password').show();
- $('#sendlogin').show();
- $('#login_title').show();
-
- $('#usermessage').hide();
- $('#userboxfrm').show();
-
- $('#response_text').html('');
- }
- function open_modal(id,text) {
- var ww = $(window).width();
-
- if (ww>1000) {
- $(id).children('h6').html(text);
- $(id).slideToggle();
-
- timer = setInterval(function() {
- close_modal(id);
- },5000);
- }
- else {
- $(id+'2').children('h6').html(text);
- $(id+'2').slideToggle();
-
- timer = setInterval(function() {
- close_modal(id+'2');
- },5000);
- }
- }
- function close_modal(id) {
- if (id) {
- $(id).slideToggle();
- $(id).children('h6').html('');
- clearInterval(timer);
- }
- }
- function isNumber(evt) {
- evt = (evt) ? evt : window.event;
- var charCode = (evt.which) ? evt.which : evt.keyCode;
- if (charCode > 31 && (charCode < 48 || charCode > 57)) {
- return false;
- }
- return true;
- }
- function checkover(obj) {
- if (!$(obj).hasClass('filtered')) {
- }
- }
- function checkout(obj) {
- if (!$(obj).hasClass('filtered')) {
- }
- }
|