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
- - - - -

business_hours, fields_phpformat, german


  • Please log in to reply
10 replies to this topic

#1 n00bster

n00bster

    Advanced Member

  • Members
  • PipPipPip
  • 300 posts
  • LocationAustria

Posted 01 July 2016 - 01:37 AM

replace the code from line 2 do 13 in the "business_hours.thtml" file to show the weekdays and times in german in the frontend.

$daysArray = array(1 => 'Montag', 2 => 'Dienstag', 3 => 'Mittwoch', 4 => 'Donnerstag', 5 => 'Freitag', 6 => 'Samstag', 7 => 'Sonntag');

$hoursArray = array(
   "0.0" => "24:00", "0.5" => "12:30", "1.0" => "1:00", "1.5" => "1:30", "2.0" => "2:00", "2.5" => "2:30",
   "3.0" => "3:00", "3.5" => "3:30", "4.0" => "4:00", "4.5" => "4:30", "5.0" => "5:00", "5.5" => "5:30",
   "6.0" => "6:00", "6.5" => "6:30", "7.0" => "7:00", "7.5" => "7:30", "8.0" => "8:00", "8.5" => "8:30",
   "9.0" => "9:00", "9.5" => "9:30", "10.0" => "10:00", "10.5" => "10:30", "11.0" => "11:00", "11.5" => "11:30",
   "12.0" => "12:00", "12.5" => "12:30", "13.0" => "13:00", "13.5" => "13:30", "14.0" => "14:00", "14.5" => "14:30",
   "15.0" => "15:00", "15.5" => "15:30", "16.0" => "4:00", "16.5" => "4:30", "17.0" => "17:00", "17.5" => "17:30",
   "18.0" => "18:00", "18.5" => "18:30", "19.0" => "19:00", "19.5" => "19:30", "20.0" => "20:00", "20.5" => "20:30",
   "21.0" => "21:00", "21.5" => "21:30", "22.0" => "22:00", "22.5" => "22:30", "23.0" => "23:00", "23.5" => "23:30"
);

  • warenbewertung.de and belltree like this

[PHP 7.0] [Joomla 3.8] [Easysocial 2.1] [jReviews 2.7]


#2 warenbewertung.de

warenbewertung.de

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 10 July 2016 - 05:04 PM

THX2U...

 

Greets

thomas



#3 StefanP

StefanP

    Member

  • Members
  • PipPip
  • 14 posts
  • LocationGermany

Posted 13 July 2016 - 03:11 AM

{
    "title": "Zeiten",
    "type": "array",
    "format": "table",
    "items": {
        "title": "Öffnungszeit",
        "type": "object",
        "properties": {
            "day": {
                "title": "Tag",
                "type": "string",
                "$ref": "#\/definitions\/weekeday",
                "options": {
                    "input_width": "15em"
                }
            },
            "hours-start": {
                "title": "Von",
                "type": "string",
                "$ref": "#\/definitions\/hours",
                "options": {
                    "input_width": "15em"
                }
            },
            "hours-end": {
                "title": "Bis",
                "type": "string",
                "$ref": "#\/definitions\/hours",
                "options": {
                    "input_width": "15em"
                }
            }
        }
    },
    "definitions": {
        "weekeday": {
            "type": "string",
            "enumSource": [
                {
                    "source": [
                        {
                            "value": "1",
                            "title": "Montag"
                        },
                        {
                            "value": "2",
                            "title": "Dienstag"
                        },
                        {
                            "value": "3",
                            "title": "Mittwoch"
                        },
                        {
                            "value": "4",
                            "title": "Donnerstag"
                        },
                        {
                            "value": "5",
                            "title": "Freitag"
                        },
                        {
                            "value": "6",
                            "title": "Samstag"
                        },
                        {
                            "value": "7",
                            "title": "Sonntag"
                        }
                    ],
                    "title": "{{item.title}}",
                    "value": "{{item.value}}"
                }
            ]
        },
        "hours": {
            "type": "string",
            "enumSource": [
                {
                    "source": [
                        {
                            "value": "0.0",
                            "title": "0:00 Uhr"
                        },
                        {
                            "value": "0.5",
                            "title": "0:30 Uhr"
                        },
                        {
                            "value": "1.0",
                            "title": "1:00 Uhr"
                        },
                        {
                            "value": "1.5",
                            "title": "1:30 Uhr"
                        },
                        {
                            "value": "2.0",
                            "title": "2:00 Uhr"
                        },
                        {
                            "value": "2.5",
                            "title": "2:30 Uhr"
                        },
                        {
                            "value": "3.0",
                            "title": "3:00 Uhr"
                        },
                        {
                            "value": "3.5",
                            "title": "3:30 Uhr"
                        },
                        {
                            "value": "4.0",
                            "title": "4:00 Uhr"
                        },
                        {
                            "value": "4.5",
                            "title": "4:30 Uhr"
                        },
                        {
                            "value": "5.0",
                            "title": "5:00 Uhr"
                        },
                        {
                            "value": "5.5",
                            "title": "5:30 Uhr"
                        },
                        {
                            "value": "6.0",
                            "title": "6:00 Uhr"
                        },
                        {
                            "value": "6.5",
                            "title": "6:30 Uhr"
                        },
                        {
                            "value": "7.0",
                            "title": "7:00 Uhr"
                        },
                        {
                            "value": "7.5",
                            "title": "7:30 Uhr"
                        },
                        {
                            "value": "8.0",
                            "title": "8:00 Uhr"
                        },
                        {
                            "value": "8.5",
                            "title": "8:30 Uhr"
                        },
                        {
                            "value": "9.0",
                            "title": "9:00 Uhr"
                        },
                        {
                            "value": "9.5",
                            "title": "9:30 Uhr"
                        },
                        {
                            "value": "10.0",
                            "title": "10:00 Uhr"
                        },
                        {
                            "value": "10.5",
                            "title": "10:30 Uhr"
                        },
                        {
                            "value": "11.0",
                            "title": "11:00 Uhr"
                        },
                        {
                            "value": "11.5",
                            "title": "11:30 Uhr"
                        },
                        {
                            "value": "12.0",
                            "title": "13:00 Uhr"
                        },
                        {
                            "value": "12.5",
                            "title": "12:30 Uhr"
                        },
                        {
                            "value": "13.0",
                            "title": "13:00 Uhr"
                        },
                        {
                            "value": "13.5",
                            "title": "13:30 Uhr"
                        },
                        {
                            "value": "14.0",
                            "title": "14:00 Uhr"
                        },
                        {
                            "value": "14.5",
                            "title": "14:30 Uhr"
                        },
                        {
                            "value": "15.0",
                            "title": "15:00 Uhr"
                        },
                        {
                            "value": "15.5",
                            "title": "15:30 Uhr"
                        },
                        {
                            "value": "16.0",
                            "title": "16:00 Uhr"
                        },
                        {
                            "value": "16.5",
                            "title": "16:30 Uhr"
                        },
                        {
                            "value": "17.0",
                            "title": "17:00 Uhr"
                        },
                        {
                            "value": "17.5",
                            "title": "17:30 Uhr"
                        },
                        {
                            "value": "18.0",
                            "title": "18:00 Uhr"
                        },
                        {
                            "value": "18.5",
                            "title": "18:30 Uhr"
                        },
                        {
                            "value": "19.0",
                            "title": "19:00 Uhr"
                        },
                        {
                            "value": "19.5",
                            "title": "19:30 Uhr"
                        },
                        {
                            "value": "20.0",
                            "title": "20:00 Uhr"
                        },
                        {
                            "value": "20.5",
                            "title": "20:30 Uhr"
                        },
                        {
                            "value": "21.0",
                            "title": "21:00 Uhr"
                        },
                        {
                            "value": "21.5",
                            "title": "21:30 Uhr"
                        },
                        {
                            "value": "22.0",
                            "title": "22:00 Uhr"
                        },
                        {
                            "value": "22.5",
                            "title": "22:30 Uhr"
                        },
                        {
                            "value": "23.0",
                            "title": "23:00 Uhr"
                        },
                        {
                            "value": "23.5",
                            "title": "23:30 Uhr"
                        }
                    ],
                    "title": "{{item.title}}",
                    "value": "{{item.value}}"
                }
            ]
        }
    }
}

Edited by StefanP, 13 July 2016 - 03:34 AM.

  • warenbewertung.de and Daniel.de like this

#4 warenbewertung.de

warenbewertung.de

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 28 July 2016 - 05:21 PM

Now I'm update to new Formbuilder and everthing is gone... ONNCE MORE!

 

I can set MEZ and all translation are gone....

 

Any idea??

 

Greets

Thomas



#5 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 29 July 2016 - 08:48 AM

The best and the only way to avoid overwrites is to use overrides! Copy the theme file to your overrides theme. If you haven't created overrides yet, check the overrides documentation.



#6 warenbewertung.de

warenbewertung.de

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 29 July 2016 - 03:43 PM

The best and the only way to avoid overwrites is to use overrides! Copy the theme file to your overrides theme. If you haven't created overrides yet, check the overrides documentation.

thx



#7 warenbewertung.de

warenbewertung.de

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 31 July 2016 - 10:36 AM

Sorry I did not understand the system....

 

Just changed the code ... days hours... but the result is...look at pics..pls.

 

Kindly told me which files need to be changed to get to run on both sides...

 

so i cn work on it and maybe can do it to here...

 

cya thomas

Attached Files



#8 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 31 July 2016 - 06:23 PM

The input and output use different files so the changes you make to the form schema will not be automatically reflected in the output. You would need to customize the output theme file located here:

/components/com_jreviews/jreviews/views/themes/default/fields_phpformat/business_hours.thtml

If you use overrides you would place that in your custom theme (lets say it's called "mytheme") here:

/templates/jreviews_overrides/views/themes/mytheme/fields_phpformat/business_hours.thtml

And you can also name the theme file anything you want and just update your field with the theme file name.

 

We've made it easy to change the format of the file from 12 to 24 hours by adding a variable at the top which you can change from false to true:

$twentyfourHourFormat = false;

However, that won't add the "hour" string next to the time. For that, you would need to make additional changes in a different file because we abstracted all the code to a helper to simplify the theme file. That file is here:

/components/com_jreviews/jreviews/views/helpers/opening_hours.php
And there you can make any customizations you want. If you don't have experience with php, I think the 24 hour format as we have it is easy to understand and I am not sure adding the hour string is really necessary, but you have access to the file if you want to play with it.


#9 warenbewertung.de

warenbewertung.de

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 August 2016 - 02:21 AM

OK...THX2U Alejandro...for your effort..

 

You explain very...well... great support...

 

Thx..

 

thomas



#10 ededi

ededi

    Advanced Member

  • Members
  • PipPipPip
  • 115 posts

Posted 24 July 2017 - 07:36 AM

times 24 hours not showing and also i will remove for users change time format

 

i made changes to her ;

/components/com_jreviews/jreviews/views/themes/default/fields_phpformat/business_hours.thtml

and copied to override

/templates/jreviews_overrides/views/themes/mytheme/fields_phpformat/business_hours.thtml

Days are ok but time setting 24hours i changed from false to true but its same ¨am pm¨

 

i also after no luck this change added this code ( full added, i only copied firs words here) to .html :

$hoursArray = array( ................

Edited by ededi, 24 July 2017 - 07:39 AM.


#11 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 24 July 2017 - 08:20 AM

The PHP change for the time format only affects the output of the field, not the form.


  • ededi likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users