Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware
Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Smarty: Tel.-Anzeige nur am/um Wochentag/Uhrzeit

    h-h-h

    • modified Team
    • Beiträge: 4.562
    Smarty: Tel.-Anzeige nur am/um Wochentag/Uhrzeit
    am: 10. Oktober 2010, 15:47:24
    Hi,
    habe was kleines mit Smarty erstellt und möchte es Euch nicht vorenthalten.

    Hiermit kann man im Shop anzeigen lassen, dass das Ladengeschäft geöffnet ist oder die Telefonnummer.
    Wenn zum Beispiel das Ladengeschäft geöffnet hat oder man erreichbar sein möchte.
    Es werden Feiertage beachtet und Öffnungszeiten.

    Einfach im Template an der gewünschten Stelle einfügen und anpassen.

    Code: PHP  [Auswählen]
    {assign var=today value=$smarty.now|date_format:"%d.%m"}
    {assign var=thetime value=$smarty.now|date_format:"%H%M"}
    {assign var=weekday value=$smarty.now|date_format:"%w"}
    {assign var=year value=$smarty.now|date_format:"%y"}

    {* Tage an denen geschlossen ist: 01.01, 01.05, 03.10, 25.12, 26.12(NI) Statische Feiertage *}
    {if $today neq "01.01" and $today neq "01.05" and $today neq "03.10" and $today neq "25.12" and $today neq "26.12" }
    {* Osterfeiertage an denen geschlossen ist, vom Jahr abhängig *}
    {* 2010: 02.04, 05.04, 13.05, 24.05 - 2011: 22.04, 25.04, 02.06, 13.06 - 2012: 06.04, 09.04, 17.05, 28.05 *}
    {if $year gt "10" and $today neq "02.04" and $today neq "05.04" and $today neq "13.05" and $today neq "24.05" }
    {elseif $year gt "11" and $today neq "22.04" and $today neq "25.04" and $today neq "02.06" and $today neq "13.06" }
    {elseif $year gt "12" and $today neq "06.04" and $today neq "09.04" and $today neq "17.05" and $today neq "28.05" }
    {else}
    {* Öffnungszeiten: Mo-Fr von 10.00Uhr bis um 13.15 Uhr und 15.10 bis 18.00 Uhr *}
    {if $weekday gt "0" and $weekday lt "6" and ( ( $thetime gt "1000" and $thetime lt "1315" ) or ( $thetime gt "1510" and $thetime lt "1800" ) ) }
    Geschäftstelefonnummer oder unser Laden-Geschäft ist geöffnet
    {/if}
    {* Am Samstag von 10.00Uhr bis um 14.00 Uhr *}
    {if $weekday eq "6" and $thetime gt "1000" and $thetime lt "1400"}
    Geschäftstelefonnummer oder unser Laden-Geschäft ist geöffnet
    {/if}
    {/if}
    {/if}
    Viel Spaß damit!

    h-h-h



    Linkback: https://www.modified-shop.org/forum/index.php?topic=8620.0

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.369
    • Geschlecht:
    Smarty: Tel.-Anzeige nur am/um Wochentag/Uhrzeit
    Antwort #1 am: 10. Oktober 2010, 19:49:07
    Prima Tipp, danke für deine Lösung!

    Grüße

    Torsten

    2 Antworten
    3193 Aufrufe
    23. Oktober 2013, 19:34:34 von einfach112
    4 Antworten
    1727 Aufrufe
    24. Oktober 2018, 22:31:47 von hpzeller