Qr-code Display-HELP US

I’m New for coding, I want to display my customer card numbers in to Qrcode format.
i didn’t know to write coding to fetch the QRcode API to user input text box.
As shown below its displaying as a number i want this to automatically change to Qrcode or barcode. Pls help me on this coding.
i did not go live because of this.

1 Like

Hello,
As I understand from your description, you’d like to do the next:
You have a list of cards = id’s, instead of a number you want to generate a barcode.

Please see my sample (using the next API - QR code API )

I have a list of ID’s in my collection

Using a button with onClick event, to set a src for html component - with value from database.

Here is the code:

$w.onReady(function () {
	$w("#button1").onClick(() => {
		var cardid = $w("#input1").value;
		$w("#html1").src = "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=" + cardid;
		$w("#html1").show();
	})
});

Here is the site with live sample:
https://alex-wix.wixsite.com/barcode

Thanks.

1 Like

Thanks, it works great…

Hello Mr.Alex,

I have few doubts How to generate a Random Alphabet letters by using Wix code.

loyal customer visiting our shop and purchasing items, he/she will be sent a random alphabet as a SMS
During the duration of this campaign period,
If he/she gets all the alphabets constituting the word SHOP T, an SMS/Email will be sent.
On Wix database i am importing the information of Customer name/invoiceno/rewardcardno/amount. there is one more field on this DB called Gift. i want system to generate a Random Alphabet form “A-Z”.
If he/she gets all the alphabets constituting the word SHOP T. Will get the gift.

Could you please guide us how to write a code for this.