• Resolved weekendize

    (@weekendize)


    Hey,

    when a user books two activities on our website, he get one order number e.g. 7498 from woocommerce and for each activity an order number e.g. 76 and 77.

    Is there a possibility to set the same order number for woocommerce and booking activities?

    For example, that the user gets the order number 7498 and the activities gets the number 7498-1 and 7489-2?
    It would be also possible for us, that all booked activities get the same order number so that the user has only one order number at all.

    Thanks in advance.
    Best,
    weekendize

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Booking Activities Team

    (@bookingactivities)

    Hello,

    Sorry but it is not possible to change booking IDs, they are automatically generated by the database, and they are used to link data between them.

    But you can change the ID displayed in the booking lists (frontend and backend), or even add a column thanks to Booking Activities API. Is it what you are trying to achieve?

    Regards,
    Yoan Cutillas

    Thread Starter weekendize

    (@weekendize)

    It should work with the API. Can you provide a code snippet to change the ID in the frontend and backend?

    Plugin Author Booking Activities Team

    (@bookingactivities)

    Hello,

    To replace the ID column in both backend and frontend booking lists with the order ID, add this code in your child theme functions.php:

    // Backend
    function my_theme_replace_id_with_order_id_in_backend_booking_list( $columns, $booking, $group, $user, $list ) {
    	if( ! empty( $booking->order_id ) ) {
    		$columns[ 'id' ] = $booking->order_id;
    	}
    	return $columns;
    }
    add_filter( 'bookacti_booking_list_booking_columns', 'my_theme_replace_id_with_order_id_in_backend_booking_list', 10, 5 );
    
    // Frontend
    function my_theme_replace_id_with_order_id_in_frontend_booking_lists( $columns, $booking, $user_id ) {
    	if( ! empty( $booking->order_id ) ) {
    		$columns[ 'id' ] = $booking->order_id;
    	}
    	return $columns;
    }
    add_filter( 'bookacti_user_bookings_list_columns_value', 'my_theme_replace_id_with_order_id_in_frontend_booking_lists', 10, 3 );

    Regards,
    Yoan Cutillas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Different order number from woocommerce and booking activities’ is closed to new replies.