Customize "Access only with Pricing Plan" - Page

Hi

For everyone looking to “customize” the page which shows up, if a user doensn’t have a pricing plan, here’s a workaround:

In you Standard Plans & Pricing Page add this code:

import wixLocation from 'wix-location';

$w.onReady(function () {
    let queryParams = wixLocation.query;
    if ("appSectionParams" in queryParams) {
        wixLocation.to("/preise?NoPlanRedirect=true"); //This is redirect to the page you want the user to land on, when he has no pricing plan.
    } else {
        $w('#section1').expand(); // This is the Section or Strip of your Standard Pricing Plans Widget. You have to set it to "collapsed" on load.
    }
});
2 Likes

I like how quick and succinct this solution is. One thing I’d caution is that while this would work for the conceivable future it’s always possible that the name of the queryParams could change in the future as it’s not a guaranteed part of the API.

Another way to do this is to use memberListOrders - Velo API Reference - Wix.com and filter to only ACTIVE orderStatuses then check if the returned orders object is empty. Also gives flexibility to take different actions depending on the status of the order(s) if you’d like to customize further.

Ah yes, I haven‘t even thought about that. Very cool👍🏻