Back to Documentation

Subscriptions and Single Sign-On


FoxyShop lets you turn WordPress into a full-on Subscription management system. To turn on subscription features, check the “Enable Subscriptions” checkbox in the FoxyShop settings. You’ll then see options to set the frequency, start date, and end date of your subscription product. It’s strongly recommended that you read through the FoxyCart documentation for instructions on setting up your subscription products. Note that FoxyShop expands on the FoxyCart functionality by letting you set a strtotime() value in the start or end dates like +3 months.

Single Sign-On

FoxyShop supports the FoxyCart Single Sign-On (SSO) feature which you can read about here. The SSO feature lets you sync your WordPress users and your FoxyCart users so that when logged in, that login is transferred to FoxyCart and the customer’s saved FoxyCart account information is retrieved at checkout. Furthermore, the FoxyCart ID number is stored as user meta data in the WordPress database so that after checkout, subscriptions and other data can be tied to the WordPress account.

IMPORTANT! Make sure that when you setup your store at FoxyCart you set your password hashing to phpass on the advanced settings tab. Do this before you start adding users so that your passwords can sync back and forth with WordPress. Even if you don’t intend to use SSO, this is a good idea for security.

Whenever a WordPress account is created or updated, a FoxyCart account is created or updated as well. The password is also synced to the FoxyCart account. In the WordPress user profile an administrator will be able to see the FoxyCart account number. This information is hidden from non-administrators.

The FoxyShop settings let you make a logged in WordPress account either optional or mandatory or mandatory on a product-by-product basis. There’s also a feature in the Datafeed Endpoint (you’ll have to enable the xml datafeed) that will, when activated, automatically create or update WordPress users when a checkout has been completed. To turn this feature on, check the option Create/Update WordPress User After Checkout.

If you would like to add your own fields to the user registration screen you can try out the Cimy User Extra Fields plugin. FoxyShop also supports custom filters to easily tie into the FoxyCart user update process with your own fields (address, phone, etc).

Subscription Content Access

If you’d like to restrict areas of your WordPress site to customers with a paid subscription, you can do so using the foxyshop_subscription_active($product_code) function (defined in the plugin’s helperfunctions.php file) on the page with the restricted content. For example, if you’re just offering one subscription product that gives access to certain pages, you’ll use the code found here on the restricted page template. This function requires the subscriptions product code attribute to be passed as an argument.

If you have multiple subscription codes that give access, you’ll want to use a modified version of the foxyshop_subscription_active($product_code) function. The modified version would allow you to look for any active subscription, and thus doesn’t take an argument. You can get the modified version here, and you’ll paste that into your child theme’s functions.php file. Then in your restricted page template, you’ll use this script instead of the example above.

Back to Documentation