• Hi,

    is it possible to fill a custom product Field through the URL?

    XYZ/?customfield=test123

    like that way?

    Thanks!
    Regards
    Nico

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Saravana Kumar K

    (@mycholan)

    Haven’t tested it before (though some users already asked for the same).

    Will explore and let you know.

    Thread Starter carcodingbayern

    (@carcodingbayern)

    Thanks! That would be very helpful!

    Hi,
    I added this to my code, hope this can help both of you.
    (This works for text field)

    –WARNING–
    I’m not sure this is the good and safe wordpress way to achieve that.
    ——–

    
    function code_fields_rendering($field) {
        if ($value = $_GET[$field['name']]) {
            $value = sanitize_text_field($value);
            $field['default_value'] = $value;
        }
        $html = wcff()->builder->build_user_field($field, "wccpf");
        return $html;
    }
    add_filter('wccpf_before_fields_rendering', 'code_fields_rendering');
    

    Regards,
    Alexandre

    Thread Starter carcodingbayern

    (@carcodingbayern)

    @alexandrew Hi!

    Where do you add this code?
    And which variable i need to use in the URL?

    Thanks!!

    Regards
    Nico

    Hi,

    I have the same issue here. Query string parameters don’t work on WC Fields Factory. Any updates?

    Thank you very much

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fill Product Field via Url’ is closed to new replies.