Skip to content

Instantly share code, notes, and snippets.

@cliffordp
cliffordp / functions.php
Last active September 1, 2020 18:15
MT - ET - ET+ - Change email From Address and From Name only when sending ticket emails -- works for RSVP and WooCommerce
<?php
/**
* MT - ET - ET+ - Change email From Address and From Name only when sending ticket emails -- works for RSVP, WooCommerce, and Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/35d3c0a08e53b061920976f80f0f44b4
*
* For https://theeventscalendar.com/support/forums/topic/change-the-sender-email-address-for-all-events-ticket-related-emails/
*/
@GeoffEW
GeoffEW / tribe-woo-catalog-hidden.php
Last active May 26, 2017 02:18
WooCommerce Tickets - Set Catalog visibility to Hidden for all Tickets Raw
<?php
/*
* The Events Calendar - WooCommerce Tickets - Set Catalog visibility to Hidden for all Tickets
* Alternative Hooks:
* wootickets_after_update_ticket
* wootickets_after_create_ticke
* @version 3.12
*/
add_action( 'wootickets_after_save_ticket', 'tribe_events_woo_change_visibility' );
function tribe_events_woo_change_visibility( $ticket_ID ) {
anonymous
anonymous / single-event.php
Created March 21, 2017 15:28
The Events Calendar Pro: Recurring events list in single event page.
<p>This event is planned on:</p>
<p class="current-date">
<?php
echo tribe_get_start_date();
echo ' - ';
echo tribe_get_end_date();
?>
</p>
<?php
global $post;
@elimn
elimn / tribe_body_class_recurring_all.php
Created March 1, 2017 08:46
MT | ECP | Add a recurring all body class to the recurring all page
<?php
if ( ! function_exists( 'tribe_body_class_recurring_all' ) ) {
/**
* Adds a recurring all body class to the recurring all page
*
* @see body_class
*/
function tribe_body_class_recurring_all( $classes, $class ) {
<?php
/* Tribe, limit ticket qty */
function tribe_limit_tickets() {
?>
<script type="text/javascript">
jQuery(document).ready( function( $ ) {
// do this if tickets available
if ( $('.tribe-events-tickets').length ) {
// set max qty to 1
@elimn
elimn / tribe_hide_woo_quantity_change.php
Created February 21, 2017 18:05
MT | ETP | Hides the Woo Quantity fields on the cart pages
<?php
/**
* Hide the WooCommerce quantity adjustment fields on cart pages
*/
function tribe_hide_woo_quantity_change() {
if ( ! is_cart() ) {
return;
}
@GeoffEW
GeoffEW / Remove_free_price_range.php
Created February 17, 2017 22:25
Advanced version of the remove free snippet
<?php add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 );
function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) {
if ( $cost == 0 || $cost == 'Free' ) {
$cost = str_replace('Free', '', $cost);
$cost = str_replace(' - ', '', $cost);
}
return $cost;
}
@andrasguseo
andrasguseo / show-event-details-on-cart.php
Last active July 4, 2023 07:31
Show event title and date on WooCommerce cart page
<?php
/* The snippet shows the event title and event start date on the WooCommerce cart page
* Done with the help of @Rachel ;)
*/
add_filter( 'woocommerce_cart_item_name', 'example_testing', 10, 3 );
function example_testing( $title, $values, $cart_item_key ) {
$ticket_meta = get_post_meta( $values['product_id'] );
$event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] );
@elimn
elimn / tribe_remove_single_calendar_links.php
Created February 14, 2017 07:39
MT | TEC | Remove the iCal and Google cal links from the single event page
@GeoffEW
GeoffEW / hide_single_cost.php
Created January 27, 2017 01:39
Hides cost from the single event details section
<?php
/**
* Hides cost from the single event details section
*
* @param string $tpl Template relative path
*/
function tribe_single_hide_cost( $tpl ) {
if ( 'modules/meta/details.php' === $tpl ) {
add_filter( 'tribe_get_formatted_cost', '__return_empty_string' );