• Resolved lknights1987

    (@lknights1987)


    I have created 380 forms for 380 pages. All forms are the same apart from the name of each form.

    I currently have email, persons name and offer price on the form. I want to add a phone number option to every form. Is there a way of adding this in bulk so all forms show the same or do i need to add the phone option individually to each form?

    Example is TourOfTheLine.com without phone number and BodyArmourForSale.com with the phone number on the form.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter lknights1987

    (@lknights1987)

    is there an option to do this?

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @lknights1987

    I hope you are doing well today.

    By default this is not possible. Also such feature could be to risky in case your site will have some temporary issues at the same time when you will BULK edit all forms at once. I asked our SLS Team to see is there some solution for that, but please note it could be complex and and out of scope of support. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @lknights1987

    Is there any reason why you use 380 forms? If you need to read only price from each page and place it into form, it will be more easy to create 1 form, use it on all 380 pages and if you will need to add some field in the future you could do that in 1 form, not in 380 forms.

    I can ask our SLS Team about it, as we have similar request on past where user nad 1 form on multiple pages and form was reading price from each product page.

    Kind Regards,
    Kris

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @lknights1987,

    We haven’t heard from you in a while, we will go ahead and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

    Kind regards,
    Zafer

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @lknights1987 ,

    Can you try this snippet as MU plugin https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/#installing-mu-plugins

    add_action( 'forminator_before_form_render', 'wpmudev_field_addition_phone', 10, 5 );
    function wpmudev_field_addition_phone( $id, $form_type, $post_id, $form_fields, $form_settings ) {
        $phone_fields = Forminator_API::get_form_fields_by_type( $id, 'phone' );
        if ( !is_wp_error( $phone_fields ) ) {
            return;
        }
    
        $data = array(
            'condition_action' => 'show',
            'condition_rule' => 'all',
            'placeholder' => 'E.g. +1 300 400 5000',
            'conditions' => array
                (
                ),
        
            'type' => 'phone',
            'options' => array
                (
                ),
        
            'cols' => '12',
            'required' => true,
            'validation' => 'none',
            'field_label' => 'Phone Number',
            'description' => '',
            'validation_text' => '',
            'custom-class' => ''
        );
    
        $type = 'phone';
        $wrapper = uniqid( 'wrapper-' );
        $field_id = $type . '-1';
    
        // Create empty field.
        $field = new Forminator_Form_Field_Model();
    
        // Update field settings.
        $data['id']         = $field_id;
        $data['element_id'] = $field_id;
        $data['type']       = $type;
        $data['form_id']    = $wrapper;
    
        // Bind settings to the fieldget_form_wrapper.
        $field->import( $data );
    
        // Update field slug.
        $field->slug = $field_id;
    
        // Load form model.
    	$model = Forminator_Base_Form_Model::get_model( $id );
    
        // Add the field to form.
        $model->add_field( $field );
    
        // Update all fields cols in the wrapper.
        $model->update_fields_by_wrapper( $wrapper );
    
        // Save the form.
        $model->save();
        ?>
        <script type="text/javascript">window.location.href = window.location.href;</script>
        <?php
    }

    This snippet will add phone-1 field to all the forms as soon as they are loaded on front end.

    kind regards,
    Kasia

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bulk Edit Forms’ is closed to new replies.