Line 1:
Line 1:
+
<!-- BEGIN interlang links -->
+
<!-- Do NOT edit this section
+
Links below are automatically managed by PolyglotBot
+
You can edit links on the English source page : Module_ECommerce_NG_(Magento) -->
+
[[en:Module_ECommerce_NG_(Magento)]]
+
<!-- END interlang links -->
+
[[Category:Modules complémentaires]]
[[Category:Modules complémentaires]]
[[Category:Magento]]
[[Category:Magento]]
[[Category:Teclib]]
[[Category:Teclib]]
+
[[Category:E-commerce]]
{{TemplateDocDev}}
{{TemplateDocDev}}
{{TemplateDocUtil}}
{{TemplateDocUtil}}
−
<keywords content="Magento, Dolibarr, synchro, synchronisation, interface" />
+
<seo metak="Magento, Dolibarr, synchro, synchronisation, interface" />
= Informations =
= Informations =
{{TemplateModuleInfo
{{TemplateModuleInfo
−
|modulename=Magento
+
|modulename=ECommerce NG (Magento)
|editor=Teclib
|editor=Teclib
|web=[http://www.teclib.com www.teclib.com]
|web=[http://www.teclib.com www.teclib.com]
Line 13:
Line 21:
|status=development
|status=development
|prerequisites=
|prerequisites=
−
|minversion=3.8.0+
+
|minversion=3.9.0+
−
Magento version 1.9+
+
Prerequisite of Magento: Magento version 1.9.* - 1Gb of allowed memory on the PHP where Magento run may be required
|note=
|note=
}}
}}
= Fonctionnalités =
= Fonctionnalités =
−
Intègre une synchronisation Magento - Dolibarr.
+
Intègre une synchronisation entre Dolibarr et une plateforme eCommerce. Le support pour Magento es stable, celui pour WooCommerce est experimental, celui pour Prestashop est un développement non terminé (contributions pour cela bienvenues).
−
Il s'agit d'un module qui s'installe sur Dolibarr. L'accès à Magento est fait par Dolibarr en utilisant les Web services par défaut de Magento.
+
+
Il s'agit d'un module qui s'installe sur Dolibarr uniquement. L'accès à la plateforme eCommerce est fait par Dolibarr en utilisant les Web services fournis par la plateforme.
= Installation =
= Installation =
Line 47:
Line 56:
== Synchronisation de Magento vers Dolibarr ==
== Synchronisation de Magento vers Dolibarr ==
−
Synchronizing can be done manually from page '''Synchronizing Site ...''':
+
== Synchronisation de Dolibarr vers Magento ==
−
* Categories created/modified into Magento => Created into Dolibarr as sub-categories of the parent category used for Mangeto categories (defined into module setup) (Table llx_ecommerce_category is mainained to keep link of dolibarr id and remote magento id)
+
= Développement =
−
* Products created/modified into Magento => Created into Dolibarr with categories (Table llx_ecommerce_product is mainained to keep link of dolibarr id and remote magento id)
+
{{TemplateModTeclibFr}}
−
* Thirdparties and contact/addresses created/modified into Magento => Created into Dolibarr (Table llx_ecommerce_societe and llx_ecommerce_socpeople is mainained to keep link of dolibarr id and remote magento id)
−
* Orders created/modified into Magento => Created into Dolibarr (Table llx_ecommerce_commande is mainained to keep link of dolibarr id and remote magento id)
−
* Creating a shipment in Magento is changing status of Order from "pending" to "processing". Because it is changing status or order, it is synchronized
−
* Invoices created/modified into Magento => TODO
−
TODO Add job/script to automate this.
−
La synchronisation est pour l'instant faite manuellement depuis les boutons '''Synchronisation Détaillée du site''' et '''Tout synchroniser pour ce site'''
+
= TroubleShooting =
−
/ecommerce/index.php?idmenu=18
+
A cause de problèmes dans Magento, si vous avez un nombre important de catégories de produits, vous constaterez de très mauvaise performance lors du comptage des données à synchroniser ou lors de la synchronisation. Voici une modification qui peut améliorer cela:
−
*Les catégories créées et modifiées dans Magento sont créées dans Dolibarr en tant que sous-catégories (dans une catégorie de Dolibarr, choisie pour cela dans la configuration du module)
+
Sur Magento 1.9, éditer le fichier '''app/code/core/Mage/Catalog/Model/Category/Api.php''' pour ajouter la ligne visible en commentaire
−
(La table llx_ecommerce_category tient à jour les liens entre ces catégories grâce au remote magento id)
−
*Les produits créés et modifiés dans Magento sont créés/modifiés dans Dolibarr avec leurs catégories respectives
−
(La table llx_ecommerce_product tient à jour les liens entre ces produits grâce au remote magento id)
−
*Les Tiers et Contacts (billing/shipping adresses) créés et modifiés dans Magento sont créés dans Dolibarr, en tant que "contacts de Tiers" pour les adresses.
−
(La table llx_ecommerce_societe pour les Tiers et la table llx_ecommerce_socpeople tient à jour les liens entre ces Tiers et contacts grâce au remote magento id)
−
(Lors de la création d'une commande sur Magento, les contacts sont bien définis en tant que "contact suivi de commande et facturation (billing), contact livraison (shipping))
−
*Les commandes créées et modifiées dans Magento sont créées dans Dolibarr et les contacts de facturation/livraison sont bien définis.
−
(La table llx_ecommerce_commande tient à jour les liens entre ces catégories grâce au remote magento id)
−
== Synchronisation de Dolibarr vers Magento ==
+
<syntaxHighlight lang="php">
+
+
...
+
+
/**
+
* Convert node to array
+
*
+
* @param Varien_Data_Tree_Node $node
+
* @return array
+
*/
+
protected function _nodeToArray(Varien_Data_Tree_Node $node)
+
{
+
// Only basic category data
+
$result = array();
+
$result['category_id'] = $node->getId();
+
$result['parent_id'] = $node->getParentId();
+
$result['name'] = $node->getName();
+
$result['is_active'] = $node->getIsActive();
+
$result['position'] = $node->getPosition();
+
$result['level'] = $node->getLevel();
+
+
+
/* FIX Add here this new line to add the missing property returned by web service */
+
/*********/
+
$result['updated_at'] = $node->getUpdatedAt();
+
/*********/
+
+
+
$result['children'] = array();
+
+
foreach ($node->getChildren() as $child) {
+
$result['children'][] = $this->_nodeToArray($child);
+
}
−
Synchronizing is done in real time:
+
return $result;
+
}
−
* Categories created/modified into Dolibarr => Created into Magento if category is inside the parent category defined into setup.
+
...
−
* Products created/modified into Dolibarr => Created into Magento if product has a category inside parent category of Magento product (defined into setup too).
−
* Thirdparties and contact/addresses into Dolibarr are not synchronized to Magento.
−
* Orders created into Dolibarr => They are not pushed to Magento. Orders updates are done on Magento only if order was created by a Magento to Dolibarr synchronization.
−
* Shipments created into Dolibarr => They are not pushed to Magento except if source order was coming from Magento.
−
* Invoice created into Dolibarr => They are not pushed to Magento except if source order was coming from Magento.
−
* Stocks
−
= Développement =
+
</syntaxHighlight>
−
{{TemplateModTeclibFr}}