Collmex Schnittstelle für modified eCommerce Shopsoftware

Eine neue Schnittstelle für die modified eCommerce Shopsoftware zur Datenübertragng von Kategorien, Artikeln und Bestellungen in das Online Warenwirtschaftssystem Collmex nun auch als OpenSource.
Artikel und Kategorien die nicht in Collmex existieren können über einen Button „zu Collmex“ übertragen werden.
Bestellungen können (optional) nach Eingang in der modified eCommerce Shopsoftware automatisch an Collmex gesendet werden. Neue Kunden werden neu angelegt und bestehende gegebenenfalls aktualisiert. Anhand des Status der Bestellung kann konfiguriert werden, welche Bestellungen automatisch übertragen werden sollen, z.B. für bestätigte Zahlungen externer Zahlungsmodule.
In der Konfiguration lassen sich für die unterschiedlichen Versand- und Zahlungsarten bei der modified eCommerce Shopsoftware die entsprechenden Versandarten und Zahlungsbedingungen bei Collmex angeben.
Bei Problemen besteht die Möglichkeit alle Transaktionen detailliert zu Loggen.
Download ab Shopversion 2.0.0.0
Für die modified eCommerce Shopsoftware ab Version 2.0.0.0 könnt ihr die Schnittstelle hier bestellen:
Collmex Schnittstelle für die modified eCommerce Shopsoftware ab Version 2.0.0.0
Changelog
/* v0.1 BETA 11. July 2013 - [NEW] Administrative interface configuration - [NEW] Methods to speak with the Collmex-API - [NEW] Acquisition of product categories as product groups to Collmex - [NEW] Acquisition of articles (without parameters) to Collmex - [NEW] Acquisition of orders as customer orders to Collmex - [NEW] Automatic transfer of orders after successful completion of the order - [NEW] Automatic transfer of orders with PayPal payment module after successful completion of the order v1.0 07. August 2013 - [FIX] Generate negative numbers in the transfer of orders to Collmex to group all ordered items and use an new Collmex-Number - [ADD] Intercept and view more messages from the Collmex-API - [ADD] Add selected product attributes to the article title - [ADD] View button to transfer data only for NOT existing categories, products and orders - [FIX] Send messages to the stack only if it exists - [ADD] Verification of the installed version up to date and display the link to the project page - [FIX] Passed items with netto prices, deduct 19% tax on shipping and payment methods surcharge. - [FIX] pass correct product weight - [FIX] Line breaks as a result of the API to correctly interpret - [ADD] set customers comments as "Internes Memo" - [ADD] log all messages */
Installation
ACHTUNG: Die mitgelieferten Dateien sind Erweiterungen der Orginalen von modified-shop_1.06-r4356. Solltest du eine ältere Version verwenden oder bereits Anpassungen in deinem Shop vorgenommen haben, vergleiche bitte alle Dateien auf Veränderungen.
Alle Modifikationen sind in Blöcken zusammen gefasst:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - *** Hier stehen die Änderungen. Bitte kopiere die Kommentare mit um später diese Änderungen wieder zu erkennen // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - ***
1. Backup erstellen
Bitte leg ein Backup vom Shop und der Datenbank an bevor du die folgenden Schritte ausführst!
KEINE HAFTUNG FÜR FEHLFUNKTIONEN NACH DER INSTALLATION
2. Dateien hochladen
Der Ordner shoproot/includes/collmex in des Shopverzeichnis nach [SHOP_ROOT]/includes/ kopieren.
Die Datei shoproot/admin/includes/modules/export/collmex.php nach [SHOP_ROOT]/admin/includes/modules/export kopieren.
3. Dateien bearbeiten
3.1. [SHOP_ROOT]/admin/categories.php
Folgende Zeile suchen:
#EOB multi_action_confirm
NACH dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - send category by Collmex API case 'collmex_send': require_once DIR_FS_CATALOG . 'includes/collmex/api.php'; $api = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); if (key_exists('cID', $_GET)) { $api->sendCategory($_GET['cID']); } if (key_exists('pID', $_GET)) { $api->sendProduct($_GET['pID']); } unset($api); break; // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - send category by Collmex API
3.2 [SHOP_ROOT]/admin/orders.php
Folgende Zeile suchen:
case 'resendordermail': break;
NACH dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit order by Collmex API case 'collmex_send': require_once DIR_FS_CATALOG . 'includes/collmex/api.php'; $api = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); $res = $api->sendOrder($oID); unset($api); unset($_GET['action']); unset($action); break; // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit order by Collmex API
Folgende Zeile suchen:
if (AFTERBUY_ACTIVATED == 'true') { $contents[] = array ('align' => 'center', 'text' => ''.BUTTON_AFTERBUY_SEND.''); }
NACH dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit order by Collmex API if (constant('MODULE_COLLMEX_STATUS') && 'true' == strtolower(MODULE_COLLMEX_STATUS)) { if (!class_exists('collmexAPI')) { require_once DIR_FS_CATALOG . 'includes/collmex/api.php'; } if (!isset($collmexAPI) || !($collmexAPI instanceof collmexAPI)) { $collmexAPI = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); } $collmexOrder = $collmexAPI->getOrder($oInfo->orders_id); $collmexContent = ''; if (is_array($collmexOrder) && 0 < count($collmexOrder)) { $collmexContent = 'bereits zu Collmex übertragen'; } else { $params = xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=collmex_send'; $collmexContent = '' . BUTTON_COLLMEX_SEND . ''; } $contents[] = array( 'align' => 'center', 'text' => $collmexContent ); } // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit order by Collmex API
3.3. [SHOP_ROOT]/admin/includes/modules/categories_view.php
Folgende Zeile suchen:
$contents[] = array('align' => 'center', 'text' => '' . BUTTON_EDIT . '');
NACH dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit category by Collmex API if (constant('MODULE_COLLMEX_STATUS') && 'true' == strtolower(MODULE_COLLMEX_STATUS)) { if (!class_exists('collmexAPI')) { require_once DIR_FS_CATALOG . 'includes/collmex/api.php'; } if (!isset($collmexAPI) || !($collmexAPI instanceof collmexAPI)) { $collmexAPI = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); } if (isset($cInfo) && is_object($cInfo)) { $collmexCategory = $collmexAPI->getCategory($cInfo->categories_id); } $collmexContent = ''; if ($collmexCategory instanceof collmexAPICategorySet) { $collmexContent = 'bereits zu Collmex übertragen'; } else { $params = xtc_get_all_get_params(array('cPath', 'action', 'pID', 'cID')) . 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=collmex_send'; $collmexContent = '' . BUTTON_COLLMEX_SEND. ''; } $contents[] = array( 'align' => 'center', 'text' => $collmexContent ); } // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit category by Collmex API
Folgende Zeilen suchen:
} else { $contents[] = array('align' => 'center', 'text' => '
‚ . BUTTON_EDIT . ‚ | |
‚); } // EOF – Tomcraft – 2009-11-28 – Included xs:booster
NACH diesen Zeilen einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit product by Collmex API if (constant('MODULE_COLLMEX_STATUS') && 'true' == strtolower(MODULE_COLLMEX_STATUS)) { if (!class_exists('collmexAPI')) { require_once DIR_FS_CATALOG . 'includes/collmex/api.php'; } if (!isset($collmexAPI) || !($collmexAPI instanceof collmexAPI)) { $collmexAPI = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); } if (isset($pInfo) && is_object($pInfo)) { $collmexProduct = $collmexAPI->getProduct($pInfo->products_id); } $collmexContent = ''; if ($collmexProduct instanceof collmexAPIProductSet) { $collmexContent = 'bereits zu Collmex übertragen'; } else { $params = xtc_get_all_get_params(array('cPath', 'action', 'pID', 'cID')) . 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=collmex_send'; $collmexContent = '' . BUTTON_COLLMEX_SEND. ''; } $contents[] = array( 'align' => 'center', 'text' => $collmexContent ); } // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - implements button to transmit product by Collmex API
3.4. [SHOP_ROOT]/checkout_process.php
Folgende Zeile suchen:
// EOF - Tomcraft - 2009-11-28 - Included xs:booster
NACH dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - send order to collmex if (defined('MODULE_COLLMEX_STATUS') && 'true' == MODULE_COLLMEX_STATUS && 'true' == MODULE_COLLMEX_AUTO_TRANSMIT) { require_once DIR_FS_CATALOG . 'includes/collmex/api.php'; $collmexApi = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); if ($collmexApi->isOrderAutoTransmit($insert_id)) { $collmexApi->sendOrder($insert_id, true); } } // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - send order to collmex
3.5. [SHOP_ROOT]/lang/german/admin/buttons.php
Folgende Zeile suchen:
?>
VOR dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - button to transmit data by Collmex API define('BUTTON_COLLMEX_SEND', 'zu Collmex übertragen'); // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - button to transmit data by Collmex API
3.6. Optional für PayPal-Aufträge: [SHOP_ROOT]/includes/classes/paypal_checkout.php
Folgende Zeile suchen:
xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
NACH dieser Zeile einfügen:
// BOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - send order to collmex ini_set('display_errors', '0'); if (defined('MODULE_COLLMEX_STATUS') && 'true' == MODULE_COLLMEX_STATUS && 'true' == MODULE_COLLMEX_AUTO_TRANSMIT) { require_once dirname(__FILE__) . '/../collmex/api.php'; $collmexApi = new collmexAPI(MODULE_COLLMEX_NUMBER, MODULE_COLLMEX_USER, MODULE_COLLMEX_PASSWORD, MODULE_COLLMEX_COMPANY_ID); if (!isset($xtc_order_id) || !$xtc_order_id) { $xtc_order_id = $this->data['invoice']; } if ($collmexApi->isOrderAutoTransmit($xtc_order_id)) { $collmexApi->sendOrder($xtc_order_id, true); } // dont throw any errors on destruct, prevent http-code 500 or 503 $collmexApi->clearMessages(); } // EOF - Timo Paul (mail[at]timopaul[dot]biz) - 2013-07-11 - send order to collmex
4. Installation
Im Shop-Backend unter „Module“ > „Module“ das Modul „Collmex – API Konfiguration“ [Installieren].