Skip to content

Instantly share code, notes, and snippets.

@cliffordp
cliffordp / functions.php
Last active July 16, 2021 00:06
Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
<?php
/**
* Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
*
* By Matt B and Cliff P
*
* From https://gist.github.com/cliffordp/66bf05df61ee269c60ff20d6f39e2cab
*/
function cliff_etplus_woo_cart_quantity_readonly() {
@jesseeproductions
jesseeproductions / tickets-plus-disable-tax.php
Created March 2, 2016 13:51
Event Tickets Plus - Disable Taxes for Ticket Products
/**
* Event Tickets Plus - Disable Taxes for Ticket Products
*/
add_action( 'wootickets_after_save_ticket', 'tribe_disable_taxes_ticket_product' );
function tribe_disable_taxes_ticket_product( $ticket_id ) {
update_post_meta( $ticket_id, '_tax_status', 'none' );
update_post_meta( $ticket_id, '_tax_class', 'zero-rate' );
}
@andrasguseo
andrasguseo / change-wording-with-context.php
Created May 12, 2017 20:21
Change the wording of any bit of text or string, which has a context
<?php
function tribe_custom_theme_text_with_context ( $translation, $text, $context, $domain ) {
// Put your custom text here in a key => value pair
// Example: 'Text you want to change' => 'This is what it will be changed to'
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key => values, but make sure to separate them with a comma
// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
@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/
*/
@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
@andrasguseo
andrasguseo / functions.php
Last active April 24, 2020 16:42
Hide the quantity field on the WooCommerce cart page
<?php
/*
* For the following plugins:
* The Events Calendar, Event Tickets, Event Tickets Plus, WooCommerce
*
* The function hides the quantity form field from the cart page
* so users cannot change the product / ticket quantity there.
* It shows the number as plain text.
* Note: it only allows you to put 1 of all products in the cart!!!
* Useful if you are collecting attendee information with Event Tickets Plus
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;
@jesseeproductions
jesseeproductions / tribe-woo-catalog-visible.php
Last active July 16, 2019 13:13
WooCommerce Tickets - Set Catalog visibility to Catalog/search for all Tickets
/*
* The Events Calendar - WooCommerce Tickets - Set Catalog visibility to Catalog/search 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 ) {
@GeoffEW
GeoffEW / remove_free.php
Created November 1, 2016 04:50
The Events Calendar - Make code empty if it's 0 or Free
<?php
/*
* The Events Calendar - Make code empty if it's 0 or Free
*/
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 = '';
@cliffordp
cliffordp / functions.php
Last active May 1, 2019 05:52
For https://theeventscalendar.com/support/forums/topic/number-of-tickets-available/ The Events Calendar + Event Tickets Plus + WooCommerce: Hide remaining quantity unless it is less than 4 (to create a sense of urgency) NOTE: Would need .each loop logic to work properly for more than just the first WooCommerce ticket if more than 1 WooCommerce t…
<?php
/**
* The Events Calendar + Event Tickets Plus + WooCommerce: Hide remaining
* quantity unless it is less than 4 (to create a sense of urgency).
*
* NOTE: We would need .each loop logic to work properly for more than just the
* first WooCommerce ticket if more than 1 WooCommerce ticket is available
* per event!
*
* If you want to ALWAYS hide (no sense of urgency logic), do not use this