• Resolved bahadir

    (@0123xyz)


    Hello,

    I am using a contact form created with Forminator for out of stock products. However, I have a problem. Each product has multiple sizes, and I can’t determine which size the user is inquiring about. What approach should I take to find this out?

    Also, I use the “WPC Variations Radio Buttons for WooCommerce” plugin to make it easier for users to select product variations. I made a small modification in this plugin to display “Contact Us” for out of stock products and linked it to the Forminator form. When users open the form through the “Contact Us” link, I want to process the size of that specific variation and have it appear in the email received after the user submits the form. I was able to display the size information on the front end of the form using JavaScript, but I couldn’t add the size information to the email I received after submitting the form.
    Can you help me with this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @0123xyz

    I hope you are doing well today.

    Apart from exporting the form and uploading it to google drive and sharing a link in your next reply, can you also give us more details and a link to what JS solution you have made to display the size information on the front end so that we could be on the same page when testing this on out side?

    Kind Regards,
    Kris

    Thread Starter bahadir

    (@0123xyz)

    Thank you for your attention and kindness.

    I have uploaded everything related to the Forminator form to Google Drive, including the custom CSS I created ??

    https://shorturl.at/eADY8


    Btw, I think mentioning this would be beneficial. Although you will notice it when you import the exported Forminator form back in, let me still clarify. Thanks to the JavaScript code I added to the theme’s functions.php file, I managed to display the product size information on the Forminator form. To have this product size information appear in the email received after submitting the form, I added the Forminator HTML field ‘{html-6}’.

    Actually, my problem is not knowing how to add a field to the Forminator form, in order to display the product size information I obtained using JavaScript, in the email.

    • This reply was modified 1 year, 7 months ago by bahadir.
    • This reply was modified 1 year, 7 months ago by bahadir.
    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @0123xyz

    Thank you for response and providing form and code.

    If I understand this correctly, the code is already correctly fetching and displaying the size but size is not submitted. You want to display that size on the form for user (but not editable – as it’s automatically fetched) but then also to include it in submission and e-mail.

    For that, you’ll need some small changes as described below.

    1. remove “html-6” field (the one you are using to display the size) form the form

    2. add “input” type field to the form and label it as “Size”, and note down it’s ID

    3. in that newly added “input” type field set following CSS class in “Styling” setting to “product-size”

    4. now edit your JS

    a) replace this line

    $('.woovr-variation-radio').on('click', function() {

    with these two

    $('.product-size input').prop("readonly", true );
    $('.woovr-variation-radio').on('click', function() {

    b) replace this line

    $('.product-size').text('Size: ' + sizemm);

    with this one

    $('.product-size input').val(sizemm).change();

    And that’s pretty much it. You will still be displaying the size on front end (you can style this new field with CSS too) and it won’t be editable there but the value will also be included in submission so

    – you will see it in “Formiantor -> Submission”
    – and you can include this new field in your e-mails just like any other field.

    Best regards,
    Adam

    Thread Starter bahadir

    (@0123xyz)

    I thank you very much for your assistance. Thanks to you, I managed to solve my problem. Wishing you healthy days ahead.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I learn the selected product variations (product size) data?’ is closed to new replies.