Posted: March 6, 2017 at 12:23 pm
|
Hello. I have 3 different prices for clients. Non logged in clients (subscriber), dealsite offer #1 price (role:S2MEMBER LEVEL 1), dealsite offer #2 pricing (role:S2MEMBER LEVEL 2). I don’t want S2MEMBER LEVEL 1 AND LEVEL2 seeing any other pricing than the single ticket set to match their role and to exclude dealsite1 and dealsite pricing from non-logged in clients (role:subscriber). Below is the price structure and tickets to display. |
Hi there, You can use a function like this: https://gist.github.com/Pebblo/106393acd850cb83c3798c66a9c5a19a Add that to a Custom Functions Plugin on your site and if a user does not have the capability assigned to their account that is set on the ticket then the ticket will not show.
The capability set on a ticket is the minimum capability required to access the ticket, one thing to remember is S2 ‘Stacks’ capabilities, for example a level 2 role has most of the capabilities the level 1 member has meaning they would see both. You will need to use a unique capability from each level on each of the ticket to do what you need. |
|
|
Thanks for the response. I have put that to use. Now, how can I display only a specific ticket type such as Dealsite ticket only for each event. It does not matter if I use the ticket selector to do this or not. I just need to show the Event Title, Date, Ticket Name, Ticket Price, Event Description. |
I’m not sure I understand, can you provide an example? |
|
|
In example, I need to distinguish and separately display 3 pricing models for tickets for a single event using Event Espresso. Event A – Travel Tour For Dealsite 1 display only: For Dealsite 2 display only: For Standard non-member display only: Viewing as Administrator: |
|
Also, I am looking for a way to blank out the email address for a registered user so they always have to type it. I am using a dealsite user for all dealsite 1 registrations pricing model 1 and dealsite 2 for all dealsite pricing model 2, pricing model 3 is non-registered. |
To remove the tickets that don’t have caps set to them for logged in users you can use this function: https://gist.github.com/Pebblo/16a7dabb6a6d8f0f3d4370ccda06098b To remove the tickets that user don’t actually have access to you can use this function: https://gist.github.com/Pebblo/106393acd850cb83c3798c66a9c5a19a For the email question take a look at how the However based on the above each time a user updates the details on the registration form it will update the details on the user account when using the add-on, there is an option to disable that but then those registrations made with the details that don’t match the account details will not show up in the My Events Section. |
|
|
Hello. I tried this on my local test and it (https://gist.github.com/Pebblo/16a7dabb6a6d8f0f3d4370ccda06098b)did not work for me when I inserted in the functions.php. |
|
Here is the code that I tried inserting into EE_WP_Users_Ticket_Selector.module. It did the job of hiding the code when user “groupon” was used. However, for some reason I cannot get my payment gateway to return back a response after the correct amount (72.95 plus taxes) shows in the payment gateway. The customer is getting charged but the customer returns to the registration checkout page being blank. //****************** code start ****************** public static function set_hooks() { } public static function set_hooks_admin() {} /** /* } //still here? //check for dealsite user and hide standard tickets return $full_html_content; } //end class EED_WP_Users_Ticket_Selector |
|
The code above was used when I could not get the GIST snippet of code to work. I used the standard WP_Users_Ticket_Selector.module.php file when I tried it. I renamed my custom change that I made above and gave it the extension .TXT, when I was testing your GIST snippet with the original WP_Users_Ticket_Selector.module.php. |
Hi there, Please do not directly alter EE’s core or add-on files. That will lead to breakage. The code that Tony shared with you in that Gist will work, but it’s possible that your functions.php file from your theme is loading too late for that code to execute when the hook fires. Instead, you can add the code snippet into a little plugin by following this guide: |
|
|
I added the PHP as a plugin. Testing and enabling DEBUG. |
The first function I gave you checks for a I’ve added another function to the gist which hides any tickets that don’t have a capability set and the user is logged in but doesn’t have the manage_options capability. Try the function within functions2.php of that gist. |
|
|
Thanks very much Tony. This works. I used the first function. |
The support post ‘Display only the ticket type that matches the user role for ticket selector’ 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.