Forum Replies Created
-
AuthorPosts
-
Matt GrayParticipant
Hi Cliff,
Thanks for your help, and understand about the level of support available.
I’ve managed to separate the templates (thanks), and also bring in the ‘template’ for the meta onto the WooCommerce product page… However, instead of bringing in the details of the Event related to the Product, it’s just bringing in today’s day and date…
$event_id = get_the_ID(); <?php tribe_get_template_part( 'modules/meta' ); ?>
How do I relate the “bring in all the meta” module to the associated event?
And number 3, that’s just not working… I know where to add all the code, just not how to generate the link for the WooCommerce Product instead of the link for the Event page.
Thanks for bearing with!
Cheers,
MattMatt GrayParticipantHi Cliff,
Thanks for this… I’ve tried referencing that function, and it’s just throwing an error (and not loading the map at all)…
I’ve added it like this:
$venues = get_posts( array( 'post_type' => Tribe__Events__Main::VENUE_POST_TYPE, 'posts_per_page' => -1) ); global $wp_query; foreach ( $venues as $venue ) { $coordinates = tribe_get_coordinates ( $venue->ID ); $address = tribe_get_full_address ( $venue->ID ); $countEvents = tribe_venue_upcoming_events ( $venue->ID, $wp_query->query_vars );
However echo $countEvents is offering nothing I’m afraid 🙁
Where am I going wrong with this?
Number 2 – I’m pretty sure I won’t be able to do it myself if it’s just the ones that appear on the map – it’d be more useful to me if I can just add a full list of venues underneath, but as part of this shortcode, not just adding the venue list widget beneath (as I’ll ultimately find a way to sort them by distance from an input address)… Is there an easier way to do that?
Cheers,
MattAugust 11, 2017 at 12:54 am in reply to: Show price from WooCommerce instead of price on Event #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,
MattMatt GrayParticipantHi Cliff,
Thanks for that, and that’s the process that I’ve followed to do so… http://aquaphysical.com/shop/instructor-training/floatfit-instructor-training-hamburg-germany-3rd-september/
However, a couple of things I can’t work out along the way…
1). What is the file structure for a product override there that will be the template for all products/events in a certain category, e.g. ‘instructor-training’.
2). Then also, how do I bring the class meta data (i.e. organiser, map and anything that is in this sidebar: http://aquaphysical.com/class/floatfit-instructor-training-hamburg-germany-3rd-september/) onto the WooCommerce product page (on the template discussed above).
3). On the list page here: http://aquaphysical.com/classes/category/instructor-training/ – What do I need to add into the ‘single-event.php’ file to allow me to add a link directly to the WooCommerce product, instead of first going to view the class and then clicking through to the ticket.
On the class page itself I use the below code, but I can’t get it to work as well on the list page:
<?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 for your help!
MattAugust 10, 2017 at 4:33 am in reply to: Show price from WooCommerce instead of price on Event #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!
MattMatt GrayParticipantHi Cliff,
Thanks for having a quick look – I seem to have got most of the way myself here: http://aquaphysical.com/find-venue/ using the code below…
/* Tribe [tribe_venue_map] shortcode sample */ function tribe_venue_map_logic ( $atts ){ $url = apply_filters( 'tribe_events_google_maps_api', 'https://maps.google.com/maps/api/js' ); $url = $url . '&callback=tribe_venue_map'; wp_enqueue_script( 'tribe_events_google_maps_api', $url, array(), false, true ); wp_enqueue_script( 'jquery' ); add_action('wp_footer', function () { ?> <style> #tribe-venue-map { width: 100%; height: 600px; } </style> <script> function tribe_venue_map() { var map = new google.maps.Map(document.getElementById('tribe-venue-map'), { center: {lat: 51.507368, lng: -0.128142}, zoom: 12, scrollwheel: false }); <?php $venues = get_posts( array( 'post_type' => Tribe__Events__Main::VENUE_POST_TYPE, 'posts_per_page' => -1) ); foreach ( $venues as $venue ) { $coordinates = tribe_get_coordinates ( $venue->ID ); $address = tribe_get_full_address ( $venue->ID ); if ( $coordinates['lat'] != 0 && $coordinates['lng'] != 0 ) { ?> window['marker_' + <?php echo $venue->ID; ?>] = new google.maps.Marker({ position: {lat: <?php echo $coordinates['lat']; ?>, lng: <?php echo $coordinates['lng']; ?>}, map: map, title: "<?php echo $venue->post_title; ?>", icon: { url: "http://aquaphysical.com/wp-content/uploads/2017/08/pin2.png", scaledSize: new google.maps.Size(40, 53) } }); var contentString = '<div id="infocontent">'+ '<h3 class="venueHeading"><a href="<?php echo esc_url( tribe_get_venue_link( $venue->ID, false ) ); ?>"><?php echo $venue->post_title; ?></a></h3>'+ '<div id="bodyContent">'+ '<p><?php echo esc_html( tribe_get_event_meta( $venue->ID, '_VenueAddress', true ) ) ; ?></p>'+ '<p><?php echo esc_html( tribe_get_event_meta( $venue->ID, '_VenueCity', true ) ) ; ?></p>'+ '<p><?php echo esc_html( tribe_get_event_meta( $venue->ID, '_VenueZip', true ) ) ; ?></p>'+ '<p><?php echo esc_html( tribe_get_event_meta( $venue->ID, '_VenueCountry', true ) ) ; ?></p>'+ '<p class="infophone"><strong>Phone: </strong><?php echo esc_html( tribe_get_event_meta( $venue->ID, '_VenuePhone', true ) ) ; ?></p>'+ '<p class="infowebsite"><strong>Website: </strong><a href="<?php echo esc_html( tribe_get_event_meta( $venue->ID, '_VenueURL', true ) ) ; ?>" target="_blank">view venue website</a></p>'+ '<div class="fusion-button-wrapper fusion-alignleft"><a class="fusion-button button-flat fusion-button-square button-large button-default button-2" target="_self" href="<?php echo esc_url( tribe_get_venue_link( $venue->ID, false ) ); ?>"><span class="fusion-button-text">view available classes</span><i class="fa fa-angle-right button-icon-right"></i></a></div>'+ '</div>'+ '</div>'; window['info_' + <?php echo $venue->ID; ?>] = new google.maps.InfoWindow({ content: contentString }); window['marker_' + <?php echo $venue->ID; ?>].addListener('click', function() { window['info_' + <?php echo $venue->ID; ?>].open(map, window['marker_' + <?php echo $venue->ID; ?>]); }); <?php } } ?> } </script> <?php }); return '<div id="tribe-venue-map"></div>'; } add_shortcode( 'tribe_venue_map', 'tribe_venue_map_logic' );
A couple of bits however that I can’t quite work out… I want to count the total number of events at a specific venue (by venue ID i.e. $venue->ID)… and then within that, count how many within separate categories, based on the category slug… This one should be fairly straightforward but I just can’t work it out I’m afraid!
Is it also possible to display a list underneath the map of all of the venues too? If you can help me do that by ID again, then I can probably manage the rest… seems to be a few people who are looking for this from my browsing!
Cheers,
MattMatt GrayParticipantHi Shelby,
Thanks for this – hadn’t seen that you’d replied!
I don’t need the whole tribe bar, just the location search…
Is there anyone that you could point me in the right direction for some help with this, as it’s something I really need to do, so could do with some help with a little customisation?
Cheers,
MattMatt GrayParticipantThis reply is private.
Matt GrayParticipantThis reply is private.
Matt GrayParticipantStill no joy I’m afraid!
Can I give you my FTP details to have a look yourself?
Or any other suggestions?
Thanks,
MattMatt GrayParticipantHey,
I’m afraid that CSS made no difference at all…
I’ve managed to increase the width of the fields, but not the width of the dropdown (shouldn’t this fill the width of its container?).
Please see attached for alignment – it’s aligned-ish, but not perfect by any stretch!
I’ve added this, but it makes no difference at all weirdly:
.tribe-community-event-details td.label, td.saved-organizer-table-cell, td.tribe-table-field-label, .event-website-details label, label.EventCurrencySymbol, label.EventCost { width: 25%!important; max-width: 25%!important; min-width: 25%!important; }
Cheers,
mattMatt GrayParticipantThis reply is private.
Matt GrayParticipantHi Hunter,
Thanks for your speedy response, and Happy New Year to you too!
In terms of the category, that’s fine to remove the code, but how is it possible to force the specific category that the post goes into… i.e. all custom submitted events go into category ID 1 for example?
For the user one… if I am logged in as “Matt” – I want the organiser field to only allow them to use themselves as the organiser, and populate the field with their own name – i.e. the organiser name wouldn’t have a drop down to choose an organiser, or ability to add a secondary organiser. Phone / Email / Website will only need to be populated on the first event that they create, and then it’ll populate it for them afterwards…
Basically, I want the person who is creating the event to always be the organiser.
On removing the other fields – that’s all fine, thanks… easy enough to do!
Finally, I’ve set a function that changes the word “Event” to “Class” everywhere else throughout the Events Calendar, but it doesn’t seem to take effect on this sub-plugin… is it possible to make that happen too, or is that just a bug?
Cheers,
MattMatt GrayParticipantHey,
I’m adding the organiser within the event itself, and it’s automatically creating the organiser…
I’ve not got any organisers with the same slug, as they haven’t been created…
Nor am I able to remove the -2 from the slug by editing it…
Cheers,
MattMay 27, 2016 at 3:51 am in reply to: Wrong date ticket being sent to basket on recurring event #1119624Matt GrayParticipantHi Brook,
Thanks for clarifying this…
No worries at all – I didn’t realise that this was how it works, but not a problem… would be great if it created individual tickets, but I guess I’ll just not be lazy and create all the events separately 😛
Looking forward to that release then, but for now, thanks for your help!
Matt
-
AuthorPosts