Show price from WooCommerce instead of price on Event

Home Forums Ticket Products Event Tickets Plus Show price from WooCommerce instead of price on Event

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1332028
    Matt Gray
    Participant

    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,
    Matt

    #1332577
    Geoff B.
    Member

    Good 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:

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1333339
    Matt Gray
    Participant

    Thanks 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!
    Matt

    #1333611
    Geoff B.
    Member

    Good 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.

     

    #1333935
    Matt Gray
    Participant

    Hi 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,
    Matt

    #1336378
    Barry
    Member

    Hi 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!

    #1346071
    Support Droid
    Keymaster

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Show price from WooCommerce instead of price on Event’ is closed to new replies.