• Resolved -MJ-

    (@mj-3)


    Hello Yoan,

    I need a little help again.

    Example: There are several courses per week. Each of these courses is 1h weekly. Course A (Workout) is every Monday at 8pm and Course B (Pilates) every Wednesday at 6pm and another Pilates (duplicate) Wednesday at 7pm.

    If somebody books Pilates 6pm, the free places should count down. Not only for this week, but also for all coming weeks 6pm. Until the subscription is terminated. And only for Pilates 6pm.


    My current constellation is the following:

    1 calendar with several activities (courses). Some of these activities have multiple duplicates (see, for example, in the picture Pilates or Zumba).
    Each course / duplicate should be a bookable course. Only the selected time. If you book it, all subsequent repetitions should also count one less.

    At the moment, it’s just that the currently selected course of this week is counting down. His repetitions still have all seats.

    Do you understand what I mean? I hope I could explain well enough what my problem is.

    I would be very happy if you could bring me a little light into the dark.
    Is that as possible as I imagine, can it work this way?

    Many thanks,
    MJ


    First week booked 1/10
    Following week same event 0/10
    See here: https://aviva24.de/ba-availability.gif

    • This topic was modified 5 years, 3 months ago by -MJ-.
    • This topic was modified 5 years, 3 months ago by -MJ-.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author yoancutillas

    (@yoancutillas)

    Hello MJ,

    The only way to decrease the availability of multiple events is to use groups of events (docs, demo);
    if you group your repeated events, then your customers will be able to book them all at once.

    However, this will create one booking per event.
    If I understand well, you want your customers to have only one booking, for the selected event, but still decrease the other events’ availability without booking them. This is not possible unfortunatly.

    This may be not the right solution to meet your need, but, can you explain what is your need exactly? I may be able to help you find another solution if I have more context.

    Regards,
    Yoan Cutillas

    Thread Starter -MJ-

    (@mj-3)

    Hallo Yoan, thank you for helping.

    Basically, we would like to sell ongoing courses by subscription.

    This means that every following course at the same time of the week (eg every Wednesday at 6pm) also has one less seat available.

    All other times / courses are not affected, no matter if it is a different course in content or the same (Zumba).

    Only the course at this time is booked. Repeated weekly.

    That’s what I want to achieve.

    MJ

    Plugin Author yoancutillas

    (@yoancutillas)

    Ok thank you,
    I think you can use groups of events then, is it ok for you?

    The only problem is that you will need to remove the past events of the groups each week because there is currently no option to book only the future events of a group.

    Thread Starter -MJ-

    (@mj-3)

    Hello Yoan

    Unfortunately, we can not really use it that way. Manually grouping all upcoming weekly courses is quite cumbersome. With more than 20 courses every single one each week mark and page until the end of the year is very hard.

    One way might be to disable/hide BA counting and use WooCommerce’s own.
    I’ll try a few things.

    MJ

    Plugin Author yoancutillas

    (@yoancutillas)

    Hello MJ,

    Ok I understand,
    I am sorry I can’t think of any good alternative,

    Using WooCommerce product stock might be a good idea for subscriptions, but if you want your events to be sold individually too, you will need to
    – manually decrease their availability when you sell a subscription,
    – manually decrease your subscription stock when you sell an individual event

    Making it automatic would require a lot of code to keep the availabilities relevant during the order process and after, when the order status or the booking status changes.

    Regards,
    Yoan Cutillas

    Thread Starter -MJ-

    (@mj-3)

    Hello Yoan

    It is not your fault. I will surely find a solution here.

    One question: If I have a calendar with only a single entry. Is it possible to preselect that?

    At the moment I can only think of a detour via jQuery, which initializes a click on this entry.

    I will mark the entry as done, because the main question is clarified.

    Thank you!

    Thread Starter -MJ-

    (@mj-3)

    My current solution is: I set my product (the price) as a ‘variable subscription’ and set as variants the corresponding times. This will give me a dropdown with the times (for example ‘Wed 5pm’).

    I keep showing the calendar but hide all avalaibility info. For this I use the internal WooCommerce avalaibility setting. However, now is the extra click on the calendar superfluous.

    It should be initialized along with the selection of the dropdown.

    Plugin Author yoancutillas

    (@yoancutillas)

    Thank you for sharing your solution!

    Fortunately, I have already made a snippet of code for another customer to pick the first event when the calendar is loaded.

    Add this code in a file named functions.js, at the root of your child theme:

    $j( document ).ready( function() {
    	// Pick the first event when the calendar is loaded
    	$j( '.bookacti-booking-system' ).on( 'bookacti_after_calendar_set_up', function() { 
    		var booking_system		= $j( this );
    		var booking_system_id	= booking_system.attr( 'id' );
    		var booking_system_data	= bookacti.booking_system[ booking_system_id ];
    		if( booking_system_data[ 'events' ] !== 'undefined' ) {
    			if( booking_system_data[ 'events' ][ 0 ] !== 'undefined' ) {
    				bookacti_event_click( booking_system, booking_system_data[ 'events' ][ 0 ] );
    			}
    		}
    	});
    });

    Then add this code in the functions.php file of your child theme:

    function my_theme_enqueue_global_scripts() {
    	wp_register_script( 'my_theme_js', get_stylesheet_directory_uri() . '/functions.js', array( 'jquery', 'bookacti-js-global-var', 'bookacti-js-booking-system-functions' ), '1.0.0', true );
    	wp_enqueue_script( 'my_theme_js' );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_global_scripts', 15 );
    add_action( 'admin_enqueue_scripts', 'my_theme_enqueue_global_scripts', 15 );
    Thread Starter -MJ-

    (@mj-3)

    Thank you, Yoan.

    It works like a charm.

    So I can also read the data-tags and combine them with my properties dropdown.

    Outstanding. Thank you!
    MJ


    Edit: For following readers maybe useful: I still had to adjust the class so that it works with the form in the frontend. (.bookacti-wc-form-fields in my case)

    • This reply was modified 5 years, 3 months ago by -MJ-.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Availability on subsequent repetitions of subscriptions (maybe understanding)’ is closed to new replies.