• Resolved jcminni

    (@jcminni)


    Hi,

    Is there a way to have a proper removal of the woocommerce product that is created with the event (for paid tickets) taking care of any redirection?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi

    Please enter the following code in your functions.php file of theme.

    /**
     * Exclude products(event-tickets) from the shop page
     */
    add_action( 'woocommerce_product_query', 'hide_event_tickets_category_shop' );
    function hide_event_tickets_category_shop( $q ) {
        $tax_query = (array) $q->get( 'tax_query' );
        $tax_query[] = array(
               'taxonomy' => 'product_cat',	
               'field' => 'slug',
               'terms' => array('event_ticket' ),
               'operator' => 'NOT IN'
        );
        $q->set( 'tax_query', $tax_query );
    }

    Let me know if the problem still persists.

    Regards
    Priya

    Thread Starter jcminni

    (@jcminni)

    I’m going to test and give you a feedback.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Automatic removal of woocommerce products after events’ is closed to new replies.