• Hi,

    For a client I’m using your plug-in with great joy.

    There’s one problem I have with this filter salesforce_w2l_field_value. I cannot pre-select an option in the picklist I’m using with name: Pakketnaam. Backend UI: https://cl.ly/2l1O1T0H172t

    My code:

    /**
     * Pre-select pagackge field on sign-up forms Salesforce
     */
    
    add_filter( 'salesforce_w2l_field_value', 'salesforce_w2l_field_value_get_package', 10, 3 );
    function salesforce_w2l_field_value_get_package( $val, $field, $form ){
    
        $form_id = 1; // form id to act upon
        $field_name = 'Pakketnaam'; // API Name of the field you want to autofill
    
        if( $form == $form_id && $field_name == $field ){
          if( isset( $_GET['package-selection'] ) ){
                $val = $_GET['package-selection'];
          }
        }
    
        return $val;
    
    }

    I’m using the URL: sign-up/?package-selection=Pro I’ve tested it with a text field and that works great.

    Thanks for your advice!

    Nick

    • This topic was modified 7 years, 2 months ago by webbionl.
  • The topic ‘salesforce_w2l_field_value with picklist’ is closed to new replies.