Posted: February 12, 2020 at 5:24 pm
|
My client wants an alert/popup to happen when the “add to cart” button is clicked. I would imagine a continue/ok button on the popup to add to cart or decline. Any ideas of a plugin or coed snippet? |
Hi, The Multi Event Registration add-on adds this. May I ask do you have that plugin installed on your site? If so, you should already see a modal window open when adding an event to the cart. If you’re not seeing this happen, maybe you can share a link to an event on your site so we can investigate? |
|
|
I was probably not clear enough. I need a custon text on the modal that says “If you bought the full registration this item is already included” and the a continue or delete before it adds it to the cart. |
Hi, Adding/modifying the text within the modal can be done with a text snippet. Changing the behavior of the Add to cart button to make it not actually add to the cart would require a significant rewrite of the plugin. If there’s a specific text string within that modal that you’d like to change its wording I can point you to a specific filter hook that allows for changing that string. |
|
|
Yes, adding/modifing to the text string would work. |
To change the ‘1 item was sucessfully added for this event’ string you can use the Example: https://gist.github.com/Pebblo/c0a730bf7396964f1d58bd6ebbc96b9a To change the ‘THERE ARE CURRENTLY X ITEMS IN THE EVENT CART.’ text you can use the |
|
|
Can this be edited to target a specific ticket? |
Hi, You could work with tickets within the context of that message. Here’s another example based off Tony’s example that shows how to get and display the names of the tickets that are currently in the cart: https://gist.github.com/joshfeck/3b0c0049c06910680611e22d717ce078 From there you could get Ticket IDs, add logic, then display different custom messages based on what’s already in the cart. If you’re not sure how to work with objects or arrays and php conditionals then it’d probably be best to team up with a PHP developer to help get this done for your client. |
|
The support post ‘Alert when clicking add to cart button’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.