Skip to content

Instantly share code, notes, and snippets.

View rafsuntaskin's full-sized avatar
🎯
Focusing

Rafsun Chowdhury rafsuntaskin

🎯
Focusing
View GitHub Profile
@rafsuntaskin
rafsuntaskin / functions.php
Last active May 28, 2019 08:03
ET+ Fix coupon apply bug || AR page saving to empty page
<?php
add_filter( "woocommerce_get_checkout_url", "rt_fix_maybe_filter_checkout_url_to_attendee_registration", 20);
/**
* Hooked to the woocommerce_get_checkout_url filter to hijack URL if on cart and there
* are attendee registration fields that need to be filled out
*
* @since 4.9
*
* @param string $checkout_url
@rafsuntaskin
rafsuntaskin / functions.php
Last active May 28, 2019 09:33
Stop Ticket email for a single event only
<?php
add_filter( 'woocommerce_email_enabled_wootickets', 'rt_custom_disable_event_ticket_email_by_event', 20, 2 );
/**
* @param $enabled
* @param $order WC_Order
*
* @return mixed
*/
function rt_custom_disable_event_ticket_email_by_event( $enabled, $order ) {
@rafsuntaskin
rafsuntaskin / functions.php
Last active October 9, 2019 06:27
Fix WooCommerce Email conflict with ET+
<?php
add_action( 'wp_loaded', 'rt_remove_ticket_email', 80 );
/**
* Remove the main filter of ET email and add it again with a check to prevent fatal errors
*/
function rt_remove_ticket_email() {
if ( ! function_exists( 'tribe' ) ) {
@rafsuntaskin
rafsuntaskin / functions.php
Created May 31, 2019 11:47
Disable Organizer meta details for The Events Calendar
<?php
/**
* Disable showing Organizer info in Event Details
*/
add_filter( 'tribe_has_organizer', '__return_false' );
@rafsuntaskin
rafsuntaskin / functions.php
Created May 31, 2019 12:03
Add extra export columns for WooCommerce customer address
<?php
/**
* Tribe, adding user meta to the attendees csv export
* Source: https://theeventscalendar.com/support/forums/topic/adding-woocommerce-order-notes-to-attendees-export/
*
*
**/
function tribe_export_custom_set_up( $event_id ) {
@rafsuntaskin
rafsuntaskin / functions.php
Created June 14, 2019 19:39
Change map marker attributes for Events Calendar
<?php
add_filter( 'tribe_events_ajax_response', 'rt_custom_map_event_title' );
function rt_custom_map_event_title( $data ) {
if ( empty( $data['markers'] ) ) {
return $data;
}
foreach ( $data['markers'] as &$marker ) {
// Change the following line to modify the markers as needed
$marker['title'] = strip_tags($marker['title']);
@rafsuntaskin
rafsuntaskin / functions.php
Last active June 28, 2019 15:25
Disable Attendee Registration page
<?php
/**
*
* Disable Attendee Registration page for WooCommerce in Event Tickets Plus
*
* @author Rafsun Chowdhury
*
* @link https://gist.github.com/rafsuntaskin/714d5582bdfe0ed235ef83d36938d8fd
*
*/
@rafsuntaskin
rafsuntaskin / functions.php
Created July 2, 2019 19:21
Add Custom Column with data for Attendee Table ET+
<?php
/**
*
* Add Custom column with data in Attendee Table
*
* @author Rafsun Chowdhury
*
* @link https://gist.github.com/rafsuntaskin/9a138c47068a6d332454ad4605c6244b
*
*/
@rafsuntaskin
rafsuntaskin / functions.php
Last active July 29, 2019 06:21
Customize Community Event submission required fields
<?php
/**
*
* Set category as required field for CE submission
*
* @author Rafsun Chowdhury
*
* @link https://gist.github.com/rafsuntaskin/1b3a4165080629253e34ca87db2027e7/edit
*
*/
@rafsuntaskin
rafsuntaskin / functions.php
Created July 23, 2019 06:36
Disable tax for Event Tickets WooCommerce products
<?php
add_action( 'event_tickets_after_save_ticket', 'rt_disable_tax_for_event_tickets', 10, 4 );
function rt_disable_tax_for_event_tickets( $post_id, $ticket, $raw_data, $class_name ) {
//hardcoded for WooCommerce only
if ( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' != $class_name ) {
return;
}