Jump to content
xt:Commerce Community Forum

xt:CommerceAPI - Probleme bei der Verwendung im Multishop


Recommended Posts

Hallo zusammen,

ich bin gerade dabei auf die Shop-API umzustellen (würde ich gern!!!).

Ich teste den Zugriff mit Postman. Allerdings liefert mir nur die function

    "function": "getManufacturers",
ein Ergebnis. Die "function": "getCategories", und "function": "getArticles", liefern bei mir ein leeres Result - empty.

Version 6.1.1 - Multishop, aktuelle xtcAPI.

{
    "function": "getManufacturers",
    "paras": {
        "user": "*****",
        "pass": "*****",
        "start":0,
        "size":50,
        "extNumberRange":0
    }
}

funktioniert.

{
    "function": "getCategories",
    "paras": {
        "user": "*****",
        "pass": "*****",
        "start":"1",
        "blocksize":"10"
    }
}

gibt nichts zurück.

?????

Vielen Dank im Voraus.

Michael

 

Ich hab jetzt folgendes ermittelt.

Es liegt an dem Aufruf von

   // Infos über alle stores holen
   $stores = $store_handler->getStores();

in getArticles.php...

Ich nehme mal an, dass das die Funktion in class.multistore.php ist.

    function getStores()
    {
        global $db, $xtPlugin;
        $where = '';
        ($plugin_code = $xtPlugin->PluginCode(__CLASS__ . ':getStores_top')) ? eval($plugin_code) : false;
        static $cache =  array();

        $hash = $where; //crc32($where);
        if(!array_key_exists($hash, $cache))
        {
            $rs = $db->CacheExecute("SELECT * FROM " . TABLE_MANDANT_CONFIG . " " . $where . " ORDER BY shop_id ASC");
            $data = array();
            while (!$rs->EOF)
            {
                $data[] = array(
                    'id' => $rs->fields['shop_id'],
                    'text' => $rs->fields['shop_ssl_domain'],
                    'status' => $rs->fields['shop_status']
                );
                $rs->MoveNext();
            }
            $rs->Close();

            $cache[$hash] = $data;
        }
        $data = $cache[$hash]; // to be compatible for old code using the next hook

        ($plugin_code = $xtPlugin->PluginCode(__CLASS__ . ':getStores_bottom')) ? eval($plugin_code) : false;

        return $data;
    }

 

to be continue.....

 

Link to comment
Share on other sites

Hallo zusammen,

hier mal ein Workaround für die Problematik.

Leider ist nicht bei allen Funktionen in der API der Verweis auf $store_handler vorhanden.
Ich hab jetzt den Verweis in den Funktionen getCategories und setArticle wie folgt eingefügt:

    global $db, $store_handler;

Damit bekomme ich auch die Daten zurück!!!

Ich muss leider immer wieder feststellen, dass dieser Shop eine Bananen-Entwicklung ist.
Auch ist der Support dafür unter aller....

Ich wurde mehrmals mit der lappidaren Bemerkung "Bei unseren Tests ist kein Fehler aufgetreten..." abgespeist. Super...
Kann ich nicht nachvollziehen.

Bis zum nächsten mal!!!
 

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
  • Create New...