Viewing 6 replies - 1 through 6 (of 6 total)
  • If you’d like us to take a look at this – please can you create an admin account for us and send the credentials to [email protected]

    Plugin Author Peter Hardy-vanDoorn

    (@petervandoorn)

    No need @eilvbell.

    Your code is asking for the locale of the site, rather than asking WooCommerce.

    Lines 282 & 283 of opentickets.php are the start of the problem:

    $locale = apply_filters('plugin_locale', get_locale(), 'woocommerce');
    setlocale(LC_MONETARY, $locale);

    Lines 12 and 67 of my-upcoming-tickets.php are then using money_format(), but the locale set above is returning “en_US”, so it’s using a $.

    The wc_price() function will return a formatted price (although it does include HTML markup, but it’s a start!)

    BTW, yes I could set the WP language to en_GB, but the problem with that is that WooCommerce changes “cart” to “basket”, but your code does not, so I end up with some things referring to “basket” and others saying “add to cart”.

    Plugin Author loushou

    (@loushou)

    Hey @petervandoorn – I see what you mean. I will do some thinking on this, because as you kind of hint towards here, there are a lot of moving parts to consider. Most likely the best way to go is to figure out the locale from WooCommerce rather than the site as a whole, but I will need to verify that this does not have any additional ramifications to consider before making it an official change. I will keep you posted on this.

    Loushou

    Plugin Author loushou

    (@loushou)

    Hey @petervandoorn ,
    After a little digging (and remembering) it seems like the only reason we even had that set, was so that the my account page would display the correct currency in certain areas (ironically). I have remove the locale bit from the plugin, and gone with your excellent suggestion of offloading the display of the values on that page to the wc_price() function. This puts everything back right I believe. Let me know if you concur.

    Thanks again,
    Loushou

    Plugin Author Peter Hardy-vanDoorn

    (@petervandoorn)

    Hi @loushou – thanks for that, but you’ve only changed line 67, which displays the tickets “By Event”. You also need to apply the fix to line 12 which displays “As Line Item List”.

    Cheers

    Plugin Author loushou

    (@loushou)

    Hey @petervandoorn ,

    Thanks for this, and sorry about that. You are correct, I did skip over the alternative view of the my account page, which is unlike me. I have corrected the problem and made a new release, 1.10.3.

    Loushou

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Currency display bug’ is closed to new replies.