Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Offset Event Start for Ticket Sales
ktb1025



Joined: 17 Nov 2004
Posts: 953
Location: Pembroke Pines, Fl.

Posted: 11/26/12 09:19 
I gets a little crazy day of show with people buying tickets online. I usually prepare names for will call 3-4 hours before the event, but inevitably, people buy tickets up to the last minute. I'd like to offset by xx-hours from the event time, when people can no longer buy tickets online.

I noticed in ../skins/Cobalt3/jr_ranking_row.tpl the following code


Code
{* if we have an event we are offering tickets for, we don't want to show the "purchase" button if the event time has already passed *}
            {elseif $VAULT_UNIQUE == 'yes' && $EVENT_TIME < $CURRENT_TIME}
              <input type="button" value="unavailable online" class="jform button" disabled="disabled">


I probably need to create a custom form field called $EVENT_TICKET_CUTOFF_TIME then apply it somehow to the above statement. If I create a custom form field, I could then apply different offset times for different events when creating the event, but I'm not sure if it would offset the time by anything measureable i.e. minutes, seconds, hours. It might be as simple as replacing $CURRENT_TIME with $EVENT_TICKET_CUTOFF_TIME

And I'll also need to modify ../themes/Cobalt3/calendar_list.tpl which has similar code.

Anybody know the best practice method for creating an offset for the end of advance ticket sales as stated above?


_________________
Kevin Burns
TheTalentFarm.com
LIVE WEBCAST VENUE
Home of TTF-TV!!!

Last edited by ktb1025 on 11/27/12 15:33; edited 2 times in total
Back to top
ktb1025



Joined: 17 Nov 2004
Posts: 953
Location: Pembroke Pines, Fl.

Posted: 11/26/12 13:25 
I created a custom field in EVENTS called $EVENT_TICKET_CUTOFF_TIME but it doesn't seem to work as I thought it would. Tickets are still available right up until the event time, even though I changed the original field $CURRENT_TIME to $EVENT_TICKET_CUTOFF_TIME.

Should be straightforward, but then again... It's Monday.


Code
{* if we have an event we are offering tickets for, we don't want to show the "purchase" button if the event time has already passed *}
            {elseif $VAULT_UNIQUE == 'yes' && $EVENT_TIME < $EVENT_TICKET_CUTOFF_TIME}
              <input type="button" value="unavailable online" class="jform button" disabled="disabled">



_________________
Kevin Burns
TheTalentFarm.com
LIVE WEBCAST VENUE
Home of TTF-TV!!!
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 11/26/12 14:30 
What do you see as the values of the variables?


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
ktb1025



Joined: 17 Nov 2004
Posts: 953
Location: Pembroke Pines, Fl.

Posted: 11/26/12 15:11 

SteveX:
What do you see as the values of the variables?


Hi Steve, I'm not sure what you're asking, but these variables are populated via the event form field. The event date & time are already in the stock JR form and is a date field. My custom field $EVENT_TICKET_CUTOFF_TIME is also a date field.

When I create a new event, I'll assign the normal event time in the form as usual.
Now that I've added the new field, I assign the cutoff to be 3 hours earlier than the event.

It's so basic, I'm mystified why it doesn't work!


Code
{elseif $VAULT_UNIQUE == 'yes' && $EVENT_TIME < $CURRENT_TIME}

as opposed to...

Code
{elseif $VAULT_UNIQUE == 'yes' && $EVENT_TIME < $EVENT_TICKET_CUTOFF_TIME}


If I make the $EVENT_TICKET_CUTOFF_TIME later than the $EVENT_TIME it works... But it obviously needs to be earlier than the event time expiration.


_________________
Kevin Burns
TheTalentFarm.com
LIVE WEBCAST VENUE
Home of TTF-TV!!!
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 11/26/12 15:29 
{$EVENT_TICKET_CUTOFF_TIME} is a smarty variable, which has a value (a number in this case).

If you put {debug output="html"} into the template a pop up window opens listing all the variables and their values.

Or, you could put this into your template and see what is printed out.

Code
$EVENT_TIME = {$EVENT_TIME}<br>
$EVENT_TICKET_CUTOFF_TIME = {$EVENT_TICKET_CUTOFF_TIME}<br>


That said, I've just spotted the error, try {if $CURRENT_TIME > $EVENT_TICKET_CUTOFF_TIME} (if the current time is greater than your set time).


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
ktb1025



Joined: 17 Nov 2004
Posts: 953
Location: Pembroke Pines, Fl.

Posted: 11/26/12 16:09 
I created an event for tomorrow at 6:00pm
Cutoff time was 5:00pm today (1-hour ago)

$EVENT_TIME = 1354060800
$EVENT_TICKET_CUTOFF_TIME = 1353970800

They're both formatted similarly, which is good.

I would assume the math would be straightforward, but it doesn't work as expected. Still see the BUY NOW BUTTON.
{if}$CURRENT_TIME > $EVENT_TICKET_CUTOFF_TIME}
<input type="button" value="unavailable online" class="jform button" disabled="disabled">

If I use the reverse of "<" like you suggested it makes all my events UNAVAILABLE ONLINE.

Pretzel Logic!

Anyway, I have to go to work at my other job, so I need to sign off for now. If something pops, please let me know. I don't expect you to go out of your way any more than you already have, and I appreciate your help immensely!!! I'll come in early tomorrow and shake it up some, see what I come up with.

Thanks Steve!


_________________
Kevin Burns
TheTalentFarm.com
LIVE WEBCAST VENUE
Home of TTF-TV!!!
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 11/26/12 16:21 
You don't mention a value for $CURRENT_TIME - does that have a value in the template?


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 11/27/12 05:35 
You could try using the smarty_now variable with it...


Code
$EVENT_TICKET_CUTOFF_TIME > $smarty.now


Hope this helps,
Douglas


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
ktb1025



Joined: 17 Nov 2004
Posts: 953
Location: Pembroke Pines, Fl.

Posted: 11/27/12 10:55 
Well guys, it looks like it might be working out.

Having created a custom field in events called EVENT_TICKET_CUTOFF_TIME I am now able to select any given cutoff time for ticket sales for any event.

In jr_ranking_row.tpl I now have (somewhere around line 350)


Code
{* if we have an event we are offering tickets for, we don't want to show the "purchase" button if the event time has already passed *}
            {elseif $VAULT_UNIQUE == 'yes' && $EVENT_TICKET_CUTOFF_TIME < $smarty.now}
              <input type="button" value="DOOR TICKETS ONLY" class="jform button" disabled="disabled">


NOTE* It is very important that you fill in the EVENT_TICKET_CUTOFF_TIME field on the form, otherwise it has a value of zero which will throw off whether the cutoff time has arrived or not. I also used "<" instead of ">" as was suggested.

I'm about to put this through some more testing, but so far it seems to work exactly as anticipated, although right now it seems to be off by an hour. More testing will verify that.

Much thanks to Steve & Douglas for babysitting me through this one.

This could be a very useful tool for anyone selling tickets to events as it allows any length of time for reconciliation of sold tickets.


_________________
Kevin Burns
TheTalentFarm.com
LIVE WEBCAST VENUE
Home of TTF-TV!!!
Back to top
ktb1025



Joined: 17 Nov 2004
Posts: 953
Location: Pembroke Pines, Fl.

Posted: 11/27/12 15:39 
Oh well... I though I had it working, but it seems that another event which had a start time of 5:30pm and a ticket cutoff time of 3:30 didn't respond to the logic. So it's back to the drawing board I go... When I finally get this sorted out I'll post up.


_________________
Kevin Burns
TheTalentFarm.com
LIVE WEBCAST VENUE
Home of TTF-TV!!!
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 11/28/12 04:21 
You will be able to deal with an empty value in smarty as well, untested but it will be something like:

Code
{elseif $VAULT_UNIQUE == 'yes' && ($EVENT_TICKET_CUTOFF_TIME < $smarty.now || $EVENT_TICKET_CUTOFF_TIME == 0)}

What that is saying is "if VAULT_UNIQUE is 'yes' AND EITHER EVENT_TICKET_CUTOFF_TIME has passed OR EVENT_TICKET_CUTOFF_TIME is '0'

Note that as this is an "elseif", it will be ignored if all the conditions of the preceeding "if" are matched. You can probably do it all in one "if" something like this (also untested):

Code
{if $EVENT_VAULT_ID > 0 && $VAULT_UNIQUE == 'yes' && $EVENT_TIME > $smarty.now && ($EVENT_TICKET_CUTOFF_TIME < $smarty.now || $EVENT_TICKET_CUTOFF_TIME == 0)}
... get your tickets here ...
{elseif $EVENT_VAULT_ID > 0 && $VAULT_UNIQUE == 'yes' && $EVENT_TIME < $smarty.now && $EVENT_TICKET_CUTOFF_TIME > $smarty.now}
... get your tickets on the door ...
{/if}


Your one hour difference is possibly due to your server time not taking time saving into account or something like that. If there is a Jamroom variable available in the template to use rather than $smarty.now it might get you around that problem.


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.