Version Notes
You need Dolibarr 3.0 and the Auguria's eCommerce module to make use of this extension.
If you have ideas for improvements or find bugs, please send them to Anthony Poiret at www.auguria.net, with Auguria LastReviews as part of the subject line.
Download this release
Release Info
Developer | Auguria |
Extension | Auguria_Dolibarrapi |
Version | 1.0.0 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 1.0.0
app/code/community/Auguria/Dolibarrapi/Model/Catalog/Product/Api.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Catalog
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Catalog product api
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_Catalog
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Auguria_Dolibarrapi_Model_Catalog_Product_Api extends Mage_Catalog_Model_Product_Api
|
35 |
+
{
|
36 |
+
/**
|
37 |
+
* Retrieve product info
|
38 |
+
*
|
39 |
+
* @param int|string $productId
|
40 |
+
* @param string|int $store
|
41 |
+
* @param array $attributes
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
public function info($productId, $store = null, $attributes = null, $identifierType = null)
|
45 |
+
{
|
46 |
+
$product = $this->_getProduct($productId, $store, $identifierType);
|
47 |
+
|
48 |
+
if (!$product->getId()) {
|
49 |
+
$this->_fault('not_exists');
|
50 |
+
}
|
51 |
+
|
52 |
+
$result = array( // Basic product data
|
53 |
+
'product_id'=> $product->getId(),
|
54 |
+
'sku' => $product->getSku(),
|
55 |
+
'set' => $product->getAttributeSetId(),
|
56 |
+
'type' => $product->getTypeId(),
|
57 |
+
'categories'=> $product->getCategoryIds(),
|
58 |
+
'websites' => $product->getWebsiteIds()
|
59 |
+
);
|
60 |
+
|
61 |
+
foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
|
62 |
+
if ($this->_isAllowedAttribute($attribute, $attributes)) {
|
63 |
+
$result[$attribute->getAttributeCode()] = $product->getData(
|
64 |
+
$attribute->getAttributeCode());
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
// Calculating product's tax rate for default settings and this product's group
|
69 |
+
$object = Mage::getSingleton('tax/calculation')->getRateRequest($store);
|
70 |
+
$object->setProductClassId($result['tax_class_id']);
|
71 |
+
$result['tax_rate'] = Mage::getSingleton('tax/calculation')->getRate($object);
|
72 |
+
|
73 |
+
return $result;
|
74 |
+
}
|
75 |
+
|
76 |
+
} // Class Auguria_Dolibarrapi_Model_Catalog_Product_Api End
|
app/code/community/Auguria/Dolibarrapi/etc/api.xml
CHANGED
@@ -52,6 +52,39 @@
|
|
52 |
</product_not_assigned>
|
53 |
</faults>
|
54 |
</auguria_dolibarrapi_catalog_category>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
</resources>
|
56 |
</api>
|
57 |
</config>
|
52 |
</product_not_assigned>
|
53 |
</faults>
|
54 |
</auguria_dolibarrapi_catalog_category>
|
55 |
+
<auguria_dolibarrapi_catalog_product translate="title" module="catalog">
|
56 |
+
<title>Product API</title>
|
57 |
+
<model>auguria_dolibarrapi/catalog_product_api</model>
|
58 |
+
<acl>catalog/product</acl>
|
59 |
+
<methods>
|
60 |
+
<currentStore translate="title" module="catalog">
|
61 |
+
<title>Set/Get current store view</title>
|
62 |
+
</currentStore>
|
63 |
+
<list translate="title" module="catalog">
|
64 |
+
<title>Retrieve products list by filters</title>
|
65 |
+
<method>items</method>
|
66 |
+
<acl>catalog/product/info</acl>
|
67 |
+
</list>
|
68 |
+
<info translate="title" module="catalog">
|
69 |
+
<title>Retrieve product</title>
|
70 |
+
<acl>catalog/product/info</acl>
|
71 |
+
</info>
|
72 |
+
</methods>
|
73 |
+
<faults module="catalog">
|
74 |
+
<store_not_exists>
|
75 |
+
<code>100</code>
|
76 |
+
<message>Requested store view not found.</message>
|
77 |
+
</store_not_exists>
|
78 |
+
<not_exists>
|
79 |
+
<code>101</code>
|
80 |
+
<message>Product not exists.</message>
|
81 |
+
</not_exists>
|
82 |
+
<data_invalid>
|
83 |
+
<code>102</code>
|
84 |
+
<message>Invalid data given. Details in error message.</message>
|
85 |
+
</data_invalid>
|
86 |
+
</faults>
|
87 |
+
</auguria_dolibarrapi_catalog_product>
|
88 |
</resources>
|
89 |
</api>
|
90 |
</config>
|
app/code/community/Auguria/Dolibarrapi/etc/config.xml
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* @category Auguria
|
5 |
-
* @package Auguria_Dolibarrapi
|
6 |
-
* @author Anthony Poiret <anthony.poiret@auguria.net>
|
7 |
-
* @copyright Auguria - www.auguria.net
|
8 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
-
*/
|
10 |
-
-->
|
11 |
-
<config>
|
12 |
-
<modules>
|
13 |
-
<Auguria_Dolibarrapi>
|
14 |
-
<version>0.
|
15 |
-
</Auguria_Dolibarrapi>
|
16 |
-
</modules>
|
17 |
-
<global>
|
18 |
-
<models>
|
19 |
-
<auguria_dolibarrapi>
|
20 |
-
<class>Auguria_Dolibarrapi_Model</class>
|
21 |
-
</auguria_dolibarrapi>
|
22 |
-
</models>
|
23 |
-
<resources>
|
24 |
-
<auguria_dolibarrapi_setup>
|
25 |
-
<setup>
|
26 |
-
<module>Auguria_Dolibarrapi</module>
|
27 |
-
</setup>
|
28 |
-
<connection>
|
29 |
-
<use>core_setup</use>
|
30 |
-
</connection>
|
31 |
-
</auguria_dolibarrapi_setup>
|
32 |
-
<auguria_dolibarrapi_write>
|
33 |
-
<connection>
|
34 |
-
<use>core_write</use>
|
35 |
-
</connection>
|
36 |
-
</auguria_dolibarrapi_write>
|
37 |
-
<auguria_dolibarrapi_read>
|
38 |
-
<connection>
|
39 |
-
<use>core_read</use>
|
40 |
-
</connection>
|
41 |
-
</auguria_dolibarrapi_read>
|
42 |
-
</resources>
|
43 |
-
</global>
|
44 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Auguria
|
5 |
+
* @package Auguria_Dolibarrapi
|
6 |
+
* @author Anthony Poiret <anthony.poiret@auguria.net>
|
7 |
+
* @copyright Auguria - www.auguria.net
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Auguria_Dolibarrapi>
|
14 |
+
<version>1.0.0</version>
|
15 |
+
</Auguria_Dolibarrapi>
|
16 |
+
</modules>
|
17 |
+
<global>
|
18 |
+
<models>
|
19 |
+
<auguria_dolibarrapi>
|
20 |
+
<class>Auguria_Dolibarrapi_Model</class>
|
21 |
+
</auguria_dolibarrapi>
|
22 |
+
</models>
|
23 |
+
<resources>
|
24 |
+
<auguria_dolibarrapi_setup>
|
25 |
+
<setup>
|
26 |
+
<module>Auguria_Dolibarrapi</module>
|
27 |
+
</setup>
|
28 |
+
<connection>
|
29 |
+
<use>core_setup</use>
|
30 |
+
</connection>
|
31 |
+
</auguria_dolibarrapi_setup>
|
32 |
+
<auguria_dolibarrapi_write>
|
33 |
+
<connection>
|
34 |
+
<use>core_write</use>
|
35 |
+
</connection>
|
36 |
+
</auguria_dolibarrapi_write>
|
37 |
+
<auguria_dolibarrapi_read>
|
38 |
+
<connection>
|
39 |
+
<use>core_read</use>
|
40 |
+
</connection>
|
41 |
+
</auguria_dolibarrapi_read>
|
42 |
+
</resources>
|
43 |
+
</global>
|
44 |
+
</config>
|
package.xml
CHANGED
@@ -1,22 +1,24 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Auguria_Dolibarrapi</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>This extension
|
|
|
|
|
11 |

|
12 |
-
|
|
|
13 |

|
14 |
-
If
|
15 |
-
<
|
16 |
-
<
|
17 |
-
<
|
18 |
-
<
|
19 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Auguria_Dolibarrapi.xml" hash="d2154189d81bfa588e3d433e67abc2cc"/></dir></target><target name="magecommunity"><dir name="Auguria"><dir name="Dolibarrapi"><dir name="Model"><dir name="Catalog"><dir name="Category"><file name="Api.php" hash="5ba030b52ca8db93327ca2485183bb78"/></dir></dir></dir><dir name="etc"><file name="api.xml" hash="7611652215737e502f0468ee8f7cdd00"/><file name="config.xml" hash="84b278148bceee4cd314d372a488a0eb"/></dir></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Auguria_Dolibarrapi</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Override categories' and products' API to able data import from Magento to Dolibarr</summary>
|
10 |
+
<description>This extension provide features required to:
|
11 |
+
- import the products' category tree from a site to Dolibarr.
|
12 |
+
- get the tax rate of a product (due to Dolibarr constraints) from his tax group and default ones for customers and countries.
|
13 |

|
14 |
+
If the features offered by this Dolibarr's module awake your interest, feel free to have a look on Dolistore at http://www.dolistore.com/ where you will find much more informations.</description>
|
15 |
+
<notes>You need Dolibarr 3.0 and the Auguria's eCommerce module to make use of this extension.
|
16 |

|
17 |
+
If you have ideas for improvements or find bugs, please send them to Anthony Poiret at www.auguria.net, with Auguria LastReviews as part of the subject line.</notes>
|
18 |
+
<authors><author><name>Auguria</name><user>Auguria</user><email>magento@auguria.net</email></author></authors>
|
19 |
+
<date>2011-09-13</date>
|
20 |
+
<time>08:17:40</time>
|
21 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Auguria_Dolibarrapi.xml" hash="d2154189d81bfa588e3d433e67abc2cc"/></dir></target><target name="magecommunity"><dir name="Auguria"><dir name="Dolibarrapi"><dir name="Model"><dir name="Catalog"><dir name="Category"><file name="Api.php" hash="5ba030b52ca8db93327ca2485183bb78"/></dir><dir name="Product"><file name="Api.php" hash="a398752ae3185fabd86e468d6fb73740"/></dir></dir></dir><dir name="etc"><file name="api.xml" hash="5a961fb242d29cdd14fb7ea7ff1a9177"/><file name="config.xml" hash="486ae8f80d35ef946e78c784f0c69a0a"/></dir></dir></dir></target></contents>
|
|
|
22 |
<compatible/>
|
23 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
24 |
</package>
|