HTML entities displayed + Control chrome prefilled form ?

WordPress Event Management, Calendars & Registration Forums General Question HTML entities displayed + Control chrome prefilled form ?

This topic contains 6 replies, has 2 voices, and was last updated by  Stephen Harris 4 years, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #36871

    Hi,

    I´m working with EO version 3 on a local test site and we only use offline payment.

    1.
    On the new confirmation page, the HTML entities for non breaking space are displayed on the screen where the price and total appear (price spacing)
    …we use Swedish currency with “Currency position: after” ?

    2.
    When filling out “Name” in a form Chrome automatically triggers prefilled adress which loads our “discount code” field with a prefilled zipcode, is there any way to control/remove this?

    Thanks!

    AK
    #36885

    1) I can’t reproduce this, additionally   doesn’t appear in the code base (or at least not on anything impacting the front-end. Could this be a result of text translation?

    2) Looks like its harder than it should be (https://stackoverflow.com/questions/15738259/disabling-chrome-autofill) – (The plug-in actually sets autocomplete="off" in templates/eo-booking-form.php – so you might want to try some of the other suggestions, such as autocomplete="false")

    Stephen Harris
    #36932

    1) It does seem to be related to translation (I just tried it on a new installation where I have not made any customizations) If I “book” something with a price of 4 digits for example 7000 then the “total” while on english version is “7,000.00kr” (I have set Swedish currency) but when I have switched to Swedish WordPress then “total” is showing 7 000,00kr
    (this is on the new extra confirmation page and we only use offline payment option)

    AK
    #36933

    So does this appear only on the thousands-seperator?

    The plug-in uses the thousand and decimal point according to the locale (e.g. in the UK it would be expressed as 7,000.00 whereas some countries in Europe would use a comma for the decimal point and period for the thousands separator (7.000,00). Sweden, if I’m not mistaken, uses a space as the thousand seperator.

    If that was encoded as non-breaking space, then that would explain the html entity you’re seeing (as its not expecting any html and so is escaping it).

    I wouldn’t want to allow html entities in the prices, so either there is a bug in WordPress’ translations in that the thousand seperator shouldn’t be a html entity or that the plug-in needs to accommodate that.

    I’ll investigate a bit further.

    Stephen Harris
    #36934

    It appears WordPress id purposefully replacing spaces with non-breaking space html entities: https://github.com/WordPress/WordPress/blob/6d40400756c0dc14c7f9aac1e60f6a84fc428b3d/wp-includes/class-wp-locale.php#L203

    I’ll release an update shortly to fix this. In the mean time, if you wanted, you can edit line 174 of class EO_Money (includes/class-money.php) to add:

    $formattedAmount = str_replace(' ', '', $formattedAmount);
    
    Stephen Harris
    #36942

    Thank you!

    AK
    #36990

    This should be fixed in 3.0.8

    Stephen Harris
Viewing 7 posts - 1 through 7 (of 7 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.