Possible to create a variable url?

Hi,

I have a contact form that posts data to my database included name, lastname, mail, address and → CUSTOMER ID ← created by my submit button.
How can I generate a QR code by the customer ID?
I have this online qr code generator:

So I want to generate a QR code by the customer ID and need a script for insert the ID

Thank you a lot.
Best regards.

1 Like

No examples?

Add an image (anything will do) to your page. You may want to set it to “Hidden on load” in the properties. Then, try this…

$w.onReady( function () {
$w(“#image1”).link = “https://api.qrserver.com/v1/create-qr-code/?data=Customer-ID-Must-Be-Here”;
$w(“#image1”).show();
});

That doesn’t work for me because my script is to create a QR code from the url pathname (example page pathname: 2746267678) so the script should put this ID into image source code. Location.pathname doesn’t work. How to do that?

My script here:

Did you check out wix-location-frontend - Velo API Reference - Wix.com ?
Also, if you are using a variable URL, are you using a wix router? Never used it myself but it seems quite useful. See wix-router - Velo API Reference - Wix.com and there are tutorials available too.

Yes but it doesn‘t work with my script. Can you write the script for me please?

I’m afraid that’s more hand-holding than I’m willing to invest and I’m not in the freelance business. Try Fiverr or similar services to get help coding, or take a Udemy course. Sorry bud, just not my thing.

Ok thank you very much.