Hey, friends! My employer (Florida Studio Theatre) sells a lot of subscriptions. We need to be able to send out order confirmations that hide the dates & times of performances far in the future when necessary. We have systems that respect that for TNEW and current order confirmations, but we are trying to re-engineer this using HTML Templates.
I don't really have Razor skills, so I am looking for structures to copy. Using the recipe book's "SHOW DYNAMIC PRODUCT CONTENT" methods, I can display the Content Value that tells TNEW to hide date/time for a particular Performance or Performance Season. I have not been able to use the existence of that value to control whether or not to show "@performance.PerformanceDateTime" and I feel like it should be easy/obvious. Does anyone have advice? We could hire (as a contractor) someone with mad skills; I guarantee there will be more things to convert in the next year.
Hi Clarke,
Instead of displaying the content value, you can use that content value in an IF statement, and then use that IF statement to display the performance date or not. So it would look something like:
IF (performance has content value){ display just performance title}
ELSE{display performance title and performance date}
Does that help?
That is what I am trying to do, but everything seems to break something else. I will try again.
My Razor skills are pretty non-existent; I bought a book and am trying to make myself competent.
I finally gave birth to something that worked. Thanks, Sara Hoffman; your call for simplicity was eventually what was needed.
I used the code in the recipe book's "SHOW DYNAMIC PRODUCT CONTENT" to test for existence of the Web Content field, and set a true/false variable called hasWebContent to make that information accessible from anywhere in the template. Then I put the if/else test within the table (see below). I was not certain how to output an empty response. Also, as I write this I realize that, if there is ever an order that contains both hidden and revealed dates, they will all be hidden. Oh well.
Do you have some kind of loop to go through and display each performance? Could you reset the "hasWebContent" variable at the start of each performance loop?
Hi Clarke-
We are about to go on sale selling subscriptions for which we do not want to display the date/time in the tnew order confirmation emails. Is your solution something you would be willing to share with me?
Many thanks!
Matt Singleton
Cincinnati Opera
Matt -
I am sorry that this is 2 weeks old! I do not mind sharing, but I feel like this is a very clunky solution, and hope to make it more elegant as I learn more. Email me?
Clarke
cweigle[at]floridastudiotheatre.org