WPPizza – A Restaurant Plugin for WordPress › Support › General Support › suggestion for preselect field on checkout coming from URL param
- AuthorPosts
- 22 May, 2020 at 8:31 pm #49305
Hello, Oly,
I need a suggestion how I can implement this:
My WPPizza shop is for inhouse (restaurant tables) only! It’s already runing fine for the waiters.
I’d like to place table orders now by the guest itself. For this purpose I generate a QR-code which the guest scans. My custom php-page gets the code from URL param and evaluates the QR code in which the table is encoded. Now I have the table number and can store this in a session value. Afterwards I redirect to the shop startpage. The guest orders some items and goes to the checkout. Now the field “cname” should be preset to exactly this table name. And best not editable by the guest just displaying “table 04”. Do you have an idea how I can preset this field on checkout with the value stored in the session?i tried at startup: WPPIZZA()->session->add_userdata_key(“table_name”, “my table from QR-Code, e.g. table 04”);
and on checkout with wppizza_formfields_inputs ??This does not preselect the right name on checkout:
$customer_data_set = WPPIZZA()->session->get_userdata(); $customer_data_set["cname"] = "table 04";
Thanks a lot
Dirk23 May, 2020 at 10:39 pm #49357Any suggestion how to solve this?
Thanks!25 May, 2020 at 4:46 pm #49414you probably want to have a look here
https://docs.wp-pizza.com/developers/?section=checkout-formfields
25 May, 2020 at 5:52 pm #49415This is exactly the documentation i was looking for.
Thanks Olly! - AuthorPosts
- The topic ‘suggestion for preselect field on checkout coming from URL param’ is closed to new replies.