Adding WordPress $producttitle to...

User 2284760 Photo


Registered User
9 posts

Hello,
I am using wordpress + woocommerce with a web builder form for free quotes. I need the form to grab the product title and send it along with all the other details in the email to myself and the customer. Is this possible? I have tried adding a hidden field with value <?php echo $producttitle; ?> but this did not work. Any way to grab the product title and push with the other info? Thank you!
Grew up in Silicone Valley late 90's.
User 2284760 Photo


Registered User
9 posts

I need to add a tag similiar to [_form_results_] in the email that displays the page title or prodct title of current page user is on.
Grew up in Silicone Valley late 90's.
User 187934 Photo


Senior Advisor
20,271 posts

If the $producttitle variable is being set on the page the form is on you can use this in an input that you add through the form builder by alter the formname.html.

<input type="hidden" name="date" id="item3_text_1" data-hint="" value="<?php echo $producttitle ; ?>" />

I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2284760 Photo


Registered User
9 posts

Ohh great, I'll try this today Eric thank you!
Grew up in Silicone Valley late 90's.
User 2284760 Photo


Registered User
9 posts

I'm using the older flash version and entered in the hidden field with name= name and value= <?php echo $producttitle ; ?> but the email just shows <?php echo $producttitle ; ?>

The product title is called in the wordpress php file with <?php $producttitle = get_the_title(); ?> I had to use an iframe to get the form to work with wordpress.
Grew up in Silicone Valley late 90's.
User 2284760 Photo


Registered User
9 posts

http://www.coffeecup.com/forums/web-for … -the-page/
Grew up in Silicone Valley late 90's.
User 2284760 Photo


Registered User
9 posts

Eric, I used your tutorial from last year below and it is actually working and providing a usable link but the link is unreadable as far as product wise goes. This is what the link in the email is showing:





******Capture the url of your forms and submit it.******
1. Make your form and place a text field in it for the url and Label it Referer and name it referer.
2.Preview your form in the form builder then right click and view source code.
3. Scroll down the source code until you find the Referer label. Look above this and you should see something like this.
<div class="fb-item fb-100-item-column" id="item2" style="opacity: 1;"> Make a note of the id name id="item2" Yours will probably be different.
4. Now look below the Referer label and you should see something like this.
<input name="referer" id="item2_text_1" type="text" maxlength="254" placeholder=""
autocomplete="off" data-hint="" /> make a note of the id name id="item2_text_1" Yours will probably be different.
5. Now go back to the form builder and place a HTML element at the top and paste the code below into it.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript">$(document).ready(function() {
var referrer = document.referrer;
$("#item2").hide();
$("#item2_text_1").val(referrer);
})</script>

Now adjust the #item2 and the #item2_text_1 to the name of your id's that you noted earlier.
Publish and test.
Grew up in Silicone Valley late 90's.
User 2284760 Photo


Registered User
9 posts

I need a working link for the parent page, form is hosted on sdrive and put on a wordpress site.

http%3A%2F%2Fwww.quickt-shirtprinting.com.au&xdm_c=default5423&xdm_p=1
Grew up in Silicone Valley late 90's.
User 2284760 Photo


Registered User
9 posts

How would I apply a urldecode in this situation?
Grew up in Silicone Valley late 90's.
User 187934 Photo


Senior Advisor
20,271 posts

Adam wrote:
I'm using the older flash version and entered in the hidden field with name= name and value= <?php echo $producttitle ; ?> but the email just shows <?php echo $producttitle ; ?>

The product title is called in the wordpress php file with <?php $producttitle = get_the_title(); ?> I had to use an iframe to get the form to work with wordpress.

I'm not supporting the old flash version any more because I don't use it at all and I'm encouraging users to get the html version. It's way easier to modify the html version of the form builder.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.