Dropdown doesn't load during sign-up process

Annoying issue. Pls help with any suggestions. Created custom sign-up form which is pulling pricing plan data from backend and enabling a dropdown to display those results.

This is the website https://www.tradewindsranchhi.com/ if i go through the process where I click login. click sign-up, the dropdown loads properly with the details.

If i go through Tradewinds Ranch PMA , and click sign-up, the dropdown doesn’t load even if there are no errors in the console

Pls let me know what could be wrong!

I see the issue. That’s weird. Show us your code so that we can understand what’s happening behind the scenes.

Hi @Pratham

Code is as below

import { getAllPlans} from 'backend/pricingPlans.jsw'

$w.onReady(function () {

    getAllPlansForDropdown()
        .then((result) => {
            console.log(`result Flag is ${result}` );
        })

})



export async function getAllPlansForDropdown() {
    return getAllPlans()
        .then((result) => {
            console.log(result);

            console.log(result[0].description);
            let count = result.length;
            console.log(count);

            let opts = [];
            //w('#membershipDropdownInput').options = opts;

            for (let i = 0; i < count; i++) {

                opts.push({ "label": result[i].description, "value": result[i]._id });
            }
            console.log(opts);
            $w("#membershipDropdownInput").options = opts;
            $w('#membershipDropdownInput').enable();
            $w('#membershipDropdownInput').placeholder = "Choose your membership";
            return true

        })
        .catch((err) => {
            console.log(err);
            return false
        });

}

//backend


export function getAllPlans() {

    return wixPricingPlansBackend.queryPublicPlans()
        .find()
        .then((result) => {
            console.log(result);
            return result.items
        })
        .catch((error) => {
            console.error(error);
        });
}

Console log for opts is showing all the values. but the dropdown just doesn’t load when the flow goes through /account/my-account

One alternative that I’d like to suggest is that you try using async await and see if that’s working for you. Here’s a detailed video by The Wix Wiz showing how you can fetch and display your Pricing Plans using this method.

The plans in this case have been fetched by querying the Plans Data collection like you do with any other collection, instead of using the premade function, i.e. wixPricingPlansBackend.queryPublicPlans().

Do remember to create a backup of your current code before overwriting it. If it still does not help, I’d recommend you get in touch with Wix Support.