• I have ACF group with various fields to create an option page.

    I try to create a flexible reservation page.

    Most options are already coded, but the main part (explained below) goes above my head. I’m willing to pay to make that part work.

    I already filled a request on Codable.io but I rather ask you because for me you’re the most trusted ACF Expert I know.

    My setup:

    I have a repeater field to set the opening hours
    With sub fields:
    – Day of the week (multi checkbox)
    – Start time (select field)
    – End time (select field)

    And I have a repeater field to set the exceptions to the opening hours set
    With sub fields:
    – Date (datepicker)
    – Whole day (checkbox)
    – Start time (select field)
    – End time (select field)

    What I want to accomplish:

    1. You can set various week days with various opening hours on the option page.
    2. You can set various exceptions on specific dates on the option page.
    3. A visitor selects a date on the frontend reservation form.
    4. The available times for that specific date/day of the week become visible.

    So the system needs to check the day of the week (of the selected date in time picker) and also look for possible exceptions on that specific date.

    All on the fly, so on the frontend form possible reservation times change, when a different reservation date is selected.

    All is coded with an option page and so on. I only need the opening hours/exceptions thing coded as described above.

    To answer for my project needs to be something in this area (just a not working example):

    add_filter('acf/prepare_field/name=booking_time', 'yl_populate_time_field_on_selected_date');
    function yl_populate_time_field_on_selected_date($field){
        
        // Reset conditions
        // Warning: Conditions set in the UI won't be compatible!
        $conditions = array();
    
    	$conditions[] = array(
    		array(
    			'field'     => 'field_5ed4178dd63d7',
    			'operator'  => '==',
    			'value'     => '20200101',
    		)
    	);
    
        if(have_rows('booking_settings_exceptions', 'booking_settings')):
            while(have_rows('booking_settings_exceptions', 'booking_settings')): the_row();
    
                $date		= date_i18n('Ymd', strtotime(get_sub_field('booking_settings_exceptions_date', 'booking_settings')));
    			$session	= get_sub_field('booking_settings_exceptions_session');
                
                // Check: Booking exceptions sessings
                if (!empty($date) && $session == '2') {
    
    				// Adding a new AND condition inside Base condition, at the index = 0
    				$conditions[] = array(
    					array(
    						'field'     => 'field_5ed4178dd63d7',
    						'operator'  => '==',
    						'value'     => $date,
    					)
    				);
    
    			}
            
            endwhile;
        endif;
    
        // Setting the full condition
        $field['conditional_logic'] = $conditions;
         
         return $field;
        
    }

    Can you make this happen and if YES, can you send me a quote?

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello Dennis,

    Thanks for the feedback! Sorry but as of now I’m 100% focused on ACF Extended and I don’t have any spare time for custom development work. I hope you’ll find someone on codable.

    Good luck!

    Regards.

Viewing 1 replies (of 1 total)

The topic ‘Payed custom work?’ is closed to new replies.