• Resolved lafac

    (@lafac)


    If you need to add text before, for example: “from” 10$.

    function tec_remove_price_range( $cost, $post_id, $with_currency_symbol ) {

    $pieces = explode( ' – ', $cost );

    // If the ticket is free, just display it.
    if ( $cost == 'Free' ) {
    return $cost;
    }

    // Remove the block you don't need!

    // To show the lowest price with some text.
    if ( ! empty( $pieces[0] ) ) {
    return "From: " . $pieces[0];
    }

    // To show the highest price.
    if ( ! empty( $pieces[1] ) ) {
    return "Up to " . $pieces[1];
    }

    // If not a range, return the default value.
    return $cost;
    }

    add_filter( 'tribe_get_cost', 'tec_remove_price_range', 10, 3 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Darian

    (@d0153)

    Hi @lafac

    Thank you for sharing this snippet! We really appreciate your contribution, and I’m sure it will be helpful to others.

    If you have any questions or need further assistance, feel free to reach out.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It seems like this thread has been quiet for a bit, so we’ll go ahead and close this for now. However, if any further questions or concerns come up, please don’t hesitate to start a new thread.

    Thread Starter lafac

    (@lafac)

    thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘add text before price’ is closed to new replies.