Skip Navigation

[Resolved] Trying to integrate Click4Advisor Call and Chat buttons into Advisor View

This support ticket is created 2 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by WilliamM1564 2 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#2296237

Tell us what you are trying to do?
I am trying to integrate Click4Advisor "Call Now" and "Chat Now" buttons into a view for a custom post type (Advisors).

There will be a snippet of code to create the button that looks something like this (the following came from Click4Advisor)

<!-- Click4Advisor tag starts--><map name='31'><area shape='rect' coords='0,0,113,67' href='#POP' onclick='javascript:window.open("hidden link"+location.href,"_blank","height=380,width=530,left=20,top=20,resizable=no,menubar=0,toolbar=0,status=0")'><area shape='rect' coords='2,68,113,86' href='hidden link' target='_blank'></map><!--Click4Advisor tag ends-->

Please note that this code is not usable in this state and is just a sample. If you would like to see a sample of a functioning button, the main page of the Click4Advisor website has a "Free Demo" feature with the button integrated. On hidden link, scroll to the bottom of the page to where it has a button for " Click to Call and Click to Chat FREE DEMO".

Is there any documentation that you are following?

Only the documentation from Click4Advisor (quoted above). I don't know where to look in the Toolset documentation for how to integrate external code into a custom post type. I expect that there will be a group number (unique to the site) and an advisor number (unique to each advisor) which will need to be passed to the code in from each individual advisor post in order to retrieve the right buttons and links for each advisor.

I am not sure where to start trying to figure this out.

Is there a similar example that we can see?

hidden link

Of course this does not use Toolset but you can see basically what I am trying to accomplish.

What is the link to your site?
Not deployed yet.

#2296319

Hello,

You can try with WordPress built-in "Custom HTML" block, see WP document:
https://wordpress.org/support/article/custom-html/

I have tried it in my localhost with below HTML codes:

<!-- Click4Advisor tag starts--><a shape='rect' coords='0,0,113,67' href='#POP' onclick='javascript:window.open("<em><u>hidden link</u></em>"+location.href,"_blank","height=380,width=530,left=20,top=20,resizable=no,menubar=0,toolbar=0,status=0")'>Test it</a><!--Click4Advisor tag ends-->

It works fine

#2296911

OK, so I just got better clarification from Click4Advisor about how to do this in WordPress.

Code for the Call Now button for WordPress is as follows (thankfully much more concise):

<a href="<em><u>hidden link</u></em>" target="_blank" rel="nofollow"><img src="<em><u>hidden link</u></em>" alt="Call Now" /></a>

(All of the above goes inside a code tag, but the support system interpreted it.)

Here is the part I don't have a clue about. Each Advisor listing will have its own cid and linker number. Would I need to generate the code on the fly, adding the correct variables for each listing? Is that even possible?

Or would I have to store the complete code in each Advisor listing with the appropriate variables set? I would still need to figure out how to express a field from a custom post type as code.

I apologize for the confusion earlier. I am excited about using Toolset for this project.

Thank you so much

#2298321

The maintenance robot asked if it could close this ticket, but I still haven't heard back from my last question.

#2298333

You can try these:
1) create a custom single line field "Click4Advisor" in post type "Advisor":
https://toolset.com/course-lesson/creating-custom-fields/
2) Edit each "Advisor" post, setup the field "Click4Advisor" as you mentioned above, for example:

<a href="<em><u>hidden link</u></em>" target="_blank" rel="nofollow"><img src="<em><u>hidden link</u></em>" alt="Call Now" /></a>

3) In single "Click4Advisor" post, display a Toolset single field block, choose above field "Click4Advisor"
https://toolset.com/block-item/single-field/

#2298345

Thank you.

Just to clarify, is there a way to build out to code and just store the cid and linker numbers in each Advisor post?

That is, put the code in at display time and plug in the cid and linker numbers from the Advisor record?

As I understand what you have suggested, it would mean manually updating the code for each advisor and saving the whole snippet as a custom field. This seems more error prone than storing the code once and the variables separately.

Thanks again,
William

#2298357

Yes, it is possible, for example, you can use Types shortcode to setup the HTML codes manually, like these:
1) create two number field in post type "Advisor":
- cid
- linker
https://toolset.com/course-lesson/creating-custom-fields/

2) Edit each "Advisor" post, setup above custom fields value

3) In single "Click4Advisor" post, display a "Custom HTML" block, with below codes:

<a href="<em><u>hidden link</u></em> field='cid'][/types]&linker=[types field='linker'][/types]" target="_blank" rel="nofollow"><img src="<em><u>hidden link</u></em> field='cid'][/types]&stat=2161" alt="Call Now" /></a>

https://wordpress.org/support/article/custom-html/

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#number

#2298465

That resolves this issue. Thank you!