WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Order from
- AuthorPosts
- 6 November, 2015 at 12:05 pm #13809
Hi Olly
Is it possible to hide some fields in the order form like address or post code when pick up is selected ?there is a bit of confusion when customers choose pick up but also write the whole address in the form although it’s not required .
thank you
6 November, 2015 at 12:50 pm #13811just use the css selectors.
example selecting required inputs and labels#wppizza-customer-details input[required] { background-color: yellow; } #wppizza-customer-details .wppizza-order-label-required { background-color: green; }
obviously, you can set all of them to hidden first for example and override the required with the above…
something like that ayway6 November, 2015 at 1:02 pm #13812something along these lines
/**add all the elements you are using, so for example, for cname and cemail, something like this*/ #wppizza-customer-details #cname, #wppizza-customer-details #cemail{display:none} #wppizza-customer-details label[for="cname"], #wppizza-customer-details label[for="cemail"]{display:none} #wppizza-customer-details input[required],#wppizza-customer-details .wppizza-order-label-required { display:block !important }
6 November, 2015 at 1:03 pm #13816is there any code like the above can totally hide specific labels once pickup is selected ?, Still like the above idea though
6 November, 2015 at 1:04 pm #13818just saw your second post I will try it soon
7 November, 2015 at 1:08 pm #13828works like magic 🙂 Thank you so much .
11 May, 2020 at 3:58 pm #48736just a quick update on the above , as this is somewhat easier now with wppizza v3.something
you can target elements when pickup is selected like so (assuming here you want to hide the name and address for example)
use your browsers element inspector to ascertain whats the exact classname you need.wppizza-order-ispickup .wppizza-personal-details > .wppizza-cname{display:none} and/or .wppizza-order-ispickup .wppizza-personal-details > .wppizza-caddress{display:none} and/or etc etc
make sure to not hide things that you have also set to be “required” though or the customer will never be able to check out ….
- AuthorPosts
- The topic ‘Order from’ is closed to new replies.