I searched and could not find and answer to this question on the forums yet.
We want to display a “strikethrough price” that is the “original” price and at the same time display and sell a ticket with the sale price.
Is there a best-practice for this using EE?
I thought of storing the original price somewhere hidden in the ticket like you can with Event Meta but I don’t think there is a Ticket Meta.
The best I could come up with was to create a force sold-out ticket (0 quantity) and use some CSS and JS to do the re-formatting of the ticket selector – remove the Sold Out wording and change the price to a strikethrough.
I am not that happy about this solution as it seems kind of weird.
// added this to CSS: tr.ticket-sales-sold-out > td:nth-child(3) {display: none;}
// get the price
var total = document.querySelector('tr.ticket-sales-sold-out > td:nth-child(2)').textContent.match(/[\d]+\.[\d]+/g);
// do a srikethrough on the price
document.querySelector('tr.ticket-sales-sold-out > td:nth-child(2)').innerHTML = '<span class="alignleft"> $<s>'+total+'</s></span>';
Note that querying based on extra_meta is inefficient and not straightforward, but pretty much any entity within EE can have extra_meta attached to it.
So there’s nothing stopping you from saving extra_meta for a ticket, if you have an EE_Ticket object within $ticket you can do something like:
Outputting that price on the ticket selector isn’t going to be straightforward depending on where you want to output the price.
May I ask what output you are looking for?
Viewing 1 reply thread
The support post ‘Slash-pricing Sale-pricing with strikethrough best practice?’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.