Home › Forums › Ticket Products › Event Tickets Plus › Custom Billing Fields for Particular Events
- This topic has 1 reply, 2 voices, and was last updated 10 years, 6 months ago by Kelly.
-
AuthorPosts
-
November 14, 2013 at 3:13 pm #76536MarcusParticipant
I’ve had no problem hooking up the Woocommerce Tickets module and inserting my own constant custom checkout fields via this documentation:
http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/However, I have a few custom checkout fields I’d like to conditionally add based on the type of event. For example, I’d like to include a “Dietary Restrictions” field for events involving food.
I’ve concocted one way to maybe do this, but I wanted to see if maybe I was taking the long way around:
Admin Step 1) Enter an event and a corresponding ticket.
Admin Step 2) Find that ticket under products and categorize it as “Includes Food”.
Developer Step 1) In functions.php, add a field “Dietary Restrictions” with the class “food”.
Developer Step 2) In the css, set class “food” to display:none.
Developer Step 3) On the checkout form (woocommerce/form-billing), access the Woocommerce cart object to retrieve the product id(s).
Developer Step 4) Loop through the product ids, retrieving their Product Categories to see if any are classified as “Includes Food”.
Developer Step 5) If so, set class “food” to display:block.It seems a little circuitous for both the admin and the developer, and it also modifies a core Woocommerce file, so I’m hoping someone has a better suggestion. Thanks!
November 15, 2013 at 1:31 pm #76727KellyParticipantHi, Marcus. This is an excellent question.
Unfortunately, I don’t know of a simpler way to do it at present. I’m actually impressed that you’ve put something together that will do the job so nicely!
Sorry I can’t be of more help! 🙂
-
AuthorPosts
- The topic ‘Custom Billing Fields for Particular Events’ is closed to new replies.