adding a simple/basic verifier

I want to add a field to my wix website that will allow a user to enter a certain code, and upon entering the right code it will either show up the product to buy or take them to a product page to buy the product.
To simplify things… the code for all users will be the same. It can be something that’s defined in advance. For example CODE123. When a user enters this code into the field and clicks on a button to verify, then the action happens (the product to appear in some way).
If anything else other than CODE123 is entered, nothing happens.
Basically I want a product to be offered to only those with the right code (not coupon code). Whatever the simplest way to do this.
Can you please help?

Import wix router

then to add your button function,

let code = $w(“#…”).value;

if ( code === ///) {then route to x page}


else display error message

Can you please clarify? Sorry, I’m kinda a nube. Do I just copy and paste the above code somewhere? How exactly do I insert code and where do I put it? Thank you so much, I really appreciate the help.