I am developing a website with Elementor. I have setup a template (with crocoblock) which will show certain items based on the fields I have selected. Now for the single post template, I want to show the service , description etc. and then I would like for the customer to book the service straight from that single post I am using the shortcode [ameliacatalog service=1] However I would like the service id to be dynamic so that I can call this from the template I have attached a screenshot, with what I would like to achieve.
<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>
Here's also an example of changing the Employee's ID 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/).
Many thanks for your feedback. Much appreciated! I will try this out soon and let you know if it works. Meanwhile I have found a workaround, by putting the shortcode+id of Amelia in the content field of each dynamic post. I am not using this field in the post, since I am buillding my content with Elementor. This worked. However I will try your method as this would allow me to be more flexible with the pages and the template.
Good afternoon,
I am developing a website with Elementor. I have setup a template (with crocoblock) which will show certain items based on the fields I have selected. Now for the single post template, I want to show the service , description etc. and then I would like for the customer to book the service straight from that single post
I am using the shortcode [ameliacatalog service=1] However I would like the service id to be dynamic so that I can call this from the template I have attached a screenshot, with what I would like to achieve.
Hello Dennis.
You can try using the following script:
Here's also an example of changing the Employee's ID 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:
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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 Aleksandar,
Many thanks for your feedback. Much appreciated! I will try this out soon and let you know if it works. Meanwhile I have found a workaround, by putting the shortcode+id of Amelia in the content field of each dynamic post. I am not using this field in the post, since I am buillding my content with Elementor. This worked. However I will try your method as this would allow me to be more flexible with the pages and the template.
Kind regards,
Dennis
I'm glad to hear that, Dennis!
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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