slisearch - Version 3.0.7

Version Notes

Changes since last release:
* Improved support for exporting Product Inventory Quantity
* Improved support for exporting Out of Stock Products
* Optimised generation of category list in the feed

Download this release

Release Info

Developer Platform support
Extension slisearch
Version 3.0.7
Comparing to
See all releases


Code changes from version 3.0.6 to 3.0.7

app/code/community/SLI/Search/Block/System/Config/Form/Field/Version.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Custom field to display the version number of the SLI module in the system configuration
27
- *
28
- * @package SLI
29
- * @subpackage Search
30
- */
31
- class SLI_Search_Block_System_Config_Form_Field_Version extends Varien_Data_Form_Element_Abstract
32
- {
33
- public function getElementHtml()
34
- {
35
- /* @var $modules Mage_Core_Model_Config_Element */
36
-
37
- $modules = Mage::getConfig()->getNode('modules')->children();
38
- $info = $modules->SLI_Search->asArray();
39
-
40
- return isset($info['version']) ? $info['version'] : '';
41
- }
42
- }
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Custom field to display the version number of the SLI module in the system configuration
27
+ *
28
+ * @package SLI
29
+ * @subpackage Search
30
+ */
31
+ class SLI_Search_Block_System_Config_Form_Field_Version extends Varien_Data_Form_Element_Abstract
32
+ {
33
+ public function getElementHtml()
34
+ {
35
+ /* @var $modules Mage_Core_Model_Config_Element */
36
+
37
+ $modules = Mage::getConfig()->getNode('modules')->children();
38
+ $info = $modules->SLI_Search->asArray();
39
+
40
+ return isset($info['version']) ? $info['version'] : '';
41
+ }
42
+ }
app/code/community/SLI/Search/Block/System/Config/Frontend/Feed/Generate/Js.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Javascript block for adminhtml JS text_list block to add functionality to the
27
- * generate feed button on the system configuration for Feed Settings.
28
- *
29
- * @package SLI
30
- * @subpackage Search
31
- */
32
- class SLI_Search_Block_System_Config_Frontend_Feed_Generate_Js extends Mage_Adminhtml_Block_Template
33
- {
34
- /**
35
- * Sets javascript template to be included in the adminhtml js text_list block
36
- */
37
- protected function _construct()
38
- {
39
- parent::_construct();
40
-
41
- $this->setTemplate('sli/search/sysconfig/generate/js.phtml');
42
- }
43
-
44
- /**
45
- * Returns the run all feeds async url
46
- *
47
- * @return string
48
- */
49
- public function getGenerateUrl()
50
- {
51
- return Mage::helper("adminhtml")->getUrl('adminhtml/sli/generateFeeds/');
52
- }
53
- }
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Javascript block for adminhtml JS text_list block to add functionality to the
27
+ * generate feed button on the system configuration for Feed Settings.
28
+ *
29
+ * @package SLI
30
+ * @subpackage Search
31
+ */
32
+ class SLI_Search_Block_System_Config_Frontend_Feed_Generate_Js extends Mage_Adminhtml_Block_Template
33
+ {
34
+ /**
35
+ * Sets javascript template to be included in the adminhtml js text_list block
36
+ */
37
+ protected function _construct()
38
+ {
39
+ parent::_construct();
40
+
41
+ $this->setTemplate('sli/search/sysconfig/generate/js.phtml');
42
+ }
43
+
44
+ /**
45
+ * Returns the run all feeds async url
46
+ *
47
+ * @return string
48
+ */
49
+ public function getGenerateUrl()
50
+ {
51
+ return Mage::helper("adminhtml")->getUrl('adminhtml/sli/generateFeeds/');
52
+ }
53
+ }
app/code/community/SLI/Search/Helper/Feed.php CHANGED
@@ -56,6 +56,24 @@ class SLI_Search_Helper_Feed
56
  'visibility',
57
  );
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Get ajax message.
61
  *
@@ -275,4 +293,13 @@ class SLI_Search_Helper_Feed
275
 
276
  return array_unique($attributes);
277
  }
 
 
 
 
 
 
 
 
 
278
  }
56
  'visibility',
57
  );
58
 
59
+ /** @var array */
60
+ protected $_inventoryAttributes
61
+ = array(
62
+ 'qty',
63
+ 'is_in_stock',
64
+ 'manage_stock',
65
+ 'backorders',
66
+ );
67
+
68
+ /**
69
+ * Get the inventory attributes
70
+ *
71
+ * @return array
72
+ */
73
+ public function getInventoryAttributes() {
74
+ return $this->_inventoryAttributes;
75
+ }
76
+
77
  /**
78
  * Get ajax message.
79
  *
293
 
294
  return array_unique($attributes);
295
  }
296
+
297
+ /**
298
+ * Return the selected inventory fields that should be included in the feed
299
+ *
300
+ * @return array
301
+ */
302
+ public function getInventoryAttributesFeed() {
303
+ return array_intersect($this->getInventoryAttributes(), $this->getExtraAttributes());
304
+ }
305
  }
app/code/community/SLI/Search/Model/Generators/AttributeGenerator.php CHANGED
@@ -77,21 +77,36 @@ class SLI_Search_Model_Generators_AttributeGenerator implements SLI_Search_Model
77
  $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');
78
  $attributeCollection->addStoreLabel($storeId);
79
 
80
- /** @var $attribute Mage_Eav_Model_Entity_Attribute */
81
- foreach ($attributeCollection as $attribute) {
82
- $attributeCode = $attribute->getAttributeCode();
83
-
84
- $attributeKey = $attribute->getAttributeId();
85
- $this->attributeValueKeys[$attributeCode] = $attributeKey;
86
-
87
- // Only add the options that we require
88
- if (in_array($attributeCode, $extraAttributes)) {
89
- $attributeOptions = $this->getAttributeOptions($attribute, $storeId, $logger);
90
- // Only add the attributes that have options
91
- if ($attributeOptions) {
92
- $this->attributeValues[$attributeCode] = $attributeOptions;
 
 
 
 
 
 
 
 
93
  }
94
  }
 
 
 
 
 
 
 
95
  }
96
  }
97
 
77
  $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');
78
  $attributeCollection->addStoreLabel($storeId);
79
 
80
+ $page = 1;
81
+ $pageSize = 1000;
82
+ $attributeCollection->setPageSize($pageSize);
83
+ $lastPage = $attributeCollection->getLastPageNumber();
84
+
85
+ while ($attributes = $attributeCollection->getItems()) {
86
+ $logger->debug(sprintf("[%s] Processing attribute page: %s", $storeId, $page));
87
+ /** @var $attribute Mage_Eav_Model_Entity_Attribute */
88
+ foreach ($attributes as $attribute) {
89
+ $attributeCode = $attribute->getAttributeCode();
90
+
91
+ $attributeKey = $attribute->getAttributeId();
92
+ $this->attributeValueKeys[$attributeCode] = $attributeKey;
93
+
94
+ // Only add the options that we require
95
+ if (in_array($attributeCode, $extraAttributes)) {
96
+ $attributeOptions = $this->getAttributeOptions($attribute, $storeId, $logger);
97
+ // Only add the attributes that have options
98
+ if ($attributeOptions) {
99
+ $this->attributeValues[$attributeCode] = $attributeOptions;
100
+ }
101
  }
102
  }
103
+
104
+ // break out when we get to the last page
105
+ if ($page >= $lastPage) {
106
+ break;
107
+ }
108
+ $attributeCollection->setCurPage(++$page);
109
+ $attributeCollection->clear();
110
  }
111
  }
112
 
app/code/community/SLI/Search/Model/Generators/CategoryGenerator.php CHANGED
@@ -58,11 +58,27 @@ class SLI_Search_Model_Generators_CategoryGenerator implements SLI_Search_Model_
58
  ->loadChildren($recursionLevel)
59
  ->getChildren();
60
 
 
 
61
  $tree->addCollectionData(null, $sorted, $rootCategoryId, $toLoad, $onlyActiveCategories);
 
 
 
62
 
63
- foreach ($tree->getCollection() as $category) {
64
- $this->writeCategory($xmlWriter, $category);
65
- ++$processed;
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
68
  // categories
58
  ->loadChildren($recursionLevel)
59
  ->getChildren();
60
 
61
+ $page = 1;
62
+ $pageSize = 1000;
63
  $tree->addCollectionData(null, $sorted, $rootCategoryId, $toLoad, $onlyActiveCategories);
64
+ $categoryCollection = $tree->getCollection();
65
+ $categoryCollection->setPageSize($pageSize);
66
+ $lastPage = $categoryCollection->getLastPageNumber();
67
 
68
+ while ($categories = $categoryCollection->getItems()) {
69
+ $logger->debug(sprintf("[%s] Processing categories page: %s", $storeId, $page));
70
+ foreach ($categories as $category) {
71
+ $this->writeCategory($xmlWriter, $category);
72
+ ++$processed;
73
+ }
74
+
75
+ // break out when we get to last page
76
+ if ($page >= $lastPage) {
77
+ break;
78
+ }
79
+
80
+ $categoryCollection->setPage(++$page, $pageSize);
81
+ $categoryCollection->clear();
82
  }
83
 
84
  // categories
app/code/community/SLI/Search/Model/Generators/GeneratorContext.php CHANGED
@@ -122,17 +122,6 @@ class SLI_Search_Model_Generators_GeneratorContext
122
  $this->productCollection
123
  ->addPriceData();
124
 
125
- // these are handled in the product generator as adding price data will drop them from the collection
126
- if (!$dataHelper->isIncludeOutOfStockItems($storeId)) {
127
- // lets still add this here in case Magentos (internal) behaviour changes in the future
128
- $logger->debug(sprintf('[%s] Exclude out of stock items', $storeId));
129
- /** @var Mage_CatalogInventory_Model_Stock $stockHelper */
130
- $stockHelper = Mage::getModel('cataloginventory/stock');
131
- $stockHelper->addInStockFilterToCollection($this->productCollection);
132
- } else {
133
- $logger->debug(sprintf('[%s] Include out of stock items', $storeId));
134
- }
135
-
136
  if ($dataHelper->isPriceFeedEnabled($storeId)) {
137
  $logger->debug("Adding tier price data...");
138
  $this->productCollection
@@ -164,7 +153,7 @@ class SLI_Search_Model_Generators_GeneratorContext
164
  $feedHelper = Mage::helper('sli_search/feed');
165
  $extraAttributes = $feedHelper->getExtraAttributes();
166
 
167
- /** @var $entityCollection Mage_Catalog_Model_Resource_Product_Collection */
168
  $productCollection = Mage::getResourceModel('catalog/product_collection');
169
 
170
  $logger->debug("Adding product attributes: " . implode(',', $extraAttributes));
122
  $this->productCollection
123
  ->addPriceData();
124
 
 
 
 
 
 
 
 
 
 
 
 
125
  if ($dataHelper->isPriceFeedEnabled($storeId)) {
126
  $logger->debug("Adding tier price data...");
127
  $this->productCollection
153
  $feedHelper = Mage::helper('sli_search/feed');
154
  $extraAttributes = $feedHelper->getExtraAttributes();
155
 
156
+ /** @var $productCollection Mage_Catalog_Model_Resource_Product_Collection */
157
  $productCollection = Mage::getResourceModel('catalog/product_collection');
158
 
159
  $logger->debug("Adding product attributes: " . implode(',', $extraAttributes));
app/code/community/SLI/Search/Model/Generators/PriceGenerator.php CHANGED
@@ -84,6 +84,7 @@ class SLI_Search_Model_Generators_PriceGenerator implements SLI_Search_Model_Gen
84
 
85
  /** @var $entityCollection Mage_Catalog_Model_Resource_Product_Collection */
86
  $entityCollection = $generatorContext->getProductCollection($storeId);
 
87
 
88
  // Loop over each page of the collections
89
  while ($products = $entityCollection->getItems()) {
@@ -97,7 +98,7 @@ class SLI_Search_Model_Generators_PriceGenerator implements SLI_Search_Model_Gen
97
  $logger->debug("Finished processing page: $page");
98
 
99
  //Break out when the number of products is less than the pagesize
100
- if (count($products) < $pageSize) {
101
  break;
102
  }
103
  $entityCollection->setPage(++$page, $pageSize);
84
 
85
  /** @var $entityCollection Mage_Catalog_Model_Resource_Product_Collection */
86
  $entityCollection = $generatorContext->getProductCollection($storeId);
87
+ $lastPage = $entityCollection->getLastPageNumber();
88
 
89
  // Loop over each page of the collections
90
  while ($products = $entityCollection->getItems()) {
98
  $logger->debug("Finished processing page: $page");
99
 
100
  //Break out when the number of products is less than the pagesize
101
+ if ($page >= $lastPage) {
102
  break;
103
  }
104
  $entityCollection->setPage(++$page, $pageSize);
app/code/community/SLI/Search/Model/Generators/ProductGenerator.php CHANGED
@@ -71,10 +71,6 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
71
  $feedHelper = Mage::helper('sli_search/feed');
72
  $extraAttributes = $feedHelper->getExtraAttributes();
73
 
74
- $page = 1;
75
- $processed = 0;
76
- $pageSize = $generatorContext->getPageSize();
77
-
78
  // might need to iterate over more than one product collection...
79
  $productCollections = array(
80
  'mainProducts' => array(
@@ -93,10 +89,7 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
93
  'filters' => array(
94
  function ($product) {
95
  /** @var Mage_Catalog_Model_Product $product */
96
- /** @var Varien_Object $value */
97
- $value = $product->getData('stock_item');
98
-
99
- return (bool)!$value->getData('is_in_stock');
100
  }
101
  )
102
  );
@@ -112,9 +105,20 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
112
  $productCollection = $productCollectionDetails['collection'];
113
  $productFilters = $productCollectionDetails['filters'];
114
 
 
 
 
 
 
115
  $logger->debug(sprintf('Writing products for collection %s...', $collectionKey));
116
 
 
 
 
117
  while ($products = $productCollection->getItems()) {
 
 
 
118
  if ($review) {
119
  $logger->debug("Adding review data for page: $page");
120
  $review->appendSummary($productCollection);
@@ -136,6 +140,8 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
136
 
137
  return false;
138
  });
 
 
139
 
140
  /** @var $product Mage_Catalog_Model_Product */
141
  foreach ($filteredProducts as $product) {
@@ -144,18 +150,22 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
144
  $this->addProductRelationshipData($product, $extraAttributes);
145
  $this->writeProductData($product, $xmlWriter);
146
  ++$processed;
 
147
  }
148
  $logger->debug(sprintf('Finished processing product page %s for collection %s', $page,
149
  $collectionKey));
150
 
151
  // break out when we get less than a full page
152
- if (count($products) < $pageSize) {
153
  break;
154
  }
155
 
156
  $productCollection->setPage(++$page, $pageSize);
157
  $productCollection->clear();
 
158
  }
 
 
159
  }
160
 
161
  $logger->debug("Finished adding $processed products");
@@ -181,13 +191,17 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
181
  $xmlWriter->writeAttribute('count', $value->getData('reviews_count'));
182
  $xmlWriter->writeAttribute('summary', $value->getData('rating_summary'));
183
  $xmlWriter->endElement();
184
- } else {
185
- if ('stock_item' == $name) {
186
- /** @var $value Varien_Object */
187
- $xmlWriter->writeNode('is_in_stock', $value->getData('is_in_stock'));
188
- } else {
189
- $xmlWriter->writeNode($name, $value);
 
 
190
  }
 
 
191
  }
192
  }
193
 
@@ -231,4 +245,18 @@ class SLI_Search_Model_Generators_ProductGenerator implements SLI_Search_Model_G
231
  }
232
  }
233
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
71
  $feedHelper = Mage::helper('sli_search/feed');
72
  $extraAttributes = $feedHelper->getExtraAttributes();
73
 
 
 
 
 
74
  // might need to iterate over more than one product collection...
75
  $productCollections = array(
76
  'mainProducts' => array(
89
  'filters' => array(
90
  function ($product) {
91
  /** @var Mage_Catalog_Model_Product $product */
92
+ return (bool)!$product->getData("is_salable");
 
 
 
93
  }
94
  )
95
  );
105
  $productCollection = $productCollectionDetails['collection'];
106
  $productFilters = $productCollectionDetails['filters'];
107
 
108
+ $processed = 0;
109
+ $page = 1;
110
+ $pageSize = $generatorContext->getPageSize();
111
+ $lastPage = $productCollection->getLastPageNumber();
112
+
113
  $logger->debug(sprintf('Writing products for collection %s...', $collectionKey));
114
 
115
+ $this->addInventoryDataToCollection($feedHelper, $logger, $collectionKey, $productCollection);
116
+
117
+ $collectionCount = 0;
118
  while ($products = $productCollection->getItems()) {
119
+
120
+ $logger->debug(sprintf('Started processing product page %s for collection %s', $page,
121
+ $collectionKey));
122
  if ($review) {
123
  $logger->debug("Adding review data for page: $page");
124
  $review->appendSummary($productCollection);
140
 
141
  return false;
142
  });
143
+ $logger->debug(sprintf('Finished filtering product page %s for collection %s', $page,
144
+ $collectionKey));
145
 
146
  /** @var $product Mage_Catalog_Model_Product */
147
  foreach ($filteredProducts as $product) {
150
  $this->addProductRelationshipData($product, $extraAttributes);
151
  $this->writeProductData($product, $xmlWriter);
152
  ++$processed;
153
+ ++$collectionCount;
154
  }
155
  $logger->debug(sprintf('Finished processing product page %s for collection %s', $page,
156
  $collectionKey));
157
 
158
  // break out when we get less than a full page
159
+ if ($page >= $lastPage) {
160
  break;
161
  }
162
 
163
  $productCollection->setPage(++$page, $pageSize);
164
  $productCollection->clear();
165
+ $this->addInventoryDataToCollection($feedHelper, $logger, $collectionKey, $productCollection);
166
  }
167
+ $logger->debug(sprintf('Finished processing %s products for collection %s', $collectionCount,
168
+ $collectionKey));
169
  }
170
 
171
  $logger->debug("Finished adding $processed products");
191
  $xmlWriter->writeAttribute('count', $value->getData('reviews_count'));
192
  $xmlWriter->writeAttribute('summary', $value->getData('rating_summary'));
193
  $xmlWriter->endElement();
194
+ } elseif ('stock_item' == $name) {
195
+ /** @var $value Varien_Object */
196
+ $inventoryAttributes = Mage::helper('sli_search/feed')->getInventoryAttributesFeed();
197
+ foreach($inventoryAttributes as $attribute) {
198
+ // The instock attribute would be included twice otherwise.
199
+ if($attribute != 'is_in_stock') {
200
+ $xmlWriter->writeNode($attribute, $value->getData($attribute));
201
+ }
202
  }
203
+ } else {
204
+ $xmlWriter->writeNode($name, $value);
205
  }
206
  }
207
 
245
  }
246
  }
247
  }
248
+
249
+ /**
250
+ * @param $feedHelper
251
+ * @param $logger
252
+ * @param $collectionKey
253
+ * @param $productCollection
254
+ */
255
+ protected function addInventoryDataToCollection($feedHelper, $logger, $collectionKey, $productCollection) {
256
+ if (!empty($feedHelper->getInventoryAttributesFeed())) {
257
+ $logger->debug(sprintf('Adding inventory data to collection', $collectionKey));
258
+ // Add the stock data to the product
259
+ Mage::getModel('cataloginventory/stock')->addItemsToProducts($productCollection);
260
+ }
261
+ }
262
  }
app/code/community/SLI/Search/Model/System/Config/Backend/Loglevel.php CHANGED
@@ -1,60 +1,60 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Log level.
27
- *
28
- * @package SLI
29
- * @subpackage Search
30
- */
31
- class SLI_Search_Model_System_Config_Backend_Loglevel
32
- {
33
- /**
34
- * Options getter
35
- *
36
- * @return array
37
- */
38
- public function toOptionArray()
39
- {
40
- return array(
41
- array('value' => 1, 'label' => Mage::helper('sli_search')->__('Error')),
42
- array('value' => 2, 'label' => Mage::helper('sli_search')->__('Debug')),
43
- array('value' => 3, 'label' => Mage::helper('sli_search')->__('Trace')),
44
- );
45
- }
46
-
47
- /**
48
- * Get options in "key-value" format
49
- *
50
- * @return array
51
- */
52
- public function toArray()
53
- {
54
- return array(
55
- 1 => Mage::helper('sli_search')->__('Error'),
56
- 2 => Mage::helper('sli_search')->__('Debug'),
57
- 3 => Mage::helper('sli_search')->__('Trace'),
58
- );
59
- }
60
- }
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Log level.
27
+ *
28
+ * @package SLI
29
+ * @subpackage Search
30
+ */
31
+ class SLI_Search_Model_System_Config_Backend_Loglevel
32
+ {
33
+ /**
34
+ * Options getter
35
+ *
36
+ * @return array
37
+ */
38
+ public function toOptionArray()
39
+ {
40
+ return array(
41
+ array('value' => 1, 'label' => Mage::helper('sli_search')->__('Error')),
42
+ array('value' => 2, 'label' => Mage::helper('sli_search')->__('Debug')),
43
+ array('value' => 3, 'label' => Mage::helper('sli_search')->__('Trace')),
44
+ );
45
+ }
46
+
47
+ /**
48
+ * Get options in "key-value" format
49
+ *
50
+ * @return array
51
+ */
52
+ public function toArray()
53
+ {
54
+ return array(
55
+ 1 => Mage::helper('sli_search')->__('Error'),
56
+ 2 => Mage::helper('sli_search')->__('Debug'),
57
+ 3 => Mage::helper('sli_search')->__('Trace'),
58
+ );
59
+ }
60
+ }
app/code/community/SLI/Search/Model/System/Config/Source/Attributes.php CHANGED
@@ -131,7 +131,7 @@ class SLI_Search_Model_System_Config_Source_Attributes
131
 
132
  // Add the inventory attributes
133
  foreach ($this->_inventoryAttributes as $label => $attributeCode) {
134
- $code = self::INVENTORY_ATTRIBUTES_PREFIX . "_" . $attributeCode;
135
  $label = is_string($label) ? $label : self::INVENTORY_ATTRIBUTES_PREFIX . "_" . $attributeCode;
136
  $options[$code] = $label;
137
  }
131
 
132
  // Add the inventory attributes
133
  foreach ($this->_inventoryAttributes as $label => $attributeCode) {
134
+ $code = $attributeCode;
135
  $label = is_string($label) ? $label : self::INVENTORY_ATTRIBUTES_PREFIX . "_" . $attributeCode;
136
  $options[$code] = $label;
137
  }
app/code/community/SLI/Search/Model/System/Config/Source/Minigrid/Abstract.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Minigrid system config field type source model abstract
27
- * Provides base functionality for minigrid source models
28
- * as the toOptionArray is specialized to the minigrid type
29
- *
30
- * @package SLI
31
- * @subpackage Search
32
- */
33
- abstract class SLI_Search_Model_System_Config_Source_Minigrid_Abstract
34
- {
35
- /**
36
- * Default values of field array. Field array defines
37
- * the fields on the grid.
38
- *
39
- * @return array
40
- */
41
- abstract protected function _getFields();
42
-
43
- /**
44
- * Add the additional grid type as a viable type on the form
45
- *
46
- * Note: Have to add value and label to each field array because
47
- * the frontend renderer requires value and label to be set
48
- * when under score scope.
49
- *
50
- * @return array
51
- */
52
- public function toOptionArray()
53
- {
54
- $fields = $this->_getFields();
55
- foreach ($fields as $key => $field) {
56
- $fields[$key]['value'] = 1;
57
- $fields[$key]['label'] = 1;
58
- }
59
-
60
- return $fields;
61
- }
62
- }
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Minigrid system config field type source model abstract
27
+ * Provides base functionality for minigrid source models
28
+ * as the toOptionArray is specialized to the minigrid type
29
+ *
30
+ * @package SLI
31
+ * @subpackage Search
32
+ */
33
+ abstract class SLI_Search_Model_System_Config_Source_Minigrid_Abstract
34
+ {
35
+ /**
36
+ * Default values of field array. Field array defines
37
+ * the fields on the grid.
38
+ *
39
+ * @return array
40
+ */
41
+ abstract protected function _getFields();
42
+
43
+ /**
44
+ * Add the additional grid type as a viable type on the form
45
+ *
46
+ * Note: Have to add value and label to each field array because
47
+ * the frontend renderer requires value and label to be set
48
+ * when under score scope.
49
+ *
50
+ * @return array
51
+ */
52
+ public function toOptionArray()
53
+ {
54
+ $fields = $this->_getFields();
55
+ foreach ($fields as $key => $field) {
56
+ $fields[$key]['value'] = 1;
57
+ $fields[$key]['label'] = 1;
58
+ }
59
+
60
+ return $fields;
61
+ }
62
+ }
app/code/community/SLI/Search/NotificationException.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * To be used when you a stores feed needs to stop, but other stores can continue
27
- *
28
- * @package SLI
29
- * @subpackage Search
30
- */
31
- class SLI_Search_NotificationException extends SLI_Search_Exception
32
- {
33
-
34
- }
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * To be used when you a stores feed needs to stop, but other stores can continue
27
+ *
28
+ * @package SLI
29
+ * @subpackage Search
30
+ */
31
+ class SLI_Search_NotificationException extends SLI_Search_Exception
32
+ {
33
+
34
+ }
app/code/community/SLI/Search/controllers/SearchController.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Provides the frontend capabilities of the SLI Search integration.
27
- *
28
- * @package SLI
29
- * @subpackage Search
30
- */
31
- class SLI_Search_SearchController extends Mage_Core_Controller_Front_Action
32
- {
33
- /**
34
- * Renders a standard frontend page using just the default handles.
35
- * Nothing is defined in the layout for this page and it should have an empty
36
- * content.
37
- *
38
- * SLI uses this page as a template for their hosted search solution.
39
- * uri: /sli/search/template
40
- */
41
- public function templateAction()
42
- {
43
- $this->loadLayout();
44
- $this->renderLayout();
45
- }
46
- }
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Provides the frontend capabilities of the SLI Search integration.
27
+ *
28
+ * @package SLI
29
+ * @subpackage Search
30
+ */
31
+ class SLI_Search_SearchController extends Mage_Core_Controller_Front_Action
32
+ {
33
+ /**
34
+ * Renders a standard frontend page using just the default handles.
35
+ * Nothing is defined in the layout for this page and it should have an empty
36
+ * content.
37
+ *
38
+ * SLI uses this page as a template for their hosted search solution.
39
+ * uri: /sli/search/template
40
+ */
41
+ public function templateAction()
42
+ {
43
+ $this->loadLayout();
44
+ $this->renderLayout();
45
+ }
46
+ }
app/code/community/SLI/Search/etc/adminhtml.xml CHANGED
@@ -1,59 +1,59 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license – please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Systems configurations for SLI Systems Search
27
- * Includes General, Feed Settings, FTP Settings, Javascript, Cron Settings,
28
- * Product Attributes, and other settings.
29
- *
30
- * @package SLI
31
- * @subpackage Search
32
- */
33
- -->
34
- <config>
35
- <acl>
36
- <resources>
37
- <admin>
38
- <children>
39
- <system>
40
- <children>
41
- <config>
42
- <children>
43
- <sli_search translate="title" module="sli_search">
44
- <title>SLI Learning Search Connect</title>
45
- <children>
46
- <manual_feed translate="title" module="sli_search">
47
- <title>Manual Feed Generation</title>
48
- </manual_feed>
49
- </children>
50
- </sli_search>
51
- </children>
52
- </config>
53
- </children>
54
- </system>
55
- </children>
56
- </admin>
57
- </resources>
58
- </acl>
59
- </config>
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license – please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Systems configurations for SLI Systems Search
27
+ * Includes General, Feed Settings, FTP Settings, Javascript, Cron Settings,
28
+ * Product Attributes, and other settings.
29
+ *
30
+ * @package SLI
31
+ * @subpackage Search
32
+ */
33
+ -->
34
+ <config>
35
+ <acl>
36
+ <resources>
37
+ <admin>
38
+ <children>
39
+ <system>
40
+ <children>
41
+ <config>
42
+ <children>
43
+ <sli_search translate="title" module="sli_search">
44
+ <title>SLI Learning Search Connect</title>
45
+ <children>
46
+ <manual_feed translate="title" module="sli_search">
47
+ <title>Manual Feed Generation</title>
48
+ </manual_feed>
49
+ </children>
50
+ </sli_search>
51
+ </children>
52
+ </config>
53
+ </children>
54
+ </system>
55
+ </children>
56
+ </admin>
57
+ </resources>
58
+ </acl>
59
+ </config>
app/code/community/SLI/Search/etc/config.xml CHANGED
@@ -32,7 +32,7 @@
32
  <config>
33
  <modules>
34
  <SLI_Search>
35
- <version>3.0.6</version>
36
  </SLI_Search>
37
  </modules>
38
  <global>
32
  <config>
33
  <modules>
34
  <SLI_Search>
35
+ <version>3.0.7</version>
36
  </SLI_Search>
37
  </modules>
38
  <global>
app/code/community/SLI/Search/sql/sli_search_setup/install-1.0.0.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Install script for version 1.0.0
27
- * Sets defaults into system config data table
28
- *
29
- * @package SLI
30
- * @subpackage Search
31
- */
32
-
33
- // save out the cron job to the core config data table
34
- $frequency = Mage::getConfig()->getNode('default/sli_search/cron/frequency');
35
- $time = explode(',', Mage::getConfig()->getNode('default/sli_search/cron/time'));
36
-
37
- /** @var SLI_Search_Helper_Data $dataHelper */
38
- $dataHelper = Mage::helper('sli_search/data');
39
-
40
- $cronTab = $dataHelper->getCronTimeAsCrontab($frequency, $time);
41
- $model = Mage::getConfig()->getNode(SLI_Search_Model_Cron::CRON_GENERATE_FEEDS_MODEL_RUN_PATH);
42
-
43
- /** @var SLI_Search_Model_System_Config_Backend_Cron $backendCron */
44
- $backendCron = Mage::getModel('sli_search/system_config_backend_cron');
45
  $backendCron->saveCronTab($cronTab, $model);
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Install script for version 1.0.0
27
+ * Sets defaults into system config data table
28
+ *
29
+ * @package SLI
30
+ * @subpackage Search
31
+ */
32
+
33
+ // save out the cron job to the core config data table
34
+ $frequency = Mage::getConfig()->getNode('default/sli_search/cron/frequency');
35
+ $time = explode(',', Mage::getConfig()->getNode('default/sli_search/cron/time'));
36
+
37
+ /** @var SLI_Search_Helper_Data $dataHelper */
38
+ $dataHelper = Mage::helper('sli_search/data');
39
+
40
+ $cronTab = $dataHelper->getCronTimeAsCrontab($frequency, $time);
41
+ $model = Mage::getConfig()->getNode(SLI_Search_Model_Cron::CRON_GENERATE_FEEDS_MODEL_RUN_PATH);
42
+
43
+ /** @var SLI_Search_Model_System_Config_Backend_Cron $backendCron */
44
+ $backendCron = Mage::getModel('sli_search/system_config_backend_cron');
45
  $backendCron->saveCronTab($cronTab, $model);
app/design/adminhtml/default/default/template/sli/search/email/messages.phtml CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Javascript that provides functionality to run the SLI feed generator using
27
- * ajax.
28
- *
29
- * @package SLI
30
- * @subpackage Search
31
- */
32
- ?>
33
- <table style="margin:3px;">
34
- <?php foreach ($this->getMessages() as $key => $message): ?>
35
- <tr>
36
- <td style="margin:3px;"><b><?php echo $key ?></b></td>
37
- <td style="margin:3px;"><?php echo $message ?></td>
38
- </tr>
39
- <?php endforeach; ?>
40
- </table>
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Javascript that provides functionality to run the SLI feed generator using
27
+ * ajax.
28
+ *
29
+ * @package SLI
30
+ * @subpackage Search
31
+ */
32
+ ?>
33
+ <table style="margin:3px;">
34
+ <?php foreach ($this->getMessages() as $key => $message): ?>
35
+ <tr>
36
+ <td style="margin:3px;"><b><?php echo $key ?></b></td>
37
+ <td style="margin:3px;"><?php echo $message ?></td>
38
+ </tr>
39
+ <?php endforeach; ?>
40
+ </table>
app/design/adminhtml/default/default/template/sli/search/sysconfig/generate/js.phtml CHANGED
@@ -1,100 +1,100 @@
1
- <?php
2
-
3
- /**
4
- * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
- * Reserved
6
- * This file is part of Learning Search Connect.
7
- * Learning Search Connect is distributed under a limited and restricted
8
- * license - please visit www.sli-systems.com/LSC for full license details.
9
- *
10
- * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
- * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
- * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
- * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
- * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
- * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
- * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
- * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
- * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
- * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
- * POSSIBILITY OF SUCH DAMAGES.
23
- */
24
-
25
- /**
26
- * Javascript that provides functionality to run the SLI feed generator using
27
- * ajax.
28
- *
29
- * @package SLI
30
- * @subpackage Search
31
- */
32
- ?>
33
- <script type="text/javascript">
34
- //<![CDATA[
35
-
36
- var sliSearch = {
37
- isInit: false,
38
- buttonId: null,
39
- init: function () {
40
- this.url = '<?php echo $this->getGenerateUrl() ?>';
41
- this.buttonId = '<?php echo $this->getButtonId()?>';
42
- this.displayId = "sli_display_msg";
43
- this.isInit = true;
44
- },
45
- generateFeed: function () {
46
- if (!this.isInit) {
47
- this.init();
48
- }
49
- new Ajax.Request(this.url, {
50
- onSuccess: function (transport) {
51
- var response = transport.responseText.evalJSON();
52
- this.displayResults(response);
53
- }.bind(this),
54
- onFailure: function (transport) {
55
- if (403 == transport.status) {
56
- this.displayResults({
57
- "messages": {
58
- 'Error': 'Your role does not have permission for "Manual Feed Generation". '
59
- + 'Please contact your system administrator.'
60
- },
61
- "error": true
62
- });
63
- } else {
64
- this.displayResults({
65
- "messages": {'Error': 'Generation failed! Status: ' + transport.status},
66
- "error": true
67
- });
68
- }
69
- }.bind(this)
70
- });
71
- },
72
- displayResults: function (response) {
73
- var responseEl = $(this.displayId);
74
- if (responseEl == null) {
75
- var responseEl = new Element('p', {id: this.displayId}).addClassName('note');
76
- Element.insert($(this.buttonId), {after: responseEl});
77
- }
78
- if (response.messages) {
79
- var style = response.error ? ' style="color:red;"' : '';
80
- responseEl.innerHTML = '';
81
- for (var message in response.messages) {
82
- responseEl.appendChild(
83
- new Element('p').update(
84
- '<span' + style + '><b>' + message + ':</b> ' + response.messages[message] + '</span>'
85
- )
86
- );
87
- }
88
- return responseEl;
89
- }
90
- if (response.error) {
91
- return responseEl.innerHTML = response.error;
92
- }
93
- $(this.buttonId).disabled = true;
94
- $(this.buttonId).addClassName("disabled");
95
- return responseEl.innerHTML = "<?php echo Mage::helper('sli_search/feed')->getAjaxNotice(); ?>";
96
- }
97
- };
98
-
99
- //]]>
100
- </script>
1
+ <?php
2
+
3
+ /**
4
+ * Copyright (c) 2015 S.L.I. Systems, Inc. (www.sli-systems.com) - All Rights
5
+ * Reserved
6
+ * This file is part of Learning Search Connect.
7
+ * Learning Search Connect is distributed under a limited and restricted
8
+ * license - please visit www.sli-systems.com/LSC for full license details.
9
+ *
10
+ * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
11
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13
+ * PARTICULAR PURPOSE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO
14
+ * EVENT WILL SLI BE LIABLE TO YOU OR ANY OTHER PARTY FOR ANY GENERAL, DIRECT,
15
+ * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL LOSS OR DAMAGES OF ANY
16
+ * CHARACTER ARISING OUT OF THE USE OF THE CODE AND/OR THE LICENSE INCLUDING
17
+ * BUT NOT LIMITED TO PERSONAL INJURY, LOSS OF DATA, LOSS OF PROFITS, LOSS OF
18
+ * ASSIGNMENTS, DATA OR OUTPUT FROM THE SERVICE BEING RENDERED INACCURATE,
19
+ * FAILURE OF CODE, SERVER DOWN TIME, DAMAGES FOR LOSS OF GOODWILL, BUSINESS
20
+ * INTERRUPTION, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES
21
+ * OR LOSSES OF WHATEVER NATURE, EVEN IF SLI HAS BEEN INFORMED OF THE
22
+ * POSSIBILITY OF SUCH DAMAGES.
23
+ */
24
+
25
+ /**
26
+ * Javascript that provides functionality to run the SLI feed generator using
27
+ * ajax.
28
+ *
29
+ * @package SLI
30
+ * @subpackage Search
31
+ */
32
+ ?>
33
+ <script type="text/javascript">
34
+ //<![CDATA[
35
+
36
+ var sliSearch = {
37
+ isInit: false,
38
+ buttonId: null,
39
+ init: function () {
40
+ this.url = '<?php echo $this->getGenerateUrl() ?>';
41
+ this.buttonId = '<?php echo $this->getButtonId()?>';
42
+ this.displayId = "sli_display_msg";
43
+ this.isInit = true;
44
+ },
45
+ generateFeed: function () {
46
+ if (!this.isInit) {
47
+ this.init();
48
+ }
49
+ new Ajax.Request(this.url, {
50
+ onSuccess: function (transport) {
51
+ var response = transport.responseText.evalJSON();
52
+ this.displayResults(response);
53
+ }.bind(this),
54
+ onFailure: function (transport) {
55
+ if (403 == transport.status) {
56
+ this.displayResults({
57
+ "messages": {
58
+ 'Error': 'Your role does not have permission for "Manual Feed Generation". '
59
+ + 'Please contact your system administrator.'
60
+ },
61
+ "error": true
62
+ });
63
+ } else {
64
+ this.displayResults({
65
+ "messages": {'Error': 'Generation failed! Status: ' + transport.status},
66
+ "error": true
67
+ });
68
+ }
69
+ }.bind(this)
70
+ });
71
+ },
72
+ displayResults: function (response) {
73
+ var responseEl = $(this.displayId);
74
+ if (responseEl == null) {
75
+ var responseEl = new Element('p', {id: this.displayId}).addClassName('note');
76
+ Element.insert($(this.buttonId), {after: responseEl});
77
+ }
78
+ if (response.messages) {
79
+ var style = response.error ? ' style="color:red;"' : '';
80
+ responseEl.innerHTML = '';
81
+ for (var message in response.messages) {
82
+ responseEl.appendChild(
83
+ new Element('p').update(
84
+ '<span' + style + '><b>' + message + ':</b> ' + response.messages[message] + '</span>'
85
+ )
86
+ );
87
+ }
88
+ return responseEl;
89
+ }
90
+ if (response.error) {
91
+ return responseEl.innerHTML = response.error;
92
+ }
93
+ $(this.buttonId).disabled = true;
94
+ $(this.buttonId).addClassName("disabled");
95
+ return responseEl.innerHTML = "<?php echo Mage::helper('sli_search/feed')->getAjaxNotice(); ?>";
96
+ }
97
+ };
98
+
99
+ //]]>
100
+ </script>
app/etc/modules/SLI_Search.xml CHANGED
@@ -1,13 +1,13 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <SLI_Search>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- <depends>
8
- <Mage_CatalogSearch/>
9
- <Mage_Catalog/>
10
- </depends>
11
- </SLI_Search>
12
- </modules>
13
- </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <SLI_Search>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_CatalogSearch/>
9
+ <Mage_Catalog/>
10
+ </depends>
11
+ </SLI_Search>
12
+ </modules>
13
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>slisearch</name>
4
- <version>3.0.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://sli-systems.com/lsc">SLI Feed Generation</license>
7
  <channel>community</channel>
@@ -9,21 +9,14 @@
9
  <summary>LSC integrates Magento with SLI's SaaS based Learning Search, Learning Navigation and user based SEO products.</summary>
10
  <description>Learning Search Connect (LSC) produces data feeds out of current Magento Community and Enterprise editions. The feeds are created and then sent to SLI's FTP servers for further processing.</description>
11
  <notes>Changes since last release:&#xD;
12
- * Re-architected to pass Magento Extension Verification&#xD;
13
- * Improvements to default attribute list interface in Admin UI&#xD;
14
- * Added validation of FTP upload fields&#xD;
15
- * Fixed issues related to cron job creation&#xD;
16
- * Improved format of exported feed&#xD;
17
- * Smarter feed encoding capability&#xD;
18
- * Optimized feed processing&#xD;
19
- * Improved email notification format&#xD;
20
- * Improved support for tiered and group pricing&#xD;
21
- * Better support for required attributes&#xD;
22
- * Improved logging capability</notes>
23
  <authors><author><name>Platform support</name><user>SLI-Systems</user><email>support@sli-system.com</email></author></authors>
24
- <date>2016-06-13</date>
25
- <time>00:57:59</time>
26
- <contents><target name="magecommunity"><dir name="SLI"><dir name="Search"><dir name="Block"><dir name="Search"><dir name="Form"><file name="Mini.php" hash="bf98fdd4a73b0536cf6fd0f7bd15f7cd"/></dir><dir name="Js"><file name="Bottom.php" hash="448c67f3ea49538b522eec5fb67ad6ec"/><file name="Top.php" hash="48a2ef9314240ae7f2a7b137073cfead"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Minigrid.php" hash="061fc5d94bd40fa21cf5aa9040acdd38"/><file name="Version.php" hash="6c21b8393c4840337989ed43c6d9a9eb"/></dir></dir><file name="Form.php" hash="08e1291b012bff41bc8f3df6644fc763"/><dir name="Frontend"><dir name="Feed"><dir name="Generate"><file name="Js.php" hash="5b2d825f90faaf56b3eb4a1a052eb927"/></dir><file name="Generate.php" hash="87cfb67934be30bcfbd208f99839c16c"/><file name="Next.php" hash="6270ea4de96286999eefbe8843b2c391"/></dir></dir></dir></dir></dir><file name="Exception.php" hash="5ccdacc40bd1fa4e0bff9e1052135ed7"/><dir name="Helper"><file name="Data.php" hash="3525ed62c3a40e8dc7e902b85bd45e2f"/><file name="Feed.php" hash="929ba6c93681ab1377719161d0f87dd7"/><file name="FeedLogger.php" hash="78ab2597e31741ba19734d8fc636621d"/><file name="XmlWriter.php" hash="dae24ab82da564645cf6f97701d30a63"/></dir><dir name="Model"><file name="Cron.php" hash="c62a9de1e84322674e6f1fac0f4c7a2d"/><file name="Email.php" hash="d19ecbae60401f770518e28c70aed151"/><file name="FeedGenerator.php" hash="2e2841a6187cff2bfd128cefb3f45590"/><file name="FeedManager.php" hash="8fa1be3c21d30e5d36b2cc5a7344fd0b"/><dir name="Generators"><file name="AttributeGenerator.php" hash="7c42b7aad7e82adc7faa20a156389dc5"/><file name="CategoryGenerator.php" hash="93fa6b7f3b3d06e06390888681eba94d"/><file name="DemoGenerator.php" hash="b6e0612249d5ac460bd8f5d3a478fa03"/><file name="GeneratorContext.php" hash="65e0ca2c7bb9e7e971e5ce70f60db639"/><file name="GeneratorInterface.php" hash="8429040b4a235f3d036c6e05c74da945"/><file name="MetaGenerator.php" hash="1fc2d82062353e32aa9cd0b5a3e4cf92"/><file name="PriceGenerator.php" hash="5e3aa9b3ab28f0fab46bfe222ab46ef8"/><file name="ProductGenerator.php" hash="53fd2a9eee68b7355220778915c4c5a0"/></dir><dir name="Resource"><file name="FeedManager.php" hash="1aaf710eb3a2a0faf9975e04751a0ffe"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="65cc33439803b330a1edc63a7e157aeb"/><file name="Loglevel.php" hash="d6f55cdf860f3a04a4cc66e9d07f2690"/><file name="Minigrid.php" hash="d22a3dac552aa9702d6dd78914908157"/></dir><dir name="Source"><file name="Attributes.php" hash="3ef527a83eab735a4d96efd7c8b4abab"/><dir name="Cron"><file name="Frequency.php" hash="813fa35468c79ab091222bfdacaac10c"/></dir><file name="Emailsetting.php" hash="05381cab1a6cbfa927bf057738ecde36"/><dir name="Minigrid"><file name="Abstract.php" hash="bea6e5915b98615f23a14e7b9ba47e26"/><file name="Attributes.php" hash="7cdaeac2ec3af87c646c1f19230bd61d"/></dir></dir></dir></dir></dir><file name="NotificationException.php" hash="f9b2751fe6b842b0f478e6af315c3504"/><dir name="controllers"><dir name="Adminhtml"><file name="SliController.php" hash="4e1aa872aefda9d14bdc0c2e161720eb"/></dir><file name="ApiController.php" hash="6bea6fe1136126cb87fc7510e9f6f789"/><file name="SearchController.php" hash="59ed22f3094a50e58e4db51ad885ff78"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9dc07e335dcc973c32e06252d1706475"/><file name="config.xml" hash="f39552576d2fcfe2fd5c68ed55024036"/><file name="system.xml" hash="31ad108c60f8aa327f7e3bb37bdee35e"/></dir><dir name="sql"><dir name="sli_search_setup"><file name="install-1.0.0.php" hash="93ed7171c20b348ada1911bda071a3f3"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sli"><dir name="search"><dir name="email"><file name="messages.phtml" hash="a1c625234e566d8c3b8e38eae87ef771"/></dir><dir name="sysconfig"><file name="ba_minigrid_js.phtml" hash="479e1c0c96604837fca9f2e02df04a2b"/><dir name="generate"><file name="js.phtml" hash="ba33a2176318c8639d8627b051beb949"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="sli"><file name="search.xml" hash="3b30097cb35b8887c19d5da934dd8ce5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SLI_Search.xml" hash="6c577c136e2170969e0b3afba1a7b426"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sli"><file name="feed_email_template.html" hash="41f77fe9e8525320c954ad7afbeff584"/></dir></dir></dir></dir></target><target name="mage"><dir name="shell"><dir name="sli"><file name="feed.php" hash="80d7556f6f026ab7bd56cdbfed9c4b97"/></dir></dir></target></contents>
27
  <compatible/>
28
- <dependencies><required><php><min>5.3.19</min><max>5.6.22</max></php></required></dependencies>
29
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>slisearch</name>
4
+ <version>3.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://sli-systems.com/lsc">SLI Feed Generation</license>
7
  <channel>community</channel>
9
  <summary>LSC integrates Magento with SLI's SaaS based Learning Search, Learning Navigation and user based SEO products.</summary>
10
  <description>Learning Search Connect (LSC) produces data feeds out of current Magento Community and Enterprise editions. The feeds are created and then sent to SLI's FTP servers for further processing.</description>
11
  <notes>Changes since last release:&#xD;
12
+ * Improved support for exporting Product Inventory Quantity &#xD;
13
+ * Improved support for exporting Out of Stock Products&#xD;
14
+ * Optimised generation of category list in the feed&#xD;
15
+ </notes>
 
 
 
 
 
 
 
16
  <authors><author><name>Platform support</name><user>SLI-Systems</user><email>support@sli-system.com</email></author></authors>
17
+ <date>2016-09-14</date>
18
+ <time>03:06:39</time>
19
+ <contents><target name="magecommunity"><dir name="SLI"><dir name="Search"><dir name="Block"><dir name="Search"><dir name="Form"><file name="Mini.php" hash="bf98fdd4a73b0536cf6fd0f7bd15f7cd"/></dir><dir name="Js"><file name="Bottom.php" hash="448c67f3ea49538b522eec5fb67ad6ec"/><file name="Top.php" hash="48a2ef9314240ae7f2a7b137073cfead"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Minigrid.php" hash="061fc5d94bd40fa21cf5aa9040acdd38"/><file name="Version.php" hash="cd803ee6529cc62a7af31dbaef38f0e2"/></dir></dir><file name="Form.php" hash="08e1291b012bff41bc8f3df6644fc763"/><dir name="Frontend"><dir name="Feed"><dir name="Generate"><file name="Js.php" hash="b58600180eb6b6b773cd1561cd9d6c27"/></dir><file name="Generate.php" hash="87cfb67934be30bcfbd208f99839c16c"/><file name="Next.php" hash="6270ea4de96286999eefbe8843b2c391"/></dir></dir></dir></dir></dir><file name="Exception.php" hash="5ccdacc40bd1fa4e0bff9e1052135ed7"/><dir name="Helper"><file name="Data.php" hash="3525ed62c3a40e8dc7e902b85bd45e2f"/><file name="Feed.php" hash="e2c94e7990ef4471acffa3f2ace080a4"/><file name="FeedLogger.php" hash="78ab2597e31741ba19734d8fc636621d"/><file name="XmlWriter.php" hash="dae24ab82da564645cf6f97701d30a63"/></dir><dir name="Model"><file name="Cron.php" hash="c62a9de1e84322674e6f1fac0f4c7a2d"/><file name="Email.php" hash="d19ecbae60401f770518e28c70aed151"/><file name="FeedGenerator.php" hash="2e2841a6187cff2bfd128cefb3f45590"/><file name="FeedManager.php" hash="8fa1be3c21d30e5d36b2cc5a7344fd0b"/><dir name="Generators"><file name="AttributeGenerator.php" hash="4aa97bc629290d8907a4339567260240"/><file name="CategoryGenerator.php" hash="7ccad450f9575d1f3864548c0a1040ac"/><file name="DemoGenerator.php" hash="b6e0612249d5ac460bd8f5d3a478fa03"/><file name="GeneratorContext.php" hash="f95f6e2e7c6afcedc6cbf79af3e45508"/><file name="GeneratorInterface.php" hash="8429040b4a235f3d036c6e05c74da945"/><file name="MetaGenerator.php" hash="1fc2d82062353e32aa9cd0b5a3e4cf92"/><file name="PriceGenerator.php" hash="64cc15592e6e34a902b89f4c311cb67d"/><file name="ProductGenerator.php" hash="4df4f037c584c4f6448e9a7029381b92"/></dir><dir name="Resource"><file name="FeedManager.php" hash="1aaf710eb3a2a0faf9975e04751a0ffe"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="65cc33439803b330a1edc63a7e157aeb"/><file name="Loglevel.php" hash="c7ee00f5dfe214e8983f068923f50613"/><file name="Minigrid.php" hash="d22a3dac552aa9702d6dd78914908157"/></dir><dir name="Source"><file name="Attributes.php" hash="3b6b23b6329504d772f0962b1a2bfc9c"/><dir name="Cron"><file name="Frequency.php" hash="813fa35468c79ab091222bfdacaac10c"/></dir><file name="Emailsetting.php" hash="05381cab1a6cbfa927bf057738ecde36"/><dir name="Minigrid"><file name="Abstract.php" hash="44b3779f93f97f76f2d977c08cd5dcd3"/><file name="Attributes.php" hash="7cdaeac2ec3af87c646c1f19230bd61d"/></dir></dir></dir></dir></dir><file name="NotificationException.php" hash="6915c015929f011034bdd88faea97ae5"/><dir name="controllers"><dir name="Adminhtml"><file name="SliController.php" hash="4e1aa872aefda9d14bdc0c2e161720eb"/></dir><file name="ApiController.php" hash="6bea6fe1136126cb87fc7510e9f6f789"/><file name="SearchController.php" hash="fbbc82e8a409e31a030444f65038384e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="fca437afe6b4e0580e5396c55f6fa03f"/><file name="config.xml" hash="a55a4585170a415a33466b9625f6374d"/><file name="system.xml" hash="31ad108c60f8aa327f7e3bb37bdee35e"/></dir><dir name="sql"><dir name="sli_search_setup"><file name="install-1.0.0.php" hash="84f463ef2a22a4c8a7d7e98444a8a061"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sli"><dir name="search"><dir name="email"><file name="messages.phtml" hash="e5119644fcf691444912c12e55d8f4d8"/></dir><dir name="sysconfig"><file name="ba_minigrid_js.phtml" hash="479e1c0c96604837fca9f2e02df04a2b"/><dir name="generate"><file name="js.phtml" hash="c17ec76fc996dae536811cc6197106e3"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="sli"><file name="search.xml" hash="3b30097cb35b8887c19d5da934dd8ce5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SLI_Search.xml" hash="0724a024d417713ef8620d91de1982cd"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sli"><file name="feed_email_template.html" hash="41f77fe9e8525320c954ad7afbeff584"/></dir></dir></dir></dir></target><target name="mage"><dir name="shell"><dir name="sli"><file name="feed.php" hash="80d7556f6f026ab7bd56cdbfed9c4b97"/></dir></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.3.19</min><max>5.6.25</max></php></required></dependencies>
22
  </package>