rechtstexte für onlineshop
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: MODUL: Artikel Anfrage

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #450 am: 09. Oktober 2020, 07:48:22
    Hallo Matthias,

    das Modul Frage_zu_Artikel_PopUp_v1.5_Shopversion_2.0.5.0.zip habe ich auch in die Shopversion 2.0.5.0 eingebaut und dabei keinen Fehler festgestellt. Du kommst wohl nicht darum zu prüfen ob alle Dateien hochgeladen wurden und deren Inhalt auch exakt mit denen aus dem Downloadpaket übereinstimmen.

    Hast du das zur Shopversion 2.0.5.0 richtige Modul installiert?

    Gruss
    Hanspeter

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #451 am: 09. Oktober 2020, 13:09:42
    Hallo Hanspeter,
    ich habe das Modul "v1.5 Shopversion 2.0.5.0" installiert und alles nochmal, nochmal und nochmal überprüft. Die beschriebenen Änderungen in den Datein sowie die neuen Dateien am "richtigen Platz" auf dem Webspace gecheckt und nix gefunden.

    Danke für Deinen Tip: Wahrscheinlich muß ich als nächstes den Inhalt jeder Datei aus dem Downloadpaket mit dem Inhalt der Dateien auf dem Webspace überprüfen. Wenn's danach funktioniert, beiß' ich gerne in den sauren Apfel. Die Installationsanleitung ist auch super beschrieben, eigentlich ist das Modul ganz einfach zu installieren. Näheres dazu, sobald alles überprüft ist.

    Gruß Matthias

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #452 am: 10. Oktober 2020, 12:17:24
    Der Inhalt jeder Datei des Modulpaktes ist nun mittel Copy/Paste von A (Notepad) nach B (geöffnete Datei auf dem Server) eingefügt. Eine Veränderung hat dies leider nicht gebracht.

    Hier mal die aufgeführten Fehlermeldungen im PopUp-Fenster nach dem Klick auf absenden (homepage/shop/shop_content_popup.php?action=send&coID=99):

    [ Für Gäste sind keine Dateianhänge sichtbar ] [ Für Gäste sind keine Dateianhänge sichtbar ] [ Für Gäste sind keine Dateianhänge sichtbar ]

    Dazu noch (sicherheitshalber) aus der contact_us_popup.php die Zeilen 87-90
    Code: PHP  [Auswählen]
    if (trim($message_body) == '') {
          $messageStack->add('contact_us_popup', ERROR_MSG_BODY);
          $error = true;
        }

    sowie 272-277
    Code: PHP  [Auswählen]
    // START Artikel Anfrage PopUp
        // is required for the contact-form field data
        $smarty->assign('INPUT_ARTICLE_NAME', xtc_draw_input_field('article_name', $product->data['products_name'], readonly));
        $smarty->assign('INPUT_ARTICLE_MODEL', xtc_draw_input_field('article_model', $product->data['products_model'], readonly));
        $smarty->assign('INPUT_ARTICLE_ID', xtc_draw_hidden_field('article_id', $product->data['products_id']));
    // END Artikel Anfrage PopUp

    Vlt. offenbart sich hier der Fehlerteufel, danke für weitere Lösungsvorschläge.

    Gruß Matthias

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #453 am: 11. Oktober 2020, 12:59:17
    Hallo Matthias,

    die geposteten Bilder zeigen keine Fehler (errors).
    Ersetze doch mal testweise den Kompletten Inhalt der Datei /media/content/contact_us_popup.php mit folgendem Code.
    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: contact_us.php 12129 2019-09-20 12:29:14Z GTB $

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

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2006 XT-Commerce

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

    /* -----------------------------------------------------------------------------------------
       $Id: contact_us_popup.php 2020-01-16 astaller $

       Angepasst für Artikel Anfrage Popup
       Vergleich mit Originaldatei: media/contact_us.php
       ---------------------------------------------------------------------------------------*/


      defined('DISPLAY_PRIVACY_CHECK') or define('DISPLAY_PRIVACY_CHECK', 'true');

      //use contact_us.php language file
      require_once (DIR_WS_LANGUAGES.$_SESSION['language'].'/contact_us.php');

      // include needed functions
      require_once (DIR_FS_INC.'parse_multi_language_value.inc.php');
      require_once (DIR_FS_INC.'secure_form.inc.php');

      // include needed classes
      require_once(DIR_WS_CLASSES.'modified_captcha.php');
     
      $mod_captcha = $_mod_captcha_class::getInstance();
       
      // captcha
      $use_captcha = array('contact');
      if (defined('MODULE_CAPTCHA_ACTIVE')) {
        $use_captcha = explode(',', MODULE_CAPTCHA_ACTIVE);
      }
      defined('MODULE_CAPTCHA_CODE_LENGTH') or define('MODULE_CAPTCHA_CODE_LENGTH', 6);
      defined('MODULE_CAPTCHA_LOGGED_IN') or define('MODULE_CAPTCHA_LOGGED_IN', 'True');
     
      $action = isset($_GET['action']) && $_GET['action'] != '' ? $_GET['action'] : '';
      $privacy = isset($_POST['privacy']) && $_POST['privacy'] == 'privacy' ? true : false;
     
      $error = false;
      if ($action == 'send') {

        $valid_params = array(
          'name',
          'email',
          'message_body',
          'company',
          'street',
          'postcode',
          'city',
          'phone',
          'fax',
    // START Artikel Anfrage PopUp
          'article_name',
          'article_model',
          'article_id',
    // END Artikel Anfrage PopUp
        );

        // prepare variables
        foreach ($_POST as $key => $value) {
          if ((!isset(${$key}) || !is_object(${$key})) && in_array($key , $valid_params)) {
            ${$key} = xtc_db_prepare_input($value);
          }
        }

        //jedes Feld kann hier auf die gewünschte Bedingung getestet und eine Fehlermeldung zugeordnet werden
        if (!xtc_validate_email(trim($email))) {
          $messageStack->add('contact_us_popup', ERROR_EMAIL);
          $error = true;
        }
       
        if (in_array('contact', $use_captcha) && (!isset($_SESSION['customer_id']) || MODULE_CAPTCHA_LOGGED_IN == 'True')) {    
          if ($mod_captcha->validate($_POST['vvcode']) !== true) {
            $messageStack->add('contact_us_popup', ERROR_VVCODE);
            $error = true;
          }
        }
       
        if (trim($message_body) == '') {
          $messageStack->add('contact_us_popup', ERROR_MSG_BODY);
          $error = true;
        }

        if (DISPLAY_PRIVACY_CHECK == 'true' && empty($privacy)) {
          $messageStack->add('contact_us_popup', ENTRY_PRIVACY_ERROR);
          $error = true;
        }

        if (check_secure_form($_POST) === false) {
          $messageStack->add('contact_us_popup', ENTRY_TOKEN_ERROR);
          $error = true;
        }

        if ($messageStack->size('contact_us_popup') > 0) {
          $messageStack->add('contact_us_popup', ERROR_MAIL);
          $smarty->assign('error_message', $messageStack->output('contact_us_popup'));
        }

        //Wenn kein Fehler Email formatieren und absenden
        if ($error === false) {
          // Datum und Uhrzeit
          $datum = date("d.m.Y");
          $uhrzeit = date("H:i");

          $additional_fields = '';
          if (isset($company))  $additional_fields =  EMAIL_COMPANY. $company . "\n" ;
          if (isset($street))   $additional_fields .= EMAIL_STREET . $street . "\n" ;
          if (isset($postcode)) $additional_fields .= EMAIL_POSTCODE . $postcode . "\n" ;
          if (isset($city))     $additional_fields .= EMAIL_CITY . $city . "\n" ;
          if (isset($phone))    $additional_fields .= EMAIL_PHONE . $phone . "\n" ;
          if (isset($fax))      $additional_fields .= EMAIL_FAX . $fax . "\n" ;
    // START Artikel Anfrage PopUp
          // is required to view the articles informations as a separate field in the contact-form and e-mail (eg. article name, number and link)
          if (isset($article_name))         $additional_fields .= "\n<strong>" . PRODUCT_INQUIRY . ":</strong>\n" . EMAIL_ARTICLE_NAME . $article_name . "\n" ;
          if (isset($article_model))        $additional_fields .= EMAIL_ARTICLE_MODEL . $article_model . "\n" ;
          if (isset($article_id))           $additional_fields .= EMAIL_ARTICLE_ID . xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link(trim($article_id))) . "\n" ;
    // END Artikel Anfrage PopUp

          if (file_exists(DIR_FS_DOCUMENT_ROOT.'templates/'.CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/contact_us.html')
              && file_exists(DIR_FS_DOCUMENT_ROOT.'templates/'.CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/contact_us.txt')
              )
          {
            $smarty->assign('language', $_SESSION['language']);
            $smarty->assign('tpl_path', HTTP_SERVER.DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/');    
            $smarty->assign('logo_path', HTTP_SERVER.DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/');
            $smarty->assign('NAME', $name);
            $smarty->assign('EMAIL', $email);
            $smarty->assign('DATE', $datum);
            $smarty->assign('TIME', $uhrzeit);
            $smarty->assign('ADDITIONAL_FIELDS', nl2br($additional_fields));
            $smarty->assign('MESSAGE', nl2br($message_body));
         
            // dont allow cache
            $smarty->caching = false;
         
            $html_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/contact_us.html');
            $txt_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/contact_us.txt');
            $txt_mail = str_replace(array('<br />', '<br/>', '<br>'), '', $txt_mail);
          } else {
            $txt_mail = sprintf(EMAIL_SENT_BY, parse_multi_language_value(CONTACT_US_NAME, $_SESSION['language_code']), parse_multi_language_value(CONTACT_US_EMAIL_ADDRESS, $_SESSION['language_code']), $datum , $uhrzeit) . "\n" .
                    "--------------------------------------------------------------" . "\n" .
                    EMAIL_NAME. $name . "\n" .
                    EMAIL_EMAIL. trim($email) . "\n" .
                    $additional_fields .
                    "\n".EMAIL_MESSAGE."\n ". $message_body . "\n";
            $html_mail = nl2br($txt_mail);
          }
         
          if (defined('MODULE_CONTACT_US_STATUS') && MODULE_CONTACT_US_STATUS == 'true') {
            require_once (DIR_FS_INC.'ip_clearing.inc.php');

            $sql_data_array = array(
              'customers_id' => (int)$_SESSION['customer_id'],
              'customers_name' => $name,
              'customers_email_address' => $email,
              'customers_ip' => ip_clearing($_SESSION['tracking']['ip']),
              'date_added' => 'now()',
            );
            xtc_db_perform('contact_us_log', $sql_data_array);
          }

    // START Artikel Anfrage PopUp
          // is required to change the email subject
          if (isset($article_id)) {
            $CONTACT_US_POPUP_EMAIL_SUBJECT = PRODUCT_INQUIRY . ': ' . $article_name;
          } else {
            $CONTACT_US_POPUP_EMAIL_SUBJECT = CONTACT_US_EMAIL_SUBJECT;
          }
    // END Artikel Anfrage PopUp
          xtc_php_mail(CONTACT_US_EMAIL_ADDRESS,
                       CONTACT_US_NAME,
                       CONTACT_US_EMAIL_ADDRESS,
                       CONTACT_US_NAME,
                       CONTACT_US_FORWARDING_STRING,
                       trim($email),
                       $name,
                       '',
                       '',
    // START Artikel Anfrage PopUp
    // new variable defined above for email subject
    /* ORIGINAL
                       CONTACT_US_EMAIL_SUBJECT,
    */

                       $CONTACT_US_POPUP_EMAIL_SUBJECT,
    // END Artikel Anfrage PopUp
                       $html_mail,
                       $txt_mail
                       );

    // START Artikel Anfrage PopUp
    /* ORIGINAL
          xtc_redirect(xtc_href_link(FILENAME_CONTENT, 'action=success&coID='.(int) $_GET['coID']));
    */

          xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INQUIRY, 'action=success&coID='.(int) $_GET['coID']));
    // END Artikel Anfrage PopUp
        }
      }

      $smarty->assign('CONTACT_HEADING', $shop_content_data['content_heading']);
      if (isset ($_GET['action']) && ($_GET['action'] == 'success')) {
        $smarty->assign('success', '1');
        $smarty->assign('BUTTON_CONTINUE', '<a href="'.xtc_href_link(FILENAME_DEFAULT).'">'.xtc_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE).'</a>');

      } else {
        if (isset ($_SESSION['customer_id']) && $action == '') {
          $c_query = xtc_db_query("SELECT c.customers_email_address,
                                          c.customers_telephone,
                                          c.customers_fax,
                                          ab.entry_company,
                                          ab.entry_street_address,
                                          ab.entry_city,
                                          ab.entry_postcode
                                     FROM "
    .TABLE_CUSTOMERS." c
                                     JOIN "
    .TABLE_ADDRESS_BOOK." ab
                                          ON ab.customers_id = c.customers_id
                                             AND ab.address_book_id = c.customers_default_address_id
                                    WHERE c.customers_id = '"
    .(int)$_SESSION['customer_id']."'");
          $c_data  = xtc_db_fetch_array($c_query);
          $c_data = array_map('stripslashes', $c_data);
          $name = $_SESSION['customer_first_name'].' '.$_SESSION['customer_last_name'];
          $email = $c_data['customers_email_address'];
          $phone = $c_data['customers_telephone'];
          $fax = $c_data['customers_fax'];
          $company = $c_data['entry_company'];
          $street = $c_data['entry_street_address'];
          $postcode = $c_data['entry_postcode'];
          $city = $c_data['entry_city'];
        } elseif ($action == '') {
            $name = '';
            $email = '';
            $phone = '';
            $company = '';
            $street = '';
            $postcode = '';
            $city = '';
            $fax = '';
        }
       
        $smarty->assign('CONTACT_CONTENT', $shop_content_data['content_text']);
    // START Artikel Anfrage PopUp
    /* ORIGINAL
        $smarty->assign('FORM_ACTION', xtc_draw_form('contact_us', xtc_href_link(FILENAME_CONTENT, 'action=send&coID='.(int) $_GET['coID'], 'SSL')).secure_form());
    */

        $smarty->assign('FORM_ACTION', xtc_draw_form('contact_us_popup', xtc_href_link(FILENAME_PRODUCT_INQUIRY, 'action=send&coID='.(int) $_GET['coID'], 'SSL')).secure_form());
    // END Artikel Anfrage PopUp
        if (in_array('contact', $use_captcha) && (!isset($_SESSION['customer_id']) || MODULE_CAPTCHA_LOGGED_IN == 'True')) {
          $smarty->assign('VVIMG', $mod_captcha->get_image_code());
          $smarty->assign('INPUT_CODE', $mod_captcha->get_input_code());
        }
        if (DISPLAY_PRIVACY_CHECK == 'true') {
          $smarty->assign('PRIVACY_CHECKBOX', xtc_draw_checkbox_field('privacy', 'privacy', $privacy, 'id="privacy"'));
        }
        $smarty->assign('PRIVACY_LINK', $main->getContentLink(2, MORE_INFO, $request_type));
        $smarty->assign('INPUT_NAME', xtc_draw_input_field('name', ((isset($name)) ? $name : ''), 'size="30"'));
        $smarty->assign('INPUT_EMAIL', xtc_draw_input_field('email', ((isset($email)) ? $email : ''), 'size="30"'));
        $smarty->assign('INPUT_PHONE', xtc_draw_input_field('phone', ((isset($phone)) ? $phone : ''), 'size="30"'));
        $smarty->assign('INPUT_COMPANY', xtc_draw_input_field('company', ((isset($company)) ? $company : ''), 'size="30"'));
        $smarty->assign('INPUT_STREET', xtc_draw_input_field('street', ((isset($street)) ? $street : ''), 'size="30"'));
        $smarty->assign('INPUT_POSTCODE', xtc_draw_input_field('postcode', ((isset($postcode)) ? $postcode : ''), 'size="30"'));
        $smarty->assign('INPUT_CITY', xtc_draw_input_field('city', ((isset($city)) ? $city : ''), 'size="30"'));
        $smarty->assign('INPUT_FAX', xtc_draw_input_field('fax', ((isset($fax)) ? $fax : ''), 'size="30"'));
        $smarty->assign('INPUT_TEXT', xtc_draw_textarea_field('message_body', 'soft', 45, 15, ((isset($message_body)) ? $message_body : '')));
        $smarty->assign('BUTTON_SUBMIT', xtc_image_submit('button_send.gif', IMAGE_BUTTON_SEND));
    // START Artikel Anfrage PopUp
        // is required for the contact-form field data
        $smarty->assign('INPUT_ARTICLE_NAME', xtc_draw_input_field('article_name', $product->data['products_name'], readonly));
        $smarty->assign('INPUT_ARTICLE_MODEL', xtc_draw_input_field('article_model', $product->data['products_model'], readonly));
        $smarty->assign('INPUT_ARTICLE_ID', xtc_draw_hidden_field('article_id', $product->data['products_id']));
    // END Artikel Anfrage PopUp
        $smarty->assign('FORM_END', '</form>');
      }

      $smarty->assign('language', $_SESSION['language']);
      $smarty->caching = 0;
    // START Artikel Anfrage PopUp
    /* ORIGINAL
      $smarty->display(CURRENT_TEMPLATE.'/module/contact_us.html');
    */

      $smarty->display(CURRENT_TEMPLATE.'/module/contact_us_popup.html');
    // END Artikel Anfrage PopUp
      // clear variables
      $smarty->clear_assign('BUTTON_CONTINUE');
      $smarty->clear_assign('CONTENT_HEADING');
      $content_body = '';
     

    Gruss
    Hanspeter

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #454 am: 11. Oktober 2020, 15:59:54
    Hallo Hanspeter,
    erstmal Danke für Deine Bemühungen.
    Der Code in der contact_us_popup.php wurde komplett ersetzt, gespeichert, Cache, Template Cache, Browser Cache geleert und gewartet. Habe danach eine Artikel Seite (nacheinander in mehreren Browsern getestet) neu geladen, das entsprechende PopUp-Fenster geöffnet und es ist leider alles beim "Alten".
    Habe nun testhalber im PopUp nur im Feld "Ihre E-Mail-Adresse:" einen Buchstaben eingegeben, dann auf absenden geklickt und danach erschien eine Fehlermeldung (Ausrufezeichen in orangefarbenem Kästchen + Text).

    Gruß Matthias

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #455 am: 12. Oktober 2020, 15:21:46
    Hallo zusammen,
    jetzt funktioniert das Modul einwandfrei.

    Doch zuerst Danke an Bert und Hanspeter für Eure Ideen.

    Nach nochmaligem umstellen, kopieren, experimentieren etc. konnte bei mir letztendlich der (wahrscheinlich selbst verursachte) Fehler gefunden und behoben werden.

    Im Admin unter Hilfsprogramme > Content Manager > Seiten > Frage zu Artikel PopUp auf bearbeiten klicken. Dann das Kästchen "Link in der Info Box angezeigen?" auf Nein. Habe ich wohl mal versehentlich umgestellt.
    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Jetzt läuft's (*freu)
    Gruß Matthias

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.743
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #456 am: 12. Oktober 2020, 23:21:38
    Das halte ich allerdings für seltsam.
    Zwar sollte man keinen Link in der Info Box angezeigen, weil es schlicht keinen Sinn macht, ich kann jedoch nicht sehen was das für einen Einfluß auf die Funktion des Formulars haben sollte.

    Gruß,
    noRiddle

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #457 am: 13. Oktober 2020, 10:39:33
    Hallo noRiddle,
    da hast Du wohl recht. Da mir das ganz "Cache leeren" nicht gefallen hat, habe ich gestern den Cache im Admin deaktiviert. [ Für Gäste sind keine Dateianhänge sichtbar ]
    Danach weiter nach Lösungen für das Modul gesucht, die Einstellung "Link in der Info Box angezeigen?" auf Nein geändert und siehe da, das PopUP für Artikel Anfrage geht auf und lässt sich erst nach Eingabe aller Daten absenden.

    Habe (auf Grund Deines Beitrages << Danke dafür) jetzt die Funktion nochmal "mit und ohne aktiviertem Cache" getestet und da ist wohl noch ein Fehlerteufelchen vorhanden.

    Also aktueller Stand der Dinge: Ist Cache deaktiviert, dann funktioniert es wie angedacht, ist Cache aktiviert, werden die im PopUp eingegebenen Daten zwar versendet, jedoch muß das Captcha (für Gäste) nicht eingetragen werden, es erscheinen keine "roten Fehlermeldungen" für die evtl. leer gelassenen *Felder und die Weiterleitung auf die "Dankesseite" erfolgt ebenfalls nicht.

    Freue mich auf Lösungsansätze
    Gruß Matthias

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.743
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #458 am: 13. Oktober 2020, 12:49:28
    Wenn du Shop-Version 2.0.5.1 hast setze mal in der Datei  unter das
    Code: PHP  [Auswählen]
    $smarty->caching = 0;

    dieses
    Code: PHP  [Auswählen]
    $disable_smarty_cache = true;

    und teste nochmals mit aktiviertem Cache..

    Ansonsten, wenn du noch 2.0.5.0 hast, lade dir die beiden Changesets* aus diesem Ticket #1752 runter und in deinen Shop.
    Du bleibst in dem Falle update-sicher weil das so in der 2.0.5.1 drin ist.

    In der Entwicklungszeit sollte man die Caches deaktivieren weil es ansonsten nervt. Später im Betrieb jedoch sollte man sie aktivieren (beide, Cache und DB-Cache) weil es den Shop deutlich schneller macht.

    Gruß,
    noRiddle

    *
    changeset_12611
    changeset_12692

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #459 am: 13. Oktober 2020, 13:39:21
    Tatsächlich, bei eingeschaltetem Cache funktioniert das Artikelanfrageformular nicht richtig.
    Meiner Meinung nach ist das Cachen dieses Formulars aber sowieso nicht nötig.

    Wenn du Shop-Version 2.0.5.1 hast setze mal in der Datei  unter das
    Code: PHP  [Auswählen]
    $smarty->caching = 0;

    dieses
    Code: PHP  [Auswählen]
    $disable_smarty_cache = true;

    und teste nochmals mit aktiviertem Cache..
    [...]

    Ich meinte "$disable_smarty_cache = true;" müsste eher oberhalb von "// set cache ID" eingesetzt werden, oder updatesicher, eine Datei \includes\extra\shop_content_end\99_product_inquiry_disable_smarty_cache.php mit folgendem Inhalt erstellen.

    Code: PHP  [Auswählen]
    <?php

    if (basename($PHP_SELF) == FILENAME_PRODUCT_INQUIRY)
      $disable_smarty_cache = true;

    Oder alternativ den kompletten Inhalt der /shop_content_popup.php mit folgendem  Code ersetzen.

    Code: PHP  [Auswählen]
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: shop_content.php 12248 2019-10-06 15:35:13Z GTB $

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

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(conditions.php,v 1.21 2003/02/13); www.oscommerce.com
       (c) 2003 nextcommerce (shop_content.php,v 1.1 2003/08/19); www.nextcommerce.org
       (c) 2006 XT-Commerce (shop_content.php 1238 2005-09-24)

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


    require_once ('includes/application_top.php');

    // redirect contact form to SSL if available
    if (ENABLE_SSL == true && $request_type == 'NONSSL' && !isset($_GET['action']) && $_GET['coID'] == '99') {
      xtc_redirect(xtc_href_link(FILENAME_CONTENT, 'coID='.(int) $_GET['coID'], 'SSL'));
    }

    // create smarty elements
    $smarty = new Smarty;

    // include boxes
    require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');

    // include needed functions
    require_once (DIR_FS_INC.'xtc_validate_email.inc.php');

    if ($language_not_found === true) {
      $site_error = TEXT_CONTENT_NOT_FOUND;
      include (DIR_WS_MODULES.FILENAME_ERROR_HANDLER);
      require (DIR_WS_INCLUDES.'header.php');

    } else {
      if (!isset($_GET['coID']) || $_GET['coID'] == '') {
        xtc_redirect(xtc_href_link(FILENAME_DEFAULT));
      }
     
      $shop_content_query = xtc_db_query("SELECT ". ADD_SELECT_CONTENT . "
                                                 content_id,
                                                 content_title,
                                                 content_heading,
                                                 content_text,
                                                 content_file,
                                                 parent_id
                                            FROM "
    .TABLE_CONTENT_MANAGER."
                                           WHERE content_group='"
    .(int) $_GET['coID']."'
                                                 "
    .CONTENT_CONDITIONS."
                                             AND content_active = '1'
                                             AND trim(content_title) != ''
                                             AND languages_id="
    .(int)$_SESSION['languages_id']);
     
      $content_exists = xtc_db_num_rows($shop_content_query);
      if ($shop_content_data = xtc_db_fetch_array($shop_content_query)) {
        // sub content
        include (DIR_WS_MODULES.'sub_content_listing.php');

        $breadcrumb->add($shop_content_data['content_title'], xtc_href_link(FILENAME_CONTENT,'coID='.(int) $_GET['coID']));
      } else {
        $site_error = TEXT_CONTENT_NOT_FOUND;
        $shop_content_data['content_heading'] = TEXT_CONTENT_NOT_FOUND;
      }

      $link = 'javascript:history.back(1)';
      if (!isset($_SERVER['HTTP_REFERER'])
          || strpos($_SERVER['HTTP_REFERER'], HTTP_SERVER) === false
          )
      {
        $link = xtc_href_link(FILENAME_DEFAULT, '', 'NONSSL');
      }
      $smarty->assign('BUTTON_CONTINUE', '<a href="'.$link.'">'.xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK).'</a>');
      $smarty->assign('CONTENT_HEADING', (($shop_content_data['content_heading'] != '') ? $shop_content_data['content_heading'] : $shop_content_data['content_title']));
      $smarty->assign('language', $_SESSION['language']);

      $content_body = '';
      if ($content_exists == 1) {
        $content_body = $shop_content_data['content_text'];
        if ($shop_content_data['content_file'] != '' && is_file(DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file'])) {
          ob_start();
          if (strpos($shop_content_data['content_file'], '.txt'))
            echo '<pre>';
          include (DIR_FS_CATALOG.'media/content/'.$shop_content_data['content_file']);
          if (strpos($shop_content_data['content_file'], '.txt'))
            echo '</pre>';
          $smarty->assign('file', ob_get_contents());
          ob_end_clean();
        }
      }
      $smarty->assign('CONTENT_BODY', $content_body);
     
      include (DIR_WS_MODULES.'content_manager_media.php');
     
      $content_template = 'content.html';
     
      foreach(auto_include(DIR_FS_CATALOG.'includes/extra/shop_content_end/','php') as $file) require_once ($file);

    // START Artikel Anfrage PopUp
    /* ORIGINAL
      // set cache ID
      if (!CacheCheck()) {
        $smarty->caching = 0;
        $main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/'.$content_template);
      } else {
        $smarty->caching = 1;
        $smarty->cache_lifetime = CACHE_LIFETIME;
        $smarty->cache_modified_check = CACHE_CHECK;
        $cache_id = md5($_SESSION['language'].$_SESSION['customers_status']['customers_status'].$shop_content_data['content_id'].((isset($_REQUEST['error'])) ? $_REQUEST['error'] : ''));
        $main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/'.$content_template, $cache_id);
      }
    */
     
      $main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/'.$content_template);  
    // END Artikel Anfrage PopUp

      require (DIR_WS_INCLUDES.'header.php');
    }
    $smarty->assign('language', $_SESSION['language']);
    $smarty->assign('main_content', $main_content);
    $smarty->caching = 0;
    // START Artikel Anfrage PopUp
    /* ORIGINAL  
    if (!defined('RM'))
      $smarty->load_filter('output', 'note');
    $smarty->display(CURRENT_TEMPLATE.'/index.html');
    */

    $smarty->display(CURRENT_TEMPLATE.'/module/popup_contact.html');
    include ('includes/application_bottom.php');  

    Gruss
    Hanspeter

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.743
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #460 am: 13. Oktober 2020, 14:36:52
    Ich habe die Datei versehentlich nicht dazu ganannt. Ich meinte /media/content/contact_us_popup.php .
    Hab's aber nicht getestet.

    Gruß,
    noRiddle

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #461 am: 13. Oktober 2020, 15:58:20
    Ja so funktioniert es auch.

    Gruss
    Hanspeter

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #462 am: 13. Oktober 2020, 19:55:13
    Hallo noRiddle,
    großes DANKE schön!

    Zitat
    updatesicher, eine Datei \includes\extra\shop_content_end\99_product_inquiry_disable_smarty_cache.php mit folgendem Inhalt erstellen.
    Wie beschrieben, neue PHP-Datei  erstellt, den Code eingefügt, gespeichert und getestet (in mehreren Browsern, als Gast und Neuer Kunde). Funktioniert nun wunderbar, egal ob Cache im Admin aktiviert ist oder nicht.

    Im Admin bei den Cache Optionen "Die Cache Features verwenden." während der Programmierphase deaktiviert zu lassen, ist wirklich extrem hilfreich.

    Gruß Matthias

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.743
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #463 am: 13. Oktober 2020, 21:55:24
    Das mit dem update-sicher ist aber völlig unnötig, da es ein Erweiterungsmodul, welches selbst bereits update-sicher implementiert ist und das der Verbesserung bedarf wegen des Cache-Problems.
    Ich denke es ist einfacher meine Lösung zu verwenden, also ohne weitere Extra-Datei.
    Um es nochmals klar zu machen:
    In /media/content/contact_us_popup.php unter
    Code: PHP  [Auswählen]
    $smarty->caching = 0;

    das setzen
    Code: PHP  [Auswählen]
    $disable_smarty_cache = true;

    Gruß,
    noRiddle

    Matthias69

    • Neu im Forum
    • Beiträge: 25
    • Geschlecht:
    Re: MODUL: Artikel Anfrage
    Antwort #464 am: 13. Oktober 2020, 22:46:58
    Hallo noRiddle,
    die neu angelegte "99_product_inquiry_disable_smarty_cache.php" ist jetzt gelöscht,
    der von Dir angegebene PHP-Code in /media/content/contact_us_popup.php korrekt eingetragen und
    es funktioniert.

    Einfach klasse, Danke dafür.
    Gruß Matthias
    97 Antworten
    40946 Aufrufe
    13. März 2019, 12:34:42 von goair
    4 Antworten
    1669 Aufrufe
    16. Januar 2020, 12:55:41 von hpzeller
    2 Antworten
    170 Aufrufe
    29. November 2023, 09:10:16 von Timm
               
    anything