Posted: May 19, 2020 at 7:09 am
hi, i found this topic and i need to do the opposite. my ticket prices are showing in the order as entered and we’d prefer them to always sort by price, with the most expensive first). how can i modify this to work? i’m on ee3 (Version 3.1.37.17.P) |
|
i’m also trying to get this to work. |
|
Hi there, The thread you linked to changes the price list function, but you linked directly to an event, that output doesn’t use a price list it uses a dropdown and therefor uses a different function. So, may I ask is it the price dropdown function you are looking to change? If so, are you using the ‘Event Espresso – Members Addon’ on the site? (Meaning you can set prices for logged out users and prices for logged in members)
Ok, but we’ll need more details on what you are stuck on with the above. The code is still available on that site and Josh’s fix still applies. |
|
it’s the order in my dropdown on the event registration page that i would like to have automatically sort from most expensive to least. right now they sort by order input. i am not using that plugin. |
|
Ok, so for that you need to copy the
Line 396 – 453 (everything within the Add that to your custom functions plugin mentioned in the previous thread and then change:
to be:
Inside your custom function. That will sort the event prices in the dropdown by event cost highest -> lowest. |
|
ok! awesome! that’s working! as for the hiding sold out events? |
|
You haven’t given any more details, so my answer is currently the same as above:
Have you added the code to your site and added Josh’s fix? Note that thread hides sold-out events from the Table View Template add-on so I assume you are viewing that output? |
|
wait!? why does the exact same plugin not work on my live site, but it works on my staging site? https://www.suzanenorthrop.com/upcoming-events/?ee=42 they are literally the same code? |
|
i’ve cleared and deactivated my cache for the live site, but it’s still not seeing my custom plugin. |
|
to be clear, the plugin is active, but new sort isn’t sorting. |
|
Sometimes load order matters with WordPress. Deactivate Event Espresso and the custom functions plugin. Then reactivate (in this order) the custom functions plugin then Event Espresso. Or, if you prefer not to do that, create a
Then place the function within that file (remember to add an opening (You’ll need to remove the function from the custom functions plugin to use the above) One issue with the above method is some ‘security’ plugins simply remove |
|
ok. the custom function in /uploads/espresso seemed to do it. weird. i am not using any addons, but was trying to hide the sold out ones from event_list.php for this type of list |
|
Ok, so that’s completely different to the thread you linked to above. That’s using Copy
Edit
Just after that add:
That should remove sold-out events from the lists. Note that the above increases the number of queries per event. |
|
well, no wonder it didn’t work when i tried. lol. this worked like perfection. thank you 🙂 |
|
The support post ‘event list price order’ 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.