- This topic has 30 replies, 3 voices, and was last updated 2 years, 6 months ago by
Brian McDaniel.
-
AuthorPosts
-
September 25, 2018 at 9:54 am #142
Brian McDaniel
VEM UserThis reply has been marked as private.September 25, 2018 at 9:58 am #143Brian McDaniel
VEM UserThis reply has been marked as private.September 25, 2018 at 10:04 am #144Drew McManus
Lead DevI’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
September 25, 2018 at 2:07 pm #145Aaron Overton
Lead DevBrian,
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
// excerptsreturn $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,
-AaroSeptember 25, 2018 at 2:29 pm #146Brian McDaniel
VEM UserThis reply has been marked as private.September 25, 2018 at 4:11 pm #147Aaron Overton
Lead DevBrian,
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,
-AaronSeptember 25, 2018 at 4:15 pm #148Drew McManus
Lead DevThis reply has been marked as private.September 28, 2018 at 8:03 am #149Brian McDaniel
VEM UserThis reply has been marked as private.September 28, 2018 at 9:08 am #150Drew McManus
Lead DevThis reply has been marked as private.September 28, 2018 at 9:21 am #151Brian McDaniel
VEM UserThis reply has been marked as private.September 28, 2018 at 9:42 am #152Drew McManus
Lead DevThis reply has been marked as private.September 28, 2018 at 9:51 am #153Brian McDaniel
VEM UserThis reply has been marked as private.September 28, 2018 at 9:54 am #154Drew McManus
Lead DevThis reply has been marked as private.September 28, 2018 at 10:34 am #155Brian McDaniel
VEM UserThis reply has been marked as private.September 28, 2018 at 10:55 am #156Aaron Overton
Lead DevBrian,
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 -
AuthorPosts
- You must be logged in to reply to this topic.