WCMp Core
-
AuthorPosts
-
-
May 8, 2021 at 11:58 AM #121325Naoya IshikawaParticipant
I am creating a ticket using the event calendar (https://theeventscalendar.com/). I’m in trouble when I buy this ticket because it creates a ticket for both the parent order and the sub-order.
Is it possible to prevent two tickets from being created for one order, such as by disabling the parent order? -
May 8, 2021 at 2:32 PM #121330NerdySupportExpert MoumitaKeymaster
Hi @Naoya Ishikawa, In order to resolve this, we need help from the plugin author.
Please ask the plugin author, can can we stop creating of tickets from order. Share their response with us, so we can help you out.
-
July 1, 2021 at 10:25 AM #124092Naoya IshikawaParticipant
He advised me that I could control the creation of tickets in the following ways.
Is there anything else I need other than this information?
add_filter( ‘get_post_metadata’, function($metadata, $post_id, $meta_key, $single){
if( $meta_key !== ‘_tribe_has_tickets’ ) {
return $metadata;
}// This variable would determine if the order is the actual order,
// or the “extra” order created by the other plugin.
// “my_custom_function()” is just a placeholder here.
// You would need to ask the other plugin developers how to check this.
$is_order_secondary = my_custom_function( $post_id );if( $is_order_secondary ) {
// Returning true here should prevent the attendee from being generated.
return true;
}// Otherwise, return original
return $metadata;}, 100, 4 );
-
July 1, 2021 at 6:21 PM #124124MVX Support NinjaKeymaster
@Naoya Ishikawa, thanks for the code.
Can you also share the ticket plugin link with us, so we can check on our end. -
July 2, 2021 at 5:09 AM #124157Naoya IshikawaParticipant
Since the plugin that links with Woocommerce is charged, we will attach the access information to the development environment separately from the plugin link.
You can edit this development environment.the actions for generating attendees and for sending the ticket emails are set up in the following file: event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php
Thank you
Below is the site information and the ticket plugin link.
【ticket plugin】
https://wordpress.org/plugins/event-tickets/ -
July 2, 2021 at 5:09 AM #124158Naoya IshikawaParticipantThis reply has been marked as private.
-
July 2, 2021 at 8:06 PM #124203MVX Support NinjaKeymasterThis reply has been marked as private.
-
July 5, 2021 at 2:35 PM #124134Naoya IshikawaParticipantThis reply has been marked as private.
-
July 6, 2021 at 6:16 PM #124317MVX Support NinjaKeymasterThis reply has been marked as private.
-
July 6, 2021 at 7:28 PM #124331Naoya IshikawaParticipantThis reply has been marked as private.
-
July 6, 2021 at 7:28 PM #124334Naoya IshikawaParticipantThis reply has been marked as private.
-
July 6, 2021 at 7:29 PM #124335Naoya IshikawaParticipantThis reply has been marked as private.
-
July 6, 2021 at 7:29 PM #124336Naoya IshikawaParticipantThis reply has been marked as private.
-
July 7, 2021 at 10:28 AM #124370Naoya IshikawaParticipant
I have received additional information from the plugin author and I will share it.
ーーーーーーーーーーーーーーーーーー
events hook into the “woocommerce_order_status_changed” action.
If you look at the “generate_tickets()” method, it contains multiple filters that could be hooked into. Also, check out the following two variables inside this method:
$already_generated
$already_dispatched
These control whether the attendee will get generated and ticket sent out. They are checking post meta attached to the order id. You may be able to hook into the “get_post_metadata” filter to control the returned values.
You would need to probably add some logic that is able to associate the two separate order IDs that your plugin is creating.
-
July 7, 2021 at 7:07 PM #124428MVX Support NinjaKeymaster
Hi,
We have checked your Website. It will be difficult for us to study the whole plugin. We need some information from the plugin author.
where to save the ticket as a post into the post table for order id.Please let us know.
Regards,
-
July 8, 2021 at 5:12 AM #124454Naoya IshikawaParticipant
I’m afraid I don’t understand your question.
The tickets are created as WooCommerce products.
The orders created by WooCommerce are of the “shop_order” post type. The _tribe_has_tickets meta key is stored in the postmeta table associated with the post id of the order.
-
July 8, 2021 at 11:08 AM #124329Naoya IshikawaParticipantThis reply has been marked as private.
-
July 8, 2021 at 11:08 AM #124333Naoya IshikawaParticipantThis reply has been marked as private.
-
July 9, 2021 at 6:15 PM #124562MVX Support NinjaKeymaster
Hi,
Kindly ask the plugin developer where the ticket is assigned to the respective order and save this into the post table and post meta table
and also share the plugins name you used.Regards,
-
July 9, 2021 at 8:06 PM #124580Naoya IshikawaParticipant
We received the following answers from the creator of the plugin.
Apologies, but I’m not sure I understand your questions.
WooCommerce orders contain a list of the products in the order. You can get the products in an order with the following:
$order = wc_get_order( $order_id );
$items = $order->get_items();The plugins we are discussing are WooCommerce, Event Tickets and Event Tickets Plus.
-
July 10, 2021 at 5:09 PM #124607luka.sjeffery2022Participant
When I’m in my profile, I can’t change my nsfw setting. It doesn’t show up. And when I go my laptop to change it in my preferences, I can’t click the box.
-
July 10, 2021 at 7:19 PM #124614MVX Support NinjaKeymaster
@Naoya Ishikawa, can you please ask the plugin author to mention the file name where we can see the codes on how orders are associated with the ticket.
-
July 12, 2021 at 6:22 PM #124675Naoya IshikawaParticipant
The attendees, which have the post type of “tribe_wooticket”, have a meta key that stores the WooCommerce product ID: “_tribe_wooticket_product”
You can see this being used in the following file: event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php
-
July 13, 2021 at 6:24 PM #124765MVX Support NinjaKeymaster
Hi,
Please add this code in the function.php of the current active theme and test your site:
add_action( 'tribe_tickets_plus_woo_before_generate_tickets', 'wcmp_order_test', 10, 1); function wcmp_order_test($order_id){ if($order_id){ $parent_order = wp_get_post_parent_id($order_id); if( $parent_order ){ return false; } } }
CopyRegards,
-
July 14, 2021 at 5:06 AM #124804Naoya IshikawaParticipant
Thank you for your support.
I tested it here, but there are still duplicate tickets issued.
When I purchase a ticket issued by a vendor’s account with authority, it is still issued in duplicate. -
July 14, 2021 at 6:43 PM #124834MVX Support NinjaKeymaster
Hi,
We have checked the plugin and can’t found any flexibility to stop generate ticket for suborders we need filter to stop this.
Kindly ask to your plugin author to made some changes and add filter for order_id to prevent generate ticket for some orders.Regards,
-
September 16, 2021 at 5:42 PM #127667MVX Support NinjaKeymaster
We haven’t heard back from you for a while. We hope this issue is fixed, so we are closing this now.
If you need any further help, please do open another thread.
-
-
AuthorPosts
The topic ‘How to disable a parent order’ is closed to new replies.