project00 Posted October 19, 2015 Share Posted October 19, 2015 Good afternoon. Dear. After manipulation (and maybe not because of them) when you add the goods in the basket of goods of the page is automatically added to the goods within a quantity of 2 pieces. if ever after "+" or "-" is a step that increases by 2 initially on the product page shows the number 1 press "+" changed to 3 5 7 etc. press the "-" and everything in reverse order of 5 3 1. sometimes leave a message "You already have the maximum quantity available for this" I shoveled some files. searching QTY. I really hope for your help! Link to comment Share on other sites More sharing options...
NemoPS Posted October 19, 2015 Share Posted October 19, 2015 I hope I am not the only one who didn't understand your explanation, could you clarify? Also, could you share the site's url? Link to comment Share on other sites More sharing options...
project00 Posted October 19, 2015 Author Share Posted October 19, 2015 ladaway.comcheck it pls. try add to cart. and try click to + - on product page. Link to comment Share on other sites More sharing options...
NemoPS Posted October 19, 2015 Share Posted October 19, 2015 You mean you can only go 2 steps up and down? That must be the template, you must find the javascript that's triggered by the buttons. SHould be product.js, around line 242. Link to comment Share on other sites More sharing options...
project00 Posted October 19, 2015 Author Share Posted October 19, 2015 Yes i seen that rows. // The button to increment the product value $(document).on('click', '.product_quantity_up', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name=+fieldName+]').val()); if (quantityAvailable > 0) { quantityAvailableT = quantityAvailable; } else { quantityAvailableT = 100000000; } if (!isNaN(currentVal) && currentVal < quantityAvailableT) { $('input[name=+fieldName+]').val(currentVal + 1).trigger('keyup'); } else { $('input[name=+fieldName+]').val(quantityAvailableT); } }); // The button to decrement the product value $(document).on('click', '.product_quantity_down', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name=+fieldName+]').val()); if (!isNaN(currentVal) && currentVal > 1) { $('input[name=+fieldName+]').val(currentVal - 1).trigger('keyup'); } else { $('input[name=+fieldName+]').val(1); } }); if (typeof minimalQuantity != 'undefined' && minimalQuantity) { checkMinimalQuantity(); $(document).on('keyup', 'input[name=qty]', function(e){ checkMinimalQuantity(minimalQuantity); }); } if (typeof ad !== 'undefined' && ad && typeof adtoken !== 'undefined' && adtoken) { $(document).on('click', 'input[name=publish_button]', function(e){ e.preventDefault(); submitPublishProduct(ad, 0, adtoken); }); $(document).on('click', 'input[name=lnk_view]', function(e){ e.preventDefault(); submitPublishProduct(ad, 1, adtoken); }); } but they looks normaly. i realy need help with that. thank you! Link to comment Share on other sites More sharing options...
project00 Posted October 19, 2015 Author Share Posted October 19, 2015 and if i set $('input[name='+fieldName+']').val(currentVal + 2).trigger('keyup'); it will increase on 4. and steps will looks like 1 5 9 13... i think it is somewhere above that level. Link to comment Share on other sites More sharing options...
NemoPS Posted October 19, 2015 Share Posted October 19, 2015 it seems it's running 2 times then. What if you remove keyup? Link to comment Share on other sites More sharing options...
project00 Posted October 19, 2015 Author Share Posted October 19, 2015 what string i need to comment for this? Link to comment Share on other sites More sharing options...
project00 Posted October 19, 2015 Author Share Posted October 19, 2015 and there is some problem... if you open product page and add it to cart sometimes it put 2. even if in quantity field set 1. Link to comment Share on other sites More sharing options...
project00 Posted October 20, 2015 Author Share Posted October 20, 2015 need hepl Link to comment Share on other sites More sharing options...
gabdara Posted October 20, 2015 Share Posted October 20, 2015 (edited) You should contact the theme developer regarding this.Meanwhile a thing you could try is to edit your product.js file, look for these lines: // The button to increment the product value $(document).on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).on('click', '.product_quantity_down', function(e){ And add a .off() call before .on() like this: // The button to increment the product value $(document).off('click', '.product_quantity_up').on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).off('click', '.product_quantity_down').on('click', '.product_quantity_down', function(e){ Edited October 20, 2015 by gabdara (see edit history) Link to comment Share on other sites More sharing options...
project00 Posted October 20, 2015 Author Share Posted October 20, 2015 (edited) You should contact the theme developer regarding this. Meanwhile a thing you could try is to edit your product.js file, look for these lines: // The button to increment the product value $(document).on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).on('click', '.product_quantity_down', function(e){ And add a .off() call before .on() like this: // The button to increment the product value $(document).off('click', '.product_quantity_up').on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).off('click', '.product_quantity_down').on('click', '.product_quantity_down', function(e){ OMG!!! i think you solve it!!! but i try step by step. and that what i got: 1. if i set .off() only in one place (decrement or increment) then it work perfect. 2. if i add .off() to bouth like you say in not work even not change not increment or decriment qty. stay allways "1" 3. i write $(document).off(); above // The button to increment the product value $(document).on('click', '.product_quantity_up', function(e){ and it WOOOOORK!!!!!!! another question WHY it become not working... thank you man!!! you are realy help me!!! sorry i dont know how i can increase your karma! UPD your new version works perfect And add a .off() call before .on() like this: // The button to increment the product value $(document).off('click', '.product_quantity_up').on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).off('click', '.product_quantity_down').on('click', '.product_quantity_down', function(e){ Edited October 20, 2015 by project00 (see edit history) Link to comment Share on other sites More sharing options...
project00 Posted October 20, 2015 Author Share Posted October 20, 2015 (edited) ufffff it stil not work perfect... now + or - work normal but after you click "add to cart" it incrase quantity *2 i stil need help. i dont understand how to put photos here directly but you cad do my steps to see. open product page. incrace quantity click add to cart. you will can see message with some error (or not) then click again "add to cart" and it will incrase quantity *2 i think somthin with ADD TO CART it doubled any quantity (but +- work normaly) Help pls. UPD thats make me crazy... it work and not work then work againe... UPD1 i think i understand. in is cookie on client machine. how can i update or reload all cookes cache to all my clients? Edited October 20, 2015 by project00 (see edit history) Link to comment Share on other sites More sharing options...
gabdara Posted October 21, 2015 Share Posted October 21, 2015 Try CTRL+SHIFT+R when viewing the product page. Link to comment Share on other sites More sharing options...
project00 Posted October 22, 2015 Author Share Posted October 22, 2015 (edited) thanks. but now another issue. if i do this all then product picture stop work normaly. i use fancybox(by default and i like it) ant if i change code in product.js then fancybox stop working. what i must add or change to make it work again? upd. And add a .off() call before .on() like this: // The button to increment the product value $(document).off('click', '.product_quantity_up').on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).off('click', '.product_quantity_down').on('click', '.product_quantity_down', function(e){ this make "+" and "-" normal (increment and decrement on to 1) but if you add to card it doubled. fancybox work. if i put $(document).off(); // The button to increment the product value $(document).off('click', '.product_quantity_up').on('click', '.product_quantity_up', function(e){ // The button to decrement the product value $(document).off('click', '.product_quantity_down').on('click', '.product_quantity_down', function(e){ then fancybox stop work but +- and ADD TO CART worked ok. Edited October 22, 2015 by project00 (see edit history) Link to comment Share on other sites More sharing options...
gabdara Posted October 22, 2015 Share Posted October 22, 2015 Adding those lines shouldn't have any effect on fancybox because they are not related in any way. Reinitializing fancybox might help: $(document).ready(function() { $('.fancybox').fancybox(); ... But I still think you should talk with the theme developer, because he might have done something particular to this theme that isn't in the default one. What we do now is treating the symptoms instead of the root cause. Link to comment Share on other sites More sharing options...
project00 Posted October 22, 2015 Author Share Posted October 22, 2015 i just think it is my fault and i cant find what i change and where. i think may be duplicate something. but i realy dont want start from the begining set new installation add products and so on... but i am realy hoped that someone can show me the way to fix it. before i go to code it worked. i do one function what i need and broke other and now dont remember what i chande. sorry if i doubt. but hope to your help. i will try your last strings. but as i write it work like i say with this strings not work without it work (fancybox). Link to comment Share on other sites More sharing options...
Recommended Posts