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
- app/code/community/FACTFinder/Asn/Block/Catalog/Layer/Factfinder.php +64 -0
- app/code/community/FACTFinder/Asn/Block/Catalog/Layer/State.php +47 -0
- app/code/community/FACTFinder/Asn/Block/Catalog/Product/List/Toolbar.php +59 -0
- app/code/community/FACTFinder/Asn/Block/Catalog/Product/Pager.php +58 -0
- app/code/community/FACTFinder/Asn/Helper/Data.php +93 -0
- app/code/community/FACTFinder/Asn/Model/Catalog/Layer.php +48 -0
- app/code/community/FACTFinder/Asn/Model/Handler/Search.php +365 -0
- app/code/community/FACTFinder/Asn/Model/Layer/Filter/Factfinder.php +138 -0
- app/code/community/FACTFinder/Asn/Model/Layer/Filter/Item.php +118 -0
- app/code/community/FACTFinder/Asn/Model/Observer.php +126 -0
- app/code/community/FACTFinder/Asn/Model/Resource/Product/Attribute/Collection.php +181 -0
- app/code/community/FACTFinder/Asn/Model/Resource/Search/Collection.php +38 -0
- app/code/community/FACTFinder/Asn/etc/config.xml +82 -0
- app/code/community/FACTFinder/Asn/etc/system.xml +34 -0
- app/code/community/FACTFinder/Campaigns/Block/Abstract.php +78 -0
- app/code/community/FACTFinder/Campaigns/Block/Advisory/Product.php +87 -0
- app/code/community/FACTFinder/Campaigns/Block/Advisory/Search.php +50 -0
- app/code/community/FACTFinder/Campaigns/Block/Feedback/Abstract.php +49 -0
- app/code/community/FACTFinder/Campaigns/Block/Feedback/Cart.php +30 -0
- app/code/community/FACTFinder/Campaigns/Block/Feedback/Product.php +42 -0
- app/code/community/FACTFinder/Campaigns/Block/Feedback/Search.php +27 -0
- app/code/community/FACTFinder/Campaigns/Block/Pushed/Abstract.php +128 -0
- app/code/community/FACTFinder/Campaigns/Block/Pushed/Cart.php +28 -0
- app/code/community/FACTFinder/Campaigns/Block/Pushed/Product.php +42 -0
- app/code/community/FACTFinder/Campaigns/Block/Pushed/Search.php +46 -0
- app/code/community/FACTFinder/Campaigns/Helper/Data.php +63 -0
- app/code/community/FACTFinder/Campaigns/Model/Facade.php +67 -0
- app/code/community/FACTFinder/Campaigns/Model/Handler/Abstract.php +155 -0
- app/code/community/FACTFinder/Campaigns/Model/Handler/Cart.php +70 -0
- app/code/community/FACTFinder/Campaigns/Model/Handler/Product.php +65 -0
- app/code/community/FACTFinder/Campaigns/Model/Handler/Search.php +71 -0
- app/code/community/FACTFinder/Campaigns/Model/Observer.php +71 -0
- app/code/community/FACTFinder/Campaigns/Model/Resource/Pushedproducts/Collection.php +191 -0
- app/code/community/FACTFinder/Campaigns/etc/config.xml +68 -0
- app/code/community/FACTFinder/Campaigns/etc/system.xml +43 -0
- app/code/community/FACTFinder/Core/Block/Adminhtml/Exportlink.php +131 -0
- app/code/community/FACTFinder/Core/Block/Adminhtml/Form/Field/Attribute.php +87 -0
- app/code/community/FACTFinder/Core/Block/Adminhtml/Form/Field/Attributes.php +88 -0
- app/code/community/FACTFinder/Core/Block/Catalog/Product/List/Toolbar.php +280 -0
- app/code/community/FACTFinder/Core/Block/Catalog/Product/Pager.php +90 -0
- app/code/community/{Flagbit/FactFinder → FACTFinder/Core}/Helper/Backend.php +248 -228
- app/code/community/FACTFinder/Core/Helper/Data.php +158 -0
- app/code/community/FACTFinder/Core/Helper/Debug.php +192 -0
- app/code/community/FACTFinder/Core/Helper/Search.php +200 -0
- app/code/community/FACTFinder/Core/Model/Autoloader.php +71 -0
- app/code/community/FACTFinder/Core/Model/CatalogSearch/Layer.php +51 -0
- app/code/community/FACTFinder/Core/Model/Export/Price.php +148 -0
- app/code/community/FACTFinder/Core/Model/Export/Product.php +1082 -0
- app/code/community/FACTFinder/Core/Model/Export/Stock.php +150 -0
- app/code/community/FACTFinder/Core/Model/Facade.php +708 -0
- app/code/community/FACTFinder/Core/Model/File.php +135 -0
- app/code/community/FACTFinder/Core/Model/Handler/Abstract.php +74 -0
- app/code/community/FACTFinder/Core/Model/Handler/Search.php +280 -0
- app/code/community/FACTFinder/Core/Model/Handler/Status.php +287 -0
- app/code/community/FACTFinder/Core/Model/Observer.php +270 -0
- app/code/community/FACTFinder/Core/Model/Resource/Search/Collection.php +145 -0
- app/code/community/FACTFinder/Core/Model/Resource/Search/Engine.php +41 -0
- app/code/community/FACTFinder/Core/Model/System/Config/Backend/Attributes.php +53 -0
- app/code/community/FACTFinder/Core/Model/System/Config/Backend/Cron.php +76 -0
- app/code/community/FACTFinder/Core/Model/System/Config/Backend/Enabled.php +85 -0
- app/code/community/FACTFinder/Core/Model/System/Config/Source/Authtype.php +54 -0
- app/code/community/FACTFinder/Core/Model/System/Config/Source/Identifier.php +48 -0
- app/code/community/FACTFinder/Core/Model/System/Config/Source/Protocol.php +48 -0
- app/code/community/FACTFinder/Core/controllers/ExportController.php +241 -0
- app/code/community/FACTFinder/Core/etc/adminhtml.xml +35 -0
- app/code/community/FACTFinder/Core/etc/config.xml +184 -0
- app/code/community/{Flagbit/FactFinder → FACTFinder/Core}/etc/system.xml +441 -397
- app/code/community/FACTFinder/Recommendation/Helper/Data.php +46 -0
- app/code/community/FACTFinder/Recommendation/Model/Facade.php +74 -0
- app/code/community/FACTFinder/Recommendation/Model/Handler/Recommendations.php +126 -0
- app/code/community/FACTFinder/Recommendation/Model/Observer.php +168 -0
- app/code/community/FACTFinder/Recommendation/etc/config.xml +59 -0
- app/code/community/FACTFinder/Recommendation/etc/system.xml +23 -0
- app/code/community/FACTFinder/Suggest/Block/TopSearch.php +50 -0
- app/code/community/{Flagbit/FactFinder → FACTFinder/Suggest}/Block/XmlConnect/Catalog/Search/Suggest.php +65 -58
- app/code/community/FACTFinder/Suggest/Helper/Data.php +83 -0
- app/code/community/FACTFinder/Suggest/Model/Facade.php +82 -0
- app/code/community/FACTFinder/Suggest/Model/Handler/Suggest.php +192 -0
- app/code/community/FACTFinder/Suggest/Model/Observer.php +64 -0
- app/code/community/FACTFinder/Suggest/Model/Processor.php +302 -0
- app/code/community/FACTFinder/Suggest/Model/System/Config/Source/Imagetype.php +50 -0
- app/code/community/FACTFinder/Suggest/controllers/ProxyController.php +44 -0
- app/code/community/FACTFinder/Suggest/etc/config.xml +97 -0
- app/code/community/FACTFinder/Suggest/etc/system.xml +89 -0
- app/code/community/FACTFinder/Tagcloud/Block/TagCloud.php +89 -0
- app/code/community/FACTFinder/Tagcloud/Helper/Data.php +27 -0
- app/code/community/FACTFinder/Tagcloud/Model/Facade.php +70 -0
- app/code/community/FACTFinder/Tagcloud/Model/Handler/TagCloud.php +117 -0
- app/code/community/FACTFinder/Tagcloud/etc/config.xml +47 -0
- app/code/community/FACTFinder/Tracking/Block/Init.php +101 -0
- app/code/community/FACTFinder/Tracking/Helper/Data.php +59 -0
- app/code/community/FACTFinder/Tracking/Model/Facade.php +40 -0
- app/code/community/FACTFinder/Tracking/Model/Handler/Tracking.php +207 -0
- app/code/community/FACTFinder/Tracking/Model/Observer.php +279 -0
- app/code/community/FACTFinder/Tracking/Model/Processor.php +106 -0
- app/code/community/FACTFinder/Tracking/Model/Queue.php +39 -0
- app/code/community/FACTFinder/Tracking/Model/Resource/Queue.php +39 -0
- app/code/community/FACTFinder/Tracking/Model/Resource/Queue/Collection.php +40 -0
- app/code/community/FACTFinder/Tracking/controllers/ProxyController.php +39 -0
- app/code/community/FACTFinder/Tracking/etc/config.xml +151 -0
- app/code/community/FACTFinder/Tracking/etc/system.xml +66 -0
- app/code/community/FACTFinder/Tracking/sql/factfinder_tracking_setup/mysql4-install-1.0.0.php +49 -0
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Cockpit.php +0 -33
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Exportlink.php +0 -64
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Form/Field/Attribute.php +0 -54
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Form/Field/Attributes.php +0 -85
- app/code/community/Flagbit/FactFinder/Block/Campaign/Advisory.php +0 -32
- app/code/community/Flagbit/FactFinder/Block/Campaign/Cart/Advisory.php +0 -63
- app/code/community/Flagbit/FactFinder/Block/Campaign/Cart/Feedback.php +0 -67
- app/code/community/Flagbit/FactFinder/Block/Campaign/Feedback.php +0 -71
- app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Advisory.php +0 -54
- app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Feedback.php +0 -51
- app/code/community/Flagbit/FactFinder/Block/Cart/Crosssell.php +0 -92
- app/code/community/Flagbit/FactFinder/Block/Filter/Slider.php +0 -36
- app/code/community/Flagbit/FactFinder/Block/Layer.php +0 -154
- app/code/community/Flagbit/FactFinder/Block/Layer/Abstract.php +0 -33
- app/code/community/Flagbit/FactFinder/Block/Product/List/Crosssell.php +0 -74
- app/code/community/Flagbit/FactFinder/Block/Product/List/Upsell.php +0 -142
- app/code/community/Flagbit/FactFinder/Block/Secondaryresult.php +0 -31
- app/code/community/Flagbit/FactFinder/Block/TagCloud.php +0 -54
- app/code/community/Flagbit/FactFinder/Block/Tracking.php +0 -108
- app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Product/List.php +0 -134
- app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Search.php +0 -133
- app/code/community/Flagbit/FactFinder/Helper/Data.php +0 -73
- app/code/community/Flagbit/FactFinder/Helper/Debug.php +0 -140
- app/code/community/Flagbit/FactFinder/Helper/Search.php +0 -421
- app/code/community/Flagbit/FactFinder/Model/Export/Price.php +0 -91
- app/code/community/Flagbit/FactFinder/Model/Export/Product.php +0 -616
- app/code/community/Flagbit/FactFinder/Model/Export/Stock.php +0 -91
- app/code/community/Flagbit/FactFinder/Model/Facade.php +0 -549
- app/code/community/Flagbit/FactFinder/Model/Handler/Abstract.php +0 -45
- app/code/community/Flagbit/FactFinder/Model/Handler/CheckStatus.php +0 -150
- app/code/community/Flagbit/FactFinder/Model/Handler/ProductCampaign.php +0 -75
- app/code/community/Flagbit/FactFinder/Model/Handler/ProductDetailCampaign.php +0 -27
- app/code/community/Flagbit/FactFinder/Model/Handler/Recommendations.php +0 -51
- app/code/community/Flagbit/FactFinder/Model/Handler/Search.php +0 -435
- app/code/community/Flagbit/FactFinder/Model/Handler/SecondarySearch.php +0 -94
- app/code/community/Flagbit/FactFinder/Model/Handler/ShoppingCartCampaign.php +0 -27
- app/code/community/Flagbit/FactFinder/Model/Handler/Suggest.php +0 -106
- app/code/community/Flagbit/FactFinder/Model/Handler/TagCloud.php +0 -71
- app/code/community/Flagbit/FactFinder/Model/Handler/Tracking.php +0 -64
- app/code/community/Flagbit/FactFinder/Model/Handler/Tracking/Scic.php +0 -77
- app/code/community/Flagbit/FactFinder/Model/Layer.php +0 -83
- app/code/community/Flagbit/FactFinder/Model/Layer/Abstract.php +0 -7
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Abstract.php +0 -118
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Catalog.php +0 -25
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Catalogsearch.php +0 -35
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Item.php +0 -23
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Campaign/Pushedproducts/Collection.php +0 -148
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Product/Attribute/Collection.php +0 -144
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Product/Recommendation/Collection.php +0 -59
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Scic/Queue.php +0 -31
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Scic/Queue/Collection.php +0 -28
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Collection.php +0 -135
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Engine.php +0 -53
- app/code/community/Flagbit/FactFinder/Model/Observer.php +0 -394
- app/code/community/Flagbit/FactFinder/Model/Processor.php +0 -281
- app/code/community/Flagbit/FactFinder/Model/Scic/Queue.php +0 -27
- app/code/community/Flagbit/FactFinder/Model/System/Config/Backend/Attributes.php +0 -52
- app/code/community/Flagbit/FactFinder/Model/System/Config/Backend/Enabled.php +0 -57
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Authtype.php +0 -45
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Ffversion.php +0 -53
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Identifier.php +0 -41
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Imagetype.php +0 -37
- app/code/community/Flagbit/FactFinder/controllers/Adminhtml/Factfinder/CockpitController.php +0 -53
- app/code/community/Flagbit/FactFinder/controllers/ExportController.php +0 -141
- app/code/community/Flagbit/FactFinder/controllers/ProxyController.php +0 -52
- app/code/community/Flagbit/FactFinder/etc/adminhtml.xml +0 -49
- app/code/community/Flagbit/FactFinder/etc/config.xml +0 -313
- app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-install-3.2.0.php +0 -38
- app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-upgrade-3.2.0-3.2.1.php +0 -30
- app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-upgrade-3.2.1-3.3.0.php +0 -34
- app/design/adminhtml/default/default/layout/factfinder.xml +0 -28
- app/design/adminhtml/default/default/template/factfinder/cockpit.phtml +0 -22
- app/design/frontend/base/default/layout/factfinder.xml +0 -78
- app/design/frontend/base/default/layout/factfinder/asn.xml +38 -0
- app/design/frontend/base/default/layout/factfinder/campaigns.xml +120 -0
- app/design/frontend/base/default/layout/factfinder/core.xml +54 -0
- app/design/frontend/base/default/layout/factfinder/suggest.xml +28 -0
- app/design/frontend/base/default/layout/factfinder/tagcloud.xml +21 -0
- app/design/frontend/base/default/layout/factfinder/tracking.xml +24 -0
- app/design/frontend/base/default/template/factfinder/asn/layer/filter/slider.phtml +41 -0
- app/design/frontend/base/default/template/factfinder/asn/layer/slider.phtml +18 -0
- app/design/frontend/base/default/template/factfinder/campaign/advisory.phtml +0 -12
- app/design/frontend/base/default/template/factfinder/campaign/cart/advisory.phtml +0 -12
- app/design/frontend/base/default/template/factfinder/campaign/cart/feedback.phtml +0 -6
- app/design/frontend/base/default/template/factfinder/campaign/feedback.phtml +0 -11
- app/design/frontend/base/default/template/factfinder/campaign/product/advisory.phtml +0 -13
- app/design/frontend/base/default/template/factfinder/campaign/product/feedback.phtml +0 -7
- app/design/frontend/base/default/template/factfinder/campaigns/advisory.phtml +32 -0
- app/design/frontend/base/default/template/factfinder/campaigns/feedback.phtml +15 -0
- app/design/frontend/base/default/template/factfinder/campaigns/pushed.phtml +43 -0
- app/design/frontend/base/default/template/factfinder/core/export/locked.phtml +19 -0
- app/design/frontend/base/default/template/factfinder/core/export/nofile.phtml +19 -0
- app/design/frontend/base/default/template/factfinder/filter/scriptaculousSlider.phtml +0 -103
- app/design/frontend/base/default/template/factfinder/filter/slider.phtml +0 -46
- app/design/frontend/base/default/template/factfinder/form.advancedsuggest.phtml +0 -97
- app/design/frontend/base/default/template/factfinder/form.advancedsuggest68.phtml +0 -111
- app/design/frontend/base/default/template/factfinder/form.mini.phtml +0 -54
- app/design/frontend/base/default/template/factfinder/logo.phtml +0 -22
- app/design/frontend/base/default/template/factfinder/secondaryresult.phtml +0 -41
- app/design/frontend/base/default/template/factfinder/suggest/advancedsuggest.phtml +57 -0
- app/design/frontend/base/default/template/factfinder/tracking.phtml +0 -33
- app/design/frontend/base/default/template/factfinder/tracking/init.phtml +26 -0
- app/etc/factfinder.xml +2 -20
- app/etc/modules/Flagbit_FactFinder.xml +0 -9
- app/locale/de_DE/Flagbit_FactFinder.csv +0 -91
- js/factfinder/jXHR.js +10 -10
- js/factfinder/suggest.js +127 -6
- js/factfinder/tracking.js +73 -61
- lib/FACTFinder/Abstract/Adapter.php +0 -134
- lib/FACTFinder/Abstract/Configuration.php +0 -223
- lib/FACTFinder/Abstract/DataProvider.php +0 -125
- lib/FACTFinder/Abstract/Logger.php +0 -23
- lib/FACTFinder/Adapter/AbstractAdapter.php +194 -0
- lib/FACTFinder/Adapter/Compare.php +179 -0
- lib/FACTFinder/Adapter/Import.php +100 -0
- lib/FACTFinder/Adapter/ProductCampaign.php +301 -0
- lib/FACTFinder/Adapter/Recommendation.php +212 -0
- lib/FACTFinder/Adapter/Search.php +1001 -0
- lib/FACTFinder/Adapter/SimilarRecords.php +220 -0
- lib/FACTFinder/Adapter/Suggest.php +127 -0
- lib/FACTFinder/Adapter/TagCloud.php +116 -0
- lib/FACTFinder/Adapter/Tracking.php +383 -0
- lib/FACTFinder/AdvisorAnswer.php +0 -77
- lib/FACTFinder/AdvisorQuestion.php +0 -67
- lib/FACTFinder/Asn.php +0 -37
- lib/FACTFinder/AsnFilterItem.php +0 -72
- lib/FACTFinder/AsnGroup.php +0 -177
- lib/FACTFinder/AsnSliderFilter.php +0 -139
- lib/FACTFinder/BreadCrumbItem.php +0 -75
- lib/FACTFinder/Campaign.php +0 -206
- lib/FACTFinder/CampaignIterator.php +0 -190
- lib/FACTFinder/Configuration.php +0 -448
- lib/FACTFinder/Core/AbstractConfiguration.php +231 -0
- lib/FACTFinder/Core/AbstractEncodingConverter.php +156 -0
- lib/FACTFinder/Core/Client/RequestParser.php +185 -0
- lib/FACTFinder/Core/Client/UrlBuilder.php +77 -0
- lib/FACTFinder/Core/ConfigurationInterface.php +212 -0
- lib/FACTFinder/Core/IConvEncodingConverter.php +40 -0
- lib/FACTFinder/Core/ManualConfiguration.php +197 -0
- lib/FACTFinder/Core/Page/.gitignore +0 -0
- lib/FACTFinder/Core/ParametersConverter.php +158 -0
- lib/FACTFinder/Core/Server/AbstractDataProvider.php +111 -0
- lib/FACTFinder/Core/Server/ConnectionData.php +202 -0
- lib/FACTFinder/Core/Server/EasyCurlDataProvider.php +230 -0
- lib/FACTFinder/Core/Server/EasyCurlRequestFactory.php +79 -0
- lib/FACTFinder/Core/Server/FileSystemDataProvider.php +121 -0
- lib/FACTFinder/Core/Server/FileSystemRequestFactory.php +70 -0
- lib/FACTFinder/Core/Server/MultiCurlDataProvider.php +346 -0
- lib/FACTFinder/Core/Server/MultiCurlRequestFactory.php +79 -0
- lib/FACTFinder/Core/Server/NullResponse.php +16 -0
- lib/FACTFinder/Core/Server/Request.php +126 -0
- lib/FACTFinder/Core/Server/RequestFactoryInterface.php +14 -0
- lib/FACTFinder/Core/Server/Response.php +72 -0
- lib/FACTFinder/Core/Server/UrlBuilder.php +229 -0
- lib/FACTFinder/Core/Utf8EncodingConverter.php +50 -0
- lib/FACTFinder/Core/XmlConfiguration.php +349 -0
- lib/FACTFinder/Curl.php +0 -99
- lib/FACTFinder/CurlHandle.php +0 -8
- lib/FACTFinder/CurlInterface.php +0 -25
- lib/FACTFinder/CurlStub.php +0 -379
- lib/FACTFinder/Custom/.gitignore +0 -0
- lib/FACTFinder/Data/AdvisorAnswer.php +60 -0
- lib/FACTFinder/Data/AdvisorQuestion.php +61 -0
- lib/FACTFinder/Data/AfterSearchNavigation.php +29 -0
- lib/FACTFinder/Data/ArticleNumberSearchStatus.php +39 -0
- lib/FACTFinder/Data/BreadCrumb.php +64 -0
- lib/FACTFinder/Data/BreadCrumbTrail.php +13 -0
- lib/FACTFinder/Data/BreadCrumbType.php +36 -0
- lib/FACTFinder/Data/Campaign.php +223 -0
- lib/FACTFinder/Data/CampaignIterator.php +170 -0
- lib/FACTFinder/Data/Filter.php +70 -0
- lib/FACTFinder/Data/FilterGroup.php +222 -0
- lib/FACTFinder/Data/FilterSelectionType.php +43 -0
- lib/FACTFinder/Data/FilterStyle.php +63 -0
- lib/FACTFinder/Data/FilterType.php +37 -0
- lib/FACTFinder/Data/Item.php +74 -0
- lib/FACTFinder/Data/Page.php +35 -0
- lib/FACTFinder/Data/Paging.php +111 -0
- lib/FACTFinder/Data/Record.php +115 -0
- lib/FACTFinder/Data/Result.php +54 -0
- lib/FACTFinder/Data/ResultsPerPageOptions.php +49 -0
- lib/FACTFinder/Data/SearchParameters.php +154 -0
- lib/FACTFinder/Data/SearchStatus.php +42 -0
- lib/FACTFinder/Data/SingleWordSearchItem.php +37 -0
- lib/FACTFinder/Data/SliderFilter.php +120 -0
- lib/FACTFinder/Data/Sorting.php +13 -0
- lib/FACTFinder/Data/SuggestQuery.php +68 -0
- lib/FACTFinder/Data/TagQuery.php +45 -0
- lib/FACTFinder/Default/CompareAdapter.php +0 -93
- lib/FACTFinder/Default/ImportAdapter.php +0 -59
- lib/FACTFinder/Default/ProductCampaignAdapter.php +0 -114
- lib/FACTFinder/Default/RecommendationAdapter.php +0 -115
- lib/FACTFinder/Default/ScicAdapter.php +0 -190
- lib/FACTFinder/Default/SearchAdapter.php +0 -313
- lib/FACTFinder/Default/SimilarRecordsAdapter.php +0 -137
- lib/FACTFinder/Default/SuggestAdapter.php +0 -44
- lib/FACTFinder/Default/TagCloudAdapter.php +0 -54
- lib/FACTFinder/Default/TrackingAdapter.php +0 -100
- lib/FACTFinder/EncodingHandler.php +0 -219
- lib/FACTFinder/Http/DataProvider.php +0 -323
- lib/FACTFinder/Http/DummyProvider.php +0 -130
- lib/FACTFinder/Http/LegacyTrackingAdapter.php +0 -15
- lib/FACTFinder/Http/ParallelDataProvider.php +0 -278
- lib/FACTFinder/Http/ScicAdapter.php +0 -41
- lib/FACTFinder/Http/StatusHelper.php +0 -153
- lib/FACTFinder/Http/SuggestAdapter.php +0 -41
- lib/FACTFinder/Http/TrackingAdapter.php +0 -31
- lib/FACTFinder/Http/UrlBuilder.php +0 -234
- lib/FACTFinder/Item.php +0 -63
- lib/FACTFinder/Json66/CompareAdapter.php +0 -71
- lib/FACTFinder/Json66/ImportAdapter.php +0 -74
- lib/FACTFinder/Json66/RecommendationAdapter.php +0 -11
- lib/FACTFinder/Json66/ScicAdapter.php +0 -9
- lib/FACTFinder/Json66/SearchAdapter.php +0 -512
- lib/FACTFinder/Json66/SimilarRecordsAdapter.php +0 -75
- lib/FACTFinder/Json66/SuggestAdapter.php +0 -58
- lib/FACTFinder/Json66/TagCloudAdapter.php +0 -55
- lib/FACTFinder/Json67/CompareAdapter.php +0 -7
- lib/FACTFinder/Json67/ImportAdapter.php +0 -10
- lib/FACTFinder/Json67/ProductCampaignAdapter.php +0 -160
- lib/FACTFinder/Json67/RecommendationAdapter.php +0 -88
- lib/FACTFinder/Json67/ScicAdapter.php +0 -8
- lib/FACTFinder/Json67/SearchAdapter.php +0 -138
- lib/FACTFinder/Json67/SimilarRecordsAdapter.php +0 -7
- lib/FACTFinder/Json67/SuggestAdapter.php +0 -10
- lib/FACTFinder/Json67/TagCloudAdapter.php +0 -10
- lib/FACTFinder/Json68/CompareAdapter.php +0 -7
- lib/FACTFinder/Json68/ImportAdapter.php +0 -10
- lib/FACTFinder/Json68/ProductCampaignAdapter.php +0 -25
- lib/FACTFinder/Json68/RecommendationAdapter.php +0 -10
- lib/FACTFinder/Json68/ScicAdapter.php +0 -12
- lib/FACTFinder/Json68/SearchAdapter.php +0 -42
- lib/FACTFinder/Json68/SimilarRecordsAdapter.php +0 -4
- lib/FACTFinder/Json68/SuggestAdapter.php +0 -22
- lib/FACTFinder/Json68/TagCloudAdapter.php +0 -10
- lib/FACTFinder/Json69/CompareAdapter.php +0 -7
- lib/FACTFinder/Json69/ImportAdapter.php +0 -10
- lib/FACTFinder/Json69/ProductCampaignAdapter.php +0 -8
- lib/FACTFinder/Json69/RecommendationAdapter.php +0 -10
- lib/FACTFinder/Json69/ScicAdapter.php +0 -8
- lib/FACTFinder/Json69/SearchAdapter.php +0 -74
- lib/FACTFinder/Json69/SimilarRecordsAdapter.php +0 -7
- lib/FACTFinder/Json69/SuggestAdapter.php +0 -17
- lib/FACTFinder/Json69/TagCloudAdapter.php +0 -11
- lib/FACTFinder/Loader.php +108 -127
- lib/FACTFinder/Log4PhpLogger.php +0 -86
- lib/FACTFinder/NullLogger.php +0 -24
- lib/FACTFinder/Paging.php +0 -191
- lib/FACTFinder/Parameters.php +0 -113
- lib/FACTFinder/ParametersParser.php +0 -385
- lib/FACTFinder/ProductsPerPageOptions.php +0 -106
- lib/FACTFinder/Record.php +0 -258
- lib/FACTFinder/Result.php +0 -62
- lib/FACTFinder/SingleWordSearchItem.php +0 -46
- lib/FACTFinder/SuggestQuery.php +0 -87
- lib/FACTFinder/TagQuery.php +0 -48
- lib/FACTFinder/Util.php +0 -89
- lib/{SAI → FACTFinder/Util}/Curl.php +44 -29
- lib/FACTFinder/Util/CurlHandle.php +33 -0
- lib/FACTFinder/Util/CurlInterface.php +40 -0
- lib/FACTFinder/Util/CurlMultiHandle.php +43 -0
- lib/FACTFinder/Util/CurlStub.php +618 -0
- lib/FACTFinder/Util/Log4PhpLogger.php +74 -0
- lib/FACTFinder/Util/LoggerInterface.php +13 -0
- lib/FACTFinder/Util/NullLogger.php +21 -0
- lib/FACTFinder/Util/Parameters.php +421 -0
- lib/FACTFinder/Util/Pimple.php +261 -0
- lib/FACTFinder/Xml64/SearchAdapter.php +0 -115
- lib/FACTFinder/Xml65/ImportAdapter.php +0 -86
- lib/FACTFinder/Xml65/RecommendationAdapter.php +0 -90
- lib/FACTFinder/Xml65/ScicAdapter.php +0 -9
- lib/FACTFinder/Xml65/SearchAdapter.php +0 -520
- lib/FACTFinder/Xml65/SuggestAdapter.php +0 -65
- lib/FACTFinder/Xml65/TagCloudAdapter.php +0 -65
- lib/FACTFinder/Xml66/CompareAdapter.php +0 -102
- lib/FACTFinder/Xml66/ImportAdapter.php +0 -22
- lib/FACTFinder/Xml66/RecommendationAdapter.php +0 -22
- lib/FACTFinder/Xml66/ScicAdapter.php +0 -8
- lib/FACTFinder/Xml66/SearchAdapter.php +0 -104
- lib/FACTFinder/Xml66/SimilarRecordsAdapter.php +0 -107
- lib/FACTFinder/Xml66/SuggestAdapter.php +0 -22
- lib/FACTFinder/Xml66/TagCloudAdapter.php +0 -22
- lib/FACTFinder/Xml67/CompareAdapter.php +0 -19
- lib/FACTFinder/Xml67/ImportAdapter.php +0 -19
- lib/FACTFinder/Xml67/ProductCampaignAdapter.php +0 -164
- lib/FACTFinder/Xml67/RecommendationAdapter.php +0 -40
- lib/FACTFinder/Xml67/ScicAdapter.php +0 -8
- lib/FACTFinder/Xml67/SearchAdapter.php +0 -135
- lib/FACTFinder/Xml67/SimilarRecordsAdapter.php +0 -19
- lib/FACTFinder/Xml67/SuggestAdapter.php +0 -19
- lib/FACTFinder/Xml67/TagCloudAdapter.php +0 -19
- lib/FACTFinder/Xml68/CompareAdapter.php +0 -19
- lib/FACTFinder/Xml68/ImportAdapter.php +0 -19
- lib/FACTFinder/Xml68/ProductCampaignAdapter.php +0 -20
- lib/FACTFinder/Xml68/RecommendationAdapter.php +0 -19
- lib/FACTFinder/Xml68/ScicAdapter.php +0 -12
- lib/FACTFinder/Xml68/SearchAdapter.php +0 -22
- lib/FACTFinder/Xml68/SimilarRecordsAdapter.php +0 -19
- lib/FACTFinder/Xml68/SuggestAdapter.php +0 -20
- lib/FACTFinder/Xml68/TagCloudAdapter.php +0 -19
- lib/FACTFinder/Xml69/CompareAdapter.php +0 -17
- lib/FACTFinder/Xml69/ImportAdapter.php +0 -17
- lib/FACTFinder/Xml69/ProductCampaignAdapter.php +0 -18
- lib/FACTFinder/Xml69/RecommendationAdapter.php +0 -17
- lib/FACTFinder/Xml69/ScicAdapter.php +0 -8
- lib/FACTFinder/Xml69/SearchAdapter.php +0 -67
- lib/FACTFinder/Xml69/SimilarRecordsAdapter.php +0 -17
- lib/FACTFinder/Xml69/SuggestAdapter.php +0 -17
- lib/FACTFinder/Xml69/TagCloudAdapter.php +0 -11
- lib/FACTFinder/Xml69/TrackingAdapter.php +0 -7
- lib/FACTFinderCustom/Configuration.php +354 -469
- lib/SAI/Curl/Handle.php +0 -8
- lib/SAI/CurlInterface.php +0 -25
- lib/SAI/CurlStub.php +0 -382
- lib/log4php/Logger.php +596 -0
- lib/log4php/LoggerAppender.php +286 -0
- lib/log4php/LoggerAppenderPool.php +98 -0
- lib/log4php/LoggerAutoloader.php +142 -0
- lib/log4php/LoggerConfigurable.php +116 -0
- lib/log4php/LoggerConfigurator.php +42 -0
- lib/log4php/LoggerException.php +28 -0
- lib/log4php/LoggerFilter.php +126 -0
- lib/log4php/LoggerHierarchy.php +257 -0
- lib/log4php/LoggerLayout.php +74 -0
- lib/log4php/LoggerLevel.php +256 -0
- lib/log4php/LoggerLocationInfo.php +103 -0
- lib/log4php/LoggerLoggingEvent.php +368 -0
- lib/log4php/LoggerMDC.php +88 -0
- lib/log4php/LoggerNDC.php +203 -0
- lib/log4php/LoggerReflectionUtils.php +152 -0
- lib/log4php/LoggerRoot.php +71 -0
- lib/log4php/LoggerThrowableInformation.php +68 -0
- lib/log4php/appenders/LoggerAppenderConsole.php +103 -0
- lib/log4php/appenders/LoggerAppenderDailyFile.php +130 -0
- lib/log4php/appenders/LoggerAppenderEcho.php +88 -0
- lib/log4php/appenders/LoggerAppenderFile.php +225 -0
- lib/log4php/appenders/LoggerAppenderFirePHP.php +100 -0
- lib/log4php/appenders/LoggerAppenderMail.php +136 -0
- lib/log4php/appenders/LoggerAppenderMailEvent.php +180 -0
- lib/log4php/appenders/LoggerAppenderMongoDB.php +360 -0
- lib/log4php/appenders/LoggerAppenderNull.php +44 -0
- lib/log4php/appenders/LoggerAppenderPDO.php +282 -0
- lib/log4php/appenders/LoggerAppenderPhp.php +49 -0
- lib/log4php/appenders/LoggerAppenderRollingFile.php +305 -0
- lib/log4php/appenders/LoggerAppenderSocket.php +122 -0
- lib/log4php/appenders/LoggerAppenderSyslog.php +303 -0
- lib/log4php/configurators/LoggerConfigurationAdapter.php +39 -0
- lib/log4php/configurators/LoggerConfigurationAdapterINI.php +299 -0
- lib/log4php/configurators/LoggerConfigurationAdapterPHP.php +84 -0
- lib/log4php/configurators/LoggerConfigurationAdapterXML.php +278 -0
- lib/log4php/configurators/LoggerConfiguratorDefault.php +477 -0
- lib/log4php/filters/LoggerFilterDenyAll.php +56 -0
- lib/log4php/filters/LoggerFilterLevelMatch.php +100 -0
- lib/log4php/filters/LoggerFilterLevelRange.php +138 -0
- lib/log4php/filters/LoggerFilterStringMatch.php +89 -0
- lib/log4php/helpers/LoggerFormattingInfo.php +54 -0
- lib/log4php/helpers/LoggerOptionConverter.php +226 -0
- lib/log4php/helpers/LoggerPatternParser.php +237 -0
- lib/log4php/helpers/LoggerUtils.php +123 -0
- lib/log4php/layouts/LoggerLayoutHtml.php +214 -0
- lib/log4php/layouts/LoggerLayoutPattern.php +171 -0
- lib/log4php/layouts/LoggerLayoutSerialized.php +55 -0
- lib/log4php/layouts/LoggerLayoutSimple.php +56 -0
- lib/log4php/layouts/LoggerLayoutTTCC.php +201 -0
- lib/log4php/layouts/LoggerLayoutXml.php +210 -0
- lib/log4php/pattern/LoggerPatternConverter.php +131 -0
- lib/log4php/pattern/LoggerPatternConverterClass.php +64 -0
- lib/log4php/pattern/LoggerPatternConverterCookie.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterDate.php +91 -0
- lib/log4php/pattern/LoggerPatternConverterEnvironment.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterFile.php +34 -0
- lib/log4php/pattern/LoggerPatternConverterLevel.php +34 -0
- lib/log4php/pattern/LoggerPatternConverterLine.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterLiteral.php +40 -0
- lib/log4php/pattern/LoggerPatternConverterLocation.php +39 -0
- lib/log4php/pattern/LoggerPatternConverterLogger.php +65 -0
- lib/log4php/pattern/LoggerPatternConverterMDC.php +55 -0
- lib/log4php/pattern/LoggerPatternConverterMessage.php +34 -0
- lib/log4php/pattern/LoggerPatternConverterMethod.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterNDC.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterNewLine.php +34 -0
- lib/log4php/pattern/LoggerPatternConverterProcess.php +34 -0
- lib/log4php/pattern/LoggerPatternConverterRelative.php +36 -0
- lib/log4php/pattern/LoggerPatternConverterRequest.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterServer.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterSession.php +35 -0
- lib/log4php/pattern/LoggerPatternConverterSessionID.php +33 -0
- lib/log4php/pattern/LoggerPatternConverterSuperglobal.php +102 -0
- lib/log4php/pattern/LoggerPatternConverterThrowable.php +40 -0
- lib/log4php/renderers/LoggerRenderer.php +36 -0
- lib/log4php/renderers/LoggerRendererDefault.php +36 -0
- lib/log4php/renderers/LoggerRendererException.php +36 -0
- lib/log4php/renderers/LoggerRendererMap.php +186 -0
- lib/log4php/xml/log4php.dtd +148 -0
- package.xml +11 -21
- shell/factfinder.php +65 -0
- 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 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|