Jump to content


JReviews is the best selling Joomla Reviews Component and WordPress Reviews Plugin. It's also in a class of its own as a Business Directory.
Photo
- - - - -

Need to be in the mood way with Business Hours (multiview, schedule, status)


  • Please log in to reply
8 replies to this topic

#1 Tony B.

Tony B.

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationFrance

Posted 14 July 2017 - 09:38 AM

Hi Everybody,

 

businesshours.thtml works

 

I read these topics in tips&tricks:

 

https://forum.jrevie...=business hours

 

https://forum.jrevie...=business hours

 

My questions are about these .thtml files:

 

business_hours_multiview.thtml

business_hours_schedule.thtml

business_hours_status.thtml

 

I got it concerning this:

 

2017-03-06_07-58-41.png

 

 

But :

 

when I set with business_hours_multiview, Same result with business_hours

 

when I set with business_hours_schedule, I got only the field name title without any content

 

when I set with business_hours_status, all the field (title + content) disappears.

 

 

 

So I need your help for understanding the aim of these .thtml files.

 

 

Does it possible to get something close like my 2 pictures in attach files?

 

 

 

Thank you in advance for your advice

 

Attached Files



#2 Tony B.

Tony B.

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationFrance

Posted 14 July 2017 - 10:50 AM

Ok I understand something :D

 

"business_hours_multiview.thtml" is linked with "business_hours_schedule.thtml" and "business_hours_status.thtml"

 

I enabled list view and multiview appears

 

How can I get the same stuff in detail.thtml ?



#3 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 14 July 2017 - 04:22 PM

You can see at the bottom of the multiview theme the following conditional:

if ($this->name == 'com_content')
{
	echo $this->renderControllerView('fields_phpformat', 'business_hours_schedule', compact('OpeningHours','days','daysArray','openNowLabel','closedNowLabel','closedLabel'));
}
else {
	echo $this->renderControllerView('fields_phpformat', 'business_hours_status', compact('OpeningHours','days','daysArray','openNowLabel','closedNowLabel','closedLabel'));
}

So in detail pages it runs the if part of the condition and on list pages it runs the else  part of the condition. If you want to show the list page output in all pages, then you could copy the file to overrides and use a different suffix, like businesshours_compact.thtml and remove the if statement and leave only this part:

 

echo $this->renderControllerView('fields_phpformat', 'business_hours_status', compact('OpeningHours','days','daysArray','openNowLabel','closedNowLabel','closedLabel'));

And remember to clear the registry and change the name of the theme name in the field setting.



#4 Tony B.

Tony B.

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationFrance

Posted 15 July 2017 - 02:23 AM

Thank you so much Alejandro for your explanations.

 

It works.  ;)



#5 sunnyjey

sunnyjey

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts

Posted 14 August 2017 - 06:40 AM

You can see at the bottom of the multiview theme the following conditional:

if ($this->name == 'com_content')
{
	echo $this->renderControllerView('fields_phpformat', 'business_hours_schedule', compact('OpeningHours','days','daysArray','openNowLabel','closedNowLabel','closedLabel'));
}
else {
	echo $this->renderControllerView('fields_phpformat', 'business_hours_status', compact('OpeningHours','days','daysArray','openNowLabel','closedNowLabel','closedLabel'));
}

So in detail pages it runs the if part of the condition and on list pages it runs the else  part of the condition. If you want to show the list page output in all pages, then you could copy the file to overrides and use a different suffix, like businesshours_compact.thtml and remove the if statement and leave only this part:

 

echo $this->renderControllerView('fields_phpformat', 'business_hours_status', compact('OpeningHours','days','daysArray','openNowLabel','closedNowLabel','closedLabel'));

And remember to clear the registry and change the name of the theme name in the field setting.

 

1. I have gone through documentation and related forum thread of Form Builder Field.

 

2. Tried various combination offered by different Users in forum, but it looks most of them are outdated due to introduction of newer version.

 

Is there any way to show 'Status Indicator' (Open / Closed) without Working Timings in 

 

1. List

 

2. Detail Header 

 

Tried this, but it is not working. 

<?php echo $this->renderControllerView('fields_phpformat','business_hours_indicator');?>
<?php echo $this->renderControllerView('fields_phpformat', 'business_hours_status', compact('openNowLabel','closedNowLabel','closedLabel'));
}

PS: I noticed TYPO error for Working Hours Zone : Asia/Dili . It should be Asia/Delhi for India. 



#6 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 14 August 2017 - 10:08 AM

Dili is an actual place and you can find the list of supported timezones in PHP. The last reply in this post was from July so nothing has changed since then and the solution given to the other user should work. You can't use the code given directly in the detail theme file, these code changes are meant to be done directly in the multiview file. If you want to separate the output in detail pages into the working hours and the status to be placed in different parts of the page, then that would require other changes that are not straightforward.



#7 sunnyjey

sunnyjey

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts

Posted 14 August 2017 - 11:49 AM

 

 

Dili is an actual place and you can find the list of supported timezones in PHP. 

 

Apologies. You are right. 

 

 

 

If you want to separate the output in detail pages into the working hours and the status to be placed in different parts of the page, then that would require other changes that are not straightforward.

 

Got it. Thank you.

 

One last question.

 

Is there any way, where we can filter out all entries which are OPEN (openNowLabel) at the moment through advanced search Module or any tagging & display the result in Custom LIST ?



#8 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 14 August 2017 - 12:04 PM

There is no way to do that because a lot of calculations are done in real time to figure this out and there's no way to manage it through a database query. 



#9 sunnyjey

sunnyjey

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts

Posted 14 August 2017 - 12:08 PM

Got it. Thanks for the prompt reply.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users