1. Home
  2. Knowledge Base
  3. Advanced Coupons
  4. Store Credits
  5. How to display customer store credit balance with a shortcode

How to display customer store credit balance with a shortcode

Customers often want to see how much store credit they have before they start shopping. You can show their balance on any page or post with a shortcode. This article shows you where to put the shortcode and what the customer sees.

Before you start

  • Store credits must be enabled in Advanced Coupons.
  • The balance belongs to the logged-in customer viewing the page. For a logged-out visitor the shortcode outputs nothing at all.

Add the shortcode to a page

  1. Open the page or post where you want the balance to appear.
  2. Add a shortcode block and enter the shortcode below.
  3. Update the page.
[acfw_customer_store_credit_balance]
Sample page with the shortcode

Check what the customer sees

Open the page while logged in as a customer who has store credit. The balance appears where you placed the shortcode.

Front page when published

Troubleshooting

The shortcode text shows instead of a balance. Check that the shortcode is inside a shortcode block and that the plugin is active. A shortcode from a deactivated plugin renders as plain text.

The balance shows as zero. A zero balance renders as a formatted price such as $0.00, not as blank space. Check the customer’s balance under Coupons > Manage Store Credits. The shortcode reports the balance of whoever is viewing the page, so an admin previewing the page sees their own balance, not the customer’s.

Nothing appears at all. The shortcode returns an empty string for logged-out visitors, so the page shows no balance and no message. Sign in as a customer to test it.

Need help?

If you have a question or run into any issues, we’re here to help.

Was this article helpful?

Related Articles

Complete Your Purchase