NewHavenSoftware_CMSAPI - Version 9.0.1.5

Version Notes

Added support for Amasty Order Attributes to custom fields

Download this release

Release Info

Developer Jason Morrison
Extension NewHavenSoftware_CMSAPI
Version 9.0.1.5
Comparing to
See all releases


Code changes from version 9.0.1.4 to 9.0.1.5

app/code/community/NewHavenSoftware/CMSAPI/Model/Custom/Api/V2.php CHANGED
@@ -8,18 +8,29 @@ class NewHavenSoftware_CMSAPI_Model_Custom_Api_V2 extends Mage_Api_Model_Resourc
8
  // comma separated list of section.fields for instance
9
  // ad_code,customer_number
10
  $fields = explode(',', $customFields);
 
11
  foreach ($fields as $field) {
12
  if (strpos($field,'=') !== false) {
13
  // we have a global assignment use this value
14
- $results = $results . $field . ',';
15
  } else {
 
 
16
  $object = Mage::getModel('sales/order')
17
  ->getCollection()
18
  ->addAttributeToFilter('state', array('neq' => Mage_Sales_Model_Order::STATE_CANCELED))
19
  ->addAttributeToFilter('increment_id', $orderIncrementId)
20
  ->getFirstItem();
21
  $objectValue = $object[$field];
22
- $results = $results . $field . "=" . $objectValue . ',';
 
 
 
 
 
 
 
 
23
  }
24
  }
25
 
8
  // comma separated list of section.fields for instance
9
  // ad_code,customer_number
10
  $fields = explode(',', $customFields);
11
+ $results .= json_encode(get_declared_classes()) . '|||';
12
  foreach ($fields as $field) {
13
  if (strpos($field,'=') !== false) {
14
  // we have a global assignment use this value
15
+ $results .= $field . ',';
16
  } else {
17
+
18
+
19
  $object = Mage::getModel('sales/order')
20
  ->getCollection()
21
  ->addAttributeToFilter('state', array('neq' => Mage_Sales_Model_Order::STATE_CANCELED))
22
  ->addAttributeToFilter('increment_id', $orderIncrementId)
23
  ->getFirstItem();
24
  $objectValue = $object[$field];
25
+ $results .= $field . "=" . $objectValue . ',';
26
+ // Amasty Order Attribute Support
27
+ if (class_exists("Amasty_Orderattr_Model_Sales_Order_Api")) {
28
+ $amastyApiV1 = new Amasty_Orderattr_Model_Sales_Order_Api;
29
+ $customAttributes = $amastyApiV1->info($orderIncrementId);
30
+ if (isset($customAttributes['custom'][$field])) {
31
+ $results .= $field . "=" . $customAttributes['custom'][$field] . ',';
32
+ }
33
+ }
34
  }
35
  }
36
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NewHavenSoftware_CMSAPI</name>
4
- <version>9.0.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -14,20 +14,11 @@ Adds the following to the v2 API:&#xD;
14
  &lt;/ol&gt;&#xD;
15
  &#xD;
16
  This extension is required for integration with the CMS eCMS module.</description>
17
- <notes>Removed unneeded module dependency. Added the ability to set global custom_field values.&#xD;
18
- &#xD;
19
- In addition to a comma delimited list of order fields. You can now add name=value in the Custom Fields list. These will be sent with every order. &#xD;
20
- &#xD;
21
- In CMS add a matching custom field plug-in option:&#xD;
22
- Name: CMS XML &lt;Order&gt; element name to store the data&#xD;
23
- Value: the custom field name specified in Magento&#xD;
24
- Type: Custom Field&#xD;
25
- &#xD;
26
- If no mapping plug-in option is found, the values will appear in the order notes.</notes>
27
  <authors><author><name>Jason Morrison</name><user>jmorrison</user><email>jmorrison@newhavensoftware.com</email></author></authors>
28
- <date>2013-06-28</date>
29
- <time>02:48:34</time>
30
- <contents><target name="magecommunity"><dir name="NewHavenSoftware"><dir name="CMSAPI"><dir name="Helper"><file name="Data.php" hash="ab4082fe27f7c6732a7f857fc326ec99"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="aad926da6a10b2c2de3c28abac0eaf52"/></dir></dir></dir><dir name="Check"><dir name="Api"><file name="V2.php" hash="c27fcf391dcf5ad7e0c86de44fd14e7c"/></dir></dir><dir name="Custom"><dir name="Api"><file name="V2.php" hash="c1fa022302bdc819ee59e14750ae18a5"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ba4c36dbd3d346c3561fb5822d5fd3b4"/><file name="api.xml" hash="d78c5d767a78b9b03be362c8ef895c98"/><file name="config.xml" hash="780d234cb167e08c7d26f10ceda84f3d"/><file name="system.xml" hash="ab6f7ba6be148634383f9e3a8f63e2cd"/><file name="wsdl.xml" hash="a0c5b11146e29e8bdfcea57ff53f8c4c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewHavenSoftware_CMSAPI.xml" hash="f858d97574f528dc237ad32e0e96ae73"/></dir></target></contents>
31
  <compatible/>
32
- <dependencies><required><php><min>5.2.0</min><max>5.4.12</max></php></required></dependencies>
33
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NewHavenSoftware_CMSAPI</name>
4
+ <version>9.0.1.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
14
  &lt;/ol&gt;&#xD;
15
  &#xD;
16
  This extension is required for integration with the CMS eCMS module.</description>
17
+ <notes>Added support for Amasty Order Attributes to custom fields</notes>
 
 
 
 
 
 
 
 
 
18
  <authors><author><name>Jason Morrison</name><user>jmorrison</user><email>jmorrison@newhavensoftware.com</email></author></authors>
19
+ <date>2013-08-12</date>
20
+ <time>19:05:26</time>
21
+ <contents><target name="magecommunity"><dir name="NewHavenSoftware"><dir name="CMSAPI"><dir name="Helper"><file name="Data.php" hash="ab4082fe27f7c6732a7f857fc326ec99"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="aad926da6a10b2c2de3c28abac0eaf52"/></dir></dir></dir><dir name="Check"><dir name="Api"><file name="V2.php" hash="c27fcf391dcf5ad7e0c86de44fd14e7c"/></dir></dir><dir name="Custom"><dir name="Api"><file name="V2.php" hash="780035209b78e55c49966656185d138e"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ba4c36dbd3d346c3561fb5822d5fd3b4"/><file name="api.xml" hash="d78c5d767a78b9b03be362c8ef895c98"/><file name="config.xml" hash="780d234cb167e08c7d26f10ceda84f3d"/><file name="system.xml" hash="ab6f7ba6be148634383f9e3a8f63e2cd"/><file name="wsdl.xml" hash="a0c5b11146e29e8bdfcea57ff53f8c4c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewHavenSoftware_CMSAPI.xml" hash="f858d97574f528dc237ad32e0e96ae73"/></dir></target></contents>
22
  <compatible/>
23
+ <dependencies><required><php><min>5.2.0</min><max>5.4.16</max></php></required></dependencies>
24
  </package>