Flagbit_Factfinder - Version 4.1.1

Version Notes

Release

Download this release

Release Info

Developer FACTFinder
Extension Flagbit_Factfinder
Version 4.1.1
Comparing to
See all releases


Code changes from version 3.5.5 to 4.1.1

Files changed (499) hide show
  1. app/code/community/FACTFinder/Asn/Block/Catalog/Layer/Factfinder.php +64 -0
  2. app/code/community/FACTFinder/Asn/Block/Catalog/Layer/State.php +47 -0
  3. app/code/community/FACTFinder/Asn/Block/Catalog/Product/List/Toolbar.php +59 -0
  4. app/code/community/FACTFinder/Asn/Block/Catalog/Product/Pager.php +58 -0
  5. app/code/community/FACTFinder/Asn/Helper/Data.php +93 -0
  6. app/code/community/FACTFinder/Asn/Model/Catalog/Layer.php +48 -0
  7. app/code/community/FACTFinder/Asn/Model/Handler/Search.php +365 -0
  8. app/code/community/FACTFinder/Asn/Model/Layer/Filter/Factfinder.php +138 -0
  9. app/code/community/FACTFinder/Asn/Model/Layer/Filter/Item.php +118 -0
  10. app/code/community/FACTFinder/Asn/Model/Observer.php +126 -0
  11. app/code/community/FACTFinder/Asn/Model/Resource/Product/Attribute/Collection.php +181 -0
  12. app/code/community/FACTFinder/Asn/Model/Resource/Search/Collection.php +38 -0
  13. app/code/community/FACTFinder/Asn/etc/config.xml +82 -0
  14. app/code/community/FACTFinder/Asn/etc/system.xml +34 -0
  15. app/code/community/FACTFinder/Campaigns/Block/Abstract.php +78 -0
  16. app/code/community/FACTFinder/Campaigns/Block/Advisory/Product.php +87 -0
  17. app/code/community/FACTFinder/Campaigns/Block/Advisory/Search.php +50 -0
  18. app/code/community/FACTFinder/Campaigns/Block/Feedback/Abstract.php +49 -0
  19. app/code/community/FACTFinder/Campaigns/Block/Feedback/Cart.php +30 -0
  20. app/code/community/FACTFinder/Campaigns/Block/Feedback/Product.php +42 -0
  21. app/code/community/FACTFinder/Campaigns/Block/Feedback/Search.php +27 -0
  22. app/code/community/FACTFinder/Campaigns/Block/Pushed/Abstract.php +128 -0
  23. app/code/community/FACTFinder/Campaigns/Block/Pushed/Cart.php +28 -0
  24. app/code/community/FACTFinder/Campaigns/Block/Pushed/Product.php +42 -0
  25. app/code/community/FACTFinder/Campaigns/Block/Pushed/Search.php +46 -0
  26. app/code/community/FACTFinder/Campaigns/Helper/Data.php +63 -0
  27. app/code/community/FACTFinder/Campaigns/Model/Facade.php +67 -0
  28. app/code/community/FACTFinder/Campaigns/Model/Handler/Abstract.php +155 -0
  29. app/code/community/FACTFinder/Campaigns/Model/Handler/Cart.php +70 -0
  30. app/code/community/FACTFinder/Campaigns/Model/Handler/Product.php +65 -0
  31. app/code/community/FACTFinder/Campaigns/Model/Handler/Search.php +71 -0
  32. app/code/community/FACTFinder/Campaigns/Model/Observer.php +71 -0
  33. app/code/community/FACTFinder/Campaigns/Model/Resource/Pushedproducts/Collection.php +191 -0
  34. app/code/community/FACTFinder/Campaigns/etc/config.xml +68 -0
  35. app/code/community/FACTFinder/Campaigns/etc/system.xml +43 -0
  36. app/code/community/FACTFinder/Core/Block/Adminhtml/Exportlink.php +131 -0
  37. app/code/community/FACTFinder/Core/Block/Adminhtml/Form/Field/Attribute.php +87 -0
  38. app/code/community/FACTFinder/Core/Block/Adminhtml/Form/Field/Attributes.php +88 -0
  39. app/code/community/FACTFinder/Core/Block/Catalog/Product/List/Toolbar.php +280 -0
  40. app/code/community/FACTFinder/Core/Block/Catalog/Product/Pager.php +90 -0
  41. app/code/community/{Flagbit/FactFinder → FACTFinder/Core}/Helper/Backend.php +248 -228
  42. app/code/community/FACTFinder/Core/Helper/Data.php +158 -0
  43. app/code/community/FACTFinder/Core/Helper/Debug.php +192 -0
  44. app/code/community/FACTFinder/Core/Helper/Search.php +200 -0
  45. app/code/community/FACTFinder/Core/Model/Autoloader.php +71 -0
  46. app/code/community/FACTFinder/Core/Model/CatalogSearch/Layer.php +51 -0
  47. app/code/community/FACTFinder/Core/Model/Export/Price.php +148 -0
  48. app/code/community/FACTFinder/Core/Model/Export/Product.php +1082 -0
  49. app/code/community/FACTFinder/Core/Model/Export/Stock.php +150 -0
  50. app/code/community/FACTFinder/Core/Model/Facade.php +708 -0
  51. app/code/community/FACTFinder/Core/Model/File.php +135 -0
  52. app/code/community/FACTFinder/Core/Model/Handler/Abstract.php +74 -0
  53. app/code/community/FACTFinder/Core/Model/Handler/Search.php +280 -0
  54. app/code/community/FACTFinder/Core/Model/Handler/Status.php +287 -0
  55. app/code/community/FACTFinder/Core/Model/Observer.php +270 -0
  56. app/code/community/FACTFinder/Core/Model/Resource/Search/Collection.php +145 -0
  57. app/code/community/FACTFinder/Core/Model/Resource/Search/Engine.php +41 -0
  58. app/code/community/FACTFinder/Core/Model/System/Config/Backend/Attributes.php +53 -0
  59. app/code/community/FACTFinder/Core/Model/System/Config/Backend/Cron.php +76 -0
  60. app/code/community/FACTFinder/Core/Model/System/Config/Backend/Enabled.php +85 -0
  61. app/code/community/FACTFinder/Core/Model/System/Config/Source/Authtype.php +54 -0
  62. app/code/community/FACTFinder/Core/Model/System/Config/Source/Identifier.php +48 -0
  63. app/code/community/FACTFinder/Core/Model/System/Config/Source/Protocol.php +48 -0
  64. app/code/community/FACTFinder/Core/controllers/ExportController.php +241 -0
  65. app/code/community/FACTFinder/Core/etc/adminhtml.xml +35 -0
  66. app/code/community/FACTFinder/Core/etc/config.xml +184 -0
  67. app/code/community/{Flagbit/FactFinder → FACTFinder/Core}/etc/system.xml +441 -397
  68. app/code/community/FACTFinder/Recommendation/Helper/Data.php +46 -0
  69. app/code/community/FACTFinder/Recommendation/Model/Facade.php +74 -0
  70. app/code/community/FACTFinder/Recommendation/Model/Handler/Recommendations.php +126 -0
  71. app/code/community/FACTFinder/Recommendation/Model/Observer.php +168 -0
  72. app/code/community/FACTFinder/Recommendation/etc/config.xml +59 -0
  73. app/code/community/FACTFinder/Recommendation/etc/system.xml +23 -0
  74. app/code/community/FACTFinder/Suggest/Block/TopSearch.php +50 -0
  75. app/code/community/{Flagbit/FactFinder → FACTFinder/Suggest}/Block/XmlConnect/Catalog/Search/Suggest.php +65 -58
  76. app/code/community/FACTFinder/Suggest/Helper/Data.php +83 -0
  77. app/code/community/FACTFinder/Suggest/Model/Facade.php +82 -0
  78. app/code/community/FACTFinder/Suggest/Model/Handler/Suggest.php +192 -0
  79. app/code/community/FACTFinder/Suggest/Model/Observer.php +64 -0
  80. app/code/community/FACTFinder/Suggest/Model/Processor.php +302 -0
  81. app/code/community/FACTFinder/Suggest/Model/System/Config/Source/Imagetype.php +50 -0
  82. app/code/community/FACTFinder/Suggest/controllers/ProxyController.php +44 -0
  83. app/code/community/FACTFinder/Suggest/etc/config.xml +97 -0
  84. app/code/community/FACTFinder/Suggest/etc/system.xml +89 -0
  85. app/code/community/FACTFinder/Tagcloud/Block/TagCloud.php +89 -0
  86. app/code/community/FACTFinder/Tagcloud/Helper/Data.php +27 -0
  87. app/code/community/FACTFinder/Tagcloud/Model/Facade.php +70 -0
  88. app/code/community/FACTFinder/Tagcloud/Model/Handler/TagCloud.php +117 -0
  89. app/code/community/FACTFinder/Tagcloud/etc/config.xml +47 -0
  90. app/code/community/FACTFinder/Tracking/Block/Init.php +101 -0
  91. app/code/community/FACTFinder/Tracking/Helper/Data.php +59 -0
  92. app/code/community/FACTFinder/Tracking/Model/Facade.php +40 -0
  93. app/code/community/FACTFinder/Tracking/Model/Handler/Tracking.php +207 -0
  94. app/code/community/FACTFinder/Tracking/Model/Observer.php +279 -0
  95. app/code/community/FACTFinder/Tracking/Model/Processor.php +106 -0
  96. app/code/community/FACTFinder/Tracking/Model/Queue.php +39 -0
  97. app/code/community/FACTFinder/Tracking/Model/Resource/Queue.php +39 -0
  98. app/code/community/FACTFinder/Tracking/Model/Resource/Queue/Collection.php +40 -0
  99. app/code/community/FACTFinder/Tracking/controllers/ProxyController.php +39 -0
  100. app/code/community/FACTFinder/Tracking/etc/config.xml +151 -0
  101. app/code/community/FACTFinder/Tracking/etc/system.xml +66 -0
  102. app/code/community/FACTFinder/Tracking/sql/factfinder_tracking_setup/mysql4-install-1.0.0.php +49 -0
  103. app/code/community/Flagbit/FactFinder/Block/Adminhtml/Cockpit.php +0 -33
  104. app/code/community/Flagbit/FactFinder/Block/Adminhtml/Exportlink.php +0 -64
  105. app/code/community/Flagbit/FactFinder/Block/Adminhtml/Form/Field/Attribute.php +0 -54
  106. app/code/community/Flagbit/FactFinder/Block/Adminhtml/Form/Field/Attributes.php +0 -85
  107. app/code/community/Flagbit/FactFinder/Block/Campaign/Advisory.php +0 -32
  108. app/code/community/Flagbit/FactFinder/Block/Campaign/Cart/Advisory.php +0 -63
  109. app/code/community/Flagbit/FactFinder/Block/Campaign/Cart/Feedback.php +0 -67
  110. app/code/community/Flagbit/FactFinder/Block/Campaign/Feedback.php +0 -71
  111. app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Advisory.php +0 -54
  112. app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Feedback.php +0 -51
  113. app/code/community/Flagbit/FactFinder/Block/Cart/Crosssell.php +0 -92
  114. app/code/community/Flagbit/FactFinder/Block/Filter/Slider.php +0 -36
  115. app/code/community/Flagbit/FactFinder/Block/Layer.php +0 -154
  116. app/code/community/Flagbit/FactFinder/Block/Layer/Abstract.php +0 -33
  117. app/code/community/Flagbit/FactFinder/Block/Product/List/Crosssell.php +0 -74
  118. app/code/community/Flagbit/FactFinder/Block/Product/List/Upsell.php +0 -142
  119. app/code/community/Flagbit/FactFinder/Block/Secondaryresult.php +0 -31
  120. app/code/community/Flagbit/FactFinder/Block/TagCloud.php +0 -54
  121. app/code/community/Flagbit/FactFinder/Block/Tracking.php +0 -108
  122. app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Product/List.php +0 -134
  123. app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Search.php +0 -133
  124. app/code/community/Flagbit/FactFinder/Helper/Data.php +0 -73
  125. app/code/community/Flagbit/FactFinder/Helper/Debug.php +0 -140
  126. app/code/community/Flagbit/FactFinder/Helper/Search.php +0 -421
  127. app/code/community/Flagbit/FactFinder/Model/Export/Price.php +0 -91
  128. app/code/community/Flagbit/FactFinder/Model/Export/Product.php +0 -616
  129. app/code/community/Flagbit/FactFinder/Model/Export/Stock.php +0 -91
  130. app/code/community/Flagbit/FactFinder/Model/Facade.php +0 -549
  131. app/code/community/Flagbit/FactFinder/Model/Handler/Abstract.php +0 -45
  132. app/code/community/Flagbit/FactFinder/Model/Handler/CheckStatus.php +0 -150
  133. app/code/community/Flagbit/FactFinder/Model/Handler/ProductCampaign.php +0 -75
  134. app/code/community/Flagbit/FactFinder/Model/Handler/ProductDetailCampaign.php +0 -27
  135. app/code/community/Flagbit/FactFinder/Model/Handler/Recommendations.php +0 -51
  136. app/code/community/Flagbit/FactFinder/Model/Handler/Search.php +0 -435
  137. app/code/community/Flagbit/FactFinder/Model/Handler/SecondarySearch.php +0 -94
  138. app/code/community/Flagbit/FactFinder/Model/Handler/ShoppingCartCampaign.php +0 -27
  139. app/code/community/Flagbit/FactFinder/Model/Handler/Suggest.php +0 -106
  140. app/code/community/Flagbit/FactFinder/Model/Handler/TagCloud.php +0 -71
  141. app/code/community/Flagbit/FactFinder/Model/Handler/Tracking.php +0 -64
  142. app/code/community/Flagbit/FactFinder/Model/Handler/Tracking/Scic.php +0 -77
  143. app/code/community/Flagbit/FactFinder/Model/Layer.php +0 -83
  144. app/code/community/Flagbit/FactFinder/Model/Layer/Abstract.php +0 -7
  145. app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Abstract.php +0 -118
  146. app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Catalog.php +0 -25
  147. app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Catalogsearch.php +0 -35
  148. app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Item.php +0 -23
  149. app/code/community/Flagbit/FactFinder/Model/Mysql4/Campaign/Pushedproducts/Collection.php +0 -148
  150. app/code/community/Flagbit/FactFinder/Model/Mysql4/Product/Attribute/Collection.php +0 -144
  151. app/code/community/Flagbit/FactFinder/Model/Mysql4/Product/Recommendation/Collection.php +0 -59
  152. app/code/community/Flagbit/FactFinder/Model/Mysql4/Scic/Queue.php +0 -31
  153. app/code/community/Flagbit/FactFinder/Model/Mysql4/Scic/Queue/Collection.php +0 -28
  154. app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Collection.php +0 -135
  155. app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Engine.php +0 -53
  156. app/code/community/Flagbit/FactFinder/Model/Observer.php +0 -394
  157. app/code/community/Flagbit/FactFinder/Model/Processor.php +0 -281
  158. app/code/community/Flagbit/FactFinder/Model/Scic/Queue.php +0 -27
  159. app/code/community/Flagbit/FactFinder/Model/System/Config/Backend/Attributes.php +0 -52
  160. app/code/community/Flagbit/FactFinder/Model/System/Config/Backend/Enabled.php +0 -57
  161. app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Authtype.php +0 -45
  162. app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Ffversion.php +0 -53
  163. app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Identifier.php +0 -41
  164. app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Imagetype.php +0 -37
  165. app/code/community/Flagbit/FactFinder/controllers/Adminhtml/Factfinder/CockpitController.php +0 -53
  166. app/code/community/Flagbit/FactFinder/controllers/ExportController.php +0 -141
  167. app/code/community/Flagbit/FactFinder/controllers/ProxyController.php +0 -52
  168. app/code/community/Flagbit/FactFinder/etc/adminhtml.xml +0 -49
  169. app/code/community/Flagbit/FactFinder/etc/config.xml +0 -313
  170. app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-install-3.2.0.php +0 -38
  171. app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-upgrade-3.2.0-3.2.1.php +0 -30
  172. app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-upgrade-3.2.1-3.3.0.php +0 -34
  173. app/design/adminhtml/default/default/layout/factfinder.xml +0 -28
  174. app/design/adminhtml/default/default/template/factfinder/cockpit.phtml +0 -22
  175. app/design/frontend/base/default/layout/factfinder.xml +0 -78
  176. app/design/frontend/base/default/layout/factfinder/asn.xml +38 -0
  177. app/design/frontend/base/default/layout/factfinder/campaigns.xml +120 -0
  178. app/design/frontend/base/default/layout/factfinder/core.xml +54 -0
  179. app/design/frontend/base/default/layout/factfinder/suggest.xml +28 -0
  180. app/design/frontend/base/default/layout/factfinder/tagcloud.xml +21 -0
  181. app/design/frontend/base/default/layout/factfinder/tracking.xml +24 -0
  182. app/design/frontend/base/default/template/factfinder/asn/layer/filter/slider.phtml +41 -0
  183. app/design/frontend/base/default/template/factfinder/asn/layer/slider.phtml +18 -0
  184. app/design/frontend/base/default/template/factfinder/campaign/advisory.phtml +0 -12
  185. app/design/frontend/base/default/template/factfinder/campaign/cart/advisory.phtml +0 -12
  186. app/design/frontend/base/default/template/factfinder/campaign/cart/feedback.phtml +0 -6
  187. app/design/frontend/base/default/template/factfinder/campaign/feedback.phtml +0 -11
  188. app/design/frontend/base/default/template/factfinder/campaign/product/advisory.phtml +0 -13
  189. app/design/frontend/base/default/template/factfinder/campaign/product/feedback.phtml +0 -7
  190. app/design/frontend/base/default/template/factfinder/campaigns/advisory.phtml +32 -0
  191. app/design/frontend/base/default/template/factfinder/campaigns/feedback.phtml +15 -0
  192. app/design/frontend/base/default/template/factfinder/campaigns/pushed.phtml +43 -0
  193. app/design/frontend/base/default/template/factfinder/core/export/locked.phtml +19 -0
  194. app/design/frontend/base/default/template/factfinder/core/export/nofile.phtml +19 -0
  195. app/design/frontend/base/default/template/factfinder/filter/scriptaculousSlider.phtml +0 -103
  196. app/design/frontend/base/default/template/factfinder/filter/slider.phtml +0 -46
  197. app/design/frontend/base/default/template/factfinder/form.advancedsuggest.phtml +0 -97
  198. app/design/frontend/base/default/template/factfinder/form.advancedsuggest68.phtml +0 -111
  199. app/design/frontend/base/default/template/factfinder/form.mini.phtml +0 -54
  200. app/design/frontend/base/default/template/factfinder/logo.phtml +0 -22
  201. app/design/frontend/base/default/template/factfinder/secondaryresult.phtml +0 -41
  202. app/design/frontend/base/default/template/factfinder/suggest/advancedsuggest.phtml +57 -0
  203. app/design/frontend/base/default/template/factfinder/tracking.phtml +0 -33
  204. app/design/frontend/base/default/template/factfinder/tracking/init.phtml +26 -0
  205. app/etc/factfinder.xml +2 -20
  206. app/etc/modules/Flagbit_FactFinder.xml +0 -9
  207. app/locale/de_DE/Flagbit_FactFinder.csv +0 -91
  208. js/factfinder/jXHR.js +10 -10
  209. js/factfinder/suggest.js +127 -6
  210. js/factfinder/tracking.js +73 -61
  211. lib/FACTFinder/Abstract/Adapter.php +0 -134
  212. lib/FACTFinder/Abstract/Configuration.php +0 -223
  213. lib/FACTFinder/Abstract/DataProvider.php +0 -125
  214. lib/FACTFinder/Abstract/Logger.php +0 -23
  215. lib/FACTFinder/Adapter/AbstractAdapter.php +194 -0
  216. lib/FACTFinder/Adapter/Compare.php +179 -0
  217. lib/FACTFinder/Adapter/Import.php +100 -0
  218. lib/FACTFinder/Adapter/ProductCampaign.php +301 -0
  219. lib/FACTFinder/Adapter/Recommendation.php +212 -0
  220. lib/FACTFinder/Adapter/Search.php +1001 -0
  221. lib/FACTFinder/Adapter/SimilarRecords.php +220 -0
  222. lib/FACTFinder/Adapter/Suggest.php +127 -0
  223. lib/FACTFinder/Adapter/TagCloud.php +116 -0
  224. lib/FACTFinder/Adapter/Tracking.php +383 -0
  225. lib/FACTFinder/AdvisorAnswer.php +0 -77
  226. lib/FACTFinder/AdvisorQuestion.php +0 -67
  227. lib/FACTFinder/Asn.php +0 -37
  228. lib/FACTFinder/AsnFilterItem.php +0 -72
  229. lib/FACTFinder/AsnGroup.php +0 -177
  230. lib/FACTFinder/AsnSliderFilter.php +0 -139
  231. lib/FACTFinder/BreadCrumbItem.php +0 -75
  232. lib/FACTFinder/Campaign.php +0 -206
  233. lib/FACTFinder/CampaignIterator.php +0 -190
  234. lib/FACTFinder/Configuration.php +0 -448
  235. lib/FACTFinder/Core/AbstractConfiguration.php +231 -0
  236. lib/FACTFinder/Core/AbstractEncodingConverter.php +156 -0
  237. lib/FACTFinder/Core/Client/RequestParser.php +185 -0
  238. lib/FACTFinder/Core/Client/UrlBuilder.php +77 -0
  239. lib/FACTFinder/Core/ConfigurationInterface.php +212 -0
  240. lib/FACTFinder/Core/IConvEncodingConverter.php +40 -0
  241. lib/FACTFinder/Core/ManualConfiguration.php +197 -0
  242. lib/FACTFinder/Core/Page/.gitignore +0 -0
  243. lib/FACTFinder/Core/ParametersConverter.php +158 -0
  244. lib/FACTFinder/Core/Server/AbstractDataProvider.php +111 -0
  245. lib/FACTFinder/Core/Server/ConnectionData.php +202 -0
  246. lib/FACTFinder/Core/Server/EasyCurlDataProvider.php +230 -0
  247. lib/FACTFinder/Core/Server/EasyCurlRequestFactory.php +79 -0
  248. lib/FACTFinder/Core/Server/FileSystemDataProvider.php +121 -0
  249. lib/FACTFinder/Core/Server/FileSystemRequestFactory.php +70 -0
  250. lib/FACTFinder/Core/Server/MultiCurlDataProvider.php +346 -0
  251. lib/FACTFinder/Core/Server/MultiCurlRequestFactory.php +79 -0
  252. lib/FACTFinder/Core/Server/NullResponse.php +16 -0
  253. lib/FACTFinder/Core/Server/Request.php +126 -0
  254. lib/FACTFinder/Core/Server/RequestFactoryInterface.php +14 -0
  255. lib/FACTFinder/Core/Server/Response.php +72 -0
  256. lib/FACTFinder/Core/Server/UrlBuilder.php +229 -0
  257. lib/FACTFinder/Core/Utf8EncodingConverter.php +50 -0
  258. lib/FACTFinder/Core/XmlConfiguration.php +349 -0
  259. lib/FACTFinder/Curl.php +0 -99
  260. lib/FACTFinder/CurlHandle.php +0 -8
  261. lib/FACTFinder/CurlInterface.php +0 -25
  262. lib/FACTFinder/CurlStub.php +0 -379
  263. lib/FACTFinder/Custom/.gitignore +0 -0
  264. lib/FACTFinder/Data/AdvisorAnswer.php +60 -0
  265. lib/FACTFinder/Data/AdvisorQuestion.php +61 -0
  266. lib/FACTFinder/Data/AfterSearchNavigation.php +29 -0
  267. lib/FACTFinder/Data/ArticleNumberSearchStatus.php +39 -0
  268. lib/FACTFinder/Data/BreadCrumb.php +64 -0
  269. lib/FACTFinder/Data/BreadCrumbTrail.php +13 -0
  270. lib/FACTFinder/Data/BreadCrumbType.php +36 -0
  271. lib/FACTFinder/Data/Campaign.php +223 -0
  272. lib/FACTFinder/Data/CampaignIterator.php +170 -0
  273. lib/FACTFinder/Data/Filter.php +70 -0
  274. lib/FACTFinder/Data/FilterGroup.php +222 -0
  275. lib/FACTFinder/Data/FilterSelectionType.php +43 -0
  276. lib/FACTFinder/Data/FilterStyle.php +63 -0
  277. lib/FACTFinder/Data/FilterType.php +37 -0
  278. lib/FACTFinder/Data/Item.php +74 -0
  279. lib/FACTFinder/Data/Page.php +35 -0
  280. lib/FACTFinder/Data/Paging.php +111 -0
  281. lib/FACTFinder/Data/Record.php +115 -0
  282. lib/FACTFinder/Data/Result.php +54 -0
  283. lib/FACTFinder/Data/ResultsPerPageOptions.php +49 -0
  284. lib/FACTFinder/Data/SearchParameters.php +154 -0
  285. lib/FACTFinder/Data/SearchStatus.php +42 -0
  286. lib/FACTFinder/Data/SingleWordSearchItem.php +37 -0
  287. lib/FACTFinder/Data/SliderFilter.php +120 -0
  288. lib/FACTFinder/Data/Sorting.php +13 -0
  289. lib/FACTFinder/Data/SuggestQuery.php +68 -0
  290. lib/FACTFinder/Data/TagQuery.php +45 -0
  291. lib/FACTFinder/Default/CompareAdapter.php +0 -93
  292. lib/FACTFinder/Default/ImportAdapter.php +0 -59
  293. lib/FACTFinder/Default/ProductCampaignAdapter.php +0 -114
  294. lib/FACTFinder/Default/RecommendationAdapter.php +0 -115
  295. lib/FACTFinder/Default/ScicAdapter.php +0 -190
  296. lib/FACTFinder/Default/SearchAdapter.php +0 -313
  297. lib/FACTFinder/Default/SimilarRecordsAdapter.php +0 -137
  298. lib/FACTFinder/Default/SuggestAdapter.php +0 -44
  299. lib/FACTFinder/Default/TagCloudAdapter.php +0 -54
  300. lib/FACTFinder/Default/TrackingAdapter.php +0 -100
  301. lib/FACTFinder/EncodingHandler.php +0 -219
  302. lib/FACTFinder/Http/DataProvider.php +0 -323
  303. lib/FACTFinder/Http/DummyProvider.php +0 -130
  304. lib/FACTFinder/Http/LegacyTrackingAdapter.php +0 -15
  305. lib/FACTFinder/Http/ParallelDataProvider.php +0 -278
  306. lib/FACTFinder/Http/ScicAdapter.php +0 -41
  307. lib/FACTFinder/Http/StatusHelper.php +0 -153
  308. lib/FACTFinder/Http/SuggestAdapter.php +0 -41
  309. lib/FACTFinder/Http/TrackingAdapter.php +0 -31
  310. lib/FACTFinder/Http/UrlBuilder.php +0 -234
  311. lib/FACTFinder/Item.php +0 -63
  312. lib/FACTFinder/Json66/CompareAdapter.php +0 -71
  313. lib/FACTFinder/Json66/ImportAdapter.php +0 -74
  314. lib/FACTFinder/Json66/RecommendationAdapter.php +0 -11
  315. lib/FACTFinder/Json66/ScicAdapter.php +0 -9
  316. lib/FACTFinder/Json66/SearchAdapter.php +0 -512
  317. lib/FACTFinder/Json66/SimilarRecordsAdapter.php +0 -75
  318. lib/FACTFinder/Json66/SuggestAdapter.php +0 -58
  319. lib/FACTFinder/Json66/TagCloudAdapter.php +0 -55
  320. lib/FACTFinder/Json67/CompareAdapter.php +0 -7
  321. lib/FACTFinder/Json67/ImportAdapter.php +0 -10
  322. lib/FACTFinder/Json67/ProductCampaignAdapter.php +0 -160
  323. lib/FACTFinder/Json67/RecommendationAdapter.php +0 -88
  324. lib/FACTFinder/Json67/ScicAdapter.php +0 -8
  325. lib/FACTFinder/Json67/SearchAdapter.php +0 -138
  326. lib/FACTFinder/Json67/SimilarRecordsAdapter.php +0 -7
  327. lib/FACTFinder/Json67/SuggestAdapter.php +0 -10
  328. lib/FACTFinder/Json67/TagCloudAdapter.php +0 -10
  329. lib/FACTFinder/Json68/CompareAdapter.php +0 -7
  330. lib/FACTFinder/Json68/ImportAdapter.php +0 -10
  331. lib/FACTFinder/Json68/ProductCampaignAdapter.php +0 -25
  332. lib/FACTFinder/Json68/RecommendationAdapter.php +0 -10
  333. lib/FACTFinder/Json68/ScicAdapter.php +0 -12
  334. lib/FACTFinder/Json68/SearchAdapter.php +0 -42
  335. lib/FACTFinder/Json68/SimilarRecordsAdapter.php +0 -4
  336. lib/FACTFinder/Json68/SuggestAdapter.php +0 -22
  337. lib/FACTFinder/Json68/TagCloudAdapter.php +0 -10
  338. lib/FACTFinder/Json69/CompareAdapter.php +0 -7
  339. lib/FACTFinder/Json69/ImportAdapter.php +0 -10
  340. lib/FACTFinder/Json69/ProductCampaignAdapter.php +0 -8
  341. lib/FACTFinder/Json69/RecommendationAdapter.php +0 -10
  342. lib/FACTFinder/Json69/ScicAdapter.php +0 -8
  343. lib/FACTFinder/Json69/SearchAdapter.php +0 -74
  344. lib/FACTFinder/Json69/SimilarRecordsAdapter.php +0 -7
  345. lib/FACTFinder/Json69/SuggestAdapter.php +0 -17
  346. lib/FACTFinder/Json69/TagCloudAdapter.php +0 -11
  347. lib/FACTFinder/Loader.php +108 -127
  348. lib/FACTFinder/Log4PhpLogger.php +0 -86
  349. lib/FACTFinder/NullLogger.php +0 -24
  350. lib/FACTFinder/Paging.php +0 -191
  351. lib/FACTFinder/Parameters.php +0 -113
  352. lib/FACTFinder/ParametersParser.php +0 -385
  353. lib/FACTFinder/ProductsPerPageOptions.php +0 -106
  354. lib/FACTFinder/Record.php +0 -258
  355. lib/FACTFinder/Result.php +0 -62
  356. lib/FACTFinder/SingleWordSearchItem.php +0 -46
  357. lib/FACTFinder/SuggestQuery.php +0 -87
  358. lib/FACTFinder/TagQuery.php +0 -48
  359. lib/FACTFinder/Util.php +0 -89
  360. lib/{SAI → FACTFinder/Util}/Curl.php +44 -29
  361. lib/FACTFinder/Util/CurlHandle.php +33 -0
  362. lib/FACTFinder/Util/CurlInterface.php +40 -0
  363. lib/FACTFinder/Util/CurlMultiHandle.php +43 -0
  364. lib/FACTFinder/Util/CurlStub.php +618 -0
  365. lib/FACTFinder/Util/Log4PhpLogger.php +74 -0
  366. lib/FACTFinder/Util/LoggerInterface.php +13 -0
  367. lib/FACTFinder/Util/NullLogger.php +21 -0
  368. lib/FACTFinder/Util/Parameters.php +421 -0
  369. lib/FACTFinder/Util/Pimple.php +261 -0
  370. lib/FACTFinder/Xml64/SearchAdapter.php +0 -115
  371. lib/FACTFinder/Xml65/ImportAdapter.php +0 -86
  372. lib/FACTFinder/Xml65/RecommendationAdapter.php +0 -90
  373. lib/FACTFinder/Xml65/ScicAdapter.php +0 -9
  374. lib/FACTFinder/Xml65/SearchAdapter.php +0 -520
  375. lib/FACTFinder/Xml65/SuggestAdapter.php +0 -65
  376. lib/FACTFinder/Xml65/TagCloudAdapter.php +0 -65
  377. lib/FACTFinder/Xml66/CompareAdapter.php +0 -102
  378. lib/FACTFinder/Xml66/ImportAdapter.php +0 -22
  379. lib/FACTFinder/Xml66/RecommendationAdapter.php +0 -22
  380. lib/FACTFinder/Xml66/ScicAdapter.php +0 -8
  381. lib/FACTFinder/Xml66/SearchAdapter.php +0 -104
  382. lib/FACTFinder/Xml66/SimilarRecordsAdapter.php +0 -107
  383. lib/FACTFinder/Xml66/SuggestAdapter.php +0 -22
  384. lib/FACTFinder/Xml66/TagCloudAdapter.php +0 -22
  385. lib/FACTFinder/Xml67/CompareAdapter.php +0 -19
  386. lib/FACTFinder/Xml67/ImportAdapter.php +0 -19
  387. lib/FACTFinder/Xml67/ProductCampaignAdapter.php +0 -164
  388. lib/FACTFinder/Xml67/RecommendationAdapter.php +0 -40
  389. lib/FACTFinder/Xml67/ScicAdapter.php +0 -8
  390. lib/FACTFinder/Xml67/SearchAdapter.php +0 -135
  391. lib/FACTFinder/Xml67/SimilarRecordsAdapter.php +0 -19
  392. lib/FACTFinder/Xml67/SuggestAdapter.php +0 -19
  393. lib/FACTFinder/Xml67/TagCloudAdapter.php +0 -19
  394. lib/FACTFinder/Xml68/CompareAdapter.php +0 -19
  395. lib/FACTFinder/Xml68/ImportAdapter.php +0 -19
  396. lib/FACTFinder/Xml68/ProductCampaignAdapter.php +0 -20
  397. lib/FACTFinder/Xml68/RecommendationAdapter.php +0 -19
  398. lib/FACTFinder/Xml68/ScicAdapter.php +0 -12
  399. lib/FACTFinder/Xml68/SearchAdapter.php +0 -22
  400. lib/FACTFinder/Xml68/SimilarRecordsAdapter.php +0 -19
  401. lib/FACTFinder/Xml68/SuggestAdapter.php +0 -20
  402. lib/FACTFinder/Xml68/TagCloudAdapter.php +0 -19
  403. lib/FACTFinder/Xml69/CompareAdapter.php +0 -17
  404. lib/FACTFinder/Xml69/ImportAdapter.php +0 -17
  405. lib/FACTFinder/Xml69/ProductCampaignAdapter.php +0 -18
  406. lib/FACTFinder/Xml69/RecommendationAdapter.php +0 -17
  407. lib/FACTFinder/Xml69/ScicAdapter.php +0 -8
  408. lib/FACTFinder/Xml69/SearchAdapter.php +0 -67
  409. lib/FACTFinder/Xml69/SimilarRecordsAdapter.php +0 -17
  410. lib/FACTFinder/Xml69/SuggestAdapter.php +0 -17
  411. lib/FACTFinder/Xml69/TagCloudAdapter.php +0 -11
  412. lib/FACTFinder/Xml69/TrackingAdapter.php +0 -7
  413. lib/FACTFinderCustom/Configuration.php +354 -469
  414. lib/SAI/Curl/Handle.php +0 -8
  415. lib/SAI/CurlInterface.php +0 -25
  416. lib/SAI/CurlStub.php +0 -382
  417. lib/log4php/Logger.php +596 -0
  418. lib/log4php/LoggerAppender.php +286 -0
  419. lib/log4php/LoggerAppenderPool.php +98 -0
  420. lib/log4php/LoggerAutoloader.php +142 -0
  421. lib/log4php/LoggerConfigurable.php +116 -0
  422. lib/log4php/LoggerConfigurator.php +42 -0
  423. lib/log4php/LoggerException.php +28 -0
  424. lib/log4php/LoggerFilter.php +126 -0
  425. lib/log4php/LoggerHierarchy.php +257 -0
  426. lib/log4php/LoggerLayout.php +74 -0
  427. lib/log4php/LoggerLevel.php +256 -0
  428. lib/log4php/LoggerLocationInfo.php +103 -0
  429. lib/log4php/LoggerLoggingEvent.php +368 -0
  430. lib/log4php/LoggerMDC.php +88 -0
  431. lib/log4php/LoggerNDC.php +203 -0
  432. lib/log4php/LoggerReflectionUtils.php +152 -0
  433. lib/log4php/LoggerRoot.php +71 -0
  434. lib/log4php/LoggerThrowableInformation.php +68 -0
  435. lib/log4php/appenders/LoggerAppenderConsole.php +103 -0
  436. lib/log4php/appenders/LoggerAppenderDailyFile.php +130 -0
  437. lib/log4php/appenders/LoggerAppenderEcho.php +88 -0
  438. lib/log4php/appenders/LoggerAppenderFile.php +225 -0
  439. lib/log4php/appenders/LoggerAppenderFirePHP.php +100 -0
  440. lib/log4php/appenders/LoggerAppenderMail.php +136 -0
  441. lib/log4php/appenders/LoggerAppenderMailEvent.php +180 -0
  442. lib/log4php/appenders/LoggerAppenderMongoDB.php +360 -0
  443. lib/log4php/appenders/LoggerAppenderNull.php +44 -0
  444. lib/log4php/appenders/LoggerAppenderPDO.php +282 -0
  445. lib/log4php/appenders/LoggerAppenderPhp.php +49 -0
  446. lib/log4php/appenders/LoggerAppenderRollingFile.php +305 -0
  447. lib/log4php/appenders/LoggerAppenderSocket.php +122 -0
  448. lib/log4php/appenders/LoggerAppenderSyslog.php +303 -0
  449. lib/log4php/configurators/LoggerConfigurationAdapter.php +39 -0
  450. lib/log4php/configurators/LoggerConfigurationAdapterINI.php +299 -0
  451. lib/log4php/configurators/LoggerConfigurationAdapterPHP.php +84 -0
  452. lib/log4php/configurators/LoggerConfigurationAdapterXML.php +278 -0
  453. lib/log4php/configurators/LoggerConfiguratorDefault.php +477 -0
  454. lib/log4php/filters/LoggerFilterDenyAll.php +56 -0
  455. lib/log4php/filters/LoggerFilterLevelMatch.php +100 -0
  456. lib/log4php/filters/LoggerFilterLevelRange.php +138 -0
  457. lib/log4php/filters/LoggerFilterStringMatch.php +89 -0
  458. lib/log4php/helpers/LoggerFormattingInfo.php +54 -0
  459. lib/log4php/helpers/LoggerOptionConverter.php +226 -0
  460. lib/log4php/helpers/LoggerPatternParser.php +237 -0
  461. lib/log4php/helpers/LoggerUtils.php +123 -0
  462. lib/log4php/layouts/LoggerLayoutHtml.php +214 -0
  463. lib/log4php/layouts/LoggerLayoutPattern.php +171 -0
  464. lib/log4php/layouts/LoggerLayoutSerialized.php +55 -0
  465. lib/log4php/layouts/LoggerLayoutSimple.php +56 -0
  466. lib/log4php/layouts/LoggerLayoutTTCC.php +201 -0
  467. lib/log4php/layouts/LoggerLayoutXml.php +210 -0
  468. lib/log4php/pattern/LoggerPatternConverter.php +131 -0
  469. lib/log4php/pattern/LoggerPatternConverterClass.php +64 -0
  470. lib/log4php/pattern/LoggerPatternConverterCookie.php +35 -0
  471. lib/log4php/pattern/LoggerPatternConverterDate.php +91 -0
  472. lib/log4php/pattern/LoggerPatternConverterEnvironment.php +35 -0
  473. lib/log4php/pattern/LoggerPatternConverterFile.php +34 -0
  474. lib/log4php/pattern/LoggerPatternConverterLevel.php +34 -0
  475. lib/log4php/pattern/LoggerPatternConverterLine.php +35 -0
  476. lib/log4php/pattern/LoggerPatternConverterLiteral.php +40 -0
  477. lib/log4php/pattern/LoggerPatternConverterLocation.php +39 -0
  478. lib/log4php/pattern/LoggerPatternConverterLogger.php +65 -0
  479. lib/log4php/pattern/LoggerPatternConverterMDC.php +55 -0
  480. lib/log4php/pattern/LoggerPatternConverterMessage.php +34 -0
  481. lib/log4php/pattern/LoggerPatternConverterMethod.php +35 -0
  482. lib/log4php/pattern/LoggerPatternConverterNDC.php +35 -0
  483. lib/log4php/pattern/LoggerPatternConverterNewLine.php +34 -0
  484. lib/log4php/pattern/LoggerPatternConverterProcess.php +34 -0
  485. lib/log4php/pattern/LoggerPatternConverterRelative.php +36 -0
  486. lib/log4php/pattern/LoggerPatternConverterRequest.php +35 -0
  487. lib/log4php/pattern/LoggerPatternConverterServer.php +35 -0
  488. lib/log4php/pattern/LoggerPatternConverterSession.php +35 -0
  489. lib/log4php/pattern/LoggerPatternConverterSessionID.php +33 -0
  490. lib/log4php/pattern/LoggerPatternConverterSuperglobal.php +102 -0
  491. lib/log4php/pattern/LoggerPatternConverterThrowable.php +40 -0
  492. lib/log4php/renderers/LoggerRenderer.php +36 -0
  493. lib/log4php/renderers/LoggerRendererDefault.php +36 -0
  494. lib/log4php/renderers/LoggerRendererException.php +36 -0
  495. lib/log4php/renderers/LoggerRendererMap.php +186 -0
  496. lib/log4php/xml/log4php.dtd +148 -0
  497. package.xml +11 -21
  498. shell/factfinder.php +65 -0
  499. skin/frontend/base/default/css/factfinder.css +0 -25
app/code/community/FACTFinder/Asn/Block/Catalog/Layer/Factfinder.php ADDED
@@ -0,0 +1,64 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ *
12
+ */
13
+
14
+ /**
15
+ * Class FACTFinder_Asn_Block_Catalog_Layer_Factfinder
16
+ *
17
+ * Replaces default layer filter attribute
18
+ *
19
+ * @category Mage
20
+ * @package FACTFinder_Asn
21
+ * @author Flagbit Magento Team <magento@flagbit.de>
22
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ * @link http://www.flagbit.de
25
+ */
26
+ class FACTFinder_Asn_Block_Catalog_Layer_Factfinder extends Mage_Catalog_Block_Layer_Filter_Attribute
27
+ {
28
+ const TYPE_SLIDER = 'slider';
29
+
30
+
31
+ /**
32
+ * Class constructor
33
+ * Here we just set our own model as filter model
34
+ */
35
+ public function __construct()
36
+ {
37
+ parent::__construct();
38
+ $this->_filterModelName = 'factfinder_asn/layer_filter_factfinder';
39
+ }
40
+
41
+
42
+ /**
43
+ * Initialize filter model object
44
+ * The only thing we need here is to set our own template for price filter
45
+ *
46
+ * @return FACTFinder_Asn_Block_Catalog_Layer_Factfinder
47
+ */
48
+ public function init()
49
+ {
50
+ parent::init();
51
+
52
+ $attribute = $this->getAttributeModel();
53
+ if ($attribute->getType() == self::TYPE_SLIDER) {
54
+ $this->setTemplate('factfinder/asn/layer/filter/slider.phtml');
55
+ $this->setData((current($attribute->getItems())));
56
+ $this->setUnit($attribute->getUnit());
57
+ $this->setLinkCount($attribute->getLinkCount());
58
+ }
59
+
60
+ return $this;
61
+ }
62
+
63
+
64
+ }
app/code/community/FACTFinder/Asn/Block/Catalog/Layer/State.php ADDED
@@ -0,0 +1,47 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ *
12
+ */
13
+
14
+ /**
15
+ * Class FACTFinder_Asn_Block_Catalog_Layer_Factfinder
16
+ *
17
+ * Replaces default layer filter attribute
18
+ *
19
+ * @category Mage
20
+ * @package FACTFinder_Asn
21
+ * @author Flagbit Magento Team <magento@flagbit.de>
22
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
23
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
+ * @link http://www.flagbit.de
25
+ */
26
+ class FACTFinder_Asn_Block_Catalog_Layer_State extends Mage_Catalog_Block_Layer_State
27
+ {
28
+ /**
29
+ * Retrieve Clear Filters URL
30
+ *
31
+ * @return string
32
+ */
33
+ public function getClearUrl()
34
+ {
35
+ $currentParams = $this->getRequest()->getParams();
36
+ foreach($currentParams as $paramKey => $paramValue) {
37
+ if($paramKey != 'q') {
38
+ $currentParams[$paramKey] = null;
39
+ }
40
+ }
41
+ $params['_current'] = true;
42
+ $params['_use_rewrite'] = true;
43
+ $params['_query'] = $currentParams;
44
+ $params['_escape'] = true;
45
+ return Mage::getUrl('*/*/*', $params);
46
+ }
47
+ }
app/code/community/FACTFinder/Asn/Block/Catalog/Product/List/Toolbar.php ADDED
@@ -0,0 +1,59 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Block_Catalog_Product_List_Toolbar
15
+ *
16
+ * Replaces default layer toolbar on navigation
17
+ *
18
+ * @category Mage
19
+ * @package FACTFinder_Asn
20
+ * @author Flagbit Magento Team <magento@flagbit.de>
21
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
22
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23
+ * @link http://www.flagbit.de
24
+ */
25
+ class FACTFinder_Asn_Block_Catalog_Product_List_Toolbar extends FACTFinder_Core_Block_Catalog_Product_List_Toolbar
26
+ {
27
+
28
+
29
+ /**
30
+ * Constructor
31
+ *
32
+ * @return void
33
+ */
34
+ protected function _construct()
35
+ {
36
+ if (!Mage::helper('factfinder_asn')->isCatalogNavigation()) {
37
+ $this->_useFF = false;
38
+ }
39
+
40
+ parent::_construct();
41
+ }
42
+
43
+
44
+ /**
45
+ * {@inheritdoc}
46
+ */
47
+ public function getPagerUrl($params = array())
48
+ {
49
+ $url = parent::getPagerUrl($params);
50
+
51
+ if ($this->_handler && !Mage::helper('factfinder/search')->getIsOnSearchPage()) {
52
+ $url = Mage::helper('factfinder_asn')->removeCategoryParams($url);
53
+ }
54
+
55
+ return $url;
56
+ }
57
+
58
+
59
+ }
app/code/community/FACTFinder/Asn/Block/Catalog/Product/Pager.php ADDED
@@ -0,0 +1,58 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Block_Catalog_Product_Pager
15
+ *
16
+ * Replaces default layer pager on navigation
17
+ *
18
+ * @category Mage
19
+ * @package FACTFinder_Asn
20
+ * @author Flagbit Magento Team <magento@flagbit.de>
21
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
22
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23
+ * @link http://www.flagbit.de
24
+ */
25
+ class FACTFinder_Asn_Block_Catalog_Product_Pager extends FACTFinder_Core_Block_Catalog_Product_Pager
26
+ {
27
+
28
+
29
+ /**
30
+ * Constructor
31
+ *
32
+ * @return void
33
+ */
34
+ protected function _construct()
35
+ {
36
+ if (!Mage::helper('factfinder_asn')->isCatalogNavigation()) {
37
+ $this->_useFF = false;
38
+ }
39
+
40
+ parent::_construct();
41
+ }
42
+
43
+ /**
44
+ * {@inheritdoc}
45
+ */
46
+ public function getPagerUrl($params = array())
47
+ {
48
+ $url = parent::getPagerUrl($params);
49
+
50
+ if ($this->_handler && !Mage::helper('factfinder/search')->getIsOnSearchPage()) {
51
+ $url = Mage::helper('factfinder_asn')->removeCategoryParams($url);
52
+ }
53
+
54
+ return $url;
55
+ }
56
+
57
+
58
+ }
app/code/community/FACTFinder/Asn/Helper/Data.php ADDED
@@ -0,0 +1,93 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Helper_Data
15
+ *
16
+ * @category Mage
17
+ * @package FACTFinder_Asn
18
+ * @author Flagbit Magento Team <magento@flagbit.de>
19
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ * @link http://www.flagbit.de
22
+ */
23
+ class FACTFinder_Asn_Helper_Data extends Mage_Core_Helper_Abstract
24
+ {
25
+
26
+
27
+ /**
28
+ * Parse url and return array of parameters
29
+ *
30
+ * @param string $url
31
+ *
32
+ * @return array
33
+ */
34
+ public function getQueryParams($url)
35
+ {
36
+ $queryParams = array();
37
+
38
+ //conserve url encoded spaces, since parse_str replaces them with underscores
39
+ $url = str_replace('%20', 'XXXXXXXXXX', $url);
40
+
41
+ $parseUrl = parse_url($url);
42
+ if (isset($parseUrl['query'])) {
43
+ parse_str($parseUrl['query'], $queryParams);
44
+ }
45
+
46
+ // recover spaces
47
+ // we use not encoded values since they will be encoded with Mage::getUrl()
48
+ $result = array();
49
+ foreach ($queryParams as $key => $value) {
50
+ $key = str_replace('XXXXXXXXXX', ' ', $key);
51
+ $value = str_replace('XXXXXXXXXX', ' ', $value);
52
+ $result[$key] = $value;
53
+ }
54
+
55
+ return $result;
56
+ }
57
+
58
+
59
+ /**
60
+ * Check is catalog navigation replacement is enabled
61
+ *
62
+ * @return bool
63
+ */
64
+ public function isCatalogNavigation()
65
+ {
66
+ return (bool) Mage::app()->getStore()->getConfig('factfinder/modules/catalog_navigation');
67
+ }
68
+
69
+
70
+ /**
71
+ * Remove category filter params if they are the save as the current category ones
72
+ *
73
+ * On catalog navigation if we use all the params from ff we have unnecessary ugly params
74
+ * which we don't need. This function removes them
75
+ *
76
+ * @param string $url
77
+ *
78
+ * @return mixed
79
+ */
80
+ public function removeCategoryParams($url)
81
+ {
82
+ $categoryPath = Mage::getSingleton('factfinder_asn/handler_search')->getCurrentFactFinderCategoryPath();
83
+ $query = http_build_query($categoryPath);
84
+ $query = str_replace('+', '%20', $query);
85
+ $url = str_replace($query, '', $url);
86
+ //remove redundant &
87
+ $url = str_replace(array('?&', '&&'), array('?', '&'), $url);
88
+
89
+ return $url;
90
+ }
91
+
92
+
93
+ }
app/code/community/FACTFinder/Asn/Model/Catalog/Layer.php ADDED
@@ -0,0 +1,48 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Catalog_Layer
15
+ *
16
+ * Replaces standard layer model in order to use our own collection
17
+ *
18
+ * @category Mage
19
+ * @package FACTFinder_Asn
20
+ * @author Flagbit Magento Team <magento@flagbit.de>
21
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
22
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23
+ * @link http://www.flagbit.de
24
+ */
25
+ class FACTFinder_Asn_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
26
+ {
27
+
28
+
29
+ /**
30
+ * Get current layer product collection
31
+ *
32
+ * @return Mage_Catalog_Model_Resource_Product_Collection
33
+ */
34
+ public function getProductCollection()
35
+ {
36
+ if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
37
+ $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
38
+ } else {
39
+ $collection = Mage::getResourceModel('factfinder_asn/search_collection');
40
+ $this->prepareProductCollection($collection);
41
+ $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
42
+ }
43
+
44
+ return $collection;
45
+ }
46
+
47
+
48
+ }
app/code/community/FACTFinder/Asn/Model/Handler/Search.php ADDED
@@ -0,0 +1,365 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Handler_Search
15
+ *
16
+ * Handle navigation data and data communications
17
+ *
18
+ * @category Mage
19
+ * @package FACTFinder_Asn
20
+ * @author Flagbit Magento Team <magento@flagbit.de>
21
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
22
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23
+ * @link http://www.flagbit.de
24
+ */
25
+ class FACTFinder_Asn_Model_Handler_Search extends FACTFinder_Core_Model_Handler_Search
26
+ {
27
+
28
+ /**
29
+ * Navigation array from fact finder
30
+ *
31
+ * @var array
32
+ */
33
+ protected $_afterSearchNavigation = array();
34
+
35
+ /**
36
+ * @var array
37
+ */
38
+ protected $_currentFactFinderCategoryPath = array();
39
+
40
+
41
+ /**
42
+ * Get and format navigation array from fact finder
43
+ *
44
+ * @return array
45
+ */
46
+ public function getAfterSearchNavigation()
47
+ {
48
+ if (empty($this->_afterSearchNavigation) && $this->isSearchHasResult()) {
49
+ $result = $this->_getFacade()->getAfterSearchNavigation();
50
+
51
+ if ($result instanceof FACTFinder\Data\AfterSearchNavigation && count($result)) {
52
+ foreach ($result as $row) {
53
+ $this->_afterSearchNavigation[] = array(
54
+ 'attribute_code' => $row->getName(),
55
+ 'name' => $row->getName(),
56
+ 'unit' => $row->getUnit(),
57
+ 'items' => $this->_getAttributeOptions($row, $row->getUnit()),
58
+ 'count' => $row->count(),
59
+ 'type' => $this->_getFilterType($row),
60
+ 'store_label' => $row->getName(),
61
+ 'link_count' => $row->getDetailedLinkCount(),
62
+ 'is_multiselect' => $row->isMultiSelectStyle()
63
+ );
64
+ }
65
+ }
66
+ }
67
+
68
+ return $this->_afterSearchNavigation;
69
+ }
70
+
71
+
72
+ /**
73
+ * Get Attribute Options Array from FactFinder FilterGroupItems
74
+ *
75
+ * @param FACTFinder\Data\FilterGroup $filterGroup
76
+ *
77
+ * @return array
78
+ */
79
+ protected function _getAttributeOptions(FACTFinder\Data\FilterGroup $filterGroup)
80
+ {
81
+ $attributeOptions = array();
82
+
83
+ $currentCategoryPath = $this->getCurrentFactFinderCategoryPath();
84
+
85
+ foreach ($filterGroup as $option) {
86
+ $queryParams = Mage::helper('factfinder_asn')->getQueryParams($option->getUrl());
87
+ $queryParams = $this->_removeCategoriesFromParams($currentCategoryPath, $queryParams);
88
+
89
+ $filterValue = $this->_getAttributeOptionValue($option, $filterGroup);
90
+
91
+ $seoPath = '';
92
+ if (isset($queryParams['seoPath'])) {
93
+ $seoPath = $queryParams['seoPath'];
94
+ }
95
+
96
+ if ($this->_isOnSearchPage() || !empty($_filterValue)) {
97
+ unset($queryParams['seoPath']);
98
+ }
99
+
100
+ if ($filterGroup->isSliderStyle()) {
101
+ $queryParams['filter' . $option->getFieldName()] = $filterValue;
102
+ $attributeOptions[] = $this->_prepareSliderOption($option, $filterGroup, $queryParams);
103
+ } else {
104
+ if (!$option->getLabel() || $this->_isTopLevelNavigation($option, $currentCategoryPath)) {
105
+ continue;
106
+ }
107
+
108
+ $attributeOptionData = $this->_prepareOption($option, $filterGroup, $filterValue);
109
+ $attributeOptionData['seoPath'] = $seoPath;
110
+ $attributeOptionData['queryParams'] = $queryParams;
111
+
112
+ $attributeOptions[] = $attributeOptionData;
113
+ }
114
+ }
115
+
116
+ return $attributeOptions;
117
+ }
118
+
119
+
120
+ /**
121
+ * Check if this is a top level navigation option
122
+ *
123
+ * @param \FACTFinder\Data\Filter $option
124
+ * @param array $categoryPath
125
+ *
126
+ * @return bool
127
+ */
128
+ protected function _isTopLevelNavigation(FACTFinder\Data\Filter $option, $categoryPath)
129
+ {
130
+ if (!$this->_isOnSearchPage()
131
+ && strpos($option->getFieldName(), 'categoryROOT') !== false
132
+ && in_array($option->getLabel(), $categoryPath)
133
+ ) {
134
+ return true;
135
+ }
136
+
137
+ return false;
138
+ }
139
+
140
+
141
+ /**
142
+ * Remove current categories from query params
143
+ *
144
+ * @param array $categoryPath
145
+ * @param array $params
146
+ *
147
+ * @return array
148
+ */
149
+ protected function _removeCategoriesFromParams($categoryPath, $params)
150
+ {
151
+ if (!$this->_isOnSearchPage()) {
152
+ foreach ($categoryPath as $filterParam => $filterValue) {
153
+ if (isset($params[$filterParam])) {
154
+ unset($params[$filterParam]);
155
+ }
156
+ }
157
+
158
+ if (isset($params['q']) && Mage::app()->getRequest()->getModuleName() == 'catalog') {
159
+ unset($params['q']);
160
+ }
161
+ }
162
+
163
+ return $params;
164
+ }
165
+
166
+
167
+ /**
168
+ * Prepare option array for slider
169
+ *
170
+ * @param \FACTFinder\Data\SliderFilter $option
171
+ * @param \FACTFinder\Data\FilterGroup $filterGroup
172
+ * @param array $params
173
+ *
174
+ * @return array
175
+ */
176
+ protected function _prepareSliderOption(FACTFinder\Data\SliderFilter $option, $filterGroup, $params)
177
+ {
178
+ $option = array(
179
+ 'type' => 'number',
180
+ 'label' => 'slider',
181
+ 'value' => $this->_getAttributeOptionValue($option, $filterGroup),
182
+ 'absolute_min' => $option->getAbsoluteMinimum(),
183
+ 'absolute_max' => $option->getAbsoluteMaximum(),
184
+ 'selected_min' => $option->getSelectedMinimum(),
185
+ 'selected_max' => $option->getSelectedMaximum(),
186
+ 'count' => true,
187
+ 'selected' => false,
188
+ 'requestVar' => 'filter' . $option->getFieldName(),
189
+ 'queryParams' => $params
190
+ );
191
+
192
+ return $option;
193
+ }
194
+
195
+
196
+ /**
197
+ * Prepare normal option array
198
+ *
199
+ * @param \FACTFinder\Data\Filter $option
200
+ * @param \FACTFinder\Data\FilterGroup $filterGroup
201
+ * @param string $filterValue
202
+ *
203
+ * @return array
204
+ */
205
+ protected function _prepareOption(FACTFinder\Data\Filter $option, $filterGroup, $filterValue)
206
+ {
207
+ $label = $option->getLabel();
208
+ if ($filterGroup->getUnit()) {
209
+ $label .= ' ' . $filterGroup->getUnit();
210
+ }
211
+
212
+ $option = array(
213
+ 'type' => 'attribute',
214
+ 'label' => $label,
215
+ 'value' => $filterValue,
216
+ 'count' => $option->getMatchCount(),
217
+ 'selected' => $option->isSelected(),
218
+ 'clusterLevel' => $option->getClusterLevel(),
219
+ 'requestVar' => 'filter' . $option->getFieldName(),
220
+ 'previewImage' => $option->getPreviewImage()
221
+ );
222
+
223
+ return $option;
224
+ }
225
+
226
+
227
+ /**
228
+ * Check if we are on search page
229
+ *
230
+ * @return bool
231
+ */
232
+ protected function _isOnSearchPage()
233
+ {
234
+ return Mage::helper('factfinder/search')->getIsOnSearchPage();
235
+ }
236
+
237
+
238
+ /**
239
+ * Prepare current category path array
240
+ *
241
+ * @return array
242
+ */
243
+ public function getCurrentFactFinderCategoryPath()
244
+ {
245
+ if (empty($this->_currentFactFinderCategoryPath)) {
246
+
247
+ if (!Mage::registry('current_category')) {
248
+ return array();
249
+ }
250
+
251
+ /** @var $category Mage_Catalog_Model_Category */
252
+ $category = Mage::registry('current_category');
253
+
254
+ $pathInStore = $category->getPathInStore();
255
+ $pathIds = array_reverse(explode(',', $pathInStore));
256
+
257
+ $categories = $category->getParentCategories();
258
+ $mainCategoriesString = '';
259
+ foreach ($pathIds as $categoryId) {
260
+ if (!isset($categories[$categoryId]) || !$categories[$categoryId]->getName()) {
261
+ continue;
262
+ }
263
+
264
+ $categoryName = html_entity_decode($categories[$categoryId]->getName());
265
+ if (empty($mainCategoriesString)) {
266
+ $this->_currentFactFinderCategoryPath['filtercategoryROOT'] = $categoryName;
267
+ } else {
268
+ $this->_currentFactFinderCategoryPath['filtercategoryROOT' . $mainCategoriesString] = $categoryName;
269
+ }
270
+
271
+ $mainCategoriesString .= '/' . $this->_encodeSpecialCharacters($categoryName);
272
+ }
273
+ }
274
+
275
+ return $this->_currentFactFinderCategoryPath;
276
+ }
277
+
278
+
279
+ /**
280
+ * Get Attribute option Value
281
+ *
282
+ * @param FACTFinder\Data\Filter $option
283
+ * @param FACTFinder\Data\FilterGroup $filterGroup
284
+ *
285
+ * @return string
286
+ */
287
+ protected function _getAttributeOptionValue(FACTFinder\Data\Filter $option, $filterGroup)
288
+ {
289
+ $value = null;
290
+
291
+ if ($filterGroup->isSliderStyle()) {
292
+ $value = '[VALUE]';
293
+ } else {
294
+ $queryParams = Mage::helper('factfinder_asn')->getQueryParams($option->getUrl());
295
+
296
+ if (isset($queryParams['filter' . $option->getFieldName()])) {
297
+ $value = $queryParams['filter' . $option->getFieldName()];
298
+ } else {
299
+ $value = '';
300
+ }
301
+ }
302
+
303
+ return $value;
304
+ }
305
+
306
+
307
+ /**
308
+ * Get Filter Type by FACT-Finder FilterItem
309
+ *
310
+ * @param FACTFinder\Data\FilterGroup $options
311
+ *
312
+ * @return string
313
+ */
314
+ protected function _getFilterType(FACTFinder\Data\FilterGroup $options)
315
+ {
316
+ $type = 'text';
317
+ if ($options->isSliderStyle()) {
318
+ $type = 'slider';
319
+ }
320
+
321
+ return $type;
322
+ }
323
+
324
+
325
+ /**
326
+ * Prepare all request parameters for the search adapter
327
+ *
328
+ * @return array
329
+ */
330
+ protected function _collectParams()
331
+ {
332
+ $params = parent::_collectParams();
333
+
334
+ if (Mage::app()->getRequest()->getModuleName() == 'catalog') {
335
+ if (!Mage::app()->getRequest()->getParam('advisorStatus')) {
336
+ $params = array_merge($params, $this->getCurrentFactFinderCategoryPath());
337
+ }
338
+
339
+ $params['navigation'] = 'true';
340
+ }
341
+
342
+ return $params;
343
+ }
344
+
345
+
346
+ /**
347
+ * Encode special characters according to ff list
348
+ *
349
+ * @param string $categoryName
350
+ *
351
+ * @return string
352
+ */
353
+ protected function _encodeSpecialCharacters($categoryName)
354
+ {
355
+ $categoryName = str_replace(
356
+ array('%', '#', '|', '/', '=', '+'),
357
+ array('%25', '%23', '%7C', '%2F', '%3D', '%2B'),
358
+ $categoryName
359
+ );
360
+
361
+ return $categoryName;
362
+ }
363
+
364
+
365
+ }
app/code/community/FACTFinder/Asn/Model/Layer/Filter/Factfinder.php ADDED
@@ -0,0 +1,138 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Layer_Filter_Factfinder
15
+ *
16
+ * @category Mage
17
+ * @package FACTFinder_Asn
18
+ * @author Flagbit Magento Team <magento@flagbit.de>
19
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ * @link http://www.flagbit.de
22
+ */
23
+ class FACTFinder_Asn_Model_Layer_Filter_Factfinder extends Mage_Catalog_Model_Layer_Filter_Abstract
24
+ {
25
+
26
+ /**
27
+ * Array of Magento Layer Filter Items
28
+ *
29
+ * @var mixed
30
+ */
31
+ protected $_filterItems = null;
32
+
33
+ /**
34
+ * Array of Selected Layer Filters
35
+ *
36
+ * @var mixed
37
+ */
38
+ protected $_selectedFilterItems = array();
39
+
40
+
41
+ /**
42
+ * Apply attribute option filter to product collection
43
+ *
44
+ * @param Zend_Controller_Request_Abstract $request
45
+ * @param Varien_Object $filterBlock
46
+ *
47
+ * @return Mage_Catalog_Model_Layer_Filter_Attribute
48
+ */
49
+ public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
50
+ {
51
+ $this->_getItemsData();
52
+ $_attributeCode = $filterBlock->getAttributeModel()->getAttributeCode();
53
+ if (isset($this->_selectedFilterItems[$_attributeCode])
54
+ && is_array($this->_selectedFilterItems[$_attributeCode])
55
+ ) {
56
+ foreach ($this->_selectedFilterItems[$_attributeCode] as $optionData) {
57
+ $this->getLayer()->getState()->addFilter(
58
+ $this->_createItem($optionData)
59
+ );
60
+ }
61
+ }
62
+
63
+ return $this;
64
+ }
65
+
66
+
67
+ /**
68
+ * Create filter item object
69
+ *
70
+ * @param array $data
71
+ * @param string $value
72
+ * @param int $count
73
+ *
74
+ * @return Mage_Catalog_Model_Layer_Filter_Item
75
+ */
76
+ protected function _createItem($data, $value = '', $count = 0)
77
+ {
78
+ $item = Mage::getModel('factfinder_asn/layer_filter_item')
79
+ ->setFilter($this);
80
+
81
+ foreach ($data as $key => $value) {
82
+ $method = 'set' . ucwords($key);
83
+ $item->$method($value);
84
+ }
85
+
86
+ return $item;
87
+ }
88
+
89
+
90
+ /**
91
+ * Get data array for building attribute filter items
92
+ *
93
+ * @return array
94
+ */
95
+ protected function _getItemsData()
96
+ {
97
+ if ($this->_filterItems === null) {
98
+ $attribute = $this->getAttributeModel();
99
+ $this->_requestVar = 'filter' . $attribute->getAttributeCode();
100
+
101
+ $options = $attribute->getItems();
102
+ $this->_filterItems = array();
103
+ if (is_array($options)) {
104
+ foreach ($options as $option) {
105
+ if ($option['selected'] == true) {
106
+ $this->_selectedFilterItems[$attribute->getAttributeCode()][] = $option;
107
+ continue;
108
+ }
109
+
110
+ $this->_filterItems[] = $option;
111
+ }
112
+ }
113
+ }
114
+
115
+ return $this->_filterItems;
116
+ }
117
+
118
+
119
+ /**
120
+ * Initialize filter items
121
+ *
122
+ * @return Mage_Catalog_Model_Layer_Filter_Abstract
123
+ */
124
+ protected function _initItems()
125
+ {
126
+ $data = $this->_getItemsData();
127
+ $items = array();
128
+ foreach ($data as $itemData) {
129
+ $items[] = $this->_createItem($itemData);
130
+ }
131
+
132
+ $this->_items = $items;
133
+
134
+ return $this;
135
+ }
136
+
137
+
138
+ }
app/code/community/FACTFinder/Asn/Model/Layer/Filter/Item.php ADDED
@@ -0,0 +1,118 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Layer_Filter_Item
15
+ *
16
+ * @category Mage
17
+ * @package FACTFinder_Asn
18
+ * @author Flagbit Magento Team <magento@flagbit.de>
19
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ * @link http://www.flagbit.de
22
+ */
23
+ class FACTFinder_Asn_Model_Layer_Filter_Item extends Mage_Catalog_Model_Layer_Filter_Item
24
+ {
25
+
26
+
27
+ /**
28
+ * Get url for remove item from filter
29
+ *
30
+ * @return string
31
+ */
32
+ public function getRemoveUrl()
33
+ {
34
+ $params['_use_rewrite'] = true;
35
+ $params['_query'] = $this->getQueryParams();
36
+ $params['_escape'] = true;
37
+
38
+ if ($this->getSeoPath() && $this->_isOnSearchPage()) {
39
+ $query['q'] = null;
40
+ $params['_direct'] = 's' . $this->getSeoPath();
41
+ }
42
+
43
+ $url = Mage::getUrl('*/*/*', $params);
44
+
45
+ // fix by PHP_QUERY_RFC1738 encoded spaces
46
+ $url = str_replace('+', '%20', $url);
47
+
48
+ return $url;
49
+ }
50
+
51
+
52
+ /**
53
+ * Get url for remove whole filter
54
+ *
55
+ * @return string
56
+ */
57
+ public function getRemoveFilterUrl()
58
+ {
59
+ $params['_use_rewrite'] = true;
60
+ $params['_query'] = $this->getQueryParams();
61
+ $params['_escape'] = true;
62
+
63
+ unset($params['_query'][$this->getRequestVar()]);
64
+
65
+ if ($this->getSeoPath() && $this->_isOnSearchPage()) {
66
+ $query['q'] = null;
67
+ $params['_direct'] = 's' . $this->getSeoPath();
68
+ }
69
+
70
+ return Mage::getUrl('*/*/*', $params);
71
+ }
72
+
73
+
74
+ /**
75
+ * Get filter item url
76
+ *
77
+ * @return string
78
+ */
79
+ public function getUrl()
80
+ {
81
+ $query = array(
82
+ Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
83
+ );
84
+
85
+ $query = array_merge(
86
+ $query,
87
+ $this->getQueryParams()
88
+ );
89
+
90
+ if ($this->getSeoPath() && $this->_isOnSearchPage()) {
91
+ if ($query['q'] != '*') {
92
+ $query['q'] = null;
93
+ }
94
+
95
+ $url = Mage::getUrl('*/*/*', array('_query' => $query, '_direct' => 's' . $this->getSeoPath()));
96
+ } else {
97
+ $url = Mage::getUrl('*/*/*', array('_use_rewrite' => true, '_query' => $query));
98
+ }
99
+
100
+ // fix PHP_QUERY_RFC1738 encoded spaces
101
+ $url = str_replace('+', '%20', $url);
102
+
103
+ return $url;
104
+ }
105
+
106
+
107
+ /**
108
+ * Check if we're on search page
109
+ *
110
+ * @return bool
111
+ */
112
+ protected function _isOnSearchPage()
113
+ {
114
+ return Mage::helper('factfinder/search')->getIsOnSearchPage();
115
+ }
116
+
117
+
118
+ }
app/code/community/FACTFinder/Asn/Model/Observer.php ADDED
@@ -0,0 +1,126 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Observer
15
+ *
16
+ * @category Mage
17
+ * @package FACTFinder_Asn
18
+ * @author Flagbit Magento Team <magento@flagbit.de>
19
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ * @link http://www.flagbit.de
22
+ */
23
+ class FACTFinder_Asn_Model_Observer
24
+ {
25
+
26
+
27
+ /**
28
+ * Add layerd navigation filters on current layer block
29
+ *
30
+ * @param Mage_Catalog_Block_Layer_View $block
31
+ *
32
+ * @return $this
33
+ */
34
+ protected function _addLayeredNavigation($block)
35
+ {
36
+ $stateBlock = $block->getLayout()->createBlock('catalog/layer_state')
37
+ ->setLayer($block->getLayer());
38
+
39
+ $block->setChild('layer_state', $stateBlock);
40
+
41
+ $filterableAttributes = Mage::getResourceModel('factfinder_asn/product_attribute_collection');
42
+ foreach ($filterableAttributes as $index => $attribute) {
43
+ $filter = $block->getLayout()
44
+ ->createBlock('factfinder_asn/catalog_layer_factfinder')
45
+ ->setAttributeModel($attribute)
46
+ ->setLayer($block->getLayer())
47
+ ->init();
48
+
49
+ $block->setChild($attribute->getAttributeCode() . '_filter', $filter);
50
+
51
+ // remove category filter - it's enough to add it as a child
52
+ if ($attribute->getAttributeCode() == 'category') {
53
+ $filterableAttributes->removeItemByKey($index);
54
+ }
55
+ }
56
+
57
+ $block->setData('_filterable_attributes', $filterableAttributes);
58
+
59
+ return $this;
60
+ }
61
+
62
+
63
+ /**
64
+ * Add factfinder navigation on catalog
65
+ *
66
+ * @param Varian_Object $observer
67
+ *
68
+ * @return void
69
+ */
70
+ public function addLayerFiltersToCatalog($observer)
71
+ {
72
+ if (!Mage::helper('factfinder')->isEnabled('catalog_navigation')) {
73
+ return;
74
+ }
75
+
76
+ $block = $observer->getBlock();
77
+
78
+ if (!$block instanceof Mage_Catalog_Block_Layer_View
79
+ || $block instanceof Mage_CatalogSearch_Block_Layer
80
+ ) {
81
+ return;
82
+ }
83
+
84
+ $this->_addLayeredNavigation($block);
85
+ }
86
+
87
+
88
+ /**
89
+ * Add factfinder navigation on search page
90
+ *
91
+ * @param Varien_Object $observer
92
+ *
93
+ * @return void
94
+ */
95
+ public function addLayerFiltersToSearch($observer)
96
+ {
97
+ $block = $observer->getBlock();
98
+
99
+ if (!$block instanceof Mage_CatalogSearch_Block_Layer
100
+ || !Mage::helper('factfinder')->isEnabled('asn')
101
+ ) {
102
+ return;
103
+ }
104
+
105
+ $this->_addLayeredNavigation($block);
106
+ }
107
+
108
+
109
+ /**
110
+ * Reset current search layer for further use in the block
111
+ *
112
+ * @param Varien_Object $observer
113
+ *
114
+ * @return void
115
+ */
116
+ public function resetCurrentCatalogLayer($observer)
117
+ {
118
+ if (!Mage::helper('factfinder')->isEnabled('catalog_navigation')) {
119
+ return;
120
+ }
121
+
122
+ Mage::register('current_layer', Mage::getSingleton('factfinder_asn/catalog_layer'));
123
+ }
124
+
125
+
126
+ }
app/code/community/FACTFinder/Asn/Model/Resource/Product/Attribute/Collection.php ADDED
@@ -0,0 +1,181 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Resource_Product_Attribute_Collection
15
+ *
16
+ * Filter Attribute Collection
17
+ *
18
+ * @category Mage
19
+ * @package FACTFinder_Asn
20
+ * @author Flagbit Magento Team <magento@flagbit.de>
21
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
22
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
23
+ * @link http://www.flagbit.de
24
+ */
25
+ class FACTFinder_Asn_Model_Resource_Product_Attribute_Collection
26
+ extends Mage_Catalog_Model_Resource_Product_Attribute_Collection
27
+ {
28
+
29
+ /**
30
+ * @var array|null
31
+ */
32
+ protected $_attributeLabels = null;
33
+
34
+ /**
35
+ * @var int|null
36
+ */
37
+ protected $_storeId = null;
38
+
39
+
40
+ /**
41
+ * Get collection size
42
+ *
43
+ * @return int
44
+ */
45
+ public function getSize()
46
+ {
47
+ return count($this->_getSearchHandler()->getAfterSearchNavigation());
48
+ }
49
+
50
+
51
+ /**
52
+ * Get search handler
53
+ *
54
+ * @return FACTFinder_Asn_Model_Handler_Search
55
+ */
56
+ protected function _getSearchHandler()
57
+ {
58
+ return Mage::getSingleton('factfinder_asn/handler_search');
59
+ }
60
+
61
+
62
+ /**
63
+ * Load entities records into items
64
+ *
65
+ * @param bool $printQuery
66
+ * @param bool $logQuery
67
+ *
68
+ * @return FACTFinder_Asn_Model_Resource_Product_Attribute_Collection
69
+ */
70
+ public function load($printQuery = false, $logQuery = false)
71
+ {
72
+ if ($this->isLoaded()) {
73
+ return $this;
74
+ }
75
+
76
+ $result = $this->_getSearchHandler()->getAfterSearchNavigation();
77
+
78
+ if (count($result)) {
79
+ $this->resetData();
80
+
81
+ foreach ($result as $row) {
82
+ $item = $this->getNewEmptyItem();
83
+ if ($this->getIdFieldName()) {
84
+ $item->setIdFieldName($this->getIdFieldName());
85
+ }
86
+
87
+ $row['store_label'] = $this->_getStoreLabelsByAttributeCode($row['name']);
88
+ $item->addData($row);
89
+ $item->setAttributeCode(strtolower($item->getAttributeCode()));
90
+ $this->addItem($item);
91
+ }
92
+
93
+ $this->_setIsLoaded();
94
+ $this->_afterLoad();
95
+ }
96
+
97
+ return $this;
98
+ }
99
+
100
+
101
+ /**
102
+ * Add search query filter
103
+ *
104
+ * @param Mage_CatalogSearch_Model_Query $query
105
+ *
106
+ * @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
107
+ */
108
+ public function addSearchFilter($query)
109
+ {
110
+ return $this;
111
+ }
112
+
113
+
114
+ /**
115
+ * Retrieve store labels by given attribute code
116
+ *
117
+ * @param string $attributeCode
118
+ *
119
+ * @return array|string
120
+ */
121
+ protected function _getStoreLabelsByAttributeCode($attributeCode)
122
+ {
123
+ if ($this->_attributeLabels === null) {
124
+ $entityType = Mage::getSingleton('eav/config')->getEntityType('catalog_product');
125
+
126
+ $select = $this->getConnection()->select()
127
+ ->from(array('main_table' => $this->getTable('eav/attribute')), array('attribute_code'))
128
+ ->joinLeft(
129
+ array('additional_table' => $this->getTable('eav/attribute_label')),
130
+ 'additional_table.attribute_id = main_table.attribute_id',
131
+ null
132
+ )
133
+ ->columns(array(
134
+ 'value' => new Zend_Db_Expr(
135
+ 'IF(additional_table.value IS NULL, main_table.frontend_label, additional_table.value)'
136
+ )
137
+ ))
138
+ ->where('main_table.entity_type_id = ?', $entityType->getEntityTypeId())
139
+ ->where('additional_table.store_id IS NULL OR additional_table.store_id=?', $this->_storeId);
140
+
141
+ $this->_attributeLabels = $this->getConnection()->fetchPairs($select);
142
+ }
143
+
144
+ if (!isset($this->_attributeLabels[$attributeCode])) {
145
+ return $attributeCode;
146
+ }
147
+
148
+ return $this->_attributeLabels[$attributeCode];
149
+ }
150
+
151
+
152
+ /**
153
+ * Set Store ID
154
+ *
155
+ * @param int $storeId
156
+ *
157
+ * @return FACTFinder_Asn_Model_Resource_Product_Attribute_Collection
158
+ */
159
+ public function setStoreId($storeId)
160
+ {
161
+ $this->_storeId = $storeId;
162
+
163
+ return $this;
164
+ }
165
+
166
+
167
+ /**
168
+ * Set Order field
169
+ *
170
+ * @param string $attribute
171
+ * @param string $dir
172
+ *
173
+ * @return FACTFinder_Asn_Model_Resource_Product_Attribute_Collection
174
+ */
175
+ public function setOrder($attribute, $dir = 'desc')
176
+ {
177
+ return $this;
178
+ }
179
+
180
+
181
+ }
app/code/community/FACTFinder/Asn/Model/Resource/Search/Collection.php ADDED
@@ -0,0 +1,38 @@
1
+ <?php
2
+ /**
3
+ * FACTFinder_Asn
4
+ *
5
+ * @category Mage
6
+ * @package FACTFinder_Asn
7
+ * @author Flagbit Magento Team <magento@flagbit.de>
8
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ * @link http://www.flagbit.de
11
+ */
12
+
13
+ /**
14
+ * Class FACTFinder_Asn_Model_Resource_Search_Collection
15
+ *
16
+ * @category Mage
17
+ * @package FACTFinder_Asn
18
+ * @author Flagbit Magento Team <magento@flagbit.de>
19
+ * @copyright Copyright (c) 2015, Flagbit GmbH & Co. KG
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ * @link http://www.flagbit.de
22
+ */
23
+ class FACTFinder_Asn_Model_Resource_Search_Collection extends FACTFinder_Core_Model_Resource_Search_Collection
24
+ {
25
+
26
+
27
+ /**
28
+ * Get FACT-Finder Facade
29
+ *
30
+ * @return FACTFinder_Core_Model_Handler_Search
31
+ */
32
+ protected function _getSearchHandler()
33
+ {
34
+ return Mage::getSingleton('factfinder_asn/handler_search');
35
+ }
36
+
37
+
38
+ }
app/code/community/FACTFinder/Asn/etc/config.xml ADDED
@@ -0,0 +1,82 @@