Creating a button with 2 different options

Question:
I would like to know if it’s possible to create a button who interact differently with subscribers who purchased a premium plan and free visitors. I would like to be able to update a file only available for customers who purchased a pricing plan and for the other they would be redirected to another page. All that on the same button.

Product:
Wix Editor

What are you trying to achieve:
It would be easier for my customers if it was possible

What have you already tried:
Never tried as I’m not very good with coding…

Additional information:
No more information about it

It wouldnt be the same button, although it would look like it is.
Depending on if a user is logged in then 1 button shows, if no user is logged in then another button shows.

Ah yes it would need to be the same button. Well the premium member have to log in anyway to access the premium files

it maybe possible with the same button. I just havnt tested the code for it yet.

In your button’s onClick function, you could leverage the wix-members-frontend API to check if the user is logged in or check if they are a member. These would let you set up conditionals to run different blocks of code for different users clicking on the same button.