Skip to main content

Stop members receiving referral rewards on their own purchases

Add a checkout extension that removes a member's own referral code from their order, so referral codes are only used by the friends they're shared with.

Written by Bartlomiej Rekosiewicz

The Self-referral check is a Shopify checkout extension. When a signed-in shopper reaches checkout, it checks whether they created the referral code in their cart. If they did, the extension removes the code and checkout continues without the discount.

Loyalty also doesn't award referral points when a member uses their own code. This applies even if the code isn't removed at checkout.


How it works

When a shopper reaches checkout with a referral code applied, the extension checks whether the signed-in shopper created that code.

  • The code belongs to someone else: checkout continues as normal.

  • The code belongs to the shopper: the extension removes the code, and they can complete their order without the discount.

The check only applies to signed-in shoppers. If a member checks out as a guest, their own referral code still applies the discount, but they don't earn referral points.

You can also let the extension block checkout. This is a fallback for when the code isn't removed automatically.


Add the self-referral check

  1. In Shopify admin, go to Settings > Checkout.

  2. Under Configurations, select Edit.

  3. In the Checkout editor, select Apps.

  4. Under All, select the + icon next to Self-referral check.

  5. Confirm that the extension appears in the checkout preview.

  6. Select Save.


Block checkout if removal fails

The extension removes the shopper's own code automatically. If removal fails, you can choose to block checkout until the shopper removes the code themselves.

  1. In the Checkout editor, select the Self-referral check.

  2. In the right panel, turn on Allow app to block checkout.

  3. Select Save.

When checkout is blocked, the shopper sees an error banner and can't select Pay now until they remove their referral code.


Verify your setup

  1. Visit your storefront and sign in as a member enrolled in your loyalty program.

  2. Copy your referral link or code from the Referral block.

  3. Apply your own referral code to an order and go to checkout.

  4. Confirm that:

    • The referral code is removed.

    • A banner tells you the code was removed.

    • You can complete checkout without the referral discount.

Did this answer your question?