The Loyalty Card widget and the Store Credit widget sit on your Shopify cart page and show customers how many loyalty points they have. From there, customers can spend those points as a cart discount or turn them into store credit, without leaving the cart.
Both widgets have been redesigned. They have a modern look, load faster and show a loading placeholder while they appear. They also work inside cart drawers (the slide-out cart that many Shopify themes use) as well as on the full cart page. In AiTrillion, you control each widget with its own redemption rules: the points-to-currency rate, a minimum cart amount, and the fewest and most points a customer can redeem.
This article
explains what has changed, then shows you step by step how to set up both
widgets, set their rules and text, and add them to your store.
1. Modern design
• Both widgets have been rebuilt with a clean, modern interface and an improved layout.
• They render faster and more smoothly than the previous version.
2. Faster loading with Shopify metafields
• The widgets now read the data they need from Shopify metafields.
• They no longer wait for a separate request to AiTrillion before they appear, so they load much faster and your storefront stays quick.
3. Skeleton loading
• While a widget loads, customers see a skeleton placeholder (a grey outline of the widget) instead of an empty space.
• Customers can tell straight away that their points are on the way, and the page looks more polished.
4. Better cart drawer support
• The widgets now have a dedicated layout for the cart drawer, designed to work with the different cart drawers that Shopify themes use.
•
The widgets load quickly and display correctly when a
customer opens or uses the cart drawer.
• A more modern and attractive storefront.
• Faster first load, with no extra request to fetch widget data.
• Better perceived speed, thanks to skeleton loaders.
• Works with a wider range of Shopify cart drawers.
•
A smoother experience for customers checking and
spending their loyalty points and store credit.
• The Loyalty rewards module must be enabled. If it is not in your left navigation, add it from the Customize modules panel.
• Customers earn the points they spend in these widgets through your earning rules (Loyalty rewards › Set up program › Earn points). Set those up first.
• To use the Store Credit widget, your store must grant AiTrillion the additional store credit permission in Shopify. Your customers also need Shopify’s new customer accounts to see and spend store credit at checkout.
•
You need access to edit your store theme’s code, or to
the theme editor’s Custom Liquid block, to paste the widget snippets.
These are the same places you would paste any other theme code.
In the left
navigation, expand Loyalty rewards › Set up program and click Redeem
points. The View rewards tab lists every reward customers can spend
points on. The two widgets appear here as Cart widget discount (the
Loyalty Card widget) and Store credit (the Store Credit widget).
Figure 1: Go to Loyalty rewards › Set up
program › Redeem points. The two widgets are listed under View rewards.
If either
widget is not listed yet, open the Create rewards tab and click Cart
redeem points widget or Store credit to set it up. Store credit asks
for the extra Shopify permission the first time you enable it.
Figure 2: Create the widgets from the
Create rewards tab if they are not set up yet.
On the View rewards tab, click the edit (pencil) icon on the Cart widget discount row. The Cart widget discount window opens. The left side controls the widget on the cart page. The right side controls how the reward appears in the loyalty popup.
Turn on the widget and set the point value
Turn on Display
on cart to show the Loyalty Card widget on the cart page. In Enter
points, enter how many points equal one unit of your store currency. For
example, 20 means 20 loyalty points = $1 (or €1) off the cart.
Figure 3: Turn on Display on cart and
enter how many points equal 1 unit of your currency.
These flexible rules decide when and how much a customer can redeem:
• Minimum cart amount ($) (required): the cart total a customer must reach before they can redeem points.
• Minimum points to claim: the fewest points a customer can redeem at one time.
•
Maximum points to claim: the most points a
customer can redeem at one time. Use it to cap the discount on a single order.
Figure 4: Set the minimum cart amount and
the minimum and maximum points a customer can claim.
Cart widget
title (required) is the headline customers see in the widget. Use {{remaining-points}}
to show the customer’s own balance, for example You have
{{remaining-points}} Reward points. Use Cart widget text to add an
optional line underneath, such as how redemption works.
Figure 5: Enter the Cart widget title
and, if you like, the Cart widget text.
Note: You can change this text in different languages. The banner at the top of the window is a reminder of this.
Turn on Display on storefront popup to also list the cart discount as a reward in the loyalty popup on your storefront. Then set what the popup shows:
• Reward title (required): the name of the reward, for example Discount against orders.
• Reward text: the description. Use {points} and {amount}, for example Redeem {points} points to save {amount}.
• Minimum cart amount text: explains the minimum, for example With minimum purchase of {amount}.
•
Show unused reward coupons: turn on to show
customers any coupons they have already redeemed but not used yet.
Figure 6: Choose how the cart reward
appears in the storefront loyalty popup.
Click Update
to save the Loyalty Card widget. The Shortcode box at the bottom of the
window shows the widget’s basic shortcode, <div
class="aaa-loyalty-cartredeem-widget"></div>. For the
redesigned widget, use the snippets in Step 12 instead.
Figure 7: Click Update to save the
Loyalty Card widget settings.
Back on the View rewards tab, click the edit (pencil) icon on the Store credit row. The banner at the top is a reminder that customers need access to Shopify’s new customer accounts to see and spend store credit at checkout.
In Enter
points equivalent to 1 unit of your currency (required), enter the
conversion rate. For example, 10 means 10 points = $1 of store credit.
Figure 8: Enter how many points convert
into 1 unit of store credit.
• Min points to redeem (required): the fewest points a customer can convert into store credit at one time.
•
Max points to redeem (in 1 day) (required): the
most points one customer can convert in a single day. This protects you from
large one-off conversions.
Figure 9: Set the minimum points per
redemption and the maximum points per day.
• Shop credit title: the headline in the widget, for example You can redeem {{remaining-points}} loyalty points to store credit.
• Description: a short line customers see on your store, for example Convert 10 points = $1 store credit. Update it if you change the conversion rate.
•
Store credit: the label used for the store
credit reward, for example Store credit.
Figure 10: Enter the title, description
and label customers see in the Store Credit widget.
Under Store
credit expiration, choose No expiration to keep store credit for as
long as the customer has it, or choose Set expiration duration (in days)
and enter the number of days the credit stays valid after it is issued.
Figure 11: Choose No expiration, or set
an expiration duration in days.
Note: Countries have different laws about store credit expiration. Check the rules that apply to your store before you set an expiration period.
Click Update
to save. As with the cart widget, the Shortcode box shows the basic
shortcode, <div
class="aaa-loyalty-shopcredit-widget"></div>. For the
redesigned widget, use the snippets in Step 12.
Figure 12: Click Update to save the Store
Credit widget settings.
Go to Loyalty rewards › Display on store and open the Widgets tab. The Cart redemption card has the snippets for both redesigned widgets. Each widget has two versions:
• For Shopify stores: a Liquid snippet. It reads the widget settings from your store’s Shopify metafields, so the widget appears without waiting for an extra request to AiTrillion. It loads the redesigned widget script (aio-loyalty-v2) and is set up to work in cart drawers.
• For other platform stores: a single line of HTML for stores that are not on Shopify.
Loyalty Card widget (Loyalty cart redeem widget)
Under Loyalty
cart redeem widget › For Shopify stores, click the copy icon and
paste the snippet into your cart template (the cart section file), or into a Custom
Liquid block on your cart page or cart drawer, where you want the widget to
appear. The widget shows only when the Loyalty rewards module is on, the cart
widget is turned on, and the cart has at least one item.
Figure 13: Copy the Loyalty cart redeem
widget snippet for your platform.
Store Credit widget (Loyalty store credit widget)
Under Loyalty
store credit widget › For Shopify stores, copy the snippet and paste it in
the same way. The widget shows only when the Loyalty rewards module and the
store credit reward are both turned on. If the cart widget is already on the
same page, the snippet doesn’t load the widget script a second time.
Figure 14: Copy the Loyalty store credit
widget snippet for your platform.
Adjust the width and spacing
Both snippets include two settings you can change directly in the code: data-block-width (default 100%) sets how wide the widget is, and data-block-margin (default 10px 0px 10px 0px: top, right, bottom, left) sets the space around it. Leave data-cart-drawer="true" as it is so the widget works in your cart drawer.
Note: If your theme still has the older one-line shortcodes, replace them with the new For Shopify stores snippets. That way your store uses the faster, metafield-based widgets. Keep only one copy of each widget on a page.
Turn a widget on or off
On the View
rewards tab, use the switch at the end of the Cart widget discount
or Store credit row to turn that widget on or off. Turning a widget off
hides it from customers, and the Shopify snippet stops showing it. You don’t
lose its settings, and you don’t need to remove the snippet from your theme.
Figure 15: Use the switches to turn each
widget on or off.
• On the cart page: as the cart loads, a skeleton placeholder appears straight away and is replaced by the widget, showing the customer’s point balance and the redemption option.
• In the cart drawer: when a customer opens the slide-out cart, the widgets load and display correctly inside it, and stay correct as the customer changes the cart.
• Loyalty Card widget: once the cart reaches the minimum cart amount, the customer chooses how many points to redeem (within your minimum and maximum) and gets a discount on the order.
•
Store Credit widget: the customer converts
points into store credit (within your daily limit). Store credit is spent at
checkout through Shopify’s new customer accounts.
Note: The faster loading comes from the For Shopify stores snippets, which read your widget settings from Shopify metafields. Use those snippets on Shopify stores, not the basic one-line shortcodes.
Note: Changes you save can take up to 15 minutes to appear on your storefront.
Note: The Store Credit widget needs the extra Shopify store credit permission, and customers must use Shopify’s new customer accounts to spend store credit at checkout.
Note: Test both widgets on your cart page and in your cart drawer with a test customer who has points before you announce them to customers.
The widget does not appear on my cart page.
Check that the widget’s switch is on under View rewards, that Display on cart is on for the Loyalty Card widget, and that the snippet is in your theme’s cart template. The Loyalty Card widget shows only when the cart has at least one item. Then wait up to 15 minutes and refresh your store.
The widget shows only the loading placeholder.
The widget data comes from Shopify metafields. Refresh the page after a few minutes. If it still doesn’t load, check that the AiTrillion app is still installed and active on your Shopify store.
The widget doesn’t show in my cart drawer.
Cart drawers differ from theme to theme. Make sure the widget works on the main cart page first. If it still doesn’t appear in the drawer, contact AiTrillion support with your theme name.
A customer can’t redeem points in the Loyalty Card widget.
The cart total must reach the Minimum cart amount, and the customer must have at least the Minimum points to claim.
A customer can’t see or use store credit at checkout.
The customer needs Shopify’s new customer accounts, and your store must have approved the store credit permission. Also check that the customer has not reached the Max points to redeem (in 1 day) limit.
Review how customers earn points under Loyalty rewards › Set up program › Earn points, and adjust the look of the loyalty popup under Loyalty rewards › Display on store.