Support » Plugin: Product Catalog » include custom fiel in contact-form

  • Resolved mwhandel

    (@mwhandel)


    Is it possible to include the value of a custom field as a text-field in the UPCP Inquiry Form?

    I created a custom field “artnr” for the productnumber. With an inquiry it is important for us to know exactly the product from where the form was created.

    Otherwise I had to include the productnumber in the title of the product. That makes the title rather long.

    Any ideas?

    Thanks in advance
    Ruth

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor EtoileWebDesign

    (@etoilewebdesign)

    Hi Ruth,

    Unfortunately, the only variable specified in our code for the Product Inquiry form is the Product name.

    One possible workaround:

    Edit the Inquiry contact form itself, add a “Product Number” field and make that field required.

    So instead of this:

    <p>Your Name (required)<br />
        [text* your-name] </p>
    				
    <p>Your Email (required)<br />
        [email* your-email] </p>
    
    <p>Your Message<br />
        [textarea your-message] </p>
    
    <p>[submit "Send"]</p>

    Your form code will look something like this:

    <p>Your Name (required)<br />
        [text* your-name] </p>
    				
    <p>Your Email (required)<br />
        [email* your-email] </p>
    
    <p>Inquiry Product Name<br />
        [text product-name "%PRODUCT_NAME%"]</p>
    
    <p>Your Product Number<br />
        [text* product-number]</p>
    
    <p>Your Message<br />
        [textarea your-message] </p>
    
    <p>[submit "Send"]</p>

    Thank you for that suggestion. In this way, the visitor will be forced to enter the product-number. Not the best idea to get new customers. So I will find a way to make the product-titles unique.

    Regards
    Ruth

    Hi

    I was struggeling around with this as well and managed to solve it like this:

    In my contact form i use:

    <p>[text product-name readonly class:wpcf7-hidden “%PRODUCT_NAME%”]</p>
    
    <p>[submit “Anfrage senden”]</p>

    and in the e-mail settings of the contact form:

    From: [your-name] <[your-email]>
    Artikel ID: [product-name]

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    -The input field is hidden so the user cannot see. It is auto-filled with the product-name and this is used in the e-mail which is sent.

    Hope that helps 🙂

    Best,
    Thomas

    • This reply was modified 2 years, 5 months ago by  bdbrown.
    Plugin Contributor EtoileWebDesign

    (@etoilewebdesign)

    Hi Thomas,

    Thanks for posting the solution you found for Ruth (@mwhandel) 🙂!

    Hi Thomas,

    thank you very much for the idea to hide entries in the form.

    Ruth

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘include custom fiel in contact-form’ is closed to new replies.