Klevu_SmartSearch - Version 1.1.16

Version Notes

-Special price change
-category product change
-get klevu current version
-image change
-klevu template landing page in controller
-multiple search box
-https fix
-add webstore code in webstore url

Download this release

Release Info

Developer Klevu
Extension Klevu_SmartSearch
Version 1.1.16
Comparing to
See all releases


Code changes from version 1.1.15 to 1.1.16

Files changed (48) hide show
  1. app/code/community/Klevu/Search/Block/Adminhtml/Form/Field/Image/Button.php +0 -49
  2. app/code/community/Klevu/Search/Block/Adminhtml/Form/Field/Image/Log.php +1 -1
  3. app/code/community/Klevu/Search/Helper/Api.php +2 -1
  4. app/code/community/Klevu/Search/Helper/Config.php +5 -5
  5. app/code/community/Klevu/Search/Model/Api/Action/Addrecords.php +2 -1
  6. app/code/community/Klevu/Search/Model/CatalogSearch/Resource/Fulltext/Collection.php +9 -7
  7. app/code/community/Klevu/Search/Model/Observer.php +22 -4
  8. app/code/community/Klevu/Search/Model/Product/Sync.php +115 -151
  9. app/code/community/Klevu/Search/Test/Controller/CatalogSearch.php +7 -7
  10. app/code/community/Klevu/Search/Test/Controller/CatalogSearch/fixtures/search_results.yaml +5 -17
  11. app/code/community/Klevu/Search/Test/Helper/Api.php +1 -1
  12. app/code/community/Klevu/Search/Test/Helper/Config.php +17 -114
  13. app/code/community/Klevu/Search/Test/Helper/Config/fixtures/testGetOrderSyncEnabledFlag.yaml +1 -1
  14. app/code/community/Klevu/Search/Test/Helper/Config/fixtures/testGetProductSyncEnabledFlag.yaml +1 -1
  15. app/code/community/Klevu/Search/Test/Helper/Config/providers/testIsOrderSyncEnabled.yaml +0 -21
  16. app/code/community/Klevu/Search/Test/Helper/Config/providers/testIsProductSyncEnabled.yaml +1 -18
  17. app/code/community/Klevu/Search/Test/Helper/Config/providers/testIsTestModeEnabled.yaml +0 -16
  18. app/code/community/Klevu/Search/Test/Model/Api/Action/Idsearch.php +2 -2
  19. app/code/community/Klevu/Search/Test/Model/Api/Action/Producttracking.php +0 -1
  20. app/code/community/Klevu/Search/Test/Model/Api/Action/Producttracking/providers/testValidateRequiredFields.yaml +1 -2
  21. app/code/community/Klevu/Search/Test/Model/Api/Action/Startsession.php +2 -1
  22. app/code/community/Klevu/Search/Test/Model/Observer.php +88 -1
  23. app/code/community/Klevu/Search/Test/Model/Observer/fixtures/testLandingPageRewritesDisabled.yaml +2 -0
  24. app/code/community/Klevu/Search/Test/Model/Observer/fixtures/testLandingPageRewritesEnabled.yaml +2 -0
  25. app/code/community/Klevu/Search/Test/Model/Observer/fixtures/testScheduleOrderSync.yaml +3 -3
  26. app/code/community/Klevu/Search/Test/Model/Order/Sync/fixtures/testAddOrderToQueue.yaml +2 -2
  27. app/code/community/Klevu/Search/Test/Model/Order/Sync/fixtures/testClearQueue.yaml +2 -2
  28. app/code/community/Klevu/Search/Test/Model/Order/Sync/fixtures/testRun.yaml +3 -3
  29. app/code/community/Klevu/Search/Test/Model/Product/Sync.php +64 -1
  30. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testAddProducts.yaml +5 -5
  31. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testCatalogruleProducts.yaml +42 -0
  32. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testClearAllProducts.yaml +6 -7
  33. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testDeleteProducts.yaml +3 -4
  34. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testRun.yaml +12 -13
  35. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testSpecialpriceProducts.yaml +34 -0
  36. app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testUpdateProducts.yaml +11 -6
  37. app/code/community/Klevu/Search/controllers/Adminhtml/Klevu/SearchController.php +1 -15
  38. app/code/community/Klevu/Search/controllers/{SearchController.php → IndexController.php} +24 -24
  39. app/code/community/Klevu/Search/etc/config.xml +23 -24
  40. app/code/community/Klevu/Search/etc/system.xml +0 -23
  41. app/code/community/Klevu/Search/sql/klevu_search_setup/mysql4-data-upgrade-1.1.1-1.1.2.php +0 -13
  42. app/code/community/Klevu/Search/sql/klevu_search_setup/mysql4-data-upgrade-1.1.7-1.1.8.php +0 -113
  43. app/design/frontend/base/default/layout/klevu/search.xml +19 -9
  44. app/design/frontend/base/default/template/klevu/search/form_js.phtml +48 -21
  45. app/design/frontend/base/default/template/klevu/search/index.phtml +74 -0
  46. app/design/frontend/base/default/template/klevu/search/klevulog.phtml +1 -4
  47. app/design/frontend/base/default/template/klevu/search/product_tracking.phtml +0 -1
  48. package.xml +12 -5
app/code/community/Klevu/Search/Block/Adminhtml/Form/Field/Image/Button.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class Klevu_Search_Block_Adminhtml_Form_Field_Image_Button
5
- *
6
- * @method setStoreId($id)
7
- * @method string getStoreId()
8
- */
9
-
10
- class Klevu_Search_Block_Adminhtml_Form_Field_Image_Button extends Mage_Adminhtml_Block_System_Config_Form_Field {
11
-
12
- protected function _prepareLayout() {
13
- parent::_prepareLayout();
14
-
15
- // Set the default template
16
- if (!$this->getTemplate()) {
17
- $this->setTemplate('klevu/search/form/field/sync/button.phtml');
18
- }
19
-
20
- return $this;
21
- }
22
-
23
- public function render(Varien_Data_Form_Element_Abstract $element) {
24
- if ($element->getScope() == "stores") {
25
- $this->setStoreId($element->getScopeId());
26
- }
27
-
28
- // Remove the scope information so it doesn't get printed out
29
- $element
30
- ->unsScope()
31
- ->unsCanUseWebsiteValue()
32
- ->unsCanUseDefaultValue();
33
-
34
- return parent::render($element);
35
- }
36
-
37
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
38
- $url_params = ($this->getStoreId()) ? array("store" => $this->getStoreId()) : array();
39
- $label_suffix = ($this->getStoreId()) ? " for This Store" : "";
40
-
41
- $this->addData(array(
42
- "html_id" => $element->getHtmlId(),
43
- "button_label" => sprintf("Generate Thumbnails For All Products%s", $label_suffix),
44
- "destination_url" => $this->getUrl("adminhtml/klevu_search/generate_thumbnail", $url_params)
45
- ));
46
-
47
- return $this->_toHtml();
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Klevu/Search/Block/Adminhtml/Form/Field/Image/Log.php CHANGED
@@ -41,7 +41,7 @@ class Klevu_Search_Block_Adminhtml_Form_Field_Image_Log extends Mage_Adminhtml_B
41
  $this->addData(array(
42
  "html_id" => $element->getHtmlId(),
43
  "button_label" => sprintf("Send Log"),
44
- "destination_url" => $this->getUrl("klevu/search/runexternaly", $url_params)
45
  ));
46
 
47
  return $this->_toHtml();
41
  $this->addData(array(
42
  "html_id" => $element->getHtmlId(),
43
  "button_label" => sprintf("Send Log"),
44
+ "destination_url" => $this->getUrl("search/index/runexternaly", $url_params)
45
  ));
46
 
47
  return $this->_toHtml();
app/code/community/Klevu/Search/Helper/Api.php CHANGED
@@ -111,8 +111,9 @@ class Klevu_Search_Helper_Api extends Mage_Core_Helper_Abstract {
111
  * message: message to be displayed to the user.
112
  */
113
  public function createWebstore($customer_id, Mage_Core_Model_Store $store, $test_mode = false) {
114
- $name = sprintf("%s - %s - %s",
115
  $store->getWebsite()->getName(),
 
116
  $store->getName(),
117
  $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)
118
  );
111
  * message: message to be displayed to the user.
112
  */
113
  public function createWebstore($customer_id, Mage_Core_Model_Store $store, $test_mode = false) {
114
+ $name = sprintf("%s - %s - %s - %s",
115
  $store->getWebsite()->getName(),
116
+ $store->getCode(),
117
  $store->getName(),
118
  $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)
119
  );
app/code/community/Klevu/Search/Helper/Config.php CHANGED
@@ -32,7 +32,7 @@ class Klevu_Search_Helper_Config extends Mage_Core_Helper_Abstract {
32
  const XML_PATH_TEST_ANALYTICS_URL = "klevu_search/general/test_analytics_url";
33
  const XML_PATH_JS_URL = "klevu_search/general/js_url";
34
  const XML_PATH_TEST_JS_URL = "klevu_search/general/test_js_url";
35
- const Klevu_PRODUCT_FORCE_OLDERVERSION = 2;
36
 
37
  const DATETIME_FORMAT = "Y-m-d H:i:s T";
38
 
@@ -372,11 +372,11 @@ class Klevu_Search_Helper_Config extends Mage_Core_Helper_Abstract {
372
  public function isProductSyncEnabled($store_id = null) {
373
  $flag = $this->getProductSyncEnabledFlag($store_id);
374
 
375
- // static::Klevu_PRODUCT_FORCE_OLDERVERSION for handling of older version of klevu
376
  //if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
377
  return in_array($flag, array(
378
  Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,
379
- static::Klevu_PRODUCT_FORCE_OLDERVERSION
380
  ));
381
  //} else {
382
  // return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;
@@ -492,11 +492,11 @@ class Klevu_Search_Helper_Config extends Mage_Core_Helper_Abstract {
492
  */
493
  public function isOrderSyncEnabled($store = null) {
494
  $flag = $this->getOrderSyncEnabledFlag($store);
495
- // static::Klevu_PRODUCT_FORCE_OLDERVERSION for handling of older version of klevu
496
  //if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
497
  return in_array($flag, array(
498
  Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,
499
- static::Klevu_PRODUCT_FORCE_OLDERVERSION
500
  ));
501
  //} else {
502
  //return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;
32
  const XML_PATH_TEST_ANALYTICS_URL = "klevu_search/general/test_analytics_url";
33
  const XML_PATH_JS_URL = "klevu_search/general/js_url";
34
  const XML_PATH_TEST_JS_URL = "klevu_search/general/test_js_url";
35
+ const KLEVU_PRODUCT_FORCE_OLDERVERSION = 2;
36
 
37
  const DATETIME_FORMAT = "Y-m-d H:i:s T";
38
 
372
  public function isProductSyncEnabled($store_id = null) {
373
  $flag = $this->getProductSyncEnabledFlag($store_id);
374
 
375
+ // static::KLEVU_PRODUCT_FORCE_OLDERVERSION for handling of older version of klevu
376
  //if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
377
  return in_array($flag, array(
378
  Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,
379
+ static::KLEVU_PRODUCT_FORCE_OLDERVERSION
380
  ));
381
  //} else {
382
  // return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;
492
  */
493
  public function isOrderSyncEnabled($store = null) {
494
  $flag = $this->getOrderSyncEnabledFlag($store);
495
+ // static::KLEVU_PRODUCT_FORCE_OLDERVERSION for handling of older version of klevu
496
  //if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
497
  return in_array($flag, array(
498
  Klevu_Search_Model_System_Config_Source_Yesnoforced::YES,
499
+ static::KLEVU_PRODUCT_FORCE_OLDERVERSION
500
  ));
501
  //} else {
502
  //return $flag === Klevu_Search_Model_System_Config_Source_Yesnoforced::FORCED;
app/code/community/Klevu/Search/Model/Api/Action/Addrecords.php CHANGED
@@ -201,6 +201,7 @@ class Klevu_Search_Model_Api_Action_Addrecords extends Klevu_Search_Model_Api_Ac
201
  protected function prepareOtherAttributeToIndexParameters(&$record) {
202
  foreach ($record['otherAttributeToIndex'] as $key => &$value) {
203
  $key = $this->sanitiseOtherAttribute($key);
 
204
  if(is_array($value)){
205
  $label = $this->sanitiseOtherAttribute($value['label']);
206
  $value = $this->sanitiseOtherAttribute($value['values']);
@@ -208,7 +209,7 @@ class Klevu_Search_Model_Api_Action_Addrecords extends Klevu_Search_Model_Api_Ac
208
  $label = $this->sanitiseOtherAttribute($key);
209
  $value = $this->sanitiseOtherAttribute($value);
210
  }
211
-
212
  if (is_array($value)) {
213
  $value = implode(",", $value);
214
  }
201
  protected function prepareOtherAttributeToIndexParameters(&$record) {
202
  foreach ($record['otherAttributeToIndex'] as $key => &$value) {
203
  $key = $this->sanitiseOtherAttribute($key);
204
+
205
  if(is_array($value)){
206
  $label = $this->sanitiseOtherAttribute($value['label']);
207
  $value = $this->sanitiseOtherAttribute($value['values']);
209
  $label = $this->sanitiseOtherAttribute($key);
210
  $value = $this->sanitiseOtherAttribute($value);
211
  }
212
+
213
  if (is_array($value)) {
214
  $value = implode(",", $value);
215
  }
app/code/community/Klevu/Search/Model/CatalogSearch/Resource/Fulltext/Collection.php CHANGED
@@ -95,7 +95,6 @@ class Klevu_Search_Model_CatalogSearch_Resource_Fulltext_Collection extends Mage
95
  'klevuSort' => $this->_getSortOrder(),
96
  'enableFilters' => 'true',
97
  'filterResults' => $this->_getPreparedFilters(),
98
-
99
  );
100
  $this->log(Zend_Log::DEBUG, sprintf("Starting search for term: %s", $this->_getQuery()->getQueryText()));
101
  }
@@ -190,7 +189,7 @@ class Klevu_Search_Model_CatalogSearch_Resource_Fulltext_Collection extends Mage
190
 
191
  foreach ($this->_klevu_parent_child_ids as $item) {
192
 
193
-
194
  if ($item['parent_id'] > 0) {
195
  /** @var Mage_Catalog_Model_Product $parent */
196
  $parent = $this->_items[$item['parent_id']];
@@ -205,15 +204,18 @@ class Klevu_Search_Model_CatalogSearch_Resource_Fulltext_Collection extends Mage
205
 
206
  if ($child) {
207
  // Set children images on parent product
208
- if (($image = $child->getData('image')) != 'no_selection') {
 
209
  $parent->setData('image', $image);
210
  }
211
-
212
- if (($small_image = $child->getData('small_image')) != 'no_selection') {
 
213
  $parent->setData('small_image', $small_image);
214
  }
215
-
216
- if (($thumbnail = $child->getData('thumbnail')) != 'no_selection') {
 
217
  $parent->setData('thumbnail', $thumbnail);
218
  }
219
  }
95
  'klevuSort' => $this->_getSortOrder(),
96
  'enableFilters' => 'true',
97
  'filterResults' => $this->_getPreparedFilters(),
 
98
  );
99
  $this->log(Zend_Log::DEBUG, sprintf("Starting search for term: %s", $this->_getQuery()->getQueryText()));
100
  }
189
 
190
  foreach ($this->_klevu_parent_child_ids as $item) {
191
 
192
+
193
  if ($item['parent_id'] > 0) {
194
  /** @var Mage_Catalog_Model_Product $parent */
195
  $parent = $this->_items[$item['parent_id']];
204
 
205
  if ($child) {
206
  // Set children images on parent product
207
+ $image = $child->getData('image');
208
+ if ($child->getData('image') != 'no_selection' && !empty($image)) {
209
  $parent->setData('image', $image);
210
  }
211
+
212
+ $small_image = $child->getData('small_image');
213
+ if ($child->getData('small_image') != 'no_selection' && !empty($small_image)) {
214
  $parent->setData('small_image', $small_image);
215
  }
216
+
217
+ $thumbnail = $child->getData('thumbnail');
218
+ if ($child->getData('thumbnail') != 'no_selection' && !empty($thumbnail)) {
219
  $parent->setData('thumbnail', $thumbnail);
220
  }
221
  }
app/code/community/Klevu/Search/Model/Observer.php CHANGED
@@ -125,13 +125,31 @@ class Klevu_Search_Model_Observer extends Varien_Object {
125
  }
126
  }
127
  }
128
-
129
- public function removeTest()
130
- {
 
 
131
  Mage::getModel("klevu_search/product_sync")->removeTestMode();
132
 
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
 
137
- }
125
  }
126
  }
127
  }
128
+
129
+ /**
130
+ * Call remove testmode
131
+ */
132
+ public function removeTest() {
133
  Mage::getModel("klevu_search/product_sync")->removeTestMode();
134
 
135
  }
136
 
137
+ /**
138
+ * make prodcuts for update when category change products
139
+ */
140
+ public function setCategoryProductsToSync(Varien_Event_Observer $observer) {
141
+ try {
142
+ $updatedProductsIds = $observer->getData('product_ids');
143
+ if (count($updatedProductsIds) == 0) {
144
+ return;
145
+ }
146
+ Mage::getModel("klevu_search/product_sync")->updateSpecificProductIds($updatedProductsIds);
147
+
148
+ } catch (Exception $e) {
149
+ Mage::helper('klevu_search')->log(Zend_Log::CRIT, sprintf("Exception thrown in %s::%s - %s", __CLASS__, __METHOD__, $e->getMessage()));
150
+ }
151
+
152
+ }
153
 
154
 
155
+ }
app/code/community/Klevu/Search/Model/Product/Sync.php CHANGED
@@ -35,7 +35,12 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
35
  * deleting removed products since last sync.
36
  */
37
  public function run() {
 
38
  try {
 
 
 
 
39
  if ($this->isRunning(2)) {
40
  // Stop if another copy is already running
41
  $this->log(Zend_Log::INFO, "Stopping because another copy is already running.");
@@ -775,9 +780,14 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
775
  $stock_data = $this->getStockData($product_ids);
776
 
777
  $attribute_map = $this->getAttributeMap();
778
- $base_url = $this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
 
 
 
 
 
 
779
  $currency = $this->getStore()->getDefaultCurrencyCode();
780
- $media_url = $this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
781
  $media_url .= Mage::getModel('catalog/product_media_config')->getBaseMediaUrlAddition();
782
 
783
  foreach ($products as $index => &$product) {
@@ -848,17 +858,24 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
848
  break;
849
  } else if ($parent && $parent->getData($attribute) && $parent->getData($attribute) != "no_selection") {
850
  $product[$key] = $parent->getData($attribute);
 
851
  break;
852
  }
853
  }
854
  if ($product[$key] != "" && strpos($product[$key], "http") !== 0) {
855
  // Prepend media base url for relative image locations
 
 
856
  $imageResized = Mage::getBaseDir('media').DS."klevu_images".$product[$key];
857
  if (file_exists($imageResized)) {
858
- $product[$key] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."klevu_images".$product[$key];
 
 
 
 
859
  }else{
860
  $product[$key] = $media_url . $product[$key];
861
- }
862
  }
863
  break;
864
  case "salePrice":
@@ -892,6 +909,9 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
892
  }
893
  // show low price for config products
894
  $product['startPrice'] = $this->processPrice($price , $tax_class_id, $parent);
 
 
 
895
  } else {
896
  // Use price index prices to set the product price and start/end prices if available
897
  // Falling back to product price attribute if not
@@ -1447,7 +1467,7 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
1447
  foreach($attr->getSource()->getAllOptions(false) as $option) {
1448
  if (is_array($option['value'])) {
1449
  foreach ($option['value'] as $sub_option) {
1450
- if (strlen($sub_option)) {
1451
  $attribute_data[$attr->getAttributeCode()]['values'][$sub_option['value']] = $sub_option['label'];
1452
  }
1453
  }
@@ -1720,54 +1740,8 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
1720
 
1721
  return $this;
1722
  }
1723
- /**
1724
- * Generate thumbnail for search through out the cron job
1725
- * @return $this
1726
- */
1727
- public function generateThumbParrallel()
1728
- {
1729
- try {
1730
- Mage::helper("klevu_search")->log(Zend_Log::INFO, sprintf("Product thumbnail generation process is started."));
1731
- $this->curlRequest();
1732
- Mage::helper("klevu_search")->log(Zend_Log::INFO, sprintf("Product thumbnail generation process is completed successfully."));
1733
- } catch(Exception $e) {
1734
- Mage::log($e->getMessage(),null,'klevu_Search.log');
1735
- }
1736
- }
1737
- /**
1738
- * Generate Parrallel curl request
1739
- * @return $this
1740
- */
1741
- public function curlRequest()
1742
- {
1743
- $query = $this->getConnection()->select()
1744
- ->from($this->getTableName("klevu_search/image_thumb"), array('id'))
1745
- ->where('is_processed=?',0)
1746
- ->limit(4);
1747
- $data = $query->query()->fetchAll();
1748
- if(count($data) > 0) {
1749
- $curl_multi_handle = curl_multi_init();
1750
- foreach($data as $key => $value)
1751
- {
1752
- Mage::getModel('klevu_search/product_sync')->isBelowMemoryLimit();
1753
- $url = Mage::getUrl("klevu/search/index",array("id" => $value['id']));
1754
- $curl_array[$value['id']] = curl_init($url);
1755
- curl_setopt($curl_array[$value['id']], CURLOPT_RETURNTRANSFER, true);
1756
- //Add a normal cURL handle to a cURL multi handle
1757
- curl_multi_add_handle($curl_multi_handle, $curl_array[$value['id']]);
1758
- $running = NULL;
1759
- do {
1760
- //Run the sub-connections of the current cURL handle
1761
- $mrc = curl_multi_exec($curl_multi_handle,$running);
1762
- } while($running > 0) ;
1763
-
1764
- }
1765
- curl_multi_close($curl_multi_handle);
1766
- }
1767
- if(count($data) > 0 && $running==0) {
1768
- $this->curlRequest();
1769
- }
1770
- }
1771
  /**
1772
  * Generate batch for thumbnail image
1773
  * @param $image
@@ -1776,72 +1750,28 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
1776
 
1777
  public function thumbImage($image)
1778
  {
1779
- $_imageUrl = Mage::getBaseDir('media').DS."catalog".DS."product".$image;
1780
- $imageResized = Mage::getBaseDir('media').DS."klevu_images".$image;
1781
- if(!file_exists($imageResized)&& file_exists($_imageUrl)) :
1782
- $imageObj = new Varien_Image($_imageUrl);
1783
- $imageObj->constrainOnly(TRUE);
1784
- $imageObj->keepAspectRatio(TRUE);
1785
- $imageObj->keepFrame(FALSE);
1786
- $imageObj->resize(140, 140);
1787
- $imageObj->save($imageResized);
1788
- endif;
1789
- }
1790
-
1791
- /**
1792
- * Create batch for thumbnail image
1793
- * @return $this
1794
- */
1795
- public function getEntityIds()
1796
- {
1797
- $this->getConnection()->delete($this->getTableName("klevu_search/image_thumb"));
1798
- $select = $this->getConnection()->select()
1799
- ->from($this->getTableName("catalog_product_entity"), array('entity_id'));
1800
- $data = $this->getConnection()->fetchAll($select);
1801
- foreach ($data as $key => $value) {
1802
- $entity_ids[] = $value['entity_id'];
1803
- }
1804
- $thum_batch = array_chunk($entity_ids,100);
1805
- foreach($thum_batch as $key => $value)
1806
- {
1807
- $this->getConnection()->insert($this->getTableName('klevu_search/image_thumb'),
1808
- array(
1809
- 'batchdata'=>serialize($value)
1810
- ));
1811
  }
1812
  }
 
1813
 
1814
- /**
1815
- * Get the batch which are not processed
1816
- * @param $id
1817
- * @return $this
1818
- */
1819
- public function getImageProcessingIds($id)
1820
- {
1821
- $query = $this->getConnection()->select()
1822
- ->from($this->getTableName("klevu_search/image_thumb"), array('batchdata'))
1823
- ->where("id=:id AND is_processed=:is_processed")
1824
- ->bind(array(
1825
- 'id' => $id,
1826
- 'is_processed' => 0,
1827
- ));
1828
- $data = $this->getConnection()->fetchAll($query, $query->getBind());
1829
- return $data;
1830
- }
1831
- /**
1832
- * Update the batch which are not processed
1833
- * @param $id
1834
- * @return $this
1835
- */
1836
- public function updateImageProcessingIds($id)
1837
- {
1838
- $where = $this->getConnection()->quoteInto("id = ?", $id);
1839
- $this->getConnection()->update(
1840
- $this->getTableName('klevu_search/image_thumb'),
1841
- array('is_processed' => '1'),
1842
- $where
1843
- );
1844
- }
1845
 
1846
 
1847
  /**
@@ -1884,41 +1814,7 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
1884
  ->schedule();
1885
  }
1886
  }
1887
- /**
1888
- * Schedule Image Cron Using Admin action
1889
- * @return $this
1890
- */
1891
- public function scheduleImageCron($time = "now") {
1892
- if (! $time instanceof DateTime) {
1893
- $time = new DateTime($time);
1894
- } else {
1895
- // Don't modify the original parameter
1896
- $time = clone $time;
1897
- }
1898
- $time_str = $time->format("Y-m-d H:i:00");
1899
- $before_str = $time->modify("15 minutes ago")->format("Y-m-d H:i:00");
1900
- $after_str = $time->modify("30 minutes")->format("Y-m-d H:i:00"); // Modifying the same DateTime object, so it's -15 + 30 = +15 minutes
1901
-
1902
- // Check if Product image cron is not already scheduled to run around (±15 minutes) that time
1903
- $collection = Mage::getResourceModel('cron/schedule_collection')
1904
- ->addFieldToFilter("job_code", 'klevu_search_product_thumb')
1905
- ->addFieldToFilter("status", Mage_Cron_Model_Schedule::STATUS_PENDING)
1906
- ->addFieldToFilter("scheduled_at", array(
1907
- "from" => $before_str,
1908
- "to" => $after_str
1909
- ));
1910
-
1911
- if ($collection->getSize() == 0) {
1912
- $schedule = Mage::getModel('cron/schedule');
1913
- $schedule
1914
- ->setJobCode('klevu_search_product_thumb')
1915
- ->setCreatedAt($time_str)
1916
- ->setScheduledAt($time_str)
1917
- ->setStatus(Mage_Cron_Model_Schedule::STATUS_PENDING)
1918
- ->save();
1919
- }
1920
- return $this;
1921
- }
1922
 
1923
  /**
1924
  * Delete test mode data from product sync
@@ -1966,4 +1862,72 @@ class Klevu_Search_Model_Product_Sync extends Klevu_Search_Model_Sync {
1966
  }
1967
  }
1968
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1969
  }
35
  * deleting removed products since last sync.
36
  */
37
  public function run() {
38
+
39
  try {
40
+
41
+ /* mark for update special price product */
42
+ $this->markProductForupdate();
43
+
44
  if ($this->isRunning(2)) {
45
  // Stop if another copy is already running
46
  $this->log(Zend_Log::INFO, "Stopping because another copy is already running.");
780
  $stock_data = $this->getStockData($product_ids);
781
 
782
  $attribute_map = $this->getAttributeMap();
783
+ if(Mage::app()->getStore()->isFrontUrlSecure()) {
784
+ $base_url = $this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK,true);
785
+ $media_url = $this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA,true);
786
+ }else {
787
+ $base_url = $this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
788
+ $media_url = $this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
789
+ }
790
  $currency = $this->getStore()->getDefaultCurrencyCode();
 
791
  $media_url .= Mage::getModel('catalog/product_media_config')->getBaseMediaUrlAddition();
792
 
793
  foreach ($products as $index => &$product) {
858
  break;
859
  } else if ($parent && $parent->getData($attribute) && $parent->getData($attribute) != "no_selection") {
860
  $product[$key] = $parent->getData($attribute);
861
+
862
  break;
863
  }
864
  }
865
  if ($product[$key] != "" && strpos($product[$key], "http") !== 0) {
866
  // Prepend media base url for relative image locations
867
+ //generate thumbnail image for each products
868
+ Mage::getModel('klevu_search/product_sync')->thumbImage($product[$key]);
869
  $imageResized = Mage::getBaseDir('media').DS."klevu_images".$product[$key];
870
  if (file_exists($imageResized)) {
871
+ if(Mage::app()->getStore()->isFrontUrlSecure()) {
872
+ $product[$key] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA,true)."klevu_images".$product[$key];
873
+ } else {
874
+ $product[$key] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."klevu_images".$product[$key];
875
+ }
876
  }else{
877
  $product[$key] = $media_url . $product[$key];
878
+ }
879
  }
880
  break;
881
  case "salePrice":
909
  }
910
  // show low price for config products
911
  $product['startPrice'] = $this->processPrice($price , $tax_class_id, $parent);
912
+
913
+ // also send sale price for sorting and filters for klevu
914
+ $product['salePrice'] = $this->processPrice($price , $tax_class_id, $parent);
915
  } else {
916
  // Use price index prices to set the product price and start/end prices if available
917
  // Falling back to product price attribute if not
1467
  foreach($attr->getSource()->getAllOptions(false) as $option) {
1468
  if (is_array($option['value'])) {
1469
  foreach ($option['value'] as $sub_option) {
1470
+ if(count($sub_option) > 0) {
1471
  $attribute_data[$attr->getAttributeCode()]['values'][$sub_option['value']] = $sub_option['label'];
1472
  }
1473
  }
1740
 
1741
  return $this;
1742
  }
1743
+
1744
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1745
  /**
1746
  * Generate batch for thumbnail image
1747
  * @param $image
1750
 
1751
  public function thumbImage($image)
1752
  {
1753
+ try {
1754
+ $_imageUrl = Mage::getBaseDir('media').DS."catalog".DS."product".$image;
1755
+ if(file_exists($_imageUrl)) {
1756
+ list($width, $height, $type, $attr)=getimagesize($_imageUrl);
1757
+ if($width > 200 && $height > 200) {
1758
+ $imageResized = Mage::getBaseDir('media').DS."klevu_images".$image;
1759
+ if(!file_exists($imageResized)&& file_exists($_imageUrl)) {
1760
+ $imageObj = new Varien_Image($_imageUrl);
1761
+ $imageObj->constrainOnly(TRUE);
1762
+ $imageObj->keepAspectRatio(TRUE);
1763
+ $imageObj->keepFrame(FALSE);
1764
+ $imageObj->resize(200, 200);
1765
+ $imageObj->save($imageResized);
1766
+ }
1767
+ }
1768
+ }
1769
+ }catch(Exception $e) {
1770
+ Mage::helper('klevu_search')->log(Zend_Log::DEBUG, sprintf("Image Error:\n%s", $e->getMessage()));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1771
  }
1772
  }
1773
+
1774
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1775
 
1776
 
1777
  /**
1814
  ->schedule();
1815
  }
1816
  }
1817
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1818
 
1819
  /**
1820
  * Delete test mode data from product sync
1862
  }
1863
  }
1864
  }
1865
+ /**
1866
+ * Get special price expire date attribute value
1867
+ * @return array
1868
+ */
1869
+ public function getExpiryDateAttributeId() {
1870
+ $query = $this->getConnection()->select()
1871
+ ->from($this->getTableName("eav_attribute"), array('attribute_id'))
1872
+ ->where('attribute_code=?','special_to_date');
1873
+ $data = $query->query()->fetchAll();
1874
+ return $data[0]['attribute_id'];
1875
+ }
1876
+
1877
+ /**
1878
+ * Get prodcuts ids which have expiry date gone and update next day
1879
+ * @return array
1880
+ */
1881
+ public function getExpirySaleProductsIds() {
1882
+ $attribute_id = $this->getExpiryDateAttributeId();
1883
+ $current_date = date_create("now")->format("Y-m-d");
1884
+ $query = $this->getConnection()->select()
1885
+ ->from($this->getTableName("catalog_product_entity_datetime"), array('entity_id'))
1886
+ ->where("attribute_id=:attribute_id AND DATE_ADD(value,INTERVAL 1 DAY)=:current_date")
1887
+ ->bind(array(
1888
+ 'attribute_id' => $attribute_id,
1889
+ 'current_date' => $current_date
1890
+ ));
1891
+ $data = $this->getConnection()->fetchAll($query, $query->getBind());
1892
+ $pro_ids = array();
1893
+ foreach($data as $key => $value)
1894
+ {
1895
+ $pro_ids[] = $value['entity_id'];
1896
+ }
1897
+ return $pro_ids;
1898
+
1899
+ }
1900
+
1901
+
1902
+ /**
1903
+ * if special to price date expire then make that product for update
1904
+ * @return $this
1905
+ */
1906
+ public function markProductForupdate(){
1907
+ try {
1908
+ $special_pro_ids = $this->getExpirySaleProductsIds();
1909
+ if(!empty($special_pro_ids)) {
1910
+ $this->updateSpecificProductIds($special_pro_ids);
1911
+ }
1912
+
1913
+ } catch(Exception $e) {
1914
+ Mage::helper('klevu_search')->log(Zend_Log::CRIT, sprintf("Exception thrown in markforupdate %s::%s - %s", __CLASS__, __METHOD__, $e->getMessage()));
1915
+ }
1916
+ }
1917
+
1918
+ /**
1919
+ * Mark prodcut ids for update
1920
+ * @return
1921
+ */
1922
+ public function updateSpecificProductIds($ids)
1923
+ {
1924
+ $pro_ids = implode(',', $ids);
1925
+ $where = sprintf("product_id IN(%s) OR parent_id IN(%s)", $pro_ids, $pro_ids);
1926
+ $resource = Mage::getSingleton('core/resource');
1927
+ $resource->getConnection('core_write')->update(
1928
+ $resource->getTableName('klevu_search/product_sync'),
1929
+ array('last_synced_at' => '0'),
1930
+ $where
1931
+ );
1932
+ }
1933
  }
app/code/community/Klevu/Search/Test/Controller/CatalogSearch.php CHANGED
@@ -108,7 +108,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
108
  * @loadFixture search_results
109
  */
110
  public function testSearchCategoryFilterIsApplied() {
111
- $this->app()->getRequest()->setQuery('cat', '3');
112
  $this->mockAndDispatchSearchResults();
113
 
114
  $this->assertCount(1, $this->getAppliedFilters()); // We expect only 1 applied filter.
@@ -134,7 +134,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
134
  * @loadFixture search_results
135
  */
136
  public function testMultipleFiltersCanBeApplied() {
137
- $this->app()->getRequest()->setQuery(array('price' => '0-49', 'cat' => '3'));
138
  $this->mockAndDispatchSearchResults();
139
 
140
  $this->assertCount(2, $this->getAppliedFilters()); // We expect 2 applied filters.
@@ -147,7 +147,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
147
  */
148
  public function testChangingSortOrderToPriceDesc() {
149
  $this->app()->getRequest()->setQuery(array('dir' => 'desc', 'order' => 'price'));
150
- $this->mockAndDispatchSearchResults('shirt', 'sorted');
151
  $result_block = $this->getSearchResultsBlock();
152
  // Set the updated mock collection
153
  $result_block->setCollection($this->collection);
@@ -174,7 +174,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
174
  // Default: page size = 9, set the page to page 2, meaning we expect to see results from 10+
175
  $this->getRequest()->setQuery('p', '2');
176
  // Our response will return the 10th product, our response contains a total result size of 10.
177
- $this->mockAndDispatchSearchResults('shirt', 'paged', 9);
178
 
179
  $result_block = $this->getSearchResultsBlock();
180
  $result_block->setCollection($this->collection);
@@ -236,7 +236,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
236
  * @return $this
237
  * @throws Zend_Controller_Exception
238
  */
239
- protected function mockAndDispatchSearchResults($query = 'shirt', $response_type = 'successful', $pagination = 0) {
240
  $this->mockApiAndCollection($query, $response_type, $pagination);
241
  // Set the search query
242
  $this->getRequest()->setQuery('q', $query);
@@ -245,7 +245,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
245
  return $this->dispatch('catalogsearch/result/index');
246
  }
247
 
248
- protected function mockApiAndCollection($query = 'shirt', $response_type = 'successful', $pagination = 0) {
249
  // Mock the API Action
250
  switch($response_type) {
251
  default:
@@ -266,7 +266,7 @@ class Klevu_Search_Test_Controller_CatalogSearch extends EcomDev_PHPUnit_Test_Ca
266
  $this->replaceApiActionByMock("klevu_search/api_action_idsearch", $response);
267
 
268
  $return_value = array(
269
- 'ticket' => 'some-api-key',
270
  'noOfResults' => 9,
271
  'term' => $query,
272
  'paginationStartsFrom' => $pagination,
108
  * @loadFixture search_results
109
  */
110
  public function testSearchCategoryFilterIsApplied() {
111
+ $this->app()->getRequest()->setQuery('cat', '2');
112
  $this->mockAndDispatchSearchResults();
113
 
114
  $this->assertCount(1, $this->getAppliedFilters()); // We expect only 1 applied filter.
134
  * @loadFixture search_results
135
  */
136
  public function testMultipleFiltersCanBeApplied() {
137
+ $this->app()->getRequest()->setQuery(array('price' => '0-49', 'cat' => '23'));
138
  $this->mockAndDispatchSearchResults();
139
 
140
  $this->assertCount(2, $this->getAppliedFilters()); // We expect 2 applied filters.
147
  */
148
  public function testChangingSortOrderToPriceDesc() {
149
  $this->app()->getRequest()->setQuery(array('dir' => 'desc', 'order' => 'price'));
150
+ $this->mockAndDispatchSearchResults('example', 'sorted');
151
  $result_block = $this->getSearchResultsBlock();
152
  // Set the updated mock collection
153
  $result_block->setCollection($this->collection);
174
  // Default: page size = 9, set the page to page 2, meaning we expect to see results from 10+
175
  $this->getRequest()->setQuery('p', '2');
176
  // Our response will return the 10th product, our response contains a total result size of 10.
177
+ $this->mockAndDispatchSearchResults('example', 'paged', 9);
178
 
179
  $result_block = $this->getSearchResultsBlock();
180
  $result_block->setCollection($this->collection);
236
  * @return $this
237
  * @throws Zend_Controller_Exception
238
  */
239
+ protected function mockAndDispatchSearchResults($query = 'example', $response_type = 'successful', $pagination = 0) {
240
  $this->mockApiAndCollection($query, $response_type, $pagination);
241
  // Set the search query
242
  $this->getRequest()->setQuery('q', $query);
245
  return $this->dispatch('catalogsearch/result/index');
246
  }
247
 
248
+ protected function mockApiAndCollection($query = 'example', $response_type = 'successful', $pagination = 0) {
249
  // Mock the API Action
250
  switch($response_type) {
251
  default:
266
  $this->replaceApiActionByMock("klevu_search/api_action_idsearch", $response);
267
 
268
  $return_value = array(
269
+ 'ticket' => 'klevu-14255510895641069',
270
  'noOfResults' => 9,
271
  'term' => $query,
272
  'paginationStartsFrom' => $pagination,
app/code/community/Klevu/Search/Test/Controller/CatalogSearch/fixtures/search_results.yaml CHANGED
@@ -1,25 +1,13 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_rest_api_key: test-api-key
5
- default/klevu_search/general/test_js_api_key: test-api-key
6
- default/klevu_search/product_sync/enabled: 2
7
  default/catalog/frontend/grid_per_page_values: 9,15,30
8
  default/catalog/frontend/grid_per_page: 9
 
9
  eav:
10
- catalog_category:
11
- - entity_id: 3
12
- parent_id: 2
13
- path: 1/2/3
14
- position: 2
15
- level: 2
16
- children_count: 0
17
- name: Test Category
18
- url_key: test-category
19
- is_active: 1
20
- is_anchor: 0
21
- display_mode: PRODUCTS
22
- include_in_menu: 1
23
  catalog_product:
24
  - entity_id: 1
25
  attribute_set_id: 4
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/landenabled: 0
4
+ default/klevu_search/general/rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
5
+ default/klevu_search/general/js_api_key: klevu-14255510895641069
6
+ default/klevu_search/product_sync/enabled: 1
7
  default/catalog/frontend/grid_per_page_values: 9,15,30
8
  default/catalog/frontend/grid_per_page: 9
9
+
10
  eav:
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  catalog_product:
12
  - entity_id: 1
13
  attribute_set_id: 4
app/code/community/Klevu/Search/Test/Helper/Api.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  class Klevu_Search_Test_Helper_Api extends EcomDev_PHPUnit_Test_Case {
3
 
4
- const VERSION_NUMBER = '1.1.2';
5
 
6
  public function testGetVersion() {
7
  $version = Mage::getConfig()->getModuleConfig('Klevu_Search')->version;
1
  <?php
2
  class Klevu_Search_Test_Helper_Api extends EcomDev_PHPUnit_Test_Case {
3
 
4
+ const VERSION_NUMBER = '1.1.12';
5
 
6
  public function testGetVersion() {
7
  $version = Mage::getConfig()->getModuleConfig('Klevu_Search')->version;
app/code/community/Klevu/Search/Test/Helper/Config.php CHANGED
@@ -13,11 +13,8 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
13
 
14
  protected function tearDown() {
15
  $this->getConfig()->deleteConfig("klevu_search/general/enabled");
16
- $this->getConfig()->deleteConfig("klevu_search/general/test_mode");
17
  $this->getConfig()->deleteConfig("klevu_search/general/js_api_key");
18
  $this->getConfig()->deleteConfig("klevu_search/general/rest_api_key");
19
- $this->getConfig()->deleteConfig("klevu_search/general/test_js_api_key");
20
- $this->getConfig()->deleteConfig("klevu_search/general/test_rest_api_key");
21
  $this->getConfig()->deleteConfig("klevu_search/product_sync/enabled");
22
  $this->getConfig()->deleteConfig("klevu_search/product_sync/frequency");
23
  $this->getConfig()->deleteConfig("klevu_search/attributes/additional");
@@ -45,50 +42,12 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
45
  $this->assertEquals(false, $this->helper->isExtensionEnabled());
46
  }
47
 
48
- /**
49
- * @test
50
- */
51
- public function testGetTestModeEnabledFlag() {
52
- $this->assertEquals(false, $this->helper->getTestModeEnabledFlag(),
53
- "Failed asserting that Test Mode flag is disabled by default."
54
- );
55
-
56
- $this->getConfig()
57
- ->saveConfig("klevu_search/general/test_mode", 1)
58
- ->cleanCache();
59
-
60
- $this->clearConfigCache();
61
-
62
- $this->assertEquals(true, $this->helper->getTestModeEnabledFlag(),
63
- "Failed asserting that Test Mode flag returns true when Test Mode is enabled in the config."
64
- );
65
- }
66
-
67
- /**
68
- * @test
69
- * @dataProvider dataProvider
70
- */
71
- public function testIsTestModeEnabled($test_mode, $is_production_domain, $result) {
72
- $this->getConfig()
73
- ->saveConfig("klevu_search/general/test_mode", $test_mode)
74
- ->cleanCache();
75
-
76
- $this->clearConfigCache();
77
-
78
- $this->mockIsProductionDomain($is_production_domain);
79
-
80
- $this->assertEquals($result, $this->helper->isTestModeEnabled());
81
- }
82
-
83
  /**
84
  * @test
85
  */
86
  public function testGetJsApiKeyProduction() {
87
- $api_key = "test-js-api-key";
88
-
89
- $this->mockIsProductionDomain(true);
90
-
91
- $this->assertEquals(null, $this->helper->getJsApiKey());
92
 
93
  $this->getConfig()
94
  ->saveConfig("klevu_search/general/js_api_key", $api_key)
@@ -98,35 +57,12 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
98
 
99
  $this->assertEquals($api_key, $this->helper->getJsApiKey());
100
  }
101
-
102
- /**
103
- * @test
104
- */
105
- public function testGetJsApiKeyStaging() {
106
- $api_key = "test-js-api-key";
107
-
108
- $this->mockIsProductionDomain(false);
109
-
110
- $this->assertEquals(null, $this->helper->getJsApiKey());
111
-
112
- $this->getConfig()
113
- ->saveConfig("klevu_search/general/test_js_api_key", $api_key)
114
- ->cleanCache();
115
-
116
- $this->clearConfigCache();
117
-
118
- $this->assertEquals($api_key, $this->helper->getJsApiKey());
119
- }
120
-
121
  /**
122
  * @test
123
  */
124
  public function testGetRestApiKeyProduction() {
125
- $api_key = "test-rest-api-key";
126
-
127
- $this->mockIsProductionDomain(true);
128
-
129
- $this->assertEquals(null, $this->helper->getRestApiKey());
130
 
131
  $this->getConfig()
132
  ->saveConfig("klevu_search/general/rest_api_key", $api_key)
@@ -136,31 +72,12 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
136
 
137
  $this->assertEquals($api_key, $this->helper->getRestApiKey());
138
  }
139
-
140
- /**
141
- * @test
142
- */
143
- public function testGetRestApiKeyStaging() {
144
- $api_key = "test-rest-api-key";
145
-
146
- $this->mockIsProductionDomain(false);
147
-
148
- $this->assertEquals(null, $this->helper->getRestApiKey());
149
-
150
- $this->getConfig()
151
- ->saveConfig("klevu_search/general/test_rest_api_key", $api_key)
152
- ->cleanCache();
153
-
154
- $this->clearConfigCache();
155
-
156
- $this->assertEquals($api_key, $this->helper->getRestApiKey());
157
- }
158
-
159
  /**
160
  * @test
161
  */
162
  public function testGetProductSyncEnabledFlagDefault() {
163
- $this->assertEquals(2, $this->helper->getProductSyncEnabledFlag());
164
  }
165
 
166
  /**
@@ -168,20 +85,15 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
168
  * @loadFixture
169
  */
170
  public function testGetProductSyncEnabledFlag() {
171
- $this->assertEquals(2, $this->helper->getProductSyncEnabledFlag());
172
  }
173
 
174
  /**
175
  * @test
176
  * @dataProvider dataProvider
177
  */
178
- public function testIsProductSyncEnabled($is_production_domain, $config_flag, $result) {
179
- $data_helper = $this->getHelperMock('klevu_search', array("isProductionDomain"));
180
- $data_helper
181
- ->expects($this->once())
182
- ->method("isProductionDomain")
183
- ->will($this->returnValue($is_production_domain));
184
- $this->replaceByMock("helper", "klevu_search", $data_helper);
185
 
186
  $this->clearConfigCache();
187
 
@@ -238,23 +150,14 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
238
  * @loadFixture
239
  */
240
  public function testGetOrderSyncEnabledFlag() {
241
- $this->assertEquals(2, $this->helper->getOrderSyncEnabledFlag());
242
  }
243
 
244
  /**
245
  * @test
246
  * @dataProvider dataProvider
247
  */
248
- public function testIsOrderSyncEnabled($is_production_domain, $config_flag, $result) {
249
- $data_helper = $this->getHelperMock('klevu_search', array("isProductionDomain"));
250
- $data_helper
251
- ->expects($this->once())
252
- ->method("isProductionDomain")
253
- ->will($this->returnValue($is_production_domain));
254
- $this->replaceByMock("helper", "klevu_search", $data_helper);
255
-
256
- $this->clearConfigCache();
257
-
258
  $this->getConfig()
259
  ->saveConfig("klevu_search/order_sync/enabled", $config_flag)
260
  ->cleanCache();
@@ -282,30 +185,30 @@ class Klevu_Search_Test_Helper_Config extends EcomDev_PHPUnit_Test_Case {
282
  */
283
  public function testIsLoggingForced() {
284
  // Test the default value
285
- $this->assertEquals(false, $this->helper->isLoggingForced());
286
 
287
  $this->clearConfigCache();
288
 
289
  // Test a set value
290
  $this->getConfig()
291
- ->saveConfig('klevu_search/developer/force_log', true)
292
  ->cleanCache();
293
 
294
- $this->assertEquals(true, $this->helper->isLoggingForced());
295
  }
296
 
297
  public function testGetLogLevel() {
298
  // Test the default value
299
- $this->assertEquals(Zend_Log::WARN, $this->helper->getLogLevel(), "getLogLevel() returned an incorrect default value.");
300
 
301
  $this->clearConfigCache();
302
 
303
  // Test a set value
304
  $this->getConfig()
305
- ->saveConfig('klevu_search/developer/log_level', Zend_Log::INFO)
306
  ->cleanCache();
307
 
308
- $this->assertEquals(Zend_Log::INFO, $this->helper->getLogLevel(), "getLogLevel() failed to return the value set.");
309
  }
310
 
311
  /**
13
 
14
  protected function tearDown() {
15
  $this->getConfig()->deleteConfig("klevu_search/general/enabled");
 
16
  $this->getConfig()->deleteConfig("klevu_search/general/js_api_key");
17
  $this->getConfig()->deleteConfig("klevu_search/general/rest_api_key");
 
 
18
  $this->getConfig()->deleteConfig("klevu_search/product_sync/enabled");
19
  $this->getConfig()->deleteConfig("klevu_search/product_sync/frequency");
20
  $this->getConfig()->deleteConfig("klevu_search/attributes/additional");
42
  $this->assertEquals(false, $this->helper->isExtensionEnabled());
43
  }
44
 
45
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  /**
47
  * @test
48
  */
49
  public function testGetJsApiKeyProduction() {
50
+ $api_key = 'klevu-14255510895641069';
 
 
 
 
51
 
52
  $this->getConfig()
53
  ->saveConfig("klevu_search/general/js_api_key", $api_key)
57
 
58
  $this->assertEquals($api_key, $this->helper->getJsApiKey());
59
  }
60
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * @test
63
  */
64
  public function testGetRestApiKeyProduction() {
65
+ $api_key = 'a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==';
 
 
 
 
66
 
67
  $this->getConfig()
68
  ->saveConfig("klevu_search/general/rest_api_key", $api_key)
72
 
73
  $this->assertEquals($api_key, $this->helper->getRestApiKey());
74
  }
75
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * @test
78
  */
79
  public function testGetProductSyncEnabledFlagDefault() {
80
+ $this->assertEquals(1, $this->helper->getProductSyncEnabledFlag());
81
  }
82
 
83
  /**
85
  * @loadFixture
86
  */
87
  public function testGetProductSyncEnabledFlag() {
88
+ $this->assertEquals(1, $this->helper->getProductSyncEnabledFlag());
89
  }
90
 
91
  /**
92
  * @test
93
  * @dataProvider dataProvider
94
  */
95
+ public function testIsProductSyncEnabled($config_flag, $result) {
96
+
 
 
 
 
 
97
 
98
  $this->clearConfigCache();
99
 
150
  * @loadFixture
151
  */
152
  public function testGetOrderSyncEnabledFlag() {
153
+ $this->assertEquals(1, $this->helper->getOrderSyncEnabledFlag());
154
  }
155
 
156
  /**
157
  * @test
158
  * @dataProvider dataProvider
159
  */
160
+ public function testIsOrderSyncEnabled($config_flag, $result) {
 
 
 
 
 
 
 
 
 
161
  $this->getConfig()
162
  ->saveConfig("klevu_search/order_sync/enabled", $config_flag)
163
  ->cleanCache();
185
  */
186
  public function testIsLoggingForced() {
187
  // Test the default value
188
+ $this->assertEquals(true, $this->helper->isLoggingForced());
189
 
190
  $this->clearConfigCache();
191
 
192
  // Test a set value
193
  $this->getConfig()
194
+ ->saveConfig('klevu_search/developer/force_log', false)
195
  ->cleanCache();
196
 
197
+ $this->assertEquals(false, $this->helper->isLoggingForced());
198
  }
199
 
200
  public function testGetLogLevel() {
201
  // Test the default value
202
+ $this->assertEquals(Zend_Log::INFO, $this->helper->getLogLevel(), "getLogLevel() returned an incorrect default value.");
203
 
204
  $this->clearConfigCache();
205
 
206
  // Test a set value
207
  $this->getConfig()
208
+ ->saveConfig('klevu_search/developer/log_level', Zend_Log::WARN)
209
  ->cleanCache();
210
 
211
+ $this->assertEquals(Zend_Log::WARN, $this->helper->getLogLevel(), "getLogLevel() failed to return the value set.");
212
  }
213
 
214
  /**
app/code/community/Klevu/Search/Test/Helper/Config/fixtures/testGetOrderSyncEnabledFlag.yaml CHANGED
@@ -1,2 +1,2 @@
1
  config:
2
- default/klevu_search/order_sync/enabled: 2
1
  config:
2
+ default/klevu_search/order_sync/enabled: 1
app/code/community/Klevu/Search/Test/Helper/Config/fixtures/testGetProductSyncEnabledFlag.yaml CHANGED
@@ -1,2 +1,2 @@
1
  config:
2
- default/klevu_search/product_sync/enabled: 2
1
  config:
2
+ default/klevu_search/product_sync/enabled: 1
app/code/community/Klevu/Search/Test/Helper/Config/providers/testIsOrderSyncEnabled.yaml CHANGED
@@ -1,24 +1,3 @@
1
  -
2
- is_production_domain: true
3
- config_flag: 0 # Disabled
4
- order_sync_enabled: false
5
- -
6
- is_production_domain: true
7
- config_flag: 1 # Enabled
8
- order_sync_enabled: true
9
- -
10
- is_production_domain: true
11
- config_flag: 2 # Forced
12
- order_sync_enabled: true
13
- -
14
- is_production_domain: false
15
- config_flag: 0 # Disabled
16
- order_sync_enabled: false
17
- -
18
- is_production_domain: false
19
  config_flag: 1 # Enabled
20
- order_sync_enabled: false
21
- -
22
- is_production_domain: false
23
- config_flag: 2 # Forced
24
  order_sync_enabled: true
1
  -
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  config_flag: 1 # Enabled
 
 
 
 
3
  order_sync_enabled: true
app/code/community/Klevu/Search/Test/Helper/Config/providers/testIsProductSyncEnabled.yaml CHANGED
@@ -1,24 +1,7 @@
1
  -
2
- is_production_domain: true
3
  config_flag: 0 # Disabled
4
  product_sync_enabled: false
5
  -
6
- is_production_domain: true
7
  config_flag: 1 # Enabled
8
  product_sync_enabled: true
9
- -
10
- is_production_domain: true
11
- config_flag: 2 # Forced
12
- product_sync_enabled: true
13
- -
14
- is_production_domain: false
15
- config_flag: 0 # Disabled
16
- product_sync_enabled: false
17
- -
18
- is_production_domain: false
19
- config_flag: 1 # Enabled
20
- product_sync_enabled: false
21
- -
22
- is_production_domain: false
23
- config_flag: 2 # Forced
24
- product_sync_enabled: true
1
  -
 
2
  config_flag: 0 # Disabled
3
  product_sync_enabled: false
4
  -
 
5
  config_flag: 1 # Enabled
6
  product_sync_enabled: true
7
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Klevu/Search/Test/Helper/Config/providers/testIsTestModeEnabled.yaml CHANGED
@@ -1,16 +0,0 @@
1
- -
2
- test_mode: 0
3
- is_production_domain: 0
4
- result: true
5
- -
6
- test_mode: 1
7
- is_production_domain: 0
8
- result: true
9
- -
10
- test_mode: 0
11
- is_production_domain: 1
12
- result: false
13
- -
14
- test_mode: 1
15
- is_production_domain: 1
16
- result: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Klevu/Search/Test/Model/Api/Action/Idsearch.php CHANGED
@@ -83,9 +83,9 @@ class Klevu_Search_Test_Model_Api_Action_Idsearch extends Klevu_Search_Test_Mode
83
 
84
  protected function getTestParameters() {
85
  return array(
86
- 'ticket' => 'test-search-api-key',
87
  'noOfResults' => 30,
88
- 'term' => 'computers',
89
  'paginationStartsFrom' => 0,
90
  'ipAddress' => '127.0.0.1',
91
  'klevuSort' => 'rel',
83
 
84
  protected function getTestParameters() {
85
  return array(
86
+ 'ticket' => 'klevu-14255510895641069',
87
  'noOfResults' => 30,
88
+ 'term' => 'exam',
89
  'paginationStartsFrom' => 0,
90
  'ipAddress' => '127.0.0.1',
91
  'klevuSort' => 'rel',
app/code/community/Klevu/Search/Test/Model/Api/Action/Producttracking.php CHANGED
@@ -69,7 +69,6 @@ class Klevu_Search_Test_Model_Api_Action_Producttracking extends Klevu_Search_Te
69
  'klevu_unit' => 1,
70
  'klevu_salePrice' => 100.00,
71
  'klevu_currency' => "GBP",
72
- 'klevu_shopperIP' => "127.0.0.1"
73
  );
74
  }
75
 
69
  'klevu_unit' => 1,
70
  'klevu_salePrice' => 100.00,
71
  'klevu_currency' => "GBP",
 
72
  );
73
  }
74
 
app/code/community/Klevu/Search/Test/Model/Api/Action/Producttracking/providers/testValidateRequiredFields.yaml CHANGED
@@ -10,5 +10,4 @@
10
  field: klevu_salePrice
11
  -
12
  field: klevu_currency
13
- -
14
- field: klevu_shopperIP
10
  field: klevu_salePrice
11
  -
12
  field: klevu_currency
13
+
 
app/code/community/Klevu/Search/Test/Model/Api/Action/Startsession.php CHANGED
@@ -4,7 +4,8 @@ class Klevu_Search_Test_Model_Api_Action_Startsession extends Klevu_Search_Test_
4
 
5
  public function testValidate() {
6
  $parameters = array(
7
- 'api_key' => "dGVzdC1hcGkta2V5"
 
8
  );
9
 
10
  $response = Mage::getModel('klevu_search/api_response');
4
 
5
  public function testValidate() {
6
  $parameters = array(
7
+ 'api_key' => "dGVzdC1hcGkta2V5",
8
+ 'store' => null
9
  );
10
 
11
  $response = Mage::getModel('klevu_search/api_response');
app/code/community/Klevu/Search/Test/Model/Observer.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  class Klevu_Search_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case {
4
 
5
  public function setUp() {
@@ -25,6 +27,12 @@ class Klevu_Search_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case {
25
  $resource = Mage::getModel("core/resource");
26
  $resource->getConnection("core_write")->delete($resource->getTableName("klevu_search/order_sync"));
27
 
 
 
 
 
 
 
28
  parent::tearDown();
29
  }
30
 
@@ -54,7 +62,7 @@ class Klevu_Search_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case {
54
  $observer->addData(array("event" => $event));
55
 
56
  $model->scheduleOrderSync($observer);
57
-
58
  $this->assertEquals(array(array("order_item_id" => "2")), $this->getOrderSyncQueue());
59
 
60
  $this->assertEquals(1, $this->getOrderSyncCronScheduleCollection()->getSize(),
@@ -62,6 +70,65 @@ class Klevu_Search_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case {
62
  );
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  /**
66
  * Return a cron/schedule collection filtered for Product Sync jobs only.
67
  *
@@ -95,4 +162,24 @@ class Klevu_Search_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case {
95
  ->from($resource->getTableName("klevu_search/order_sync"))
96
  );
97
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
1
  <?php
2
 
3
+ use EcomDev_PHPUnit_Test_Case_Util as TestUtil;
4
+
5
  class Klevu_Search_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case {
6
 
7
  public function setUp() {
27
  $resource = Mage::getModel("core/resource");
28
  $resource->getConnection("core_write")->delete($resource->getTableName("klevu_search/order_sync"));
29
 
30
+ EcomDev_Utils_Reflection::setRestrictedPropertyValue(
31
+ Mage::getConfig(),
32
+ "_classNameCache",
33
+ array()
34
+ );
35
+
36
  parent::tearDown();
37
  }
38
 
62
  $observer->addData(array("event" => $event));
63
 
64
  $model->scheduleOrderSync($observer);
65
+
66
  $this->assertEquals(array(array("order_item_id" => "2")), $this->getOrderSyncQueue());
67
 
68
  $this->assertEquals(1, $this->getOrderSyncCronScheduleCollection()->getSize(),
70
  );
71
  }
72
 
73
+ /**
74
+ * @test
75
+ * @loadFixture
76
+ */
77
+ public function testLandingPageRewritesDisabled() {
78
+ Mage::getModel("klevu_search/observer")->applyLandingPageModelRewrites(new Varien_Event_Observer());
79
+
80
+ foreach ($this->getLandingPageRewrites() as $type => $rewrites) {
81
+ foreach ($rewrites as $name => $class) {
82
+ $object = null;
83
+ switch ($type) {
84
+ case "resource":
85
+ $object = Mage::getResourceModel($name);
86
+ break;
87
+ case "model":
88
+ default:
89
+ $object = Mage::getModel($name);
90
+ }
91
+
92
+ $this->assertNotInstanceOf($class, $object,
93
+ sprintf("Failed asserting that %s %s is not rewritten when landing page is disabled.",
94
+ $name,
95
+ $type
96
+ )
97
+ );
98
+ }
99
+ }
100
+ }
101
+
102
+ /**
103
+ * @test
104
+ * @loadFixture
105
+ */
106
+ public function testLandingPageRewritesEnabled() {
107
+ Mage::getModel("klevu_search/observer")->applyLandingPageModelRewrites(new Varien_Event_Observer());
108
+
109
+ foreach ($this->getLandingPageRewrites() as $type => $rewrites) {
110
+ foreach ($rewrites as $name => $class) {
111
+ $object = null;
112
+ switch ($type) {
113
+ case "resource":
114
+ $object = Mage::getResourceModel($name);
115
+ break;
116
+ case "model":
117
+ default:
118
+ $object = Mage::getModel($name);
119
+ }
120
+
121
+ $this->assertInstanceOf($class, $object,
122
+ sprintf("Failed asserting that %s %s gets rewritten to %s when landing page is enabled.",
123
+ $name,
124
+ $type,
125
+ $class
126
+ )
127
+ );
128
+ }
129
+ }
130
+ }
131
+
132
  /**
133
  * Return a cron/schedule collection filtered for Product Sync jobs only.
134
  *
162
  ->from($resource->getTableName("klevu_search/order_sync"))
163
  );
164
  }
165
+
166
+ /**
167
+ * Return the model rewrites the landing page is expected to have.
168
+ *
169
+ * @return array
170
+ */
171
+ protected function getLandingPageRewrites() {
172
+ return array(
173
+ "resource" => array(
174
+ "catalogsearch/fulltext_collection" => "Klevu_Search_Model_CatalogSearch_Resource_Fulltext_Collection",
175
+ "catalog/layer_filter_attribute" => "Klevu_Search_Model_CatalogSearch_Resource_Layer_Filter_Attribute"
176
+ ),
177
+ "model" => array(
178
+ "catalogsearch/layer_filter_attribute" => "Klevu_Search_Model_CatalogSearch_Layer_Filter_Attribute",
179
+ "catalog/layer_filter_price" => "Klevu_Search_Model_CatalogSearch_Layer_Filter_Price",
180
+ "catalog/layer_filter_category" => "Klevu_Search_Model_CatalogSearch_Layer_Filter_Category",
181
+ "catalog/config" => "Klevu_Search_Model_Catalog_Model_Config"
182
+ )
183
+ );
184
+ }
185
  }
app/code/community/Klevu/Search/Test/Model/Observer/fixtures/testLandingPageRewritesDisabled.yaml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ config:
2
+ default/klevu_search/searchlanding/landenabled: 0
app/code/community/Klevu/Search/Test/Model/Observer/fixtures/testLandingPageRewritesEnabled.yaml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ config:
2
+ default/klevu_search/searchlanding/landenabled: 1
app/code/community/Klevu/Search/Test/Model/Observer/fixtures/testScheduleOrderSync.yaml CHANGED
@@ -1,8 +1,8 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_js_api_key: test-api-key
5
- default/klevu_search/order_sync/enabled: 2
6
  tables:
7
  sales_flat_order:
8
  -
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/test_mode: 0
4
+ default/klevu_search/general/test_js_api_key: klevu-14255510895641069
5
+ default/klevu_search/order_sync/enabled: 1
6
  tables:
7
  sales_flat_order:
8
  -
app/code/community/Klevu/Search/Test/Model/Order/Sync/fixtures/testAddOrderToQueue.yaml CHANGED
@@ -1,7 +1,7 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/js_api_key: test-api-key
4
- default/klevu_search/order_sync/enabled: 2
5
  tables:
6
  sales_flat_order:
7
  -
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/js_api_key: klevu-14255510895641069
4
+ default/klevu_search/order_sync/enabled: 1
5
  tables:
6
  sales_flat_order:
7
  -
app/code/community/Klevu/Search/Test/Model/Order/Sync/fixtures/testClearQueue.yaml CHANGED
@@ -9,8 +9,8 @@ scope:
9
  is_active: 1
10
  config:
11
  default/klevu_search/general/enabled: 1
12
- default/klevu_search/general/js_api_key: test-api-key
13
- default/klevu_search/order_sync/enabled: 2
14
  tables:
15
  sales_flat_order:
16
  -
9
  is_active: 1
10
  config:
11
  default/klevu_search/general/enabled: 1
12
+ default/klevu_search/general/js_api_key: klevu-14255510895641069
13
+ default/klevu_search/order_sync/enabled: 1
14
  tables:
15
  sales_flat_order:
16
  -
app/code/community/Klevu/Search/Test/Model/Order/Sync/fixtures/testRun.yaml CHANGED
@@ -1,8 +1,8 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_js_api_key: test-api-key
5
- default/klevu_search/order_sync/enabled: 2
6
  tables:
7
  sales_flat_order:
8
  -
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/test_mode: 0
4
+ default/klevu_search/general/test_js_api_key: klevu-14255510895641069
5
+ default/klevu_search/order_sync/enabled: 1
6
  tables:
7
  sales_flat_order:
8
  -
app/code/community/Klevu/Search/Test/Model/Product/Sync.php CHANGED
@@ -60,7 +60,7 @@ class Klevu_Search_Test_Model_Product_Sync extends Klevu_Search_Test_Model_Api_T
60
 
61
  $model->run();
62
  }
63
-
64
  /**
65
  * @test
66
  * @loadFixture
@@ -120,6 +120,8 @@ class Klevu_Search_Test_Model_Product_Sync extends Klevu_Search_Test_Model_Api_T
120
  $this->assertTrue((is_array($contents) && count($contents) == 1));
121
  $this->assertEquals("133", $contents[0]['product_id']);
122
  }
 
 
123
 
124
  /**
125
  * @test
@@ -252,6 +254,9 @@ class Klevu_Search_Test_Model_Product_Sync extends Klevu_Search_Test_Model_Api_T
252
  array(
253
  'klevu_attribute' => 'name',
254
  'magento_attribute' => 'name'),
 
 
 
255
  array(
256
  'klevu_attribute' => 'image',
257
  'magento_attribute' => 'image'),
@@ -272,4 +277,62 @@ class Klevu_Search_Test_Model_Product_Sync extends Klevu_Search_Test_Model_Api_T
272
  'magento_attribute' => 'weight'),
273
  );
274
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  }
60
 
61
  $model->run();
62
  }
63
+
64
  /**
65
  * @test
66
  * @loadFixture
120
  $this->assertTrue((is_array($contents) && count($contents) == 1));
121
  $this->assertEquals("133", $contents[0]['product_id']);
122
  }
123
+
124
+
125
 
126
  /**
127
  * @test
254
  array(
255
  'klevu_attribute' => 'name',
256
  'magento_attribute' => 'name'),
257
+ array(
258
+ 'klevu_attribute' => 'sku',
259
+ 'magento_attribute' => 'sku'),
260
  array(
261
  'klevu_attribute' => 'image',
262
  'magento_attribute' => 'image'),
277
  'magento_attribute' => 'weight'),
278
  );
279
  }
280
+
281
+ /**
282
+ * Run special price prodcuts ids
283
+ * @test
284
+ * @loadFixture
285
+ */
286
+ public function testSpecialpriceProducts()
287
+ {
288
+ $model = Mage::getModel("klevu_search/product_sync");
289
+ $expirySaleProductsIds = $model->getExpirySaleProductsIds();
290
+ $model->markProductForupdate();
291
+ $this->assertEquals($this->getExpectedSpecialpriceProducts(), $expirySaleProductsIds);
292
+ }
293
+
294
+ /**
295
+ * Run special price prodcuts ids
296
+ * @test
297
+ * @loadFixture
298
+ */
299
+ public function testCatalogruleProducts()
300
+ {
301
+
302
+ $model = Mage::getModel("klevu_search/product_sync");
303
+ $catalogruleProductsIds = $model->getCatalogRuleProductsIds();
304
+ $model->markProductForupdate();
305
+ $this->assertEquals($this->getExpectedSpecialpriceProducts(), $catalogruleProductsIds);
306
+
307
+ }
308
+
309
+ /**
310
+ * Expected prodcuts ids
311
+ */
312
+ public function getExpectedSpecialpriceProducts()
313
+ {
314
+ return array(133);
315
+
316
+ }
317
+
318
+ protected function getDataFileContents($file) {
319
+ $directory_tree = array(
320
+ Mage::getModuleDir('', 'Klevu_Search'),
321
+ 'Test',
322
+ 'Model',
323
+ 'Api',
324
+ 'data',
325
+ $file
326
+ );
327
+
328
+ $file_path = join(DS, $directory_tree);
329
+
330
+ return file_get_contents($file_path);
331
+ }
332
+
333
+ protected function getPriceAttribute() {
334
+ return Mage::getModel('eav/entity_attribute')->loadByCode(Mage_Catalog_Model_Product::ENTITY, 'price');
335
+ }
336
+
337
+
338
  }
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testAddProducts.yaml CHANGED
@@ -1,8 +1,7 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_rest_api_key: test-api-key
5
- default/klevu_search/product_sync/enabled: 2
6
  eav:
7
  catalog_product:
8
  -
@@ -27,5 +26,6 @@ eav:
27
  tax_class_id: 2
28
  status: 1
29
  visibility: 4
30
- created_at: 2007-08-29 19:56:27
31
- updated_at: 2008-06-28 01:57:22
 
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/test_rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
 
5
  eav:
6
  catalog_product:
7
  -
26
  tax_class_id: 2
27
  status: 1
28
  visibility: 4
29
+ created_at: 2015-03-13 01:57:22
30
+ updated_at: 2015-03-13 01:57:22
31
+
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testCatalogruleProducts.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/test_rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
5
+ eav:
6
+ catalog_product:
7
+ -
8
+ entity_id: 133
9
+ attribute_set_id: 4
10
+ type_id: simple
11
+ sku: ac9003
12
+ name: Universal Camera Case
13
+ short_description: A stylish digital camera demands stylish protection. This leather carrying case will defend your camera from the dings and scratches of travel and everyday use while looking smart all the time.
14
+ description: A stylish digital camera demands stylish protection. This leather carrying case will defend your camera from the dings and scratches of travel and everyday use while looking smart all the time.
15
+ url_key: universal-camera-case
16
+ image: /u/n/universal-camera-case.jpg
17
+ weight: null
18
+ stock:
19
+ qty: 100.00
20
+ is_in_stock: 1
21
+ website_ids:
22
+ - 1 # Default website
23
+ category_ids:
24
+ - 2 # Default category
25
+ price: 34
26
+ tax_class_id: 2
27
+ status: 1
28
+ visibility: 4
29
+ created_at: 2015-03-06 01:57:22
30
+ updated_at: 2015-03-06 01:57:22
31
+ tables:
32
+ catalogrule_product_price:
33
+ -
34
+ rule_date:2015-03-06
35
+ customer_group_id:0
36
+ product_id:133
37
+ rule_price:6
38
+ website_id:1
39
+ latest_start_date:2015-03-12
40
+ earliest_end_date:2015-03-13
41
+
42
+
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testClearAllProducts.yaml CHANGED
@@ -1,20 +1,19 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_rest_api_key: test-api-key
5
- default/klevu_search/product_sync/enabled: 2
6
  tables:
7
  klevu_search/product_sync:
8
  -
9
  product_id: 1
10
  parent_id: 0
11
  store_id: 1
12
- test_mode: 1
13
- last_synced_at: 2008-08-10 13:36:29
14
  -
15
  product_id: 2
16
  parent_id: 0
17
  store_id: 2
18
- test_mode: 1
19
- last_synced_at: 2008-08-10 13:36:29
20
 
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
 
5
  tables:
6
  klevu_search/product_sync:
7
  -
8
  product_id: 1
9
  parent_id: 0
10
  store_id: 1
11
+ test_mode: 0
12
+ last_synced_at: 0
13
  -
14
  product_id: 2
15
  parent_id: 0
16
  store_id: 2
17
+ test_mode: 0
18
+ last_synced_at: 0
19
 
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testDeleteProducts.yaml CHANGED
@@ -1,13 +1,12 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_rest_api_key: test-api-key
5
- default/klevu_search/product_sync/enabled: 2
6
  tables:
7
  klevu_search/product_sync:
8
  -
9
  product_id: 130
10
  parent_id: 0
11
  store_id: 1
12
- test_mode: 1
13
  last_synced_at: 2008-08-10 13:36:29
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
 
5
  tables:
6
  klevu_search/product_sync:
7
  -
8
  product_id: 130
9
  parent_id: 0
10
  store_id: 1
11
+ test_mode: 0
12
  last_synced_at: 2008-08-10 13:36:29
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testRun.yaml CHANGED
@@ -1,8 +1,7 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_rest_api_key: test-api-key
5
- default/klevu_search/product_sync/enabled: 2
6
  eav:
7
  catalog_product:
8
  -
@@ -367,59 +366,59 @@ tables:
367
  product_id: 130
368
  parent_id: 0
369
  store_id: 1
370
- test_mode: 1
371
  last_synced_at: 2008-08-10 13:36:29
372
  -
373
  product_id: 133
374
  parent_id: 0
375
  store_id: 1
376
- test_mode: 1
377
  last_synced_at: 2008-06-27 01:57:22
378
  -
379
  product_id: 134
380
  parent_id: 0
381
  store_id: 1
382
- test_mode: 1
383
  last_synced_at: 2008-06-27 01:57:16
384
  -
385
  product_id: 138
386
  parent_id: 0
387
  store_id: 1
388
- test_mode: 1
389
  last_synced_at: 2008-08-10 13:36:29
390
  -
391
  product_id: 139
392
  parent_id: 0
393
  store_id: 1
394
- test_mode: 1
395
  last_synced_at: 2008-08-10 13:36:29
396
  -
397
  product_id: 201
398
  parent_id: 202
399
  store_id: 1
400
- test_mode: 1
401
  last_synced_at: 2014-05-21 12:00:00
402
  -
403
  product_id: 203
404
  parent_id: 204
405
  store_id: 1
406
- test_mode: 1
407
  last_synced_at: 2014-05-20 12:00:00
408
  -
409
  product_id: 205
410
  parent_id: 206
411
  store_id: 1
412
- test_mode: 1
413
  last_synced_at: 2014-05-20 12:00:00
414
  -
415
  product_id: 210
416
  parent_id: 212
417
  store_id: 1
418
- test_mode: 1
419
  last_synced_at: 2014-05-21 12:00:00
420
  -
421
  product_id: 211
422
  parent_id: 212
423
  store_id: 1
424
- test_mode: 1
425
  last_synced_at: 2014-05-21 12:00:00
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
 
5
  eav:
6
  catalog_product:
7
  -
366
  product_id: 130
367
  parent_id: 0
368
  store_id: 1
369
+ test_mode: 0
370
  last_synced_at: 2008-08-10 13:36:29
371
  -
372
  product_id: 133
373
  parent_id: 0
374
  store_id: 1
375
+ test_mode: 0
376
  last_synced_at: 2008-06-27 01:57:22
377
  -
378
  product_id: 134
379
  parent_id: 0
380
  store_id: 1
381
+ test_mode: 0
382
  last_synced_at: 2008-06-27 01:57:16
383
  -
384
  product_id: 138
385
  parent_id: 0
386
  store_id: 1
387
+ test_mode: 0
388
  last_synced_at: 2008-08-10 13:36:29
389
  -
390
  product_id: 139
391
  parent_id: 0
392
  store_id: 1
393
+ test_mode: 0
394
  last_synced_at: 2008-08-10 13:36:29
395
  -
396
  product_id: 201
397
  parent_id: 202
398
  store_id: 1
399
+ test_mode: 0
400
  last_synced_at: 2014-05-21 12:00:00
401
  -
402
  product_id: 203
403
  parent_id: 204
404
  store_id: 1
405
+ test_mode: 0
406
  last_synced_at: 2014-05-20 12:00:00
407
  -
408
  product_id: 205
409
  parent_id: 206
410
  store_id: 1
411
+ test_mode: 0
412
  last_synced_at: 2014-05-20 12:00:00
413
  -
414
  product_id: 210
415
  parent_id: 212
416
  store_id: 1
417
+ test_mode: 0
418
  last_synced_at: 2014-05-21 12:00:00
419
  -
420
  product_id: 211
421
  parent_id: 212
422
  store_id: 1
423
+ test_mode: 0
424
  last_synced_at: 2014-05-21 12:00:00
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testSpecialpriceProducts.yaml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ config:
2
+ default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/test_rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
5
+ eav:
6
+ catalog_product:
7
+ -
8
+ entity_id: 133
9
+ attribute_set_id: 4
10
+ type_id: simple
11
+ sku: ac9003
12
+ name: Universal Camera Case
13
+ short_description: A stylish digital camera demands stylish protection. This leather carrying case will defend your camera from the dings and scratches of travel and everyday use while looking smart all the time.
14
+ description: A stylish digital camera demands stylish protection. This leather carrying case will defend your camera from the dings and scratches of travel and everyday use while looking smart all the time.
15
+ url_key: universal-camera-case
16
+ image: /u/n/universal-camera-case.jpg
17
+ weight: null
18
+ stock:
19
+ qty: 100.00
20
+ is_in_stock: 1
21
+ website_ids:
22
+ - 1 # Default website
23
+ category_ids:
24
+ - 2 # Default category
25
+ price: 34
26
+ special_price:22
27
+ special_from_date:2015-03-03 00:00:00
28
+ special_to_date:2015-03-12 00:00:00
29
+ tax_class_id: 2
30
+ status: 1
31
+ visibility: 4
32
+ created_at: 2015-03-06 01:57:22
33
+ updated_at: 2015-03-06 01:57:22
34
+
app/code/community/Klevu/Search/Test/Model/Product/Sync/fixtures/testUpdateProducts.yaml CHANGED
@@ -1,8 +1,7 @@
1
  config:
2
  default/klevu_search/general/enabled: 1
3
- default/klevu_search/general/test_mode: 1
4
- default/klevu_search/general/test_rest_api_key: test-api-key
5
- default/klevu_search/product_sync/enabled: 2
6
  eav:
7
  catalog_product:
8
  -
@@ -24,16 +23,22 @@ eav:
24
  category_ids:
25
  - 2 # Default category
26
  price: 34
 
 
 
27
  tax_class_id: 2
28
  status: 1
29
  visibility: 4
30
  created_at: 2007-08-29 19:56:27
31
- updated_at: 2008-06-28 01:57:22
 
32
  tables:
33
  klevu_search/product_sync:
34
  -
35
  product_id: 133
36
  parent_id: 0
37
  store_id: 1
38
- test_mode: 1
39
- last_synced_at: 2008-06-27 01:57:22
 
 
1
  config:
2
  default/klevu_search/general/enabled: 1
3
+ default/klevu_search/general/rest_api_key: a2xldnUtMTQyNTU1MTA4OTU2NDEwNjk6S2xldnUtZmo4NzQ3cHUxMg==
4
+ default/klevu_search/product_sync/enabled: 1
 
5
  eav:
6
  catalog_product:
7
  -
23
  category_ids:
24
  - 2 # Default category
25
  price: 34
26
+ special_price:22
27
+ special_to_date:2015-03-03 01:57:22
28
+ special_from_date:2015-03-08 00:00:00
29
  tax_class_id: 2
30
  status: 1
31
  visibility: 4
32
  created_at: 2007-08-29 19:56:27
33
+ updated_at: 2015-03-13 00:00:00
34
+
35
  tables:
36
  klevu_search/product_sync:
37
  -
38
  product_id: 133
39
  parent_id: 0
40
  store_id: 1
41
+ test_mode: 0
42
+ last_synced_at: 0000-00-00 00:00:00
43
+
44
+
app/code/community/Klevu/Search/controllers/Adminhtml/Klevu/SearchController.php CHANGED
@@ -46,19 +46,5 @@ class Klevu_Search_Adminhtml_Klevu_SearchController extends Mage_Adminhtml_Contr
46
 
47
  return $this->_redirectReferer("adminhtml/dashboard");
48
  }
49
- /**
50
- * Get the product ids for thumbnails and schedual the cron.
51
- */
52
- public function generate_thumbnailAction() {
53
- try {
54
- Mage::getModel('klevu_search/product_sync')->getEntityIds();
55
- Mage::getModel('klevu_search/product_sync')->scheduleImageCron();
56
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__("Klevu thumbnails generation task scheduled to be run on the next cron run."));
57
- }
58
- catch (Exception $e) {
59
- Mage::logException($e);
60
- Mage::getSingleton('adminhtml/session')->addError($this->__("Unable to generate product images. Please try later."));
61
- }
62
- return $this->_redirectReferer("adminhtml/dashboard");
63
- }
64
  }
46
 
47
  return $this->_redirectReferer("adminhtml/dashboard");
48
  }
49
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
app/code/community/Klevu/Search/controllers/{SearchController.php → IndexController.php} RENAMED
@@ -2,34 +2,34 @@
2
  /**
3
  * Klevu FrontEnd Controller
4
  */
5
- class Klevu_Search_SearchController extends Mage_Core_Controller_Front_Action {
6
- /**
7
- * Genarate thumbnail using multiple curl request action
8
- */
9
- public function indexAction() {
10
- try {
11
- $id = Mage::app()->getRequest()->getParam('id');
12
- $data = Mage::getModel('klevu_search/product_sync')->getImageProcessingIds($id);
13
- foreach(unserialize($data[0]['batchdata']) as $key => $value) {
14
- $product = Mage::getModel('catalog/product')->load($value);
15
- $image = $product->getImage();
16
- if((!empty($image)) && ($image!= "no_selection")) {
17
- Mage::getModel('klevu_search/product_sync')->thumbImage($product->getImage());
18
- }
19
- }
20
- Mage::getModel('klevu_search/product_sync')->updateImageProcessingIds($id);
21
- }
22
- catch(Exception $e) {
23
- Mage::helper('klevu_search')->log(Zend_Log::DEBUG, sprintf("Image Error:\n%s", $e->getMessage()));
24
- }
25
-
26
- }
27
 
28
  public function runexternalylogAction()
29
  {
30
  $this->loadLayout();
31
  $this->renderLayout();
32
- }
 
33
  /**
34
  * Send different logs to klevu server to debug the data
35
  */
@@ -87,7 +87,7 @@ class Klevu_Search_SearchController extends Mage_Core_Controller_Front_Action {
87
  Mage::getModel('klevu_search/product_sync')->sheduleCronExteranally($rest_api);
88
  Mage::getSingleton('core/session')->addSuccess("Cron scheduled externally.");
89
  }
90
- $this->_redirect('klevu/search/runexternalylog');
91
 
92
  }
93
  catch(Exception $e) {
2
  /**
3
  * Klevu FrontEnd Controller
4
  */
5
+ class Klevu_Search_IndexController extends Mage_Core_Controller_Front_Action {
6
+
7
+ public function IndexAction() {
8
+
9
+ $this->loadLayout();
10
+ $this->getLayout()->getBlock("head")->setTitle($this->__("Test"));
11
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
12
+ $breadcrumbs->addCrumb("home", array(
13
+ "label" => $this->__("Home"),
14
+ "title" => $this->__("Home"),
15
+ "link" => Mage::getBaseUrl()
16
+ ));
17
+
18
+ $breadcrumbs->addCrumb("Search Result", array(
19
+ "label" => $this->__("Search Result"),
20
+ "title" => $this->__("Search Result")
21
+ ));
22
+
23
+ $this->renderLayout();
24
+
25
+ }
 
26
 
27
  public function runexternalylogAction()
28
  {
29
  $this->loadLayout();
30
  $this->renderLayout();
31
+ }
32
+
33
  /**
34
  * Send different logs to klevu server to debug the data
35
  */
87
  Mage::getModel('klevu_search/product_sync')->sheduleCronExteranally($rest_api);
88
  Mage::getSingleton('core/session')->addSuccess("Cron scheduled externally.");
89
  }
90
+ $this->_redirect('search/index/runexternalylog');
91
 
92
  }
93
  catch(Exception $e) {
app/code/community/Klevu/Search/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Klevu_Search>
5
- <version>1.1.15</version>
6
  </Klevu_Search>
7
  </modules>
8
  <global>
@@ -33,11 +33,9 @@
33
  <order_sync>
34
  <table>klevu_order_sync</table>
35
  </order_sync>
36
- <image_thumb>
37
- <table>klevu_image_thumb</table>
38
- </image_thumb>
39
  </entities>
40
  </klevu_search_resource>
 
41
  </models>
42
  <resources>
43
  <klevu_search_setup>
@@ -165,6 +163,15 @@
165
  </klevu_search_product_sync>
166
  </observers>
167
  </catalog_product_attribute_update_before>
 
 
 
 
 
 
 
 
 
168
  </events>
169
  </global>
170
  <admin>
@@ -188,22 +195,22 @@
188
  </layout>
189
  </adminhtml>
190
  <frontend>
191
- <layout>
192
- <updates>
193
- <klevu_search>
194
- <file>klevu/search.xml</file>
195
- </klevu_search>
196
- </updates>
197
- </layout>
198
- <routers>
199
- <klevu_search>
200
  <use>standard</use>
201
  <args>
202
- <module>Klevu_Search</module>
203
- <frontName>klevu</frontName>
204
  </args>
205
- </klevu_search>
206
  </routers>
 
 
 
 
 
 
 
207
  </frontend>
208
  <crontab>
209
  <jobs>
@@ -228,14 +235,6 @@
228
  <model>klevu_search/order_sync::run</model>
229
  </run>
230
  </klevu_search_order_sync>
231
- <klevu_search_product_thumb>
232
- <schedule>
233
- <config_path>klevu_search/product_sync/frequency</config_path>
234
- </schedule>
235
- <run>
236
- <model>klevu_search/product_sync::generateThumbParrallel</model>
237
- </run>
238
- </klevu_search_product_thumb>
239
  </jobs>
240
  </crontab>
241
  <default>
2
  <config>
3
  <modules>
4
  <Klevu_Search>
5
+ <version>1.1.16</version>
6
  </Klevu_Search>
7
  </modules>
8
  <global>
33
  <order_sync>
34
  <table>klevu_order_sync</table>
35
  </order_sync>
 
 
 
36
  </entities>
37
  </klevu_search_resource>
38
+
39
  </models>
40
  <resources>
41
  <klevu_search_setup>
163
  </klevu_search_product_sync>
164
  </observers>
165
  </catalog_product_attribute_update_before>
166
+ <catalog_category_change_products>
167
+ <observers>
168
+ <klevu_search_categroy_product_sync>
169
+ <type>singleton</type>
170
+ <class>klevu_search/observer</class>
171
+ <method>setCategoryProductsToSync</method>
172
+ </klevu_search_categroy_product_sync>
173
+ </observers>
174
+ </catalog_category_change_products>
175
  </events>
176
  </global>
177
  <admin>
195
  </layout>
196
  </adminhtml>
197
  <frontend>
198
+ <routers>
199
+ <search>
 
 
 
 
 
 
 
200
  <use>standard</use>
201
  <args>
202
+ <module>Klevu_Search</module>
203
+ <frontName>search</frontName>
204
  </args>
205
+ </search>
206
  </routers>
207
+ <layout>
208
+ <updates>
209
+ <search>
210
+ <file>klevu/search.xml</file>
211
+ </search>
212
+ </updates>
213
+ </layout>
214
  </frontend>
215
  <crontab>
216
  <jobs>
235
  <model>klevu_search/order_sync::run</model>
236
  </run>
237
  </klevu_search_order_sync>
 
 
 
 
 
 
 
 
238
  </jobs>
239
  </crontab>
240
  <default>
app/code/community/Klevu/Search/etc/system.xml CHANGED
@@ -313,29 +313,6 @@
313
  </sendlog>
314
  </fields>
315
  </developer>
316
- <image translate="label">
317
- <label>Generate Thumbnail Image</label>
318
- <sort_order>901</sort_order>
319
- <expanded>1</expanded>
320
- <show_in_default>1</show_in_default>
321
- <show_in_website>0</show_in_website>
322
- <show_in_store>0</show_in_store>
323
- <fields>
324
- <image_thumb translate="label">
325
- <label>Product Thumbnails</label>
326
- <comment><![CDATA[Click here to create thumbnails for all your product images. Once the process
327
- has finnished, please synchronize all your products again (see Product
328
- Synchronization Settings). This is to make sure Klevu Search uses the newly
329
- created thumbnails instead of the original product images.]]></comment>
330
- <frontend_type>button</frontend_type>
331
- <frontend_model>klevu_search/adminhtml_form_field_image_button</frontend_model>
332
- <sort_order>310</sort_order>
333
- <show_in_default>1</show_in_default>
334
- <show_in_website>0</show_in_website>
335
- <show_in_store>0</show_in_store>
336
- </image_thumb>
337
- </fields>
338
- </image>
339
  </groups>
340
  </klevu_search>
341
  </sections>
313
  </sendlog>
314
  </fields>
315
  </developer>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  </groups>
317
  </klevu_search>
318
  </sections>
app/code/community/Klevu/Search/sql/klevu_search_setup/mysql4-data-upgrade-1.1.1-1.1.2.php CHANGED
@@ -44,17 +44,4 @@ foreach (Mage::app()->getStores() as $store) {
44
 
45
  $mage_config->reinit();
46
 
47
- $image_thumb_table = $installer->getTable('klevu_search/image_thumb');
48
- $installer->run("DROP TABLE IF EXISTS `{$image_thumb_table}`");
49
- $installer->run("
50
- CREATE TABLE `{$image_thumb_table}` (
51
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
52
- `batchdata` text NOT NULL,
53
- `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
54
- `is_processed` int(10) NOT NULL,
55
- PRIMARY KEY (`id`)
56
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
57
- ");
58
-
59
-
60
  $installer->endSetup();
44
 
45
  $mage_config->reinit();
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  $installer->endSetup();
app/code/community/Klevu/Search/sql/klevu_search_setup/mysql4-data-upgrade-1.1.7-1.1.8.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Add all of the attributes mapped in "Additional Attributes" section to the
5
- * "Other Attributes to Index" section
6
- */
7
-
8
- /** @var Mage_Core_Model_Resource_Setup $installer */
9
- $installer = $this;
10
- $installer->startSetup();
11
- $content = '<div class="kuContainer">
12
- <div id="loader" style="text-align: center;"><img src="{{skin url=images/klevu/ku-loader.gif}}" alt="search" /></div>
13
- <div class="kuProListing" id="kuProListing" style="display:none;">
14
- <div class="kuNoRecordFound" id="kuNoRecordFound" style="display:none;">
15
- <p>No matching products found for "red awef"</p>
16
- </div>
17
- <div class="kuFilters" id="kuFilters">
18
- </div><!-- End of kuFilters -->
19
-
20
- <div class="kuResultList" id="kuResultListBlock">
21
- <div class="kuListHeader">
22
- <div class="kuTotResults" id="kuTotResults"></div>
23
- <div class="kuSortingOpt">
24
- <div class="kuSortby">
25
- <label id="klevuSortLbl">Sort by:</label>
26
- <select name="kuSortby" id="kuSortby" onchange="klevu_changeSortingOptionsForLandigPage(this.value);">
27
- <option value="rel" id="klevuRelSort" >Relevance</option>
28
- <option value="lth" id="klevuLthSort">Price: Low to high</option>
29
- <option value="htl" id="klevuHtlSort">Price: High to low</option>
30
- </select>
31
- </div>
32
-
33
- <div class="kuView">
34
- <a class="kuGridviewBtn" id="gridViewBtn" onclick="setKuView('."'grid'".');">
35
- <span class="icon-gridview">&nbsp;</span>
36
- </a>
37
- <a class="kuListviewBtn kuCurrent" id="listViewBtn" onclick="setKuView('."'list'".');">
38
- <span class="icon-listview">&nbsp;</span>
39
- </a>
40
- </div>
41
-
42
- <div class="kuPerPage">
43
- <label id="klevuItemsPerPage">Items per page:</label>
44
- <select onchange="klevu_changeItemsPerPage(this.value);" id="noOfRecords1">
45
- <option>12</option>
46
- <option>24</option>
47
- <option>36</option>
48
- </select>
49
- </div>
50
-
51
- <div class="kuPagination" id="kuPagination1">
52
- </div>
53
-
54
- <div class="kuClearLeft"></div>
55
- </div>
56
-
57
- </div>
58
- <div class="kuListView" id="kuResultsView">
59
-
60
- </div>
61
- <div class="kuBottomPagi">
62
- <div class="kuPerPage">
63
- <label id="klevuItemsPerPageFooter">Items per page:</label>
64
- <select onchange="klevu_changeItemsPerPage(this.value);" id="noOfRecords2">
65
- <option>12</option>
66
- <option>24</option>
67
- <option>36</option>
68
- </select>
69
- </div>
70
- <div class="kuPagination" id="kuPagination2">
71
-
72
- </div>
73
- <div class="kuClearLeft"></div>
74
- </div>
75
-
76
-
77
- </div>
78
- <div class="klevu-clear-both"></div>
79
- </div><!-- End of kuProListing -->
80
- </div><!-- End of klevu-container -->
81
- <input type="hidden" name="noOfRecords" id="noOfRecords" value="12"/>
82
- <input type="hidden" name="startPos" id="startPos" value="0"/>
83
- <input type="hidden" name="totalResultsFound" id="totalResultsFound" value="0"/>
84
- <input type="hidden" name="searchedKeyword" id="searchedKeyword" value=""/>
85
- <input type="hidden" name="totalPages" id="totalPages" value="0"/>
86
- <script type="text/javascript" src="https://box.klevu.com/klevu-js-v1/js-1-1/klevu-landing.js">
87
- </script>
88
- <script type="text/javascript">// <![CDATA[
89
- document.getElementById("searchedKeyword").value= klevu_getParamValue("q");
90
- // ]]></script>';
91
- //if you want one block for each store view, get the store collection
92
- $stores = Mage::getModel('core/store')->getCollection()->addFieldToFilter('store_id', array('gt'=>0))->getAllIds();
93
- // add static block
94
- $block = Mage::getModel('cms/block');
95
- $block->setTitle('Klevu Search Landing Page Block');
96
- $block->setIdentifier('klevu-search-landing-page-block-html');
97
- $block->setStores(array(0));
98
- $block->setIsActive(1);
99
- $block->setContent($content);
100
- $block->save();
101
-
102
- // add cms page
103
- $cmsPage = array(
104
- 'title' => 'Search results',
105
- 'root_template' => 'one_column',
106
- 'identifier' => 'search-result',
107
- 'is_active' => 1,
108
- 'stores' => array(0),
109
- 'content' => '{{block type="cms/block" block_id="klevu-search-landing-page-block-html"}}',
110
- );
111
-
112
- Mage::getModel('cms/page')->setData($cmsPage)->save();
113
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/klevu/search.xml CHANGED
@@ -1,20 +1,17 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
  <default>
4
- <reference name="head">
5
- <action method="addCss"><stylesheet>css/klevu/klevu-landing-page-style.css</stylesheet></action>
6
- <action method="addCss"><stylesheet>css/klevu/klevu-landing-responsive.css</stylesheet></action>
7
- </reference>
8
- <reference name="before_body_end">
9
  <block type="core/template" name="klevu.search.form_js" template="klevu/search/form_js.phtml"/>
10
- </reference>
11
  </default>
12
  <catalog_product_view>
13
  <reference name="before_body_end">
14
  <block type="klevu_search/catalog_product_tracking" name="klevu_search.catalog.product.tracking" template="klevu/search/product_tracking.phtml" />
15
  </reference>
16
  </catalog_product_view>
17
- <klevu_search_runexternalylog>
18
  <label>Klevu Log</label>
19
  <remove name="right"/>
20
  <remove name="left"/>
@@ -22,7 +19,20 @@
22
  <action method="setTemplate"><template>page/1column.phtml</template></action>
23
  </reference>
24
  <reference name="content">
25
- <block type="core/template" name="klevulog" template="klevu/klevulog.phtml"/>
26
  </reference>
27
- </klevu_search_runexternalylog>
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  </layout>
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
  <default>
4
+
5
+ <reference name="before_body_end">
 
 
 
6
  <block type="core/template" name="klevu.search.form_js" template="klevu/search/form_js.phtml"/>
7
+ </reference>
8
  </default>
9
  <catalog_product_view>
10
  <reference name="before_body_end">
11
  <block type="klevu_search/catalog_product_tracking" name="klevu_search.catalog.product.tracking" template="klevu/search/product_tracking.phtml" />
12
  </reference>
13
  </catalog_product_view>
14
+ <search_search_runexternalylog>
15
  <label>Klevu Log</label>
16
  <remove name="right"/>
17
  <remove name="left"/>
19
  <action method="setTemplate"><template>page/1column.phtml</template></action>
20
  </reference>
21
  <reference name="content">
22
+ <block type="core/template" name="klevulog" template="klevu/search/klevulog.phtml"/>
23
  </reference>
24
+ </search_search_runexternalylog>
25
+ <search_index_index>
26
+ <reference name="head">
27
+ <action method="addCss"><stylesheet>css/klevu/klevu-landing-page-style.css</stylesheet></action>
28
+ <action method="addCss"><stylesheet>css/klevu/klevu-landing-responsive.css</stylesheet></action>
29
+ </reference>
30
+ <reference name="root">
31
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
32
+ </reference>
33
+ <reference name="content">
34
+ <block type="core/template" name="search_index" template="klevu/search/index.phtml"/>
35
+ </reference>
36
+ </search_index_index>
37
+
38
  </layout>
app/design/frontend/base/default/template/klevu/search/form_js.phtml CHANGED
@@ -3,45 +3,71 @@
3
  <?php $helper = Mage::helper('klevu_search'); ?>
4
  <?php if ($config->isExtensionConfigured()): ?>
5
  <script type="text/javascript">
 
 
6
  <?php
7
  if ($config->isLandingEnabled()==0){ ?>
 
8
  (function () {
9
  // Remove Magento event observers from the search box
10
  // No Redirection of landing page
11
- var search_input = $('search');
12
- search_input.stopObserving('click');
13
- search_input.stopObserving('keydown');
14
- search_input.form.stopObserving('submit');
15
- search_input.form.observe('submit', function (e) {
16
- Event.stop(e);
17
- klevu_autoSuggest($('search').value, e);
18
- return false;
19
- });
 
 
 
 
 
 
 
20
  })();
21
  <?php } else if($config->isLandingEnabled()==2) { ?>
22
  (function () {
23
  // Remove Magento event observers from the search box
24
  // Redirect to klevu js page
25
- var search_input = $('search');
26
- search_input.stopObserving('click');
27
- search_input.stopObserving('keydown');
28
- search_input.form.observe('submit', function (e) {
29
- Event.stop(e);
30
- document.location='<?php echo Mage::getBaseUrl(); ?>' + "search-result?q="+$('search').value;
31
- return false;
32
- });
 
 
 
 
 
 
 
 
33
 
34
  })();
 
35
  var klevu_showQuickSearchOnEnter=false;
36
  <?php } else if($config->isLandingEnabled()==1) { ?>
37
  (function () {
38
  // Remove Magento event observers from the search box
39
  // default magetno layout landing page
40
- var search_input = $('search');
41
- search_input.stopObserving('click');
42
- search_input.stopObserving('keydown');
 
 
 
 
 
 
43
  })();
44
- var klevu_showQuickSearchOnEnter=false;
 
45
  <?php } ?>
46
  // call store js
47
  var klevu_apiKey = '<?php echo $config->getJsApiKey() ?>',
@@ -53,3 +79,4 @@
53
  </script>
54
 
55
  <?php endif; ?>
 
3
  <?php $helper = Mage::helper('klevu_search'); ?>
4
  <?php if ($config->isExtensionConfigured()): ?>
5
  <script type="text/javascript">
6
+ var allInputs = document.getElementsByTagName( 'input' );
7
+ var klevu_current_version = '<?php echo Mage::getConfig()->getModuleConfig('Klevu_Search')->version; ?>';
8
  <?php
9
  if ($config->isLandingEnabled()==0){ ?>
10
+ var klevu_showQuickSearchOnEnter=true;
11
  (function () {
12
  // Remove Magento event observers from the search box
13
  // No Redirection of landing page
14
+ for( i = 0, len = allInputs.length; i < len; i++ ){
15
+ if( allInputs[i].type === "text" || allInputs[i].type === "search" ){
16
+ if( allInputs[i].name === "q" || allInputs[i].id === "search" ){
17
+ var search_input = allInputs[i];
18
+ search_input.stopObserving('click');
19
+ search_input.stopObserving('keydown');
20
+ search_input.form.stopObserving('submit');
21
+ search_input.form.observe('submit', function (e) {
22
+ Event.stop(e);
23
+ klevu_autoSuggest(search_input.value, e);
24
+ return false;
25
+ });
26
+ }
27
+ }
28
+ }
29
+
30
  })();
31
  <?php } else if($config->isLandingEnabled()==2) { ?>
32
  (function () {
33
  // Remove Magento event observers from the search box
34
  // Redirect to klevu js page
35
+ for( i = 0, len = allInputs.length; i < len; i++ ){
36
+ if( allInputs[i].type === "text" || allInputs[i].type === "search" ){
37
+ if( allInputs[i].name === "q" || allInputs[i].id === "search" ){
38
+ var search_input = allInputs[i];
39
+ search_input.stopObserving('click');
40
+ search_input.stopObserving('keydown');
41
+ search_input.form.action='<?php echo Mage::getBaseUrl(); ?>' + "search";//?q="+search_input.value;
42
+ search_input.form.observe('submit', function (e) {
43
+ //if(search_input.value.length!= 0){
44
+ //Event.stop(e);
45
+ //return false;
46
+ //}
47
+ });
48
+ }
49
+ }
50
+ }
51
 
52
  })();
53
+ var klevu_storeLandingPageUrl = '<?php echo Mage::getBaseUrl(); ?>' + "search";
54
  var klevu_showQuickSearchOnEnter=false;
55
  <?php } else if($config->isLandingEnabled()==1) { ?>
56
  (function () {
57
  // Remove Magento event observers from the search box
58
  // default magetno layout landing page
59
+ for( i = 0, len = allInputs.length; i < len; i++ ){
60
+ if( allInputs[i].type === "text" || allInputs[i].type === "search" ){
61
+ if( allInputs[i].name === "q" || allInputs[i].id === "search" ){
62
+ var search_input = allInputs[i];
63
+ search_input.stopObserving('click');
64
+ search_input.stopObserving('keydown');
65
+ }
66
+ }
67
+ }
68
  })();
69
+ var klevu_storeLandingPageUrl = '<?php echo Mage::getUrl('catalogsearch/result/');?>';
70
+ var klevu_showQuickSearchOnEnter=false;
71
  <?php } ?>
72
  // call store js
73
  var klevu_apiKey = '<?php echo $config->getJsApiKey() ?>',
79
  </script>
80
 
81
  <?php endif; ?>
82
+
app/design/frontend/base/default/template/klevu/search/index.phtml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $config = Mage::helper('klevu_search/config'); ?>
2
+ <div class="kuContainer">
3
+ <div id="loader" style="text-align: center;"><img src="<?php echo $this->getSkinUrl('images/klevu/ku-loader.gif'); ?>" alt="search" /></div>
4
+ <div id="kuNoRecordFound" class="kuNoRecordFound" style="display: none;">
5
+ <p><?php echo $this->__('No matching products found.');?></p>
6
+ </div>
7
+ <div id="kuProListing" class="kuProListing" style="display: none;">
8
+ <div id="kuFilters" class="kuFilters">&nbsp;</div>
9
+ <!-- End of kuFilters -->
10
+ <div id="kuResultListBlock" class="kuResultList">
11
+ <div class="kuListHeader">
12
+ <div id="kuTotResults" class="kuTotResults">&nbsp;</div>
13
+ <div class="kuSortingOpt">
14
+ <div class="kuSortby">
15
+ <label id="klevuSortLbl"><?php echo $this->__('Sort by');?>:</label>
16
+ <select id="kuSortby" name="kuSortby" onchange="klevu_changeSortingOptionsForLandigPage(this.value);">
17
+ <option id="klevuRelSort" value="rel"><?php echo $this->__('Relevance');?></option>
18
+ <option id="klevuLthSort" value="lth"><?php echo $this->__('Price').":".$this->__('Low to high');?></option>
19
+ <option id="klevuHtlSort" value="htl"><?php echo $this->__('Price').":".$this->__('High to low');?></option>
20
+ </select>
21
+ </div>
22
+ <div class="kuView"><a id="gridViewBtn" class="kuGridviewBtn" onclick="setKuView('grid');"> <span class="icon-gridview">&nbsp;</span> </a> <a id="listViewBtn" class="kuListviewBtn kuCurrent" onclick="setKuView('list');"> <span class="icon-listview">&nbsp;</span> </a></div>
23
+ <div class="kuPerPage">
24
+ <label id="klevuItemsPerPage"><?php echo $this->__('Items per page');?>:</label>
25
+ <select id="noOfRecords1" onchange="klevu_changeItemsPerPage(this.value);">
26
+ <?php
27
+ $per_page = explode(",",Mage::getStoreConfig("catalog/frontend/grid_per_page_values"));
28
+ if(!empty($per_page)){
29
+ foreach($per_page as $key => $value) { ?>
30
+ <option> <?php echo $value;?></option>
31
+ <?php }
32
+ }?>
33
+ </select>
34
+ </div>
35
+ <div id="kuPagination1" class="kuPagination">&nbsp;</div>
36
+ <div class="kuClearLeft">&nbsp;</div>
37
+ </div>
38
+ </div>
39
+ <div id="kuResultsView" class="kuListView">&nbsp;</div>
40
+ <div class="kuBottomPagi">
41
+ <div class="kuPerPage">
42
+ <label id="klevuItemsPerPageFooter"><?php echo $this->__('Items per page');?>:</label>
43
+ <select id="noOfRecords2" onchange="klevu_changeItemsPerPage(this.value);">
44
+ <?php if(!empty($per_page)){
45
+ foreach($per_page as $key => $value) { ?>
46
+ <option> <?php echo $value;?></option>
47
+ <?php }
48
+ }?>
49
+ </select>
50
+ </div>
51
+ <div id="kuPagination2" class="kuPagination">&nbsp;</div>
52
+ <div class="kuClearLeft">&nbsp;</div>
53
+ </div>
54
+ </div>
55
+ <div class="klevu-clear-both">&nbsp;</div>
56
+ </div>
57
+ <!-- End of kuProListing --></div>
58
+ <!-- End of klevu-container -->
59
+ <input id="noOfRecords" type="hidden" name="noOfRecords" value="<?php if(!empty($per_page[0])){ echo $per_page[0]; }?>" />
60
+ <input id="startPos" type="hidden" name="startPos" value="0" />
61
+ <input id="totalResultsFound" type="hidden" name="totalResultsFound" value="0" />
62
+ <input id="searchedKeyword" type="hidden" name="searchedKeyword" value="" />
63
+ <input id="totalPages" type="hidden" name="totalPages" value="0" />
64
+ <?php
65
+ if(Mage::app()->getStore()->isFrontUrlSecure()){
66
+ $src = "https://".$config->getJsUrl();
67
+ } else {
68
+ $src = "http://".$config->getJsUrl();
69
+ } ?>
70
+ <script type="text/javascript" src="<?php echo $src; ?>/klevu-js-v1/js-1-1/klevu-landing.js">// <![CDATA[
71
+ // ]]></script>
72
+ <script type="text/javascript">// <![CDATA[
73
+ document.getElementById("searchedKeyword").value= klevu_getParamValue("q");
74
+ // ]]></script>
app/design/frontend/base/default/template/klevu/search/klevulog.phtml CHANGED
@@ -1,7 +1,4 @@
1
- <?php /** @var Mage_Core_Block_Template $this */
2
- echo "hi";
3
- exit;
4
- ?>
5
  <div id="messages_product_view">
6
  <?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>
7
  </div>
1
+ <?php /** @var Mage_Core_Block_Template $this */?>
 
 
 
2
  <div id="messages_product_view">
3
  <?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>
4
  </div>
app/design/frontend/base/default/template/klevu/search/product_tracking.phtml CHANGED
@@ -6,7 +6,6 @@
6
  var referrer, search_term, klevu_search_product_tracking;
7
  referrer = document.referrer;
8
  search_term = referrer.toQueryParams().q;
9
-
10
  if (referrer.indexOf('catalogsearch/result') > -1 && search_term) {
11
  klevu_search_product_tracking = <?php echo $this->getJsonTrackingData() ?>;
12
  klevu_search_product_tracking.klevu_term = search_term;
6
  var referrer, search_term, klevu_search_product_tracking;
7
  referrer = document.referrer;
8
  search_term = referrer.toQueryParams().q;
 
9
  if (referrer.indexOf('catalogsearch/result') > -1 && search_term) {
10
  klevu_search_product_tracking = <?php echo $this->getJsonTrackingData() ?>;
11
  klevu_search_product_tracking.klevu_term = search_term;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Klevu_SmartSearch</name>
4
- <version>1.1.15</version>
5
  <stability>stable</stability>
6
  <license uri="http://klevu.com">Commercial</license>
7
  <channel>community</channel>
@@ -14,11 +14,18 @@ Intelligent boosting - Just select products you want to promote, no need to manu
14
  Dynamic filters - Shoppers get excellent shopping experience.&#xD;
15
  Search as you type - Shoppers see results even with long keywords.&#xD;
16
  Actionable insights - Drive traffic by learning from shoppers' search patterns.</description>
17
- <notes>- Comparison of basic and pro</notes>
 
 
 
 
 
 
 
18
  <authors><author><name>Klevu</name><user>Klevu</user><email>niraj.aswani@klevu.com</email></author></authors>
19
- <date>2015-04-20</date>
20
- <time>11:32:27</time>
21
- <contents><target name="mageetc"><dir name="modules"><file name="Klevu_Search.xml" hash="49674c121481f67bcfc2f31bb21e5aaf"/></dir></target><target name="magecommunity"><dir name="Klevu"><dir name="Search"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Field"><dir name="Attribute"><file name="Mappings.php" hash="293c4d19663fa3aad76c17287fec2114"/></dir><dir name="Automatic"><dir name="Attribute"><file name="Mappings.php" hash="b0d192bd03319957d09f34d510914a2f"/></dir></dir><dir name="Html"><file name="Select.php" hash="adc22272b93deb46b524f46f7000972f"/></dir><dir name="Image"><file name="Button.php" hash="bebde12b67a3fd9717e0fb3a1b489bfb"/><file name="Log.php" hash="b74aaef7b0f94f0e775d0da6491316af"/></dir><dir name="Store"><dir name="Level"><file name="Label.php" hash="c2a77e64a2decb8abd101f15b4ea3e3f"/></dir></dir><dir name="Sync"><file name="Button.php" hash="a6f8f69290f84f0ecd731585b3cca0e7"/></dir></dir><file name="Information.php" hash="b422d8aa8524b4277f2b4013e90379a0"/></dir><file name="Notifications.php" hash="9fc2511a89e04cb2c9ce86fc7c3684cd"/><dir name="Wizard"><dir name="Config"><file name="Button.php" hash="d17ba7640d5777612ab9fb27f85aa5c9"/></dir><dir name="Configure"><file name="Attributes.php" hash="3801cd4ebb45b3d29cfbacf830af2874"/><file name="Store.php" hash="a5e900bf91db47115ce54497669fd384"/><file name="User.php" hash="f353da92a383854f419333e842380273"/></dir></dir></dir><dir name="Catalog"><dir name="Product"><file name="Tracking.php" hash="a472d4caf068d12f9151d0ed282293e4"/></dir></dir></dir><dir name="Helper"><file name="Api.php" hash="72588aad499bee2c3a543a8a558a8a90"/><file name="Compat.php" hash="3726862a4576a53c5a44dda59a1e9a86"/><file name="Config.php" hash="603e15a54fe1de9f1305ed36d5e11a0d"/><file name="Data.php" hash="22e73727ba0b0f2575da81b04eb2e4c4"/></dir><dir name="Model"><dir name="Api"><dir name="Action"><file name="Addrecords.php" hash="36ee2cb10481d4b223c02e7a339482bd"/><file name="Adduser.php" hash="d8b6e6d37fe6ce522747fd6951c8e9df"/><file name="Addwebstore.php" hash="ea33f2c7032682a6ec2bdb8324cdaf0e"/><file name="Debuginfo.php" hash="dd92df091719aa73eca07a08d9681d42"/><file name="Deleterecords.php" hash="0e404db0aab2c58ff90a4e7e4fe73818"/><file name="Gettimezone.php" hash="4bb572b68f42236d765f8194e413b1ca"/><file name="Getuserdetail.php" hash="849a0f04bfdbf39ae75a2627d26717ca"/><file name="Idsearch.php" hash="9244fbdf1e67beea19c99ad0a014d0fc"/><file name="Producttracking.php" hash="50dacac910b7a68b035078771e9f8ff6"/><file name="Removetestmode.php" hash="bd2e7ecf6c233b1430e2989b2b62000f"/><file name="Startsession.php" hash="14edcef879dce92c76a9c78d4106fc6c"/><file name="Updaterecords.php" hash="9e99ce8da72a030b10e9af8353233427"/></dir><file name="Action.php" hash="792f3fe4348f7d13bdf09562ec0d8b59"/><dir name="Request"><file name="Get.php" hash="2d6f510d4dcc171b8e44322b76a49f93"/><file name="Post.php" hash="a46b484a50ced15e2c02deb16bbeb6bb"/><file name="Xml.php" hash="73b3f04d29c2bd79c470d7b81cfc0390"/></dir><file name="Request.php" hash="7f15814e8a01982499563e0e056d2d52"/><dir name="Response"><file name="Data.php" hash="9dbe8e28a501feacb07a6ce2bcc4deb8"/><file name="Empty.php" hash="5988ec43c1756cf4acfedb212787b2b9"/><file name="Invalid.php" hash="8287280c3b99f64e08cf54a0bf65e4a1"/><file name="Message.php" hash="5b6d717c75014e798e619e3df2008d29"/><file name="Search.php" hash="96b9bdef60811c4d994cb457f0d355a9"/><file name="Timezone.php" hash="ffa4d48e42fa52d2c928e202c2af61fd"/></dir><file name="Response.php" hash="b2c244001dedd653e1f0953d6bf25e0e"/></dir><dir name="Catalog"><dir name="Model"><file name="Config.php" hash="57ae55e3cea3dd1b4c60dafcb06d5efd"/></dir></dir><dir name="CatalogSearch"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="104ac92f6ef59879b593a9f1baffd562"/><file name="Category.php" hash="d30670c5ca616dcb0c3f0dd2ffbb97ba"/><file name="Price.php" hash="4ca1e56183364670fb39a88ea5666c13"/></dir></dir><dir name="Resource"><dir name="Fulltext"><file name="Collection.php" hash="b80bc1ff2e539c4ff54ba9b04a53bae6"/></dir><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="d675e50ad7c5277b9ca4100770ac16d3"/></dir></dir></dir></dir><dir name="Config"><dir name="Log"><file name="Level.php" hash="ef07b22f48c4ca72066bf90a1cf9ac27"/></dir></dir><file name="Cron.php" hash="0936cc2667e056182668c9f61fc171bc"/><file name="Notification.php" hash="771d45868668c5b925e3bf2202482b43"/><file name="Observer.php" hash="a4eedf47b7194cd56aa0b7cc069fb691"/><dir name="Order"><file name="Sync.php" hash="e8af97ae357bfa1380e9f733d88efd5c"/></dir><dir name="Product"><file name="Sync.php" hash="4f3fcd3df423aa085fe209dd51e8876e"/></dir><dir name="Resource"><dir name="Notification"><file name="Collection.php" hash="936a242678b1c89853149e9dc77b6aff"/></dir><file name="Notification.php" hash="f3206c5286bf6ccb4df268c54fcff0f5"/></dir><file name="Session.php" hash="a4ab94b093ba8a414fbfa031f0d2cabe"/><file name="Sync.php" hash="f9f6f4d1251d493944ab13f1467d5257"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Additional"><file name="Attributes.php" hash="d91e1af65488d647b035fbb100a4eb1d"/></dir><dir name="Boosting"><file name="Attribute.php" hash="52a633242ff145d8f3b74c6a573c303e"/></dir><file name="Frequency.php" hash="5866e9d92476cdaa8a5f27c5fa0dc48b"/><file name="Landingoptions.php" hash="058c81eb9faec57f6c77db697ff3279e"/><dir name="Log"><file name="Level.php" hash="ba2bee63eb18b966db6beade72293036"/></dir><dir name="Product"><file name="Attributes.php" hash="f99ced41d6504f1570a703e66743dd0b"/></dir><file name="Yesnoforced.php" hash="0cf0e7842afae56af0caf92c9490295b"/></dir></dir></dir></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="a1a8faa15e50cd1d394bc79ca94f712b"/></dir><dir name="Controller"><dir name="CatalogSearch"><dir name="fixtures"><file name="search_results.yaml" hash="29bfca0b08d91f8acc4f7114f1e40475"/></dir></dir><file name="CatalogSearch.php" hash="7f8d9583333f5ad7a383a994816aa7a5"/></dir><dir name="Helper"><file name="Api.php" hash="74864f6af98fbbf64cf2e83e0ff25389"/><file name="Compat.php" hash="8bae993e0da8f368eb50689f271446a5"/><dir name="Config"><dir name="fixtures"><file name="testGetOrderSyncEnabledFlag.yaml" hash="998fd5ff61adf624336ba054e1898754"/><file name="testGetOrderSyncFrequency.yaml" hash="52dffcad75b15761a695eb451b99c751"/><file name="testGetProductSyncEnabledFlag.yaml" hash="431cf53b919d319bee1444c88c53d399"/><file name="testGetProductSyncFrequency.yaml" hash="004e62dfa22c9abfd8dcf56c92270e19"/><file name="testIsExtensionEnabledDisabled.yaml" hash="5d706b347b4f32f87dc8eb4dd6102148"/><file name="testIsExtensionEnabledEnabled.yaml" hash="52c9eb8a4fad4d8f3ba25c68d35977f3"/></dir><dir name="providers"><file name="testIsOrderSyncEnabled.yaml" hash="8239d8d0835b3fc555ac22906acd96da"/><file name="testIsProductSyncEnabled.yaml" hash="71e7c11155746f8add52a5b3704f4113"/><file name="testIsTestModeEnabled.yaml" hash="f727b557a1a13f0e98b576e3a067690b"/></dir></dir><file name="Config.php" hash="6a29543849d2b606f20f792018124b23"/><dir name="Data"><dir name="providers"><file name="testBytesToHumanReadable.yaml" hash="7cdb8705e108715abc63fa2cfd81626b"/><file name="testGetLanguageFromLocale.yaml" hash="c301f8dc090142627f6af4e4222b7708"/><file name="testHumanReadableToBytes.yaml" hash="dd89ae5b6705cfcfbf42ba64432c0f0a"/><file name="testIsProductionDomain.yaml" hash="f88ef0f80073fdb9cbdbd020348527a7"/></dir></dir><file name="Data.php" hash="93bb38ec55380a6ec7d79008496cac34"/></dir><dir name="Model"><dir name="Api"><dir name="Action"><dir name="Addrecords"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="26eea8bfc58c60e4a2f07dcbddc2e6fd"/><file name="testValidateRequiredFieldsRecords.yaml" hash="590b7ec9b7c33debb740b8c6c6db717f"/><file name="testValidateRequiredFieldsRecordsAllowedEmpty.yaml" hash="f82933b3d219491015cef39a214543bd"/><file name="testValidateRequiredFieldsRecordsEmpty.yaml" hash="d5dcd5aad682db42b1352c35b8905d47"/><file name="testValidateRequiredFieldsRecordsOptional.yaml" hash="25092bb84ba311815ca33971a388256e"/></dir></dir><file name="Addrecords.php" hash="14f5c217fac3f82957f54916fa29b387"/><dir name="Adduser"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="841f068ff3ffd8081ccc91e8675f998c"/></dir></dir><file name="Adduser.php" hash="5189f29f08c4ed30d9b6ac83429de3d0"/><dir name="Addwebstore"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="e52324b58b76d2d63cfa83ee228e1b31"/></dir></dir><file name="Addwebstore.php" hash="fbeac1b8adc5df45ef08a0a3331e5fbc"/><dir name="Getuserdetail"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="297df49838c47536bc9ee928b27470b2"/></dir></dir><file name="Getuserdetail.php" hash="4733d1ec7fd5b3b765aa88f182adf390"/><dir name="Idsearch"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="f36c1a1a1e6d1f5a2d3a59d8d349036e"/></dir></dir><file name="Idsearch.php" hash="0f572e9621086df59e53c55054e3f9d7"/><dir name="Producttracking"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="8749e326906367a0d0c26128ca944d0b"/></dir></dir><file name="Producttracking.php" hash="c41b1cb2e23bb00d83703d5f1775d31e"/><file name="Startsession.php" hash="e952ec0fd56d4a4603f73e297fd219c4"/></dir><file name="Action.php" hash="14ce7e11eb3acfda2dfea539c8f5254b"/><dir name="Request"><dir name="Xml"><dir name="providers"><file name="testGetDataAsXml.yaml" hash="4aa16e3557481444ba39775ee0b99d29"/></dir></dir><file name="Xml.php" hash="279a5defe0c933540e9635455590d8b1"/></dir><file name="Request.php" hash="b0cbdfe6a023d0479dc1b1c7fc6869c0"/><dir name="Response"><dir name="Data"><dir name="providers"><file name="testIsSuccessful.yaml" hash="f085922f4329b3d6b19c1e0010d3ca22"/></dir></dir><file name="Data.php" hash="1ab05c7225658f54bd31f0c205d05a2b"/><file name="Empty.php" hash="9933c42aa9ff06977ca3e53d2de15857"/><file name="Invalid.php" hash="bb68f25a053b7e5fc024bce0f5286fcb"/><dir name="Message"><dir name="providers"><file name="testIsSuccessful.yaml" hash="d53562002270a0c4b58ca94733309a21"/></dir></dir><file name="Message.php" hash="135c0d136fa9d0e86158407fc59294c3"/><dir name="Timezone"><dir name="providers"><file name="testIsSuccessful.yaml" hash="67f35e7ee5081689a1eddb867ae6256d"/></dir></dir><file name="Timezone.php" hash="f9cb063ef1f506f656a25c6206899eb3"/><dir name="providers"><file name="response_testIsSuccessful.yaml" hash="ac214d5ebf1eccb89e8fa85e8e3cbb75"/></dir></dir><file name="Response.php" hash="dbcce43ccb2cdf47bce5c05fcf27e759"/><dir name="Test"><file name="Case.php" hash="ec6d3169b9e2bd26655687124be779dd"/></dir><dir name="data"><file name="data_response_data.xml" hash="cd2e5d3dcac402828b9e5f0b0b637c76"/><file name="data_response_failure.xml" hash="ba677628e68149e0283729c1c8e5e86a"/><file name="data_response_no_response.xml" hash="98944f0eda050221de59100f4b22f030"/><file name="data_response_success.xml" hash="e92d1cfcd4461dc8d3fcabe1f902b40b"/><file name="data_response_success_only.xml" hash="276055d04a3f112efe9e6f1c337d7699"/><file name="message_response_failure.xml" hash="ab63c55523b26bd53ea6abf426dd11f5"/><file name="message_response_missing_message.xml" hash="4a43490eda6f33804ca400da2f9cdac1"/><file name="message_response_missing_status.xml" hash="39103fec18a0be88e4ff00a8149c8ad4"/><file name="message_response_session_id.xml" hash="415f25f79a3795ae70b983504cbb784f"/><file name="message_response_success.xml" hash="3ac53566b3d187cb81eb04d40a195c50"/><file name="response_malformed.xml" hash="bfeb4e75829a42082a7935a8e7be491e"/><file name="response_noxml.xml" hash="2debfdcf79f03e4a65a667d21ef9de14"/><file name="response_valid.xml" hash="c915992330f0e4bd37bb629637139f98"/><file name="search_response_empty.xml" hash="601298402d21f3626052634cbbb0ae72"/><file name="search_response_paged.xml" hash="04203807a1d6df787c54afd84690a50e"/><file name="search_response_sorted.xml" hash="c3ee65658a56f65334417328c7fbdcac"/><file name="search_response_success.xml" hash="fea4e59e7ae6e68b387729e320d5f49c"/><file name="startsession_response_success.xml" hash="1865ee2da80359e5a84914c56cae2c8d"/><file name="timezone_response_no_data.xml" hash="276055d04a3f112efe9e6f1c337d7699"/><file name="timezone_response_no_status.xml" hash="bd695479b03e3607196f01f627af4a45"/><file name="timezone_response_with_failure.xml" hash="69a6b1fa7b2cf087d85be162064525b0"/><file name="timezone_response_with_success.xml" hash="e6888eca066741675d228ba1397b5554"/></dir></dir><dir name="Config"><dir name="Log"><file name="Level.php" hash="2032f568dc75c8a5ff63c7daaf8bd049"/></dir></dir><dir name="Notification"><dir name="fixtures"><file name="testLoad.yaml" hash="305afce09851bb40e8c990c138aff162"/></dir></dir><file name="Notification.php" hash="889ec647dbdb938741cfc75e1baa2bc2"/><dir name="Observer"><dir name="fixtures"><file name="testScheduleOrderSync.yaml" hash="9dc706c72f13c3dbf43add1b23d1edce"/></dir></dir><file name="Observer.php" hash="f47e6187bcc7f738f40865a5db663467"/><dir name="Order"><dir name="Sync"><dir name="fixtures"><file name="testAddOrderToQueue.yaml" hash="9fd8654cffa0c5e5ad8140825a116601"/><file name="testClearQueue.yaml" hash="2413c55c5e3f05e15668fbe7edbe0bb0"/><file name="testRun.yaml" hash="b0b694cbdbfbbd97880254841f57fcf9"/></dir></dir><file name="Sync.php" hash="d2166272904e003b6bea3862f66e0235"/></dir><dir name="Product"><dir name="Sync"><dir name="fixtures"><file name="testAddProducts.yaml" hash="3059d9bfa5e611542384f2177b693d0c"/><file name="testClearAllProducts.yaml" hash="7420a73a3db174f74f825a9267f9be96"/><file name="testDeleteProducts.yaml" hash="fdac9c823890a3308fa83564df2b2531"/><file name="testRun.yaml" hash="1890501df756f0e8813d66f5726cbbc8"/><file name="testUpdateProducts.yaml" hash="796f71e44f79c5e5bb14f8d860bcbcd5"/></dir></dir><file name="Sync.php" hash="bb0455f3b8ce4988f4da8e66d90a9ef8"/></dir><dir name="Sync"><dir name="providers"><file name="testSchedule.yaml" hash="97f1043c42eb74162ae97941dc920d8f"/></dir></dir><file name="Sync.php" hash="8c091e168e251761be7fb1d1d2149305"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Test"><dir name="providers"><file name="testIsValidSourceModel.yaml" hash="cfedc94014707ee5586dd212b4d1ee16"/></dir></dir><file name="Test.php" hash="3e915599d4f76a2fbbb20aed9ffdf968"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Klevu"><file name="NotificationsController.php" hash="e6a8f7ee4ca5463bb9b3df5fa901b6b1"/><dir name="Search"><file name="WizardController.php" hash="5de993f8afaa30dcabbbaeb255503383"/></dir><file name="SearchController.php" hash="fc8669460e70f2a7cca27714faaf15d5"/></dir></dir><file name="SearchController.php" hash="1cd14cf045fedd2957a2bfd6de4b6080"/></dir><dir name="etc"><file name="adminhtml.xml" hash="938a66de5c0de1d096d7c0cb97e980cd"/><file name="config.xml" hash="0a253fba9567e946d6090c7a2aff9dc2"/><file name="system.xml" hash="26bc11cf684cc93977735cfa4bff4fa9"/></dir><dir name="sql"><dir name="klevu_search_setup"><file name="mysql4-data-upgrade-1.1.1-1.1.2.php" hash="28513b00d6ee4ac0a2bd0716484ff687"/><file name="mysql4-data-upgrade-1.1.7-1.1.8.php" hash="dd74fc5c8209647d87b5757a0fad6805"/><file name="mysql4-install-1.0.0.php" hash="860c1991c2ebf804f939598e9932edf5"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="klevu"><dir name="search"><dir name="form"><dir name="field"><file name="array_readonly.phtml" hash="d3a3be4cf22f89d84bd73121a1adfa86"/><dir name="sync"><file name="button.phtml" hash="0459f187b2b98a9ff5a9433875b465e1"/><file name="logbutton.phtml" hash="d31dd881015319d78d9fb2b83874f296"/></dir></dir><file name="information.phtml" hash="971e5e3e0823a740774164f58e00084e"/></dir><file name="notifications.phtml" hash="090714ca57b11d24769c1baa1bcd4615"/><dir name="wizard"><file name="complete.phtml" hash="aeca8d1a3335b461f5e6bcbba08c22b6"/><dir name="config"><file name="button.phtml" hash="b1644ee569882b05c2d8cb2f1eecddbc"/></dir><dir name="configure"><file name="attributes.phtml" hash="d54f0a86e78390fbe66825d0771aad25"/><file name="store.phtml" hash="1345462de285ecfe0bbe5ae8c422cbe6"/><file name="user.phtml" hash="559c117d0f164d1db10922e4b213f3fa"/></dir><dir name="form"><dir name="field"><file name="array.phtml" hash="ccdccab02fbd9cfc2145f094d5e12a2e"/></dir></dir></dir></dir></dir></dir><dir name="layout"><dir name="klevu"><file name="search.xml" hash="f385a7290bad22fb212b440afa82d2a7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="klevu"><file name="search.xml" hash="71f813aa8775943a17220ddc3c4b9a41"/></dir></dir><dir name="template"><dir name="klevu"><dir name="search"><file name="form_js.phtml" hash="0f685e77647449b5a752a6c90b8fd4b8"/><file name="klevulog.phtml" hash="4dfa41e3747b2281e66b949ff03d46e2"/><file name="product_tracking.phtml" hash="5f81bca7273a3f1197217b6e0015083e"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="klevu"><dir name="search"><dir name="lib"><file name="Wizard.js" hash="67e9ae1996da43d6e419853a1e096419"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="klevu"><dir name="search"><file name="notifications.css" hash="80954cfc49bb2bc45d2eafb7c28cedad"/><file name="wizard.css" hash="824f735715f3ed97ce98414b9895e46b"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="klevu"><file name="klevu-landing-page-style.css" hash="fcbb7555e0005a517132f91a8090e797"/><file name="klevu-landing-responsive.css" hash="811e1bfece09ba7d5529fec850963ac6"/></dir></dir><dir name="images"><dir name="klevu"><file name="btn-gridview.png" hash="c3dd97f4f53e1dfe34b6c5b6b4237b8a"/><file name="btn-listview.png" hash="00aaaa62d67e252248d6075f53b04f7f"/><file name="ku-loader.gif" hash="6050f5bcf455cc8f0332dd65e72f8e52"/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Klevu_SmartSearch</name>
4
+ <version>1.1.16</version>
5
  <stability>stable</stability>
6
  <license uri="http://klevu.com">Commercial</license>
7
  <channel>community</channel>
14
  Dynamic filters - Shoppers get excellent shopping experience.&#xD;
15
  Search as you type - Shoppers see results even with long keywords.&#xD;
16
  Actionable insights - Drive traffic by learning from shoppers' search patterns.</description>
17
+ <notes>-Special price change&#xD;
18
+ -category product change &#xD;
19
+ -get klevu current version&#xD;
20
+ -image change&#xD;
21
+ -klevu template landing page in controller&#xD;
22
+ -multiple search box &#xD;
23
+ -https fix&#xD;
24
+ -add webstore code in webstore url</notes>
25
  <authors><author><name>Klevu</name><user>Klevu</user><email>niraj.aswani@klevu.com</email></author></authors>
26
+ <date>2015-05-02</date>
27
+ <time>07:03:30</time>
28
+ <contents><target name="mageetc"><dir name="modules"><file name="Klevu_Search.xml" hash="49674c121481f67bcfc2f31bb21e5aaf"/></dir></target><target name="magecommunity"><dir name="Klevu"><dir name="Search"><dir name="Block"><dir name="Adminhtml"><dir name="Form"><dir name="Field"><dir name="Attribute"><file name="Mappings.php" hash="293c4d19663fa3aad76c17287fec2114"/></dir><dir name="Automatic"><dir name="Attribute"><file name="Mappings.php" hash="b0d192bd03319957d09f34d510914a2f"/></dir></dir><dir name="Html"><file name="Select.php" hash="adc22272b93deb46b524f46f7000972f"/></dir><dir name="Image"><file name="Log.php" hash="5be8e22db76874a10914b297425532c6"/></dir><dir name="Store"><dir name="Level"><file name="Label.php" hash="c2a77e64a2decb8abd101f15b4ea3e3f"/></dir></dir><dir name="Sync"><file name="Button.php" hash="a6f8f69290f84f0ecd731585b3cca0e7"/></dir></dir><file name="Information.php" hash="b422d8aa8524b4277f2b4013e90379a0"/></dir><file name="Notifications.php" hash="9fc2511a89e04cb2c9ce86fc7c3684cd"/><dir name="Wizard"><dir name="Config"><file name="Button.php" hash="d17ba7640d5777612ab9fb27f85aa5c9"/></dir><dir name="Configure"><file name="Attributes.php" hash="3801cd4ebb45b3d29cfbacf830af2874"/><file name="Store.php" hash="a5e900bf91db47115ce54497669fd384"/><file name="User.php" hash="f353da92a383854f419333e842380273"/></dir></dir></dir><dir name="Catalog"><dir name="Product"><file name="Tracking.php" hash="a472d4caf068d12f9151d0ed282293e4"/></dir></dir></dir><dir name="Helper"><file name="Api.php" hash="73d65beb4ad3f68e96b9685577d16ee0"/><file name="Compat.php" hash="3726862a4576a53c5a44dda59a1e9a86"/><file name="Config.php" hash="79d555cc3d86663acde864416c43f0b0"/><file name="Data.php" hash="22e73727ba0b0f2575da81b04eb2e4c4"/></dir><dir name="Model"><dir name="Api"><dir name="Action"><file name="Addrecords.php" hash="088f40418b35a682a3f815dbfbd42fa7"/><file name="Adduser.php" hash="d8b6e6d37fe6ce522747fd6951c8e9df"/><file name="Addwebstore.php" hash="ea33f2c7032682a6ec2bdb8324cdaf0e"/><file name="Debuginfo.php" hash="dd92df091719aa73eca07a08d9681d42"/><file name="Deleterecords.php" hash="0e404db0aab2c58ff90a4e7e4fe73818"/><file name="Gettimezone.php" hash="4bb572b68f42236d765f8194e413b1ca"/><file name="Getuserdetail.php" hash="849a0f04bfdbf39ae75a2627d26717ca"/><file name="Idsearch.php" hash="9244fbdf1e67beea19c99ad0a014d0fc"/><file name="Producttracking.php" hash="50dacac910b7a68b035078771e9f8ff6"/><file name="Removetestmode.php" hash="bd2e7ecf6c233b1430e2989b2b62000f"/><file name="Startsession.php" hash="14edcef879dce92c76a9c78d4106fc6c"/><file name="Updaterecords.php" hash="9e99ce8da72a030b10e9af8353233427"/></dir><file name="Action.php" hash="792f3fe4348f7d13bdf09562ec0d8b59"/><dir name="Request"><file name="Get.php" hash="2d6f510d4dcc171b8e44322b76a49f93"/><file name="Post.php" hash="a46b484a50ced15e2c02deb16bbeb6bb"/><file name="Xml.php" hash="73b3f04d29c2bd79c470d7b81cfc0390"/></dir><file name="Request.php" hash="7f15814e8a01982499563e0e056d2d52"/><dir name="Response"><file name="Data.php" hash="9dbe8e28a501feacb07a6ce2bcc4deb8"/><file name="Empty.php" hash="5988ec43c1756cf4acfedb212787b2b9"/><file name="Invalid.php" hash="8287280c3b99f64e08cf54a0bf65e4a1"/><file name="Message.php" hash="5b6d717c75014e798e619e3df2008d29"/><file name="Search.php" hash="96b9bdef60811c4d994cb457f0d355a9"/><file name="Timezone.php" hash="ffa4d48e42fa52d2c928e202c2af61fd"/></dir><file name="Response.php" hash="b2c244001dedd653e1f0953d6bf25e0e"/></dir><dir name="Catalog"><dir name="Model"><file name="Config.php" hash="57ae55e3cea3dd1b4c60dafcb06d5efd"/></dir></dir><dir name="CatalogSearch"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="104ac92f6ef59879b593a9f1baffd562"/><file name="Category.php" hash="d30670c5ca616dcb0c3f0dd2ffbb97ba"/><file name="Price.php" hash="4ca1e56183364670fb39a88ea5666c13"/></dir></dir><dir name="Resource"><dir name="Fulltext"><file name="Collection.php" hash="d6a46fb60056ce18e8e7735e5b76a43d"/></dir><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="d675e50ad7c5277b9ca4100770ac16d3"/></dir></dir></dir></dir><dir name="Config"><dir name="Log"><file name="Level.php" hash="ef07b22f48c4ca72066bf90a1cf9ac27"/></dir></dir><file name="Cron.php" hash="0936cc2667e056182668c9f61fc171bc"/><file name="Notification.php" hash="771d45868668c5b925e3bf2202482b43"/><file name="Observer.php" hash="9d1d7f5138a1eba069b6cdcf068b68f9"/><dir name="Order"><file name="Sync.php" hash="e8af97ae357bfa1380e9f733d88efd5c"/></dir><dir name="Product"><file name="Sync.php" hash="f8149e6e8ae6fb257040b6372163ec63"/></dir><dir name="Resource"><dir name="Notification"><file name="Collection.php" hash="936a242678b1c89853149e9dc77b6aff"/></dir><file name="Notification.php" hash="f3206c5286bf6ccb4df268c54fcff0f5"/></dir><file name="Session.php" hash="a4ab94b093ba8a414fbfa031f0d2cabe"/><file name="Sync.php" hash="f9f6f4d1251d493944ab13f1467d5257"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Additional"><file name="Attributes.php" hash="d91e1af65488d647b035fbb100a4eb1d"/></dir><dir name="Boosting"><file name="Attribute.php" hash="52a633242ff145d8f3b74c6a573c303e"/></dir><file name="Frequency.php" hash="5866e9d92476cdaa8a5f27c5fa0dc48b"/><file name="Landingoptions.php" hash="058c81eb9faec57f6c77db697ff3279e"/><dir name="Log"><file name="Level.php" hash="ba2bee63eb18b966db6beade72293036"/></dir><dir name="Product"><file name="Attributes.php" hash="f99ced41d6504f1570a703e66743dd0b"/></dir><file name="Yesnoforced.php" hash="0cf0e7842afae56af0caf92c9490295b"/></dir></dir></dir></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="a1a8faa15e50cd1d394bc79ca94f712b"/></dir><dir name="Controller"><dir name="CatalogSearch"><dir name="fixtures"><file name="search_results.yaml" hash="bfa6ebad238b75d771b89fb369201540"/></dir></dir><file name="CatalogSearch.php" hash="f6c2615ef27061d0cce7e7eae717c040"/></dir><dir name="Helper"><file name="Api.php" hash="c8484c149e920b3f74b8f6f2dce82936"/><file name="Compat.php" hash="8bae993e0da8f368eb50689f271446a5"/><dir name="Config"><dir name="fixtures"><file name="testGetOrderSyncEnabledFlag.yaml" hash="d1427ea15734ca336c47aad51ad7026e"/><file name="testGetOrderSyncFrequency.yaml" hash="52dffcad75b15761a695eb451b99c751"/><file name="testGetProductSyncEnabledFlag.yaml" hash="43e7263c8b781ef7fb6efbb6598f0226"/><file name="testGetProductSyncFrequency.yaml" hash="004e62dfa22c9abfd8dcf56c92270e19"/><file name="testIsExtensionEnabledDisabled.yaml" hash="5d706b347b4f32f87dc8eb4dd6102148"/><file name="testIsExtensionEnabledEnabled.yaml" hash="52c9eb8a4fad4d8f3ba25c68d35977f3"/></dir><dir name="providers"><file name="testIsOrderSyncEnabled.yaml" hash="938cc58e15b310ba2760be6c64e3d3cb"/><file name="testIsProductSyncEnabled.yaml" hash="5be1dcfb21264a012de32cbd252a09c9"/><file name="testIsTestModeEnabled.yaml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><file name="Config.php" hash="9ef7b00d63104e11426f3085afa36744"/><dir name="Data"><dir name="providers"><file name="testBytesToHumanReadable.yaml" hash="7cdb8705e108715abc63fa2cfd81626b"/><file name="testGetLanguageFromLocale.yaml" hash="c301f8dc090142627f6af4e4222b7708"/><file name="testHumanReadableToBytes.yaml" hash="dd89ae5b6705cfcfbf42ba64432c0f0a"/><file name="testIsProductionDomain.yaml" hash="f88ef0f80073fdb9cbdbd020348527a7"/></dir></dir><file name="Data.php" hash="93bb38ec55380a6ec7d79008496cac34"/></dir><dir name="Model"><dir name="Api"><dir name="Action"><dir name="Addrecords"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="26eea8bfc58c60e4a2f07dcbddc2e6fd"/><file name="testValidateRequiredFieldsRecords.yaml" hash="590b7ec9b7c33debb740b8c6c6db717f"/><file name="testValidateRequiredFieldsRecordsAllowedEmpty.yaml" hash="f82933b3d219491015cef39a214543bd"/><file name="testValidateRequiredFieldsRecordsEmpty.yaml" hash="d5dcd5aad682db42b1352c35b8905d47"/><file name="testValidateRequiredFieldsRecordsOptional.yaml" hash="25092bb84ba311815ca33971a388256e"/></dir></dir><file name="Addrecords.php" hash="14f5c217fac3f82957f54916fa29b387"/><dir name="Adduser"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="841f068ff3ffd8081ccc91e8675f998c"/></dir></dir><file name="Adduser.php" hash="5189f29f08c4ed30d9b6ac83429de3d0"/><dir name="Addwebstore"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="e52324b58b76d2d63cfa83ee228e1b31"/></dir></dir><file name="Addwebstore.php" hash="fbeac1b8adc5df45ef08a0a3331e5fbc"/><dir name="Getuserdetail"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="297df49838c47536bc9ee928b27470b2"/></dir></dir><file name="Getuserdetail.php" hash="4733d1ec7fd5b3b765aa88f182adf390"/><dir name="Idsearch"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="f36c1a1a1e6d1f5a2d3a59d8d349036e"/></dir></dir><file name="Idsearch.php" hash="4c8849b460a0df494911e3a4df65719c"/><dir name="Producttracking"><dir name="providers"><file name="testValidateRequiredFields.yaml" hash="4bc690980c701649d17ff6caba3ef646"/></dir></dir><file name="Producttracking.php" hash="04d8ef59f24f848d36493aabfa413828"/><file name="Startsession.php" hash="c1ae49d22b5e75672b8d84499d51f3d4"/></dir><file name="Action.php" hash="14ce7e11eb3acfda2dfea539c8f5254b"/><dir name="Request"><dir name="Xml"><dir name="providers"><file name="testGetDataAsXml.yaml" hash="4aa16e3557481444ba39775ee0b99d29"/></dir></dir><file name="Xml.php" hash="279a5defe0c933540e9635455590d8b1"/></dir><file name="Request.php" hash="b0cbdfe6a023d0479dc1b1c7fc6869c0"/><dir name="Response"><dir name="Data"><dir name="providers"><file name="testIsSuccessful.yaml" hash="f085922f4329b3d6b19c1e0010d3ca22"/></dir></dir><file name="Data.php" hash="1ab05c7225658f54bd31f0c205d05a2b"/><file name="Empty.php" hash="9933c42aa9ff06977ca3e53d2de15857"/><file name="Invalid.php" hash="bb68f25a053b7e5fc024bce0f5286fcb"/><dir name="Message"><dir name="providers"><file name="testIsSuccessful.yaml" hash="d53562002270a0c4b58ca94733309a21"/></dir></dir><file name="Message.php" hash="135c0d136fa9d0e86158407fc59294c3"/><dir name="Timezone"><dir name="providers"><file name="testIsSuccessful.yaml" hash="67f35e7ee5081689a1eddb867ae6256d"/></dir></dir><file name="Timezone.php" hash="f9cb063ef1f506f656a25c6206899eb3"/><dir name="providers"><file name="response_testIsSuccessful.yaml" hash="ac214d5ebf1eccb89e8fa85e8e3cbb75"/></dir></dir><file name="Response.php" hash="dbcce43ccb2cdf47bce5c05fcf27e759"/><dir name="Test"><file name="Case.php" hash="ec6d3169b9e2bd26655687124be779dd"/></dir><dir name="data"><file name="data_response_data.xml" hash="cd2e5d3dcac402828b9e5f0b0b637c76"/><file name="data_response_failure.xml" hash="ba677628e68149e0283729c1c8e5e86a"/><file name="data_response_no_response.xml" hash="98944f0eda050221de59100f4b22f030"/><file name="data_response_success.xml" hash="e92d1cfcd4461dc8d3fcabe1f902b40b"/><file name="data_response_success_only.xml" hash="276055d04a3f112efe9e6f1c337d7699"/><file name="message_response_failure.xml" hash="ab63c55523b26bd53ea6abf426dd11f5"/><file name="message_response_missing_message.xml" hash="4a43490eda6f33804ca400da2f9cdac1"/><file name="message_response_missing_status.xml" hash="39103fec18a0be88e4ff00a8149c8ad4"/><file name="message_response_session_id.xml" hash="415f25f79a3795ae70b983504cbb784f"/><file name="message_response_success.xml" hash="3ac53566b3d187cb81eb04d40a195c50"/><file name="response_malformed.xml" hash="bfeb4e75829a42082a7935a8e7be491e"/><file name="response_noxml.xml" hash="2debfdcf79f03e4a65a667d21ef9de14"/><file name="response_valid.xml" hash="c915992330f0e4bd37bb629637139f98"/><file name="search_response_empty.xml" hash="601298402d21f3626052634cbbb0ae72"/><file name="search_response_paged.xml" hash="04203807a1d6df787c54afd84690a50e"/><file name="search_response_sorted.xml" hash="c3ee65658a56f65334417328c7fbdcac"/><file name="search_response_success.xml" hash="fea4e59e7ae6e68b387729e320d5f49c"/><file name="startsession_response_success.xml" hash="1865ee2da80359e5a84914c56cae2c8d"/><file name="timezone_response_no_data.xml" hash="276055d04a3f112efe9e6f1c337d7699"/><file name="timezone_response_no_status.xml" hash="bd695479b03e3607196f01f627af4a45"/><file name="timezone_response_with_failure.xml" hash="69a6b1fa7b2cf087d85be162064525b0"/><file name="timezone_response_with_success.xml" hash="e6888eca066741675d228ba1397b5554"/></dir></dir><dir name="Config"><dir name="Log"><file name="Level.php" hash="2032f568dc75c8a5ff63c7daaf8bd049"/></dir></dir><dir name="Notification"><dir name="fixtures"><file name="testLoad.yaml" hash="305afce09851bb40e8c990c138aff162"/></dir></dir><file name="Notification.php" hash="889ec647dbdb938741cfc75e1baa2bc2"/><dir name="Observer"><dir name="fixtures"><file name="testLandingPageRewritesDisabled.yaml" hash="88f0c274444dbaab4fded639b4f40048"/><file name="testLandingPageRewritesEnabled.yaml" hash="bfe60a7ccc0ac73c664f24a4b7394343"/><file name="testScheduleOrderSync.yaml" hash="170806194b4a1bd7f00bc346a51709e1"/></dir></dir><file name="Observer.php" hash="73349e9c475129197c2cf55a1e1d4cdc"/><dir name="Order"><dir name="Sync"><dir name="fixtures"><file name="testAddOrderToQueue.yaml" hash="c93c3c28273757a13b878f97dd0b9e97"/><file name="testClearQueue.yaml" hash="d7ad7abd553e333e84cbab149cdcfb31"/><file name="testRun.yaml" hash="44f091d24de97d230f61fcaf3689ba81"/></dir></dir><file name="Sync.php" hash="d2166272904e003b6bea3862f66e0235"/></dir><dir name="Product"><dir name="Sync"><dir name="fixtures"><file name="testAddProducts.yaml" hash="0ac9a9e6666f285eff796d30c8e0a4e3"/><file name="testCatalogruleProducts.yaml" hash="c37fe4fe86fda18d9fd90794ea1520e4"/><file name="testClearAllProducts.yaml" hash="b7ec8b285d34a27e1c50d572b5ae8227"/><file name="testDeleteProducts.yaml" hash="22f94366cc64b6980b8d648067920533"/><file name="testRun.yaml" hash="eaac2bf57835625a6cd80294e6c5a99c"/><file name="testSpecialpriceProducts.yaml" hash="7d44672dcf91473c0bf1d9cb523a394a"/><file name="testUpdateProducts.yaml" hash="61266411faa659dc175f75ffbccce97e"/></dir></dir><file name="Sync.php" hash="464c549e54103898fea0bef21649dcd1"/></dir><dir name="Sync"><dir name="providers"><file name="testSchedule.yaml" hash="97f1043c42eb74162ae97941dc920d8f"/></dir></dir><file name="Sync.php" hash="8c091e168e251761be7fb1d1d2149305"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Test"><dir name="providers"><file name="testIsValidSourceModel.yaml" hash="cfedc94014707ee5586dd212b4d1ee16"/></dir></dir><file name="Test.php" hash="3e915599d4f76a2fbbb20aed9ffdf968"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Klevu"><file name="NotificationsController.php" hash="e6a8f7ee4ca5463bb9b3df5fa901b6b1"/><dir name="Search"><file name="WizardController.php" hash="5de993f8afaa30dcabbbaeb255503383"/></dir><file name="SearchController.php" hash="eb4e183d45fe049e2a0b7df7739b3f8d"/></dir></dir><file name="IndexController.php" hash="565b44bf8b4c4db9bb1a3f66c61028fb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="938a66de5c0de1d096d7c0cb97e980cd"/><file name="config.xml" hash="ea229c84d706a3728c1d0da81b830285"/><file name="system.xml" hash="7e51ed58bf7300e4c6dba0aa03a5cbc4"/></dir><dir name="sql"><dir name="klevu_search_setup"><file name="mysql4-data-upgrade-1.1.1-1.1.2.php" hash="a65f702cf64af452f2fb6f6cdac130a7"/><file name="mysql4-install-1.0.0.php" hash="860c1991c2ebf804f939598e9932edf5"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="klevu"><dir name="search"><dir name="form"><dir name="field"><file name="array_readonly.phtml" hash="d3a3be4cf22f89d84bd73121a1adfa86"/><dir name="sync"><file name="button.phtml" hash="0459f187b2b98a9ff5a9433875b465e1"/><file name="logbutton.phtml" hash="d31dd881015319d78d9fb2b83874f296"/></dir></dir><file name="information.phtml" hash="971e5e3e0823a740774164f58e00084e"/></dir><file name="notifications.phtml" hash="090714ca57b11d24769c1baa1bcd4615"/><dir name="wizard"><file name="complete.phtml" hash="aeca8d1a3335b461f5e6bcbba08c22b6"/><dir name="config"><file name="button.phtml" hash="b1644ee569882b05c2d8cb2f1eecddbc"/></dir><dir name="configure"><file name="attributes.phtml" hash="d54f0a86e78390fbe66825d0771aad25"/><file name="store.phtml" hash="1345462de285ecfe0bbe5ae8c422cbe6"/><file name="user.phtml" hash="559c117d0f164d1db10922e4b213f3fa"/></dir><dir name="form"><dir name="field"><file name="array.phtml" hash="ccdccab02fbd9cfc2145f094d5e12a2e"/></dir></dir></dir></dir></dir></dir><dir name="layout"><dir name="klevu"><file name="search.xml" hash="f385a7290bad22fb212b440afa82d2a7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="klevu"><file name="search.xml" hash="2cba521b2f52d070a496a78fbed83136"/></dir></dir><dir name="template"><dir name="klevu"><dir name="search"><file name="form_js.phtml" hash="13ecea7a0e7bd867795167414d72f20f"/><file name="index.phtml" hash="2d9cb3fbb4a95cfb348219c8f0bc5897"/><file name="klevulog.phtml" hash="9cebbd9ec162570768aefc30c777fb78"/><file name="product_tracking.phtml" hash="4d7e50935d5106ca47e3f4e372be3254"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="klevu"><dir name="search"><dir name="lib"><file name="Wizard.js" hash="67e9ae1996da43d6e419853a1e096419"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="klevu"><dir name="search"><file name="notifications.css" hash="80954cfc49bb2bc45d2eafb7c28cedad"/><file name="wizard.css" hash="824f735715f3ed97ce98414b9895e46b"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="klevu"><file name="klevu-landing-page-style.css" hash="fcbb7555e0005a517132f91a8090e797"/><file name="klevu-landing-responsive.css" hash="811e1bfece09ba7d5529fec850963ac6"/></dir></dir><dir name="images"><dir name="klevu"><file name="btn-gridview.png" hash="c3dd97f4f53e1dfe34b6c5b6b4237b8a"/><file name="btn-listview.png" hash="00aaaa62d67e252248d6075f53b04f7f"/><file name="ku-loader.gif" hash="6050f5bcf455cc8f0332dd65e72f8e52"/></dir></dir></dir></dir></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
31
  </package>