Hello,
I am using the ‘wootickets_after_save_ticket’ hook to trigger the ticket product to be set to ‘visible’ in the WooCommerce catalogue.
Is there another hook I can use that triggers when a ticket expires or has a sales end_date set to set that back to “hidden” in the WooCommerce catalogue?
I am using the following to set the initial visibility:
add_action( 'wootickets_after_save_ticket', 'tribe_events_woo_change_visibility' );
function tribe_events_woo_change_visibility( $ticket_ID ) {
if ($product = wc_get_product($ticket_ID)) {
$product->set_catalog_visibility('visible');
$product->save();
}
}
Thanks for any help.
-
This topic was modified 8 years, 4 months ago by
momofone.