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: Bug in allen 1.06: Class 'product' not found + Fix

    DieterW

    • Mitglied
    • Beiträge: 140
    Bug in allen 1.06: Class 'product' not found + Fix
    am: 12. November 2018, 15:31:11
    Firefox: Einen Artikel mit rechtsklick->Link in neuem Tab öffnen aufrufen, und dann den "In den Warenkorb" Knopf drücken.

    Warenkorb wirft:  Class 'product' not found ....

    Suche
    Code: PHP  [Auswählen]
    // class product
    require (DIR_WS_CLASSES.'product.php');
     
    verschiebe auf die Zeile VOR
    Code: PHP  [Auswählen]
    // create the shopping cart & fix the cart if necesary
     

    Und das Problem ist weg.

    Hintergrund ist, in der
    Code: PHP  [Auswählen]
    require (DIR_WS_INCLUDES.FILENAME_CART_ACTIONS);
    wird versucht die Klasse Product zu instanzieren die aber noch gar nicht geladen ist.

    Ich habe den Fehler in allen 1.06er Versionen gefunden (2.x nicht betroffen, frühere Versionen nicht geprüft)

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

    Herr_Bert

    • Fördermitglied
    • Beiträge: 756
    • Geschlecht:
    Re: Bug in allen 1.06: Class 'product' not found + Fix
    Antwort #1 am: 12. November 2018, 16:21:51
    Zitat
    Ich habe den Fehler in allen 1.06er Versionen gefunden....
    Bei mir funktioniert das einwandfrei, da kommt
    Zitat
    Class 'product' not found ....
    nicht  :whistle:
    Ich nehme mal an, du meinst die application_top.php, da sieht der entsprechende Teil bei mir so aus:

    Code: PHP  [Auswählen]
    // PayPal Express
    if (defined('PAYPAL_API_VERSION')) {
      require_once (DIR_WS_CLASSES . 'paypal_checkout.php');
      $o_paypal = new paypal_checkout();
    }

    // create the shopping cart & fix the cart if necesary
    if (!isset($_SESSION['cart']) || !is_object($_SESSION['cart'])) {
      $_SESSION['cart'] = new shoppingCart();
    }

    require (DIR_WS_INCLUDES.FILENAME_CART_ACTIONS);

    // who's online functions
    xtc_update_whos_online();

    // split-page-results
    require (DIR_WS_CLASSES.'split_page_results.php');

    // infobox
    require (DIR_WS_CLASSES.'boxes.php');

    // auto activate and expire banners
    xtc_activate_banners();
    xtc_expire_banners();

    // auto expire special products
    xtc_expire_specials();

    // class product
    require (DIR_WS_CLASSES.'product.php');

    // set $actual_products_id,  $current_category_id, $ cPath, $_GET['manufacturers_id']
    include (DIR_WS_MODULES.'set_ids_by_url_parameters.php');

    web-looks

    • Mitglied
    • Beiträge: 136
    Re: Bug in allen 1.06: Class 'product' not found + Fix
    Antwort #2 am: 13. November 2018, 09:01:06
    @DieterW: Hast Du vielleicht ein zusätzliches Modul installiert, welches die Klasse $product in der cart_actions.php nutzt? Im Standard-Shop wird $product nämlich dort nicht genutzt. Lediglich ab SP3 wird sie an einer Stelle für PayPal Express gebraucht, da wird allerdings vorher geprüft, ob die Variable existiert und falls nicht neu erzeugt.
    17 Antworten
    11928 Aufrufe
    16. August 2009, 00:01:30 von Tomcraft
    6 Antworten
    4333 Aufrufe
    28. August 2014, 19:54:15 von noRiddle (revilonetz)
               
    anything