All Collections
API / Customization / Advanced
HAPI Sample - Account Subscription Page
HAPI Sample - Account Subscription Page

You can customize the /account/subscription/# page with the following HAPI sample.

Updated over a week ago

If you would like to replace the out of the box page at /account/subscription/# you can do this by setting the marketing keyword of the page to account_subscription.

You can leverage this code to build a similar experience by calling the component subscription:

<div>
    <div class="qtr-section-block no-banner" data-pv-component="subscription" data-pv-type="" data-pv-parameters="{customer_no: {@var_customer_no@}, totalResults: 1}" data-pv-object="obvs">
        <div class="large-wrapper clearfix">
            <div class="col col-6 sm-col-12">
                <h4 class="qtr-section-block black">YOUR SUBSCRIPTION</h4>
                <div class="qtr-section-block">You are currently subscribed to:</div>
                <h2 class="half-section-block" data-pv-element="service.service_title">Service Title</h2>
                <div class="half-section-block">
                    <p>Your account is currently <span data-pv-element="subscription_status">active</span>.</p>
                    <p>You were last charged <span data-pv-formatter="currency" data-pv-element="subscription_rate">$0.00</span> on <span data-pv-element="last_date" data-pv-formatter="date(ddd, MMM d, yyyy)">Wednesday, May 15, 2019</span> based on your <span data-pv-element="subscription_frequency">monthly</span> payment.</p>
                </div>

                <div data-pv-component="text" data-pv-conditional="{@subscription_status@} != active ">
                    MAYBE PROMPT TO TAKE PAYMENT
                    <a class="button orange-background uppercase float-left" href="/checkout/subscription_payment/{@subscription_no@}">Activate Membership</a>
                </div>

                <div data-pv-component="text" data-pv-conditional="{@card_no@} = 0">
                    <div class="half-section-block">
                        <p>Looks Like We Don't Have Your Payment Method On File.</p>
                        <p>Add a payment method to make sure you don't get locked out of your account. Your card will not be charged until your next renewal is due.</p>
                    </div>
   
                    <a class="button orange-background uppercase float-left" href="/account/payment/subscription/{@subscription_no@}">Add Payment Method</a>
                </div>
               
                <div data-pv-component="text" data-pv-conditional="{@card_no@} != 0">
                    MAYBE THEY WANT TO CHANGE THEIR CARD HERE SAME LINK
                    <a class="button orange-background uppercase float-left" href="/account/payment/subscription/{@subscription_no@}">Change Payment Method</a>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
</div>
Did this answer your question?