Chris

Forum Replies Created

Viewing 15 posts - 241 through 255 (of 311 total)
  • Author
    Posts
  • in reply to: Problems with ajax_handler_ticket_edit #69643
    Chris
    Participant

    Hi Mike,
    We’re having a really hard figuring out what you’re attempting to do here.
    Which do_action are we talking about and what do you want to put in it?

    -Chris

    in reply to: Loading Visual editor in Add Event screen #69215
    Chris
    Participant

    Hi there Elmalak,
    I’m one of the developers here at Modern Tribe.
    First off, I’d like to thank you for your patience with this issue.

    So, to your issue we go,

    So Community Events does use the regular wp_editor that the backend uses. So you may be wondering, why does say the Viper Plugin’s buttons not show up on the frontend? It’s a very good question actually. So theoretically, actually, when you register a button as a developer to go on the editor, it will go on the editor anywhere.

    So in the case of Viper, for instance, he decided to limit those icons to only show on certain pages, specifically the screen where you can make a new post, or the screen where you can edit a post.

    This logic, found in Viper’s plugin, looks like this:

    
    if ( in_array( basename($_SERVER['PHP_SELF']), apply_filters( 'vvq_editor_pages', array('post-new.php', 'page-new.php', 'post.php', 'page.php') ) ) ) {
    // His code for adding the functions to display the button are here
    }
    
    

    Now that conditional will never return as true for a frontend editor. So even though he used a system to add his button everywhere, and Tribe used the standard editor, his buttons will only appear in the backend.

    So the same thing is happening with your plugin. After spending a bit of time trying to figure out the plugin you were using, I tracked down the same style of code in that one as well:

    add_action('admin_init', 'gmap_add_buttons');
    function gmap_add_buttons() {
    // Don't bother doing this stuff if the current user lacks permissions
    if( !current_user_can('edit_posts') && !current_user_can('edit_pages') )
    return;
    
    // Add only in Rich Editor mode
    if( get_user_option('rich_editing') == 'true') {
    add_filter('mce_external_plugins', 'add_gmap_script');
    add_filter('mce_buttons', 'add_gmap_button');
    }
    }
    

    the admin_init function only runs when you are in the backend of WordPress, so off the bat, this isn’t going to load those buttons on the frontend, since you’d need to hook onto an action that fires on the frontend.
    Further, notice the capability check. He’s only loading the buttons if the user is able to both edit posts and pages. So unless your user role has those permissions via a custom role or an editor or administrator role, you won’t see them either.

    This same cap check is done on every function related to those buttons, from display to saving.

    So to summarize, Events Calendar is using the standard WordPress editor, but the two plugins (the GPX one and the example Viper one) both use code that explicitly prevents them from loading for your users.

    I would suggest talking to that plugins author about changing his code so you can use it on the frontend.

    -Chris

    in reply to: Calendar does not show correctly #66907
    Chris
    Participant

    Awesome 🙂

    in reply to: Calendar does not show correctly #66810
    Chris
    Participant

    Add this to your theme’s style.css file or to your themes custom CSS setting (if it has one):

    #tribe-events-pg-template{
    background: #f7f7f7;
    }

    in reply to: Calendar does not show correctly #66802
    Chris
    Participant

    Hi there,
    Can you get us a URL to that calendar page?

    Thanks,
    Chris

    in reply to: Ticket information in the "meta", I want it isolated. [solved] #66238
    Chris
    Participant

    Hi there,
    If it works, thats good, but thats definately not an ideal solution. When this update comes out, you’ll be able to do:

    $event_id = get_the_ID();
    // Get the singleton instance
    $woo = TribeWooTickets::get_instance();
    // Get an array of WooCommerce products IDs associated with this event
    $all_tickets = $woo->get_tickets_ids( $event_id );
    // Get just the first one, if the user wants that
    $first_ticket = array_shift( $all_tickets );
    // print price
    $price = get_post_meta( $first_ticket, ‘_regular_price’, true );
    echo $price;

    -Chris

    Chris
    Participant

    Can you post a copy of your code that you’re using on Pastebin or something and then put a link to it here?

    in reply to: Events In/View As Fields #65401
    Chris
    Participant

    Hmmm,what do we have here: 😉

    add_action( ‘wp_enqueue_scripts’, ‘mw_theme_enqueue_scripts’ );
    function mw_theme_enqueue_scripts() {
    if( !is_admin()){
    wp_deregister_script(‘jquery’);
    wp_register_script(‘jquery’, (“http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js”), false, ‘1.5.1’, true);

    wp_enqueue_script(‘jquery’);
    }
    }

    You’re going to need to remove that blob inside of functions/themes/init.php.

    -Chris

    in reply to: Ticket information in the "meta", I want it isolated. [solved] #65283
    Chris
    Participant

    So the query above gets saved to the variable. So now we just call woo’s pricing with it:

    $id = get_the_ID();
    $wootickets = TribeWooTickets::get_instance();
    $query = new WP_Query( array( ‘post_type’ => ‘product’,
    ‘meta_key’ => $wootickets->event_key,
    ‘meta_value’ => $id,
    ‘meta_compare’ => ‘=’,
    ‘posts_per_page’ => 1,
    ‘fields’ => ‘ids’,
    ‘post_status’ => ‘publish’, ) );
    echo get_post_meta( $query, ‘_regular_price’, true);

    should do it

    Chris
    Participant

    Not a problem, though now that I think of it, plain 1 might be better. -1 will return all product ID’s attached to an event, which will return an array of numbers if you have more than 1 product attached to an event. 1 will return the first product attached, so you know it will just be an integer (though WordPress will put it in an array anyways).

    Depends really on how you want to handle something like that

    in reply to: Ticket information in the "meta", I want it isolated. [solved] #64743
    Chris
    Participant

    Hi there,
    That – 1 was actually supposed to be -1
    The ID of the ticket is the same as the id of the product in WooCommerce.

    So if you put that ID (using the variable) where get_the_ID() was, you should be good to go.

    Chris
    Participant

    Ah that makes sense, yep. My bad.

    So to grab the id, you’ll need to run a query to get the associated product_id. Something like this should work:
    $id = get_the_ID();
    $woo_product_id = TribeWooTickets::get_instance();
    $query = new WP_Query( array( ‘post_type’ => ‘product’,
    ‘meta_key’ => $wootickets->event_key,
    ‘meta_value’ => $id,
    ‘meta_compare’ => ‘=’,
    ‘posts_per_page’ => – 1,
    ‘fields’ => ‘ids’,
    ‘post_status’ => ‘publish’, ) );

    -Chris

    Chris
    Participant

    Hi there,
    For a simple product (non variable), any one of these should work:

    echo get_post_meta( get_the_ID(), ‘_regular_price’, true); for the regular price
    echo get_post_meta( get_the_ID(), ‘_sale_price’, true); for hte sale price

    you could also instantiate the product class:
    $product = new WC_Product( get_the_ID() );
    echo $product->price; for plaintext
    or
    echo $product->get_price_html(); for the html version

    or loop in the template:
    woocommerce_get_template( ‘loop/price.php’ );

    -Chris

    in reply to: Events In/View As Fields #64450
    Chris
    Participant

    Hi there,
    We need a copy of your theme

    -Chris

    in reply to: Recurrence Events & Installation #64449
    Chris
    Participant

    Hi there Ella,
    If you could, please start a new thread, so we don’t continue dead threads.

    Thanks,
    Chris

Viewing 15 posts - 241 through 255 (of 311 total)