• Resolved baksudin

    (@baksudin)


    Hi, I’ve seen your message concerning missing currency filter:

    add_filter('pms_currencies', 'pmsc_add_currency');
    function pmsc_add_currency($currencies) {
    	$currencies['CRC'] = __( 'Costa Rican Colon', 'paid-member-subscriptions' );
     
    	return $currencies;

    I have two questions:
    (This is all new to me, so don’t laugh, please)

    #1 – Do I paste this code (with RSD and Serbian dinar, instead of CRC) somewhere in the plugin, or add as css (in customizer), or do I have to create a child theme and then change it there?
    #2
    Serbian Dinar RSD is somehow displayed in Cyrillic -as дин. instead of Latin: RSD. I’ve played with the code based on what others suggested for woocommerce, but I’m obviously doing something wrong, because the Cyrillic version won’t budge. ??

    Thanks

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @baksudin,

    1. The code can be added into the functions.php file of your child theme. But you could also create a custom plugin with it, as explained at the top of this page: https://www.cozmoslabs.com/docs/paid-member-subscriptions/developer-knowledge-base/

    2. That’s the symbol we use for it, in the native language. These can be changed as well, here’s some sample code:

    add_filter( 'pms_currency_symbols', 'pmsc_change_currency_symbol' );
        function pmsc_change_currency_symbol( $symbols ){
    
            if( isset( $symbols['RSD'] ) )
                $symbols['RSD'] = 'RSD';
    
        }
    Thread Starter baksudin

    (@baksudin)

    Hi, Georgian,
    thanks for your reply.
    I’ll try this when I get to know things how child theme works (have never done it).
    Could you also tell me how to change the response I get from the code – because it’s set on Serbian – it presumes I want a Cyrillic script.
    For example – month: instead of avgust, it’s август. ??

    Thanks again!

    Thread Starter baksudin

    (@baksudin)

    Just dropped by to say that the code you provided works. ??
    I wrote the second question in a hurry, and it probably doesn’t make any sense, so I’ll retype it, just to clarify things.
    What I meant earlier is that when you choose the country (in this case Serbia is somehow connected to Cyrillic, by default), the form field for date/month automatically gives – август – in Cyrillic (the same thing as with RSD and дин).
    What code should I add to switch it to Latin script?

    thanks again.

    Plugin Author Georgian Cocora

    (@raster02)

    Hello @baksudin,

    I’m not sure which form field you are talking about, can you show me a screenshot?

    And by choosing the country, you mean in the WordPress General Settings?

    Thread Starter baksudin

    (@baksudin)

    Hi,
    No, not WordPress. When I choose Serbian currency (in payment options), the plugin itself creates a form for payments automatically, displaying the date when your subscription started and when it’s going to expire.
    The months on these dates are displayed in Cyrillic: On the left – 22. August
    screenshot

    Plugin Author Georgian Cocora

    (@raster02)

    Hello @baksudin,

    The language of the form is determined by the WordPress settings as I said. it is not defined by the currency that you select.

    Anyway, I see what you mean now, if you set your WordPress language to Serbian, the months will be written in Cyrillic.

    This happens because of translations, the months are simply translated this way. This is coming directly from WordPress as we are formatting the dates using the date_i18n function.

    I am not sure how to change these, you need overwrite the translation I think. Maybe Loco Translate can help you with this.

    Regards.

    Thread Starter baksudin

    (@baksudin)

    Hi,
    Thanks again!
    My site is not translated. I manually translated (with Translatepress) some fields concerning the plugin. (adding the paths in Translatepress)
    Do you mean that Translatepress did it automatically – because I chose Serbian for primary language (inside the plugin, not the whole wp site?)

    Cheers,

    Thread Starter baksudin

    (@baksudin)

    Me again,
    I took a look at the page (without the path for Translatepress to work its magic) and it’s – August.
    It’s the plugin.
    Is there a way to make the Translatepress to display the results in Latin for Serbian, not Cyrillic?
    Thanks again for your time.

    Plugin Author Georgian Cocora

    (@raster02)

    So if your default language is English but you added Serbian in TranslatePress and switch to it, these language files will be loaded automatically and the translations apply (just like it translates the columns of the same table you showed me).

    At the moment, you need to do the same thing, somehow edit the months translations coming directly from WordPress. Loco translate should help.
    You cannot make this change with TranslatePress directly but you will be able to in the future.

    Regards.

    Thread Starter baksudin

    (@baksudin)

    Thanks,
    the problem is exactly that – the months are generated automatically – by the plugin (depending on when the subscription started), so there isn’t a manual option for that. I guess, I’ll have to leave it as it is, or try to fiddle with the wp itself ??

    Thanks,
    S

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘currency correction’ is closed to new replies.