Skip to content

Instantly share code, notes, and snippets.

@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] );
@vicskf
vicskf / functions.php
Last active June 12, 2023 16:30
Event Tickets > Send a copy of the RSVP or ticket email to all event organizers that have a valid email address
<?php
/**
* BCC event organizers email on all Event Tickets' RSVP and commerce ticket emails so they get a copy of it too
*/
function bcc_all_event_organizers( $headers, $event_id, $order_id ) {
//check if has organizer
if ( !tribe_has_organizer( $event_id ) ) {
return $headers;
}
@cliffordp
cliffordp / functions.php
Last active June 6, 2023 05:38
How to remove (dequeue) The Events Calendar's and PRO's styles.
<?php
// If you use this snippet as-is, ALL of The Events Calendar (i.e. "Core") and Pro add-on styles will NOT be loaded.
// (although there may be some $handles that I didn't detect... especially from widgets, shortcodes, and the like... no guarantess ;-)
// Comment out the line of each style you DO want to load.
// Note the comments within each array regarding the Display style options -- https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/#display
// The Display styles are "stacked".
// In other words, the Skeleton files are always loaded, and the Full styles are loaded when Tribe Events Styles (i.e. Theme) is selected.
// However, the commented .css example file names can change, e.g. 'full.min.css' instead of 'skeleton.min.css' or 'theme-mobile.min.css' instead of 'full-mobile.min.css'
//
<?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
@GeoffEW
GeoffEW / prevent_export.php
Last active October 2, 2022 15:15
Prevent calendar export links from showing anywhere on the front-end.
<?php
/**
* Prevent calendar export links from showing anywhere on the front-end.
*
*
*/
class Tribe__Events__Remove__Export__Links {
public function __construct() {
add_action( 'init', array( $this, 'single_event_links' ) );
@cliffordp
cliffordp / functions.php
Last active September 8, 2022 14:31
Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
<?php
/**
* Event Tickets Plus - Add other WooCommerce Product to Cart when WooCommerce Ticket is added to cart
*
* @link https://wordpress.org/plugins/woocommerce-product-dependencies/ May be a better and easier solution !!! !!! !!! (But I haven't tried it.)
*
* !!! Before using, edit the variables in this function according to your needs!!!
* Could maybe also do the inverse (if ticket product is removed from cart, also remove the chained product).
*
* From https://gist.github.com/cliffordp/30481ca323012e298418095476d49337
@andrasguseo
andrasguseo / et-meta-hawk.php
Created November 30, 2016 15:44
Event Tickets Meta Hawk by Barry
<?php
/**
* Plugin name: Event Tickets Meta Hawk
* Description: Lets site administrators soar over attendee meta data supplied by attendees then swoop down, hawk-like, to change it. Proof of concept targeting the WooCommerce provider.
* Version: 2016-03-21
* Author: Barry Hughes
*
* Experiment in making attendee meta editable via the attendee screen.
* Well worth bearing in mind that:
*
@cliffordp
cliffordp / functions.php
Last active May 18, 2022 04:12
BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
<?php
/**
* BCC site admin email on all Event Tickets' RSVP ticket emails so they get a copy of it too
*
* From https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182
*
* Reference: https://developer.wordpress.org/reference/functions/wp_mail/#using-headers-to-set-from-cc-and-bcc-parameters
*
*/
function cliff_et_rsvp_bcc_admin_ticket() {
@theeventscalendar
theeventscalendar / ticketsplus_woocommerce-products.php
Last active February 15, 2022 22:38 — forked from elimn/tribe_wootix_no_hijack.php
Allows customers to access the WooCommerce product page for tickets with Tickets Plus
<?php
/*
* Causes WooCommerce Ticket product pages to stop redirecting to their event page
* See https://theeventscalendar.com/knowledgebase/selling-tickets-from-the-woocommerce-products-page/
*/
function tribe_wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
@elimn
elimn / tribe_neuter_qr.php
Last active December 22, 2021 11:43
MT | TEC | Hide QR codes from the Email/Tickets sent to purchasers
<?php
/*
* Hides QR codes from the Email/Tickets sent to purchasers
*/
function tribe_neuter_qr () {
if ( class_exists( 'Tribe__Tickets_Plus__Main' ) ) {
$qr_class = Tribe__Tickets_Plus__Main::instance()->qr();
remove_action( 'tribe_tickets_ticket_email_ticket_bottom', array( $qr_class, 'inject_qr' ) );
}