Ready to get started?Download WordPress


Easy Digital Downloads
[resolved] how to get thousand/decimal separator to work on multilingual site? (22 posts)

  1. Piet
    Posted 1 year ago #

    Hi Pippin,

    I'm having an issue with the thousands/decimal separator on a multilingual website (English (default) German and Greek) using the WPML plugin.

    In the settings I have set the separators to use the mainland Europe way: x.xxx,xx

    In the backend on the product posts I use that notation too: EUR 9,99

    Then on the frontend on the product posts I can indeed see EUR 9,99, however on the checkout page something goes wrong as the total amount shows EUR 9.00

    I have tried to overcome this issue by making a WPML Language Configuration File for your plugin (which also is very very helpful for all the other optional output like email content - http://wpml.org/documentation/support/language-configuration-files/), but then another issue pops up:

    The notation on the checkout page then is at the product itself EUR 9.99 and at the total EUR 9,99

    Have you heard of any of these issues before? How is this normally solved?

    Looking forward to receiving some info on this.

    PS the theme that is used for this site is Restored, a themeforest theme, supposedly especially developed for your plugin.


  2. Ah, I see why you're having problems. There are a few areas where the number formatting isn't applied correctly.

    I've just fixed the bugs and am going to push an update out later today or tomorrow. Once it's out, your issues should be fixed.

  3. Piet
    Posted 1 year ago #

    Fantastic news Pippin, thanks so much!

    btw, if you want I can send you the complete language configuration file that I made for your plugin. Once you add it to the plugin's directory WPML will pick it up. People who don't use WPML will never know the difference.

  4. That would be great if you could send that. If you're are familiar with Github, create and issue or pull request: https://github.com/pippinsplugins/Easy-Digital-Downloads

  5. Piet
    Posted 1 year ago #

  6. Piet
    Posted 1 year ago #

    The latest version does not solve the pricing problem.

    When you set the decimal separator to a comma (,) you still need to use a dot (.) in the pricing of the download configuration. Only then will the backend (products list) and the frontend show a comma.

    BUT, when on the checkout page, the price is still rounded down (basically everything after the decimal separator is completely ignored and replaced with 00.

    Settings - thousand separator is a dot, decimal separator is a comma
    Download Configuration of Single Product - price needs to be set with a dot: 7.99
    Backend Product list shows prices with a comma: 7,99
    Frontend shows prices with a comma and with the correct amount on most pages, only checkout page the total is shown as 7,00

    screenshot: http://img.skitch.com/20120916-f185kxa74fdeuac961bdq2511d.jpg

  7. Piet
    Posted 1 year ago #

    an additional problem is that now on the single product pages the currency no longer shows.

  8. I see the problem and am working on it.

  9. Pretty sure I have this all fixed and working great now. Would you be willing to test the deve version on Github?

  10. Piet
    Posted 1 year ago #

    Yes, I am willing to do that and will let you know the results soon.

  11. Piet
    Posted 1 year ago #

    Currency is back and as long as you write the price in the backend with a dot (.), the price shows correct on the backend and frontend with a comma (,).

    Clicking on checkout after buying now indeed shows the correct price on both the product line as the total line.

    The only warning to existing users is that all prices of existing products have been multiplied by 100.
    In other words, if you have previously added a product as 12,99 in the download configuration settings, after installing the update that price has become 1299,00

    This happens on both prices separated with a dot and with a comma. For a user like me (still in development) obviously not a huge problem, but for people with 100's of downloads this would be terrible.

  12. Piet
    Posted 1 year ago #

    not entirely correct.

    if you choose a comma to be he decimal separator then in the download configuration you need to set the price with a comma too. After saving the price will show with a dot, but on the backend products list it shows with a comma and the frontend is correct too.

  13. The multiplication is definitely not supposed to be happening. I was working on this while half asleep last night, so I most likely missed something simple :)

    A note about setting up prices: if you set the thousands separator to be a ".", then you should use a . in the price option. The same goes for the decimal separator.

    I'll be working on this bug more today.

  14. Piet
    Posted 1 year ago #

    On my development environment I have adjusted all the prices to commas too now and it works perfectly actually.

    Once saved it still shows the price with a dot (in the download configuration box; everywhere else it shows the comma), but that is ok with me

    The multiplication only happens if you set the decimal separator to be a comma and then input prices with a dot.

  15. The meta box should never change what you insert, so if you set the price with a comma, the comma will be saved. if you set the price with a decimal, the decimal will be saved. If this is not the behavior you're seeing, then I need to address that as well.

  16. Piet
    Posted 1 year ago #

    this is indeed not the behavior I am seeing. I input a comma, after saving it outputs a dot, but everything else is showing the comma.

    I am sorry that I seem to have opened a horn's nest...

  17. When you say it outputs a dot, do you mean it does that in the price field in admin, or on the front end when the price is displayed (such as in the checkout)?

  18. Piet
    Posted 1 year ago #

    no, what I mean is that the dot only shows in the price field of the download configuration box of a single product

    And I just realised that the dot also shows in the email that is sent to the site admin...

  19. Normal or variable prices?

  20. Piet
    Posted 1 year ago #

    I'm only using normal prices on this project

  21. Ok thanks. I'm going to do my best to get this resolved as soon as I can, but it might be a day or two.

  22. Piet
    Posted 1 year ago #

    sure no worries, Pippin; the project is still in development.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic