Home › Forums › Ticket Products › Event Tickets Plus › Show price from WooCommerce instead of price on Event
- This topic has 7 replies, 3 voices, and was last updated 6 years, 8 months ago by Matt Gray.
-
AuthorPosts
-
August 8, 2017 at 5:12 am #1332028Matt GrayParticipant
Hi,
My site shows prices in different currencies (from Aelia plugin within Woocommerce)…
Is it possible to get the price directly from WooCommerce (where different prices are supplied in different currencies), instead of using tribe_get_cost( null, true ) in the list view? If so, what code do I add instead?
Cheers,
MattAugust 8, 2017 at 8:27 pm #1332577Geoff B.MemberGood evening Matt and welcome back!
Thank you for reaching out to us.
I would love to help you with this topic.The short answer is yes.
Pretty much everything is customizable in our plugins.Either through the use of code snippets or of some template/view customization.
You can read about that here: https://theeventscalendar.com/customizations/
If coding is not really your cup of tea, you could always hire one of our recommended customizers to do the customization for you.
You might also want to read our Themer’s guide to get a sense of how view customization works.
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, the following snippets should provide you some inspiration to achieve what you are looking for, a starting point of sorts:
- https://gist.github.com/GeoffEW/69f8a033fb614c78b3de45a197431135
- https://gist.github.com/GeoffEW/ef196ef3154a747a851c771ae45fdecd
Let me know if that helps.
Have a great day!
Geoff B.
August 10, 2017 at 4:33 am #1333339Matt GrayParticipantThanks for this…
Possible along the right line, but I think I need something that’ll replicate instead what is shown in the ticket information on the single event page: http://aquaphysical.com/classes/category/instructor-training/
This generates the WooCommerce cost in the right place here: http://aquaphysical.com/class/floatfit-instructor-training-hamburg-germany-3rd-september/ but I can’t get it to work on the list page… what would I need to change?
<?php $count = 0; foreach ( $tickets as $ticket ) { global $product; $count++; if ( class_exists( 'WC_Product_Simple' ) ) $product = new WC_Product_Simple( $ticket->ID ); else $product = new WC_Product( $ticket->ID ); $price = $product->get_price_html(); $link = $product->get_permalink(); }?> <div class="fusion-button-wrapper fusion-span"><a class="fusion-button button-flat fusion-button-square button-large button-default" target="_self" href="<?php echo $link; ?>"><span class="fusion-button-text">Register<?php if ( tribe_get_cost() ) : ?>: <?php echo $price; ?><?php endif; ?></span></a> </div> <?php if ( 0 === $count ) echo 'There are no tickets available for this event'; ?>
Thanks!
MattAugust 10, 2017 at 11:03 am #1333611Geoff B.MemberGood afternoon Matt,
Thank you for writing back.
If I understand correctly, what you are trying to do is to have a direct link to the WooCommerce product on the list view (instead of having to go to the single Event page). Is that correct ?
If so, you can simply steal the code from the single event view and paste it in the list view.
Of course, you will want to do this via a template customization using the /tribe-events/ of your WordPress theme.Following the instructions from our Themer’s guide should make this pretty easy.
You might also be interested in the following approach. It is a bit more drastic as it links you straight to the URL you enter for the event’s website (the WooCommerce product in this case) and bypasses the single event page altogether.
Let me know how that goes.
Best regards,
Geoff B.August 11, 2017 at 12:54 am #1333935Matt GrayParticipantHi Geoff,
Your ‘following approach’ doesn’t seem to have come through?
Also, I’m afraid it doesn’t seem that simple to copy the code in, as the WooCommerce ticket link is generated within /wootickets/tickets.php and the event view within the list is at /list/meta.php
It’s note recognising the associated tickets within woocommerce?
Thanks for bearing with me on this!
Cheers,
MattAugust 16, 2017 at 2:28 pm #1336378BarryMemberHi there Matt,
Apologies for the delay — but let me see if I might be able to help a little further.
I’m not quite sure what Geoff was about to suggest (and I’m afraid he’s out of office this week), but following your previous question about making the code you added to single event posts functional within list view, I suspect the problem there is that $tickets has not been defined.
Therefore, when used elsewhere, you would need to fetch that data with some code along these lines:
$provider = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); $tickets = $provider->get_tickets();
Perhaps that would work for you if placed immediately before your existing snippet? Please note though that these are really ideas for you to take and explore under your own steam: as Geoff noted previously, the amount of support for custom dev tasks like this one does tend to be rather limited.
I hope that above helps, though!
September 7, 2017 at 9:36 am #1346071Support 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 ‘Show price from WooCommerce instead of price on Event’ is closed to new replies.