Tagged: CONTACT FORM, enfold, woocommerce
-
AuthorPosts
-
February 1, 2016 at 2:22 pm #575755
We are running a woocommerce site on Enfold (selling used machinery). On each product page we have a standard enfold contact form. When the forms come through in email format we want it to include the URL of the page it was sent from (A link to the actual product). Really struggling and appreciate any advice for what I assumed would be a simple task…
February 2, 2016 at 7:13 am #576266Hi Paul!
Thank you for using Enfold.
Please add this in the functions.php file:
add_filter('avf_form_message', 'avf_form_message_mod'); function avf_form_message_mod($message) { global $post; $message .= "<br>Page: ".get_the_title($post->ID); return $message; }Best regards,
IsmaelFebruary 2, 2016 at 2:43 pm #576436Thanks Ismael, Could you be specific about which Functions.php file. We tried it in the theme and child theme functions PHP file and it broke the site.
Paul
February 2, 2016 at 2:45 pm #576438Hey!
Please go to Appearance > Editor and add the code Ismael posted above into functions.php file.
Regards,
YigitFebruary 2, 2016 at 7:05 pm #576638Thanks Yigit. I’ll try this.
February 3, 2016 at 8:31 am #576955Hi,
Great, please let us know if you should need any more help on the topic.
Thanks,
RikardOctober 13, 2017 at 3:56 pm #864015This is great, is there anyway to add the actual URL rather than just the page title?
October 16, 2017 at 7:14 am #864686Hi,
Replace the get_the_title function with the get_the_permalink function.
// https://developer.wordpress.org/reference/functions/get_the_permalink/
Best regards,
IsmaelJuly 13, 2021 at 12:47 pm #1309942Hi
My php skils kinda stink
How would I format it to get
Sent from: Page title ?This would be a good standard function btw.. usually in the websites that I build I put contact forms on every single page.. on the sites where this really matters to me I switched to Gravity Forms almost solely for this reason.. haha.. I should’ve searched a bit more maybe
July 18, 2021 at 3:43 pm #1310600Hi,
@joax: You need to replace this line within the filter or the snippet above.$message .= "Page: ".get_the_title($post->ID);Try to replace it with this code instead.
$message .= "Sent from: " . get_the_title($post->ID);Best regards,
IsmaelAugust 18, 2021 at 7:41 am #1317289This reply has been marked as private.August 19, 2021 at 5:23 am #1317416Hi,
You will have to append the links manually to the $message.
$message .= "<a href='https://facebook.com?utm_source=Facebook&utm_medium=Sepet1&utm_campaign=tr-yeni">Facebook></a>";If you need more assistance, please feel free to open another thread. We will close this one for now.
Best regards,
Ismael -
AuthorPosts
- The topic ‘Enfold contact form includes the URL of the page it is sent from’ is closed to new replies.
