Port

Forum Replies Created

Viewing 3 posts - 46 through 48 (of 48 total)
  • Author
    Posts
  • Port
    Participant

    Thanks for the info on the plugin updates and for the direction w/usort, Brian! I’ll work on this asap and report back here.

    Port
    Participant

    Hi Brian,

    We’re not using Events Tickets Plus — we’re using The Events Calendar Pro and WooTickets.

    I’ve copied plugins/the-events-calendar/src/views/tickets/email.php into the appropriate directory in my theme folder and have successfully customized other things. In this file, there’s a line: foreach ( $tickets as $ticket ) {, however I don’t see a query above it where I can try and sort via Event Start Date & Time.

    **I see plugins/wootickets/src/Tribe/Email.php, and in that file on line 61, I see get_content_html(), and its query args — can I not duplicate this file in my themes folder and modify it the way I’d modify any other plugin template? (so that my changes aren’t over-written)

    – is there simply not a function I can add to my functions.php file to sort tickets in cart/checkout/order/email by Event Start Date & Time?

    Port
    Participant

    Update: I found a function that sorts alphabetically by Title:

    add_filter( ‘woocommerce_order_get_items’, function( $items, $order ) {
    uasort( $items,
    function( $a, $b ) {
    return strnatcmp( $a[‘name’], $b[‘name’] );
    }
    );
    return $items;
    }, 10, 2 );

    That works on the following views:
    – Checkout > Confirmation
    – My Account > Orders > viewing a single order

    How can that be modified to work in the emailed tickets? More importantly, how can it be modified to sorty by Event date?

Viewing 3 posts - 46 through 48 (of 48 total)