[Resolved] Moved: add dynamic parameters to the ticket URL

Support Forums Support Moved: add dynamic parameters to the ticket URL

This topic contains 30 replies, has 3 voices, and was last updated by  Brian McDaniel 11 months, 3 weeks ago.

Viewing 15 posts - 16 through 30 (of 31 total)
  • Author
    Posts
  • #142

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #143

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #144

    Drew McManus
    Lead Dev

    I’ll let Aaron circle back on the filter questions but I’m glad the CSS worked. One thing that’s upgraded since your last project is Listings and Calendars both have custom CSS class values. So even though each respective post generates an automatic parent class number, you can create your own custom class names.

    If your current project has room in the budget for custom work, I would be surprised if we couldn’t expand the current functionality within your existing timeframe. But I’ll let Aaron weigh in on that for a definitive reply (along with offering up any suggestions to your related filter question).

    Drew

    #145

    Aaron Overton
    Lead Dev

    Brian,

    In your custom plugin’s constructor, you’d add this:

    add_filter('vem_get_calendar_data', [$this, 'addCalendarData'], 10, 3);

    Then in the class, you’d add a new function:

    public function addCalendarData($results, $calendarId, $topCategory) {
    // do stuff here with $results to get event IDs and retrieve additional metadata,
    // then revise your $results output, like adding to the ticket URL or getting
    // excerpts

    return $results;
    }

    You probably don’t need the $calendarID or $topCategory for what you’re doing, but they are arguments being passed to the filter anyway.

    Explaining more than this and just doing it for you are basically the same time investment. 🙂

    On the other feature, I think that your timeline to make the dialog have more is too short for us to make that happen. I could probably put together a mechanism for how you would be able to revise the dialog style and content, but then you’d have to further make use of that mechanism to actually do so. Based on our experiences about where you are as a coder, I suspect you’d need me to provide some custom work to make that happen. If you’re pushing to staging tomorrow with a live date by end of week, I’d be hesitant to promise it. I have some competing development commitments, too.

    Maybe you can get the client to go for that as a follow-up improvement in a week or two?

    Blue skies,
    -Aaro

    #146

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #147

    Aaron Overton
    Lead Dev

    Brian,

    Ticket links in event single pages and listings are filtered one way. Ticket links in calendars are processed in a different way and use a different filter. My most recent post tells you how to take advantage of that filter to modify the links in calendars.

    Another future improvement is for calendar data to be more flexible, similar to how listings are, but there hasn’t yet been much call for it from our existing client base, so it hasn’t yet been the top priority and scheduled.

    You can get done what you want for ticket links with the information I posted.

    Blue skies,
    -Aaron

    #148

    Drew McManus
    Lead Dev
    This reply has been marked as private.
    #149

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #150

    Drew McManus
    Lead Dev
    This reply has been marked as private.
    #151

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #152

    Drew McManus
    Lead Dev
    This reply has been marked as private.
    #153

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #154

    Drew McManus
    Lead Dev
    This reply has been marked as private.
    #155

    Brian McDaniel
    VEM User
    This reply has been marked as private.
    #156

    Aaron Overton
    Lead Dev

    Brian,

    When we wrote the custom plugin for you, I had asked about things like “will there always be a price?” On that project, the answer was yes, so I did not write error checking and fallbacks for when there was no price. It sounds like that’s not the case in your new project. As an example of how the code might change, there’s one line in the plugin we delivered that gets the price, converts it to a ##.## format suitable for currency display, and then that goes in the URL. If you wanted that to instead put a blank in the URL for price, you could replace it with this:


    if (is_numeric($date['ticket_price_from'])) {
    $price = '$'.number_format((float)$date['ticket_price_from'], 2);
    } else {
    $price = '';
    }

    This makes sure the ticket price for the first ticket and low price is a number as opposed to a blank, then only tries to format it in that case. Of course, there are many other possible cases that could come up and the custom code would need to be that much more robust to account for all the various scenarios. For example: what if it’s a price range? what if there is a second ticket link? what if there’s a ticket price to, but not a ticket price from? what if instead of returning “price=” with a blank price, you want the url to not have a price attribute at all?

    The above code snippet fixes one potential scenario assuming one modification to the output, but without knowing all the scenarios I can’t easily create a catch-all set of code for you.

    Blue skies,
    -Aaron

Viewing 15 posts - 16 through 30 (of 31 total)

You must be logged in to reply to this topic.