Posted: March 25, 2021 at 9:39 am
I’ve searched the forum and the only topic I found about this was: I gather from Tony’s response that we should be able to add another input field to the ticket pricing that we can use to indicate the regular price. I’m not sure how to do that but I will see if I can figure that out. We will also need to display the “regular” price on the purchase form somehow. I’ve added other filters to custom plugins to modify how the pricing is displayed but this would be adding another column to each ticket type row. How would I go about doing that? Thanks |
|
Can I get some guidance on how to best implement the pieces needed to accomplish this? Thanks |
|
Hi there,
You can add another input to the ticket editor and set a value in that which can be saved via extra_meta and then called if you have the ticket object. It’s not as straight forward and just sticking an input on the page though. The only example we have of adding additional inputs there is the within the WP User integration add-on which is what I linked to in that thread. This is how the above add-on calls the form to add the additional input: The This method: https://github.com/eventespresso/eea-wpuser-integration/blob/master/EED_WP_Users_Admin.module.php#L1070 Confirms the form was submitted and then save/updates extra_meta with the value set. That’s the relatively easy part done.
This is what I would consider the more difficult part, the ticket selector can’t be easily modified to output additional details (it’s currently intentional as there is a LOT of logic involved with the ticket selector so giving easy access on what it output eventually causes more harm than good). There is a filter that allows you to modify the entire row returned:
However, if using that you’ll basically need to reproduce everything that the ticket selector class is already doing on your own and output the additional details in the price column. Another option would be to output the additional pricing to the DOM somewhere on the single event page and use jQuery to insert those values into the ticket selector price column. That leaves the TS selector logic along and allows you to modify the details as you see fit but depends on how comfortable you are with jQuery. |
|
The support post ‘Sale Pricing with strikethrough of regular price’ 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.