HUBSPOT

This topic contains 6 replies, has 3 voices, and was last updated by  Kor 5 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #447457

    foodtrucks2u
    Expired Member
    Post count: 21

    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
    Danielle

    #447475

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    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 like

    If 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.

    #447479

    Kor
    Moderator
    Post count: 16516

    Hi Danielle,

    Thanks for your post. Do you mean you want to change the “Book this Food Truck” to link to something else?

    Thanks!

    #447732

    foodtrucks2u
    Expired Member
    Post count: 21

    Hi Kor

    Yes I do.
    Dani

    #447766

    Kor
    Moderator
    Post count: 16516

    Hi 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!

    #447886

    foodtrucks2u
    Expired Member
    Post count: 21

    “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
    Danielle

    #447897

    Kor
    Moderator
    Post count: 16516

    Hi 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); 
    }
Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket