Templateshop - Eine große Auswahl an neuen und 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: tawk.to LiveChat einbauen

    Frank71

    • Frisch an Board
    • Beiträge: 54
    tawk.to LiveChat einbauen
    am: 16. April 2023, 17:49:31
    Hallo Zusammen,

    ich versuche mich gerade beim Einbau eines einfachen Scriptes.

    Dauert nur 30sec haben sie gesagt. :’-(

    Ich hab die aktuelle Shop Version und das Template "tpl_modified_responsive_8".

    Eingebaut werden soll folgendes Script.

    Code: PHP  [Auswählen]
    <!--Start of Tawk.to Script-->
    <script type="text/javascript">
    var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
    (function(){
    var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
    s1.async=true;
    s1.src='https://embed.tawk.to/yxcxyxcxyxcv/1fdgfdgdg';
    s1.charset='UTF-8';
    s1.setAttribute('crossorigin','*');
    s0.parentNode.insertBefore(s1,s0);
    })();
    </script>
    <!--End of Tawk.to Script-->

    Ich habe es schon versucht in der

    /templates/DEIN_TEMPLATE/javascript/general_bottom_js.php

    Code: PHP  [Auswählen]
    <?php
    /*-----------------------------------------------------------
       $Id: general_bottom.js.php 13771 2021-10-15 13:35:43Z GTB $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
      -----------------------------------------------------------
       based on: (c) 2003 - 2006 XT-Commerce (general.js.php)
      -----------------------------------------------------------
       Released under the GNU General Public License
      -----------------------------------------------------------*/

       
      // this javascriptfile get includes at the BOTTOM of every template page in shop
      // you can add your template specific js scripts here
      defined('DIR_TMPL_JS') OR define('DIR_TMPL_JS', DIR_TMPL.'javascript/');
    ?>

    <!--Start of Tawk.to Script-->
    <script type="text/javascript">
    var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
    (function(){
    var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
    s1.async=true;
    s1.src='https://embed.tawk.to/hierstehteincode/1gu0sjlt4';
    s1.charset='UTF-8';
    s1.setAttribute('crossorigin','*');
    s0.parentNode.insertBefore(s1,s0);
    })();
    </script>
    <!--End of Tawk.to Script-->

    <script src="<?php echo DIR_WS_BASE.DIR_TMPL_JS; ?>jquery.min.js"></script>

    <?php
    $script_array = array(
      DIR_TMPL_JS.'jquery.mmenulight.js',
      DIR_TMPL_JS.'jquery.scroll-entrance.js',
      DIR_TMPL_JS.'jquery.headroom.min.js',
      DIR_TMPL_JS.'jquery.colorbox.min.js',
      DIR_TMPL_JS.'jquery.lazysizes.min.js',
      DIR_TMPL_JS.'jquery.slick.min.js',
      DIR_TMPL_JS.'jquery.viewer.min.js',
      DIR_TMPL_JS.'jquery.easyTabs.min.js',
      DIR_TMPL_JS.'jquery.alertable.min.js',
      DIR_TMPL_JS.'jquery.sumoselect.min.js',
    );
    $script_min = DIR_TMPL_JS.'tpl_plugins.min.js';
     
    $this_f_time = filemtime(DIR_FS_CATALOG.DIR_TMPL_JS.'general_bottom.js.php');
     
    if (COMPRESS_JAVASCRIPT == 'true') {
      require_once(DIR_FS_BOXES_INC.'combine_files.inc.php');
      $script_array = combine_files($script_array,$script_min,false,$this_f_time);
    }

    foreach ($script_array as $script) {
      $script .= strpos($script,$script_min) === false ? '?v=' . filemtime(DIR_FS_CATALOG.$script) : '';
      echo '<script src="'.DIR_WS_BASE.$script.'"></script>'.PHP_EOL;
    }

    ob_start();
    foreach(auto_include(DIR_FS_CATALOG.DIR_TMPL_JS.'/extra/','php') as $file) require ($file);
    $javascript = ob_get_clean();
    if (COMPRESS_JAVASCRIPT == 'true') {
      require_once(DIR_FS_EXTERNAL.'compactor/compactor.php');
      $compactor = new Compactor(array('strip_php_comments' => false, 'compress_css' => false, 'compress_scripts' => true));
      $javascript = $compactor->squeeze($javascript);
    }
    echo $javascript.PHP_EOL;

    ?>

    auch in der

    /templates/DEIN_TEMPLATE/javascript/general.js.php

    hier erhalte ich eine weisse Seite.

    Hat eventuell jemand einen Tipp für mich ?

    Danke und Gruß Frank

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

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.369
    • Geschlecht:
    Re: tawk.to LiveChat einbauen
    Antwort #1 am: 16. April 2023, 19:50:16
    Mit welchem Editor bearbeitest du die Dateien!? Ich sehe keinen Fehler in deiner gemachten Änderung in der Datei "/templates/DEIN_TEMPLATE/javascript/general_bottom_js.php".

    Was sagen die Logs im Ordner "/log/"?

    Grüße

    Torsten

    Frank71

    • Frisch an Board
    • Beiträge: 54
    Re: tawk.to LiveChat einbauen
    Antwort #2 am: 16. April 2023, 20:36:08
    Hallo Torsten,

    ich arbeite mit Notepad++  und Filezilla.

    In den Logs sind folgende Einträge:

    [2023-04-16 20:27:26] [warning] [modified] [pid:94197] WARNING found for URL: /de/ {} {}

    [2023-04-16 20:27:26] [warning] [modified] [pid:94197] Array to string conversion in File: .../templates/tpl_modified_responsive_8/source/boxes/last_viewed.php on Line: 25 {} {}

    [2023-04-16 20:27:26] [warning] [modified] [pid:94197] Backtrace #0 - ..../templates/tpl_modified_responsive_8/source/boxes.php called at Line 77 {} {}
    [2023-04-16 20:27:26] [warning] [modified] [pid:94197] Backtrace #1 - ....../shop/index.php called at Line 31 {} {}

    In der last_viewed.php sieht es so aus:

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: last_viewed.php 13566 2021-05-20 12:16:27Z GTB $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2003 XT-Commerce - www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/


    // include smarty
    include(DIR_FS_BOXES_INC . 'smarty_default.php');

    // reset cache id
    $cache_id = '';

    if (isset($_SESSION['tracking']['products_history']) && count($_SESSION['tracking']['products_history']) > 0) {

      // set cache id
      $cache_id = md5($_SESSION['currency'].$_SESSION['language'].$_SESSION['customers_status']['customers_status'].$_SESSION['tracking']['products_history']);

      if (!$box_smarty->is_cached(CURRENT_TEMPLATE.'/boxes/box_last_viewed.html', $cache_id) || !$cache) {

        $last_viewed_query = "SELECT ".$product->default_select.",
                                     p2c.categories_id,
                                     cd.categories_name
                                FROM "
    . TABLE_PRODUCTS . " p
                                JOIN "
    . TABLE_PRODUCTS_DESCRIPTION . " pd
                                     ON p.products_id = pd.products_id
                                        AND pd.language_id = '"
    .(int)$_SESSION['languages_id']."'
                                        AND trim(pd.products_name) != ''
                                JOIN "
    . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                                     ON p.products_id = p2c.products_id
                                JOIN "
    . TABLE_CATEGORIES_DESCRIPTION . " cd
                                     ON cd.categories_id = p2c.categories_id
                                        AND cd.language_id = '"
    .(int)$_SESSION['languages_id']."'
                               WHERE p.products_status = '1'
                                 AND p.products_id IN ('"
    .implode("', '", $_SESSION['tracking']['products_history'])."')
                                     "
    .PRODUCTS_CONDITIONS_P;
       
        $last_viewed_query = xtDBquery($last_viewed_query);
       
        $box_content = array();
        if (xtc_db_num_rows($last_viewed_query, true) > 0) {
          while ($last_viewed = xtc_db_fetch_array($last_viewed_query, true)) {
            $box_content[$last_viewed['products_id']] = $product->buildDataArray($last_viewed);
            $box_content[$last_viewed['products_id']]['CATEGORY_LINK'] = xtc_href_link(FILENAME_DEFAULT, xtc_category_link($last_viewed['categories_id'], $last_viewed['categories_name']));
            $box_content[$last_viewed['products_id']]['CATEGORY_NAME'] = $last_viewed['categories_name'];
          }
          $box_content = array_replace(array_flip(array_reverse($_SESSION['tracking']['products_history'])), $box_content);
        }
       
        $box_smarty->assign('box_content', $box_content);
        $box_smarty->assign('MY_PERSONAL_PAGE', xtc_href_link(FILENAME_ACCOUNT));
      }

      if (!$cache) {
        $box_last_viewed = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_last_viewed.html');
      } else {
        $box_last_viewed = $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_last_viewed.html', $cache_id);
      }

      $smarty->assign('box_LAST_VIEWED', $box_last_viewed);
    }
    ?>

    Soll ich die Backtrace's auch einstellen ?

    Danke und Gruß Frank

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: tawk.to LiveChat einbauen
    Antwort #3 am: 16. April 2023, 21:59:37
    Hallo Frank,

    Wenn du das Skript in der Datei /templates/DEIN_TEMPLATE/javascript/general_bottom_js.php einbaust, ist die Seite nicht weiss?

    Wenn dem so ist, dann müsstest du im gesendeten HTML-Dokument (Quelltext) den JavaScript-Code auch sehen.

    Wenn alles Obige zutrifft, kannst du im Browser, bei Firefox mit F12, die Entwickler-Tools aufrufen und unter dem Reiter "Konsole" etwaige Fehlermeldungen ansehen, ev. einen Reload der Seite ausführen.

    Gruss
    Hanspeter

    Frank71

    • Frisch an Board
    • Beiträge: 54
    Re: tawk.to LiveChat einbauen
    Antwort #4 am: 17. April 2023, 08:48:10
    Hallo Torsten,
    hallo Hanspeter,

    hatte heute Nacht den Einfall.

    Ich hab den Consentmanager vom Händlerbund deaktiviert.
    Dann funktioniert es, hätte erwartet, dass es auch bei Annahme aller Cookies funktionieren sollte.

    Aber jetzt hab ich schon die heiße Spur.
    Ich werde weiter suchen, welche Einstellungen nötig sind und berichten.

    Gruß Frank

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.990
    • Geschlecht:
    Re: tawk.to LiveChat einbauen
    Antwort #5 am: 17. April 2023, 13:03:37
    Unabhängig von der von hpzeller  genannten Bedingung solltest du das machen:
    [...] bei Firefox mit F12, die Entwickler-Tools aufrufen und unter dem Reiter "Konsole" etwaige Fehlermeldungen ansehen, ev. einen Reload der Seite ausführen.
    [...]

    Oder (Firefox, Chrome, Safari, Opera):
    Rechte Maustaste irgendwo über einem Inhalt des Shops
    => "Untersuchen" (oder "Element untersuchen")
    => Tab "Konsole"

    Gruß,
    noRiddle

    Ben

    • Schreiberling
    • Beiträge: 307
    • Geschlecht:
    Re: tawk.to LiveChat einbauen
    Antwort #6 am: 18. April 2023, 10:35:09
    Ich habe mir das auch mal installiert und direkt in der "/templates/DEIN_TEMPLATE/javascript/general_bottom_js.php" installiert unter:

    Code: PHP  [Auswählen]
    // this javascriptfile get includes at the BOTTOM of every template page in shop
    // you can add your template specific js scripts here
    defined('DIR_TMPL_JS') OR define('DIR_TMPL_JS', DIR_TMPL.'javascript/');
    ?>

    Funktioniert bei mir ohne Probleme.

    Grüße

    Frank71

    • Frisch an Board
    • Beiträge: 54
    Re: tawk.to LiveChat einbauen
    Antwort #7 am: 19. April 2023, 09:54:20
    Hallo Zusammen,

    das Problem war wirklich der Consentmanager.

    Nachdem er tawk selbständig erfasst hatte und ich es einer Kategorie zugeordnet hatte wurde das Script zugelassen und der Chat hat funktioniert.

    Leider hat tawk die Performance meiner Seite/Server so in den Keller gezogen, dass ich es wieder ausgebaut habe.

    Fehler hat es über die Konsole nicht angezeigt.

    Vielleicht kennt jemand ein ähnliches Live-Chat Tool welches etwas performanter ist.

    Gruß Frank

    Hetfield

    • modified Team
    • Beiträge: 937
    Re: tawk.to LiveChat einbauen
    Antwort #8 am: 19. April 2023, 10:40:04
    Ich empfehle UserLike. Haben diverse Kunden im Einsatz und sind damit sehr zufrieden.

    MfG Hetfield  8-)

    Timm

    • Fördermitglied
    • Beiträge: 6.258
    Re: tawk.to LiveChat einbauen
    Antwort #9 am: 19. April 2023, 11:20:40
    [...]
    Vielleicht kennt jemand ein ähnliches Live-Chat Tool welches etwas performanter ist.
    [...]

    Telefon :flee-mrgreen:

    Grüße Timm

    Ben

    • Schreiberling
    • Beiträge: 307
    • Geschlecht:
    Re: tawk.to LiveChat einbauen
    Antwort #10 am: 19. April 2023, 11:27:35
    Ich habe Tidio mal eingebaut auf unserer Firmenseite.

    Mal schauen. ;)

    Frank71

    • Frisch an Board
    • Beiträge: 54
    Re: tawk.to LiveChat einbauen
    Antwort #11 am: 19. April 2023, 11:28:53
    Hallo Hetfield,

    ich hab smartsupp und userlike im Auge.
    Sind auch beides EU Firmen. :-)

    Werde es am WE testen.

    Danke und Gruß Frank

    Frank71

    • Frisch an Board
    • Beiträge: 54
    Re: tawk.to LiveChat einbauen
    Antwort #12 am: 19. April 2023, 11:34:04
    [...]
    Vielleicht kennt jemand ein ähnliches Live-Chat Tool welches etwas performanter ist.
    [...]

    Telefon :flee-mrgreen:
    [...]

    Hallo Timm,

    Telefon ist doch langweilig. Sind wir hier nicht alle auch Spielkinder. ;-)

    Gruß Frank

    Frank71

    • Frisch an Board
    • Beiträge: 54
    Re: tawk.to LiveChat einbauen
    Antwort #13 am: 19. April 2023, 11:35:26
    Ich habe Tidio mal eingebaut auf unserer Firmenseite.

    Mal schauen. ;)

    Hallo Ben,

    schaue ich mir gerne an. :thumbs:

    Gruß Frank

    Hetfield

    • modified Team
    • Beiträge: 937
    Re: tawk.to LiveChat einbauen
    Antwort #14 am: 19. April 2023, 13:35:48
    Für UserLike hatte ich sogar mal ein Plugin gemacht. Habe es gerade mal auf GitHub eingestellt, falls es jemand gebrauchen kann: https://github.com/hetfield74/MITS_Userlike_Live_Chat

    MfG Hetfield  8-)
    0 Antworten
    1367 Aufrufe
    05. November 2016, 22:48:40 von Teratek
    5 Antworten
    3252 Aufrufe
    16. April 2014, 13:28:15 von Peconline
    6 Antworten
    4558 Aufrufe
    24. Februar 2010, 12:17:21 von doncuma
               
    anything