Docs
Loyalty Shortcodes

Loyalty Shortcodes

Display Square Loyalty program information using shortcodes on your WooCommerce store.

Use shortcodes to display loyalty program information anywhere on your site. Show points balances, rewards, progress bars, and more.

Requirements

Before using loyalty shortcodes:

  • SquareSync for Woo Pro 7.7.0 or higher
  • Loyalty program enabled in settings
  • Customer linked to Square account
  • Most shortcodes require user to be logged in

Available Shortcodes

Points Balance

Display the customer's current points balance.

[sws_loyalty_points]

Options:

AttributeValuesDefault
formatsimple, badge, detailedsimple
show_labeltrue, falsetrue
classCSS class name

Examples:

[sws_loyalty_points format="badge"]
[sws_loyalty_points format="detailed" show_label="false"]

Tier Status

Show the customer's current loyalty tier and progress to the next tier.

[sws_loyalty_tier]

Options:

AttributeValuesDefault
show_nexttrue, falsetrue
classCSS class name

Example:

[sws_loyalty_tier show_next="true"]

Progress Bar

Display a visual progress bar toward the next reward.

[sws_loyalty_progress]

Options:

AttributeValuesDefault
show_texttrue, falsetrue
heightCSS value20px
colorCSS color
backgroundCSS color
classCSS class name

Examples:

[sws_loyalty_progress color="#4CAF50" height="30px"]
[sws_loyalty_progress show_text="false" background="#eee"]

Available Rewards

Show rewards the customer can redeem.

[sws_loyalty_rewards]

Options:

AttributeValuesDefault
layoutlist, grid, cardslist
show_qualifiedtrue, falsetrue
show_unqualifiedtrue, falsetrue
classCSS class name

Examples:

[sws_loyalty_rewards layout="grid"]
[sws_loyalty_rewards show_unqualified="false"]

Transaction History

Display the customer's points transaction history.

[sws_loyalty_history]

Options:

AttributeValuesDefault
limitNumber10
classCSS class name

Example:

[sws_loyalty_history limit="5"]

Earn Rate

Show how many points customers earn per dollar spent.

[sws_loyalty_earn_rate]

Options:

AttributeValuesDefault
formatsimple, detailedsimple
classCSS class name

Example:

[sws_loyalty_earn_rate format="detailed"]

Complete Widget

Display a comprehensive loyalty dashboard with multiple elements.

[sws_loyalty_widget]

Options:

AttributeValuesDefault
titleText"Your Rewards"
show_pointstrue, falsetrue
show_progresstrue, falsetrue
show_rewardstrue, falsetrue
show_earn_ratetrue, falsetrue
classCSS class name

Example:

[sws_loyalty_widget title="My Loyalty Status" show_history="true"]

Product Points

Show how many points a customer would earn from purchasing a specific product.

[sws_loyalty_product_points]

Options:

AttributeValuesDefault
product_idProduct IDAuto-detected
formatsimple, detailedsimple
classCSS class name

Features:

  • Auto-detects product on product pages
  • Updates dynamically for variable products
  • Shows points for selected variation

Examples:

[sws_loyalty_product_points]
[sws_loyalty_product_points product_id="123"]

Usage Examples

Account Page Widget

Add to customer account page:

[sws_loyalty_widget show_earn_rate="false"]

Product Page Incentive

Add to product template:

Earn [sws_loyalty_product_points format="simple"] points with this purchase!

Add to sidebar:

[sws_loyalty_points format="badge"]
[sws_loyalty_progress height="10px"]

Dedicated Loyalty Page

Create a full loyalty page:

<h2>Your Loyalty Status</h2>
[sws_loyalty_points format="detailed"]

<h3>Progress to Next Reward</h3>
[sws_loyalty_progress]

<h3>Available Rewards</h3>
[sws_loyalty_rewards layout="cards"]

<h3>Recent Activity</h3>
[sws_loyalty_history limit="10"]

Styling

All shortcodes support custom CSS classes:

[sws_loyalty_points class="my-custom-class"]

Default Classes

Each shortcode outputs with default classes:

  • sws-loyalty-points
  • sws-loyalty-tier
  • sws-loyalty-progress
  • sws-loyalty-rewards
  • sws-loyalty-history
  • sws-loyalty-earn-rate
  • sws-loyalty-widget
  • sws-loyalty-product-points

Custom CSS Example

.sws-loyalty-points.my-custom-class {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
}

Troubleshooting

Shortcode showing as text

  • Verify SquareSync Pro is activated
  • Check loyalty features are enabled
  • Clear any caching plugins

No data displaying

  • Confirm customer is logged in
  • Verify customer is linked to Square
  • Check loyalty program is configured

Incorrect points showing

  • Refresh page to get latest data
  • Check Square Dashboard for accurate balance
  • Verify sync is working properly