• Resolved Luciano Gambino

    (@lgambino)


    Hello. First, thank you for offering this useful plugin.

    I have tried to disable the decimals from settings, deleting the comma, but when updating a product, the price is altered: it begins to delete numbers.

    Maybe in a future update, you can put the option to disable decimals, it would be very useful.

    Searching the forum, 7 years ago a user had a similar problem and fixed it with JQuery. Below is a similar code.

    $('.price-value').each(function() {
    		var text = $(this).text();
    		$(this).text(text.replace(',00', ''));
    	});
    	$('.product-price').each(function() {
    		var text = $(this).text();
    		$(this).text(text.replace(',00', ''));
    	});

    Thank you very much for the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ndre

    (@ndre)

    Hi @lgambino,

    The decimals will be disabled if you delete the decimal separator and save the settings.

    Would you please provide the details on how the price is altered in your case?

    Thread Starter Luciano Gambino

    (@lgambino)

    Hello @ndre, thank you very much for the quick response.

    Yes, I disables decimals, but there is a bug. The problem appears when the price is between 1000 and 999999. I will give you an example.

    1) I remove the decimal separator and save the settings.
    2) I create a product with a price of 1500, for example. I write “1.500”, not “1500”. I publish / update the product.
    3) The product is published correctly and the price is displayed as “1.500”.
    4) I go back and edit something in the same product. The WordPress editor now displays the price as “1.500”. But, remember, I saved it with “1500”. So, if I update the product leaving “1.500”, now the product shows the value of “2”.

    I want to clarify that the same thing happens if I directly place “1.500” and save.

    If I apply the same example but with the number “15000”, I end up with “15”.

    The error occurs with thousands, but not with millions. For example, “1500000” or “1.500.000”, works fine.

    In short, if the price is between 1.000 and 999.999, the system ends up taking the “.” as “,” and approximates the remaining integer.

    Plugin Author ndre

    (@ndre)

    Hi @lgambino,

    Thank you for the details. The latest version has this issue solved.

    Thread Starter Luciano Gambino

    (@lgambino)

    Hi @ndre, checked, thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove decimals from price’ is closed to new replies.