Hide tickets in products page

Home Forums Ticket Products Event Tickets Plus Hide tickets in products page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1132150
    Claudio
    Participant

    Hi, i have event-tickets-plus. i need hide the tickets on products page. I will go later stating the global user_level, to hide page according user_level from user..
    Thx πŸ™‚

    #1132385
    Geoff
    Member

    Hey Claudio, hope you had a great weekend!

    You can hide the ticket form with CSS for the time being:

    .single-tribe_events #tribe-events-content form.cart {
    display: none;
    }

    Will that work for you? Please let me know.

    Cheers!
    Geoff

    #1132464
    Claudio
    Participant

    Hi Geoff, thank you and i need hide tickets in product admin page woocomerce. this code is for page wp-admin woocomerce products?

    Thanks πŸ˜€

    #1132470
    Geoff
    Member

    Hey there, Claudio!

    Oh sorry, no, that snippet is for the front-end view of the website rather than the admin area.

    I’m afraid that customizing the admin area is something that would have to be directly in WooCommerce itself rather than the calendar and ticket plugins.

    While I do not have a solution for this, I did find this threadΒ on WordPress.org and wonder if it might at least help get you started.

    Cheers,
    Geof

    #1132507
    Claudio
    Participant

    Thank you Geoff, i am making and edited this code at the forum wordpress:

    add_action( 'pre_get_posts', 'custom_pre_get_posts' );
    
    function custom_pre_get_posts( $q ) {
    
    	if ( ! $q->is_main_query() ) return;
    
    	if ( ! $q->is_post_type_archive() ) return;
    
    	$not_posts = array();
    
    	$not_p = get_posts(array('post_type'=>'product','meta_query' => array(
    		array(
    			'key' => '_tribe_tickets_meta_enabled',
    			'value' => '',
    			'compare' => '!='
    			)
    		)));
    	foreach ($not_p as $post) { $not_posts[] = $post->ID; }
    
    	$q->query_vars['post__not_in'] = $not_posts;
    
    	remove_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); 
    
    }

    It works! πŸ˜€

    • This reply was modified 9 years, 10 months ago by Claudio.
    #1132540
    Geoff
    Member

    Heck yeah, nice work! I really, really, really appreciate you sharing that with us here. πŸ™‚

    Cheers!
    Geoff

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Hide tickets in products page’ is closed to new replies.