# Create-Account Invitation on the Order Thank-You Page

> Suggests to guest buyers on the WooCommerce thank-you page that they create an account to track this and future orders.

- Type: Universal
- Runs: Woocommerce before thankyou
- Category: [Users](https://wpide.com/library/category/users/)
- Requires: WooCommerce
- Tags: users, woocommerce, accounts
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-thankyou-create-account/

## Code

```php
<?php if ( ! is_user_logged_in() && function_exists( 'wc_get_page_permalink' ) && 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?>
<div class="woocommerce-info wpide-thankyou-account">
    Want to track this order and check out faster next time?
    <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>">Create an account</a> with the same email address.
</div>
<?php endif; ?>
```

## Notes

Only appears when account creation on the My Account page is enabled in WooCommerce settings.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Create-Account Invitation on the Order Thank-You Page" in its snippet library and add it in one click; or create a new Universal snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
