I want to PRE SET resources fileds in bookings in vendor dashboard
-
I want to pre-set resources fields in bookings in vendor dashboard publishing page. I wrote this code but it is not working. Help please
add_filter( 'wcfmI_wcbokings_resource_fields', function( $resource_fields, $resource_id ) { $_wc_booking_resources = array('label' => __('Resources', 'woocommerce-bookings') , 'type' => 'multiinput', 'class' => 'wcfm-text wcfm_ele resource_types booking accommodation-booking', 'label_class' => 'wcfm_title resource_types booking accommodation-booking', 'value' => $resources, 'options' => array( "resource_title" => array('label' => __('Title', 'woocommerce-bookings'), 'type' => 'select', 'options' => array( 'video' => __( 'Video', 'woocommerce-bookings'), 'banner' => __( 'Banner', 'woocommerce-bookings' ), 'audio' => __( 'Audio', 'woocommerce-bookings' ), 'text' => __( 'Text', 'woocommerce-bookings' ), 'mention' => __( 'Mention', 'woocommerce-bookings' ), 'interview' => __( 'Interview', 'woocommerce-bookings' ) ), 'class' => 'wcfm-select wcfm_ele booking', 'label_class' => 'wcfm_title resource_types_label booking accommodation-booking' ), "resource_base_cost" => array('label' => __('Base Cost', 'woocommerce-bookings'), 'type' => 'text', 'class' => 'wcfm-text wcfm_ele resource_types_text booking accommodation-booking', 'label_class' => 'wcfm_title resource_types_label booking accommodation-booking' ), "resource_block_cost" => array('label' => __('Block Cost', 'woocommerce-bookings'), 'type' => 'number', 'class' => 'wcfm-text wcfm_ele resource_types_text booking accommodation-booking', 'label_class' => 'wcfm_title resource_types_label booking accommodation-booking' ), "resource_quantity" => array('label' => __('Quantity', 'woocommerce-bookings'), 'type' => 'number', 'class' => 'wcfm-text wcfm_ele resource_types_text booking accommodation-booking', 'label_class' => 'wcfm_title resource_types_label booking accommodation-booking' ), "resource_id" => array('type' => 'hidden', 'class' => 'resource_id' ) ) ); $resource_fields['_wc_booking_resources']['value'] = $_wc_booking_resources; $resource_fields['_wc_booking_resources']['custom_attributes'] = array( 'limit' => 3 ); $resource_fields['_wc_booking_resource_label']['value'] = 'AD TYPE'; return $resource_fields; }, 50, 2 );
- The topic ‘I want to PRE SET resources fileds in bookings in vendor dashboard’ is closed to new replies.