Intelligent_Reach - Version 1.0.40

Version Notes

Stable release. Compatible with older versions. Feed creation has been optimized to handle larger loads. The option to choose the store is now available. Can retrieve associated products for grouped types.Bug fixes.Has support for PHP V5.2. Quantity script has now been added. Flat Catalog support has been added,

Download this release

Release Info

Developer Intelligent Reach
Extension Intelligent_Reach
Version 1.0.40
Comparing to
See all releases


Code changes from version 1.0.39 to 1.0.40

app/code/local/IntelligentReach/AmazonPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_AmazonPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_AmazonPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_AmazonPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_AmazonPayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/DebenhamsPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_DebenhamsPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_DebenhamsPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_DebenhamsPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_DebenhamsPayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/EbayPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_EbayPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_EbayPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_EbayPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_EbayPayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/Integration/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_Integration>
5
- <version>1.0.39</version>
6
  </IntelligentReach_Integration>
7
  </modules>
8
  <frontend>
2
  <config>
3
  <modules>
4
  <IntelligentReach_Integration>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_Integration>
7
  </modules>
8
  <frontend>
app/code/local/IntelligentReach/LazadaPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_LazadaPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_LazadaPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_LazadaPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_LazadaPayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/OrderExporter/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_OrderExporter>
5
- <version>1.0.39</version>
6
  </IntelligentReach_OrderExporter>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_OrderExporter>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_OrderExporter>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/PlayPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_PlayPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_PlayPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_PlayPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_PlayPayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/RakutenPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_RakutenPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_RakutenPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_RakutenPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_RakutenPayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/TradeMePayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_TradeMePayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_TradeMePayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_TradeMePayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_TradeMePayment>
7
  </modules>
8
  <global>
app/code/local/IntelligentReach/WestfieldPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <IntelligentReach_WestfieldPayment>
5
- <version>1.0.39</version>
6
  </IntelligentReach_WestfieldPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <IntelligentReach_WestfieldPayment>
5
+ <version>1.0.40</version>
6
  </IntelligentReach_WestfieldPayment>
7
  </modules>
8
  <global>
intelligentreach_integration.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /** Version 1.0.39 Last updated by Kire on 16/06/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  include_once 'app/Mage.php';
@@ -15,8 +15,8 @@ class IntelligentReach
15
  private $_splitby = 100;
16
  private $_amountOfProductsPerPage = 100;
17
  private $_lastPageNumber = 0;
18
- private $_versionNumber = "1.0.39";
19
- private $_lastUpdated = "16/06/2016";
20
 
21
  public function run()
22
  {
@@ -149,8 +149,7 @@ class IntelligentReach
149
  public function getProductCollection()
150
  {
151
  $products = Mage::getModel('catalog/product')->getCollection()
152
- ->addStoreFilter($_GET["storeid"])
153
- ->addAttributeToSelect('*');
154
  return $this->addAdditionalAttributeFilters($products);
155
  }
156
 
@@ -180,8 +179,8 @@ class IntelligentReach
180
  Mage::log('File: intelligentreach_integration.php, Error: There are no products to export at page '.$startPage.' when the amount of products per page is '. $this->_amountOfProductsPerPage);
181
  else
182
  {
183
- foreach($products as $product)
184
- $this->printProducts($product);
185
  }
186
  $startPage = $startPage + 1;
187
  unset($products);
@@ -189,11 +188,11 @@ class IntelligentReach
189
  }
190
  }
191
 
192
- public function printProducts($product)
193
  {
194
  $parentIds = null;
195
  $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
196
-
197
  if($product->getTypeId() == 'simple')
198
  {
199
  $parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId());
1
  <?php
2
 
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  include_once 'app/Mage.php';
15
  private $_splitby = 100;
16
  private $_amountOfProductsPerPage = 100;
17
  private $_lastPageNumber = 0;
18
+ private $_versionNumber = "1.0.40";
19
+ private $_lastUpdated = "27/07/2016";
20
 
21
  public function run()
22
  {
149
  public function getProductCollection()
150
  {
151
  $products = Mage::getModel('catalog/product')->getCollection()
152
+ ->addStoreFilter($_GET["storeid"]);
 
153
  return $this->addAdditionalAttributeFilters($products);
154
  }
155
 
179
  Mage::log('File: intelligentreach_integration.php, Error: There are no products to export at page '.$startPage.' when the amount of products per page is '. $this->_amountOfProductsPerPage);
180
  else
181
  {
182
+ Mage::getSingleton('core/resource_iterator')
183
+ ->walk($products->getSelect(), array(array($this, 'printProducts')),array('store_id' => $_GET["storeid"]));
184
  }
185
  $startPage = $startPage + 1;
186
  unset($products);
188
  }
189
  }
190
 
191
+ public function printProducts($args)
192
  {
193
  $parentIds = null;
194
  $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
195
+ $product = Mage::getModel('catalog/product')->load($args['row']['entity_id']);
196
  if($product->getTypeId() == 'simple')
197
  {
198
  $parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId());
intelligentreach_integration_opt.php ADDED
@@ -0,0 +1,451 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
+ ini_set('display_errors', 1);
5
+ ini_set('max_execution_time', 1800);
6
+ include_once 'app/Mage.php';
7
+ umask(0);
8
+ Mage::app();
9
+
10
+ $ir = new IntelligentReach();
11
+ $ir->run();
12
+
13
+ class IntelligentReach
14
+ {
15
+ private $_splitby = 100;
16
+ private $_amountOfProductsPerPage = 100;
17
+ private $_lastPageNumber = 0;
18
+ private $_versionNumber = "1.0.40";
19
+ private $_lastUpdated = "27/07/2016";
20
+
21
+ public function run()
22
+ {
23
+ // If a store id was provided then print the products to the output.
24
+ if ($this->storeIsSelected())
25
+ {
26
+ if (isset($_GET["splitby"]))
27
+ $this->_splitby = $_GET["splitby"];
28
+ if (isset($_GET["amountofproducts"]))
29
+ $this->_amountOfProductsPerPage = $_GET["amountofproducts"];
30
+ $this->_lastPageNumber = ceil($this->getProductCollection()->getSize() / $this->_amountOfProductsPerPage);
31
+
32
+ if ((isset($_GET["startingpage"]) && isset($_GET["endpage"])) || isset($_GET["getall"]))
33
+ {
34
+ header("Content-Type: text/xml; charset=UTF-8");
35
+ header("Cache-Control: no-cache, must-revalidate");
36
+ echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
37
+ <products version=\"$this->_versionNumber\" type=\"web_opt\">";
38
+ $this->runTheTask(isset($_GET["getall"]) ? 1 : $_GET["startingpage"], isset($_GET["getall"]) ? $this->_lastPageNumber : $_GET["endpage"]);
39
+ echo '</products>';
40
+ }
41
+ else
42
+ $this->printSections();
43
+ }
44
+ else
45
+ $this->printStores();
46
+ }
47
+
48
+ // Check if a storeid parameter has been set, returns a boolean.
49
+ public function storeIsSelected()
50
+ {
51
+ if (isset($_GET["storeid"]))
52
+ return true;
53
+ else
54
+ return false;
55
+ }
56
+
57
+ // Gets all the stores on all websites,
58
+ // returns a table containing Store Ids and Store Names.
59
+ public function getStores()
60
+ {
61
+ $websiteStores = Mage::app()->getStores();
62
+ echo "<table cellspacing='2px;' border='1px;' cellpadding='8px;'>";
63
+ echo "<tr><th>Store Id</th><th>Store Name</th></tr>";
64
+ foreach ($websiteStores as $store)
65
+ echo "<tr><td>" . $store->getId() . "</td><td><a href='?storeid=" . $store->getId() . "&splitby=100&amountofproducts=100'>" . $store->getName() . "</a></td></tr>";
66
+ echo "</table>";
67
+ }
68
+
69
+ public function printStores()
70
+ {
71
+ echo "<p>Sorry a Store Id was not provided, please choose a store from the options below.</p>";
72
+ $this->getStores();
73
+ echo "<p>If you want to skip this step in the future, you can manually enter the Store Id in the URL.<br />";
74
+ echo "e.g. http://www.exampledomain.com/intelligentreach_integration.php?storeid=1</p>";
75
+ echo "<p><strong>NB:</strong> The Store Id parameter name is case sensitive. Only use \"storeid=\" not another variation.</p>";
76
+ echo "<h5>Version $this->_versionNumber <br />Last updated on $this->_lastUpdated</h5></div>";
77
+ }
78
+
79
+ public function getSections($sections)
80
+ {
81
+ $convertNumberToWord = (isset($_GET["convertNumberToWord"])) ? "&convertNumberToWord=1" : "";
82
+ $stripInvalidChars = (isset($_GET["stripInvalidChars"])) ? "&stripInvalidChars=1" : "";
83
+ $includeAllParentFields = (isset($_GET["includeAllParentFields"])) ? "&includeAllParentFields=1" : "";
84
+ $includeDisabled = (isset($_GET["includeDisabled"])) ? "&includeDisabled=1" : "";
85
+ $includeNonSimpleProducts = (isset($_GET["includeNonSimpleProducts"])) ? "&includeNonSimpleProducts=1" : "";
86
+
87
+ $pages = $this->_lastPageNumber;
88
+ echo "<table cellspacing='2px;' border='1px;' cellpadding='8px;'>";
89
+ echo "<tr><th>Section</th><th>Pages</th></tr>";
90
+ for ($i = $sections; $i > 0; $i--)
91
+ {
92
+ $startingPage = $pages - $this->_splitby + 1;
93
+ if ($startingPage < 1)
94
+ $startingPage = 1;
95
+
96
+ echo "<tr><td><a href='?storeid=" . $_GET["storeid"] . "&startingpage=" . $startingPage . "&endpage=" . $pages . "&splitby=".$this->_splitby."&amountofproducts=".$this->_amountOfProductsPerPage.$convertNumberToWord.$stripInvalidChars.$includeAllParentFields.$includeDisabled.$includeNonSimpleProducts."'>" . $i . "</a></td><td>" . $startingPage . "-" . $pages . "</td></tr>";
97
+ $pages = $startingPage - 1;
98
+ }
99
+ echo "</table>";
100
+ }
101
+
102
+ public function printSections()
103
+ {
104
+ $sections = ceil($this->_lastPageNumber / $this->_splitby);
105
+ echo "<h2>Please select a section to return the products.</h2>";
106
+ echo "<div class='sections' style='float:left; padding-left:50px;'>";
107
+ $this->getSections($sections);
108
+ echo "</div>";
109
+ echo "<div class='instructions' style='float:left; padding-left:50px;'>";
110
+ echo "<h3>Instructions</h3>";
111
+ echo "<p>The parameter <strong>'splitby'</strong> in the URL splits pages into sections, each page contains (unless specified otherwise) the default amount of 100 products.</p>";
112
+ echo "<p>So setting <strong>'splitby'</strong> to equal 100 will bring back 1,000 products per page and 10,000 products per section, if there are 40,000 products in the store then this will return 4 sections. </p>";
113
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>splitby=100</strong></p>";
114
+ echo "<p>You can also set the value of the number of products per page that is returned, by setting the parameter <strong>'amountofproducts'</strong> in the URL</p>";
115
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&splitby=100&<strong>amountofproducts=100</strong></p>";
116
+ echo "<p><strong>NB:</strong> The default value for <strong>'splitby'</strong> is 100 and for <strong>'amountofproducts'</strong> is 100.</p>";
117
+ echo "<h3>Other options</h3>";
118
+ echo "<p>You can retrieve all products by using the <strong>'getall'</strong> parameter</p>";
119
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>getall=1</strong></p>";
120
+ echo "<p>To enable the stripping of invalid XML characters add the <strong>'stripInvalidChars'</strong> parameter</p>";
121
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>stripInvalidChars=1</strong></p>";
122
+ echo "<p>To enable the converting of the first character in the XML tag from a number to a word, use the <strong>'convertNumberToWord'</strong> parameter.</p>";
123
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>convertNumberToWord=1</strong></p>";
124
+ echo "<p>To return all the parent product fields, use the <strong>'includeAllParentFields'</strong> parameter.</p>";
125
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>includeAllParentFields=1</strong></p>";
126
+ echo "<p>To include disabled products in the feed, use the <strong>'includeDisabled'</strong> parameter.</p>";
127
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>includeDisabled=1</strong></p>";
128
+ echo "<p>To include products of all types in the feed, use the <strong>'includeNonSimpleProducts'</strong> parameter.</p>";
129
+ echo "<strong>e.g.</strong> http://www.exampledomain.com/intelligentreach_integration.php?storeid=1&<strong>includeNonSimpleProducts=1</strong></p>";
130
+ echo "</div>";
131
+ echo "<div style='float:left; padding-left:50px;'><h5>Version $this->_versionNumber <br />Last updated on $this->_lastUpdated</h5></div>";
132
+ }
133
+
134
+ // Gets all the products in the catalog in the specific store view,
135
+ // returns an array of products and their details.
136
+ public function getProducts($page)
137
+ {
138
+ if(isset($_GET["storeid"]))
139
+ Mage::app()->setCurrentStore($_GET["storeid"]);
140
+
141
+ $products = $this->getProductCollection();
142
+
143
+ $products->getSelect()
144
+ ->limit($this->_amountOfProductsPerPage,($page - 1) * $this->_amountOfProductsPerPage);
145
+
146
+ return $products;
147
+ }
148
+
149
+ public function getProductCollection()
150
+ {
151
+ $products = Mage::getModel('catalog/product')->getCollection()
152
+ ->addStoreFilter($_GET["storeid"])
153
+ ->addAttributeToSelect('*');
154
+ return $this->addAdditionalAttributeFilters($products);
155
+ }
156
+
157
+ public function addAdditionalAttributeFilters($products)
158
+ {
159
+ if(Mage::app()->getStore()->getConfig('catalog/frontend/flat_catalog_product'))
160
+ Mage::app()->getStore()->setConfig('catalog/frontend/flat_catalog_product', 0);
161
+
162
+ if(isset($_GET["includeDisabled"]))
163
+ $products->addAttributeToFilter('status', array('gt' => 0));
164
+ else
165
+ $products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
166
+
167
+ if(!isset($_GET["includeNonSimpleProducts"]))
168
+ $products->addAttributeToFilter('type_id', array('eq' => 'simple'));
169
+
170
+ return $products;
171
+ }
172
+
173
+ // Run the task
174
+ public function runTheTask($startPage, $endPage)
175
+ {
176
+ while ($startPage <= $endPage)
177
+ {
178
+ $products = $this->getProducts($startPage);
179
+ if ($products->count() == 0)
180
+ Mage::log('File: intelligentreach_integration.php, Error: There are no products to export at page '.$startPage.' when the amount of products per page is '. $this->_amountOfProductsPerPage);
181
+ else
182
+ {
183
+ foreach($products as $product)
184
+ $this->printProducts($product);
185
+ }
186
+ $startPage = $startPage + 1;
187
+ unset($products);
188
+ flush();
189
+ }
190
+ }
191
+
192
+ public function printProducts($product)
193
+ {
194
+ $parentIds = null;
195
+ $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
196
+
197
+ if($product->getTypeId() == 'simple')
198
+ {
199
+ $parentIds = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($product->getId());
200
+ if(!$parentIds)
201
+ $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
202
+ if(isset($parentIds[0]))
203
+ $parentProduct = Mage::getModel('catalog/product')->load($parentIds[0]);
204
+ }
205
+
206
+ if((($product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)
207
+ || ((isset($parentProduct)) && ($parentProduct->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)))
208
+ && !isset($_GET['includeDisabled']))
209
+ {
210
+ return;
211
+ }
212
+
213
+ echo'<product>';
214
+ foreach ($product->getData() as $key => $value)
215
+ {
216
+ if ($key !== 'stock_item')
217
+ {
218
+ if ($product->getResource()->getAttribute($key) != null)
219
+ $value = $product->getResource()->getAttribute($key)->getFrontend()->getValue($product);
220
+
221
+ if (($key == 'url_path') || ($key == 'url_key'))
222
+ $value = trim(str_replace('/intelligentreach_integration.php', '', $product->getProductUrl()));
223
+
224
+ if ($key == 'image')
225
+ $value = $baseUrl . "media/catalog/product" . $value;
226
+
227
+ if ($key == 'thumbnail')
228
+ $value = $baseUrl . "media/catalog/product" . $value;
229
+
230
+ if (($value == '') && (isset($parentProduct)))
231
+ {
232
+ $attr = $parentProduct->getResource()->getAttribute($key);
233
+ if (!is_object($attr))
234
+ continue;
235
+ $value = $attr->getFrontend()->getValue($parentProduct);
236
+ }
237
+
238
+ // Print out all media gallery images.
239
+ if($key == 'media_gallery')
240
+ {
241
+ for($i = 0; $i < count($value['images']); $i++)
242
+ echo " <image_".($i + 1)."><![CDATA[". $baseUrl . "media/catalog/product" . $value['images'][$i]['file']."]]></image_".($i + 1).">";
243
+ continue;
244
+ }
245
+ if($key == 'status')
246
+ {
247
+ if((isset($parentProduct)) && ($parentProduct->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED))
248
+ $value = "Disabled";
249
+ }
250
+
251
+ if($key == 'special_price')
252
+ {
253
+ $specialPriceEnabledValue = is_null($value) ? 0 : 1;
254
+ $fromDate = $product->getResource()->getAttribute('special_from_date')->getFrontend()->getValue($product);
255
+ $toDate = $product->getResource()->getAttribute('special_to_date')->getFrontend()->getValue($product);
256
+
257
+ if($fromDate != null)
258
+ $specialPriceEnabledValue = (strtotime($fromDate) <= strtotime(date('Y-m-d'))) ? 1 : 0;
259
+ if($toDate != null)
260
+ $specialPriceEnabledValue = (strtotime(date('Y-m-d')) <= strtotime($toDate)) ? 1 : 0;
261
+
262
+ echo "<special_price_enabled><![CDATA[".$specialPriceEnabledValue."]]></special_price_enabled>";
263
+ }
264
+
265
+ if(is_array($value))
266
+ {
267
+ foreach($value as $vkey => $vvalue)
268
+ {
269
+ foreach($vvalue as $pkey => $pvalue)
270
+ echo "<".$key."_".$vkey."_".$pkey."><![CDATA[".$pvalue."]]></".$key."_".$vkey."_".$pkey.">";
271
+ }
272
+ continue;
273
+ }
274
+
275
+ $value = $this->encodeValue($value);
276
+ $value = $this->stripInvalidXMLCharacters($value);
277
+
278
+ $value = "<![CDATA[$value]]>";
279
+
280
+ $key = str_replace('"', '', $key);
281
+ if(is_numeric($key[0]))
282
+ $key = $this->convertNumberToWord($key[0]).substr($key, 1);
283
+ echo '<' . $key . '>' . $value . '</' . $key . '>';
284
+ }
285
+ }
286
+
287
+ if(isset($parentProduct))
288
+ {
289
+ if(isset($_GET["includeAllParentFields"]))
290
+ $this->printAllParentFields($parentProduct);
291
+ else
292
+ {
293
+ echo '<ir_parent_entity_id><![CDATA['.$this->stripInvalidXMLCharacters($parentProduct->getId()).']]></ir_parent_entity_id>';
294
+ echo '<ir_parent_sku><![CDATA['.$this->stripInvalidXMLCharacters($parentProduct->getSku()).']]></ir_parent_sku>';
295
+ echo '<ir_parent_url><![CDATA[' . $this->stripInvalidXMLCharacters(trim(str_replace('/intelligentreach_integration.php', '', $parentProduct->getProductUrl()))) . ']]></ir_parent_url>';
296
+ echo '<ir_parent_image><![CDATA['.$this->stripInvalidXMLCharacters($baseUrl . 'media/catalog/product' . $parentProduct->getImage()).']]></ir_parent_image>';
297
+ echo '<ir_parent_description><![CDATA['.$this->stripInvalidXMLCharacters($this->encodeValue($parentProduct->getDescription())).']]></ir_parent_description>';
298
+ }
299
+ $gallery = $parentProduct->getMediaGallery();
300
+ if(count($gallery['images']) != 0)
301
+ {
302
+ for($i = 0; $i < count($gallery['images']); $i++)
303
+ echo " <ir_parent_image_".($i + 1)."><![CDATA[". $baseUrl . "media/catalog/product" . $gallery['images'][$i]['file']."]]></ir_parent_image_".($i + 1).">";
304
+ }
305
+ }
306
+
307
+ $categories = $product->getCategoryIds();
308
+ if((count($categories) == 0) && isset($parentProduct))
309
+ $categories = $parentProduct->getCategoryIds();
310
+ if(count($categories) == 0)
311
+ {
312
+ echo '</product>';
313
+ if (is_object($parentIds))
314
+ unset($parentIds);
315
+ unset($product);
316
+ return;
317
+ }
318
+ $category = Mage::getModel('catalog/category')->setStoreId($_GET["storeid"])->load($categories[0]);
319
+
320
+ /** Old Category Path code: will be deleted in the future. **/
321
+ $cat_parentCategories = array_reverse($category->getParentCategories(), true);
322
+ $output = "";
323
+
324
+ foreach ($cat_parentCategories as $parent)
325
+ {
326
+ $output .= $parent->getName();
327
+ if ($parent !== end($cat_parentCategories))
328
+ $output .= ' > ';
329
+ }
330
+ if($output != "")
331
+ echo '<category_path><![CDATA['.$output.']]></category_path>';
332
+ /** End of Old Category path code **/
333
+
334
+ /** New Category Path code **/
335
+ $pathIds = array_reverse(explode(",", $category->getPathInStore()), true);
336
+ $path = "";
337
+ foreach($pathIds as $pathId)
338
+ {
339
+ $path .= Mage::getModel('catalog/category')->setStoreId($_GET["storeid"])->load($pathId)->getName();
340
+ if($pathId != end($pathIds))
341
+ $path .= ' > ';
342
+ }
343
+ if($path != "")
344
+ echo '<ir_category_path><![CDATA['.$path.']]></ir_category_path>';
345
+ /** End of New Category Path code **/
346
+
347
+ /** New longest Category Path code **/
348
+ $validCategoryPaths = array();
349
+ $intelligent_reach_category_exclusions = Mage::getModel('core/variable')->setStoreId($_GET["storeid"])->loadByCode('intelligent_reach_category_exclusions')->getValue();
350
+ foreach($categories as $cat)
351
+ {
352
+ $category = Mage::getModel('catalog/category')->setStoreId($_GET["storeid"])->load($cat);
353
+ $pathIds = array_reverse(explode(",", $category->getPathInStore()), true);
354
+ $catpath = "";
355
+ foreach($pathIds as $pathId)
356
+ {
357
+ $catpath .= Mage::getModel('catalog/category')->setStoreId($_GET["storeid"])->load($pathId)->getName();
358
+ if($pathId != end($pathIds))
359
+ $catpath .= ' > ';
360
+ }
361
+ if($catpath != "")
362
+ {
363
+ if($intelligent_reach_category_exclusions != "")
364
+ {
365
+ if(preg_match('/('.$intelligent_reach_category_exclusions.')/i', $catpath) != true)
366
+ array_push($validCategoryPaths, $catpath);
367
+ }
368
+ else
369
+ array_push($validCategoryPaths, $catpath);
370
+ }
371
+ }
372
+ if(count($validCategoryPaths) != 0)
373
+ {
374
+ if(count($validCategoryPaths) > 1)
375
+ usort($validCategoryPaths, function ($a, $b) { return (strlen($a) < strlen($b)); });
376
+ echo "<ir_longest_category_path><![CDATA[".$validCategoryPaths[0]."]]></ir_longest_category_path>";
377
+ }
378
+ else if($path != "")
379
+ echo '<ir_longest_category_path><![CDATA['.$path.']]></ir_longest_category_path>';
380
+ /** End of New longest Category Path code **/
381
+
382
+ echo '</product>';
383
+ if (is_object($parentIds))
384
+ unset($parentIds);
385
+ unset($product);
386
+ }
387
+
388
+ public function printAllParentFields($parentProduct)
389
+ {
390
+ $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
391
+ foreach ($parentProduct->getData() as $key => $value)
392
+ {
393
+ if ($parentProduct->getResource()->getAttribute($key) != null)
394
+ $value = $parentProduct->getResource()->getAttribute($key)->getFrontend()->getValue($parentProduct);
395
+
396
+ if (($key == 'url_path') || ($key == 'url_key'))
397
+ $value = trim(str_replace('/intelligentreach_integration.php', '', $parentProduct->getProductUrl()));
398
+
399
+ if ($key == 'image')
400
+ $value = $baseUrl . "media/catalog/product" . $value;
401
+
402
+ if ($key == 'thumbnail')
403
+ $value = $baseUrl . "media/catalog/product" . $value;
404
+
405
+ if(is_array($value))
406
+ {
407
+ foreach($value as $vkey => $vvalue)
408
+ {
409
+ foreach($vvalue as $pkey => $pvalue)
410
+ echo "<".$key."_".$vkey."_".$pkey."><![CDATA[".$pvalue."]]></".$key."_".$vkey."_".$pkey.">";
411
+ }
412
+ continue;
413
+ }
414
+
415
+ $value = $this->encodeValue($value);
416
+ $value = $this->stripInvalidXMLCharacters($value);
417
+
418
+ $value = "<![CDATA[$value]]>";
419
+
420
+ $key = str_replace('"', '', $key);
421
+ if(is_numeric($key[0]))
422
+ $key = $this->convertNumberToWord($key[0]).substr($key, 1);
423
+ echo '<ir_parent_' . $key . '>' . $value . '</ir_parent_' . $key . '>';
424
+
425
+ }
426
+ }
427
+
428
+ public function stripInvalidXMLCharacters($value)
429
+ {
430
+ if(!isset($_GET["stripInvalidChars"]))
431
+ return $value;
432
+ return preg_replace("/[^A-Za-z0-9\d\!\"\$%^&*:;?'@~#{}|`()\\/.,_+=\-<>\s]/u", '', $value);
433
+ }
434
+
435
+ public function convertNumberToWord($number)
436
+ {
437
+ if(!isset($_GET["convertNumberToWord"]))
438
+ return $number;
439
+ $dictionary = array( 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine');
440
+ return $dictionary[$number];
441
+ }
442
+
443
+ public function encodeValue($value)
444
+ {
445
+ if(version_compare(PHP_VERSION, '5.4.0', '>='))
446
+ return htmlentities($value, ENT_COMPAT | ENT_SUBSTITUTE, "UTF-8");
447
+ else
448
+ return htmlentities($value, ENT_COMPAT, "UTF-8");
449
+ }
450
+ }
451
+
intelligentreach_integration_pre.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /** Version 1.0.39 Last updated by Kire on 16/06/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  include_once 'app/Mage.php';
@@ -15,8 +15,8 @@ class IntelligentReach
15
  private $_splitby = 100;
16
  private $_amountOfProductsPerPage = 100;
17
  private $_lastPageNumber = 0;
18
- private $_versionNumber = "1.0.39";
19
- private $_lastUpdated = "16/06/2016";
20
 
21
  public function run()
22
  {
1
  <?php
2
 
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  include_once 'app/Mage.php';
15
  private $_splitby = 100;
16
  private $_amountOfProductsPerPage = 100;
17
  private $_lastPageNumber = 0;
18
+ private $_versionNumber = "1.0.40";
19
+ private $_lastUpdated = "27/07/2016";
20
 
21
  public function run()
22
  {
intelligentreach_integration_qty.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /** Version 1.0.39 Last updated by Kire on 27/06/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  include_once 'app/Mage.php';
@@ -15,8 +15,8 @@ class IntelligentReach
15
  private $_splitby = 100;
16
  private $_amountOfProductsPerPage = 100;
17
  private $_lastPageNumber = 0;
18
- private $_versionNumber = "1.0.39";
19
- private $_lastUpdated = "27/06/2016";
20
 
21
  public function run()
22
  {
1
  <?php
2
 
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  include_once 'app/Mage.php';
15
  private $_splitby = 100;
16
  private $_amountOfProductsPerPage = 100;
17
  private $_lastPageNumber = 0;
18
+ private $_versionNumber = "1.0.40";
19
+ private $_lastUpdated = "27/07/2016";
20
 
21
  public function run()
22
  {
ircronscripts/intelligentreach_integration_cron.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /** Version 1.0.39 Last updated by Kire on 16/06/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  ini_set('memory_limit', '2G');
@@ -13,8 +13,8 @@ $ir->run();
13
 
14
  class IntelligentReach
15
  {
16
- private $_versionNumber = "1.0.39";
17
- private $_lastUpdated = "16/06/2016";
18
  private $_outputDirectory = "output";
19
  private $_fileName = "Feed";
20
  private $_fileNameTemp = "";
@@ -124,8 +124,7 @@ class IntelligentReach
124
  {
125
  $products = Mage::getModel('catalog/product')
126
  ->getCollection()
127
- ->addStoreFilter($storeId)
128
- ->addAttributeToSelect('*');
129
  return $this->addAdditionalAttributeFilters($products);
130
  }
131
 
@@ -183,7 +182,7 @@ class IntelligentReach
183
  $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
184
  $feedData = "";
185
 
186
- $product = Mage::getModel('catalog/product')->setData($args['row']);
187
  if ($product->getTypeId() == 'simple')
188
  {
189
  // use singleton saves re instantiating new model
1
  <?php
2
 
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  ini_set('memory_limit', '2G');
13
 
14
  class IntelligentReach
15
  {
16
+ private $_versionNumber = "1.0.40";
17
+ private $_lastUpdated = "27/07/2016";
18
  private $_outputDirectory = "output";
19
  private $_fileName = "Feed";
20
  private $_fileNameTemp = "";
124
  {
125
  $products = Mage::getModel('catalog/product')
126
  ->getCollection()
127
+ ->addStoreFilter($storeId);
 
128
  return $this->addAdditionalAttributeFilters($products);
129
  }
130
 
182
  $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
183
  $feedData = "";
184
 
185
+ $product = Mage::getModel('catalog/product')->load($args['row']['entity_id']);
186
  if ($product->getTypeId() == 'simple')
187
  {
188
  // use singleton saves re instantiating new model
ircronscripts/intelligentreach_integration_cron_opt.php ADDED
@@ -0,0 +1,526 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
+ ini_set('display_errors', 1);
5
+ ini_set('max_execution_time', 1800);
6
+ ini_set('memory_limit', '2G');
7
+ include_once '../app/Mage.php';
8
+ umask(0);
9
+ Mage::app();
10
+
11
+ $ir = new IntelligentReach();
12
+ $ir->run();
13
+
14
+ class IntelligentReach
15
+ {
16
+ private $_versionNumber = "1.0.40";
17
+ private $_lastUpdated = "27/07/2016";
18
+ private $_outputDirectory = "output";
19
+ private $_fileName = "Feed";
20
+ private $_fileNameTemp = "";
21
+ private $_amountOfProductsPerPage = 1000;
22
+ private $_categories = null;
23
+ private $_intelligentReachCategoryExclusions = null;
24
+ private $_parentProducts = array();
25
+
26
+ private $_gzipFile = true;
27
+ private $_includeAllParentFields = false;
28
+ private $_stripInvalidChars = false;
29
+ private $_convertNumberToWord = false;
30
+ private $_includeDisabled = false;
31
+ private $_includeNonSimpleProducts = false;
32
+
33
+ public function run()
34
+ {
35
+ $storeId = (isset($_GET["storeid"]))? $_GET["storeid"] : false;
36
+
37
+ // If a store id was provided then print the products to the output.
38
+ if ($this->storeIsSelected())
39
+ {
40
+ $this->_fileName = $this->_outputDirectory."/".$this->_fileName."_".$storeId.".xml"; // added store id to feed file name for multi store support.
41
+ $this->_fileNameTemp = tempnam("", $this->_fileName);
42
+ echo "Temp File created: ". $this->_fileNameTemp."<br />";
43
+ $time = microtime(true);
44
+ file_put_contents($this->_fileNameTemp, "<?xml version=\"1.0\" encoding=\"utf-8\"?>
45
+ <products version=\"$this->_versionNumber\" type=\"cron_opt\">", LOCK_EX);
46
+ $this->runTheTask($storeId);
47
+ file_put_contents($this->_fileNameTemp, '</products>', FILE_APPEND | LOCK_EX);
48
+
49
+ if (!file_exists($this->_outputDirectory))
50
+ mkdir($this->_outputDirectory);
51
+
52
+ file_put_contents($this->_fileName, file_get_contents($this->_fileNameTemp), LOCK_EX);
53
+ unlink($this->_fileNameTemp);
54
+ echo "Finished Generating Feed file: '".$this->_fileName."'";
55
+
56
+ if($this->_gzipFile)
57
+ $this->gzCompressFile($this->_fileName);
58
+
59
+ echo "<br />".((microtime(true) - $time))." secs";
60
+ echo "<br />".(memory_get_usage(true))." bytes";
61
+ }
62
+ else
63
+ $this->printStores();
64
+ }
65
+
66
+ // Check if a storeid parameter has been set, returns a boolean.
67
+ public function storeIsSelected()
68
+ {
69
+ if (isset($_GET["storeid"]))
70
+ return true;
71
+ else
72
+ return false;
73
+ }
74
+
75
+ // Gets all the stores on all websites,
76
+ // returns a table containing Store Ids and Store Names.
77
+ public function getStores()
78
+ {
79
+ $websiteStores = Mage::app()->getStores();
80
+ echo "<table cellspacing='2px;' border='1px;' cellpadding='8px;'>";
81
+ echo "<tr><th>Store Id</th><th>Store Name</th></tr>";
82
+ foreach ($websiteStores as $store)
83
+ echo "<tr><td>" . $store->getId() . "</td><td><a href='?storeid=" . $store->getId() . "'>" . $store->getName() . "</a></td></tr>";
84
+ echo "</table>";
85
+ }
86
+
87
+ public function printStores()
88
+ {
89
+ echo "<p>Sorry a Store Id was not provided, please choose a store from the options below.</p>";
90
+ $this->getStores();
91
+ echo "<p>If you want to skip this step in the future, you can manually enter the Store Id in the URL.<br />";
92
+ echo "e.g. http://www.exampledomain.com/intelligentreach_integration.php?storeid=1</p>";
93
+ echo "<p><strong>NB:</strong> The Store Id parameter name is case sensitive. Only use \"storeid=\" not another variation.</p>";
94
+ echo "<h3>Other options</h3>";
95
+ echo "<p>To enable the stripping of invalid XML characters set the <strong>'_stripInvalidChars'</strong> property to true</p>";
96
+ echo "<p>To enable the converting of the first character in the XML tag from a number to a word, set the <strong>'_convertNumberToWord'</strong> property to true.</p>";
97
+ echo "<p>To return all the parent product fields, set the <strong>'_includeAllParentFields'</strong> property to true.</p>";
98
+ echo "<p>To include disabled products in the feed, set the <strong>'_includeDisabled'</strong> property to true.</p>";
99
+ echo "<p>To include products of all types in the feed, set the <strong>'_includeNonSimpleProducts'</strong> property to true.</p>";
100
+ echo "<h5>Version $this->_versionNumber <br />Last updated on $this->_lastUpdated</h5></div>";
101
+ }
102
+
103
+ /**
104
+ * @param $page
105
+ * @param $storeId
106
+ * @return Mage_Catalog_Model_Resource_Product_Collection
107
+ */
108
+ public function getProducts($page,$storeId)
109
+ {
110
+ if($storeId)
111
+ Mage::app()->setCurrentStore($storeId);
112
+
113
+ $products = $this->getProductCollection($storeId);
114
+
115
+ // use limit otherwise resource iterator will ignore the page unless we load the collection first.
116
+ // previously this was loaded when count was called.
117
+ $products->getSelect()
118
+ ->limit($this->_amountOfProductsPerPage,($page - 1) * $this->_amountOfProductsPerPage);
119
+
120
+ return $products;
121
+ }
122
+
123
+ public function getProductCollection($storeId)
124
+ {
125
+ $products = Mage::getModel('catalog/product')
126
+ ->getCollection()
127
+ ->addStoreFilter($storeId)
128
+ ->addAttributeToSelect('*');
129
+ return $this->addAdditionalAttributeFilters($products);
130
+ }
131
+
132
+ public function addAdditionalAttributeFilters($products)
133
+ {
134
+ if(Mage::app()->getStore()->getConfig('catalog/frontend/flat_catalog_product') == 1)
135
+ Mage::app()->getStore()->setConfig('catalog/frontend/flat_catalog_product', 0);
136
+
137
+ if($this->_includeDisabled)
138
+ $products->addAttributeToFilter('status', array('gt' => 0));
139
+ else
140
+ $products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
141
+
142
+ if(!$this->_includeNonSimpleProducts)
143
+ $products->addAttributeToFilter('type_id', array('eq' => 'simple'));
144
+
145
+ return $products;
146
+ }
147
+
148
+ // Run the task
149
+ public function runTheTask($storeId)
150
+ {
151
+ // build category map
152
+ $this->_buildCategoryMap();
153
+ $currentPage = 1;
154
+ $lastPage = ceil($this->getProductCollection($storeId)->getSize() / $this->_amountOfProductsPerPage);
155
+
156
+ echo $lastPage. " pages <br />";
157
+ do{
158
+ $products = $this->getProducts($currentPage,$storeId);
159
+
160
+ echo "Starting page $currentPage of $lastPage ..";
161
+ Mage::getSingleton('core/resource_iterator')
162
+ ->walk($products->getSelect(), array(array($this, 'printProducts')),array('store_id' => $storeId));
163
+ $currentPage++;
164
+
165
+ $products->clear();
166
+ unset($products);
167
+
168
+ foreach($this->_parentProducts as $parentProduct)
169
+ $parentProduct->clearInstance();
170
+
171
+ $this->_parentProducts = array(); // clear parent products
172
+ ob_flush();
173
+ flush();
174
+ echo " ".(memory_get_usage(true))." bytes ";
175
+ echo ".. Finished (ok) <br />";
176
+
177
+ }while($currentPage <= $lastPage);
178
+ }
179
+
180
+ public function printProducts($args)
181
+ {
182
+ $parentIds = null;
183
+ $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
184
+ $feedData = "";
185
+
186
+ $product = Mage::getModel('catalog/product')->setData($args['row']);
187
+ if ($product->getTypeId() == 'simple')
188
+ {
189
+ // use singleton saves re instantiating new model
190
+ $parentIds = Mage::getSingleton('catalog/product_type_grouped')->getParentIdsByChild($product->getId());
191
+ if (!$parentIds)
192
+ $parentIds = Mage::getSingleton('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
193
+ if (isset($parentIds[0]))
194
+ $parentProduct = $this->getParentProduct($parentIds[0]);// use already loaded parent if available
195
+ }
196
+
197
+ if((($product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)
198
+ || ((isset($parentProduct)) && ($parentProduct->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)))
199
+ && !$this->_includeDisabled)
200
+ {
201
+ return;
202
+ }
203
+
204
+ $feedData .= '<product>';
205
+ foreach ($product->getData() as $key => $value)
206
+ {
207
+ if ($key !== 'stock_item')
208
+ {
209
+ if ($product->getResource()->getAttribute($key) != null)
210
+ $value = $product->getResource()->getAttribute($key)->getFrontend()->getValue($product);
211
+
212
+ if (($key == 'url_path') || ($key == 'url_key'))
213
+ $value = trim(str_replace('/intelligentreach_integration.php', '', $product->getProductUrl()));
214
+
215
+ if ($key == 'image')
216
+ $value = $baseUrl . "media/catalog/product" . $value;
217
+
218
+ if ($key == 'thumbnail')
219
+ $value = $baseUrl . "media/catalog/product" . $value;
220
+
221
+ if (($value == '') && (isset($parentProduct)))
222
+ {
223
+ $attr = $parentProduct->getResource()->getAttribute($key);
224
+ if (!is_object($attr))
225
+ continue;
226
+ $value = $attr->getFrontend()->getValue($parentProduct);
227
+ }
228
+ // Print out all media gallery images.
229
+ if($key == 'media_gallery')
230
+ {
231
+ for($i = 0; $i < count($value['images']); $i++)
232
+ $feedData .= " <image_".($i + 1)."><![CDATA[". $baseUrl . "media/catalog/product" . $value['images'][$i]['file']."]]></image_".($i + 1).">";
233
+ continue;
234
+ }
235
+ if($key == 'status')
236
+ {
237
+ if((isset($parentProduct)) && ($parentProduct->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED))
238
+ $value = "Disabled";
239
+ }
240
+ if($key == 'special_price')
241
+ {
242
+ $specialPriceEnabledValue = is_null($value) ? 0 : 1;
243
+ $fromDate = $product->getResource()->getAttribute('special_from_date')->getFrontend()->getValue($product);
244
+ $toDate = $product->getResource()->getAttribute('special_to_date')->getFrontend()->getValue($product);
245
+
246
+ if($fromDate != null)
247
+ $specialPriceEnabledValue = (strtotime($fromDate) <= strtotime(date('Y-m-d'))) ? 1 : 0;
248
+ if($toDate != null)
249
+ $specialPriceEnabledValue = (strtotime(date('Y-m-d')) <= strtotime($toDate)) ? 1 : 0;
250
+
251
+ $feedData .= "<special_price_enabled><![CDATA[".$specialPriceEnabledValue."]]></special_price_enabled>";
252
+ }
253
+ if(is_array($value))
254
+ {
255
+ foreach($value as $vkey => $vvalue)
256
+ {
257
+ foreach($vvalue as $pkey => $pvalue)
258
+ $feedData .= "<".$key."_".$vkey."_".$pkey."><![CDATA[".$pvalue."]]></".$key."_".$vkey."_".$pkey.">";
259
+ }
260
+ continue;
261
+ }
262
+
263
+ $value = $this->encodeValue($value);
264
+ $value = $this->stripInvalidXMLCharacters($value);
265
+ $value = "<![CDATA[$value]]>";
266
+
267
+ $key = str_replace('"', '', $key);
268
+ if(is_numeric($key[0]))
269
+ $key = $this->convertNumberToWord($key[0]).substr($key, 1);
270
+ $feedData .= '<' . $key . '>' . $value . '</' . $key . '>';
271
+ }
272
+ }
273
+
274
+ if(isset($parentProduct))
275
+ {
276
+ if($this->_includeAllParentFields)
277
+ {
278
+ file_put_contents($this->_fileNameTemp, $feedData, FILE_APPEND | LOCK_EX);
279
+ $feedData = "";
280
+ $this->printAllParentFields($parentProduct);
281
+ }
282
+ else
283
+ {
284
+ $feedData .= '<ir_parent_entity_id><![CDATA['.$this->stripInvalidXMLCharacters($parentProduct->getId()).']]></ir_parent_entity_id>';
285
+ $feedData .= '<ir_parent_sku><![CDATA['.$this->stripInvalidXMLCharacters($parentProduct->getSku()).']]></ir_parent_sku>';
286
+ $feedData .= '<ir_parent_url><![CDATA[' . $this->stripInvalidXMLCharacters(trim(str_replace('/intelligentreach_integration.php', '', $parentProduct->getProductUrl()))) . ']]></ir_parent_url>';
287
+ $feedData .= '<ir_parent_image><![CDATA['.$this->stripInvalidXMLCharacters($baseUrl . 'media/catalog/product' . $parentProduct->getImage()).']]></ir_parent_image>';
288
+ $feedData .= '<ir_parent_description><![CDATA['.$this->stripInvalidXMLCharacters($this->encodeValue($parentProduct->getDescription())).']]></ir_parent_description>';
289
+ }
290
+ $gallery = $parentProduct->getMediaGallery();
291
+ if(count($gallery['images']) != 0)
292
+ {
293
+ for($i = 0; $i < count($gallery['images']); $i++)
294
+ $feedData .= " <ir_parent_image_".($i + 1)."><![CDATA[". $baseUrl . "media/catalog/product" . $gallery['images'][$i]['file']."]]></ir_parent_image_".($i + 1).">";
295
+ }
296
+ $feedData .= $this->getCategoryData($product,$args['store_id'],$parentProduct);
297
+ }
298
+
299
+ $feedData .= '</product>'.PHP_EOL;
300
+ if (is_object($parentIds))
301
+ unset($parentIds);
302
+
303
+ $product->clearInstance(); // unset by itself doesn't clear some variables you need to let the model handle this itself
304
+ unset($product);
305
+ file_put_contents($this->_fileNameTemp, $feedData, FILE_APPEND | LOCK_EX);
306
+ }
307
+
308
+ private function _buildCategoryMap()
309
+ {
310
+ $categories = Mage::getModel('catalog/category')
311
+ ->getCollection()
312
+ ->addAttributeToSelect("level", "path", "entity_id")
313
+ ->addNameToResult()
314
+ ->addOrder("level");
315
+
316
+ $categories->setPageSize(100);
317
+
318
+ $lastPageNumber = $categories->getLastPageNumber();
319
+ $currentPage = 1;
320
+ do{
321
+ $categories->setCurPage($currentPage);
322
+ foreach($categories as $category)
323
+ {
324
+ $this->_categories[$category->getId()] =
325
+ array(
326
+ "name" => $category->getName(),
327
+ "path_in_store" => $category->getPathInStore()
328
+ );
329
+ $category->getName();
330
+ }
331
+
332
+ $categories->clear();
333
+ $currentPage++;
334
+
335
+ }while($currentPage <= $lastPageNumber);
336
+ return $this->_categories;
337
+ }
338
+
339
+ public function getCategoryData($product, $storeId, $parentProduct)
340
+ {
341
+ $feedData = '';
342
+ $categories = $product->getCategoryIds();
343
+
344
+ if((count($categories) == 0) && isset($parentProduct))
345
+ $categories = $parentProduct->getCategoryIds();
346
+ if((count($categories) == 0) || !isset($this->_categories[$categories[0]]))
347
+ return;
348
+
349
+ $categoryData = $this->_categories[$categories[0]];
350
+ $parentCategories = array_reverse(explode(',',$categoryData['path_in_store']));
351
+
352
+ $output = '';
353
+ foreach($parentCategories as $parent)
354
+ {
355
+ if(isset($this->_categories[$parent]))
356
+ {
357
+ $output .= $this->_categories[$parent]['name'];
358
+ if($parent !== end($parentCategories))
359
+ $output .= ' > ';
360
+ }
361
+ }
362
+
363
+ if($output != "")
364
+ {
365
+ /** Old Category Path code: will be deleted in the future. **/
366
+ $feedData .= '<category_path><![CDATA[' . $output . ']]></category_path>';
367
+ /** End of Old Category path code **/
368
+ /** New Category Path code **/
369
+ $feedData .= '<ir_category_path><![CDATA['.$output.']]></ir_category_path>';
370
+ /** End of New Category Path code **/
371
+ }
372
+
373
+ /** New longest Category Path code **/
374
+ $validCategoryPaths = array();
375
+ $catPath = '';
376
+ foreach($categories as $cat)
377
+ {
378
+ if(isset($this->_categories[$cat]))
379
+ {
380
+ $catPath .= $this->_categories[$cat]['name'];
381
+ if ($cat !== end($categories))
382
+ $catPath .= ' > ';
383
+ }
384
+ if($catPath != "")
385
+ {
386
+ if($this->getIntelligentReachCategoryExclusions($storeId) != "")
387
+ {
388
+ if(preg_match('/('.$this->getIntelligentReachCategoryExclusions($storeId).')/i', $catPath) != true)
389
+ array_push($validCategoryPaths, $catPath);
390
+ }
391
+ else
392
+ array_push($validCategoryPaths, $catPath);
393
+ }
394
+ }
395
+
396
+ if(count($validCategoryPaths) != 0)
397
+ {
398
+ if(count($validCategoryPaths) > 1)
399
+ usort($validCategoryPaths, function ($a, $b) { return (strlen($a) < strlen($b)); });
400
+ $feedData .= "<ir_longest_category_path><![CDATA[".$validCategoryPaths[0]."]]></ir_longest_category_path>";
401
+ }
402
+ else if($output != "")
403
+ $feedData .= '<ir_longest_category_path><![CDATA['.$output.']]></ir_longest_category_path>';
404
+
405
+ /** End of New longest Category Path code **/
406
+
407
+ return $feedData;
408
+ }
409
+
410
+ public function getIntelligentReachCategoryExclusions($storeId)
411
+ {
412
+ if($this->_intelligentReachCategoryExclusions == null)
413
+ {
414
+ $this->_intelligentReachCategoryExclusions = Mage::getModel('core/variable')
415
+ ->setStoreId($storeId)
416
+ ->loadByCode('intelligent_reach_category_exclusions')
417
+ ->getValue();
418
+ }
419
+ return $this->_intelligentReachCategoryExclusions;
420
+ }
421
+
422
+ public function printAllParentFields($parentProduct)
423
+ {
424
+ $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
425
+ $parentFeedData = "";
426
+ foreach ($parentProduct->getData() as $key => $value)
427
+ {
428
+ if ($parentProduct->getResource()->getAttribute($key) != null)
429
+ $value = $parentProduct->getResource()->getAttribute($key)->getFrontend()->getValue($parentProduct);
430
+
431
+ if (($key == 'url_path') || ($key == 'url_key'))
432
+ $value = trim(str_replace('/intelligentreach_integration.php', '', $parentProduct->getProductUrl()));
433
+
434
+ if ($key == 'image')
435
+ $value = $baseUrl . "media/catalog/product" . $value;
436
+
437
+ if ($key == 'thumbnail')
438
+ $value = $baseUrl . "media/catalog/product" . $value;
439
+
440
+ if(is_array($value))
441
+ {
442
+ foreach($value as $vkey => $vvalue)
443
+ {
444
+ foreach($vvalue as $pkey => $pvalue)
445
+ $parentFeedData .= "<".$key."_".$vkey."_".$pkey."><![CDATA[".$pvalue."]]></".$key."_".$vkey."_".$pkey.">";
446
+ }
447
+ continue;
448
+ }
449
+ $value = $this->encodeValue($value);
450
+ $value = $this->stripInvalidXMLCharacters($value);
451
+
452
+ $value = "<![CDATA[$value]]>";
453
+
454
+ $key = str_replace('"', '', $key);
455
+ if(is_numeric($key[0]))
456
+ $key = $this->convertNumberToWord($key[0]).substr($key, 1);
457
+ $parentFeedData .= '<ir_parent_' . $key . '>' . $value . '</ir_parent_' . $key . '>';
458
+ }
459
+ file_put_contents($this->_fileNameTemp, $parentFeedData, FILE_APPEND | LOCK_EX);
460
+ }
461
+
462
+ public function stripInvalidXMLCharacters($value)
463
+ {
464
+ if(!$this->_stripInvalidChars)
465
+ return $value;
466
+ return preg_replace("/[^A-Za-z0-9\d\!\"\$%^&*:;?'@~#{}|`()\\/.,_+=\-<>\s]/u", '', $value);
467
+ }
468
+
469
+ public function getParentProduct($parentId)
470
+ {
471
+ if(!isset($this->_parentProducts[$parentId]))
472
+ $this->_parentProducts[$parentId] = Mage::getModel('catalog/product')->load($parentId);
473
+ return $this->_parentProducts[$parentId];
474
+ }
475
+
476
+ public function convertNumberToWord($number)
477
+ {
478
+ if(!$this->_convertNumberToWord)
479
+ return $number;
480
+ $dictionary = array( 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine');
481
+ return $dictionary[$number];
482
+ }
483
+
484
+ public function encodeValue($value)
485
+ {
486
+ if(version_compare(PHP_VERSION, '5.4.0', '>='))
487
+ return htmlentities($value, ENT_COMPAT | ENT_SUBSTITUTE, "UTF-8");
488
+ else
489
+ return htmlentities($value, ENT_COMPAT, "UTF-8");
490
+ }
491
+
492
+ /**
493
+ * GZIPs a file on disk (appending .gz to the name)
494
+ *
495
+ * From http://stackoverflow.com/questions/6073397/how-do-you-create-a-gz-file-using-php
496
+ * Based on function by Kioob at:
497
+ * http://www.php.net/manual/en/function.gzwrite.php#34955
498
+ *
499
+ * @param string $source Path to file that should be compressed
500
+ * @param integer $level GZIP compression level (default: 9)
501
+ * @return string New filename (with .gz appended) if success, or false if operation fails
502
+ */
503
+ public function gzCompressFile($source, $level = 9)
504
+ {
505
+ $dest = $source . '.gz';
506
+ $mode = 'wb' . $level;
507
+ $error = false;
508
+ if ($fp_out = gzopen($dest, $mode)) {
509
+ if ($fp_in = fopen($source,'rb')) {
510
+ while (!feof($fp_in))
511
+ gzwrite($fp_out, fread($fp_in, 1024 * 512));
512
+ fclose($fp_in);
513
+ } else {
514
+ $error = true;
515
+ }
516
+ gzclose($fp_out);
517
+ } else {
518
+ $error = true;
519
+ }
520
+ if ($error)
521
+ return false;
522
+ else
523
+ return $dest;
524
+ }
525
+ }
526
+
ircronscripts/intelligentreach_integration_cron_pre.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /** Version 1.0.39 Last updated by Kire on 16/06/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  ini_set('memory_limit', '2G');
@@ -13,8 +13,8 @@ $ir->run();
13
 
14
  class IntelligentReach
15
  {
16
- private $_versionNumber = "1.0.39";
17
- private $_lastUpdated = "16/06/2016";
18
  private $_outputDirectory = "output";
19
  private $_fileName = "Feed";
20
  private $_fileNameTemp = "";
1
  <?php
2
 
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  ini_set('memory_limit', '2G');
13
 
14
  class IntelligentReach
15
  {
16
+ private $_versionNumber = "1.0.40";
17
+ private $_lastUpdated = "27/07/2016";
18
  private $_outputDirectory = "output";
19
  private $_fileName = "Feed";
20
  private $_fileNameTemp = "";
ircronscripts/intelligentreach_integration_cron_qty_price.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /** Version 1.0.39 Last updated by Kire on 27/06/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  ini_set('memory_limit', '2G');
@@ -13,8 +13,8 @@ $ir->run();
13
 
14
  class IntelligentReach
15
  {
16
- private $_versionNumber = "1.0.39";
17
- private $_lastUpdated = "27/06/2016";
18
  private $_outputDirectory = "output";
19
  private $_fileName = "Feed_Quantity_And_Price";
20
  private $_fileNameTemp = "";
1
  <?php
2
 
3
+ /** Version 1.0.40 Last updated by Kire on 27/07/2016 **/
4
  ini_set('display_errors', 1);
5
  ini_set('max_execution_time', 1800);
6
  ini_set('memory_limit', '2G');
13
 
14
  class IntelligentReach
15
  {
16
+ private $_versionNumber = "1.0.40";
17
+ private $_lastUpdated = "27/07/2016";
18
  private $_outputDirectory = "output";
19
  private $_fileName = "Feed_Quantity_And_Price";
20
  private $_fileNameTemp = "";
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Intelligent_Reach</name>
4
- <version>1.0.39</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL</license>
7
  <channel>community</channel>
@@ -17,9 +17,9 @@ Intelligent reach also offers advanced insight and trading services; whilst ensu
17
  Contact us to arrange a free E-commerce therapy session. Get advice about e-privacy compliance, tag management, analytics or BI implementations and Data quality as well as any key pain points or challenges which are hampering your growth.</description>
18
  <notes>Stable release. Compatible with older versions. Feed creation has been optimized to handle larger loads. The option to choose the store is now available. Can retrieve associated products for grouped types.Bug fixes.Has support for PHP V5.2. Quantity script has now been added. Flat Catalog support has been added,</notes>
19
  <authors><author><name>Intelligent Reach</name><user>IR</user><email>development@intelligentreach.com</email></author></authors>
20
- <date>2016-06-27</date>
21
- <time>14:19:27</time>
22
- <contents><target name="mage"><dir name="."><file name="intelligentreach_integration.php" hash="db1ddd94732b19fa9b2403faf7415452"/><file name="intelligentreach_integration_qty.php" hash="2620ab595bf2a3a0c2561c706558e2fa"/><file name="intelligentreach_integration_pre.php" hash="aaf2534548c884cfd02c1ffbd76ffc2a"/></dir><dir><dir name="app"><dir name="etc"><dir name="modules"><file name="IntelligentReach_Integration.xml" hash="6cdd19a11572e7073dbb3d746b6b57b6"/><file name="IntelligentReach_AmazonPayment.xml" hash="10faf651f19ea2298217be1a95707b7c"/><file name="IntelligentReach_EbayPayment.xml" hash="eb9acbd1b55da29e10b09981f0b7af8f"/><file name="IntelligentReach_DebenhamsPayment.xml" hash="649e25d5edf93ea84ce0a35240441ecb"/><file name="IntelligentReach_LazadaPayment.xml" hash="74ebd9f7bab6023049128e6de012b52c"/><file name="IntelligentReach_PlayPayment.xml" hash="c711e18f9a79c24bcddce4143ffb6fb6"/><file name="IntelligentReach_RakutenPayment.xml" hash="d70ce1efcf60b29ecc02fcea8df1f7e9"/><file name="IntelligentReach_TradeMePayment.xml" hash="367154d17430c1000c3798454be25dcb"/><file name="IntelligentReach_WestfieldPayment.xml" hash="b0ae5878bb26f86674ce88a50876496b"/><file name="IntelligentReach_OrderExporter.xml" hash="004c82baa9638e0fb23cc75f783b56e1"/></dir></dir><dir name="code"><dir name="local"><dir name="IntelligentReach"><dir name="Integration"><dir name="etc"><file name="config.xml" hash="bf61e941cc7404978de4d84d5ff7a63e"/></dir></dir><dir name="AmazonPayment"><dir name="etc"><file name="config.xml" hash="071fb81f54c2ebe4596eccdb3a0c3c68"/><file name="system.xml" hash="7b236978b8022dc4deda628640ea8689"/></dir><dir name="Helper"><file name="Data.php" hash="2e4ef89b210d0f992cd25b8ef5f4b96e"/></dir><dir name="Model"><file name="Pay.php" hash="4f706307986b9cd0f7cb64f69402cbd5"/></dir></dir><dir name="EbayPayment"><dir name="etc"><file name="config.xml" hash="69831d26f75c0d3f9d2962f02ce00f36"/><file name="system.xml" hash="7246fbf64d238328f74bd6445cc05b29"/></dir><dir name="Helper"><file name="Data.php" hash="0e112e22a4786f3624216628dee796a0"/></dir><dir name="Model"><file name="Pay.php" hash="9195dd4e2dbdeae9170220d78efc9f7b"/></dir></dir><dir name="DebenhamsPayment"><dir name="etc"><file name="config.xml" hash="bea77abb889227127069d16b18944773"/><file name="system.xml" hash="fab15158ef26748821326174ca9d91eb"/></dir><dir name="Helper"><file name="Data.php" hash="24e03a8fb06b27480aae4e37f2dc54d8"/></dir><dir name="Model"><file name="Pay.php" hash="45162537d76f8c9e9ccc1ec493c59691"/></dir></dir><dir name="LazadaPayment"><dir name="etc"><file name="config.xml" hash="7cf0c3806eb70da5811936c607f29f2b"/><file name="system.xml" hash="bf34e8ec60287c727d8221163f436c9c"/></dir><dir name="Helper"><file name="Data.php" hash="7eee4edb781ab93817979b61f314787f"/></dir><dir name="Model"><file name="Pay.php" hash="d52eafb63ab3bad2a390e2f83ebfab6e"/></dir></dir><dir name="PlayPayment"><dir name="etc"><file name="config.xml" hash="d8fd914036e68e021f87d2f39a2f2211"/><file name="system.xml" hash="4afb9b545ca22d4043b0606222d734a6"/></dir><dir name="Helper"><file name="Data.php" hash="486d43158da7188608eb07d3c9e45845"/></dir><dir name="Model"><file name="Pay.php" hash="78432762a0020455de623fbe79166045"/></dir></dir><dir name="RakutenPayment"><dir name="etc"><file name="config.xml" hash="4c45fecaf9ae4629ffb9ff06fe04dc3c"/><file name="system.xml" hash="6c19c11b0ad20305d3dd705a0e3f71b9"/></dir><dir name="Helper"><file name="Data.php" hash="87cc7e597d4f70a26911c861358d5695"/></dir><dir name="Model"><file name="Pay.php" hash="b52e5cb4fdb78db91c23bc929e8a70eb"/></dir></dir><dir name="TradeMePayment"><dir name="etc"><file name="config.xml" hash="a76546eebd601e34590ea38e40835e60"/><file name="system.xml" hash="98893010b7a44f27611421780a09cd6a"/></dir><dir name="Helper"><file name="Data.php" hash="b789a1164f2296882e81d4dced4897a0"/></dir><dir name="Model"><file name="Pay.php" hash="74ba42a1af907d6159fcd8c507d533de"/></dir></dir><dir name="WestfieldPayment"><dir name="etc"><file name="config.xml" hash="8040b6b2c001d39270de487a82232882"/><file name="system.xml" hash="de52dce1e16aaa20f62253a4a22f419f"/></dir><dir name="Helper"><file name="Data.php" hash="1d1fcc723fc60d73b004173094a8499e"/></dir><dir name="Model"><file name="Pay.php" hash="d398e69f34d1b7b4105d264eccf01799"/></dir></dir><dir name="OrderExporter"><dir name="etc"><file name="api.xml" hash="aee4a0fdb16e1e6b24de0f1b9bb3da99"/><file name="config.xml" hash="24eebaae577ce1bae2a5f71a4afc79a5"/><file name="system.xml" hash="6e41cdc209a85975879947a78bda24b2"/><file name="wsdl.xml" hash="a7361499844f83df32d923322633bab1"/><file name="wsi.xml" hash="a106a60efb3b7e50d3239343311e5a50"/></dir><dir name="Model"><file name="Carrier.php" hash="723819e51c4e1a644cc3de48dcac54c6"/><dir name="Cart"><file name="Api.php" hash="50339620188a9187ecd0afa6ede3fda7"/><dir name="Api"><file name="V2.php" hash="1703584c45f0eabc93b75b7814a970b9"/></dir><dir name="Shipping"><file name="Api.php" hash="547829c7eb8d0c22a4a13e5a8df2a2a3"/><dir name="Api"><file name="V2.php" hash="ebd0fc61544ddcf8a7dc8c5fece6ada5"/></dir></dir><dir name="Product"><file name="Api.php" hash="25f9320923ed59266fb55bba645a2cf1"/><dir name="Api"><file name="V2.php" hash="74912462ca1d3bab41381c4d1a489091"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="7891ef0dc09150b7dda42e7f67e14584"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4ef41fb017e9d210521d42cff2b43dd0"/></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="intelligentreach_integration.xml" hash="c45eb729e1e4b5025b25c20ac2723eeb"/></dir><dir name="template"><dir name="intelligentreach_integration"><file name="intelligentreach_integration.phtml" hash="cfcf6e1c2de50fa66258a820fb296775"/><dir name="product"><file name="intelligentreach_integration.phtml" hash="0d1f3ce4a57d977d8955176b01e2f87d"/></dir><dir name="basket"><file name="intelligentreach_integration.phtml" hash="983743acab4cd1c2819ea4fb6eebe0b5"/></dir><dir name="checkout"><dir name="onepage"><file name="intelligentreach_integration.phtml" hash="dfcfe625fadaf06fb3b069cb9257b4cc"/></dir><dir name="multishipping"><file name="intelligentreach_integration.phtml" hash="206d1fe72ab530829ca274fd52e90108"/></dir></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="intelligentreach_integration.xml" hash="c45eb729e1e4b5025b25c20ac2723eeb"/></dir><dir name="template"><dir name="intelligentreach_integration"><file name="intelligentreach_integration.phtml" hash="cfcf6e1c2de50fa66258a820fb296775"/><dir name="product"><file name="intelligentreach_integration.phtml" hash="0d1f3ce4a57d977d8955176b01e2f87d"/></dir><dir name="basket"><file name="intelligentreach_integration.phtml" hash="983743acab4cd1c2819ea4fb6eebe0b5"/></dir><dir name="checkout"><dir name="onepage"><file name="intelligentreach_integration.phtml" hash="dfcfe625fadaf06fb3b069cb9257b4cc"/></dir><dir name="multishipping"><file name="intelligentreach_integration.phtml" hash="206d1fe72ab530829ca274fd52e90108"/></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="intelligentreach_integration.xml" hash="c45eb729e1e4b5025b25c20ac2723eeb"/></dir><dir name="template"><dir name="intelligentreach_integration"><file name="intelligentreach_integration.phtml" hash="cfcf6e1c2de50fa66258a820fb296775"/><dir name="product"><file name="intelligentreach_integration.phtml" hash="0d1f3ce4a57d977d8955176b01e2f87d"/></dir><dir name="basket"><file name="intelligentreach_integration.phtml" hash="983743acab4cd1c2819ea4fb6eebe0b5"/></dir><dir name="checkout"><dir name="onepage"><file name="intelligentreach_integration.phtml" hash="dfcfe625fadaf06fb3b069cb9257b4cc"/></dir><dir name="multishipping"><file name="intelligentreach_integration.phtml" hash="206d1fe72ab530829ca274fd52e90108"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="ircronscripts"><file name="intelligentreach_integration_cron.php" hash="ae6d860f803b1069d2e46545205cc1ac"/><file name="intelligentreach_integration_cron_pre.php" hash="9446a7edf2029ec034a912e5b5d9ed2e"/><file name="intelligentreach_integration_cron_qty_price.php" hash="2ee6c88078a7387320e3e0309a5fa56e"/></dir></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
25
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Intelligent_Reach</name>
4
+ <version>1.0.40</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL</license>
7
  <channel>community</channel>
17
  Contact us to arrange a free E-commerce therapy session. Get advice about e-privacy compliance, tag management, analytics or BI implementations and Data quality as well as any key pain points or challenges which are hampering your growth.</description>
18
  <notes>Stable release. Compatible with older versions. Feed creation has been optimized to handle larger loads. The option to choose the store is now available. Can retrieve associated products for grouped types.Bug fixes.Has support for PHP V5.2. Quantity script has now been added. Flat Catalog support has been added,</notes>
19
  <authors><author><name>Intelligent Reach</name><user>IR</user><email>development@intelligentreach.com</email></author></authors>
20
+ <date>2016-07-27</date>
21
+ <time>15:08:27</time>
22
+ <contents><target name="mage"><dir name="."><file name="intelligentreach_integration.php" hash="62963252d5d3fae1952e9e622e3d212b"/><file name="intelligentreach_integration_qty.php" hash="98f56502f5e5caa9e67103c4fdd1736b"/><file name="intelligentreach_integration_pre.php" hash="0907b832acbcb4010165858f2e779249"/><file name="intelligentreach_integration_opt.php" hash="05f9d3abc3b50dc9e259dd747f75d53f"/></dir><dir><dir name="app"><dir name="etc"><dir name="modules"><file name="IntelligentReach_Integration.xml" hash="6cdd19a11572e7073dbb3d746b6b57b6"/><file name="IntelligentReach_AmazonPayment.xml" hash="10faf651f19ea2298217be1a95707b7c"/><file name="IntelligentReach_EbayPayment.xml" hash="eb9acbd1b55da29e10b09981f0b7af8f"/><file name="IntelligentReach_DebenhamsPayment.xml" hash="649e25d5edf93ea84ce0a35240441ecb"/><file name="IntelligentReach_LazadaPayment.xml" hash="74ebd9f7bab6023049128e6de012b52c"/><file name="IntelligentReach_PlayPayment.xml" hash="c711e18f9a79c24bcddce4143ffb6fb6"/><file name="IntelligentReach_RakutenPayment.xml" hash="d70ce1efcf60b29ecc02fcea8df1f7e9"/><file name="IntelligentReach_TradeMePayment.xml" hash="367154d17430c1000c3798454be25dcb"/><file name="IntelligentReach_WestfieldPayment.xml" hash="b0ae5878bb26f86674ce88a50876496b"/><file name="IntelligentReach_OrderExporter.xml" hash="004c82baa9638e0fb23cc75f783b56e1"/></dir></dir><dir name="code"><dir name="local"><dir name="IntelligentReach"><dir name="Integration"><dir name="etc"><file name="config.xml" hash="9180f7179ed5d2b22b8fe0adcc565858"/></dir></dir><dir name="AmazonPayment"><dir name="etc"><file name="config.xml" hash="d4a03c3505e9eb2cc6b50ea049170938"/><file name="system.xml" hash="7b236978b8022dc4deda628640ea8689"/></dir><dir name="Helper"><file name="Data.php" hash="2e4ef89b210d0f992cd25b8ef5f4b96e"/></dir><dir name="Model"><file name="Pay.php" hash="4f706307986b9cd0f7cb64f69402cbd5"/></dir></dir><dir name="EbayPayment"><dir name="etc"><file name="config.xml" hash="65d1b5110f7782aee4af87bcf5e1dd8f"/><file name="system.xml" hash="7246fbf64d238328f74bd6445cc05b29"/></dir><dir name="Helper"><file name="Data.php" hash="0e112e22a4786f3624216628dee796a0"/></dir><dir name="Model"><file name="Pay.php" hash="9195dd4e2dbdeae9170220d78efc9f7b"/></dir></dir><dir name="DebenhamsPayment"><dir name="etc"><file name="config.xml" hash="27bfe87d1adb412905f682aeedc37550"/><file name="system.xml" hash="fab15158ef26748821326174ca9d91eb"/></dir><dir name="Helper"><file name="Data.php" hash="24e03a8fb06b27480aae4e37f2dc54d8"/></dir><dir name="Model"><file name="Pay.php" hash="45162537d76f8c9e9ccc1ec493c59691"/></dir></dir><dir name="LazadaPayment"><dir name="etc"><file name="config.xml" hash="abd084c6b33d747eabbed77289a02c3c"/><file name="system.xml" hash="bf34e8ec60287c727d8221163f436c9c"/></dir><dir name="Helper"><file name="Data.php" hash="7eee4edb781ab93817979b61f314787f"/></dir><dir name="Model"><file name="Pay.php" hash="d52eafb63ab3bad2a390e2f83ebfab6e"/></dir></dir><dir name="PlayPayment"><dir name="etc"><file name="config.xml" hash="ee2cbae69fa6a6e676eeeefc5c395227"/><file name="system.xml" hash="4afb9b545ca22d4043b0606222d734a6"/></dir><dir name="Helper"><file name="Data.php" hash="486d43158da7188608eb07d3c9e45845"/></dir><dir name="Model"><file name="Pay.php" hash="78432762a0020455de623fbe79166045"/></dir></dir><dir name="RakutenPayment"><dir name="etc"><file name="config.xml" hash="9c4731febdf3f5e9f3a360e793e666c9"/><file name="system.xml" hash="6c19c11b0ad20305d3dd705a0e3f71b9"/></dir><dir name="Helper"><file name="Data.php" hash="87cc7e597d4f70a26911c861358d5695"/></dir><dir name="Model"><file name="Pay.php" hash="b52e5cb4fdb78db91c23bc929e8a70eb"/></dir></dir><dir name="TradeMePayment"><dir name="etc"><file name="config.xml" hash="f8373389ccd40ac5c37f4d1db80104a2"/><file name="system.xml" hash="98893010b7a44f27611421780a09cd6a"/></dir><dir name="Helper"><file name="Data.php" hash="b789a1164f2296882e81d4dced4897a0"/></dir><dir name="Model"><file name="Pay.php" hash="74ba42a1af907d6159fcd8c507d533de"/></dir></dir><dir name="WestfieldPayment"><dir name="etc"><file name="config.xml" hash="af29d7190a214363adebb4d0ef248e7a"/><file name="system.xml" hash="de52dce1e16aaa20f62253a4a22f419f"/></dir><dir name="Helper"><file name="Data.php" hash="1d1fcc723fc60d73b004173094a8499e"/></dir><dir name="Model"><file name="Pay.php" hash="d398e69f34d1b7b4105d264eccf01799"/></dir></dir><dir name="OrderExporter"><dir name="etc"><file name="api.xml" hash="aee4a0fdb16e1e6b24de0f1b9bb3da99"/><file name="config.xml" hash="eb46c81069cfedee166b9c77fddd218f"/><file name="system.xml" hash="6e41cdc209a85975879947a78bda24b2"/><file name="wsdl.xml" hash="a7361499844f83df32d923322633bab1"/><file name="wsi.xml" hash="a106a60efb3b7e50d3239343311e5a50"/></dir><dir name="Model"><file name="Carrier.php" hash="723819e51c4e1a644cc3de48dcac54c6"/><dir name="Cart"><file name="Api.php" hash="50339620188a9187ecd0afa6ede3fda7"/><dir name="Api"><file name="V2.php" hash="1703584c45f0eabc93b75b7814a970b9"/></dir><dir name="Shipping"><file name="Api.php" hash="547829c7eb8d0c22a4a13e5a8df2a2a3"/><dir name="Api"><file name="V2.php" hash="ebd0fc61544ddcf8a7dc8c5fece6ada5"/></dir></dir><dir name="Product"><file name="Api.php" hash="25f9320923ed59266fb55bba645a2cf1"/><dir name="Api"><file name="V2.php" hash="74912462ca1d3bab41381c4d1a489091"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Shipping.php" hash="7891ef0dc09150b7dda42e7f67e14584"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4ef41fb017e9d210521d42cff2b43dd0"/></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="intelligentreach_integration.xml" hash="c45eb729e1e4b5025b25c20ac2723eeb"/></dir><dir name="template"><dir name="intelligentreach_integration"><file name="intelligentreach_integration.phtml" hash="cfcf6e1c2de50fa66258a820fb296775"/><dir name="product"><file name="intelligentreach_integration.phtml" hash="0d1f3ce4a57d977d8955176b01e2f87d"/></dir><dir name="basket"><file name="intelligentreach_integration.phtml" hash="983743acab4cd1c2819ea4fb6eebe0b5"/></dir><dir name="checkout"><dir name="onepage"><file name="intelligentreach_integration.phtml" hash="dfcfe625fadaf06fb3b069cb9257b4cc"/></dir><dir name="multishipping"><file name="intelligentreach_integration.phtml" hash="206d1fe72ab530829ca274fd52e90108"/></dir></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="intelligentreach_integration.xml" hash="c45eb729e1e4b5025b25c20ac2723eeb"/></dir><dir name="template"><dir name="intelligentreach_integration"><file name="intelligentreach_integration.phtml" hash="cfcf6e1c2de50fa66258a820fb296775"/><dir name="product"><file name="intelligentreach_integration.phtml" hash="0d1f3ce4a57d977d8955176b01e2f87d"/></dir><dir name="basket"><file name="intelligentreach_integration.phtml" hash="983743acab4cd1c2819ea4fb6eebe0b5"/></dir><dir name="checkout"><dir name="onepage"><file name="intelligentreach_integration.phtml" hash="dfcfe625fadaf06fb3b069cb9257b4cc"/></dir><dir name="multishipping"><file name="intelligentreach_integration.phtml" hash="206d1fe72ab530829ca274fd52e90108"/></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="intelligentreach_integration.xml" hash="c45eb729e1e4b5025b25c20ac2723eeb"/></dir><dir name="template"><dir name="intelligentreach_integration"><file name="intelligentreach_integration.phtml" hash="cfcf6e1c2de50fa66258a820fb296775"/><dir name="product"><file name="intelligentreach_integration.phtml" hash="0d1f3ce4a57d977d8955176b01e2f87d"/></dir><dir name="basket"><file name="intelligentreach_integration.phtml" hash="983743acab4cd1c2819ea4fb6eebe0b5"/></dir><dir name="checkout"><dir name="onepage"><file name="intelligentreach_integration.phtml" hash="dfcfe625fadaf06fb3b069cb9257b4cc"/></dir><dir name="multishipping"><file name="intelligentreach_integration.phtml" hash="206d1fe72ab530829ca274fd52e90108"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="ircronscripts"><file name="intelligentreach_integration_cron.php" hash="6f15f90dee945767fcb6240e3fd5483d"/><file name="intelligentreach_integration_cron_pre.php" hash="fb6e3618519bf02845c7729522e1d35a"/><file name="intelligentreach_integration_cron_qty_price.php" hash="36a511d7eba2f7dd667a1b41b67933bb"/><file name="intelligentreach_integration_cron_opt.php" hash="c9f37bb88e8d151af6624274ce7ede44"/></dir></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
25
  </package>