• Support
  • Adding the opening time to header partial

Hi,
I want to add the opening times to partial header. Where can I find the route/controller to add this component.

Thanks a lot in Advance!

    My Question is how I can add opening hours component to header template ?

    Thx

      $location is available as a variable in the header on pages using the local layout… its an instance of Igniter\Local\Classes\Location

      So you can use $location->openTime()

        3 years later

        You can add following code into the header Partials.

        @php
        $openingTime = make_carbon($locationCurrentSchedule->getOpenTime());
        @endphp
        <div class=“no-spacing”>
        @if ($locationCurrentSchedule->isOpen())
        @lang(‘igniter.local::default.text_is_opened’)
        @elseif ($locationCurrentSchedule->isOpening())
        {!! sprintf(lang(‘igniter.local::default.text_opening_time’), $openingTime->isoFormat($openingTimeFormat)) !!}
        @else
        @lang(‘igniter.local::default.text_closed’)
        @endif
        </div>