I created individual pages for the “employees” profiles. From there I want to insert an Amelia booking link that will dynamically create the booking for that employee's page. This is so that my users can directly book a service pertaining to that employee directly from his/her page and I won't have to create a calendar for each person manually.
Is there a way to have the calendar dynamically get the employee's id and have it in the shortcode?
Thank you for purchasing our product, and for reaching out to us.
It is possible with a code, the code below should be placed on the page where [ameliacatalog] short-code is and If part should be repeated for as many employees as you want. The employee name needs to be the same as it is in Amelia (replace Sylvester Stallone) and in <a href="#"> # should be replaced with the employee profile page you have.
<script>
window.beforeCatalogServiceLoaded = function () {
setTimeout(function () {
var elements = document.getElementsByClassName('am-service-provider') for (var i = 0; i < elements.length; i++) {
var employeeName = elements[i].children[1].innerHTML if (employeeName === 'Sylvester Stallone') {
elements[i].children[1].innerHTML = '<a href="#">' + employeeName + '</a>'
}
}
}, 1000)
}
</script>
[ameliacatalog]
This is an example for you to change the service ID in the shortcode that needs to be customized to change the employee ID
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
function(m, key, value) {
vars[key] = value;
});
return vars;
}
bookingEntitiesIds[bookingEntitiesIds.length - 1]['service'] = getUrlVars()['service'];
</script>
If you have any more questions please feel free to open another ticket.
I thought I replied to this right after you responded but I don't see it anymore. So here it goes again...
Hi and thanks for taking the time to answer.
I'm actually looking for a fully automated way to do this without entering in code for each member. I'd like for the booking calendar to recognize who the employee is by id and only present the user with their booking calendar.
I have a profile template page for all employees that I plan on placing this booking calendar and hoping there is a solution where I can place the code for the booking calendar on here so I don't have to do anything else. Do you guys have a way for me to do this?
Thank you for sending this. I'm not sure where to put this code and how it will connect to the booking shortcode with the employee that is logged in? Can you please give me some more details?
This is a custom solution for people who dynamically change the ID in the shortcode with the ID found in the URL of the profile page, so, this is a javascript that's placed on the template page, it would pick up the ID from the URL and place it in the shortcode custom solution that requires a certain level of programming skills.
Our support is for advice only, other types of services such as custom programming services, the implementation of those codes that is not covered and included in our support.
For this type of service, you must contact your dev team or some other specialized company that provides this type of service.
If you have any more questions please feel free to open another ticket.
I understand what you are saying and respect it. I already invested so much money for a dev to implement functions that I was told in my pre-purchase questions Amelia can handle so I'd like to figure out what you gave me and make it work by asking you for clarification on some things, if possible.
1.) Can you explain what you meant in your instructions by "The employee name needs to be the same as it is in Amelia (replace Sylvester Stallone)?" From what I'm reading in the code given, I'm not seeing how this IF statement is comparing the employee id name from the URL to a full-text name that I'm supposed to type in when it should dynamically be getting the name or id.
window.beforeCatalogServiceLoaded = function () { setTimeout(function () { var elements = document.getElementsByClassName('am-service-provider') for (var i = 0; i < elements.length; i++) { var employeeName = elements[i].children[1].innerHTML if (employeeName === 'Sylvester Stallone') { elements[i].children[1].innerHTML = '<a href="#">' + employeeName + '</a>' } } }, 1000)
}
2.) I'm not seeing where the code (from the last code snippet you sent me) is placing the variable value into a shortcode. That is what is throwing me off right now. I plan on using the ameliabooking shortcode.
Any insight on this would be very helpful to me and I appreciate any more time you spend on this.
The "Sylvester Stallone" code works for [ameliacatalog] booking form and it uses the employee's name to make it a hyperlink. Take a look at the screenshot below:
The other code is used for a dynamic ID, which is usually applied to services, but it can be used for dynamic Employee IDs also. However, there may be a more elegant solution, looking at your initial request.
You can do it with the help of some plugin which has the possibility to use PHP Snippets, and add shortcodes on the page in that way. For example:
1. There's the page (where you want the booking form to be), and when you're creating links that lead to that page, in URL you need to place the ID for the employee (http://somesite/booking?employee=17)
2. On that page (where you want the booking form to be), instead of our shortcode, you'd need to add the shortcode of that plugin which uses PHP Snippet which will generate our shortcode (https://wordpress.org/plugins/insert-php-code-snippet/).
Hi,
I created individual pages for the “employees” profiles. From there I want to insert an Amelia booking link that will dynamically create the booking for that employee's page. This is so that my users can directly book a service pertaining to that employee directly from his/her page and I won't have to create a calendar for each person manually.
Is there a way to have the calendar dynamically get the employee's id and have it in the shortcode?
For example:
Thanks,
Jeremy
Hello Jeremy,
Thank you for purchasing our product, and for reaching out to us.
It is possible with a code, the code below should be placed on the page where [ameliacatalog] short-code is and If part should be repeated for as many employees as you want. The employee name needs to be the same as it is in Amelia (replace Sylvester Stallone) and in <a href="#"> # should be replaced with the employee profile page you have.
<script> window.beforeCatalogServiceLoaded = function () { setTimeout(function () { var elements = document.getElementsByClassName('am-service-provider') for (var i = 0; i < elements.length; i++) { var employeeName = elements[i].children[1].innerHTML if (employeeName === 'Sylvester Stallone') { elements[i].children[1].innerHTML = '<a href="#">' + employeeName + '</a>' } } }, 1000) } </script>
[ameliacatalog]
This is an example for you to change the service ID in the shortcode that needs to be customized to change the employee ID
If you have any more questions please feel free to open another ticket.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
I thought I replied to this right after you responded but I don't see it anymore. So here it goes again...
Hi and thanks for taking the time to answer.
I'm actually looking for a fully automated way to do this without entering in code for each member. I'd like for the booking calendar to recognize who the employee is by id and only present the user with their booking calendar.
I have a profile template page for all employees that I plan on placing this booking calendar and hoping there is a solution where I can place the code for the booking calendar on here so I don't have to do anything else. Do you guys have a way for me to do this?
Thanks.
Hello Jeremy,
We didn't get the second ticket from you thank you for sending it again.
We have forwarded your inquiry to our developers and they have sent this code
Please try it out and let us know how it went.
Looking forward to your reply.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thank you for sending this. I'm not sure where to put this code and how it will connect to the booking shortcode with the employee that is logged in? Can you please give me some more details?
Thank you!
Hello Jeremy,
This is a custom solution for people who dynamically change the ID in the shortcode with the ID found in the URL of the profile page, so, this is a javascript that's placed on the template page, it would pick up the ID from the URL and place it in the shortcode custom solution that requires a certain level of programming skills.
Our support is for advice only, other types of services such as custom programming services, the implementation of those codes that is not covered and included in our support.
For this type of service, you must contact your dev team or some other specialized company that provides this type of service.
If you have any more questions please feel free to open another ticket.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi,
I understand what you are saying and respect it. I already invested so much money for a dev to implement functions that I was told in my pre-purchase questions Amelia can handle so I'd like to figure out what you gave me and make it work by asking you for clarification on some things, if possible.
1.) Can you explain what you meant in your instructions by "The employee name needs to be the same as it is in Amelia (replace Sylvester Stallone)?" From what I'm reading in the code given, I'm not seeing how this IF statement is comparing the employee id name from the URL to a full-text name that I'm supposed to type in when it should dynamically be getting the name or id.
2.) I'm not seeing where the code (from the last code snippet you sent me) is placing the variable value into a shortcode. That is what is throwing me off right now. I plan on using the ameliabooking shortcode.
Any insight on this would be very helpful to me and I appreciate any more time you spend on this.
Thanks.
Hello Jeremy,
The "Sylvester Stallone" code works for [ameliacatalog] booking form and it uses the employee's name to make it a hyperlink. Take a look at the screenshot below:
The other code is used for a dynamic ID, which is usually applied to services, but it can be used for dynamic Employee IDs also. However, there may be a more elegant solution, looking at your initial request.
You can do it with the help of some plugin which has the possibility to use PHP Snippets, and add shortcodes on the page in that way. For example:
1. There's the page (where you want the booking form to be), and when you're creating links that lead to that page, in URL you need to place the ID for the employee (http://somesite/booking?employee=17)
2. On that page (where you want the booking form to be), instead of our shortcode, you'd need to add the shortcode of that plugin which uses PHP Snippet which will generate our shortcode (https://wordpress.org/plugins/insert-php-code-snippet/).
3. The snippet would look something like this:
That should help. Please let me know how it went.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Unfortunately, I already tried the exact code for the shortcode snippet and it didn't work. I saw it from another public ticket.
Also, the other javascript code failed due to "bookingEntitiesIds[bookingEntitiesIds not defined."
I'll need to find another way somehow. Too bad there isn't an online depository of custom snippet codes for doing these types of things. :(
Thanks for your time. I appreciate your help.
Hello Jeremy,
You are most welcome. We have forwarded this to our developers and we will see if we can do something about it in the future.
If you have any more questions please feel free to open another ticket and we will gladly you there.
We wish you all the best.
Kind Regards,
Marko Davidovic [email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables