• Hi there,

    I am trying to find this topic everywhere, but I can not find the solution anywhere.
    I have created a form on my site that is connected to an Apayment provider (payment service provider: Redsys).

    I have 2 types of info on the form: Visible and hidden

    VISIBLE:
    – Empresa (company) / Nombre (Name) / Correo (Email) / Producto (Product) / Importe (Ammount)

    HIDDEN:(as I don’t want the customer to modify them as they have to be connected to the Apayment provider (payment service provider):

    – Código Comercio (Commercial Code)
    – Terminal (Terminal)
    – Número de pedido (Order number)

    These ones I have set them up under “Actions” tab >> Redirect >> Fields to pass as URL query parameters, in order to send the info to the Apayment provider (required).

    Question 1: ** The first 2 fields I want to be filled out automatically by the text supplied by me and not editable by anyone else, I mean, this text won’t change as always will be the same. What code should I add to make it work???

    Question 2: ** The last one (order number) I would like to be generated automatically every time someone tries to fill out and send the form, that way, will create a new number for each order created. What code should I add to make it work???

    This is what I have written so far:

    <br>
    
    <label><strong>EMPRESA</strong> [text* Empresa placeholder "* Escribe el nombre de tu empresa"] </label>
    <label><strong>NOMBRE</strong>
    [text* Nombre placeholder "* Escribe el nombre de tu nombre"] </label>
    <label><strong>CORREO</strong>
    [email* Email placeholder "* Escribe el nombre de tu correo electrónico"] </label>
    <label><strong>PRODUCTO</strong>
    [text* Producto placeholder " * Escribe el nombre del producto a adquirir"] </label>
    
    <label><strong>IMPORTE</strong>
    [number* Importe placeholder " * Escribe el IMPORTE €"] </label>
    
     </label>
    
    <br>
    
    <label>[hidden CodigoComercio readonly class:required "my number"]
    <label>[hidden Terminal readonly class:required "my number"]
    <label>[hidden Npedido readonly class:required "?????"]
    
    [honeypot honeypot-1]
    [submit "Realizar el pago"]
    &nbsp;

    I would be very gratefull if you could help me on that matter.

    Kind regards

    Elixabete

    • This topic was modified 2 years, 2 months ago by elixask.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter elixask

    (@elixask)

    Hello?!
    Anyone can help?!
    Thanks

    Q1. CF7 has filter for hidden fields where you can add hidden fields with specific values:

    function filter_wpcf7_form_hidden_fields( $hidden_fields ) {
    	$hidden_fields = array(
    		'Commercial Code' => 'A123',
    		'Terminal'  => '01',
    	);
    	return $hidden_fields;
    };
    add_filter( 'wpcf7_form_hidden_fields', 'filter_wpcf7_form_hidden_fields', 10, 1 );

    Q2. You can use special mail tag for order # [_serial_number] with the Flamingo plugin https://contactform7.com/special-mail-tags/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Generate a order number for each form filled’ is closed to new replies.