Jump to content

AlexPopov

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Location
    Ukraine
  • First Name
    Alexiy
  • Last Name
    Popov

Recent Profile Visitors

193 profile views

AlexPopov's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. I thank Mykhailo for solving this problem. I repeated this trick in prestashop 1.6.1.19. For those who need to repeat this operation, I want to give two additions in the code that helped me a lot. These solutions will be useful if you need to add a product in 0.1 increments. 1) For Product page in the product.js you need to replace the script // 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 (!allowBuyWhenOutOfStock && 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); $('#quantity_wanted').change(); }); // 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); $('#quantity_wanted').change(); }); to var allowBuyWhenOutOfStock = true; var quantityAvailable = 1000000; var fieldName; // The button to increment the product value $(document).on('click', '.product_quantity_up', function (e) { e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseFloat($('input[name=' + fieldName + ']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) { quantityAvailableT = quantityAvailable; } else { quantityAvailableT = 100000000; } if (!isNaN(currentVal) && currentVal < quantityAvailableT) { currentVal += 0.1; } else { currentVal = quantityAvailableT } $('input[name='+fieldName+']').val(currentVal.toFixed(2)).trigger('keyup'); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down', function(e) { e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseFloat($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1.0) { currentVal -= 0.1; } else { currentVal = 1; } $('input[name='+fieldName+']').val(currentVal.toFixed(2)).trigger('keyup'); $('#quantity_wanted').change(); }); 2) For Cart page In the cart-summary.js you need to replace the script qty = 1; to qty = 0.1; I hope this will be useful to someone.
  2. Hello guys. Thank you for solving the problem with decimal. According to the instructions from Mykhailo. I set the decimal on Presta 1.6.1.17 and encountered some problems. Please help me figure it out. 1) Since I'm not a programmer, it's difficult for me to understand how to change the format decimal numbers the value in the input on Product page. For example, I have 1.900000000 in the input, and I need 1.9 2)I also could not get the elements - / + to add decimal numbers to the sum of products on the Cart page. Tell me, please, where can I find a place in the files where this can be fixed. Thanks!
  3. Hi there, I noticed that errors appear in the logs of my store. How can I get rid of these errors? I have Prestashop 1.6.1.17 Thanks!
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More