Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FR] Currency Symbol for Sites #2540

Closed
davidhellmann opened this issue Mar 6, 2018 · 3 comments
Closed

[FR] Currency Symbol for Sites #2540

davidhellmann opened this issue Mar 6, 2018 · 3 comments

Comments

@davidhellmann
Copy link
Contributor

We built a Shop with different languages.
Next to the country code should be the Currency Symbol for the language.

Any way to bring this in with core features?

AT (€)
US ($)

And Stuff like this.

@davidhellmann
Copy link
Contributor Author

Something like this
image

@brandonkelly
Copy link
Member

brandonkelly commented Mar 6, 2018

Each locales doesn’t necessarily have a single currency, so we can’t do anything to make this easy for you.

That said you could write a macro that outputs it.

{% macro currencySymbol() %}
{%- spaceless %}
    {% switch craft.app.language %}
        {% case 'en-us' %}
            $
        {% default %}
            €
    {% endswitch %}
{% endspaceless -%}
{% endmacro %}

{% from _self import currencySymbol %}

{{ currencySymbol() }}

@davidhellmann
Copy link
Contributor Author

Oh yes, macro! Good solution I think that can work. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants