HUBSPOT
This topic contains 6 replies, has 3 voices, and was last updated by Kor 7 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
September 24, 2018 at 7:06 am #447457
Hello
My website is http://www.foodtrucks2u.com.au.
On my listings I have a button “Book this Food Truck” https://www.foodtrucks2u.com.au/food-trucks/sydney/jolly-slush-sydney/.
I would like to know how I replace the current link to Send Enquiry on the Details page with my own link?”
Is there a special functions code, otherwise which template can we manipulate to manually change the link.
Thanks
DanielleSeptember 24, 2018 at 9:12 am #447475Hello,
If you just want to make a new link on each listing, you could hide ‘send enquiry’ with CSS and either:
1) Add a widget that only shows on Detail pages that has a link to a different form
2) Add a custom field (URL) that is an Admin only field with the link you want, then style that as you likeIf that isn’t what you are looking for, maybe you want to customize?
For V1, we have an example of how a 3rd party plugin can be used instead of or in addition to the send enquiry feature:
Dynamic shortcode: https://wpgeodirectory.com/formidable-forms-in-geodirectory-tabs/
However, if you are leaning towards this type of integration, we would recommend at least trying it out with V2 first to see how much easier it is with Ninja Forms as an example:
https://wpgeodirectory.com/geodirectory-v2-ninja-forms/
For more about V2 see:
https://wpgeodirectory.com/docs-v2/geodirectory/overview/
Let us know if those aren’t what you are looking for.
September 24, 2018 at 9:26 am #447479Hi Danielle,
Thanks for your post. Do you mean you want to change the “Book this Food Truck” to link to something else?
Thanks!
September 26, 2018 at 12:19 am #447732Hi Kor
Yes I do.
DaniSeptember 26, 2018 at 8:26 am #447766Hi there,
Try using the code from this post and see if it helps. https://wpgeodirectory.com/support/topic/send-enquiry-link/#post-417543 . You can use the ‘Code Snippets’ plugin for this.
Thanks!
September 27, 2018 at 2:21 am #447886“Thanks for providing the following snippet to change the enquiry form link. This has been added, but the class is not showing when its added, so i’m unable to style. You can see on this page https://www.foodtrucks2u.com.au/food-trucks/sydney/chillato-pop-up-gelato-bar/
Could there possibly be some part of the code that is not correct? Can I also ask if its possible to add a target(blank) to the link and if so, would you let me know what to add. This is what we have added from post https://wpgeodirectory.com/support/topic/send-enquiry-link/#post-417543
add_filter(‘sd_details_output_send_buttons’,’_my_change_contact_link’);
function _my_change_contact_link($content){
return str_replace(‘”javascript:void(0);” class=”b_send_inquiry”‘,'”#form” ‘,$content);
}Thank you
DanielleSeptember 27, 2018 at 3:24 am #447897Hi Danielle,
Try this code and see if it helps.
add_filter('sd_details_output_send_buttons','_my_change_contact_link'); function _my_change_contact_link($content){ return str_replace('"javascript:void(0);"','"https://share.hsforms.com/1CrB1l7dITVGFWOYhgcjsLQ2x9zt" class="b_send_inquiry" ',$content); } -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket