loushou
Forum Replies Created
-
Forum: Plugins
In reply to: [OpenTickets Community Edition] wp_enqueue_script page speed helpHi @rmsgreig,
Sorry it seems I missed this followup too.
Both of the scripts in question should not show up on any event pages at all. They should only show on pages that have the ‘event calendar’ on them (like your frontend calendar page, or any edit-post pages for events in the admin).
With that in mind, if you are certain that these scripts are loading on pages that they do not need to on your site, you can dequeue them using these lines:
wp_dequeue_script( 'moment-js' ); wp_dequeue_script( 'moment-core-js' );
The wp_dequeue_script() function only requires the script unique name (not the plugin name), which is the first parameter. Both of those scripts are registered in
opentickets-community-edition/inc/core/calendar.class.php
around line 138, and both are only used by the calendar portion of the site currently, in community edition. I’m not sure how they could be loading on any other pages, but this should help you not load them.Hope this helps,
LoushouForum: Plugins
In reply to: [OpenTickets Community Edition] How to modify calendar textHey @rmsgreig,
Sorry I missed your follow up question. The short answer is that there is not a way to change that currently, without modifying the plugin, or at least copying the script that puts those square brackets in there, and doing some fancy footwork with $wp_scripts to overwrite it.
In the short term, the easiest way to remove these brackets is to edit the javascript files that adds them, directly in the plugin. Normally, I shy away from suggesting that, since you will have to maintain that change manually every time you update the plugin, but I really don’t see another good way to do it right now.
You will need to make the following edit:
File: /wp-content/plugins/opentickets-community-edition/assets/js/features/calendar/calendar.js Line: 533 Change: remove the '[' and ']' parts, and relevant '+' characters Final Line: section.find( '.num' ).html( evt.available );
Hope this helps,
LoushouForum: Plugins
In reply to: [OpenTickets Community Edition] How to modify calendar textHi @marklein,
Yes you can override this relatively easily. Look inside our plugin directory, and you will find a sub-directory called ‘templates/qsot-calendar/views’. Inside that directory is a series of files that correspond to the selected view that the calendar is in (which the default view is the ‘month’ view). What you can do is this:
– in your theme, create a new sub-directory called ‘qsot-calendar/views’
– copy the month.php file from the plugin sub-directory into your new theme sub-directory
– make the edits you wish to that theme-side copy of the fileNow, you are correct that things get added to the calendar using javascript (since the entire calendar page is driven by a third party library called ‘fullcalendar’, which is effectively a jquery plugin). When that happens, the javascript consumes a bunch of data about the event, fills out the ‘template’ with that data, and then adds it to the calendar. Because of this, the javascript must know where to add the certain pieces of data, like the remaining capacity number (the 10 in your example). Thus, if you want to change the verbiage as you defined in your question you need to change the following bit of the template
<div class="fc-availability"> <span class="words"></span> <span class="num"></span> </div>
to be something like this:
<div class="fc-availability"> <span class="num"></span> seats available </div>
Hopefully this helps,
LoushouForum: Plugins
In reply to: [OpenTickets Community Edition] Creating Custom Query in OpenTicketHey @rmsgreig,
If you want to show a list of events that are of the same parent event, that is pretty easy. Each event post has a
post_parent
id. That id corresponds with the parent event. You can then use that parent id to find all the child events of that parent event. Then you also want to limit the results to only those in the future. You can do all this with the core WordPress, like so:function get_other_events( $child_event_id, $limit ) { $child_event = get_post( $child_event_id ); $other_child_events = get_posts( array( 'post_type' => 'qsot-event', 'post_status' => 'publish', 'post_parent' => $child_event->post_parent, // events that start in the future 'meta_query' => array( array( 'key' => '_start', 'value' => date( 'c' ), // now 'compare' => '>', ), ), 'meta_key' => '_start', 'orderby' => 'meta_value', 'meta_type' => 'DATETIME', ) ); return $other_child_events; }
Also if you want to get a list of all the events that happen at the same event-area, you can do something similar:
function get_other_events( $child_event_id, $limit ) { $child_event = get_post( $child_event_id ); $event_area_id = get_post_meta( $child_event->ID, '_event_area_id', true ); $other_child_events = get_posts( array( 'post_type' => 'qsot-event', 'post_status' => 'publish', // events that start in the future 'meta_query' => array( array( 'key' => '_event_area_id', 'value' => $event_area_id, ), array( 'key' => '_start', 'value' => date( 'c' ), // now 'compare' => '>', ), ), 'meta_key' => '_start', 'orderby' => 'meta_value', 'meta_type' => 'DATETIME', ) ); return $other_child_events; }
Hope this helps simplify what you need,
Loushou- This reply was modified 7 years, 1 month ago by loushou.
Forum: Plugins
In reply to: [OpenTickets Community Edition] wp_enqueue_script page speed helpHey @rmsgreig,
Most of the scripts you are talking about, already load only on the page that they are used on. Here is a breakdown of where you can find the code to model your code after (all paths are inside of the /wp-content/plugins/opentickets-community-edition/ directory):
Calendar
The calendar’s scripts already only load on pages that have calendars. This is done in the code that loads the scripts, by first checking if the current page has a calendar on it, and then second loading the scripts if it does. You can find the code ininc/core/calendar.class.php
@add_assets()
(roughly line 266 in current version).Events
For general admission events (the only type of event you can have without an extension), the javascript used to control the interface used to select your tickets, again only loads on the event pages. This is again controlled by logic that first checks if the current page is an event page, whether the event has all the required information needed to render the interface. Then only after those checks pass, it loads the javascript. You can see this logic you need to emulate ininc/event-area/general-admission-area-type.class.php
@enqueue_assets()
(roughly line 106).Admin Assets
Many of the features have respective admin pages. Like the frontend pages, these pages all have checks to make sure that the assets belong, before the assets are actually loaded.Loaded only on admin pages that need it:
event postsinc/core/post-type.class.php
@load_edit_page_assets()
(1063)
order pagesinc/event-area/general-admission-area-type.class.php
@enqueue_assets
(106)
order pagesinc/event-area/post-type.class.php
@load_assets_edit_order
(1486)
event areasinc/event-area/post-type.class.php
@enqueue_admin_assets_event_area
(214)
event postsinc/event-area/post-type.class.php
@enqueue_admin_assets_event
(230)
venue pagesinc/venues/post-type.class.php
@load_venue_admin_assets_later
(330)
event postsinc/venues/post-type.class.php
@load_event_venue_assets
(353)Loaded on all pages in admin:
calendarinc/core/calendar.class.php
@load_admin_assets()
(233)Hope this helps,
LoushouForum: Plugins
In reply to: [OpenTickets Community Edition] Styling Buttons on Calendar PageHey @wrconsultancy,
You have a couple options here, which will work without using a css3 selector. The calendar page itself should have a ‘body class’ called ‘page-template-qsot-calendar-php’. Second, if your theme does not add that class for some reason (unlikely), or if you want to narrow the button styling changes to literally just those on the calendar, you can use the ‘container class’, for the container that the calendar sits in, ‘calendar-content-wrap’. Here is an example of what that might look like:
.calendar-content-wrap .button { padding:0; color:#000; font-size:1rem; } .calendar-content-wrap .button.disabled, .calendar-content-wrap .button:disabled { padding:0; color:#000; } .calendar-content-wrap .button.fc-state-default { color:#000; }
If you find that some or all of these do not seem to apply to your buttons on the calendar page, you most likely need to be more specific with the selector. You can do this by adding more parent elements to your selector, or by adding
!important
.Hope this helps,
LoushouForum: Plugins
In reply to: [OpenTickets Community Edition] Creating Custom Query in OpenTicketYour question is exceptionally vague. Usually if you provide a hint as to what you are trying to accomplish, we can guide you in the right direction. That being said, I will tell you some generic information related to what you are asking.
Most of the reservation data is held in the wp_qsot_event_zone_to_order table. This is what links an order, to a ticket type, to an order item, to an event. From this table you can divine most of the basic information you need to seek further information about a ticket.
Once you identify the appropriate rows in this table, you have several things at your disposal. You have an order_id, order_item_id, event_id, and product_id (ticket_type_id). Using each of those ids, you can find out the discreet information about each moving part, using the conventional wordpress methods.
With the order_id, you can look in the wp_postmeta table, and get all the information about the order. This includes the total, shipping method, billing information, and various other mundane facts. With the new WooCommerce, you may find it better to use the functions built into their plugin combined with the order_id instead though, at least for simplicity sake.
Using the order_item_id, you can grab the information about a specific order item attached to an order. This information resides in the wp_woocommerce_order_items and wp_woocommerce_order_itemmeta tables. Similar to the orders themselves though, you will find it much easier to grab this information from an order item, by using the built in woocommerce functions. Most likely you will need to load the order first, then jump to the order item.
With the product_id (ticket_type_id) you can use the wp_postmeta table to find all the information about the ticket product. This includes price, stock, sale information, and other product specific information. Much like the order though, you will find it easier to grab all that information if you use the WooCommerce functions to do so, especially since the latest major version of the plugin.
The event_id can be used to grab most of the relevant information from the event. The most important information from there is the _event_area_id, which can be used to load the event area. Once you have that, you can load the event area. The event-area itself holds the rest of the event information, such as capacity, ticket-type, and venue.
All in all, this should give you an idea of how the data all works together. If you have a specific question, or a specific end goal, you can share that, and I could offer some further guidance.
Loushou
Forum: Plugins
In reply to: [OpenTickets Community Edition] Remove Quotations from ttnameSomething like this (add it to your theme functions.php file):
function lou_remove_quotes() { ?> <script type="text/javascript"> ( function() { var to; to = setInterval( function() { // test jQuery first if ( 'function' !== typeof jQuery ) return; // test for the element if ( ! jQuery( '[rel="ttname"]' ).length ) return; // if the contents of the element does not have quotes, bail var contents = jQuery( '[rel="ttname"]' ).html(); console.log( 'checking', contents ); if ( '"' != contents.charAt( 0 ) ) return; // otherwise, remove the quotes and stop checking contents = contents.replace( /(^"|"$)/g, '' ); jQuery( '[rel="ttname"]' ).html( contents ); clearTimeout( to ); }, 50 ); } )(); </script> <?php } add_action( 'wp_head', 'lou_remove_quotes' );
Forum: Plugins
In reply to: [OpenTickets Community Edition] Remove Quotations from ttnameHey @rmsgreig,
Unfortunately there is not an easy way to remove those quotes. The quotes are added to the ticket name in the Javascript. That addition takes place in two locations, one for the admin, and one for the frontend. Those locations are as follows, in version 2.8.7:
admin:
opentickets-community-edition/assets/js//admin/order/ticket-selection.js line 103frontend:
opentickets-community-edition/assets/js//features/event-area/ui.js line 53In the short term, you could edit those two lines, and remove the quotes. That should get you what you need; however, keep in mind that any time the plugin is updated, you will need to manually maintain this change.
There is one other option, if you have the Javascript chops to pull it off. You could write a small Javascript that looks at that container over and over again until it is filled with something that has quotes around it. Then use the Javascript to remove the quotes. The addition of the quotes only happens once in Community Edition, so it would only need to happen once. It is a hack, but so is the only other available solution currently. The difference is that this one would not require ongoing maintenance.
I will see if we can add a better method of handling this in a future version, but as of now, these are your only real options.
loushou
Forum: Plugins
In reply to: [OpenTickets Community Edition] Wrong times on ticketsHey @petervandoorn,
Thanks for pointing this out. I tracked down the problem. Essentially, the frontend tool used to create the events, was not reporting the start time in the same timezone as the wordpress install is set to. I made an adjustment, and now both use the same timezone, which fixes this problem on events that are created after you update.
Unfortunately, these changes are not retroactive. The best way to correct those start times right now, is to manually update the postmeta that contains the start time. The name of the meta is ‘_start’. The change you would need to make to them is two fold:
1) Update the ‘time’ portion of the timestamp, so that it reflects the appropriate starting local time. For instance, if you want the event to start at 2pm London-daylight-savings-time, you would update the time portion to read ‘T14:00:00’.
2) Second, you will need to update the ‘timezone’ portion of the start time, so that it reflects your appropriate local timezone. For instance, if you want the event to start at 2pm London-daylight-savings-time, you would update the time portion to read ‘+01:00’.
*) So as a final result, if you have an event on august 4th 2016 at 2pm london-daylight-savings-time, the timestamp should read ‘2016-08-04T14:00:00+01:00’
I will be working on a tool that can be used to update the timestamps appropriately, but it will not be done today. Most likely, it will be ready sometime next weekish. If you need the immediate change though, you can follow the above instructions, and get them right before then.
Again thanks for finding this, as always.
Loushou
Forum: Plugins
In reply to: [OpenTickets Community Edition] Generated pdf's from ticket cannot be openedHey J (@netffandersadmin),
I think we have gotten as far as we can without a closer look. Lets start the path forward by you sending me a couple of one of the PDF files that cannot be opened. If you can attach it to an email and send that to [email protected], that would be a good next step. Make sure to put in your message that this is about a ticket on the www.ads-software.com forums, and that you are talking with Loushou about it, so that it gets routed to me.
Loushou
Forum: Plugins
In reply to: [OpenTickets Community Edition] Database is not updated (_purchases_ea)Hey @skoda007,
I see what you mean here. I will take a look into this and trackdown why it is no longer updating. Once I have a solution, I will update you here.
Loushou
Forum: Plugins
In reply to: [OpenTickets Community Edition] Integration with templatesHey @gmorgan1,
In the basic community version, the calendar is the only method, that is built in, for displaying the events. With that in mind, we do have another extension, called Display Options. This extension gives you a few more ways to display the events.
It provides you with a couple shortcodes you can embed in your content. One of them allows you to show a list of upcoming events on your site. This list is completely style-able (via css) and customizable (via template overrides in your theme) depending on your needs.
The extension also provides you with a shortcode to display a ‘Featured Event’ (or a series of featured events). This shortcode is also style-able and customizable the same way as the upcoming events shortcode.
Both of these shortcodes also have ‘sister widgets’. These widgets accomplish the exact same thing as the shortcode, only you can embed it in a widget area on your site instead of the content of your site, adding another level of flexibility.
In addition, this extension allows you to show all your events, in your shop view. This way when users visit your standard ‘shop’ interface for WooCommerce, they will not only be presented with a list of all your ‘swag’ products, but they will also be presented with a list of all the upcoming events, and the prices of those events.
Display Options provides you with a bunch of new ways of displaying your events, and each of them are customizable as you see fit. That being said, with a little ingenuity, the tools you need to generate your own interface for displaying your events, are available to you already, if you have some technical background and are able to put code together to accomplish what you want. The plugin was written with the concept in mind that you may be displaying, or even using, the software in a way that we have not anticipated. Thus it is extendable with a little programming time on your part (or hired by you).
Hope this helps,
LoushouForum: Plugins
In reply to: [OpenTickets Community Edition] Generated pdf's from ticket cannot be openedHey @netffandersadmin,
Another update will be released today, version 2.2.3, which will mitigate this PDF corruption problem as much as possible. If this does not work, we are going to have to dig a lot deeper together, to find out why your specific environment is still corrupting the PDFs.
The original problem, which was solved 3 or 4 versions ago, was that some data that used to be present in an older version of the plugin, was no longer present. One of the templates was still trying to access this data, which was causing a PHP notice. This PHP notice was getting added into the code of the PDF, thus corrupting it when it was attempting to be loaded in a viewer.
The fact that you are still having the issue even after that update, seems to indicate that another one of your plugins, or your theme, are causing a PHP error of somekind (even a warning or notice), and that is getting added to the PDF output, thus again corrupting it. Today I am adding some code to our plugin that will try to mitigate as much of these extra PHP errors produced by external sources (like other plugins and themes) from being printed as possible, in a hope to prevent the PDF corruption.
If this does not resolve your issue, then we definitely need to start by getting a link to a corrupted PDF ticket, so I can look at it’s source, and check it for some PHP errors. That may point us to the culprit. Regardless of whether that helps or not, I will make a recommendation on how to proceed, if this patch does not work. Let me know the result if you don’t mind.
Loushou
Forum: Plugins
In reply to: [OpenTickets Community Edition] Error eventsHey @cesar10,
I am ready and willing to help you out with this; however, I will need more information from you in order to help out. Can you answer these questions for me, to the best of your ability:
1. Are you able to click the ‘Add Event’ button in the admin?
2. Does clicking that button bring up the edit event page?
3. Can you Save the edit event page?
4. On the edit event page, do you see the calendar?
5. Above the calendar, do you see a blue button that reads ‘New Event Date’?
6. What happens when you click the ‘New Event Date’ button?
7. When the ‘new event date’ form appears, can you fill form out?
8. What happens when you click the ‘Add to Calendar’ button at the bottom of the form?
9. Do new events show up in the calendar below the form?
10. Do new events show up in the list of events below the calendar?
11. Can you select events from the list of events below the calendar?
12. When you select the events, does the ‘floating settings form’ appear out to the right side of the list?
13. Can you change the settings in that form?
14. What happens to the events in the list below the calendar, after you hit the blue ‘Publish’ or ‘Update’ button at the top right of the page?
15. Do the events show on the frontend of the site, in the event calendar page?
Thanks for taking the time to answer these questions. Giving the best answer you can to each will help me understand what part of the event publishing process is not working. That will help me give you information on how to resolve the problem you are running into.
Loushou