• Resolved chustaschus

    (@chustaschus)


    hello.

    I would like create new tab option to create new config meta on activities.

    I create new tab, but I cant get saved data.

    Could you help me?

    /**
     * Add a "Custom" tab in activity settings
     * @since 1.3.0
     * @param array $tabs
     * @return array
     */
    function dz_bapap_add_activity_price_tab( $tabs ) {
    	$tabs[] = array(	
    		'label'			=> esc_html__( 'Custom', 'booking-activities' ),
    		'id'			=> 'custom',
    		'callback'		=> 'bapap_fill_activity_tab_custom',
    		'parameters'	=> array(),
    		'order'			=> 150 );
    	return $tabs;
    }
    add_filter( 'bookacti_activity_dialog_tabs', 'dz_bapap_add_activity_price_tab', 101 );
    
    function bapap_fill_activity_tab_custom(){
    	$fields = array(
    		'max_adults' => array(
    			'type'  => 'number',
    			'name'  => 'Custom',
    			'id'    => 'max_adults',
    			'class'	=> 'max_adults',
    			'title' => esc_html__( 'Custom', 'booking-activities' ),
    			'tip'   => esc_html__( 'Custom.', 'booking-activities' )
    		)
    	);
    	
    	bookacti_display_fields( $fields );
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author yoancutillas

    (@yoancutillas)

    Hello,
    No, unfortunately, I cannot provide support for custom code.

    I can see in the function name that you are using the Prices and Credits add-on. If it helps, you can find a full code example in ba-prices-and-credits/controller/controller-templates.php

    Thread Starter chustaschus

    (@chustaschus)

    I would like get the next thing

    – I have children and adults
    – The limit for event is 10.
    – i would like limit adults to 6 and children to 4
    The total limit is 10, but I need limit adults, do you think it is possible without modify the plugin?

    Thanks

    Plugin Author yoancutillas

    (@yoancutillas)

    No, unfortunately there is no option to set a max quantity per price category. I note your feature request, thank you.

    An alternative solution would be to use the Advanced Forms add-on:
    – create a (paid) custom field “Number of children” (a “number” input, with max value = “4”) (e.g.: see the “Number of extras” field on that demo, docs)
    – Change the “Quantity” field label to “Number of adults”. If you are using WooCommerce, the default WC quantity input is used and you cannot add a label to it. As a workaround, you can add a “Free text” field before WC’s quantity input.
    – Set your events availability to “6” in the calendar editor

    However, note that with this solution, children won’t be deducted from the availability of the event, and the customer must book for at least 1 adult.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Create new tab option’ is closed to new replies.