Format Currency Data

Yeah at the moment this is a really ridiculous setup which we haven’t properly solved yet (sorry) – here’s how I make it work atm on Rediverge:

{{#if @member.paid}}

    {{!-- Logged in, paying member: Show account info --}}
    <article class="post-content">
        <div class="container">
            <div class="content">
                <form class="authbox">
                    <h1 class="authbox-title">Nice, you're a subscriber!</h1>
                    <p>Hey! <strong>{{@member.email}}</strong> has an active {{@site.title}} account with access to all areas. You're all set, but if you need any help, get in touch on <code>support@rediverge.com</code> for assistance!</p>
                    <div class="authbox-signup">
                        {{#foreach @member.subscriptions}}

                        <ul>
                            <li><strong>Plan:</strong> Early adopter — $<span class="plan-price">0</span>/{{plan.interval}}</li>
                            <li><strong>Card:</strong> **** **** **** {{default_payment_card_last4}}</li>
                            <li><strong>Renews:</strong> {{date current_period_end format="DD MMM YYYY"}}</li>
                        </ul>

                        {{#contentFor "scripts"}}
                        <script>
                            $(document).ready(function () {
                                var planAmount = {{plan.amount}} / 100;
                                $(".plan-price").html(planAmount);
                            });
                        </script>
                        {{/contentFor}}

                        {{/foreach}}
                    </div>
                </form>
            </div>
        </div>
    </article>

{{else if @member}}

We’ll have a proper helper for doing this correctly soon

5 Likes