Home › Forums › Ticket Products › Event Tickets Plus › Using WooCommerce Variable Products with WooTickets
- This topic has 3 replies, 2 voices, and was last updated 6 years, 7 months ago by Sean Spence.
-
AuthorPosts
-
September 2, 2017 at 2:17 pm #1344171Sean SpenceParticipant
I’m aware there is the request for this to happen, but I can’t wait for that.
I’m working on a custom solution for this.
Inside WooTickets the tickets.php file exists which is what displays the tickets attached to an event.
if ( class_exists( 'WC_Product_Simple' ) ) {
$product = new WC_Product_Simple( $ticket->ID );
}{This function takes the variable $ticket and turns it into a Simple Product
I changed this code to create a Variable product instead so I could customize the output and show my variations.
if ( class_exists( 'WC_Product_Variable' ) ) {
$product = new WC_Product_Variable( $ticket->ID );
}{Unfortunately it won’t even allow me to do that… Attempting to use any of the WC Variable Product functions results in the following error:
Fatal error: Call to undefined method Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_children() in wp-content/plugins/woocommerce/includes/class-wc-product-variable.php on line 256
Is there any way I can keep the Ticket Product concept the same, but use a Variable product with custom development?
I’m afraid you’re going to tell me I will have to just manually create WooCommerce products, then manually attach them to my Events, THEN manually display them in the tickets.php file of my theme.
Any input?
September 4, 2017 at 4:08 pm #1344628Geoff B.MemberGood evening Sean,
Thank you for reaching out to us.
I would love to help you with this topic.As you have found out, simply replacing that line does not work.
If it did, you can rest assured that we would have tackled this beast a while back.Just to set expectations, the scope of our support is mostly to get our customers started on the right track and to help them in case of issues. We unfortunately do not provide complete support for customization.
With that in mind and without getting overly technical, there are several reasons why we have safeguards in our plugins to use tickets with variable products. At least for now.
The simplest and most important one being that this can cause several important issues.
With that in mind, if you are feeling adventurous, here are a couple of snippets that would help:- https://gist.github.com/theeventscalendar/180aac35016f667d5d51
- https://gist.github.com/GeoffEW/4246401bb310ae087640ce7bf0b83937
Just to be clear, using these is absolutely at your own risk. Make sure you backup your database before experimenting further or better yet, customize this on a test/staging server.
Another interesting avenue would be to use something like Composite products (instead of variable products).
Best regards,
Geoff B.
September 26, 2017 at 9:35 am #1355041Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Using WooCommerce Variable Products with WooTickets’ is closed to new replies.