I need to be able to assign custom number automatically to each customer who checkouts via the website.
Case 1:
Customer Orders Quantity of 3 of one product. When customer checkouts and the sale is processed, the website should then automatically generate 3 random numbers (3 random numbers as it was 3 quantity ordered).
Case 2:
Customer Orders Quantity of 10 of one product. When customer checkouts and the sale is processed, the website should then automatically generate 10 random numbers.
The random numbers should be saved to a separate accessible database with a specific field detailing the buyers name next to each entry. I.e the three entries from case 1 will have the same customer name but different numbers.
These numbers should also be viewable inside the customers member area, but only their numbers. Not everyone else.
Thank you for your input. Im aware that the random numbers can be generated on successful checkout, however, I need a random number generated for each quantity … i.e 10 random numbers if quantity ordered is 10 etc
Hi, I’m in the same boat I know how to generate random numbers but don’t know how to for multiple purchases like Dorricott mentioned initially. I want a random number to be generated so for 1 purchase there will be 1 random number generated for 3 purchases 3 individual random numbers are generated. I also want to know how I can attach those numbers to the purchase email they receive after they pay for the items and have it say something like ‘here are your random numbers’. Any help would be greatly appreciated. I’ve seen you help others on the forum so I’m hoping you’ll come through and get us in the right direction. Thanks
@rafiqdegia95 All you need to do is to generate a random number for each purchase. So, to generate 3 random numbers from 1 to 10,000;
let rnd1 = Math.floor(Math.random() *10000) +1;
let rnd2 = Math.floor(Math.random() *10000) +1;
let rnd3 = Math.floor(Math.random() *10000) +1;
If you want, you can add a check to make sure that all of the random numbers are unique.
Customizing the Order Email is not currently supported. What you can do is to generate a separate email that would be sent upon the order being placed. Here’s one example on how to send an email.
Thank you so much for your reply. I’ll try it out and I’ll let you know how it’s gone. Again I really appreciate it. You need a pay rise man you help a lot of people out haha
Sorry Yisrael I forgot to ask. I don’t know a whole lot about code or if any at all. What page do I input that code into? Is it on the product page or checkout page? If I’m asking the wrong questions or missing anything please let me know I’m trying learn as I go along. Many thanks
What you would like to do is not trivial and will be a challenge for a beginner. You may also want to check out the Wix Marketplace - it’s a hub where you can look for Corvid (and other) experts for hire.