I’m developing a site for a shopping centre in which each shop has separate opening hours. They appear on a list, and on that list I want to show the opening hours for that specific day. This is currently set up in the backend with two sets of Matricies, one for normal hours, the other for specific days (mostly for over xmas when they have random hours), set up like thus;
{opening_hours}
{day} (text field)
{hours} (text field)
{/opening_hours}
{specific_opening_hours}
{day} (date field)
{hours} (text field)
{/specific_opening_hours}
The code I have used is
{specific_opening_hours}
{if "{day format='%Y%m%d'}" == "{current_time format='%Y%m%d'}" }
{if hours=="Closed"}
{hours}
{if:else}
{hours}
{/if}
{if:elseif "{day format='%Y%m%d'}" != "{current_time format='%Y%m%d'}" }
{opening_hours}
{if "{current_time format='%l'}" == "{day format='%l'}"}{hours}{/if}
{/opening_hours}
{/if}
{/specific_opening_hours}You can see what is should look like, and also how the above code renders.
Basically, unless a specific opening hours is that specific day, it should display the regular opening hours. Both work independently, but as shown here, is displays BOTH the specific and daily hours, not either / or. Where is the flaw in my logic?
Many thanks