AliExpress Dropshipping forum - Daniels

Forum Replies Created

  • Author
    Posts
  • Daniels
    Participant
    in reply to: Save users input #13646

    The support here isn’t very helpful.

    I couldn’t wait for them to add this option so i used a gravity forms hook to loop through all answers checking if its autocomplete field and if it is then save it somewhere where i need it.

    If you know something about coding here is my answer:

    /*Save new companies after successful form submission*/
    add_action( 'gform_after_submission', 'action_gform_after_submission', 10, 2 );
    function action_gform_after_submission( $entry, $form ) {
    
        $companies = getSurveyCompanies();
    
        $new_companies = array();
    
        foreach ( $form['fields'] as $field ) {
            if($field->get_input_type() == 'autocomplete'){
                $value = htmlspecialchars(rgar( $entry, (string) $field->id ));
    
                if($value){
                    $is_in_db = false;
    
                    if(strlen($value) > 170){
                        $value = substr($value,0, 170);
                    }
    
    
                    foreach ($companies as $company){
                        if($company->name == $value){
                            $is_in_db = true;
                            break;
                        }
                    }
    
                    if(!$is_in_db){
                        array_push($new_companies, $value);
                    }
                }
            }
        }
    
        if(!empty($new_companies)){
            foreach ($new_companies as $company){
                if(strlen($company) > 3){
                    addSurveyCompany($company);
                }
            }
        }
    }
    /*END Save new companies after successful form submission*/
    Daniels
    Participant
    in reply to: Special Characters #13609

    They gave me version 1.8.7, but the bug persists in that version as well. Can you tell me in what version this bug should be fixed?

Turn Your Store Into

Cash Machine

Enter email and get FREE eBook with

best dropshipping tips for 2020

guide box

By entering your email, you agree to receive marketing

emails from Ali2woo. You can unsubscribe any time.

Thank you!

Check Your E-mail & Start Downloading

Thank you for your interest in our e-book. We’ve sent you an email with a download link - simply click it, and start downloading

Download our free ebook:

Turn Your Store Into Cash Machine