koljaa
Forum Replies Created
-
I did something similar because I wanted the customer to make changes later. I used Javascript and PHP.
1. I generated a random ID for the customer and addet it to the product url (https://url.com?id=kbw2P)
2. Hide the default cart button and add another one.
3. When the user clicks your add to cart button, get all the values of the fields (also true or false for checkbockes/radio…) and send an ajax request containing all of your form data to a custom PHP Script.
4. Write the data to a database.
4.1 Be careful here. You don’t have the security features of WordPress if you do it this way. So you should be prepared for any kind of attack. I suggest making a new database just for this data and adding various safety features. If you store personal data you should be even more careful!
5. When you get a success from the server, click the hidden “real” add to cart button
6. Now you can write some code to detect the GET data in the URL (https://url.com?id=kbw2P). Now request the data from the database using the id. You can either hardcode a function which puts the data into the fields (which I did) or find a better solution (store the field names in the database too)You can add the URL with the ID to the history, add an “EDIT”-Button to the Cart containing a link, or E-Mail the Edit link to the customer. This is up to you, some of these options are more difficult than others but they are possible.
Hope this helps, have a nice day!
- This reply was modified 4 years, 11 months ago by koljaa. Reason: forgot 5