Version Notes
ADD: necessary information into the build.xml to make the package process work
ADD: it is possible to get the complete search adapter of the secondary search result.
CHG: made it possible to add ignore parameters from the module
CHG: renamed misspelled variable
CHG: as the "Category" name convention is not always complied, accept both notations
CHG: updated ff library to current version
CHG: implemented the legacy tracking for 6.9
FIX: selected filters are now viewed on navigation pages, except of current magento-selected categories closing #62
FIX: Prevent fatal errors in factfinder/search_collection closing #54
FIX: added names to the campaign blocks at the layout xml file
FIX: get caching working; however it won't work with php 5.2 or less!
Release Info
Developer | Magento Core Team |
Extension | Flagbit_Factfinder |
Version | 3.5.5 |
Comparing to | |
See all releases |
Code changes from version 3.5.4 to 3.5.5
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Cockpit.php +32 -32
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Exportlink.php +63 -63
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Form/Field/Attribute.php +54 -54
- app/code/community/Flagbit/FactFinder/Block/Adminhtml/Form/Field/Attributes.php +85 -85
- app/code/community/Flagbit/FactFinder/Block/Campaign/Advisory.php +31 -31
- app/code/community/Flagbit/FactFinder/Block/Campaign/Cart/Advisory.php +62 -62
- app/code/community/Flagbit/FactFinder/Block/Campaign/Cart/Feedback.php +66 -66
- app/code/community/Flagbit/FactFinder/Block/Campaign/Feedback.php +70 -70
- app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Advisory.php +53 -53
- app/code/community/Flagbit/FactFinder/Block/Campaign/Product/Feedback.php +50 -50
- app/code/community/Flagbit/FactFinder/Block/Cart/Crosssell.php +91 -91
- app/code/community/Flagbit/FactFinder/Block/Filter/Slider.php +35 -35
- app/code/community/Flagbit/FactFinder/Block/Layer.php +154 -154
- app/code/community/Flagbit/FactFinder/Block/Layer/Abstract.php +33 -33
- app/code/community/Flagbit/FactFinder/Block/Product/List/Crosssell.php +73 -73
- app/code/community/Flagbit/FactFinder/Block/Product/List/Upsell.php +141 -141
- app/code/community/Flagbit/FactFinder/Block/Secondaryresult.php +30 -30
- app/code/community/Flagbit/FactFinder/Block/TagCloud.php +53 -53
- app/code/community/Flagbit/FactFinder/Block/Tracking.php +107 -107
- app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Product/List.php +134 -134
- app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Search.php +133 -133
- app/code/community/Flagbit/FactFinder/Block/XmlConnect/Catalog/Search/Suggest.php +57 -57
- app/code/community/Flagbit/FactFinder/Helper/Backend.php +227 -227
- app/code/community/Flagbit/FactFinder/Helper/Data.php +73 -73
- app/code/community/Flagbit/FactFinder/Helper/Debug.php +139 -139
- app/code/community/Flagbit/FactFinder/Helper/Search.php +421 -421
- app/code/community/Flagbit/FactFinder/Model/Export/Price.php +91 -91
- app/code/community/Flagbit/FactFinder/Model/Export/Product.php +616 -616
- app/code/community/Flagbit/FactFinder/Model/Export/Stock.php +91 -91
- app/code/community/Flagbit/FactFinder/Model/Facade.php +548 -538
- app/code/community/Flagbit/FactFinder/Model/Handler/Tracking.php +63 -61
- app/code/community/Flagbit/FactFinder/Model/Handler/Tracking/Scic.php +76 -76
- app/code/community/Flagbit/FactFinder/Model/Layer.php +83 -83
- app/code/community/Flagbit/FactFinder/Model/Layer/Abstract.php +6 -6
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Abstract.php +117 -117
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Catalog.php +24 -24
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Attribute/Catalogsearch.php +34 -34
- app/code/community/Flagbit/FactFinder/Model/Layer/Filter/Item.php +22 -22
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Campaign/Pushedproducts/Collection.php +148 -148
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Product/Attribute/Collection.php +143 -143
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Product/Recommendation/Collection.php +58 -58
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Scic/Queue.php +30 -30
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Scic/Queue/Collection.php +27 -27
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Collection.php +135 -135
- app/code/community/Flagbit/FactFinder/Model/Mysql4/Search/Engine.php +53 -53
- app/code/community/Flagbit/FactFinder/Model/Observer.php +393 -393
- app/code/community/Flagbit/FactFinder/Model/Processor.php +280 -269
- app/code/community/Flagbit/FactFinder/Model/Scic/Queue.php +26 -26
- app/code/community/Flagbit/FactFinder/Model/System/Config/Backend/Attributes.php +52 -52
- app/code/community/Flagbit/FactFinder/Model/System/Config/Backend/Enabled.php +57 -57
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Authtype.php +45 -45
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Ffversion.php +53 -53
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Identifier.php +41 -41
- app/code/community/Flagbit/FactFinder/Model/System/Config/Source/Imagetype.php +37 -37
- app/code/community/Flagbit/FactFinder/controllers/Adminhtml/Factfinder/CockpitController.php +52 -52
- app/code/community/Flagbit/FactFinder/controllers/ExportController.php +140 -140
- app/code/community/Flagbit/FactFinder/controllers/ProxyController.php +51 -51
- app/code/community/Flagbit/FactFinder/etc/adminhtml.xml +49 -49
- app/code/community/Flagbit/FactFinder/etc/config.xml +312 -312
- app/code/community/Flagbit/FactFinder/etc/system.xml +397 -397
- app/code/community/Flagbit/FactFinder/sql/factfinder_setup/mysql4-install-3.2.0.php +37 -37
- app/locale/de_DE/Flagbit_FactFinder.csv +91 -91
- lib/FACTFinder/Xml65/ImportAdapter.php +86 -86
- package.xml +4 -4
@@ -1,33 +1,33 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Black class
|
12 |
-
*
|
13 |
-
* This Block class provides the FACT-Finder Business User Cockpit Authentication URL
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_Adminhtml_Cockpit extends Mage_Adminhtml_Block_Template {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* get FACT-Finder Business User Cockpit Authentication URL
|
25 |
-
*
|
26 |
-
* @return string
|
27 |
-
*/
|
28 |
-
public function getManagementUrl()
|
29 |
-
{
|
30 |
-
return Mage::getSingleton('factfinder/facade')->getManagementUrl();
|
31 |
-
}
|
32 |
-
|
33 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Black class
|
12 |
+
*
|
13 |
+
* This Block class provides the FACT-Finder Business User Cockpit Authentication URL
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_Adminhtml_Cockpit extends Mage_Adminhtml_Block_Template {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* get FACT-Finder Business User Cockpit Authentication URL
|
25 |
+
*
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
public function getManagementUrl()
|
29 |
+
{
|
30 |
+
return Mage::getSingleton('factfinder/facade')->getManagementUrl();
|
31 |
+
}
|
32 |
+
|
33 |
}
|
@@ -1,64 +1,64 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Mage
|
22 |
-
* @package Mage_CatalogInventory
|
23 |
-
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Adminhtml export link
|
29 |
-
*
|
30 |
-
* @category Mage
|
31 |
-
* @package Mage_CatalogInventory
|
32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
-
*/
|
34 |
-
class Flagbit_FactFinder_Block_Adminhtml_Exportlink extends Mage_Adminhtml_Block_System_Config_Form_Field
|
35 |
-
{
|
36 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
37 |
-
{
|
38 |
-
$this->setElement($element);
|
39 |
-
$shopdomain = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
40 |
-
$activeStore = '';
|
41 |
-
$store = $this->getRequest()->getParam('store');
|
42 |
-
if(Mage::getStoreConfig('web/url/use_store'))
|
43 |
-
{
|
44 |
-
if ($store)
|
45 |
-
{
|
46 |
-
$activeStore = $store.'/';
|
47 |
-
}
|
48 |
-
else
|
49 |
-
{
|
50 |
-
$websites = Mage::app()->getWebsites();
|
51 |
-
$activeStore = $websites[1]->getDefaultStore()->getCode().'/';
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
$password = Mage::getStoreConfig('factfinder/search/auth_password', $store);
|
56 |
-
|
57 |
-
if ($store) $storeParam = '&store='.(int)Mage::getConfig()->getNode('stores/' . $store . '/system/store/id');
|
58 |
-
else $storeParam = '';
|
59 |
-
$linktext = Mage::helper('factfinder')->__('Download export');
|
60 |
-
|
61 |
-
$html = '<a href="'.$shopdomain.$activeStore.'factfinder/export/product?key='.md5($password).$storeParam.'" target="_blank">'.$linktext.'</a>';
|
62 |
-
return $html;
|
63 |
-
}
|
64 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_CatalogInventory
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Adminhtml export link
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_CatalogInventory
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Flagbit_FactFinder_Block_Adminhtml_Exportlink extends Mage_Adminhtml_Block_System_Config_Form_Field
|
35 |
+
{
|
36 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
37 |
+
{
|
38 |
+
$this->setElement($element);
|
39 |
+
$shopdomain = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
40 |
+
$activeStore = '';
|
41 |
+
$store = $this->getRequest()->getParam('store');
|
42 |
+
if(Mage::getStoreConfig('web/url/use_store'))
|
43 |
+
{
|
44 |
+
if ($store)
|
45 |
+
{
|
46 |
+
$activeStore = $store.'/';
|
47 |
+
}
|
48 |
+
else
|
49 |
+
{
|
50 |
+
$websites = Mage::app()->getWebsites();
|
51 |
+
$activeStore = $websites[1]->getDefaultStore()->getCode().'/';
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
$password = Mage::getStoreConfig('factfinder/search/auth_password', $store);
|
56 |
+
|
57 |
+
if ($store) $storeParam = '&store='.(int)Mage::getConfig()->getNode('stores/' . $store . '/system/store/id');
|
58 |
+
else $storeParam = '';
|
59 |
+
$linktext = Mage::helper('factfinder')->__('Download export');
|
60 |
+
|
61 |
+
$html = '<a href="'.$shopdomain.$activeStore.'factfinder/export/product?key='.md5($password).$storeParam.'" target="_blank">'.$linktext.'</a>';
|
62 |
+
return $html;
|
63 |
+
}
|
64 |
}
|
@@ -1,54 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Flagbit_FactFinder_Block_Adminhtml_Form_Field_Attribute extends Mage_Core_Block_Html_Select
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* Storeviews cache
|
7 |
-
*
|
8 |
-
* @var array
|
9 |
-
*/
|
10 |
-
private $_attributes;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Retrieve allowed Storeviews
|
14 |
-
*
|
15 |
-
* @param int $storeId return name by storeview id
|
16 |
-
* @return array|string
|
17 |
-
*/
|
18 |
-
protected function _getAttributes($storeId = null)
|
19 |
-
{
|
20 |
-
if (is_null($this->_attributes)) {
|
21 |
-
$this->_attributes = array();
|
22 |
-
$collection = Mage::getModel('eav/entity_attribute')->getCollection();
|
23 |
-
$collection->setEntityTypeFilter(Mage::getSingleton('eav/config')->getEntityType('catalog_product'));
|
24 |
-
foreach ($collection as $item) {
|
25 |
-
/* @var $item Mage_Core_Model_Store */
|
26 |
-
$this->_attributes[$item->getAttributeCode()] = $item->getFrontendLabel().' ('.$item->getAttributeCode().')';
|
27 |
-
}
|
28 |
-
}
|
29 |
-
if (!is_null($storeId)) {
|
30 |
-
return isset($this->_attributes[$storeId]) ? $this->_attributes[$storeId] : null;
|
31 |
-
}
|
32 |
-
return $this->_attributes;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function setInputName($value)
|
36 |
-
{
|
37 |
-
return $this->setName($value);
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Render block HTML
|
42 |
-
*
|
43 |
-
* @return string
|
44 |
-
*/
|
45 |
-
public function _toHtml()
|
46 |
-
{
|
47 |
-
if (!$this->getOptions()) {
|
48 |
-
foreach ($this->_getAttributes() as $id => $label) {
|
49 |
-
$this->addOption($id, addslashes($label));
|
50 |
-
}
|
51 |
-
}
|
52 |
-
return parent::_toHtml();
|
53 |
-
}
|
54 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Flagbit_FactFinder_Block_Adminhtml_Form_Field_Attribute extends Mage_Core_Block_Html_Select
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Storeviews cache
|
7 |
+
*
|
8 |
+
* @var array
|
9 |
+
*/
|
10 |
+
private $_attributes;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Retrieve allowed Storeviews
|
14 |
+
*
|
15 |
+
* @param int $storeId return name by storeview id
|
16 |
+
* @return array|string
|
17 |
+
*/
|
18 |
+
protected function _getAttributes($storeId = null)
|
19 |
+
{
|
20 |
+
if (is_null($this->_attributes)) {
|
21 |
+
$this->_attributes = array();
|
22 |
+
$collection = Mage::getModel('eav/entity_attribute')->getCollection();
|
23 |
+
$collection->setEntityTypeFilter(Mage::getSingleton('eav/config')->getEntityType('catalog_product'));
|
24 |
+
foreach ($collection as $item) {
|
25 |
+
/* @var $item Mage_Core_Model_Store */
|
26 |
+
$this->_attributes[$item->getAttributeCode()] = $item->getFrontendLabel().' ('.$item->getAttributeCode().')';
|
27 |
+
}
|
28 |
+
}
|
29 |
+
if (!is_null($storeId)) {
|
30 |
+
return isset($this->_attributes[$storeId]) ? $this->_attributes[$storeId] : null;
|
31 |
+
}
|
32 |
+
return $this->_attributes;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function setInputName($value)
|
36 |
+
{
|
37 |
+
return $this->setName($value);
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Render block HTML
|
42 |
+
*
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public function _toHtml()
|
46 |
+
{
|
47 |
+
if (!$this->getOptions()) {
|
48 |
+
foreach ($this->_getAttributes() as $id => $label) {
|
49 |
+
$this->addOption($id, addslashes($label));
|
50 |
+
}
|
51 |
+
}
|
52 |
+
return parent::_toHtml();
|
53 |
+
}
|
54 |
+
}
|
@@ -1,85 +1,85 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Mage
|
22 |
-
* @package Mage_CatalogInventory
|
23 |
-
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Adminhtml catalog inventory "Minimum Qty Allowed in Shopping Cart" field
|
29 |
-
*
|
30 |
-
* @category Mage
|
31 |
-
* @package Mage_CatalogInventory
|
32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
-
*/
|
34 |
-
class Flagbit_FactFinder_Block_Adminhtml_Form_Field_Attributes extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
35 |
-
{
|
36 |
-
/**
|
37 |
-
* @var Flagbit_ContentFromUrl_Block_Adminhtml_Form_Field_Storeview
|
38 |
-
*/
|
39 |
-
protected $_attributeRenderer;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Retrieve group column renderer
|
43 |
-
*
|
44 |
-
* @return Flagbit_ContentFromUrl_Block_Adminhtml_Form_Field_Storeview
|
45 |
-
*/
|
46 |
-
protected function _getAttributeRenderer()
|
47 |
-
{
|
48 |
-
if (!$this->_attributeRenderer) {
|
49 |
-
$this->_attributeRenderer = $this->getLayout()->createBlock(
|
50 |
-
'factfinder/adminhtml_form_field_attribute', '',
|
51 |
-
array('is_render_to_js_template' => true)
|
52 |
-
);
|
53 |
-
$this->_attributeRenderer->setClass('attribute_select');
|
54 |
-
$this->_attributeRenderer->setExtraParams('style="width:200px"');
|
55 |
-
}
|
56 |
-
return $this->_attributeRenderer;
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Prepare to render
|
61 |
-
*/
|
62 |
-
protected function _prepareToRender()
|
63 |
-
{
|
64 |
-
$this->addColumn('attribute', array(
|
65 |
-
'label' => Mage::helper('factfinder')->__('Attribute'),
|
66 |
-
'renderer' => $this->_getAttributeRenderer(),
|
67 |
-
));
|
68 |
-
|
69 |
-
$this->_addAfter = false;
|
70 |
-
$this->_addButtonLabel = Mage::helper('factfinder')->__('Add Attribute');
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Prepare existing row data object
|
75 |
-
*
|
76 |
-
* @param Varien_Object
|
77 |
-
*/
|
78 |
-
protected function _prepareArrayRow(Varien_Object $row)
|
79 |
-
{
|
80 |
-
$row->setData(
|
81 |
-
'option_extra_attr_' . $this->_getAttributeRenderer()->calcOptionHash($row->getData('attribute')),
|
82 |
-
'selected="selected"'
|
83 |
-
);
|
84 |
-
}
|
85 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_CatalogInventory
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Adminhtml catalog inventory "Minimum Qty Allowed in Shopping Cart" field
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_CatalogInventory
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Flagbit_FactFinder_Block_Adminhtml_Form_Field_Attributes extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
35 |
+
{
|
36 |
+
/**
|
37 |
+
* @var Flagbit_ContentFromUrl_Block_Adminhtml_Form_Field_Storeview
|
38 |
+
*/
|
39 |
+
protected $_attributeRenderer;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Retrieve group column renderer
|
43 |
+
*
|
44 |
+
* @return Flagbit_ContentFromUrl_Block_Adminhtml_Form_Field_Storeview
|
45 |
+
*/
|
46 |
+
protected function _getAttributeRenderer()
|
47 |
+
{
|
48 |
+
if (!$this->_attributeRenderer) {
|
49 |
+
$this->_attributeRenderer = $this->getLayout()->createBlock(
|
50 |
+
'factfinder/adminhtml_form_field_attribute', '',
|
51 |
+
array('is_render_to_js_template' => true)
|
52 |
+
);
|
53 |
+
$this->_attributeRenderer->setClass('attribute_select');
|
54 |
+
$this->_attributeRenderer->setExtraParams('style="width:200px"');
|
55 |
+
}
|
56 |
+
return $this->_attributeRenderer;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Prepare to render
|
61 |
+
*/
|
62 |
+
protected function _prepareToRender()
|
63 |
+
{
|
64 |
+
$this->addColumn('attribute', array(
|
65 |
+
'label' => Mage::helper('factfinder')->__('Attribute'),
|
66 |
+
'renderer' => $this->_getAttributeRenderer(),
|
67 |
+
));
|
68 |
+
|
69 |
+
$this->_addAfter = false;
|
70 |
+
$this->_addButtonLabel = Mage::helper('factfinder')->__('Add Attribute');
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Prepare existing row data object
|
75 |
+
*
|
76 |
+
* @param Varien_Object
|
77 |
+
*/
|
78 |
+
protected function _prepareArrayRow(Varien_Object $row)
|
79 |
+
{
|
80 |
+
$row->setData(
|
81 |
+
'option_extra_attr_' . $this->_getAttributeRenderer()->calcOptionHash($row->getData('attribute')),
|
82 |
+
'selected="selected"'
|
83 |
+
);
|
84 |
+
}
|
85 |
+
}
|
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Flagbit_FactFinder_Block_Campaign_Advisory extends Mage_Core_Block_Template
|
4 |
-
{
|
5 |
-
protected $_searchHandler;
|
6 |
-
|
7 |
-
protected function _prepareLayout()
|
8 |
-
{
|
9 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
10 |
-
$this->_searchHandler = Mage::getSingleton('factfinder/handler_search');
|
11 |
-
}
|
12 |
-
}
|
13 |
-
|
14 |
-
/**
|
15 |
-
* get Campaign Text
|
16 |
-
*
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public function getActiveQuestions()
|
20 |
-
{
|
21 |
-
$questions = array();
|
22 |
-
|
23 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
24 |
-
$_campaigns = $this->_searchHandler->getCampaigns();
|
25 |
-
if($_campaigns && $_campaigns->hasActiveQuestions()){
|
26 |
-
$questions = $_campaigns->getActiveQuestions();
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
return $questions;
|
31 |
-
}
|
32 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Flagbit_FactFinder_Block_Campaign_Advisory extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
protected $_searchHandler;
|
6 |
+
|
7 |
+
protected function _prepareLayout()
|
8 |
+
{
|
9 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
10 |
+
$this->_searchHandler = Mage::getSingleton('factfinder/handler_search');
|
11 |
+
}
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* get Campaign Text
|
16 |
+
*
|
17 |
+
* @return string
|
18 |
+
*/
|
19 |
+
public function getActiveQuestions()
|
20 |
+
{
|
21 |
+
$questions = array();
|
22 |
+
|
23 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
24 |
+
$_campaigns = $this->_searchHandler->getCampaigns();
|
25 |
+
if($_campaigns && $_campaigns->hasActiveQuestions()){
|
26 |
+
$questions = $_campaigns->getActiveQuestions();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
return $questions;
|
31 |
+
}
|
32 |
}
|
@@ -1,63 +1,63 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Provides advisory hints to the product view page
|
12 |
-
*
|
13 |
-
* @category Mage
|
14 |
-
* @package Flagbit_FactFinder
|
15 |
-
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
-
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
-
* @version $Id$
|
18 |
-
*/
|
19 |
-
class Flagbit_FactFinder_Block_Campaign_Cart_Advisory extends Mage_Core_Block_Template
|
20 |
-
{
|
21 |
-
protected $_product;
|
22 |
-
protected $_productCampaignHandler;
|
23 |
-
|
24 |
-
protected function _prepareLayout()
|
25 |
-
{
|
26 |
-
$this->_product = Mage::getModel('catalog/product')->load(Mage::getSingleton('checkout/session')->getLastAddedProductId());
|
27 |
-
|
28 |
-
if($this->canCampaignBeDisplayed()){
|
29 |
-
$productIds = array(
|
30 |
-
$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
31 |
-
);
|
32 |
-
|
33 |
-
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_shoppingCartCampaign', array($productIds, true));
|
34 |
-
}
|
35 |
-
return parent::_prepareLayout();
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* get campaign questions and answers
|
40 |
-
*
|
41 |
-
* @return array $questions
|
42 |
-
*/
|
43 |
-
public function getActiveQuestions()
|
44 |
-
{
|
45 |
-
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
46 |
-
|
47 |
-
$questions = array();
|
48 |
-
|
49 |
-
if ($this->canCampaignBeDisplayed()) {
|
50 |
-
$questions = $this->_productCampaignHandler->getActiveAdvisorQuestions();
|
51 |
-
}
|
52 |
-
|
53 |
-
return $questions;
|
54 |
-
}
|
55 |
-
|
56 |
-
protected function canCampaignBeDisplayed()
|
57 |
-
{
|
58 |
-
return
|
59 |
-
Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') &&
|
60 |
-
Mage::getSingleton('checkout/session')->getLastAddedProductId() &&
|
61 |
-
$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName());
|
62 |
-
}
|
63 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Provides advisory hints to the product view page
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Flagbit_FactFinder
|
15 |
+
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
+
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
+
* @version $Id$
|
18 |
+
*/
|
19 |
+
class Flagbit_FactFinder_Block_Campaign_Cart_Advisory extends Mage_Core_Block_Template
|
20 |
+
{
|
21 |
+
protected $_product;
|
22 |
+
protected $_productCampaignHandler;
|
23 |
+
|
24 |
+
protected function _prepareLayout()
|
25 |
+
{
|
26 |
+
$this->_product = Mage::getModel('catalog/product')->load(Mage::getSingleton('checkout/session')->getLastAddedProductId());
|
27 |
+
|
28 |
+
if($this->canCampaignBeDisplayed()){
|
29 |
+
$productIds = array(
|
30 |
+
$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
31 |
+
);
|
32 |
+
|
33 |
+
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_shoppingCartCampaign', array($productIds, true));
|
34 |
+
}
|
35 |
+
return parent::_prepareLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* get campaign questions and answers
|
40 |
+
*
|
41 |
+
* @return array $questions
|
42 |
+
*/
|
43 |
+
public function getActiveQuestions()
|
44 |
+
{
|
45 |
+
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
46 |
+
|
47 |
+
$questions = array();
|
48 |
+
|
49 |
+
if ($this->canCampaignBeDisplayed()) {
|
50 |
+
$questions = $this->_productCampaignHandler->getActiveAdvisorQuestions();
|
51 |
+
}
|
52 |
+
|
53 |
+
return $questions;
|
54 |
+
}
|
55 |
+
|
56 |
+
protected function canCampaignBeDisplayed()
|
57 |
+
{
|
58 |
+
return
|
59 |
+
Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') &&
|
60 |
+
Mage::getSingleton('checkout/session')->getLastAddedProductId() &&
|
61 |
+
$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName());
|
62 |
+
}
|
63 |
}
|
@@ -1,67 +1,67 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Provides advisory hints to the product view page
|
12 |
-
*
|
13 |
-
* @category Mage
|
14 |
-
* @package Flagbit_FactFinder
|
15 |
-
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
-
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
-
* @version $Id$
|
18 |
-
*/
|
19 |
-
class Flagbit_FactFinder_Block_Campaign_Cart_Feedback extends Mage_Core_Block_Template
|
20 |
-
{
|
21 |
-
protected $_product;
|
22 |
-
protected $_productCampaignHandler;
|
23 |
-
|
24 |
-
protected function _prepareLayout()
|
25 |
-
{
|
26 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
27 |
-
$this->_product = Mage::getModel('catalog/product')->load(Mage::getSingleton('checkout/session')->getLastAddedProductId());
|
28 |
-
|
29 |
-
$productIds = array(
|
30 |
-
$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
31 |
-
);
|
32 |
-
|
33 |
-
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_shoppingCartCampaign', array($productIds, true));
|
34 |
-
}
|
35 |
-
return parent::_prepareLayout();
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* get campaign questions and answers
|
40 |
-
*
|
41 |
-
* @return array $feedback
|
42 |
-
*/
|
43 |
-
public function getActiveFeedback()
|
44 |
-
{
|
45 |
-
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
46 |
-
|
47 |
-
// only display campaign if they are activated and right after a new product was added to cart
|
48 |
-
if (!Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') || !Mage::getSingleton('checkout/session')->getLastAddedProductId()) {
|
49 |
-
return array();
|
50 |
-
}
|
51 |
-
|
52 |
-
$feedback = array();
|
53 |
-
|
54 |
-
if (!$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName())) {
|
55 |
-
return array();
|
56 |
-
}
|
57 |
-
|
58 |
-
$_campaigns = $this->_productCampaignHandler->getCampaigns();
|
59 |
-
|
60 |
-
if($_campaigns && $_campaigns->hasFeedback()){
|
61 |
-
$feedback = $_campaigns;
|
62 |
-
}
|
63 |
-
|
64 |
-
return $feedback;
|
65 |
-
|
66 |
-
}
|
67 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Provides advisory hints to the product view page
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Flagbit_FactFinder
|
15 |
+
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
+
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
+
* @version $Id$
|
18 |
+
*/
|
19 |
+
class Flagbit_FactFinder_Block_Campaign_Cart_Feedback extends Mage_Core_Block_Template
|
20 |
+
{
|
21 |
+
protected $_product;
|
22 |
+
protected $_productCampaignHandler;
|
23 |
+
|
24 |
+
protected function _prepareLayout()
|
25 |
+
{
|
26 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
27 |
+
$this->_product = Mage::getModel('catalog/product')->load(Mage::getSingleton('checkout/session')->getLastAddedProductId());
|
28 |
+
|
29 |
+
$productIds = array(
|
30 |
+
$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
31 |
+
);
|
32 |
+
|
33 |
+
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_shoppingCartCampaign', array($productIds, true));
|
34 |
+
}
|
35 |
+
return parent::_prepareLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* get campaign questions and answers
|
40 |
+
*
|
41 |
+
* @return array $feedback
|
42 |
+
*/
|
43 |
+
public function getActiveFeedback()
|
44 |
+
{
|
45 |
+
Mage::getSingleton('core/session', array('name'=>'frontend'));
|
46 |
+
|
47 |
+
// only display campaign if they are activated and right after a new product was added to cart
|
48 |
+
if (!Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') || !Mage::getSingleton('checkout/session')->getLastAddedProductId()) {
|
49 |
+
return array();
|
50 |
+
}
|
51 |
+
|
52 |
+
$feedback = array();
|
53 |
+
|
54 |
+
if (!$this->_product->getData(Mage::helper('factfinder/search')->getIdFieldName())) {
|
55 |
+
return array();
|
56 |
+
}
|
57 |
+
|
58 |
+
$_campaigns = $this->_productCampaignHandler->getCampaigns();
|
59 |
+
|
60 |
+
if($_campaigns && $_campaigns->hasFeedback()){
|
61 |
+
$feedback = $_campaigns;
|
62 |
+
}
|
63 |
+
|
64 |
+
return $feedback;
|
65 |
+
|
66 |
+
}
|
67 |
}
|
@@ -1,71 +1,71 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* This class is used to disable Magento´s default Price and Category Filter Output
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id: Scic.php 645 2011-03-17 14:54:20Z weller $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_Campaign_Feedback extends Mage_Core_Block_Template
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Pushed Products Collection
|
25 |
-
*
|
26 |
-
* @var Flagbit_FactFinder_Model_Mysql4_Campaign_Pushedproducts_Collection
|
27 |
-
*/
|
28 |
-
protected $_pushedProductsCollection = null;
|
29 |
-
|
30 |
-
protected $_searchHandler;
|
31 |
-
|
32 |
-
protected function _prepareLayout()
|
33 |
-
{
|
34 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
35 |
-
$this->_searchHandler = Mage::getSingleton('factfinder/handler_search');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* get Campaign Text
|
41 |
-
*
|
42 |
-
* @return string
|
43 |
-
*/
|
44 |
-
public function getText()
|
45 |
-
{
|
46 |
-
$text = '';
|
47 |
-
|
48 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
49 |
-
$_campaigns = $this->_searchHandler->getCampaigns();
|
50 |
-
if($_campaigns && $_campaigns->hasFeedback() && $this->getTextNumber()){
|
51 |
-
$text = $_campaigns->getFeedback($this->getTextNumber() - 1);
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
return $text;
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Pushed Products Collection
|
60 |
-
*
|
61 |
-
* @return Flagbit_FactFinder_Model_Mysql4_Campaign_Pushedproducts_Collection
|
62 |
-
*/
|
63 |
-
public function getPushedProductsCollection()
|
64 |
-
{
|
65 |
-
if($this->_pushedProductsCollection === null){
|
66 |
-
$this->_pushedProductsCollection = Mage::getResourceModel('factfinder/campaign_pushedproducts_collection');
|
67 |
-
}
|
68 |
-
|
69 |
-
return $this->_pushedProductsCollection;
|
70 |
-
}
|
71 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* This class is used to disable Magento´s default Price and Category Filter Output
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id: Scic.php 645 2011-03-17 14:54:20Z weller $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_Campaign_Feedback extends Mage_Core_Block_Template
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Pushed Products Collection
|
25 |
+
*
|
26 |
+
* @var Flagbit_FactFinder_Model_Mysql4_Campaign_Pushedproducts_Collection
|
27 |
+
*/
|
28 |
+
protected $_pushedProductsCollection = null;
|
29 |
+
|
30 |
+
protected $_searchHandler;
|
31 |
+
|
32 |
+
protected function _prepareLayout()
|
33 |
+
{
|
34 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
35 |
+
$this->_searchHandler = Mage::getSingleton('factfinder/handler_search');
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* get Campaign Text
|
41 |
+
*
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function getText()
|
45 |
+
{
|
46 |
+
$text = '';
|
47 |
+
|
48 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
49 |
+
$_campaigns = $this->_searchHandler->getCampaigns();
|
50 |
+
if($_campaigns && $_campaigns->hasFeedback() && $this->getTextNumber()){
|
51 |
+
$text = $_campaigns->getFeedback($this->getTextNumber() - 1);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return $text;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Pushed Products Collection
|
60 |
+
*
|
61 |
+
* @return Flagbit_FactFinder_Model_Mysql4_Campaign_Pushedproducts_Collection
|
62 |
+
*/
|
63 |
+
public function getPushedProductsCollection()
|
64 |
+
{
|
65 |
+
if($this->_pushedProductsCollection === null){
|
66 |
+
$this->_pushedProductsCollection = Mage::getResourceModel('factfinder/campaign_pushedproducts_collection');
|
67 |
+
}
|
68 |
+
|
69 |
+
return $this->_pushedProductsCollection;
|
70 |
+
}
|
71 |
}
|
@@ -1,54 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Provides advisory hints to the product view page
|
12 |
-
*
|
13 |
-
* @category Mage
|
14 |
-
* @package Flagbit_FactFinder
|
15 |
-
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
-
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
-
* @version $Id$
|
18 |
-
*/
|
19 |
-
class Flagbit_FactFinder_Block_Campaign_Product_Advisory extends Mage_Core_Block_Template
|
20 |
-
{
|
21 |
-
protected $_productCampaignHandler;
|
22 |
-
|
23 |
-
protected function _prepareLayout()
|
24 |
-
{
|
25 |
-
$productIds = array(
|
26 |
-
Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
27 |
-
);
|
28 |
-
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
|
29 |
-
return parent::_prepareLayout();
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* get campaign questions and answers
|
34 |
-
*
|
35 |
-
* @return array $questions
|
36 |
-
*/
|
37 |
-
public function getActiveQuestions()
|
38 |
-
{
|
39 |
-
$questions = array();
|
40 |
-
|
41 |
-
if ($this->canCampaignBeDisplay()) {
|
42 |
-
$questions = $this->_productCampaignHandler->getActiveAdvisorQuestions();
|
43 |
-
}
|
44 |
-
|
45 |
-
return $questions;
|
46 |
-
}
|
47 |
-
|
48 |
-
protected function canCampaignBeDisplay()
|
49 |
-
{
|
50 |
-
return
|
51 |
-
Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') &&
|
52 |
-
Mage::registry('current_product');
|
53 |
-
}
|
54 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Provides advisory hints to the product view page
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Flagbit_FactFinder
|
15 |
+
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
+
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
+
* @version $Id$
|
18 |
+
*/
|
19 |
+
class Flagbit_FactFinder_Block_Campaign_Product_Advisory extends Mage_Core_Block_Template
|
20 |
+
{
|
21 |
+
protected $_productCampaignHandler;
|
22 |
+
|
23 |
+
protected function _prepareLayout()
|
24 |
+
{
|
25 |
+
$productIds = array(
|
26 |
+
Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
27 |
+
);
|
28 |
+
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
|
29 |
+
return parent::_prepareLayout();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* get campaign questions and answers
|
34 |
+
*
|
35 |
+
* @return array $questions
|
36 |
+
*/
|
37 |
+
public function getActiveQuestions()
|
38 |
+
{
|
39 |
+
$questions = array();
|
40 |
+
|
41 |
+
if ($this->canCampaignBeDisplay()) {
|
42 |
+
$questions = $this->_productCampaignHandler->getActiveAdvisorQuestions();
|
43 |
+
}
|
44 |
+
|
45 |
+
return $questions;
|
46 |
+
}
|
47 |
+
|
48 |
+
protected function canCampaignBeDisplay()
|
49 |
+
{
|
50 |
+
return
|
51 |
+
Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') &&
|
52 |
+
Mage::registry('current_product');
|
53 |
+
}
|
54 |
}
|
@@ -1,51 +1,51 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Provides advisory hints to the product view page
|
12 |
-
*
|
13 |
-
* @category Mage
|
14 |
-
* @package Flagbit_FactFinder
|
15 |
-
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
-
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
-
* @version $Id$
|
18 |
-
*/
|
19 |
-
class Flagbit_FactFinder_Block_Campaign_Product_Feedback extends Mage_Core_Block_Template
|
20 |
-
{
|
21 |
-
protected $_productCampaignHandler;
|
22 |
-
|
23 |
-
protected function _prepareLayout()
|
24 |
-
{
|
25 |
-
$productIds = array(
|
26 |
-
Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
27 |
-
);
|
28 |
-
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
|
29 |
-
return parent::_prepareLayout();
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* get campaign feedback
|
34 |
-
*
|
35 |
-
* @return array $feedback
|
36 |
-
*/
|
37 |
-
public function getActiveFeedback()
|
38 |
-
{
|
39 |
-
$feedback = array();
|
40 |
-
|
41 |
-
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') && Mage::registry('current_product')) {
|
42 |
-
$_campaigns = $this->_productCampaignHandler->getCampaigns();
|
43 |
-
|
44 |
-
if($_campaigns && $_campaigns->hasFeedback()){
|
45 |
-
$feedback = $_campaigns;
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
return $feedback;
|
50 |
-
}
|
51 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Provides advisory hints to the product view page
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Flagbit_FactFinder
|
15 |
+
* @copyright Copyright (c) 2012 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
+
* @author Mike Becker <mike.becker@flagbit.de>
|
17 |
+
* @version $Id$
|
18 |
+
*/
|
19 |
+
class Flagbit_FactFinder_Block_Campaign_Product_Feedback extends Mage_Core_Block_Template
|
20 |
+
{
|
21 |
+
protected $_productCampaignHandler;
|
22 |
+
|
23 |
+
protected function _prepareLayout()
|
24 |
+
{
|
25 |
+
$productIds = array(
|
26 |
+
Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
27 |
+
);
|
28 |
+
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
|
29 |
+
return parent::_prepareLayout();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* get campaign feedback
|
34 |
+
*
|
35 |
+
* @return array $feedback
|
36 |
+
*/
|
37 |
+
public function getActiveFeedback()
|
38 |
+
{
|
39 |
+
$feedback = array();
|
40 |
+
|
41 |
+
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign') && Mage::registry('current_product')) {
|
42 |
+
$_campaigns = $this->_productCampaignHandler->getCampaigns();
|
43 |
+
|
44 |
+
if($_campaigns && $_campaigns->hasFeedback()){
|
45 |
+
$feedback = $_campaigns;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
return $feedback;
|
50 |
+
}
|
51 |
}
|
@@ -1,92 +1,92 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Overwritten block.
|
12 |
-
*
|
13 |
-
* Replaces the crosssell block within cart view. Gets data from FACT-Finder instead of product link collection.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Crosssell
|
22 |
-
{
|
23 |
-
protected $_recommendationsHandler;
|
24 |
-
|
25 |
-
protected function _prepareLayout()
|
26 |
-
{
|
27 |
-
if(Mage::getStoreConfigFlag('factfinder/activation/crosssell')){
|
28 |
-
$productIds = $this->_getCartProductIds();
|
29 |
-
$this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
|
30 |
-
}
|
31 |
-
return parent::_prepareLayout();
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Overwritten function. Gets information from FACT-Finder Collection instead of product link collection.
|
36 |
-
*/
|
37 |
-
public function getItems()
|
38 |
-
{
|
39 |
-
if (!Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
40 |
-
return parent::getItems();
|
41 |
-
}
|
42 |
-
|
43 |
-
$items = $this->getData('items');
|
44 |
-
if (is_null($items)) {
|
45 |
-
$items = array();
|
46 |
-
$ninProductIds = $this->_getCartProductIds();
|
47 |
-
if ($ninProductIds) {
|
48 |
-
$collection = $this->_getCollection()
|
49 |
-
->setRecommendations($this->_recommendationsHandler->getRecommendations());
|
50 |
-
if (!empty($ninProductIds)) {
|
51 |
-
// Before FF 6.7 only one product id will be considered.
|
52 |
-
// In that case (only) it could happen that another product in the cart is among the
|
53 |
-
// recommendations.
|
54 |
-
// TODO: This filter does not seem to work.
|
55 |
-
$collection->addExcludeProductFilter($ninProductIds);
|
56 |
-
}
|
57 |
-
|
58 |
-
foreach ($collection as $item) {
|
59 |
-
$items[] = $item;
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
$this->setData('items', $items);
|
64 |
-
}
|
65 |
-
return $items;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Get crosssell products collection. Get it from product recommendation collection for communication with FACT-Finder.
|
70 |
-
*
|
71 |
-
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Link_Product_Collection
|
72 |
-
*/
|
73 |
-
protected function _getCollection()
|
74 |
-
{
|
75 |
-
if (!Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
76 |
-
return parent::_getCollection();
|
77 |
-
}
|
78 |
-
|
79 |
-
$collection = Mage::getResourceModel('factfinder/product_recommendation_collection')
|
80 |
-
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
81 |
-
->setStoreId(Mage::app()->getStore()->getId())
|
82 |
-
->addStoreFilter()
|
83 |
-
->setPageSize($this->_maxItemCount);
|
84 |
-
$this->_addProductAttributesAndPrices($collection);
|
85 |
-
|
86 |
-
Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($collection);
|
87 |
-
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
|
88 |
-
Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection);
|
89 |
-
|
90 |
-
return $collection;
|
91 |
-
}
|
92 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Overwritten block.
|
12 |
+
*
|
13 |
+
* Replaces the crosssell block within cart view. Gets data from FACT-Finder instead of product link collection.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Crosssell
|
22 |
+
{
|
23 |
+
protected $_recommendationsHandler;
|
24 |
+
|
25 |
+
protected function _prepareLayout()
|
26 |
+
{
|
27 |
+
if(Mage::getStoreConfigFlag('factfinder/activation/crosssell')){
|
28 |
+
$productIds = $this->_getCartProductIds();
|
29 |
+
$this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
|
30 |
+
}
|
31 |
+
return parent::_prepareLayout();
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Overwritten function. Gets information from FACT-Finder Collection instead of product link collection.
|
36 |
+
*/
|
37 |
+
public function getItems()
|
38 |
+
{
|
39 |
+
if (!Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
40 |
+
return parent::getItems();
|
41 |
+
}
|
42 |
+
|
43 |
+
$items = $this->getData('items');
|
44 |
+
if (is_null($items)) {
|
45 |
+
$items = array();
|
46 |
+
$ninProductIds = $this->_getCartProductIds();
|
47 |
+
if ($ninProductIds) {
|
48 |
+
$collection = $this->_getCollection()
|
49 |
+
->setRecommendations($this->_recommendationsHandler->getRecommendations());
|
50 |
+
if (!empty($ninProductIds)) {
|
51 |
+
// Before FF 6.7 only one product id will be considered.
|
52 |
+
// In that case (only) it could happen that another product in the cart is among the
|
53 |
+
// recommendations.
|
54 |
+
// TODO: This filter does not seem to work.
|
55 |
+
$collection->addExcludeProductFilter($ninProductIds);
|
56 |
+
}
|
57 |
+
|
58 |
+
foreach ($collection as $item) {
|
59 |
+
$items[] = $item;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
$this->setData('items', $items);
|
64 |
+
}
|
65 |
+
return $items;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get crosssell products collection. Get it from product recommendation collection for communication with FACT-Finder.
|
70 |
+
*
|
71 |
+
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Link_Product_Collection
|
72 |
+
*/
|
73 |
+
protected function _getCollection()
|
74 |
+
{
|
75 |
+
if (!Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
76 |
+
return parent::_getCollection();
|
77 |
+
}
|
78 |
+
|
79 |
+
$collection = Mage::getResourceModel('factfinder/product_recommendation_collection')
|
80 |
+
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
81 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
82 |
+
->addStoreFilter()
|
83 |
+
->setPageSize($this->_maxItemCount);
|
84 |
+
$this->_addProductAttributesAndPrices($collection);
|
85 |
+
|
86 |
+
Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($collection);
|
87 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
|
88 |
+
Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection);
|
89 |
+
|
90 |
+
return $collection;
|
91 |
+
}
|
92 |
}
|
@@ -1,36 +1,36 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* Add Slider Javascript to HTML Head
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_Filter_Slider extends Mage_Core_Block_Abstract {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* get Slider Javascript
|
25 |
-
*
|
26 |
-
* @return string
|
27 |
-
*/
|
28 |
-
protected function _toHtml()
|
29 |
-
{
|
30 |
-
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
31 |
-
return '<script type="text/javascript" language="javascript" src="http://static.express.fact-finder.com/onetouchslider-1.0/de.factfinder.asn.slider.OneTouchSlider.nocache.js"></script>'."\n".
|
32 |
-
'<script type="text/javascript" language="javascript"> oneTouchSliderOnLoad = function(){ document.fire("ffslider:init");}</script>'."\n";
|
33 |
-
|
34 |
-
}
|
35 |
-
}
|
36 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* Add Slider Javascript to HTML Head
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_Filter_Slider extends Mage_Core_Block_Abstract {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* get Slider Javascript
|
25 |
+
*
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
protected function _toHtml()
|
29 |
+
{
|
30 |
+
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
31 |
+
return '<script type="text/javascript" language="javascript" src="http://static.express.fact-finder.com/onetouchslider-1.0/de.factfinder.asn.slider.OneTouchSlider.nocache.js"></script>'."\n".
|
32 |
+
'<script type="text/javascript" language="javascript"> oneTouchSliderOnLoad = function(){ document.fire("ffslider:init");}</script>'."\n";
|
33 |
+
|
34 |
+
}
|
35 |
+
}
|
36 |
}
|
@@ -1,154 +1,154 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* This class is used to disable Magento´s default Price and Category Filter Output
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_Layer extends Flagbit_FactFinder_Block_Layer_Abstract
|
22 |
-
{
|
23 |
-
protected $_searchHandler;
|
24 |
-
|
25 |
-
protected $_usesAsn = false;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Prepare child blocks
|
29 |
-
*
|
30 |
-
* @return Mage_Catalog_Block_Layer_View
|
31 |
-
*/
|
32 |
-
protected function _prepareLayout()
|
33 |
-
{
|
34 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
35 |
-
return parent::_prepareLayout();
|
36 |
-
}
|
37 |
-
|
38 |
-
$this->_searchHandler = Mage::getSingleton('factfinder/handler_search');
|
39 |
-
$this->_usesAsn = Mage::helper('factfinder/search')->getIsEnabled(false, 'asn');
|
40 |
-
|
41 |
-
// Make this block globally known so that initializeAfterSearchNavigation can be called on this instance
|
42 |
-
// when the controller_action_layout_generate_blocks_after event is fired
|
43 |
-
Mage::register(Flagbit_FactFinder_Model_Observer::_asnBlockRegistryKey, $this, true);
|
44 |
-
|
45 |
-
// Same for handling campaign redirects
|
46 |
-
Mage::register(Flagbit_FactFinder_Model_Observer::_campaignRedirectRegistryKey, $this, true);
|
47 |
-
|
48 |
-
return Mage_Core_Block_Template::_prepareLayout();
|
49 |
-
}
|
50 |
-
|
51 |
-
public function handleCampaignRedirect()
|
52 |
-
{
|
53 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
54 |
-
// handle redirects
|
55 |
-
$redirect = $this->_searchHandler->getRedirect();
|
56 |
-
if($redirect){
|
57 |
-
$response = Mage::app()->getResponse();
|
58 |
-
$response->setRedirect($redirect);
|
59 |
-
$response->sendResponse();
|
60 |
-
exit;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
public function initializeAfterSearchNavigation()
|
66 |
-
{
|
67 |
-
if(!$this->_usesAsn)
|
68 |
-
return;
|
69 |
-
|
70 |
-
// set default sort Order
|
71 |
-
if(Mage::getSingleton('catalog/session')->getSortOrder()){
|
72 |
-
Mage::getSingleton('catalog/session')->setSortOrder('relevance');
|
73 |
-
}
|
74 |
-
|
75 |
-
$stateBlock = $this->getLayout()->createBlock('catalog/layer_state')
|
76 |
-
->setLayer($this->getLayer());
|
77 |
-
|
78 |
-
$this->setChild('layer_state', $stateBlock);
|
79 |
-
|
80 |
-
$filterableAttributes = $this->_getFilterableAttributes();
|
81 |
-
foreach ($filterableAttributes as $attribute) {
|
82 |
-
$filterBlockName = $this->_getAttributeFilterBlockName();
|
83 |
-
|
84 |
-
$filterBlock = $this->getLayout()->createBlock($filterBlockName)
|
85 |
-
->setLayer($this->getLayer())
|
86 |
-
->setAttributeModel($attribute)
|
87 |
-
->init();
|
88 |
-
|
89 |
-
switch($attribute->getType()){
|
90 |
-
|
91 |
-
case 'slider':
|
92 |
-
if(!($this->getLayout()->getBlock('ffslider') instanceof Flagbit_FactFinder_Block_Filter_Slider)){
|
93 |
-
$this->getLayout()->getBlock('head')->setChild('ffslider', $this->getLayout()->createBlock('factfinder/filter_slider'));
|
94 |
-
}
|
95 |
-
$filterBlock->setTemplate('factfinder/filter/slider.phtml');
|
96 |
-
$filterBlock->setData((current($attribute->getItems())));
|
97 |
-
$filterBlock->setUnit($attribute->getUnit());
|
98 |
-
break;
|
99 |
-
}
|
100 |
-
|
101 |
-
$this->setChild($attribute->getAttributeCode().'_filter', $filterBlock);
|
102 |
-
}
|
103 |
-
|
104 |
-
$this->getLayer()->apply();
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Get category filter block
|
109 |
-
*
|
110 |
-
* @return Mage_Catalog_Block_Layer_Filter_Category
|
111 |
-
*/
|
112 |
-
protected function _getCategoryFilter()
|
113 |
-
{
|
114 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
115 |
-
return parent::_getCategoryFilter();
|
116 |
-
}
|
117 |
-
return false;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Retrieve Price Filter block
|
122 |
-
*
|
123 |
-
* @return Mage_Catalog_Block_Layer_Filter_Price
|
124 |
-
*/
|
125 |
-
protected function _getPriceFilter()
|
126 |
-
{
|
127 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
128 |
-
return parent::_getPriceFilter();
|
129 |
-
}
|
130 |
-
|
131 |
-
return false;
|
132 |
-
}
|
133 |
-
|
134 |
-
/**
|
135 |
-
* Check availability display layer block
|
136 |
-
*
|
137 |
-
* @return bool
|
138 |
-
*/
|
139 |
-
public function canShowBlock()
|
140 |
-
{
|
141 |
-
if (!Mage::helper('factfinder/search')->getIsEnabled(false)
|
142 |
-
|| (!Mage::helper('factfinder/search')->getIsOnSearchPage() && !Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')) ){
|
143 |
-
return parent::canShowBlock();
|
144 |
-
}
|
145 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
146 |
-
return false;
|
147 |
-
}
|
148 |
-
if ($this->getLayer()->getFilterableAttributes()->count()
|
149 |
-
&& $this->getLayer()->getProductCollection()->getSize()) {
|
150 |
-
return true;
|
151 |
-
}
|
152 |
-
return false;
|
153 |
-
}
|
154 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* This class is used to disable Magento´s default Price and Category Filter Output
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_Layer extends Flagbit_FactFinder_Block_Layer_Abstract
|
22 |
+
{
|
23 |
+
protected $_searchHandler;
|
24 |
+
|
25 |
+
protected $_usesAsn = false;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Prepare child blocks
|
29 |
+
*
|
30 |
+
* @return Mage_Catalog_Block_Layer_View
|
31 |
+
*/
|
32 |
+
protected function _prepareLayout()
|
33 |
+
{
|
34 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
35 |
+
return parent::_prepareLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
$this->_searchHandler = Mage::getSingleton('factfinder/handler_search');
|
39 |
+
$this->_usesAsn = Mage::helper('factfinder/search')->getIsEnabled(false, 'asn');
|
40 |
+
|
41 |
+
// Make this block globally known so that initializeAfterSearchNavigation can be called on this instance
|
42 |
+
// when the controller_action_layout_generate_blocks_after event is fired
|
43 |
+
Mage::register(Flagbit_FactFinder_Model_Observer::_asnBlockRegistryKey, $this, true);
|
44 |
+
|
45 |
+
// Same for handling campaign redirects
|
46 |
+
Mage::register(Flagbit_FactFinder_Model_Observer::_campaignRedirectRegistryKey, $this, true);
|
47 |
+
|
48 |
+
return Mage_Core_Block_Template::_prepareLayout();
|
49 |
+
}
|
50 |
+
|
51 |
+
public function handleCampaignRedirect()
|
52 |
+
{
|
53 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
54 |
+
// handle redirects
|
55 |
+
$redirect = $this->_searchHandler->getRedirect();
|
56 |
+
if($redirect){
|
57 |
+
$response = Mage::app()->getResponse();
|
58 |
+
$response->setRedirect($redirect);
|
59 |
+
$response->sendResponse();
|
60 |
+
exit;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
public function initializeAfterSearchNavigation()
|
66 |
+
{
|
67 |
+
if(!$this->_usesAsn)
|
68 |
+
return;
|
69 |
+
|
70 |
+
// set default sort Order
|
71 |
+
if(Mage::getSingleton('catalog/session')->getSortOrder()){
|
72 |
+
Mage::getSingleton('catalog/session')->setSortOrder('relevance');
|
73 |
+
}
|
74 |
+
|
75 |
+
$stateBlock = $this->getLayout()->createBlock('catalog/layer_state')
|
76 |
+
->setLayer($this->getLayer());
|
77 |
+
|
78 |
+
$this->setChild('layer_state', $stateBlock);
|
79 |
+
|
80 |
+
$filterableAttributes = $this->_getFilterableAttributes();
|
81 |
+
foreach ($filterableAttributes as $attribute) {
|
82 |
+
$filterBlockName = $this->_getAttributeFilterBlockName();
|
83 |
+
|
84 |
+
$filterBlock = $this->getLayout()->createBlock($filterBlockName)
|
85 |
+
->setLayer($this->getLayer())
|
86 |
+
->setAttributeModel($attribute)
|
87 |
+
->init();
|
88 |
+
|
89 |
+
switch($attribute->getType()){
|
90 |
+
|
91 |
+
case 'slider':
|
92 |
+
if(!($this->getLayout()->getBlock('ffslider') instanceof Flagbit_FactFinder_Block_Filter_Slider)){
|
93 |
+
$this->getLayout()->getBlock('head')->setChild('ffslider', $this->getLayout()->createBlock('factfinder/filter_slider'));
|
94 |
+
}
|
95 |
+
$filterBlock->setTemplate('factfinder/filter/slider.phtml');
|
96 |
+
$filterBlock->setData((current($attribute->getItems())));
|
97 |
+
$filterBlock->setUnit($attribute->getUnit());
|
98 |
+
break;
|
99 |
+
}
|
100 |
+
|
101 |
+
$this->setChild($attribute->getAttributeCode().'_filter', $filterBlock);
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->getLayer()->apply();
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Get category filter block
|
109 |
+
*
|
110 |
+
* @return Mage_Catalog_Block_Layer_Filter_Category
|
111 |
+
*/
|
112 |
+
protected function _getCategoryFilter()
|
113 |
+
{
|
114 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
115 |
+
return parent::_getCategoryFilter();
|
116 |
+
}
|
117 |
+
return false;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Retrieve Price Filter block
|
122 |
+
*
|
123 |
+
* @return Mage_Catalog_Block_Layer_Filter_Price
|
124 |
+
*/
|
125 |
+
protected function _getPriceFilter()
|
126 |
+
{
|
127 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
128 |
+
return parent::_getPriceFilter();
|
129 |
+
}
|
130 |
+
|
131 |
+
return false;
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Check availability display layer block
|
136 |
+
*
|
137 |
+
* @return bool
|
138 |
+
*/
|
139 |
+
public function canShowBlock()
|
140 |
+
{
|
141 |
+
if (!Mage::helper('factfinder/search')->getIsEnabled(false)
|
142 |
+
|| (!Mage::helper('factfinder/search')->getIsOnSearchPage() && !Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')) ){
|
143 |
+
return parent::canShowBlock();
|
144 |
+
}
|
145 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
if ($this->getLayer()->getFilterableAttributes()->count()
|
149 |
+
&& $this->getLayer()->getProductCollection()->getSize()) {
|
150 |
+
return true;
|
151 |
+
}
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
}
|
@@ -1,33 +1,33 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* dynamicaly extends the core class whether Enterprise Search is enabled or not
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
|
22 |
-
if(Mage::helper('factfinder/search')->getIsOnSearchPage()){
|
23 |
-
if(Mage::helper('factfinder')->isModuleActive('Enterprise_Search')){
|
24 |
-
class Flagbit_FactFinder_Block_Layer_Abstract extends Enterprise_Search_Block_Catalogsearch_Layer {}
|
25 |
-
}else{
|
26 |
-
class Flagbit_FactFinder_Block_Layer_Abstract extends Mage_CatalogSearch_Block_Layer {}
|
27 |
-
}
|
28 |
-
}else{
|
29 |
-
class Flagbit_FactFinder_Block_Layer_Abstract extends Mage_Catalog_Block_Layer_View {}
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* dynamicaly extends the core class whether Enterprise Search is enabled or not
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
|
22 |
+
if(Mage::helper('factfinder/search')->getIsOnSearchPage()){
|
23 |
+
if(Mage::helper('factfinder')->isModuleActive('Enterprise_Search')){
|
24 |
+
class Flagbit_FactFinder_Block_Layer_Abstract extends Enterprise_Search_Block_Catalogsearch_Layer {}
|
25 |
+
}else{
|
26 |
+
class Flagbit_FactFinder_Block_Layer_Abstract extends Mage_CatalogSearch_Block_Layer {}
|
27 |
+
}
|
28 |
+
}else{
|
29 |
+
class Flagbit_FactFinder_Block_Layer_Abstract extends Mage_Catalog_Block_Layer_View {}
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
|
@@ -1,74 +1,74 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Overwritten block.
|
12 |
-
*
|
13 |
-
* Replaces the crosssell block. Gets data from FACT-Finder instead of product link collection.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_Product_List_Crosssell extends Mage_Catalog_Block_Product_List_Crosssell
|
22 |
-
{
|
23 |
-
protected $_recommendationsHandler;
|
24 |
-
|
25 |
-
protected function _prepareLayout()
|
26 |
-
{
|
27 |
-
if (Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
28 |
-
$productIds = array(
|
29 |
-
Mage::registry('product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
30 |
-
);
|
31 |
-
$this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
|
32 |
-
}
|
33 |
-
return parent::_prepareLayout();
|
34 |
-
}
|
35 |
-
/**
|
36 |
-
* Method overwritten. Data is not read from product link collection but from FACT-Finder interface instead.
|
37 |
-
*/
|
38 |
-
protected function _prepareData()
|
39 |
-
{
|
40 |
-
|
41 |
-
if (!Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
42 |
-
return parent::_prepareData();
|
43 |
-
}
|
44 |
-
try {
|
45 |
-
$product = Mage::registry('product');
|
46 |
-
/* @var $product Mage_Catalog_Model_Product */
|
47 |
-
|
48 |
-
$searchHelper = Mage::helper('factfinder/search');
|
49 |
-
$idFieldName = $searchHelper->getIdFieldName();
|
50 |
-
|
51 |
-
$this->_itemCollection = Mage::getResourceModel('factfinder/product_recommendation_collection')
|
52 |
-
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
53 |
-
->addStoreFilter();
|
54 |
-
|
55 |
-
$recommendations = $this->_recommendationsHandler->getRecommendations();
|
56 |
-
|
57 |
-
$this->_itemCollection->setRecommendations($recommendations);
|
58 |
-
|
59 |
-
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
|
60 |
-
|
61 |
-
$this->_itemCollection->load();
|
62 |
-
|
63 |
-
foreach ($this->_itemCollection as $product) {
|
64 |
-
$product->setDoNotUseCategoryId(true);
|
65 |
-
}
|
66 |
-
}
|
67 |
-
catch (Exception $e) {
|
68 |
-
Mage::logException($e);
|
69 |
-
$this->_itemCollection = new Varien_Data_Collection();
|
70 |
-
}
|
71 |
-
|
72 |
-
return $this;
|
73 |
-
}
|
74 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Overwritten block.
|
12 |
+
*
|
13 |
+
* Replaces the crosssell block. Gets data from FACT-Finder instead of product link collection.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_Product_List_Crosssell extends Mage_Catalog_Block_Product_List_Crosssell
|
22 |
+
{
|
23 |
+
protected $_recommendationsHandler;
|
24 |
+
|
25 |
+
protected function _prepareLayout()
|
26 |
+
{
|
27 |
+
if (Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
28 |
+
$productIds = array(
|
29 |
+
Mage::registry('product')->getData(Mage::helper('factfinder/search')->getIdFieldName())
|
30 |
+
);
|
31 |
+
$this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
|
32 |
+
}
|
33 |
+
return parent::_prepareLayout();
|
34 |
+
}
|
35 |
+
/**
|
36 |
+
* Method overwritten. Data is not read from product link collection but from FACT-Finder interface instead.
|
37 |
+
*/
|
38 |
+
protected function _prepareData()
|
39 |
+
{
|
40 |
+
|
41 |
+
if (!Mage::getStoreConfigFlag('factfinder/activation/crosssell')) {
|
42 |
+
return parent::_prepareData();
|
43 |
+
}
|
44 |
+
try {
|
45 |
+
$product = Mage::registry('product');
|
46 |
+
/* @var $product Mage_Catalog_Model_Product */
|
47 |
+
|
48 |
+
$searchHelper = Mage::helper('factfinder/search');
|
49 |
+
$idFieldName = $searchHelper->getIdFieldName();
|
50 |
+
|
51 |
+
$this->_itemCollection = Mage::getResourceModel('factfinder/product_recommendation_collection')
|
52 |
+
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
53 |
+
->addStoreFilter();
|
54 |
+
|
55 |
+
$recommendations = $this->_recommendationsHandler->getRecommendations();
|
56 |
+
|
57 |
+
$this->_itemCollection->setRecommendations($recommendations);
|
58 |
+
|
59 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
|
60 |
+
|
61 |
+
$this->_itemCollection->load();
|
62 |
+
|
63 |
+
foreach ($this->_itemCollection as $product) {
|
64 |
+
$product->setDoNotUseCategoryId(true);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
catch (Exception $e) {
|
68 |
+
Mage::logException($e);
|
69 |
+
$this->_itemCollection = new Varien_Data_Collection();
|
70 |
+
}
|
71 |
+
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
}
|
@@ -1,142 +1,142 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class for upselling
|
12 |
-
*
|
13 |
-
* Rewritten block - data is now caught by FACT-Finder, passed to normal collection, works quite as if it was the
|
14 |
-
* default behavior.
|
15 |
-
*
|
16 |
-
* @category Mage
|
17 |
-
* @package Flagbit_FactFinder
|
18 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
-
* @author Michael Türk <türk@flagbit.de>
|
20 |
-
* @version $Id: Search.php 678 2011-08-01 13:02:50Z rudolf_batt $
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Product_List_Upsell
|
23 |
-
{
|
24 |
-
protected $_productCampaignHandler;
|
25 |
-
protected $_recommendationsHandler;
|
26 |
-
|
27 |
-
protected function _prepareLayout()
|
28 |
-
{
|
29 |
-
$productIds = array();
|
30 |
-
|
31 |
-
if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product){
|
32 |
-
$productIds[] = Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName());
|
33 |
-
}
|
34 |
-
|
35 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')) {
|
36 |
-
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
|
37 |
-
}
|
38 |
-
|
39 |
-
if (Mage::getStoreConfigFlag('factfinder/activation/upsell')) {
|
40 |
-
$this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
|
41 |
-
}
|
42 |
-
|
43 |
-
return parent::_prepareLayout();
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Method overwritten. Data is not read from product link collection but from FACT-Finder interface instead.
|
48 |
-
*/
|
49 |
-
protected function _prepareData()
|
50 |
-
{
|
51 |
-
$pushedProducts = array();
|
52 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')) {
|
53 |
-
$pushedProducts = $this->getPushedProducts();
|
54 |
-
}
|
55 |
-
|
56 |
-
$recommendations = array();
|
57 |
-
if (Mage::getStoreConfigFlag('factfinder/activation/upsell')) {
|
58 |
-
$recommendations = $this->_recommendationsHandler->getRecommendations();
|
59 |
-
}
|
60 |
-
|
61 |
-
// if there are no recommendations or pushed products, use default magento upselling
|
62 |
-
if (empty($recommendations) && empty($pushedProducts)){
|
63 |
-
return parent::_prepareData();
|
64 |
-
} else {
|
65 |
-
// combine recommendations and pushed products
|
66 |
-
$mergedUpsell = array_merge($pushedProducts, (array) $recommendations);
|
67 |
-
$this->applyUpsells($mergedUpsell);
|
68 |
-
}
|
69 |
-
|
70 |
-
return $this;
|
71 |
-
}
|
72 |
-
|
73 |
-
protected function applyUpsells(array $upsells)
|
74 |
-
{
|
75 |
-
try {
|
76 |
-
$product = Mage::registry('product');
|
77 |
-
/* @var $product Mage_Catalog_Model_Product */
|
78 |
-
|
79 |
-
// build new FACTFinder_Result with combined data
|
80 |
-
$recommendations = FF::getInstance('result', $upsells, count($upsells));
|
81 |
-
|
82 |
-
if ($recommendations == null) {
|
83 |
-
throw new Exception('No recommendations given - check connection to FACT-Finder and FACT-Finder configuration');
|
84 |
-
}
|
85 |
-
elseif ($recommendations->getFoundRecordsCount() == 0) {
|
86 |
-
$this->_itemCollection = new Varien_Data_Collection();
|
87 |
-
return $this;
|
88 |
-
}
|
89 |
-
|
90 |
-
$this->_itemCollection = Mage::getResourceModel('factfinder/product_recommendation_collection')->addStoreFilter();
|
91 |
-
|
92 |
-
if ($this->getItemLimit('upsell') > 0) {
|
93 |
-
$this->_itemCollection->setPageSize($this->getItemLimit('upsell'));
|
94 |
-
}
|
95 |
-
$this->_itemCollection->setRecommendations($recommendations);
|
96 |
-
|
97 |
-
Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter($this->_itemCollection,
|
98 |
-
Mage::getSingleton('checkout/session')->getQuoteId()
|
99 |
-
);
|
100 |
-
$this->_addProductAttributesAndPrices($this->_itemCollection);
|
101 |
-
|
102 |
-
// // Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_itemCollection);
|
103 |
-
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
|
104 |
-
$this->_itemCollection->load();
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Updating collection with desired items
|
108 |
-
*/
|
109 |
-
Mage::dispatchEvent('catalog_product_upsell', array(
|
110 |
-
'product' => $product,
|
111 |
-
'collection' => $this->_itemCollection,
|
112 |
-
'limit' => $this->getItemLimit()
|
113 |
-
));
|
114 |
-
|
115 |
-
foreach ($this->_itemCollection as $product) {
|
116 |
-
$product->setDoNotUseCategoryId(true);
|
117 |
-
}
|
118 |
-
} catch (Exception $e) {
|
119 |
-
Mage::logException($e);
|
120 |
-
$this->_itemCollection = new Varien_Data_Collection();
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* get pushed products to combine with recommendations
|
126 |
-
*
|
127 |
-
* @return array
|
128 |
-
*/
|
129 |
-
protected function getPushedProducts()
|
130 |
-
{
|
131 |
-
$pushedProducts = array();
|
132 |
-
|
133 |
-
$_campaigns = $this->_productCampaignHandler->getCampaigns();
|
134 |
-
|
135 |
-
if($_campaigns && $_campaigns->hasPushedProducts()){
|
136 |
-
$pushedProducts = $_campaigns->getPushedProducts();
|
137 |
-
}
|
138 |
-
|
139 |
-
return $pushedProducts;
|
140 |
-
}
|
141 |
-
|
142 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class for upselling
|
12 |
+
*
|
13 |
+
* Rewritten block - data is now caught by FACT-Finder, passed to normal collection, works quite as if it was the
|
14 |
+
* default behavior.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Flagbit_FactFinder
|
18 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
+
* @author Michael Türk <türk@flagbit.de>
|
20 |
+
* @version $Id: Search.php 678 2011-08-01 13:02:50Z rudolf_batt $
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_Block_Product_List_Upsell extends Mage_Catalog_Block_Product_List_Upsell
|
23 |
+
{
|
24 |
+
protected $_productCampaignHandler;
|
25 |
+
protected $_recommendationsHandler;
|
26 |
+
|
27 |
+
protected function _prepareLayout()
|
28 |
+
{
|
29 |
+
$productIds = array();
|
30 |
+
|
31 |
+
if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product){
|
32 |
+
$productIds[] = Mage::registry('current_product')->getData(Mage::helper('factfinder/search')->getIdFieldName());
|
33 |
+
}
|
34 |
+
|
35 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')) {
|
36 |
+
$this->_productCampaignHandler = Mage::getSingleton('factfinder/handler_productDetailCampaign', $productIds);
|
37 |
+
}
|
38 |
+
|
39 |
+
if (Mage::getStoreConfigFlag('factfinder/activation/upsell')) {
|
40 |
+
$this->_recommendationsHandler = Mage::getSingleton('factfinder/handler_recommendations', $productIds);
|
41 |
+
}
|
42 |
+
|
43 |
+
return parent::_prepareLayout();
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Method overwritten. Data is not read from product link collection but from FACT-Finder interface instead.
|
48 |
+
*/
|
49 |
+
protected function _prepareData()
|
50 |
+
{
|
51 |
+
$pushedProducts = array();
|
52 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')) {
|
53 |
+
$pushedProducts = $this->getPushedProducts();
|
54 |
+
}
|
55 |
+
|
56 |
+
$recommendations = array();
|
57 |
+
if (Mage::getStoreConfigFlag('factfinder/activation/upsell')) {
|
58 |
+
$recommendations = $this->_recommendationsHandler->getRecommendations();
|
59 |
+
}
|
60 |
+
|
61 |
+
// if there are no recommendations or pushed products, use default magento upselling
|
62 |
+
if (empty($recommendations) && empty($pushedProducts)){
|
63 |
+
return parent::_prepareData();
|
64 |
+
} else {
|
65 |
+
// combine recommendations and pushed products
|
66 |
+
$mergedUpsell = array_merge($pushedProducts, (array) $recommendations);
|
67 |
+
$this->applyUpsells($mergedUpsell);
|
68 |
+
}
|
69 |
+
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
protected function applyUpsells(array $upsells)
|
74 |
+
{
|
75 |
+
try {
|
76 |
+
$product = Mage::registry('product');
|
77 |
+
/* @var $product Mage_Catalog_Model_Product */
|
78 |
+
|
79 |
+
// build new FACTFinder_Result with combined data
|
80 |
+
$recommendations = FF::getInstance('result', $upsells, count($upsells));
|
81 |
+
|
82 |
+
if ($recommendations == null) {
|
83 |
+
throw new Exception('No recommendations given - check connection to FACT-Finder and FACT-Finder configuration');
|
84 |
+
}
|
85 |
+
elseif ($recommendations->getFoundRecordsCount() == 0) {
|
86 |
+
$this->_itemCollection = new Varien_Data_Collection();
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
$this->_itemCollection = Mage::getResourceModel('factfinder/product_recommendation_collection')->addStoreFilter();
|
91 |
+
|
92 |
+
if ($this->getItemLimit('upsell') > 0) {
|
93 |
+
$this->_itemCollection->setPageSize($this->getItemLimit('upsell'));
|
94 |
+
}
|
95 |
+
$this->_itemCollection->setRecommendations($recommendations);
|
96 |
+
|
97 |
+
Mage::getResourceSingleton('checkout/cart')->addExcludeProductFilter($this->_itemCollection,
|
98 |
+
Mage::getSingleton('checkout/session')->getQuoteId()
|
99 |
+
);
|
100 |
+
$this->_addProductAttributesAndPrices($this->_itemCollection);
|
101 |
+
|
102 |
+
// // Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_itemCollection);
|
103 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($this->_itemCollection);
|
104 |
+
$this->_itemCollection->load();
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Updating collection with desired items
|
108 |
+
*/
|
109 |
+
Mage::dispatchEvent('catalog_product_upsell', array(
|
110 |
+
'product' => $product,
|
111 |
+
'collection' => $this->_itemCollection,
|
112 |
+
'limit' => $this->getItemLimit()
|
113 |
+
));
|
114 |
+
|
115 |
+
foreach ($this->_itemCollection as $product) {
|
116 |
+
$product->setDoNotUseCategoryId(true);
|
117 |
+
}
|
118 |
+
} catch (Exception $e) {
|
119 |
+
Mage::logException($e);
|
120 |
+
$this->_itemCollection = new Varien_Data_Collection();
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* get pushed products to combine with recommendations
|
126 |
+
*
|
127 |
+
* @return array
|
128 |
+
*/
|
129 |
+
protected function getPushedProducts()
|
130 |
+
{
|
131 |
+
$pushedProducts = array();
|
132 |
+
|
133 |
+
$_campaigns = $this->_productCampaignHandler->getCampaigns();
|
134 |
+
|
135 |
+
if($_campaigns && $_campaigns->hasPushedProducts()){
|
136 |
+
$pushedProducts = $_campaigns->getPushedProducts();
|
137 |
+
}
|
138 |
+
|
139 |
+
return $pushedProducts;
|
140 |
+
}
|
141 |
+
|
142 |
}
|
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
class Flagbit_FactFinder_Block_Secondaryresult extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
protected $_searchHandler;
|
5 |
-
|
6 |
-
protected function _prepareLayout()
|
7 |
-
{
|
8 |
-
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
9 |
-
$this->_searchHandler = Mage::getSingleton('factfinder/handler_secondarySearch');
|
10 |
-
}
|
11 |
-
}
|
12 |
-
|
13 |
-
protected function getSecondaryResult($channel)
|
14 |
-
{
|
15 |
-
$result = array();
|
16 |
-
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
17 |
-
$result = $this->_searchHandler->getSecondarySearchResult($channel);
|
18 |
-
}
|
19 |
-
|
20 |
-
return $result;
|
21 |
-
}
|
22 |
-
|
23 |
-
protected function getSecondarySearchAdapter($channel)
|
24 |
-
{
|
25 |
-
$adapter = null;
|
26 |
-
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
27 |
-
$adapter = $this->_searchHandler->getSecondarySearchAdapter($channel);
|
28 |
-
}
|
29 |
-
return $adapter;
|
30 |
-
}
|
31 |
}
|
1 |
+
<?php
|
2 |
+
class Flagbit_FactFinder_Block_Secondaryresult extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
protected $_searchHandler;
|
5 |
+
|
6 |
+
protected function _prepareLayout()
|
7 |
+
{
|
8 |
+
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
9 |
+
$this->_searchHandler = Mage::getSingleton('factfinder/handler_secondarySearch');
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
protected function getSecondaryResult($channel)
|
14 |
+
{
|
15 |
+
$result = array();
|
16 |
+
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
17 |
+
$result = $this->_searchHandler->getSecondarySearchResult($channel);
|
18 |
+
}
|
19 |
+
|
20 |
+
return $result;
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function getSecondarySearchAdapter($channel)
|
24 |
+
{
|
25 |
+
$adapter = null;
|
26 |
+
if(Mage::helper('factfinder/search')->getIsEnabled()){
|
27 |
+
$adapter = $this->_searchHandler->getSecondarySearchAdapter($channel);
|
28 |
+
}
|
29 |
+
return $adapter;
|
30 |
+
}
|
31 |
}
|
@@ -1,54 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
class Flagbit_FactFinder_Block_TagCloud extends Mage_CatalogSearch_Block_Term
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* @var Flagbit_FactFinder_Model_Handler_TagCloud
|
6 |
-
*/
|
7 |
-
protected $_tagCloudHandler;
|
8 |
-
|
9 |
-
protected function _prepareLayout()
|
10 |
-
{
|
11 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'tagcloud')){
|
12 |
-
$this->_tagCloudHandler = Mage::getSingleton('factfinder/handler_tagCloud');
|
13 |
-
}
|
14 |
-
return parent::_prepareLayout();
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @return Flagbit_FactFinder_Block_TagCloud|Mage_CatalogSearch_Block_Term
|
19 |
-
*/
|
20 |
-
protected function _loadTerms()
|
21 |
-
{
|
22 |
-
if (!Mage::helper('factfinder/search')->getIsEnabled(false, 'tagcloud')) {
|
23 |
-
return parent::_loadTerms();
|
24 |
-
}
|
25 |
-
|
26 |
-
if (empty($this->_terms)) {
|
27 |
-
$this->_terms = $this->_tagCloudHandler->getTerms();
|
28 |
-
|
29 |
-
if (count($this->_terms) == 0)
|
30 |
-
return $this;
|
31 |
-
|
32 |
-
$this->determineMinMaxPopularity();
|
33 |
-
}
|
34 |
-
|
35 |
-
return $this;
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Determines minimum and maximum popularity among terms
|
40 |
-
*/
|
41 |
-
protected function determineMinMaxPopularity()
|
42 |
-
{
|
43 |
-
$this->_maxPopularity = 0;
|
44 |
-
$this->_minPopularity = 1;
|
45 |
-
|
46 |
-
foreach ($this->_terms as $term) {
|
47 |
-
if ($term->getPopularity() > $this->_maxPopularity)
|
48 |
-
$this->_maxPopularity = $term->getPopularity();
|
49 |
-
|
50 |
-
if ($term->getPopularity() < $this->_minPopularity)
|
51 |
-
$this->_minPopularity = $term->getPopularity();
|
52 |
-
}
|
53 |
-
}
|
54 |
}
|
1 |
+
<?php
|
2 |
+
class Flagbit_FactFinder_Block_TagCloud extends Mage_CatalogSearch_Block_Term
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* @var Flagbit_FactFinder_Model_Handler_TagCloud
|
6 |
+
*/
|
7 |
+
protected $_tagCloudHandler;
|
8 |
+
|
9 |
+
protected function _prepareLayout()
|
10 |
+
{
|
11 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'tagcloud')){
|
12 |
+
$this->_tagCloudHandler = Mage::getSingleton('factfinder/handler_tagCloud');
|
13 |
+
}
|
14 |
+
return parent::_prepareLayout();
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @return Flagbit_FactFinder_Block_TagCloud|Mage_CatalogSearch_Block_Term
|
19 |
+
*/
|
20 |
+
protected function _loadTerms()
|
21 |
+
{
|
22 |
+
if (!Mage::helper('factfinder/search')->getIsEnabled(false, 'tagcloud')) {
|
23 |
+
return parent::_loadTerms();
|
24 |
+
}
|
25 |
+
|
26 |
+
if (empty($this->_terms)) {
|
27 |
+
$this->_terms = $this->_tagCloudHandler->getTerms();
|
28 |
+
|
29 |
+
if (count($this->_terms) == 0)
|
30 |
+
return $this;
|
31 |
+
|
32 |
+
$this->determineMinMaxPopularity();
|
33 |
+
}
|
34 |
+
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Determines minimum and maximum popularity among terms
|
40 |
+
*/
|
41 |
+
protected function determineMinMaxPopularity()
|
42 |
+
{
|
43 |
+
$this->_maxPopularity = 0;
|
44 |
+
$this->_minPopularity = 1;
|
45 |
+
|
46 |
+
foreach ($this->_terms as $term) {
|
47 |
+
if ($term->getPopularity() > $this->_maxPopularity)
|
48 |
+
$this->_maxPopularity = $term->getPopularity();
|
49 |
+
|
50 |
+
if ($term->getPopularity() < $this->_minPopularity)
|
51 |
+
$this->_minPopularity = $term->getPopularity();
|
52 |
+
}
|
53 |
+
}
|
54 |
}
|
@@ -1,108 +1,108 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Tracking block class
|
12 |
-
*
|
13 |
-
* @category Mage
|
14 |
-
* @package Flagbit_FactFinder
|
15 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
-
* @author Joerg Weller <joerg.weller@flagbit.de>
|
17 |
-
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
18 |
-
* @version $Id$
|
19 |
-
*/
|
20 |
-
class Flagbit_FactFinder_Block_Tracking extends Mage_Core_Block_Template
|
21 |
-
{
|
22 |
-
|
23 |
-
/**
|
24 |
-
* get Product Result Collection
|
25 |
-
*
|
26 |
-
* @return Flagbit_FactFinder_Model_Mysql4_Search_Collection
|
27 |
-
*/
|
28 |
-
protected function _getProductResultCollection()
|
29 |
-
{
|
30 |
-
return Mage::getSingleton('factfinder/layer')->getProductCollection();
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* get Product URL to ID Mapping JSON Object
|
35 |
-
*
|
36 |
-
* @return string
|
37 |
-
*/
|
38 |
-
public function getJsonUrlToIdMappingObject()
|
39 |
-
{
|
40 |
-
$data = array();
|
41 |
-
foreach($this->_getProductResultCollection() as $product){
|
42 |
-
$data[$product->getProductUrl()] = $product->getId();
|
43 |
-
}
|
44 |
-
return Mage::helper('core')->jsonEncode($data);
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* get Product and Search Details by ID as JSON Object
|
49 |
-
*
|
50 |
-
* @return string
|
51 |
-
*/
|
52 |
-
public function getJsonDataObject()
|
53 |
-
{
|
54 |
-
$searchHelper = Mage::helper('factfinder/search');
|
55 |
-
$idFieldName = $searchHelper->getIdFieldName();
|
56 |
-
|
57 |
-
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
58 |
-
if ($customerId) {
|
59 |
-
$customerId = md5('customer_' . $customerId);
|
60 |
-
}
|
61 |
-
|
62 |
-
if(Mage::helper('factfinder')->useOldTracking())
|
63 |
-
{
|
64 |
-
$dataTemplate = array(
|
65 |
-
'query' => $searchHelper->getQuery()->getQueryText(),
|
66 |
-
'page' => $searchHelper->getCurrentPage(),
|
67 |
-
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
68 |
-
'pageSize' => $searchHelper->getPageLimit(),
|
69 |
-
'origPageSize' => $searchHelper->getDefaultPerPageValue(),
|
70 |
-
'channel' => Mage::getStoreConfig('factfinder/search/channel'),
|
71 |
-
'userId' => $customerId,
|
72 |
-
'event' => 'click'
|
73 |
-
);
|
74 |
-
} else {
|
75 |
-
$dataTemplate = array(
|
76 |
-
'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey(),
|
77 |
-
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
78 |
-
'uid' => $customerId,
|
79 |
-
'site' => Mage::app()->getStore()->getCode(),
|
80 |
-
'event' => FACTFinder_Default_TrackingAdapter::EVENT_INSPECT
|
81 |
-
);
|
82 |
-
}
|
83 |
-
|
84 |
-
$data = array();
|
85 |
-
foreach($this->_getProductResultCollection() as $product){
|
86 |
-
$key = $product->getId();
|
87 |
-
|
88 |
-
$data[$key] = array(
|
89 |
-
'id' => $product->getData($idFieldName),
|
90 |
-
);
|
91 |
-
|
92 |
-
if(Mage::helper('factfinder')->useOldTracking())
|
93 |
-
{
|
94 |
-
$data[$key] += array(
|
95 |
-
'pos' => $product->getPosition(),
|
96 |
-
'origPos' => $product->getOriginalPosition(),
|
97 |
-
'title' => $product->getName(),
|
98 |
-
'simi' => $product->getSimilarity()
|
99 |
-
);
|
100 |
-
}
|
101 |
-
|
102 |
-
$data[$key] += $dataTemplate;
|
103 |
-
}
|
104 |
-
|
105 |
-
return Mage::helper('core')->jsonEncode($data);
|
106 |
-
}
|
107 |
-
|
108 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Tracking block class
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Flagbit_FactFinder
|
15 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
+
* @author Joerg Weller <joerg.weller@flagbit.de>
|
17 |
+
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
18 |
+
* @version $Id$
|
19 |
+
*/
|
20 |
+
class Flagbit_FactFinder_Block_Tracking extends Mage_Core_Block_Template
|
21 |
+
{
|
22 |
+
|
23 |
+
/**
|
24 |
+
* get Product Result Collection
|
25 |
+
*
|
26 |
+
* @return Flagbit_FactFinder_Model_Mysql4_Search_Collection
|
27 |
+
*/
|
28 |
+
protected function _getProductResultCollection()
|
29 |
+
{
|
30 |
+
return Mage::getSingleton('factfinder/layer')->getProductCollection();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* get Product URL to ID Mapping JSON Object
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function getJsonUrlToIdMappingObject()
|
39 |
+
{
|
40 |
+
$data = array();
|
41 |
+
foreach($this->_getProductResultCollection() as $product){
|
42 |
+
$data[$product->getProductUrl()] = $product->getId();
|
43 |
+
}
|
44 |
+
return Mage::helper('core')->jsonEncode($data);
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* get Product and Search Details by ID as JSON Object
|
49 |
+
*
|
50 |
+
* @return string
|
51 |
+
*/
|
52 |
+
public function getJsonDataObject()
|
53 |
+
{
|
54 |
+
$searchHelper = Mage::helper('factfinder/search');
|
55 |
+
$idFieldName = $searchHelper->getIdFieldName();
|
56 |
+
|
57 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
58 |
+
if ($customerId) {
|
59 |
+
$customerId = md5('customer_' . $customerId);
|
60 |
+
}
|
61 |
+
|
62 |
+
if(Mage::helper('factfinder')->useOldTracking())
|
63 |
+
{
|
64 |
+
$dataTemplate = array(
|
65 |
+
'query' => $searchHelper->getQuery()->getQueryText(),
|
66 |
+
'page' => $searchHelper->getCurrentPage(),
|
67 |
+
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
68 |
+
'pageSize' => $searchHelper->getPageLimit(),
|
69 |
+
'origPageSize' => $searchHelper->getDefaultPerPageValue(),
|
70 |
+
'channel' => Mage::getStoreConfig('factfinder/search/channel'),
|
71 |
+
'userId' => $customerId,
|
72 |
+
'event' => 'click'
|
73 |
+
);
|
74 |
+
} else {
|
75 |
+
$dataTemplate = array(
|
76 |
+
'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey(),
|
77 |
+
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
78 |
+
'uid' => $customerId,
|
79 |
+
'site' => Mage::app()->getStore()->getCode(),
|
80 |
+
'event' => FACTFinder_Default_TrackingAdapter::EVENT_INSPECT
|
81 |
+
);
|
82 |
+
}
|
83 |
+
|
84 |
+
$data = array();
|
85 |
+
foreach($this->_getProductResultCollection() as $product){
|
86 |
+
$key = $product->getId();
|
87 |
+
|
88 |
+
$data[$key] = array(
|
89 |
+
'id' => $product->getData($idFieldName),
|
90 |
+
);
|
91 |
+
|
92 |
+
if(Mage::helper('factfinder')->useOldTracking())
|
93 |
+
{
|
94 |
+
$data[$key] += array(
|
95 |
+
'pos' => $product->getPosition(),
|
96 |
+
'origPos' => $product->getOriginalPosition(),
|
97 |
+
'title' => $product->getName(),
|
98 |
+
'simi' => $product->getSimilarity()
|
99 |
+
);
|
100 |
+
}
|
101 |
+
|
102 |
+
$data[$key] += $dataTemplate;
|
103 |
+
}
|
104 |
+
|
105 |
+
return Mage::helper('core')->jsonEncode($data);
|
106 |
+
}
|
107 |
+
|
108 |
}
|
@@ -1,134 +1,134 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* This class is used to disable Magento´s default apply Filter
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlConnect_Block_Catalog_Product_List {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Retrieve product collection with all prepared data and limitations
|
25 |
-
*
|
26 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
27 |
-
*/
|
28 |
-
protected function _getProductCollection()
|
29 |
-
{
|
30 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
31 |
-
return parent::_getProductCollection();
|
32 |
-
}
|
33 |
-
|
34 |
-
if (is_null($this->_productCollection)) {
|
35 |
-
if (strpos($this->getRequest()->getActionName(), 'search') !== false) {
|
36 |
-
$this->__getSearchProductCollection();
|
37 |
-
}
|
38 |
-
else {
|
39 |
-
parent::_getProductCollection();
|
40 |
-
}
|
41 |
-
}
|
42 |
-
return $this->_productCollection;
|
43 |
-
}
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Retrieve product collection with all prepared data and limitations
|
48 |
-
*
|
49 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
50 |
-
*/
|
51 |
-
protected function __getSearchProductCollection()
|
52 |
-
{
|
53 |
-
if (is_null($this->_productCollection)) {
|
54 |
-
$filters = array();
|
55 |
-
$request = $this->getRequest();
|
56 |
-
$requestParams = $request->getParams();
|
57 |
-
$layer = $this->getLayer();
|
58 |
-
if (!$layer) {
|
59 |
-
return null;
|
60 |
-
}
|
61 |
-
$category = $this->getCategory();
|
62 |
-
if ($category && is_object($category) && $category->getId()) {
|
63 |
-
$layer->setCurrentCategory($category);
|
64 |
-
}
|
65 |
-
|
66 |
-
if (!$this->getNeedBlockApplyingFilters()) {
|
67 |
-
$attributes = $layer->getFilterableAttributes();
|
68 |
-
/**
|
69 |
-
* Apply filters
|
70 |
-
*/
|
71 |
-
foreach ($attributes as $attributeItem) {
|
72 |
-
$attributeCode = $attributeItem->getAttributeCode();
|
73 |
-
list($filterModel, $filterBlock) = $this->helper('xmlconnect')->getFilterByKey($attributeCode);
|
74 |
-
|
75 |
-
$filterModel->setLayer($layer)->setAttributeModel($attributeItem);
|
76 |
-
|
77 |
-
$filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $attributeCode;
|
78 |
-
/**
|
79 |
-
* Set new request var
|
80 |
-
*/
|
81 |
-
if (isset($requestParams[$filterParam])) {
|
82 |
-
$filterModel->setRequestVar($filterParam);
|
83 |
-
}
|
84 |
-
$filterModel->apply($request, $filterBlock);
|
85 |
-
$filters[] = $filterModel;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Separately apply and save category filter
|
90 |
-
*/
|
91 |
-
list($categoryFilter, $categoryFilterBlock) = $this->helper('xmlconnect')->getFilterByKey('category');
|
92 |
-
$filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $categoryFilter->getRequestVar();
|
93 |
-
|
94 |
-
$categoryFilter->setLayer($layer)->setRequestVar($filterParam)
|
95 |
-
->apply($this->getRequest(), $categoryFilterBlock);
|
96 |
-
$filters[] = $categoryFilter;
|
97 |
-
|
98 |
-
$this->_collectedFilters = $filters;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Products
|
103 |
-
*/
|
104 |
-
$layer = $this->getLayer();
|
105 |
-
$collection = $layer->getProductCollection();
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Add rating and review summary, image attribute, apply sort params
|
109 |
-
*/
|
110 |
-
$this->_prepareCollection($collection);
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Apply offset and count
|
114 |
-
*/
|
115 |
-
$offset = (int)$request->getParam('offset', 0);
|
116 |
-
$count = (int)$request->getParam('count', 0);
|
117 |
-
$count = $count <= 0 ? 1 : $count;
|
118 |
-
if ($offset + $count < $collection->getSize()) {
|
119 |
-
$this->setHasProductItems(1);
|
120 |
-
}
|
121 |
-
$collection->getSelect()->limit($count, $offset);
|
122 |
-
$collection->setFlag('require_stock_items', true);
|
123 |
-
|
124 |
-
$this->_productCollection = $collection;
|
125 |
-
}
|
126 |
-
return $this->_productCollection;
|
127 |
-
}
|
128 |
-
|
129 |
-
|
130 |
-
}
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* This class is used to disable Magento´s default apply Filter
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List extends Mage_XmlConnect_Block_Catalog_Product_List {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Retrieve product collection with all prepared data and limitations
|
25 |
+
*
|
26 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
27 |
+
*/
|
28 |
+
protected function _getProductCollection()
|
29 |
+
{
|
30 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
31 |
+
return parent::_getProductCollection();
|
32 |
+
}
|
33 |
+
|
34 |
+
if (is_null($this->_productCollection)) {
|
35 |
+
if (strpos($this->getRequest()->getActionName(), 'search') !== false) {
|
36 |
+
$this->__getSearchProductCollection();
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
parent::_getProductCollection();
|
40 |
+
}
|
41 |
+
}
|
42 |
+
return $this->_productCollection;
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Retrieve product collection with all prepared data and limitations
|
48 |
+
*
|
49 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
50 |
+
*/
|
51 |
+
protected function __getSearchProductCollection()
|
52 |
+
{
|
53 |
+
if (is_null($this->_productCollection)) {
|
54 |
+
$filters = array();
|
55 |
+
$request = $this->getRequest();
|
56 |
+
$requestParams = $request->getParams();
|
57 |
+
$layer = $this->getLayer();
|
58 |
+
if (!$layer) {
|
59 |
+
return null;
|
60 |
+
}
|
61 |
+
$category = $this->getCategory();
|
62 |
+
if ($category && is_object($category) && $category->getId()) {
|
63 |
+
$layer->setCurrentCategory($category);
|
64 |
+
}
|
65 |
+
|
66 |
+
if (!$this->getNeedBlockApplyingFilters()) {
|
67 |
+
$attributes = $layer->getFilterableAttributes();
|
68 |
+
/**
|
69 |
+
* Apply filters
|
70 |
+
*/
|
71 |
+
foreach ($attributes as $attributeItem) {
|
72 |
+
$attributeCode = $attributeItem->getAttributeCode();
|
73 |
+
list($filterModel, $filterBlock) = $this->helper('xmlconnect')->getFilterByKey($attributeCode);
|
74 |
+
|
75 |
+
$filterModel->setLayer($layer)->setAttributeModel($attributeItem);
|
76 |
+
|
77 |
+
$filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $attributeCode;
|
78 |
+
/**
|
79 |
+
* Set new request var
|
80 |
+
*/
|
81 |
+
if (isset($requestParams[$filterParam])) {
|
82 |
+
$filterModel->setRequestVar($filterParam);
|
83 |
+
}
|
84 |
+
$filterModel->apply($request, $filterBlock);
|
85 |
+
$filters[] = $filterModel;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Separately apply and save category filter
|
90 |
+
*/
|
91 |
+
list($categoryFilter, $categoryFilterBlock) = $this->helper('xmlconnect')->getFilterByKey('category');
|
92 |
+
$filterParam = parent::REQUEST_FILTER_PARAM_REFIX . $categoryFilter->getRequestVar();
|
93 |
+
|
94 |
+
$categoryFilter->setLayer($layer)->setRequestVar($filterParam)
|
95 |
+
->apply($this->getRequest(), $categoryFilterBlock);
|
96 |
+
$filters[] = $categoryFilter;
|
97 |
+
|
98 |
+
$this->_collectedFilters = $filters;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Products
|
103 |
+
*/
|
104 |
+
$layer = $this->getLayer();
|
105 |
+
$collection = $layer->getProductCollection();
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Add rating and review summary, image attribute, apply sort params
|
109 |
+
*/
|
110 |
+
$this->_prepareCollection($collection);
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Apply offset and count
|
114 |
+
*/
|
115 |
+
$offset = (int)$request->getParam('offset', 0);
|
116 |
+
$count = (int)$request->getParam('count', 0);
|
117 |
+
$count = $count <= 0 ? 1 : $count;
|
118 |
+
if ($offset + $count < $collection->getSize()) {
|
119 |
+
$this->setHasProductItems(1);
|
120 |
+
}
|
121 |
+
$collection->getSelect()->limit($count, $offset);
|
122 |
+
$collection->setFlag('require_stock_items', true);
|
123 |
+
|
124 |
+
$this->_productCollection = $collection;
|
125 |
+
}
|
126 |
+
return $this->_productCollection;
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
|
134 |
+
|
@@ -1,133 +1,133 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* This class is used provide FAC-Finder filters
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect_Block_Catalog_Search {
|
22 |
-
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Search results xml renderer
|
26 |
-
* XML also contains filters that can be apply (accorfingly already applyed filters and search query)
|
27 |
-
* and sort fields
|
28 |
-
*
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
protected function _toHtml()
|
32 |
-
{
|
33 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
34 |
-
return parent::_toHtml();
|
35 |
-
}
|
36 |
-
|
37 |
-
$searchXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<search></search>');
|
38 |
-
$filtersXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<filters></filters>');
|
39 |
-
|
40 |
-
$helper = Mage::helper('catalogsearch');
|
41 |
-
if (method_exists($helper, 'getEngine')) {
|
42 |
-
$engine = Mage::helper('catalogsearch')->getEngine();
|
43 |
-
$isLayeredNavigationAllowed = ($engine instanceof Varien_Object) ? $engine->isLeyeredNavigationAllowed() : true;
|
44 |
-
}
|
45 |
-
else {
|
46 |
-
$isLayeredNavigationAllowed = true;
|
47 |
-
}
|
48 |
-
|
49 |
-
$request = $this->getRequest();
|
50 |
-
$requestParams = $request->getParams();
|
51 |
-
$hasMoreProductItems = 0;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Products
|
55 |
-
*/
|
56 |
-
$productListBlock = $this->getChild('product_list');
|
57 |
-
$productListBlock->setNeedBlockApplyingFilters(false);
|
58 |
-
if ($productListBlock) {
|
59 |
-
$layer = Mage::getSingleton('catalogsearch/layer');
|
60 |
-
$productsXmlObj = $productListBlock->setLayer($layer)
|
61 |
-
->setNeedBlockApplyingFilters(!$isLayeredNavigationAllowed)
|
62 |
-
->getProductsXmlObject();
|
63 |
-
$searchXmlObject->appendChild($productsXmlObj);
|
64 |
-
$hasMoreProductItems = (int)$productListBlock->getHasProductItems();
|
65 |
-
}
|
66 |
-
|
67 |
-
$searchXmlObject->addAttribute('has_more_items', $hasMoreProductItems);
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Filters
|
71 |
-
*/
|
72 |
-
$showFiltersAndOrders = true;
|
73 |
-
$reguest = $this->getRequest();
|
74 |
-
foreach ($reguest->getParams() as $key => $value) {
|
75 |
-
if (0 === strpos($key, parent::REQUEST_SORT_ORDER_PARAM_REFIX) ||
|
76 |
-
0 === strpos($key, parent::REQUEST_FILTER_PARAM_REFIX)) {
|
77 |
-
$showFiltersAndOrders = false;
|
78 |
-
break;
|
79 |
-
}
|
80 |
-
}
|
81 |
-
if ($isLayeredNavigationAllowed && $productListBlock && $showFiltersAndOrders) {
|
82 |
-
$filters = $productListBlock->getCollectedFilters();
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Render filters xml
|
86 |
-
*/
|
87 |
-
foreach ($filters as $filter) {
|
88 |
-
if (!$this->_isFilterItemsHasValues($filter)) {
|
89 |
-
continue;
|
90 |
-
}
|
91 |
-
|
92 |
-
$item = $filtersXmlObject->addChild('item');
|
93 |
-
$item->addChild('name', $searchXmlObject->xmlentities($filter->getName()));
|
94 |
-
$item->addChild('code', $filter->getRequestVar());
|
95 |
-
$values = $item->addChild('values');
|
96 |
-
|
97 |
-
foreach ($filter->getItems() as $valueItem) {
|
98 |
-
$count = (int)$valueItem->getCount();
|
99 |
-
if (!$count) {
|
100 |
-
continue;
|
101 |
-
}
|
102 |
-
$value = $values->addChild('value');
|
103 |
-
$value->addChild('id', $valueItem->getValueString());
|
104 |
-
$value->addChild('label', $searchXmlObject->xmlentities(strip_tags($valueItem->getLabel())));
|
105 |
-
$value->addChild('count', $count);
|
106 |
-
}
|
107 |
-
}
|
108 |
-
$searchXmlObject->appendChild($filtersXmlObject);
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Sort fields
|
113 |
-
*/
|
114 |
-
if ($showFiltersAndOrders) {
|
115 |
-
$searchXmlObject->appendChild($this->getProductSortFieldsXmlObject());
|
116 |
-
}
|
117 |
-
|
118 |
-
return $searchXmlObject->asNiceXml();
|
119 |
-
}
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Overwrite original fallback, because they forgot to return
|
123 |
-
*
|
124 |
-
* @return Mage_XmlConnect_Model_Simplexml_Element
|
125 |
-
*/
|
126 |
-
public function getProductSortFieldsXmlObject()
|
127 |
-
{
|
128 |
-
if(method_exists(get_parent_class($this), 'getProductSortFieldsXmlObject')) {
|
129 |
-
return parent::getProductSortFieldsXmlObject();
|
130 |
-
}
|
131 |
-
return parent::getProductSortFeildsXmlObject();
|
132 |
-
}
|
133 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* This class is used provide FAC-Finder filters
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search extends Mage_XmlConnect_Block_Catalog_Search {
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Search results xml renderer
|
26 |
+
* XML also contains filters that can be apply (accorfingly already applyed filters and search query)
|
27 |
+
* and sort fields
|
28 |
+
*
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
protected function _toHtml()
|
32 |
+
{
|
33 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
34 |
+
return parent::_toHtml();
|
35 |
+
}
|
36 |
+
|
37 |
+
$searchXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<search></search>');
|
38 |
+
$filtersXmlObject = new Mage_XmlConnect_Model_Simplexml_Element('<filters></filters>');
|
39 |
+
|
40 |
+
$helper = Mage::helper('catalogsearch');
|
41 |
+
if (method_exists($helper, 'getEngine')) {
|
42 |
+
$engine = Mage::helper('catalogsearch')->getEngine();
|
43 |
+
$isLayeredNavigationAllowed = ($engine instanceof Varien_Object) ? $engine->isLeyeredNavigationAllowed() : true;
|
44 |
+
}
|
45 |
+
else {
|
46 |
+
$isLayeredNavigationAllowed = true;
|
47 |
+
}
|
48 |
+
|
49 |
+
$request = $this->getRequest();
|
50 |
+
$requestParams = $request->getParams();
|
51 |
+
$hasMoreProductItems = 0;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Products
|
55 |
+
*/
|
56 |
+
$productListBlock = $this->getChild('product_list');
|
57 |
+
$productListBlock->setNeedBlockApplyingFilters(false);
|
58 |
+
if ($productListBlock) {
|
59 |
+
$layer = Mage::getSingleton('catalogsearch/layer');
|
60 |
+
$productsXmlObj = $productListBlock->setLayer($layer)
|
61 |
+
->setNeedBlockApplyingFilters(!$isLayeredNavigationAllowed)
|
62 |
+
->getProductsXmlObject();
|
63 |
+
$searchXmlObject->appendChild($productsXmlObj);
|
64 |
+
$hasMoreProductItems = (int)$productListBlock->getHasProductItems();
|
65 |
+
}
|
66 |
+
|
67 |
+
$searchXmlObject->addAttribute('has_more_items', $hasMoreProductItems);
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Filters
|
71 |
+
*/
|
72 |
+
$showFiltersAndOrders = true;
|
73 |
+
$reguest = $this->getRequest();
|
74 |
+
foreach ($reguest->getParams() as $key => $value) {
|
75 |
+
if (0 === strpos($key, parent::REQUEST_SORT_ORDER_PARAM_REFIX) ||
|
76 |
+
0 === strpos($key, parent::REQUEST_FILTER_PARAM_REFIX)) {
|
77 |
+
$showFiltersAndOrders = false;
|
78 |
+
break;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
if ($isLayeredNavigationAllowed && $productListBlock && $showFiltersAndOrders) {
|
82 |
+
$filters = $productListBlock->getCollectedFilters();
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Render filters xml
|
86 |
+
*/
|
87 |
+
foreach ($filters as $filter) {
|
88 |
+
if (!$this->_isFilterItemsHasValues($filter)) {
|
89 |
+
continue;
|
90 |
+
}
|
91 |
+
|
92 |
+
$item = $filtersXmlObject->addChild('item');
|
93 |
+
$item->addChild('name', $searchXmlObject->xmlentities($filter->getName()));
|
94 |
+
$item->addChild('code', $filter->getRequestVar());
|
95 |
+
$values = $item->addChild('values');
|
96 |
+
|
97 |
+
foreach ($filter->getItems() as $valueItem) {
|
98 |
+
$count = (int)$valueItem->getCount();
|
99 |
+
if (!$count) {
|
100 |
+
continue;
|
101 |
+
}
|
102 |
+
$value = $values->addChild('value');
|
103 |
+
$value->addChild('id', $valueItem->getValueString());
|
104 |
+
$value->addChild('label', $searchXmlObject->xmlentities(strip_tags($valueItem->getLabel())));
|
105 |
+
$value->addChild('count', $count);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
$searchXmlObject->appendChild($filtersXmlObject);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Sort fields
|
113 |
+
*/
|
114 |
+
if ($showFiltersAndOrders) {
|
115 |
+
$searchXmlObject->appendChild($this->getProductSortFieldsXmlObject());
|
116 |
+
}
|
117 |
+
|
118 |
+
return $searchXmlObject->asNiceXml();
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Overwrite original fallback, because they forgot to return
|
123 |
+
*
|
124 |
+
* @return Mage_XmlConnect_Model_Simplexml_Element
|
125 |
+
*/
|
126 |
+
public function getProductSortFieldsXmlObject()
|
127 |
+
{
|
128 |
+
if(method_exists(get_parent_class($this), 'getProductSortFieldsXmlObject')) {
|
129 |
+
return parent::getProductSortFieldsXmlObject();
|
130 |
+
}
|
131 |
+
return parent::getProductSortFeildsXmlObject();
|
132 |
+
}
|
133 |
+
}
|
@@ -1,58 +1,58 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class
|
12 |
-
*
|
13 |
-
* This class enables FAC-Finder sugguest
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search_Suggest extends Mage_XmlConnect_Block_Catalog_Search_Suggest
|
22 |
-
{
|
23 |
-
const SUGGEST_ITEM_SEPARATOR = '::sep::';
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Search suggestions xml renderer
|
27 |
-
*
|
28 |
-
* @return string
|
29 |
-
*/
|
30 |
-
protected function _toHtml()
|
31 |
-
{
|
32 |
-
$suggestXmlObj = new Mage_XmlConnect_Model_Simplexml_Element('<suggestions></suggestions>');
|
33 |
-
if (!$this->getRequest()->getParam('q', false)) {
|
34 |
-
return $suggestXmlObj->asNiceXml();
|
35 |
-
}
|
36 |
-
|
37 |
-
$handler = Mage::getSingleton('factfinder/handler_suggest', array($this->getRequest()->getParam('q')));
|
38 |
-
|
39 |
-
$suggestData = $handler->getSuggestionsAsArray();
|
40 |
-
|
41 |
-
if (!($count = count($suggestData))) {
|
42 |
-
return $suggestXmlObj->asNiceXml();
|
43 |
-
}
|
44 |
-
|
45 |
-
$items = '';
|
46 |
-
foreach ($suggestData as $index => $item) {
|
47 |
-
$items .= $suggestXmlObj->xmlentities(strip_tags($item['query']))
|
48 |
-
. self::SUGGEST_ITEM_SEPARATOR
|
49 |
-
. (int)$item['hitCount']
|
50 |
-
. self::SUGGEST_ITEM_SEPARATOR;
|
51 |
-
}
|
52 |
-
|
53 |
-
$suggestXmlObj = new Mage_XmlConnect_Model_Simplexml_Element('<suggestions>' . $items . '</suggestions>');
|
54 |
-
|
55 |
-
return $suggestXmlObj->asNiceXml();
|
56 |
-
}
|
57 |
-
|
58 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class
|
12 |
+
*
|
13 |
+
* This class enables FAC-Finder sugguest
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Block_XmlConnect_Catalog_Search_Suggest extends Mage_XmlConnect_Block_Catalog_Search_Suggest
|
22 |
+
{
|
23 |
+
const SUGGEST_ITEM_SEPARATOR = '::sep::';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Search suggestions xml renderer
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
protected function _toHtml()
|
31 |
+
{
|
32 |
+
$suggestXmlObj = new Mage_XmlConnect_Model_Simplexml_Element('<suggestions></suggestions>');
|
33 |
+
if (!$this->getRequest()->getParam('q', false)) {
|
34 |
+
return $suggestXmlObj->asNiceXml();
|
35 |
+
}
|
36 |
+
|
37 |
+
$handler = Mage::getSingleton('factfinder/handler_suggest', array($this->getRequest()->getParam('q')));
|
38 |
+
|
39 |
+
$suggestData = $handler->getSuggestionsAsArray();
|
40 |
+
|
41 |
+
if (!($count = count($suggestData))) {
|
42 |
+
return $suggestXmlObj->asNiceXml();
|
43 |
+
}
|
44 |
+
|
45 |
+
$items = '';
|
46 |
+
foreach ($suggestData as $index => $item) {
|
47 |
+
$items .= $suggestXmlObj->xmlentities(strip_tags($item['query']))
|
48 |
+
. self::SUGGEST_ITEM_SEPARATOR
|
49 |
+
. (int)$item['hitCount']
|
50 |
+
. self::SUGGEST_ITEM_SEPARATOR;
|
51 |
+
}
|
52 |
+
|
53 |
+
$suggestXmlObj = new Mage_XmlConnect_Model_Simplexml_Element('<suggestions>' . $items . '</suggestions>');
|
54 |
+
|
55 |
+
return $suggestXmlObj->asNiceXml();
|
56 |
+
}
|
57 |
+
|
58 |
}
|
@@ -1,228 +1,228 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Helper class
|
12 |
-
*
|
13 |
-
* Helper for backend configurations.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2011 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Enabled.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Helper_Backend extends Mage_Core_Helper_Abstract
|
22 |
-
{
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Check configuration data by contacting FACT-Finder servers.
|
26 |
-
*
|
27 |
-
* @param unknown_type $configData
|
28 |
-
*/
|
29 |
-
public function checkConfigData($configData) {
|
30 |
-
$dataArray = $this->_getCompleteFieldsetData($configData);
|
31 |
-
$data = new Varien_Object($dataArray);
|
32 |
-
$errors = array();
|
33 |
-
|
34 |
-
if (stripos($data->getAddress(), 'http://') === 0 || strpos($data->getAddress(), '/') !== false) {
|
35 |
-
$errors[] = Mage::helper('factfinder')->__('The server name should contain only the IP address or the domain - no "http://" or any slashes!');
|
36 |
-
}
|
37 |
-
|
38 |
-
if ($data->getPort() == '') {
|
39 |
-
$port = 80;
|
40 |
-
}
|
41 |
-
elseif (!is_numeric($data->getPort())) {
|
42 |
-
$errors[] = Mage::helper('factfinder')->__('The value for "port" must be an integer!');
|
43 |
-
}
|
44 |
-
elseif(intval($data->getPort()) < 80) { //is there any http port lower 80?
|
45 |
-
$errors[] = Mage::helper('factfinder')->__('The value for "port" must be an integer greater or equals 80!');
|
46 |
-
}
|
47 |
-
|
48 |
-
if ($data->getAuthPassword() != '' && $data->getAuthUser() == '') {
|
49 |
-
$errors[] = Mage::helper('factfinder')->__('A user name must be provided if a password is to be used.');
|
50 |
-
}
|
51 |
-
|
52 |
-
$conflicts = Mage::helper('factfinder/debug')->getRewriteConflicts();
|
53 |
-
if(count($conflicts)){
|
54 |
-
foreach($conflicts as $moduleClass => $externalClass){
|
55 |
-
$errors[] = Mage::helper('factfinder')->__('There is a Class Rewrite Conflict: "%s" already overwritten by "%s"', $moduleClass, $externalClass);
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
if (count($errors) == 0) {
|
60 |
-
$checkStatusHandler = Mage::getSingleton('factfinder/handler_checkStatus', $dataArray);
|
61 |
-
if(!$checkStatusHandler->checkStatus($data->getFfversion())){
|
62 |
-
$errors = $checkStatusHandler->getErrorMessages();
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
return $errors;
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Read data from array given, or if no value given, try to read data from website or global configuration
|
73 |
-
*
|
74 |
-
* @param array $configData
|
75 |
-
*/
|
76 |
-
protected function _getCompleteFieldsetData($configData)
|
77 |
-
{
|
78 |
-
$data = array();
|
79 |
-
$websiteCode = Mage::app()->getRequest()->getParam('website');
|
80 |
-
$storeCode = Mage::app()->getRequest()->getParam('store');
|
81 |
-
|
82 |
-
foreach ($configData as $key => $keyData) {
|
83 |
-
if (!isset($keyData['value'])) {
|
84 |
-
|
85 |
-
$path = 'factfinder/search/' . $key;
|
86 |
-
|
87 |
-
if ($storeCode) {
|
88 |
-
$value = Mage::app()->getWebsite($websiteCode)->getConfig($path);
|
89 |
-
}
|
90 |
-
else {
|
91 |
-
$value = (string) Mage::getConfig()->getNode('default/' . $path);
|
92 |
-
}
|
93 |
-
}
|
94 |
-
else {
|
95 |
-
$value = $keyData['value'];
|
96 |
-
}
|
97 |
-
|
98 |
-
$data[$key] = $value;
|
99 |
-
}
|
100 |
-
|
101 |
-
return $data;
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Generate a storable representation of a value
|
106 |
-
*
|
107 |
-
* @param mixed $value
|
108 |
-
* @return string
|
109 |
-
*/
|
110 |
-
protected function _serializeValue($value)
|
111 |
-
{
|
112 |
-
if (is_array($value)) {
|
113 |
-
$data = array();
|
114 |
-
foreach ($value as $rule => $setup) {
|
115 |
-
if($rule == '__empty') {
|
116 |
-
continue;
|
117 |
-
}
|
118 |
-
if (!array_key_exists($rule, $data)) {
|
119 |
-
$data[$rule] = $setup;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
return serialize($data);
|
123 |
-
} else {
|
124 |
-
return '';
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Create a value from a storable representation
|
130 |
-
*
|
131 |
-
* @param mixed $value
|
132 |
-
* @return array
|
133 |
-
*/
|
134 |
-
protected function _unserializeValue($value)
|
135 |
-
{
|
136 |
-
if (is_string($value) && !empty($value)) {
|
137 |
-
return unserialize($value);
|
138 |
-
} else {
|
139 |
-
return array();
|
140 |
-
}
|
141 |
-
}
|
142 |
-
|
143 |
-
/**
|
144 |
-
* Check whether value is in form retrieved by _encodeArrayFieldValue()
|
145 |
-
*
|
146 |
-
* @param mixed
|
147 |
-
* @return bool
|
148 |
-
*/
|
149 |
-
protected function _isEncodedArrayFieldValue($value)
|
150 |
-
{
|
151 |
-
if (!is_array($value)) {
|
152 |
-
return false;
|
153 |
-
}
|
154 |
-
unset($value['__empty']);
|
155 |
-
foreach ($value as $_id => $row) {
|
156 |
-
if (!is_array($row) || !array_key_exists('attribute', $row)) {
|
157 |
-
return false;
|
158 |
-
}
|
159 |
-
}
|
160 |
-
return true;
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Encode value to be used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
165 |
-
*
|
166 |
-
* @param array
|
167 |
-
* @return array
|
168 |
-
*/
|
169 |
-
protected function _encodeArrayFieldValue(array $value)
|
170 |
-
{
|
171 |
-
$result = array();
|
172 |
-
foreach ($value as $set => $value) {
|
173 |
-
$_id = Mage::helper('core')->uniqHash('_');
|
174 |
-
$result[$_id] = $value;
|
175 |
-
}
|
176 |
-
return $result;
|
177 |
-
}
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Decode value from used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
181 |
-
*
|
182 |
-
* @param array
|
183 |
-
* @return array
|
184 |
-
*/
|
185 |
-
protected function _decodeArrayFieldValue(array $value)
|
186 |
-
{
|
187 |
-
$result = array();
|
188 |
-
unset($value['__empty']);
|
189 |
-
foreach ($value as $_id => $row) {
|
190 |
-
if (!is_array($row) || !array_key_exists('attribute', $row)) {
|
191 |
-
continue;
|
192 |
-
}
|
193 |
-
$result[trim($row['attribute'])] = $row;
|
194 |
-
}
|
195 |
-
return $result;
|
196 |
-
}
|
197 |
-
|
198 |
-
/**
|
199 |
-
* Make value readable by Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
200 |
-
*
|
201 |
-
* @param mixed $value
|
202 |
-
* @return array
|
203 |
-
*/
|
204 |
-
public function makeArrayFieldValue($value)
|
205 |
-
{
|
206 |
-
$value = $this->_unserializeValue($value);
|
207 |
-
if (!$this->_isEncodedArrayFieldValue($value)) {
|
208 |
-
$value = $this->_encodeArrayFieldValue($value);
|
209 |
-
}
|
210 |
-
return $value;
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* Make value ready for store
|
215 |
-
*
|
216 |
-
* @param mixed $value
|
217 |
-
* @return string
|
218 |
-
*/
|
219 |
-
public function makeStorableArrayFieldValue($value)
|
220 |
-
{
|
221 |
-
if ($this->_isEncodedArrayFieldValue($value)) {
|
222 |
-
$value = $this->_decodeArrayFieldValue($value);
|
223 |
-
}
|
224 |
-
$value = $this->_serializeValue($value);
|
225 |
-
return $value;
|
226 |
-
}
|
227 |
-
|
228 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Helper class
|
12 |
+
*
|
13 |
+
* Helper for backend configurations.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2011 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Enabled.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Helper_Backend extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Check configuration data by contacting FACT-Finder servers.
|
26 |
+
*
|
27 |
+
* @param unknown_type $configData
|
28 |
+
*/
|
29 |
+
public function checkConfigData($configData) {
|
30 |
+
$dataArray = $this->_getCompleteFieldsetData($configData);
|
31 |
+
$data = new Varien_Object($dataArray);
|
32 |
+
$errors = array();
|
33 |
+
|
34 |
+
if (stripos($data->getAddress(), 'http://') === 0 || strpos($data->getAddress(), '/') !== false) {
|
35 |
+
$errors[] = Mage::helper('factfinder')->__('The server name should contain only the IP address or the domain - no "http://" or any slashes!');
|
36 |
+
}
|
37 |
+
|
38 |
+
if ($data->getPort() == '') {
|
39 |
+
$port = 80;
|
40 |
+
}
|
41 |
+
elseif (!is_numeric($data->getPort())) {
|
42 |
+
$errors[] = Mage::helper('factfinder')->__('The value for "port" must be an integer!');
|
43 |
+
}
|
44 |
+
elseif(intval($data->getPort()) < 80) { //is there any http port lower 80?
|
45 |
+
$errors[] = Mage::helper('factfinder')->__('The value for "port" must be an integer greater or equals 80!');
|
46 |
+
}
|
47 |
+
|
48 |
+
if ($data->getAuthPassword() != '' && $data->getAuthUser() == '') {
|
49 |
+
$errors[] = Mage::helper('factfinder')->__('A user name must be provided if a password is to be used.');
|
50 |
+
}
|
51 |
+
|
52 |
+
$conflicts = Mage::helper('factfinder/debug')->getRewriteConflicts();
|
53 |
+
if(count($conflicts)){
|
54 |
+
foreach($conflicts as $moduleClass => $externalClass){
|
55 |
+
$errors[] = Mage::helper('factfinder')->__('There is a Class Rewrite Conflict: "%s" already overwritten by "%s"', $moduleClass, $externalClass);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
if (count($errors) == 0) {
|
60 |
+
$checkStatusHandler = Mage::getSingleton('factfinder/handler_checkStatus', $dataArray);
|
61 |
+
if(!$checkStatusHandler->checkStatus($data->getFfversion())){
|
62 |
+
$errors = $checkStatusHandler->getErrorMessages();
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
return $errors;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Read data from array given, or if no value given, try to read data from website or global configuration
|
73 |
+
*
|
74 |
+
* @param array $configData
|
75 |
+
*/
|
76 |
+
protected function _getCompleteFieldsetData($configData)
|
77 |
+
{
|
78 |
+
$data = array();
|
79 |
+
$websiteCode = Mage::app()->getRequest()->getParam('website');
|
80 |
+
$storeCode = Mage::app()->getRequest()->getParam('store');
|
81 |
+
|
82 |
+
foreach ($configData as $key => $keyData) {
|
83 |
+
if (!isset($keyData['value'])) {
|
84 |
+
|
85 |
+
$path = 'factfinder/search/' . $key;
|
86 |
+
|
87 |
+
if ($storeCode) {
|
88 |
+
$value = Mage::app()->getWebsite($websiteCode)->getConfig($path);
|
89 |
+
}
|
90 |
+
else {
|
91 |
+
$value = (string) Mage::getConfig()->getNode('default/' . $path);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
else {
|
95 |
+
$value = $keyData['value'];
|
96 |
+
}
|
97 |
+
|
98 |
+
$data[$key] = $value;
|
99 |
+
}
|
100 |
+
|
101 |
+
return $data;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Generate a storable representation of a value
|
106 |
+
*
|
107 |
+
* @param mixed $value
|
108 |
+
* @return string
|
109 |
+
*/
|
110 |
+
protected function _serializeValue($value)
|
111 |
+
{
|
112 |
+
if (is_array($value)) {
|
113 |
+
$data = array();
|
114 |
+
foreach ($value as $rule => $setup) {
|
115 |
+
if($rule == '__empty') {
|
116 |
+
continue;
|
117 |
+
}
|
118 |
+
if (!array_key_exists($rule, $data)) {
|
119 |
+
$data[$rule] = $setup;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
return serialize($data);
|
123 |
+
} else {
|
124 |
+
return '';
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Create a value from a storable representation
|
130 |
+
*
|
131 |
+
* @param mixed $value
|
132 |
+
* @return array
|
133 |
+
*/
|
134 |
+
protected function _unserializeValue($value)
|
135 |
+
{
|
136 |
+
if (is_string($value) && !empty($value)) {
|
137 |
+
return unserialize($value);
|
138 |
+
} else {
|
139 |
+
return array();
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Check whether value is in form retrieved by _encodeArrayFieldValue()
|
145 |
+
*
|
146 |
+
* @param mixed
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
protected function _isEncodedArrayFieldValue($value)
|
150 |
+
{
|
151 |
+
if (!is_array($value)) {
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
unset($value['__empty']);
|
155 |
+
foreach ($value as $_id => $row) {
|
156 |
+
if (!is_array($row) || !array_key_exists('attribute', $row)) {
|
157 |
+
return false;
|
158 |
+
}
|
159 |
+
}
|
160 |
+
return true;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Encode value to be used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
165 |
+
*
|
166 |
+
* @param array
|
167 |
+
* @return array
|
168 |
+
*/
|
169 |
+
protected function _encodeArrayFieldValue(array $value)
|
170 |
+
{
|
171 |
+
$result = array();
|
172 |
+
foreach ($value as $set => $value) {
|
173 |
+
$_id = Mage::helper('core')->uniqHash('_');
|
174 |
+
$result[$_id] = $value;
|
175 |
+
}
|
176 |
+
return $result;
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Decode value from used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
181 |
+
*
|
182 |
+
* @param array
|
183 |
+
* @return array
|
184 |
+
*/
|
185 |
+
protected function _decodeArrayFieldValue(array $value)
|
186 |
+
{
|
187 |
+
$result = array();
|
188 |
+
unset($value['__empty']);
|
189 |
+
foreach ($value as $_id => $row) {
|
190 |
+
if (!is_array($row) || !array_key_exists('attribute', $row)) {
|
191 |
+
continue;
|
192 |
+
}
|
193 |
+
$result[trim($row['attribute'])] = $row;
|
194 |
+
}
|
195 |
+
return $result;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Make value readable by Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
200 |
+
*
|
201 |
+
* @param mixed $value
|
202 |
+
* @return array
|
203 |
+
*/
|
204 |
+
public function makeArrayFieldValue($value)
|
205 |
+
{
|
206 |
+
$value = $this->_unserializeValue($value);
|
207 |
+
if (!$this->_isEncodedArrayFieldValue($value)) {
|
208 |
+
$value = $this->_encodeArrayFieldValue($value);
|
209 |
+
}
|
210 |
+
return $value;
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Make value ready for store
|
215 |
+
*
|
216 |
+
* @param mixed $value
|
217 |
+
* @return string
|
218 |
+
*/
|
219 |
+
public function makeStorableArrayFieldValue($value)
|
220 |
+
{
|
221 |
+
if ($this->_isEncodedArrayFieldValue($value)) {
|
222 |
+
$value = $this->_decodeArrayFieldValue($value);
|
223 |
+
}
|
224 |
+
$value = $this->_serializeValue($value);
|
225 |
+
return $value;
|
226 |
+
}
|
227 |
+
|
228 |
}
|
@@ -1,73 +1,73 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Helper class
|
12 |
-
*
|
13 |
-
* This helper class provides Translation Methods throw Magento Helper Abstract
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Helper_Data extends Mage_Core_Helper_Abstract {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* returns Module Status by Module Code
|
25 |
-
*
|
26 |
-
* @param string $code Module Code
|
27 |
-
* @return boolean
|
28 |
-
*/
|
29 |
-
public function isModuleActive($code)
|
30 |
-
{
|
31 |
-
$module = Mage::getConfig()->getNode("modules/$code");
|
32 |
-
$model = Mage::getConfig()->getNode("global/models/$code");
|
33 |
-
return $module && $module->is('active') || $model;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Decide whether old tracking should be used
|
38 |
-
*
|
39 |
-
* @return bool
|
40 |
-
*/
|
41 |
-
public function useOldTracking()
|
42 |
-
{
|
43 |
-
$ffVersion = Mage::getStoreConfig('factfinder/search/ffversion');
|
44 |
-
// to use the new tracking, change the comparison to '$ffVersion < 69'
|
45 |
-
return ($ffVersion <= 69);
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Decide whether legacy tracking should be used (old tracking for the versions for 6.8 and 6.9)
|
50 |
-
*
|
51 |
-
* @return bool
|
52 |
-
*/
|
53 |
-
public function useLegacyTracking()
|
54 |
-
{
|
55 |
-
$ffVersion = Mage::getStoreConfig('factfinder/search/ffversion');
|
56 |
-
return ($ffVersion >= 68 && $ffVersion <= 69);
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* returns the correct path where the tracking should be sent
|
61 |
-
*
|
62 |
-
* @return string
|
63 |
-
*/
|
64 |
-
public function getTrackingUrlPath()
|
65 |
-
{
|
66 |
-
$urlPath = 'factfinder/proxy/tracking';
|
67 |
-
if ($this->useOldTracking() && !$this->useLegacyTracking()) {
|
68 |
-
// if old tracking is legacy tracking, don't use the scic url
|
69 |
-
$urlPath = 'factfinder/proxy/scic';
|
70 |
-
}
|
71 |
-
return $
|
72 |
-
}
|
73 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Helper class
|
12 |
+
*
|
13 |
+
* This helper class provides Translation Methods throw Magento Helper Abstract
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Helper_Data extends Mage_Core_Helper_Abstract {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* returns Module Status by Module Code
|
25 |
+
*
|
26 |
+
* @param string $code Module Code
|
27 |
+
* @return boolean
|
28 |
+
*/
|
29 |
+
public function isModuleActive($code)
|
30 |
+
{
|
31 |
+
$module = Mage::getConfig()->getNode("modules/$code");
|
32 |
+
$model = Mage::getConfig()->getNode("global/models/$code");
|
33 |
+
return $module && $module->is('active') || $model;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Decide whether old tracking should be used
|
38 |
+
*
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
public function useOldTracking()
|
42 |
+
{
|
43 |
+
$ffVersion = Mage::getStoreConfig('factfinder/search/ffversion');
|
44 |
+
// to use the new tracking, change the comparison to '$ffVersion < 69'
|
45 |
+
return ($ffVersion <= 69);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Decide whether legacy tracking should be used (old tracking for the versions for 6.8 and 6.9)
|
50 |
+
*
|
51 |
+
* @return bool
|
52 |
+
*/
|
53 |
+
public function useLegacyTracking()
|
54 |
+
{
|
55 |
+
$ffVersion = Mage::getStoreConfig('factfinder/search/ffversion');
|
56 |
+
return ($ffVersion >= 68 && $ffVersion <= 69);
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* returns the correct path where the tracking should be sent
|
61 |
+
*
|
62 |
+
* @return string
|
63 |
+
*/
|
64 |
+
public function getTrackingUrlPath()
|
65 |
+
{
|
66 |
+
$urlPath = 'factfinder/proxy/tracking';
|
67 |
+
if ($this->useOldTracking() && !$this->useLegacyTracking()) {
|
68 |
+
// if old tracking is legacy tracking, don't use the scic url
|
69 |
+
$urlPath = 'factfinder/proxy/scic';
|
70 |
+
}
|
71 |
+
return $urlPath;
|
72 |
+
}
|
73 |
+
}
|
@@ -1,140 +1,140 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Helper class
|
12 |
-
*
|
13 |
-
* This helper class provides some Methods which allows us
|
14 |
-
* to debug Modul specific configurations Problems.
|
15 |
-
*
|
16 |
-
* @category Mage
|
17 |
-
* @package Flagbit_FactFinder
|
18 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
-
* @author Joerg Weller <weller@flagbit.de>
|
20 |
-
* @version $Id$
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_Helper_Debug extends Mage_Core_Helper_Abstract
|
23 |
-
implements FACTFinder_Abstract_Logger
|
24 |
-
{
|
25 |
-
/**
|
26 |
-
* Module Configuration File
|
27 |
-
*
|
28 |
-
* @var string
|
29 |
-
*/
|
30 |
-
const MODULE_CONFIG_FILE = 'config.xml';
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Module Log File
|
34 |
-
*
|
35 |
-
* @var string
|
36 |
-
*/
|
37 |
-
const LOG_FILE_NAME = 'factfinder.log';
|
38 |
-
|
39 |
-
/**
|
40 |
-
* XML Config Path to Product Identifier Setting
|
41 |
-
*
|
42 |
-
* @var string
|
43 |
-
*/
|
44 |
-
const XML_CONFIG_PATH_DEBUG_MODE = 'factfinder/config/debug';
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Debug Log to file var/log/factfinder.log
|
48 |
-
*
|
49 |
-
* @param $message
|
50 |
-
* @param $level
|
51 |
-
* @param $file
|
52 |
-
* @param $forceLog
|
53 |
-
*/
|
54 |
-
public function log($message)
|
55 |
-
{
|
56 |
-
if (!Mage::getConfig()) {
|
57 |
-
return;
|
58 |
-
}
|
59 |
-
try{
|
60 |
-
if(Mage::getStoreConfig(self::XML_CONFIG_PATH_DEBUG_MODE)) {
|
61 |
-
return Mage::log($message, null, self::LOG_FILE_NAME, true);
|
62 |
-
}
|
63 |
-
}catch (Exception $e){}
|
64 |
-
|
65 |
-
return $this;
|
66 |
-
}
|
67 |
-
|
68 |
-
public function trace($message)
|
69 |
-
{
|
70 |
-
return $this->log('TRACE: ' . $message);
|
71 |
-
}
|
72 |
-
public function debug($message)
|
73 |
-
{
|
74 |
-
return $this->log('DEBUG: ' . $message);
|
75 |
-
}
|
76 |
-
public function info($message)
|
77 |
-
{
|
78 |
-
return $this->log('INFO: ' . $message);
|
79 |
-
}
|
80 |
-
public function warn($message)
|
81 |
-
{
|
82 |
-
return $this->log('WARNING: ' . $message);
|
83 |
-
}
|
84 |
-
public function error($message)
|
85 |
-
{
|
86 |
-
return $this->log('ERROR: ' . $message);
|
87 |
-
}
|
88 |
-
public function fatal($message)
|
89 |
-
{
|
90 |
-
return $this->log('FATAL ERROR: ' . $message);
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* get Class Rewrite Conflicts for the current Modul
|
95 |
-
*
|
96 |
-
* return array
|
97 |
-
*/
|
98 |
-
public function getRewriteConflicts()
|
99 |
-
{
|
100 |
-
$rewriteConflicts = array();
|
101 |
-
$xml = simplexml_load_file(Mage::getConfig()->getModuleDir('etc', $this->_getModuleName()).DS.self::MODULE_CONFIG_FILE);
|
102 |
-
if ($xml instanceof SimpleXMLElement) {
|
103 |
-
$rewriteNodes = $xml->xpath('//rewrite');
|
104 |
-
|
105 |
-
foreach ($rewriteNodes as $n) {
|
106 |
-
$nParent = $n->xpath('..');
|
107 |
-
$module = (string) $nParent[0]->getName();
|
108 |
-
$nParent2 = $nParent[0]->xpath('..');
|
109 |
-
$component = (string) $nParent2[0]->getName();
|
110 |
-
$pathNodes = $n->children();
|
111 |
-
|
112 |
-
foreach ($pathNodes as $pathNode) {
|
113 |
-
|
114 |
-
$path = (string) $pathNode->getName();
|
115 |
-
$completePath = $module.'/'.$path;
|
116 |
-
|
117 |
-
$rewriteClassName = (string) $pathNode;
|
118 |
-
|
119 |
-
$instance = Mage::getConfig()->getGroupedClassName(
|
120 |
-
substr($component, 0, -1),
|
121 |
-
$completePath
|
122 |
-
);
|
123 |
-
if($instance != $rewriteClassName){
|
124 |
-
|
125 |
-
try{
|
126 |
-
$reflector = new $instance();
|
127 |
-
if($reflector instanceof $rewriteClassName){
|
128 |
-
continue;
|
129 |
-
}
|
130 |
-
}catch (Exception $e){}
|
131 |
-
|
132 |
-
$rewriteConflicts[$rewriteClassName] = $instance;
|
133 |
-
}
|
134 |
-
}
|
135 |
-
}
|
136 |
-
}
|
137 |
-
return $rewriteConflicts;
|
138 |
-
}
|
139 |
-
|
140 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Helper class
|
12 |
+
*
|
13 |
+
* This helper class provides some Methods which allows us
|
14 |
+
* to debug Modul specific configurations Problems.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Flagbit_FactFinder
|
18 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
+
* @author Joerg Weller <weller@flagbit.de>
|
20 |
+
* @version $Id$
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_Helper_Debug extends Mage_Core_Helper_Abstract
|
23 |
+
implements FACTFinder_Abstract_Logger
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Module Configuration File
|
27 |
+
*
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
const MODULE_CONFIG_FILE = 'config.xml';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Module Log File
|
34 |
+
*
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
const LOG_FILE_NAME = 'factfinder.log';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* XML Config Path to Product Identifier Setting
|
41 |
+
*
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
const XML_CONFIG_PATH_DEBUG_MODE = 'factfinder/config/debug';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Debug Log to file var/log/factfinder.log
|
48 |
+
*
|
49 |
+
* @param $message
|
50 |
+
* @param $level
|
51 |
+
* @param $file
|
52 |
+
* @param $forceLog
|
53 |
+
*/
|
54 |
+
public function log($message)
|
55 |
+
{
|
56 |
+
if (!Mage::getConfig()) {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
try{
|
60 |
+
if(Mage::getStoreConfig(self::XML_CONFIG_PATH_DEBUG_MODE)) {
|
61 |
+
return Mage::log($message, null, self::LOG_FILE_NAME, true);
|
62 |
+
}
|
63 |
+
}catch (Exception $e){}
|
64 |
+
|
65 |
+
return $this;
|
66 |
+
}
|
67 |
+
|
68 |
+
public function trace($message)
|
69 |
+
{
|
70 |
+
return $this->log('TRACE: ' . $message);
|
71 |
+
}
|
72 |
+
public function debug($message)
|
73 |
+
{
|
74 |
+
return $this->log('DEBUG: ' . $message);
|
75 |
+
}
|
76 |
+
public function info($message)
|
77 |
+
{
|
78 |
+
return $this->log('INFO: ' . $message);
|
79 |
+
}
|
80 |
+
public function warn($message)
|
81 |
+
{
|
82 |
+
return $this->log('WARNING: ' . $message);
|
83 |
+
}
|
84 |
+
public function error($message)
|
85 |
+
{
|
86 |
+
return $this->log('ERROR: ' . $message);
|
87 |
+
}
|
88 |
+
public function fatal($message)
|
89 |
+
{
|
90 |
+
return $this->log('FATAL ERROR: ' . $message);
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* get Class Rewrite Conflicts for the current Modul
|
95 |
+
*
|
96 |
+
* return array
|
97 |
+
*/
|
98 |
+
public function getRewriteConflicts()
|
99 |
+
{
|
100 |
+
$rewriteConflicts = array();
|
101 |
+
$xml = simplexml_load_file(Mage::getConfig()->getModuleDir('etc', $this->_getModuleName()).DS.self::MODULE_CONFIG_FILE);
|
102 |
+
if ($xml instanceof SimpleXMLElement) {
|
103 |
+
$rewriteNodes = $xml->xpath('//rewrite');
|
104 |
+
|
105 |
+
foreach ($rewriteNodes as $n) {
|
106 |
+
$nParent = $n->xpath('..');
|
107 |
+
$module = (string) $nParent[0]->getName();
|
108 |
+
$nParent2 = $nParent[0]->xpath('..');
|
109 |
+
$component = (string) $nParent2[0]->getName();
|
110 |
+
$pathNodes = $n->children();
|
111 |
+
|
112 |
+
foreach ($pathNodes as $pathNode) {
|
113 |
+
|
114 |
+
$path = (string) $pathNode->getName();
|
115 |
+
$completePath = $module.'/'.$path;
|
116 |
+
|
117 |
+
$rewriteClassName = (string) $pathNode;
|
118 |
+
|
119 |
+
$instance = Mage::getConfig()->getGroupedClassName(
|
120 |
+
substr($component, 0, -1),
|
121 |
+
$completePath
|
122 |
+
);
|
123 |
+
if($instance != $rewriteClassName){
|
124 |
+
|
125 |
+
try{
|
126 |
+
$reflector = new $instance();
|
127 |
+
if($reflector instanceof $rewriteClassName){
|
128 |
+
continue;
|
129 |
+
}
|
130 |
+
}catch (Exception $e){}
|
131 |
+
|
132 |
+
$rewriteConflicts[$rewriteClassName] = $instance;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
137 |
+
return $rewriteConflicts;
|
138 |
+
}
|
139 |
+
|
140 |
}
|
@@ -1,421 +1,421 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Helper class
|
12 |
-
*
|
13 |
-
* This helper class provides some Methods which allows us
|
14 |
-
* to get default und current Values from Toolbar block.
|
15 |
-
*
|
16 |
-
* @category Mage
|
17 |
-
* @package Flagbit_FactFinder
|
18 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
-
* @author Joerg Weller <weller@flagbit.de>
|
20 |
-
* @version $Id$
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_Helper_Search extends Mage_Core_Helper_Abstract {
|
23 |
-
|
24 |
-
/**
|
25 |
-
* XML Config Path to Product Identifier Setting
|
26 |
-
*
|
27 |
-
* @var string
|
28 |
-
*/
|
29 |
-
const XML_CONFIG_PATH_PRODUCT_IDENTIFIER = 'factfinder/config/identifier';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* XML Config Path to Product Identifier Setting
|
33 |
-
*
|
34 |
-
* @var string
|
35 |
-
*/
|
36 |
-
const XML_CONFIG_PATH_USE_PROXY = 'factfinder/config/proxy';
|
37 |
-
|
38 |
-
const CACHE_TAG = 'FACTFINDER';
|
39 |
-
const CACHE_ID = "FallbackCache";
|
40 |
-
const REQUEST_ID_PREFIX = 'FACTFINDER_';
|
41 |
-
|
42 |
-
protected static $_skipFactFinder = null;
|
43 |
-
|
44 |
-
protected static $_isFallbackFeatureActive = null;
|
45 |
-
|
46 |
-
protected static $_failedAttemptRegistered = false;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* if FACT-Finder enabled?
|
50 |
-
*
|
51 |
-
* @param searchPageCheck if true, it will also check whether this is a request for a page with factfinder results
|
52 |
-
* @param functionality can be one of those: suggest, asn, campaign, clicktracking, tagcloud
|
53 |
-
* @return boolean true it the specified feature is enabled
|
54 |
-
*/
|
55 |
-
public function getIsEnabled($searchPageCheck = true, $functionality = '')
|
56 |
-
{
|
57 |
-
if (!Mage::getStoreConfigFlag('factfinder/search/enabled')
|
58 |
-
|| Mage::getStoreConfigFlag('advanced/modules_disable_output/Flagbit_FactFinder')
|
59 |
-
|| ($searchPageCheck == true && !$this->getIsOnSearchPage() && !Mage::getStoreConfigFlag('factfinder/activation/navigation'))
|
60 |
-
|| $this->_skipFactFinder()) {
|
61 |
-
return false;
|
62 |
-
}
|
63 |
-
|
64 |
-
$result = true;
|
65 |
-
|
66 |
-
if ($functionality) {
|
67 |
-
switch ($functionality) {
|
68 |
-
case 'suggest':
|
69 |
-
$result = Mage::getStoreConfig('factfinder/activation/suggest');
|
70 |
-
break;
|
71 |
-
case 'asn':
|
72 |
-
if (Mage::helper('factfinder/search')->getIsOnSearchPage()) {
|
73 |
-
$result = Mage::getStoreConfig('factfinder/activation/asn');
|
74 |
-
}
|
75 |
-
else {
|
76 |
-
$result = Mage::getStoreConfig('factfinder/activation/navigation');
|
77 |
-
}
|
78 |
-
break;
|
79 |
-
case 'campaign':
|
80 |
-
$result = Mage::getStoreConfig('factfinder/activation/campaign');
|
81 |
-
break;
|
82 |
-
case 'clicktracking':
|
83 |
-
$result = Mage::getStoreConfig('factfinder/export/clicktracking');
|
84 |
-
break;
|
85 |
-
case 'tagcloud':
|
86 |
-
$result = Mage::getStoreConfig('factfinder/activation/tagcloud');
|
87 |
-
break;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
return $result;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Determines whether the fallback should be used
|
96 |
-
*
|
97 |
-
* @return bool
|
98 |
-
**/
|
99 |
-
protected function _isFallbackFeatureActive()
|
100 |
-
{
|
101 |
-
if(self::$_isFallbackFeatureActive === null)
|
102 |
-
{
|
103 |
-
self::$_isFallbackFeatureActive = Mage::getStoreConfig('factfinder/fallback/use_fallback');
|
104 |
-
}
|
105 |
-
|
106 |
-
return self::$_isFallbackFeatureActive;
|
107 |
-
}
|
108 |
-
|
109 |
-
protected function _enableFallback($delay)
|
110 |
-
{
|
111 |
-
self::$_skipFactFinder = true;
|
112 |
-
$nextRetryTimestamp = intval(time() / 60) + $delay;
|
113 |
-
Mage::app()->saveCache($nextRetryTimestamp, $this->_getCacheId('nextRetryTimestamp'), array(self::CACHE_TAG));
|
114 |
-
}
|
115 |
-
|
116 |
-
protected function _disableFallback()
|
117 |
-
{
|
118 |
-
self::$_skipFactFinder = false;
|
119 |
-
$nextRetryTimestamp = 0;
|
120 |
-
Mage::app()->saveCache($nextRetryTimestamp, $this->_getCacheId('nextRetryTimestamp'), array(self::CACHE_TAG));
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Determines whether FACT-Finder should be skipped completely, because it has failed to respond too often
|
125 |
-
* The check is made lazily so that it will return the same result for every call during one request to Magento.
|
126 |
-
*
|
127 |
-
* @return bool
|
128 |
-
**/
|
129 |
-
protected function _skipFactFinder()
|
130 |
-
{
|
131 |
-
if(self::$_skipFactFinder === null)
|
132 |
-
{
|
133 |
-
if(!$this->_isFallbackFeatureActive())
|
134 |
-
{
|
135 |
-
self::$_skipFactFinder = false;
|
136 |
-
}
|
137 |
-
else
|
138 |
-
{
|
139 |
-
$nextRetryTimestamp = intval(Mage::app()->loadCache($this->_getCacheId('nextRetryTimestamp')));
|
140 |
-
$currentTimestamp = intval(time() / 60);
|
141 |
-
|
142 |
-
self::$_skipFactFinder = ($currentTimestamp <= $nextRetryTimestamp);
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
return self::$_skipFactFinder;
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* resets all fallback counter values.
|
151 |
-
*
|
152 |
-
* @return void
|
153 |
-
*/
|
154 |
-
public function resetFailedAttemptCount()
|
155 |
-
{
|
156 |
-
$this->_disableFallback();
|
157 |
-
$this->_saveFailedAttempts(array());
|
158 |
-
}
|
159 |
-
|
160 |
-
/**
|
161 |
-
* Registers that FACT-Finder has failed to respond.
|
162 |
-
* The attempt will be represented as an integer corresponding to attempt's timestamp in minutes.
|
163 |
-
* Only one failed attempt per lifetime of this object will be registered.
|
164 |
-
**/
|
165 |
-
public function registerFailedAttempt()
|
166 |
-
{
|
167 |
-
if(self::$_failedAttemptRegistered || !$this->_isFallbackFeatureActive() || $this->_skipFactFinder()) {
|
168 |
-
return;
|
169 |
-
}
|
170 |
-
|
171 |
-
$failedAttempts = $this->_loadFailedAttempts();
|
172 |
-
$failedAttempts = $this->_removeOldEntries($failedAttempts);
|
173 |
-
$failedAttempts[] = intval(time() / 60);
|
174 |
-
$this->_saveFailedAttempts($failedAttempts);
|
175 |
-
|
176 |
-
self::$_failedAttemptRegistered = true;
|
177 |
-
Mage::helper('factfinder/debug')->log('Registered failed attempt to connect to FACT-Finder. '.count($failedAttempts).' failed attempts registered.');
|
178 |
-
|
179 |
-
if (count($failedAttempts) >= 3) {
|
180 |
-
$delay = Mage::getStoreConfig('factfinder/fallback/wait_time');
|
181 |
-
|
182 |
-
$this->_enableFallback($delay);
|
183 |
-
|
184 |
-
// don't output a warning, if the delay is set to 0 as this would cause a lot of messages during a factfinder downtime
|
185 |
-
if($delay > 0) {
|
186 |
-
$this->_outputWarningMessage();
|
187 |
-
}
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
protected function _outputWarningMessage()
|
192 |
-
{
|
193 |
-
$delay = Mage::getStoreConfig('factfinder/fallback/wait_time');
|
194 |
-
|
195 |
-
$title = 'FACT-Finder unreachable! Falling back to Magento\'s search for '.$delay.' minutes.';
|
196 |
-
$message = 'FACT-Finder did not respond for the third time. Magento will now use its own search for '.$delay.' minutes before trying to reach FACT-Finder again. If the problem persists, please check your FACT-Finder server and the settings in Magento\'s FACT-Finder configuration.';
|
197 |
-
|
198 |
-
$adminNotificationInbox = Mage::getModel('adminnotification/inbox');
|
199 |
-
|
200 |
-
if (method_exists($adminNotificationInbox, 'addMajor')) {
|
201 |
-
Mage::getModel('adminnotification/inbox')->addMajor($title, $message);
|
202 |
-
} else {
|
203 |
-
$severity = Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR;
|
204 |
-
$date = date('Y-m-d H:i:s');
|
205 |
-
|
206 |
-
$adminNotificationInbox->parse(array(
|
207 |
-
array(
|
208 |
-
'severity' => $severity,
|
209 |
-
'date_added' => $date,
|
210 |
-
'title' => $title,
|
211 |
-
'description' => $message,
|
212 |
-
'url' => '',
|
213 |
-
'internal' => true
|
214 |
-
)
|
215 |
-
));
|
216 |
-
}
|
217 |
-
}
|
218 |
-
|
219 |
-
protected function _getCacheId($suffix = null)
|
220 |
-
{
|
221 |
-
$cacheId = self::REQUEST_ID_PREFIX . self::CACHE_ID;
|
222 |
-
if ($suffix != null) {
|
223 |
-
$cacheId .= '_' . $suffix;
|
224 |
-
}
|
225 |
-
return $cacheId;
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* Loads previously registered failed attempts from cache, if they exist.
|
230 |
-
* Returns an empty array, otherwise.
|
231 |
-
*
|
232 |
-
* @return array of int
|
233 |
-
**/
|
234 |
-
protected function _loadFailedAttempts()
|
235 |
-
{
|
236 |
-
$cachedContent = Mage::app()->loadCache($this->_getCacheId('failedAttempts'));
|
237 |
-
$failedAttempts = array();
|
238 |
-
if($cachedContent) {
|
239 |
-
$failedAttempts = unserialize($cachedContent);
|
240 |
-
}
|
241 |
-
|
242 |
-
return $failedAttempts;
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Save failed attempts to cache.
|
247 |
-
*
|
248 |
-
* @param array of int failed attempts
|
249 |
-
**/
|
250 |
-
public function _saveFailedAttempts($failedAttempts)
|
251 |
-
{
|
252 |
-
Mage::app()->saveCache(serialize($failedAttempts), $this->_getCacheId('failedAttempts'), array(self::CACHE_TAG));
|
253 |
-
}
|
254 |
-
|
255 |
-
/**
|
256 |
-
* Removes entries from a list of minute-timestamps which are older than 3 minutes
|
257 |
-
*
|
258 |
-
* @param array of int entries
|
259 |
-
**/
|
260 |
-
protected function _removeOldEntries($entries)
|
261 |
-
{
|
262 |
-
$delay = Mage::getStoreConfig('factfinder/fallback/wait_time');
|
263 |
-
$newEntries = array();
|
264 |
-
|
265 |
-
$minutesTimestamp = intval(time() / 60);
|
266 |
-
foreach($entries as $entry)
|
267 |
-
{
|
268 |
-
if($minutesTimestamp - $entry < 3)
|
269 |
-
$newEntries[] = $entry;
|
270 |
-
}
|
271 |
-
|
272 |
-
return $newEntries;
|
273 |
-
}
|
274 |
-
|
275 |
-
/**
|
276 |
-
* get Module Status depending on Module
|
277 |
-
*
|
278 |
-
* @return boolean
|
279 |
-
*/
|
280 |
-
public function getIsOnSearchPage()
|
281 |
-
{
|
282 |
-
return Mage::app()->getRequest()->getModuleName() == 'catalogsearch' ||
|
283 |
-
(Mage::app()->getRequest()->getModuleName() == 'xmlconnect' && strpos(Mage::app()->getRequest()->getActionName(), 'search') !== false);
|
284 |
-
}
|
285 |
-
|
286 |
-
|
287 |
-
/**
|
288 |
-
* get Toolbar Block
|
289 |
-
*
|
290 |
-
* @return Mage_Catalog_Block_Product_List_Toolbar
|
291 |
-
*/
|
292 |
-
protected function _getToolbarBlock()
|
293 |
-
{
|
294 |
-
$mainBlock = Mage::app()->getLayout()->getBlock('search.result');
|
295 |
-
if($mainBlock instanceof Mage_CatalogSearch_Block_Result){
|
296 |
-
$toolbarBlock = $mainBlock->getListBlock()->getToolbarBlock();
|
297 |
-
}else{
|
298 |
-
$toolbarBlock = Mage::app()->getLayout()->createBlock('catalog/product_list_toolbar');
|
299 |
-
}
|
300 |
-
|
301 |
-
return $toolbarBlock;
|
302 |
-
}
|
303 |
-
|
304 |
-
/**
|
305 |
-
* Retrieve default per page values
|
306 |
-
*
|
307 |
-
* @return string (comma separated)
|
308 |
-
*/
|
309 |
-
public function getDefaultPerPageValue()
|
310 |
-
{
|
311 |
-
return $this->_getToolbarBlock()->getDefaultPerPageValue();
|
312 |
-
}
|
313 |
-
|
314 |
-
/**
|
315 |
-
* get Entity ID Field Name by Configuration or via Entity
|
316 |
-
*
|
317 |
-
* @return string
|
318 |
-
*/
|
319 |
-
public function getIdFieldName()
|
320 |
-
{
|
321 |
-
$idFieldName = Mage::getStoreConfig(self::XML_CONFIG_PATH_PRODUCT_IDENTIFIER);
|
322 |
-
if(!$idFieldName){
|
323 |
-
$idFieldName = $this->getEntity()->getIdFieldName();
|
324 |
-
}
|
325 |
-
return $idFieldName;
|
326 |
-
}
|
327 |
-
|
328 |
-
/**
|
329 |
-
* get FACT-Finder Suggest URL
|
330 |
-
*
|
331 |
-
* @return string
|
332 |
-
*/
|
333 |
-
public function getSuggestUrl()
|
334 |
-
{
|
335 |
-
if ($this->isSuggestProxyActivated()) {
|
336 |
-
$params = array();
|
337 |
-
if (Mage::app()->getStore()->isCurrentlySecure()) {
|
338 |
-
$params['_secure'] = true;
|
339 |
-
}
|
340 |
-
$url = $this->_getUrl('factfinder/proxy/suggest', $params);
|
341 |
-
} else {
|
342 |
-
$url = Mage::getSingleton('factfinder/facade')->getSuggestUrl();
|
343 |
-
if (Mage::app()->getStore()->isCurrentlySecure()) {
|
344 |
-
$url = preg_replace('/^http:/', 'https:', $url);
|
345 |
-
}
|
346 |
-
}
|
347 |
-
return $url;
|
348 |
-
}
|
349 |
-
|
350 |
-
/**
|
351 |
-
* @return bool
|
352 |
-
*/
|
353 |
-
public function isSuggestProxyActivated()
|
354 |
-
{
|
355 |
-
return Mage::getStoreConfig(self::XML_CONFIG_PATH_USE_PROXY);
|
356 |
-
}
|
357 |
-
|
358 |
-
/**
|
359 |
-
* get current Order
|
360 |
-
*
|
361 |
-
* @return string
|
362 |
-
*/
|
363 |
-
public function getCurrentOrder()
|
364 |
-
{
|
365 |
-
return $this->_getToolbarBlock()->getCurrentOrder();
|
366 |
-
}
|
367 |
-
|
368 |
-
/**
|
369 |
-
* get current Order Direction
|
370 |
-
*
|
371 |
-
* @return string
|
372 |
-
*/
|
373 |
-
public function getCurrentDirection()
|
374 |
-
{
|
375 |
-
return $this->_getToolbarBlock()->getCurrentDirection();
|
376 |
-
}
|
377 |
-
|
378 |
-
/**
|
379 |
-
* get Page Limit
|
380 |
-
*
|
381 |
-
* @return int
|
382 |
-
*/
|
383 |
-
public function getPageLimit()
|
384 |
-
{
|
385 |
-
$limit = $this->_getToolbarBlock()->getLimit();
|
386 |
-
if ($limit == 'all') {
|
387 |
-
$limit = 2*3*4*5*6; //a lot of products working for each layout
|
388 |
-
}
|
389 |
-
return $limit;
|
390 |
-
}
|
391 |
-
|
392 |
-
/**
|
393 |
-
* get current Page Number
|
394 |
-
*
|
395 |
-
* @return int
|
396 |
-
*/
|
397 |
-
public function getCurrentPage()
|
398 |
-
{
|
399 |
-
return $this->_getToolbarBlock()->getCurrentPage();
|
400 |
-
}
|
401 |
-
|
402 |
-
/**
|
403 |
-
* Retrieve query model object
|
404 |
-
*
|
405 |
-
* @return Mage_CatalogSearch_Model_Query
|
406 |
-
*/
|
407 |
-
public function getQuery()
|
408 |
-
{
|
409 |
-
return Mage::helper('catalogsearch')->getQuery();
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Retrieve query model object
|
414 |
-
*
|
415 |
-
* @return String
|
416 |
-
*/
|
417 |
-
public function getQueryText()
|
418 |
-
{
|
419 |
-
return Mage::helper('catalogsearch')->getQueryText();
|
420 |
-
}
|
421 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Helper class
|
12 |
+
*
|
13 |
+
* This helper class provides some Methods which allows us
|
14 |
+
* to get default und current Values from Toolbar block.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Flagbit_FactFinder
|
18 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
+
* @author Joerg Weller <weller@flagbit.de>
|
20 |
+
* @version $Id$
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_Helper_Search extends Mage_Core_Helper_Abstract {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* XML Config Path to Product Identifier Setting
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
const XML_CONFIG_PATH_PRODUCT_IDENTIFIER = 'factfinder/config/identifier';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* XML Config Path to Product Identifier Setting
|
33 |
+
*
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
const XML_CONFIG_PATH_USE_PROXY = 'factfinder/config/proxy';
|
37 |
+
|
38 |
+
const CACHE_TAG = 'FACTFINDER';
|
39 |
+
const CACHE_ID = "FallbackCache";
|
40 |
+
const REQUEST_ID_PREFIX = 'FACTFINDER_';
|
41 |
+
|
42 |
+
protected static $_skipFactFinder = null;
|
43 |
+
|
44 |
+
protected static $_isFallbackFeatureActive = null;
|
45 |
+
|
46 |
+
protected static $_failedAttemptRegistered = false;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* if FACT-Finder enabled?
|
50 |
+
*
|
51 |
+
* @param searchPageCheck if true, it will also check whether this is a request for a page with factfinder results
|
52 |
+
* @param functionality can be one of those: suggest, asn, campaign, clicktracking, tagcloud
|
53 |
+
* @return boolean true it the specified feature is enabled
|
54 |
+
*/
|
55 |
+
public function getIsEnabled($searchPageCheck = true, $functionality = '')
|
56 |
+
{
|
57 |
+
if (!Mage::getStoreConfigFlag('factfinder/search/enabled')
|
58 |
+
|| Mage::getStoreConfigFlag('advanced/modules_disable_output/Flagbit_FactFinder')
|
59 |
+
|| ($searchPageCheck == true && !$this->getIsOnSearchPage() && !Mage::getStoreConfigFlag('factfinder/activation/navigation'))
|
60 |
+
|| $this->_skipFactFinder()) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
$result = true;
|
65 |
+
|
66 |
+
if ($functionality) {
|
67 |
+
switch ($functionality) {
|
68 |
+
case 'suggest':
|
69 |
+
$result = Mage::getStoreConfig('factfinder/activation/suggest');
|
70 |
+
break;
|
71 |
+
case 'asn':
|
72 |
+
if (Mage::helper('factfinder/search')->getIsOnSearchPage()) {
|
73 |
+
$result = Mage::getStoreConfig('factfinder/activation/asn');
|
74 |
+
}
|
75 |
+
else {
|
76 |
+
$result = Mage::getStoreConfig('factfinder/activation/navigation');
|
77 |
+
}
|
78 |
+
break;
|
79 |
+
case 'campaign':
|
80 |
+
$result = Mage::getStoreConfig('factfinder/activation/campaign');
|
81 |
+
break;
|
82 |
+
case 'clicktracking':
|
83 |
+
$result = Mage::getStoreConfig('factfinder/export/clicktracking');
|
84 |
+
break;
|
85 |
+
case 'tagcloud':
|
86 |
+
$result = Mage::getStoreConfig('factfinder/activation/tagcloud');
|
87 |
+
break;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
return $result;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Determines whether the fallback should be used
|
96 |
+
*
|
97 |
+
* @return bool
|
98 |
+
**/
|
99 |
+
protected function _isFallbackFeatureActive()
|
100 |
+
{
|
101 |
+
if(self::$_isFallbackFeatureActive === null)
|
102 |
+
{
|
103 |
+
self::$_isFallbackFeatureActive = Mage::getStoreConfig('factfinder/fallback/use_fallback');
|
104 |
+
}
|
105 |
+
|
106 |
+
return self::$_isFallbackFeatureActive;
|
107 |
+
}
|
108 |
+
|
109 |
+
protected function _enableFallback($delay)
|
110 |
+
{
|
111 |
+
self::$_skipFactFinder = true;
|
112 |
+
$nextRetryTimestamp = intval(time() / 60) + $delay;
|
113 |
+
Mage::app()->saveCache($nextRetryTimestamp, $this->_getCacheId('nextRetryTimestamp'), array(self::CACHE_TAG));
|
114 |
+
}
|
115 |
+
|
116 |
+
protected function _disableFallback()
|
117 |
+
{
|
118 |
+
self::$_skipFactFinder = false;
|
119 |
+
$nextRetryTimestamp = 0;
|
120 |
+
Mage::app()->saveCache($nextRetryTimestamp, $this->_getCacheId('nextRetryTimestamp'), array(self::CACHE_TAG));
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Determines whether FACT-Finder should be skipped completely, because it has failed to respond too often
|
125 |
+
* The check is made lazily so that it will return the same result for every call during one request to Magento.
|
126 |
+
*
|
127 |
+
* @return bool
|
128 |
+
**/
|
129 |
+
protected function _skipFactFinder()
|
130 |
+
{
|
131 |
+
if(self::$_skipFactFinder === null)
|
132 |
+
{
|
133 |
+
if(!$this->_isFallbackFeatureActive())
|
134 |
+
{
|
135 |
+
self::$_skipFactFinder = false;
|
136 |
+
}
|
137 |
+
else
|
138 |
+
{
|
139 |
+
$nextRetryTimestamp = intval(Mage::app()->loadCache($this->_getCacheId('nextRetryTimestamp')));
|
140 |
+
$currentTimestamp = intval(time() / 60);
|
141 |
+
|
142 |
+
self::$_skipFactFinder = ($currentTimestamp <= $nextRetryTimestamp);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
return self::$_skipFactFinder;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* resets all fallback counter values.
|
151 |
+
*
|
152 |
+
* @return void
|
153 |
+
*/
|
154 |
+
public function resetFailedAttemptCount()
|
155 |
+
{
|
156 |
+
$this->_disableFallback();
|
157 |
+
$this->_saveFailedAttempts(array());
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Registers that FACT-Finder has failed to respond.
|
162 |
+
* The attempt will be represented as an integer corresponding to attempt's timestamp in minutes.
|
163 |
+
* Only one failed attempt per lifetime of this object will be registered.
|
164 |
+
**/
|
165 |
+
public function registerFailedAttempt()
|
166 |
+
{
|
167 |
+
if(self::$_failedAttemptRegistered || !$this->_isFallbackFeatureActive() || $this->_skipFactFinder()) {
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
|
171 |
+
$failedAttempts = $this->_loadFailedAttempts();
|
172 |
+
$failedAttempts = $this->_removeOldEntries($failedAttempts);
|
173 |
+
$failedAttempts[] = intval(time() / 60);
|
174 |
+
$this->_saveFailedAttempts($failedAttempts);
|
175 |
+
|
176 |
+
self::$_failedAttemptRegistered = true;
|
177 |
+
Mage::helper('factfinder/debug')->log('Registered failed attempt to connect to FACT-Finder. '.count($failedAttempts).' failed attempts registered.');
|
178 |
+
|
179 |
+
if (count($failedAttempts) >= 3) {
|
180 |
+
$delay = Mage::getStoreConfig('factfinder/fallback/wait_time');
|
181 |
+
|
182 |
+
$this->_enableFallback($delay);
|
183 |
+
|
184 |
+
// don't output a warning, if the delay is set to 0 as this would cause a lot of messages during a factfinder downtime
|
185 |
+
if($delay > 0) {
|
186 |
+
$this->_outputWarningMessage();
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
protected function _outputWarningMessage()
|
192 |
+
{
|
193 |
+
$delay = Mage::getStoreConfig('factfinder/fallback/wait_time');
|
194 |
+
|
195 |
+
$title = 'FACT-Finder unreachable! Falling back to Magento\'s search for '.$delay.' minutes.';
|
196 |
+
$message = 'FACT-Finder did not respond for the third time. Magento will now use its own search for '.$delay.' minutes before trying to reach FACT-Finder again. If the problem persists, please check your FACT-Finder server and the settings in Magento\'s FACT-Finder configuration.';
|
197 |
+
|
198 |
+
$adminNotificationInbox = Mage::getModel('adminnotification/inbox');
|
199 |
+
|
200 |
+
if (method_exists($adminNotificationInbox, 'addMajor')) {
|
201 |
+
Mage::getModel('adminnotification/inbox')->addMajor($title, $message);
|
202 |
+
} else {
|
203 |
+
$severity = Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR;
|
204 |
+
$date = date('Y-m-d H:i:s');
|
205 |
+
|
206 |
+
$adminNotificationInbox->parse(array(
|
207 |
+
array(
|
208 |
+
'severity' => $severity,
|
209 |
+
'date_added' => $date,
|
210 |
+
'title' => $title,
|
211 |
+
'description' => $message,
|
212 |
+
'url' => '',
|
213 |
+
'internal' => true
|
214 |
+
)
|
215 |
+
));
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
protected function _getCacheId($suffix = null)
|
220 |
+
{
|
221 |
+
$cacheId = self::REQUEST_ID_PREFIX . self::CACHE_ID;
|
222 |
+
if ($suffix != null) {
|
223 |
+
$cacheId .= '_' . $suffix;
|
224 |
+
}
|
225 |
+
return $cacheId;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Loads previously registered failed attempts from cache, if they exist.
|
230 |
+
* Returns an empty array, otherwise.
|
231 |
+
*
|
232 |
+
* @return array of int
|
233 |
+
**/
|
234 |
+
protected function _loadFailedAttempts()
|
235 |
+
{
|
236 |
+
$cachedContent = Mage::app()->loadCache($this->_getCacheId('failedAttempts'));
|
237 |
+
$failedAttempts = array();
|
238 |
+
if($cachedContent) {
|
239 |
+
$failedAttempts = unserialize($cachedContent);
|
240 |
+
}
|
241 |
+
|
242 |
+
return $failedAttempts;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Save failed attempts to cache.
|
247 |
+
*
|
248 |
+
* @param array of int failed attempts
|
249 |
+
**/
|
250 |
+
public function _saveFailedAttempts($failedAttempts)
|
251 |
+
{
|
252 |
+
Mage::app()->saveCache(serialize($failedAttempts), $this->_getCacheId('failedAttempts'), array(self::CACHE_TAG));
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Removes entries from a list of minute-timestamps which are older than 3 minutes
|
257 |
+
*
|
258 |
+
* @param array of int entries
|
259 |
+
**/
|
260 |
+
protected function _removeOldEntries($entries)
|
261 |
+
{
|
262 |
+
$delay = Mage::getStoreConfig('factfinder/fallback/wait_time');
|
263 |
+
$newEntries = array();
|
264 |
+
|
265 |
+
$minutesTimestamp = intval(time() / 60);
|
266 |
+
foreach($entries as $entry)
|
267 |
+
{
|
268 |
+
if($minutesTimestamp - $entry < 3)
|
269 |
+
$newEntries[] = $entry;
|
270 |
+
}
|
271 |
+
|
272 |
+
return $newEntries;
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* get Module Status depending on Module
|
277 |
+
*
|
278 |
+
* @return boolean
|
279 |
+
*/
|
280 |
+
public function getIsOnSearchPage()
|
281 |
+
{
|
282 |
+
return Mage::app()->getRequest()->getModuleName() == 'catalogsearch' ||
|
283 |
+
(Mage::app()->getRequest()->getModuleName() == 'xmlconnect' && strpos(Mage::app()->getRequest()->getActionName(), 'search') !== false);
|
284 |
+
}
|
285 |
+
|
286 |
+
|
287 |
+
/**
|
288 |
+
* get Toolbar Block
|
289 |
+
*
|
290 |
+
* @return Mage_Catalog_Block_Product_List_Toolbar
|
291 |
+
*/
|
292 |
+
protected function _getToolbarBlock()
|
293 |
+
{
|
294 |
+
$mainBlock = Mage::app()->getLayout()->getBlock('search.result');
|
295 |
+
if($mainBlock instanceof Mage_CatalogSearch_Block_Result){
|
296 |
+
$toolbarBlock = $mainBlock->getListBlock()->getToolbarBlock();
|
297 |
+
}else{
|
298 |
+
$toolbarBlock = Mage::app()->getLayout()->createBlock('catalog/product_list_toolbar');
|
299 |
+
}
|
300 |
+
|
301 |
+
return $toolbarBlock;
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Retrieve default per page values
|
306 |
+
*
|
307 |
+
* @return string (comma separated)
|
308 |
+
*/
|
309 |
+
public function getDefaultPerPageValue()
|
310 |
+
{
|
311 |
+
return $this->_getToolbarBlock()->getDefaultPerPageValue();
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* get Entity ID Field Name by Configuration or via Entity
|
316 |
+
*
|
317 |
+
* @return string
|
318 |
+
*/
|
319 |
+
public function getIdFieldName()
|
320 |
+
{
|
321 |
+
$idFieldName = Mage::getStoreConfig(self::XML_CONFIG_PATH_PRODUCT_IDENTIFIER);
|
322 |
+
if(!$idFieldName){
|
323 |
+
$idFieldName = $this->getEntity()->getIdFieldName();
|
324 |
+
}
|
325 |
+
return $idFieldName;
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* get FACT-Finder Suggest URL
|
330 |
+
*
|
331 |
+
* @return string
|
332 |
+
*/
|
333 |
+
public function getSuggestUrl()
|
334 |
+
{
|
335 |
+
if ($this->isSuggestProxyActivated()) {
|
336 |
+
$params = array();
|
337 |
+
if (Mage::app()->getStore()->isCurrentlySecure()) {
|
338 |
+
$params['_secure'] = true;
|
339 |
+
}
|
340 |
+
$url = $this->_getUrl('factfinder/proxy/suggest', $params);
|
341 |
+
} else {
|
342 |
+
$url = Mage::getSingleton('factfinder/facade')->getSuggestUrl();
|
343 |
+
if (Mage::app()->getStore()->isCurrentlySecure()) {
|
344 |
+
$url = preg_replace('/^http:/', 'https:', $url);
|
345 |
+
}
|
346 |
+
}
|
347 |
+
return $url;
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* @return bool
|
352 |
+
*/
|
353 |
+
public function isSuggestProxyActivated()
|
354 |
+
{
|
355 |
+
return Mage::getStoreConfig(self::XML_CONFIG_PATH_USE_PROXY);
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* get current Order
|
360 |
+
*
|
361 |
+
* @return string
|
362 |
+
*/
|
363 |
+
public function getCurrentOrder()
|
364 |
+
{
|
365 |
+
return $this->_getToolbarBlock()->getCurrentOrder();
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* get current Order Direction
|
370 |
+
*
|
371 |
+
* @return string
|
372 |
+
*/
|
373 |
+
public function getCurrentDirection()
|
374 |
+
{
|
375 |
+
return $this->_getToolbarBlock()->getCurrentDirection();
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* get Page Limit
|
380 |
+
*
|
381 |
+
* @return int
|
382 |
+
*/
|
383 |
+
public function getPageLimit()
|
384 |
+
{
|
385 |
+
$limit = $this->_getToolbarBlock()->getLimit();
|
386 |
+
if ($limit == 'all') {
|
387 |
+
$limit = 2*3*4*5*6; //a lot of products working for each layout
|
388 |
+
}
|
389 |
+
return $limit;
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* get current Page Number
|
394 |
+
*
|
395 |
+
* @return int
|
396 |
+
*/
|
397 |
+
public function getCurrentPage()
|
398 |
+
{
|
399 |
+
return $this->_getToolbarBlock()->getCurrentPage();
|
400 |
+
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Retrieve query model object
|
404 |
+
*
|
405 |
+
* @return Mage_CatalogSearch_Model_Query
|
406 |
+
*/
|
407 |
+
public function getQuery()
|
408 |
+
{
|
409 |
+
return Mage::helper('catalogsearch')->getQuery();
|
410 |
+
}
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Retrieve query model object
|
414 |
+
*
|
415 |
+
* @return String
|
416 |
+
*/
|
417 |
+
public function getQueryText()
|
418 |
+
{
|
419 |
+
return Mage::helper('catalogsearch')->getQueryText();
|
420 |
+
}
|
421 |
+
}
|
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* This helper class provides the Price export
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Export_Price extends Mage_Core_Model_Mysql4_Abstract {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* defines Export Columns
|
25 |
-
* @var array
|
26 |
-
*/
|
27 |
-
protected $_exportColumns = array('entity_id', 'customer_group_id', 'final_price', 'min_price');
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Resource initialization
|
31 |
-
*/
|
32 |
-
protected function _construct(){
|
33 |
-
$this->_setResource('core');
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* add CSV Row
|
38 |
-
*
|
39 |
-
* @param array $data
|
40 |
-
*/
|
41 |
-
protected function _addCsvRow($data)
|
42 |
-
{
|
43 |
-
foreach($data as &$item){
|
44 |
-
$item = str_replace(array("\r", "\n", "\""), ' ', addcslashes(strip_tags($item), '"'));
|
45 |
-
}
|
46 |
-
|
47 |
-
echo '"'.implode('";"', $data).'"'."\n";
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* export Product Prices
|
52 |
-
* direct Output as CSV
|
53 |
-
*
|
54 |
-
* @param int $storeId Store View Id
|
55 |
-
*/
|
56 |
-
public function doExport($storeId = null)
|
57 |
-
{
|
58 |
-
$this->_addCsvRow($this->_exportColumns);
|
59 |
-
for($i=1; $prices = $this->_getPrices($storeId, $i); $i++){
|
60 |
-
foreach($prices as $price){
|
61 |
-
$this->_addCsvRow($price);
|
62 |
-
}
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* get Prices from Price Index Table
|
68 |
-
*
|
69 |
-
* @param int $storeId Store ID
|
70 |
-
* @param int $part
|
71 |
-
* @param int $limit
|
72 |
-
* @return array
|
73 |
-
*/
|
74 |
-
protected function _getPrices($storeId, $part = 1, $limit = 100){
|
75 |
-
|
76 |
-
$store = Mage::app()->getStore($storeId);
|
77 |
-
$select = $this->_getWriteAdapter()->select()
|
78 |
-
->from(
|
79 |
-
array('e' => $this->getTable('catalog/product_index_price')),
|
80 |
-
$this->_exportColumns);
|
81 |
-
|
82 |
-
if($storeId !== null){
|
83 |
-
$select->where('e.website_id = ?', $store->getWebsiteId());
|
84 |
-
}
|
85 |
-
|
86 |
-
$select->limitPage($part, $limit)
|
87 |
-
->order('e.entity_id');
|
88 |
-
|
89 |
-
return $this->_getWriteAdapter()->fetchAll($select);
|
90 |
-
}
|
91 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* This helper class provides the Price export
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Export_Price extends Mage_Core_Model_Mysql4_Abstract {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* defines Export Columns
|
25 |
+
* @var array
|
26 |
+
*/
|
27 |
+
protected $_exportColumns = array('entity_id', 'customer_group_id', 'final_price', 'min_price');
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Resource initialization
|
31 |
+
*/
|
32 |
+
protected function _construct(){
|
33 |
+
$this->_setResource('core');
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* add CSV Row
|
38 |
+
*
|
39 |
+
* @param array $data
|
40 |
+
*/
|
41 |
+
protected function _addCsvRow($data)
|
42 |
+
{
|
43 |
+
foreach($data as &$item){
|
44 |
+
$item = str_replace(array("\r", "\n", "\""), ' ', addcslashes(strip_tags($item), '"'));
|
45 |
+
}
|
46 |
+
|
47 |
+
echo '"'.implode('";"', $data).'"'."\n";
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* export Product Prices
|
52 |
+
* direct Output as CSV
|
53 |
+
*
|
54 |
+
* @param int $storeId Store View Id
|
55 |
+
*/
|
56 |
+
public function doExport($storeId = null)
|
57 |
+
{
|
58 |
+
$this->_addCsvRow($this->_exportColumns);
|
59 |
+
for($i=1; $prices = $this->_getPrices($storeId, $i); $i++){
|
60 |
+
foreach($prices as $price){
|
61 |
+
$this->_addCsvRow($price);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* get Prices from Price Index Table
|
68 |
+
*
|
69 |
+
* @param int $storeId Store ID
|
70 |
+
* @param int $part
|
71 |
+
* @param int $limit
|
72 |
+
* @return array
|
73 |
+
*/
|
74 |
+
protected function _getPrices($storeId, $part = 1, $limit = 100){
|
75 |
+
|
76 |
+
$store = Mage::app()->getStore($storeId);
|
77 |
+
$select = $this->_getWriteAdapter()->select()
|
78 |
+
->from(
|
79 |
+
array('e' => $this->getTable('catalog/product_index_price')),
|
80 |
+
$this->_exportColumns);
|
81 |
+
|
82 |
+
if($storeId !== null){
|
83 |
+
$select->where('e.website_id = ?', $store->getWebsiteId());
|
84 |
+
}
|
85 |
+
|
86 |
+
$select->limitPage($part, $limit)
|
87 |
+
->order('e.entity_id');
|
88 |
+
|
89 |
+
return $this->_getWriteAdapter()->fetchAll($select);
|
90 |
+
}
|
91 |
+
}
|
@@ -1,616 +1,616 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* This helper class provides the Product export
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Export_Product extends Mage_CatalogSearch_Model_Mysql4_Fulltext {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Option ID to Value Mapping Array
|
25 |
-
* @var mixed
|
26 |
-
*/
|
27 |
-
protected $_optionIdToValue = null;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Products to Category Path Mapping
|
31 |
-
*
|
32 |
-
* @var mixed
|
33 |
-
*/
|
34 |
-
protected $_productsToCategoryPath = null;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Category Names by ID
|
38 |
-
* @var mixed
|
39 |
-
*/
|
40 |
-
protected $_categoryNames = null;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* export attribute codes
|
44 |
-
* @var mixed
|
45 |
-
*/
|
46 |
-
protected $_exportAttributeCodes = null;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* export attribute objects
|
50 |
-
* @var mixed
|
51 |
-
*/
|
52 |
-
protected $_exportAttributes = null;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* helper to generate the image urls
|
56 |
-
* @var Mage_Catalog_Helper_Image
|
57 |
-
*/
|
58 |
-
protected $_imageHelper = null;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* add CSV Row
|
62 |
-
*
|
63 |
-
* @param array $data
|
64 |
-
*/
|
65 |
-
protected function _addCsvRow($data)
|
66 |
-
{
|
67 |
-
foreach ($data as &$item) {
|
68 |
-
$item = str_replace(array("\r", "\n", "\""), array(' ', ' ', "''"), trim( strip_tags($item), ';') );
|
69 |
-
}
|
70 |
-
|
71 |
-
echo '"'.implode('";"', $data).'"'."\n";
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* get Option Text by Option ID
|
76 |
-
*
|
77 |
-
* @param int $optionId Option ID
|
78 |
-
* @param int $storeId Store ID
|
79 |
-
* @return string
|
80 |
-
*/
|
81 |
-
protected function _getAttributeOptionText($optionId, $storeId)
|
82 |
-
{
|
83 |
-
$value = '';
|
84 |
-
if (intval($optionId)) {
|
85 |
-
if ($this->_optionIdToValue === null) {
|
86 |
-
/*@var $optionCollection Mage_Eav_Model_Mysql4_Entity_Attribute_Option_Collection */
|
87 |
-
$optionCollection = Mage::getResourceModel('eav/entity_attribute_option_collection');
|
88 |
-
$optionCollection->setStoreFilter($storeId);
|
89 |
-
$this->_optionIdToValue = array();
|
90 |
-
foreach ($optionCollection as $option) {
|
91 |
-
$this->_optionIdToValue[$option->getId()] = $option->getValue();
|
92 |
-
}
|
93 |
-
}
|
94 |
-
$value = isset($this->_optionIdToValue[$optionId]) ? $this->_optionIdToValue[$optionId] : '';
|
95 |
-
}
|
96 |
-
return $value;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* get CSV Header Array
|
101 |
-
*
|
102 |
-
* @param int $storeId
|
103 |
-
* @return array
|
104 |
-
*/
|
105 |
-
protected function _getExportAttributes($storeId = null)
|
106 |
-
{
|
107 |
-
if($this->_exportAttributeCodes === null){
|
108 |
-
$headerDefault = array('id', 'parent_id', 'sku', 'category', 'filterable_attributes', 'searchable_attributes');
|
109 |
-
$headerDynamic = array();
|
110 |
-
|
111 |
-
if (Mage::getStoreConfigFlag('factfinder/export/urls', $storeId)) {
|
112 |
-
$headerDefault[] = 'image';
|
113 |
-
$headerDefault[] = 'deeplink';
|
114 |
-
$this->_imageHelper = Mage::helper('catalog/image');
|
115 |
-
}
|
116 |
-
|
117 |
-
// get dynamic Attributes
|
118 |
-
foreach ($this->_getSearchableAttributes(null, 'system', $storeId) as $attribute) {
|
119 |
-
if (in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility'))) {
|
120 |
-
continue;
|
121 |
-
}
|
122 |
-
$headerDynamic[] = $attribute->getAttributeCode();
|
123 |
-
}
|
124 |
-
|
125 |
-
// compare dynamic with setup attributes
|
126 |
-
$headerSetup = Mage::helper('factfinder/backend')->makeArrayFieldValue(Mage::getStoreConfig('factfinder/export/attributes', $storeId));
|
127 |
-
$setupUpdate = false;
|
128 |
-
foreach($headerDynamic as $code){
|
129 |
-
if(in_array($code, $headerSetup)){
|
130 |
-
continue;
|
131 |
-
}
|
132 |
-
$headerSetup[$code]['attribute'] = $code;
|
133 |
-
$setupUpdate = true;
|
134 |
-
}
|
135 |
-
|
136 |
-
// remove default attributes from setup
|
137 |
-
foreach($headerDefault as $code){
|
138 |
-
if(array_key_exists($code, $headerSetup)){
|
139 |
-
unset($headerSetup[$code]);
|
140 |
-
$setupUpdate = true;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
if($setupUpdate === true){
|
145 |
-
Mage::getModel('core/config')->saveConfig('factfinder/export/attributes', Mage::helper('factfinder/backend')->makeStorableArrayFieldValue($headerSetup), 'stores', $storeId);
|
146 |
-
}
|
147 |
-
|
148 |
-
$this->_exportAttributeCodes = array_merge($headerDefault, array_keys($headerSetup));
|
149 |
-
}
|
150 |
-
return $this->_exportAttributeCodes;
|
151 |
-
}
|
152 |
-
|
153 |
-
|
154 |
-
/**
|
155 |
-
* export Product Data with Attributes
|
156 |
-
* direct Output as CSV
|
157 |
-
*
|
158 |
-
* @param int $storeId Store View Id
|
159 |
-
*/
|
160 |
-
public function doExport($storeId = null)
|
161 |
-
{
|
162 |
-
$idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
|
163 |
-
$exportImageAndDeeplink = Mage::getStoreConfigFlag('factfinder/export/urls', $storeId);
|
164 |
-
if ($exportImageAndDeeplink) {
|
165 |
-
$imageType = Mage::getStoreConfig('factfinder/export/suggest_image_type', $storeId);
|
166 |
-
$imageSize = (int) Mage::getStoreConfig('factfinder/export/suggest_image_size', $storeId);
|
167 |
-
}
|
168 |
-
|
169 |
-
$header = $this->_getExportAttributes($storeId);
|
170 |
-
$this->_addCsvRow($header);
|
171 |
-
|
172 |
-
// preparesearchable attributes
|
173 |
-
$staticFields = array();
|
174 |
-
foreach ($this->_getSearchableAttributes('static', 'system', $storeId) as $attribute) {
|
175 |
-
$staticFields[] = $attribute->getAttributeCode();
|
176 |
-
}
|
177 |
-
$dynamicFields = array(
|
178 |
-
'int' => array_keys($this->_getSearchableAttributes('int')),
|
179 |
-
'varchar' => array_keys($this->_getSearchableAttributes('varchar')),
|
180 |
-
'text' => array_keys($this->_getSearchableAttributes('text')),
|
181 |
-
'decimal' => array_keys($this->_getSearchableAttributes('decimal')),
|
182 |
-
'datetime' => array_keys($this->_getSearchableAttributes('datetime')),
|
183 |
-
);
|
184 |
-
|
185 |
-
// status and visibility filter
|
186 |
-
$visibility = $this->_getSearchableAttribute('visibility');
|
187 |
-
$status = $this->_getSearchableAttribute('status');
|
188 |
-
$visibilityVals = Mage::getSingleton('catalog/product_visibility')->getVisibleInSearchIds();
|
189 |
-
$statusVals = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();
|
190 |
-
|
191 |
-
$lastProductId = 0;
|
192 |
-
while (true) {
|
193 |
-
$products = $this->_getSearchableProducts($storeId, $staticFields, null, $lastProductId);
|
194 |
-
if (!$products) {
|
195 |
-
break;
|
196 |
-
}
|
197 |
-
|
198 |
-
$productRelations = array();
|
199 |
-
foreach ($products as $productData) {
|
200 |
-
$lastProductId = $productData['entity_id'];
|
201 |
-
$productAttributes[$productData['entity_id']] = $productData['entity_id'];
|
202 |
-
$productChilds = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']);
|
203 |
-
$productRelations[$productData['entity_id']] = $productChilds;
|
204 |
-
if ($productChilds) {
|
205 |
-
foreach ($productChilds as $productChild) {
|
206 |
-
$productAttributes[$productChild['entity_id']] = $productChild;
|
207 |
-
}
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
$productAttributes = $this->_getProductAttributes($storeId, array_keys($productAttributes), $dynamicFields);
|
212 |
-
foreach ($products as $productData) {
|
213 |
-
if (!isset($productAttributes[$productData['entity_id']])) {
|
214 |
-
continue;
|
215 |
-
}
|
216 |
-
$productAttr = $productAttributes[$productData['entity_id']];
|
217 |
-
|
218 |
-
if (!isset($productAttr[$visibility->getId()]) || !in_array($productAttr[$visibility->getId()], $visibilityVals)) {
|
219 |
-
continue;
|
220 |
-
}
|
221 |
-
if (!isset($productAttr[$status->getId()]) || !in_array($productAttr[$status->getId()], $statusVals)) {
|
222 |
-
continue;
|
223 |
-
}
|
224 |
-
|
225 |
-
$productIndex = array(
|
226 |
-
$productData['entity_id'],
|
227 |
-
$productData[$idFieldName],
|
228 |
-
$productData['sku'],
|
229 |
-
$this->_getCategoryPath($productData['entity_id'], $storeId),
|
230 |
-
$this->_formatFilterableAttributes($this->_getSearchableAttributes(null, 'filterable'), $productAttr, $storeId),
|
231 |
-
$this->_formatSearchableAttributes($this->_getSearchableAttributes(null, 'searchable'), $productAttr, $storeId)
|
232 |
-
);
|
233 |
-
|
234 |
-
if ($exportImageAndDeeplink) {
|
235 |
-
$product = Mage::getModel("catalog/product");
|
236 |
-
$product->setStoreId($storeId);
|
237 |
-
$product->load($productData['entity_id']);
|
238 |
-
|
239 |
-
$productIndex[] = (string) $this->_imageHelper->init($product, $imageType)->resize($imageSize);
|
240 |
-
$productIndex[] = $product->getProductUrl();
|
241 |
-
}
|
242 |
-
|
243 |
-
$this->_getAttributesRowArray($productIndex, $productAttr, $storeId);
|
244 |
-
|
245 |
-
$this->_addCsvRow($productIndex);
|
246 |
-
|
247 |
-
if ($productChilds = $productRelations[$productData['entity_id']]) {
|
248 |
-
foreach ($productChilds as $productChild) {
|
249 |
-
if (isset($productAttributes[$productChild['entity_id']])) {
|
250 |
-
/* should be used if sub products should not be exported because of their status
|
251 |
-
$subProductAttr = $productAttributes[$productChild[ 'entity_id' ]];
|
252 |
-
if (!isset($subProductAttr[$status->getId()]) || !in_array($subProductAttr[$status->getId()], $statusVals)) {
|
253 |
-
continue;
|
254 |
-
} */
|
255 |
-
|
256 |
-
$subProductIndex = array(
|
257 |
-
$productChild['entity_id'],
|
258 |
-
$productData[$idFieldName],
|
259 |
-
$productChild['sku'],
|
260 |
-
$this->_getCategoryPath($productData['entity_id'], $storeId),
|
261 |
-
$this->_formatFilterableAttributes($this->_getSearchableAttributes(null, 'filterable'), $productAttributes[$productChild['entity_id']], $storeId),
|
262 |
-
$this->_formatSearchableAttributes($this->_getSearchableAttributes(null, 'searchable'), $productAttributes[$productChild['entity_id']], $storeId)
|
263 |
-
);
|
264 |
-
if ($exportImageAndDeeplink) {
|
265 |
-
//dont need to add image and deeplink to child product, just add empty values
|
266 |
-
$subProductIndex[] = '';
|
267 |
-
$subProductIndex[] = '';
|
268 |
-
}
|
269 |
-
$this->_getAttributesRowArray($subProductIndex, $productAttributes[$productChild['entity_id']], $storeId);
|
270 |
-
|
271 |
-
$this->_addCsvRow($subProductIndex);
|
272 |
-
}
|
273 |
-
}
|
274 |
-
}
|
275 |
-
}
|
276 |
-
|
277 |
-
unset($products);
|
278 |
-
unset($productAttributes);
|
279 |
-
unset($productRelations);
|
280 |
-
flush();
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
protected function _formatSearchableAttributes($attributes, $values, $storeId=null)
|
285 |
-
{
|
286 |
-
$returnArray = array();
|
287 |
-
foreach ($attributes as $attribute) {
|
288 |
-
$value = isset($values[$attribute->getId()]) ? $values[$attribute->getId()] : null;
|
289 |
-
if (!$value || in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility', 'price'))) {
|
290 |
-
continue;
|
291 |
-
}
|
292 |
-
$attributeValue = $this->_getAttributeValue($attribute->getId(), $value, $storeId);
|
293 |
-
if (strval($attributeValue) != "") {
|
294 |
-
$returnArray[] = $attributeValue;
|
295 |
-
}
|
296 |
-
}
|
297 |
-
return implode(',', $returnArray);
|
298 |
-
}
|
299 |
-
|
300 |
-
protected function _formatFilterableAttributes($attributes, $values, $storeId=null)
|
301 |
-
{
|
302 |
-
$returnArray = array();
|
303 |
-
foreach ($attributes as $attribute) {
|
304 |
-
$value = isset($values[$attribute->getId()]) ? $values[$attribute->getId()] : null;
|
305 |
-
if (!$value || in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility', 'price'))) {
|
306 |
-
continue;
|
307 |
-
}
|
308 |
-
$attributeValue = $this->_getAttributeValue($attribute->getId(), $value, $storeId);
|
309 |
-
$attributeValues = array();
|
310 |
-
if (strpos($attributeValue, '|') !== false) {
|
311 |
-
$attributeValues = explode('|', $attributeValue);
|
312 |
-
} else {
|
313 |
-
$attributeValues[] = $attributeValue;
|
314 |
-
}
|
315 |
-
|
316 |
-
foreach ($attributeValues AS $value) {
|
317 |
-
if (strval($value) != "") {
|
318 |
-
$returnArray[] = $attribute->getAttributeCode().'='.$value;
|
319 |
-
}
|
320 |
-
}
|
321 |
-
}
|
322 |
-
return implode('|', $returnArray);
|
323 |
-
}
|
324 |
-
|
325 |
-
/**
|
326 |
-
* Retrieve Searchable attributes
|
327 |
-
*
|
328 |
-
* @param string $backendType
|
329 |
-
* @param string $type possible Types: system, sortable, filterable, searchable
|
330 |
-
* @return array
|
331 |
-
*/
|
332 |
-
protected function _getSearchableAttributes($backendType = null, $type = null, $storeId = null)
|
333 |
-
{
|
334 |
-
if (is_null($this->_searchableAttributes)) {
|
335 |
-
$this->_searchableAttributes = array();
|
336 |
-
$entityType = $this->getEavConfig()->getEntityType('catalog_product');
|
337 |
-
$entity = $entityType->getEntity();
|
338 |
-
|
339 |
-
$userDefinedAttributes = array_keys(Mage::helper('factfinder/backend')->makeArrayFieldValue(Mage::getStoreConfig('factfinder/export/attributes', $storeId)));
|
340 |
-
|
341 |
-
$whereCond = array(
|
342 |
-
$this->_getWriteAdapter()->quoteInto('additional_table.is_searchable=? or additional_table.is_filterable=? or additional_table.used_for_sort_by=?', 1),
|
343 |
-
$this->_getWriteAdapter()->quoteInto('main_table.attribute_code IN(?)', array_merge(array('status', 'visibility'), $userDefinedAttributes))
|
344 |
-
);
|
345 |
-
|
346 |
-
$select = $this->_getWriteAdapter()->select()
|
347 |
-
->from(array('main_table' => $this->getTable('eav/attribute')))
|
348 |
-
->join(
|
349 |
-
array('additional_table' => $this->getTable('catalog/eav_attribute')),
|
350 |
-
'additional_table.attribute_id = main_table.attribute_id'
|
351 |
-
)
|
352 |
-
->where('main_table.entity_type_id=?', $entityType->getEntityTypeId())
|
353 |
-
->where(join(' OR ', $whereCond))
|
354 |
-
->order('main_table.attribute_id', 'asc');
|
355 |
-
|
356 |
-
$attributesData = $this->_getWriteAdapter()->fetchAll($select);
|
357 |
-
$this->getEavConfig()->importAttributesData($entityType, $attributesData);
|
358 |
-
foreach ($attributesData as $attributeData) {
|
359 |
-
$attributeCode = $attributeData['attribute_code'];
|
360 |
-
$attribute = $this->getEavConfig()->getAttribute($entityType, $attributeCode);
|
361 |
-
$attribute->setEntity($entity);
|
362 |
-
$this->_searchableAttributes[$attribute->getId()] = $attribute;
|
363 |
-
}
|
364 |
-
unset($attributesData);
|
365 |
-
}
|
366 |
-
|
367 |
-
if (!is_null($type) || !is_null($backendType)) {
|
368 |
-
$attributes = array();
|
369 |
-
foreach ($this->_searchableAttributes as $attribute) {
|
370 |
-
|
371 |
-
if (!is_null($backendType)
|
372 |
-
&& $attribute->getBackendType() != $backendType) {
|
373 |
-
continue;
|
374 |
-
}
|
375 |
-
|
376 |
-
switch($type) {
|
377 |
-
|
378 |
-
case "system":
|
379 |
-
if ($attribute->getIsUserDefined()
|
380 |
-
&& !$attribute->getUsedForSortBy()) {
|
381 |
-
continue 2;
|
382 |
-
}
|
383 |
-
break;
|
384 |
-
|
385 |
-
case "sortable":
|
386 |
-
if (!$attribute->getUsedForSortBy()) {
|
387 |
-
continue 2;
|
388 |
-
}
|
389 |
-
break;
|
390 |
-
|
391 |
-
case "filterable":
|
392 |
-
if (!$attribute->getIsFilterableInSearch()
|
393 |
-
|| in_array($attribute->getAttributeCode(), $this->_getExportAttributes())) {
|
394 |
-
continue 2;
|
395 |
-
}
|
396 |
-
break;
|
397 |
-
|
398 |
-
case "searchable":
|
399 |
-
if (!$attribute->getIsUserDefined()
|
400 |
-
|| !$attribute->getIsSearchable()
|
401 |
-
|| in_array($attribute->getAttributeCode(), $this->_getExportAttributes())) {
|
402 |
-
continue 2;
|
403 |
-
}
|
404 |
-
break;
|
405 |
-
}
|
406 |
-
|
407 |
-
$attributes[$attribute->getId()] = $attribute;
|
408 |
-
}
|
409 |
-
return $attributes;
|
410 |
-
}
|
411 |
-
return $this->_searchableAttributes;
|
412 |
-
}
|
413 |
-
|
414 |
-
/**
|
415 |
-
* Get Category Path by Product ID
|
416 |
-
*
|
417 |
-
* @param int $productId
|
418 |
-
* @param int $storeId
|
419 |
-
* @return string
|
420 |
-
*/
|
421 |
-
protected function _getCategoryPath($productId, $storeId = null)
|
422 |
-
{
|
423 |
-
|
424 |
-
if ($this->_categoryNames === null) {
|
425 |
-
$categoryCollection = Mage::getResourceModel('catalog/category_attribute_collection');
|
426 |
-
$categoryCollection->getSelect()->where("attribute_code IN('name', 'is_active')");
|
427 |
-
|
428 |
-
foreach ($categoryCollection as $categoryModel) {
|
429 |
-
${$categoryModel->getAttributeCode().'Model'} = $categoryModel;
|
430 |
-
}
|
431 |
-
|
432 |
-
$select = $this->_getReadAdapter()->select()
|
433 |
-
->from(
|
434 |
-
array('main' => $nameModel->getBackendTable()),
|
435 |
-
array('entity_id', 'value')
|
436 |
-
)
|
437 |
-
->join(
|
438 |
-
array('e' => $is_activeModel->getBackendTable()),
|
439 |
-
'main.entity_id=e.entity_id AND (e.store_id = 0 OR e.store_id = '.$storeId.') AND e.attribute_id='.$is_activeModel->getAttributeId(),
|
440 |
-
null
|
441 |
-
)
|
442 |
-
->where('main.attribute_id=?', $nameModel->getAttributeId())
|
443 |
-
->where('e.value=?', '1')
|
444 |
-
->where('main.store_id = 0 OR main.store_id = ?', $storeId);
|
445 |
-
|
446 |
-
$this->_categoryNames = $this->_getReadAdapter()->fetchPairs($select);
|
447 |
-
}
|
448 |
-
|
449 |
-
if ($this->_productsToCategoryPath === null) {
|
450 |
-
$select = $this->_getReadAdapter()->select()
|
451 |
-
->from(
|
452 |
-
array('main' => $this->getTable('catalog/category_product_index')),
|
453 |
-
array('product_id')
|
454 |
-
)
|
455 |
-
->join(
|
456 |
-
array('e' => $this->getTable('catalog/category')),
|
457 |
-
'main.category_id=e.entity_id',
|
458 |
-
null
|
459 |
-
)
|
460 |
-
->columns(array('e.path' => new Zend_Db_Expr('GROUP_CONCAT(e.path)')))
|
461 |
-
->where(
|
462 |
-
'main.visibility IN(?)',
|
463 |
-
array(
|
464 |
-
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_SEARCH,
|
465 |
-
Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH
|
466 |
-
)
|
467 |
-
)
|
468 |
-
->where('main.store_id = ?', $storeId)
|
469 |
-
->where('e.path LIKE \'1/' . Mage::app()->getStore($storeId)->getRootCategoryId() .'/%\'')
|
470 |
-
->group('main.product_id');
|
471 |
-
|
472 |
-
$this->_productsToCategoryPath = $this->_getReadAdapter()->fetchPairs($select);
|
473 |
-
}
|
474 |
-
|
475 |
-
$value = '';
|
476 |
-
if (isset($this->_productsToCategoryPath[$productId])) {
|
477 |
-
$paths = explode(',', $this->_productsToCategoryPath[$productId]);
|
478 |
-
foreach ($paths as $path) {
|
479 |
-
$categoryIds = explode('/', $path);
|
480 |
-
$categoryIdsCount = count($categoryIds);
|
481 |
-
$categoryPath = '';
|
482 |
-
for($i=2;$i < $categoryIdsCount;$i++) {
|
483 |
-
if (!isset($this->_categoryNames[$categoryIds[$i]])) {
|
484 |
-
continue 2;
|
485 |
-
}
|
486 |
-
$categoryPath .= urlencode(trim($this->_categoryNames[$categoryIds[$i]])).'/';
|
487 |
-
}
|
488 |
-
if ($categoryIdsCount > 2) {
|
489 |
-
$value .= rtrim($categoryPath,'/').'|';
|
490 |
-
}
|
491 |
-
}
|
492 |
-
$value = trim($value, '|');
|
493 |
-
}
|
494 |
-
|
495 |
-
return $value;
|
496 |
-
}
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Return all product children ids
|
500 |
-
*
|
501 |
-
* @param int $productId Product Entity Id
|
502 |
-
* @param string $typeId Super Product Link Type
|
503 |
-
* @return array
|
504 |
-
*/
|
505 |
-
protected function _getProductChildIds($productId, $typeId)
|
506 |
-
{
|
507 |
-
$typeInstance = $this->_getProductTypeInstance($typeId);
|
508 |
-
$relation = $typeInstance->isComposite()
|
509 |
-
? $typeInstance->getRelationInfo()
|
510 |
-
: false;
|
511 |
-
|
512 |
-
if ($relation && $relation->getTable() && $relation->getParentFieldName() && $relation->getChildFieldName()) {
|
513 |
-
$select = $this->_getReadAdapter()->select()
|
514 |
-
->from(
|
515 |
-
array('main' => $this->getTable($relation->getTable())),
|
516 |
-
array($relation->getChildFieldName()))
|
517 |
-
|
518 |
-
->join(
|
519 |
-
array('e' => $this->getTable('catalog/product')),
|
520 |
-
'main.'.$relation->getChildFieldName().'=e.entity_id',
|
521 |
-
array('entity_id', 'type_id', 'sku')
|
522 |
-
)
|
523 |
-
|
524 |
-
->where("{$relation->getParentFieldName()}=?", $productId);
|
525 |
-
if (!is_null($relation->getWhere())) {
|
526 |
-
$select->where($relation->getWhere());
|
527 |
-
}
|
528 |
-
return $this->_getReadAdapter()->fetchAll($select);
|
529 |
-
}
|
530 |
-
|
531 |
-
return null;
|
532 |
-
}
|
533 |
-
|
534 |
-
/**
|
535 |
-
* Retrieve attribute source value for search
|
536 |
-
* This method is mostly copied from Mage_CatalogSearch_Model_Resource_Fulltext, but it also retrieves attribute values from non-searchable/non-filterable attributes
|
537 |
-
*
|
538 |
-
* @param int $attributeId
|
539 |
-
* @param mixed $value
|
540 |
-
* @param int $storeId
|
541 |
-
* @return mixed
|
542 |
-
*/
|
543 |
-
protected function _getAttributeValue($attributeId, $value, $storeId)
|
544 |
-
{
|
545 |
-
$attribute = $this->_getSearchableAttribute($attributeId);
|
546 |
-
if (!$attribute->getIsSearchable() && $attribute->getAttributeCode() == 'visibility') {
|
547 |
-
return $value;
|
548 |
-
}
|
549 |
-
|
550 |
-
if ($attribute->usesSource()) {
|
551 |
-
if ($this->_engine !== null && method_exists($this->_engine, 'allowAdvancedIndex') && $this->_engine->allowAdvancedIndex()) {
|
552 |
-
return $value;
|
553 |
-
}
|
554 |
-
|
555 |
-
$attribute->setStoreId($storeId);
|
556 |
-
$value = $attribute->getSource()->getOptionText($value);
|
557 |
-
|
558 |
-
if (is_array($value)) {
|
559 |
-
$value = implode($this->_separator, $value);
|
560 |
-
} elseif (empty($value)) {
|
561 |
-
$inputType = $attribute->getFrontend()->getInputType();
|
562 |
-
if ($inputType == 'select' || $inputType == 'multiselect') {
|
563 |
-
return null;
|
564 |
-
}
|
565 |
-
}
|
566 |
-
} elseif ($attribute->getBackendType() == 'datetime') {
|
567 |
-
$value = $this->_getStoreDate($storeId, $value);
|
568 |
-
} else {
|
569 |
-
$inputType = $attribute->getFrontend()->getInputType();
|
570 |
-
if ($inputType == 'price') {
|
571 |
-
$value = Mage::app()->getStore($storeId)->roundPrice($value);
|
572 |
-
}
|
573 |
-
}
|
574 |
-
|
575 |
-
// Add spaces before HTML Tags, so that strip_tags() does not join word which were in different block elements
|
576 |
-
// Additional spaces are not an issue, because they will be removed in the next step anyway
|
577 |
-
$value = preg_replace('/</u', ' <', $value);
|
578 |
-
|
579 |
-
$value = preg_replace("#\s+#siu", ' ', trim(strip_tags($value)));
|
580 |
-
|
581 |
-
return $value;
|
582 |
-
}
|
583 |
-
|
584 |
-
/**
|
585 |
-
* get Attribute Row Array
|
586 |
-
*
|
587 |
-
* @param array $dataArray Export row Array
|
588 |
-
* @param array $attributes Attributes Array
|
589 |
-
* @param int $storeId Store ID
|
590 |
-
*/
|
591 |
-
protected function _getAttributesRowArray(&$dataArray, $values, $storeId=null)
|
592 |
-
{
|
593 |
-
// get attributes objects assigned to their position at the export
|
594 |
-
if ($this->_exportAttributes == null) {
|
595 |
-
$this->_exportAttributes = array_fill(0, sizeof($this->_getExportAttributes()), null);
|
596 |
-
|
597 |
-
$attributeCodes = array_flip($this->_getExportAttributes());
|
598 |
-
foreach ($this->_getSearchableAttributes() as $attribute) {
|
599 |
-
if (isset($attributeCodes[$attribute->getAttributeCode()]) && !in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility'))) {
|
600 |
-
$this->_exportAttributes[$attributeCodes[$attribute->getAttributeCode()]] = $attribute;
|
601 |
-
}
|
602 |
-
}
|
603 |
-
}
|
604 |
-
// fill dataArray with the values of the attributes that should be exported
|
605 |
-
foreach($this->_exportAttributes AS $pos => $attribute) {
|
606 |
-
if ($attribute != null) {
|
607 |
-
$value = isset($values[$attribute->getId()]) ? $values[$attribute->getId()] : null;
|
608 |
-
$dataArray[$pos] = $this->_getAttributeValue($attribute->getId(), $value, $storeId);
|
609 |
-
} else if (!array_key_exists($pos, $dataArray)) {
|
610 |
-
// it is very unlikely that an attribute exists in the header but is not delivered by "getSearchableAttributes",
|
611 |
-
// but actually it might be a result of a broken database or something like that..
|
612 |
-
$dataArray[$pos] = null;
|
613 |
-
}
|
614 |
-
}
|
615 |
-
}
|
616 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* This helper class provides the Product export
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Export_Product extends Mage_CatalogSearch_Model_Mysql4_Fulltext {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Option ID to Value Mapping Array
|
25 |
+
* @var mixed
|
26 |
+
*/
|
27 |
+
protected $_optionIdToValue = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Products to Category Path Mapping
|
31 |
+
*
|
32 |
+
* @var mixed
|
33 |
+
*/
|
34 |
+
protected $_productsToCategoryPath = null;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Category Names by ID
|
38 |
+
* @var mixed
|
39 |
+
*/
|
40 |
+
protected $_categoryNames = null;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* export attribute codes
|
44 |
+
* @var mixed
|
45 |
+
*/
|
46 |
+
protected $_exportAttributeCodes = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* export attribute objects
|
50 |
+
* @var mixed
|
51 |
+
*/
|
52 |
+
protected $_exportAttributes = null;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* helper to generate the image urls
|
56 |
+
* @var Mage_Catalog_Helper_Image
|
57 |
+
*/
|
58 |
+
protected $_imageHelper = null;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* add CSV Row
|
62 |
+
*
|
63 |
+
* @param array $data
|
64 |
+
*/
|
65 |
+
protected function _addCsvRow($data)
|
66 |
+
{
|
67 |
+
foreach ($data as &$item) {
|
68 |
+
$item = str_replace(array("\r", "\n", "\""), array(' ', ' ', "''"), trim( strip_tags($item), ';') );
|
69 |
+
}
|
70 |
+
|
71 |
+
echo '"'.implode('";"', $data).'"'."\n";
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* get Option Text by Option ID
|
76 |
+
*
|
77 |
+
* @param int $optionId Option ID
|
78 |
+
* @param int $storeId Store ID
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
protected function _getAttributeOptionText($optionId, $storeId)
|
82 |
+
{
|
83 |
+
$value = '';
|
84 |
+
if (intval($optionId)) {
|
85 |
+
if ($this->_optionIdToValue === null) {
|
86 |
+
/*@var $optionCollection Mage_Eav_Model_Mysql4_Entity_Attribute_Option_Collection */
|
87 |
+
$optionCollection = Mage::getResourceModel('eav/entity_attribute_option_collection');
|
88 |
+
$optionCollection->setStoreFilter($storeId);
|
89 |
+
$this->_optionIdToValue = array();
|
90 |
+
foreach ($optionCollection as $option) {
|
91 |
+
$this->_optionIdToValue[$option->getId()] = $option->getValue();
|
92 |
+
}
|
93 |
+
}
|
94 |
+
$value = isset($this->_optionIdToValue[$optionId]) ? $this->_optionIdToValue[$optionId] : '';
|
95 |
+
}
|
96 |
+
return $value;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* get CSV Header Array
|
101 |
+
*
|
102 |
+
* @param int $storeId
|
103 |
+
* @return array
|
104 |
+
*/
|
105 |
+
protected function _getExportAttributes($storeId = null)
|
106 |
+
{
|
107 |
+
if($this->_exportAttributeCodes === null){
|
108 |
+
$headerDefault = array('id', 'parent_id', 'sku', 'category', 'filterable_attributes', 'searchable_attributes');
|
109 |
+
$headerDynamic = array();
|
110 |
+
|
111 |
+
if (Mage::getStoreConfigFlag('factfinder/export/urls', $storeId)) {
|
112 |
+
$headerDefault[] = 'image';
|
113 |
+
$headerDefault[] = 'deeplink';
|
114 |
+
$this->_imageHelper = Mage::helper('catalog/image');
|
115 |
+
}
|
116 |
+
|
117 |
+
// get dynamic Attributes
|
118 |
+
foreach ($this->_getSearchableAttributes(null, 'system', $storeId) as $attribute) {
|
119 |
+
if (in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility'))) {
|
120 |
+
continue;
|
121 |
+
}
|
122 |
+
$headerDynamic[] = $attribute->getAttributeCode();
|
123 |
+
}
|
124 |
+
|
125 |
+
// compare dynamic with setup attributes
|
126 |
+
$headerSetup = Mage::helper('factfinder/backend')->makeArrayFieldValue(Mage::getStoreConfig('factfinder/export/attributes', $storeId));
|
127 |
+
$setupUpdate = false;
|
128 |
+
foreach($headerDynamic as $code){
|
129 |
+
if(in_array($code, $headerSetup)){
|
130 |
+
continue;
|
131 |
+
}
|
132 |
+
$headerSetup[$code]['attribute'] = $code;
|
133 |
+
$setupUpdate = true;
|
134 |
+
}
|
135 |
+
|
136 |
+
// remove default attributes from setup
|
137 |
+
foreach($headerDefault as $code){
|
138 |
+
if(array_key_exists($code, $headerSetup)){
|
139 |
+
unset($headerSetup[$code]);
|
140 |
+
$setupUpdate = true;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
if($setupUpdate === true){
|
145 |
+
Mage::getModel('core/config')->saveConfig('factfinder/export/attributes', Mage::helper('factfinder/backend')->makeStorableArrayFieldValue($headerSetup), 'stores', $storeId);
|
146 |
+
}
|
147 |
+
|
148 |
+
$this->_exportAttributeCodes = array_merge($headerDefault, array_keys($headerSetup));
|
149 |
+
}
|
150 |
+
return $this->_exportAttributeCodes;
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
/**
|
155 |
+
* export Product Data with Attributes
|
156 |
+
* direct Output as CSV
|
157 |
+
*
|
158 |
+
* @param int $storeId Store View Id
|
159 |
+
*/
|
160 |
+
public function doExport($storeId = null)
|
161 |
+
{
|
162 |
+
$idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
|
163 |
+
$exportImageAndDeeplink = Mage::getStoreConfigFlag('factfinder/export/urls', $storeId);
|
164 |
+
if ($exportImageAndDeeplink) {
|
165 |
+
$imageType = Mage::getStoreConfig('factfinder/export/suggest_image_type', $storeId);
|
166 |
+
$imageSize = (int) Mage::getStoreConfig('factfinder/export/suggest_image_size', $storeId);
|
167 |
+
}
|
168 |
+
|
169 |
+
$header = $this->_getExportAttributes($storeId);
|
170 |
+
$this->_addCsvRow($header);
|
171 |
+
|
172 |
+
// preparesearchable attributes
|
173 |
+
$staticFields = array();
|
174 |
+
foreach ($this->_getSearchableAttributes('static', 'system', $storeId) as $attribute) {
|
175 |
+
$staticFields[] = $attribute->getAttributeCode();
|
176 |
+
}
|
177 |
+
$dynamicFields = array(
|
178 |
+
'int' => array_keys($this->_getSearchableAttributes('int')),
|
179 |
+
'varchar' => array_keys($this->_getSearchableAttributes('varchar')),
|
180 |
+
'text' => array_keys($this->_getSearchableAttributes('text')),
|
181 |
+
'decimal' => array_keys($this->_getSearchableAttributes('decimal')),
|
182 |
+
'datetime' => array_keys($this->_getSearchableAttributes('datetime')),
|
183 |
+
);
|
184 |
+
|
185 |
+
// status and visibility filter
|
186 |
+
$visibility = $this->_getSearchableAttribute('visibility');
|
187 |
+
$status = $this->_getSearchableAttribute('status');
|
188 |
+
$visibilityVals = Mage::getSingleton('catalog/product_visibility')->getVisibleInSearchIds();
|
189 |
+
$statusVals = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();
|
190 |
+
|
191 |
+
$lastProductId = 0;
|
192 |
+
while (true) {
|
193 |
+
$products = $this->_getSearchableProducts($storeId, $staticFields, null, $lastProductId);
|
194 |
+
if (!$products) {
|
195 |
+
break;
|
196 |
+
}
|
197 |
+
|
198 |
+
$productRelations = array();
|
199 |
+
foreach ($products as $productData) {
|
200 |
+
$lastProductId = $productData['entity_id'];
|
201 |
+
$productAttributes[$productData['entity_id']] = $productData['entity_id'];
|
202 |
+
$productChilds = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']);
|
203 |
+
$productRelations[$productData['entity_id']] = $productChilds;
|
204 |
+
if ($productChilds) {
|
205 |
+
foreach ($productChilds as $productChild) {
|
206 |
+
$productAttributes[$productChild['entity_id']] = $productChild;
|
207 |
+
}
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
$productAttributes = $this->_getProductAttributes($storeId, array_keys($productAttributes), $dynamicFields);
|
212 |
+
foreach ($products as $productData) {
|
213 |
+
if (!isset($productAttributes[$productData['entity_id']])) {
|
214 |
+
continue;
|
215 |
+
}
|
216 |
+
$productAttr = $productAttributes[$productData['entity_id']];
|
217 |
+
|
218 |
+
if (!isset($productAttr[$visibility->getId()]) || !in_array($productAttr[$visibility->getId()], $visibilityVals)) {
|
219 |
+
continue;
|
220 |
+
}
|
221 |
+
if (!isset($productAttr[$status->getId()]) || !in_array($productAttr[$status->getId()], $statusVals)) {
|
222 |
+
continue;
|
223 |
+
}
|
224 |
+
|
225 |
+
$productIndex = array(
|
226 |
+
$productData['entity_id'],
|
227 |
+
$productData[$idFieldName],
|
228 |
+
$productData['sku'],
|
229 |
+
$this->_getCategoryPath($productData['entity_id'], $storeId),
|
230 |
+
$this->_formatFilterableAttributes($this->_getSearchableAttributes(null, 'filterable'), $productAttr, $storeId),
|
231 |
+
$this->_formatSearchableAttributes($this->_getSearchableAttributes(null, 'searchable'), $productAttr, $storeId)
|
232 |
+
);
|
233 |
+
|
234 |
+
if ($exportImageAndDeeplink) {
|
235 |
+
$product = Mage::getModel("catalog/product");
|
236 |
+
$product->setStoreId($storeId);
|
237 |
+
$product->load($productData['entity_id']);
|
238 |
+
|
239 |
+
$productIndex[] = (string) $this->_imageHelper->init($product, $imageType)->resize($imageSize);
|
240 |
+
$productIndex[] = $product->getProductUrl();
|
241 |
+
}
|
242 |
+
|
243 |
+
$this->_getAttributesRowArray($productIndex, $productAttr, $storeId);
|
244 |
+
|
245 |
+
$this->_addCsvRow($productIndex);
|
246 |
+
|
247 |
+
if ($productChilds = $productRelations[$productData['entity_id']]) {
|
248 |
+
foreach ($productChilds as $productChild) {
|
249 |
+
if (isset($productAttributes[$productChild['entity_id']])) {
|
250 |
+
/* should be used if sub products should not be exported because of their status
|
251 |
+
$subProductAttr = $productAttributes[$productChild[ 'entity_id' ]];
|
252 |
+
if (!isset($subProductAttr[$status->getId()]) || !in_array($subProductAttr[$status->getId()], $statusVals)) {
|
253 |
+
continue;
|
254 |
+
} */
|
255 |
+
|
256 |
+
$subProductIndex = array(
|
257 |
+
$productChild['entity_id'],
|
258 |
+
$productData[$idFieldName],
|
259 |
+
$productChild['sku'],
|
260 |
+
$this->_getCategoryPath($productData['entity_id'], $storeId),
|
261 |
+
$this->_formatFilterableAttributes($this->_getSearchableAttributes(null, 'filterable'), $productAttributes[$productChild['entity_id']], $storeId),
|
262 |
+
$this->_formatSearchableAttributes($this->_getSearchableAttributes(null, 'searchable'), $productAttributes[$productChild['entity_id']], $storeId)
|
263 |
+
);
|
264 |
+
if ($exportImageAndDeeplink) {
|
265 |
+
//dont need to add image and deeplink to child product, just add empty values
|
266 |
+
$subProductIndex[] = '';
|
267 |
+
$subProductIndex[] = '';
|
268 |
+
}
|
269 |
+
$this->_getAttributesRowArray($subProductIndex, $productAttributes[$productChild['entity_id']], $storeId);
|
270 |
+
|
271 |
+
$this->_addCsvRow($subProductIndex);
|
272 |
+
}
|
273 |
+
}
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
unset($products);
|
278 |
+
unset($productAttributes);
|
279 |
+
unset($productRelations);
|
280 |
+
flush();
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
protected function _formatSearchableAttributes($attributes, $values, $storeId=null)
|
285 |
+
{
|
286 |
+
$returnArray = array();
|
287 |
+
foreach ($attributes as $attribute) {
|
288 |
+
$value = isset($values[$attribute->getId()]) ? $values[$attribute->getId()] : null;
|
289 |
+
if (!$value || in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility', 'price'))) {
|
290 |
+
continue;
|
291 |
+
}
|
292 |
+
$attributeValue = $this->_getAttributeValue($attribute->getId(), $value, $storeId);
|
293 |
+
if (strval($attributeValue) != "") {
|
294 |
+
$returnArray[] = $attributeValue;
|
295 |
+
}
|
296 |
+
}
|
297 |
+
return implode(',', $returnArray);
|
298 |
+
}
|
299 |
+
|
300 |
+
protected function _formatFilterableAttributes($attributes, $values, $storeId=null)
|
301 |
+
{
|
302 |
+
$returnArray = array();
|
303 |
+
foreach ($attributes as $attribute) {
|
304 |
+
$value = isset($values[$attribute->getId()]) ? $values[$attribute->getId()] : null;
|
305 |
+
if (!$value || in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility', 'price'))) {
|
306 |
+
continue;
|
307 |
+
}
|
308 |
+
$attributeValue = $this->_getAttributeValue($attribute->getId(), $value, $storeId);
|
309 |
+
$attributeValues = array();
|
310 |
+
if (strpos($attributeValue, '|') !== false) {
|
311 |
+
$attributeValues = explode('|', $attributeValue);
|
312 |
+
} else {
|
313 |
+
$attributeValues[] = $attributeValue;
|
314 |
+
}
|
315 |
+
|
316 |
+
foreach ($attributeValues AS $value) {
|
317 |
+
if (strval($value) != "") {
|
318 |
+
$returnArray[] = $attribute->getAttributeCode().'='.$value;
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
return implode('|', $returnArray);
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Retrieve Searchable attributes
|
327 |
+
*
|
328 |
+
* @param string $backendType
|
329 |
+
* @param string $type possible Types: system, sortable, filterable, searchable
|
330 |
+
* @return array
|
331 |
+
*/
|
332 |
+
protected function _getSearchableAttributes($backendType = null, $type = null, $storeId = null)
|
333 |
+
{
|
334 |
+
if (is_null($this->_searchableAttributes)) {
|
335 |
+
$this->_searchableAttributes = array();
|
336 |
+
$entityType = $this->getEavConfig()->getEntityType('catalog_product');
|
337 |
+
$entity = $entityType->getEntity();
|
338 |
+
|
339 |
+
$userDefinedAttributes = array_keys(Mage::helper('factfinder/backend')->makeArrayFieldValue(Mage::getStoreConfig('factfinder/export/attributes', $storeId)));
|
340 |
+
|
341 |
+
$whereCond = array(
|
342 |
+
$this->_getWriteAdapter()->quoteInto('additional_table.is_searchable=? or additional_table.is_filterable=? or additional_table.used_for_sort_by=?', 1),
|
343 |
+
$this->_getWriteAdapter()->quoteInto('main_table.attribute_code IN(?)', array_merge(array('status', 'visibility'), $userDefinedAttributes))
|
344 |
+
);
|
345 |
+
|
346 |
+
$select = $this->_getWriteAdapter()->select()
|
347 |
+
->from(array('main_table' => $this->getTable('eav/attribute')))
|
348 |
+
->join(
|
349 |
+
array('additional_table' => $this->getTable('catalog/eav_attribute')),
|
350 |
+
'additional_table.attribute_id = main_table.attribute_id'
|
351 |
+
)
|
352 |
+
->where('main_table.entity_type_id=?', $entityType->getEntityTypeId())
|
353 |
+
->where(join(' OR ', $whereCond))
|
354 |
+
->order('main_table.attribute_id', 'asc');
|
355 |
+
|
356 |
+
$attributesData = $this->_getWriteAdapter()->fetchAll($select);
|
357 |
+
$this->getEavConfig()->importAttributesData($entityType, $attributesData);
|
358 |
+
foreach ($attributesData as $attributeData) {
|
359 |
+
$attributeCode = $attributeData['attribute_code'];
|
360 |
+
$attribute = $this->getEavConfig()->getAttribute($entityType, $attributeCode);
|
361 |
+
$attribute->setEntity($entity);
|
362 |
+
$this->_searchableAttributes[$attribute->getId()] = $attribute;
|
363 |
+
}
|
364 |
+
unset($attributesData);
|
365 |
+
}
|
366 |
+
|
367 |
+
if (!is_null($type) || !is_null($backendType)) {
|
368 |
+
$attributes = array();
|
369 |
+
foreach ($this->_searchableAttributes as $attribute) {
|
370 |
+
|
371 |
+
if (!is_null($backendType)
|
372 |
+
&& $attribute->getBackendType() != $backendType) {
|
373 |
+
continue;
|
374 |
+
}
|
375 |
+
|
376 |
+
switch($type) {
|
377 |
+
|
378 |
+
case "system":
|
379 |
+
if ($attribute->getIsUserDefined()
|
380 |
+
&& !$attribute->getUsedForSortBy()) {
|
381 |
+
continue 2;
|
382 |
+
}
|
383 |
+
break;
|
384 |
+
|
385 |
+
case "sortable":
|
386 |
+
if (!$attribute->getUsedForSortBy()) {
|
387 |
+
continue 2;
|
388 |
+
}
|
389 |
+
break;
|
390 |
+
|
391 |
+
case "filterable":
|
392 |
+
if (!$attribute->getIsFilterableInSearch()
|
393 |
+
|| in_array($attribute->getAttributeCode(), $this->_getExportAttributes())) {
|
394 |
+
continue 2;
|
395 |
+
}
|
396 |
+
break;
|
397 |
+
|
398 |
+
case "searchable":
|
399 |
+
if (!$attribute->getIsUserDefined()
|
400 |
+
|| !$attribute->getIsSearchable()
|
401 |
+
|| in_array($attribute->getAttributeCode(), $this->_getExportAttributes())) {
|
402 |
+
continue 2;
|
403 |
+
}
|
404 |
+
break;
|
405 |
+
}
|
406 |
+
|
407 |
+
$attributes[$attribute->getId()] = $attribute;
|
408 |
+
}
|
409 |
+
return $attributes;
|
410 |
+
}
|
411 |
+
return $this->_searchableAttributes;
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Get Category Path by Product ID
|
416 |
+
*
|
417 |
+
* @param int $productId
|
418 |
+
* @param int $storeId
|
419 |
+
* @return string
|
420 |
+
*/
|
421 |
+
protected function _getCategoryPath($productId, $storeId = null)
|
422 |
+
{
|
423 |
+
|
424 |
+
if ($this->_categoryNames === null) {
|
425 |
+
$categoryCollection = Mage::getResourceModel('catalog/category_attribute_collection');
|
426 |
+
$categoryCollection->getSelect()->where("attribute_code IN('name', 'is_active')");
|
427 |
+
|
428 |
+
foreach ($categoryCollection as $categoryModel) {
|
429 |
+
${$categoryModel->getAttributeCode().'Model'} = $categoryModel;
|
430 |
+
}
|
431 |
+
|
432 |
+
$select = $this->_getReadAdapter()->select()
|
433 |
+
->from(
|
434 |
+
array('main' => $nameModel->getBackendTable()),
|
435 |
+
array('entity_id', 'value')
|
436 |
+
)
|
437 |
+
->join(
|
438 |
+
array('e' => $is_activeModel->getBackendTable()),
|
439 |
+
'main.entity_id=e.entity_id AND (e.store_id = 0 OR e.store_id = '.$storeId.') AND e.attribute_id='.$is_activeModel->getAttributeId(),
|
440 |
+
null
|
441 |
+
)
|
442 |
+
->where('main.attribute_id=?', $nameModel->getAttributeId())
|
443 |
+
->where('e.value=?', '1')
|
444 |
+
->where('main.store_id = 0 OR main.store_id = ?', $storeId);
|
445 |
+
|
446 |
+
$this->_categoryNames = $this->_getReadAdapter()->fetchPairs($select);
|
447 |
+
}
|
448 |
+
|
449 |
+
if ($this->_productsToCategoryPath === null) {
|
450 |
+
$select = $this->_getReadAdapter()->select()
|
451 |
+
->from(
|
452 |
+
array('main' => $this->getTable('catalog/category_product_index')),
|
453 |
+
array('product_id')
|
454 |
+
)
|
455 |
+
->join(
|
456 |
+
array('e' => $this->getTable('catalog/category')),
|
457 |
+
'main.category_id=e.entity_id',
|
458 |
+
null
|
459 |
+
)
|
460 |
+
->columns(array('e.path' => new Zend_Db_Expr('GROUP_CONCAT(e.path)')))
|
461 |
+
->where(
|
462 |
+
'main.visibility IN(?)',
|
463 |
+
array(
|
464 |
+
Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_SEARCH,
|
465 |
+
Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH
|
466 |
+
)
|
467 |
+
)
|
468 |
+
->where('main.store_id = ?', $storeId)
|
469 |
+
->where('e.path LIKE \'1/' . Mage::app()->getStore($storeId)->getRootCategoryId() .'/%\'')
|
470 |
+
->group('main.product_id');
|
471 |
+
|
472 |
+
$this->_productsToCategoryPath = $this->_getReadAdapter()->fetchPairs($select);
|
473 |
+
}
|
474 |
+
|
475 |
+
$value = '';
|
476 |
+
if (isset($this->_productsToCategoryPath[$productId])) {
|
477 |
+
$paths = explode(',', $this->_productsToCategoryPath[$productId]);
|
478 |
+
foreach ($paths as $path) {
|
479 |
+
$categoryIds = explode('/', $path);
|
480 |
+
$categoryIdsCount = count($categoryIds);
|
481 |
+
$categoryPath = '';
|
482 |
+
for($i=2;$i < $categoryIdsCount;$i++) {
|
483 |
+
if (!isset($this->_categoryNames[$categoryIds[$i]])) {
|
484 |
+
continue 2;
|
485 |
+
}
|
486 |
+
$categoryPath .= urlencode(trim($this->_categoryNames[$categoryIds[$i]])).'/';
|
487 |
+
}
|
488 |
+
if ($categoryIdsCount > 2) {
|
489 |
+
$value .= rtrim($categoryPath,'/').'|';
|
490 |
+
}
|
491 |
+
}
|
492 |
+
$value = trim($value, '|');
|
493 |
+
}
|
494 |
+
|
495 |
+
return $value;
|
496 |
+
}
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Return all product children ids
|
500 |
+
*
|
501 |
+
* @param int $productId Product Entity Id
|
502 |
+
* @param string $typeId Super Product Link Type
|
503 |
+
* @return array
|
504 |
+
*/
|
505 |
+
protected function _getProductChildIds($productId, $typeId)
|
506 |
+
{
|
507 |
+
$typeInstance = $this->_getProductTypeInstance($typeId);
|
508 |
+
$relation = $typeInstance->isComposite()
|
509 |
+
? $typeInstance->getRelationInfo()
|
510 |
+
: false;
|
511 |
+
|
512 |
+
if ($relation && $relation->getTable() && $relation->getParentFieldName() && $relation->getChildFieldName()) {
|
513 |
+
$select = $this->_getReadAdapter()->select()
|
514 |
+
->from(
|
515 |
+
array('main' => $this->getTable($relation->getTable())),
|
516 |
+
array($relation->getChildFieldName()))
|
517 |
+
|
518 |
+
->join(
|
519 |
+
array('e' => $this->getTable('catalog/product')),
|
520 |
+
'main.'.$relation->getChildFieldName().'=e.entity_id',
|
521 |
+
array('entity_id', 'type_id', 'sku')
|
522 |
+
)
|
523 |
+
|
524 |
+
->where("{$relation->getParentFieldName()}=?", $productId);
|
525 |
+
if (!is_null($relation->getWhere())) {
|
526 |
+
$select->where($relation->getWhere());
|
527 |
+
}
|
528 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
529 |
+
}
|
530 |
+
|
531 |
+
return null;
|
532 |
+
}
|
533 |
+
|
534 |
+
/**
|
535 |
+
* Retrieve attribute source value for search
|
536 |
+
* This method is mostly copied from Mage_CatalogSearch_Model_Resource_Fulltext, but it also retrieves attribute values from non-searchable/non-filterable attributes
|
537 |
+
*
|
538 |
+
* @param int $attributeId
|
539 |
+
* @param mixed $value
|
540 |
+
* @param int $storeId
|
541 |
+
* @return mixed
|
542 |
+
*/
|
543 |
+
protected function _getAttributeValue($attributeId, $value, $storeId)
|
544 |
+
{
|
545 |
+
$attribute = $this->_getSearchableAttribute($attributeId);
|
546 |
+
if (!$attribute->getIsSearchable() && $attribute->getAttributeCode() == 'visibility') {
|
547 |
+
return $value;
|
548 |
+
}
|
549 |
+
|
550 |
+
if ($attribute->usesSource()) {
|
551 |
+
if ($this->_engine !== null && method_exists($this->_engine, 'allowAdvancedIndex') && $this->_engine->allowAdvancedIndex()) {
|
552 |
+
return $value;
|
553 |
+
}
|
554 |
+
|
555 |
+
$attribute->setStoreId($storeId);
|
556 |
+
$value = $attribute->getSource()->getOptionText($value);
|
557 |
+
|
558 |
+
if (is_array($value)) {
|
559 |
+
$value = implode($this->_separator, $value);
|
560 |
+
} elseif (empty($value)) {
|
561 |
+
$inputType = $attribute->getFrontend()->getInputType();
|
562 |
+
if ($inputType == 'select' || $inputType == 'multiselect') {
|
563 |
+
return null;
|
564 |
+
}
|
565 |
+
}
|
566 |
+
} elseif ($attribute->getBackendType() == 'datetime') {
|
567 |
+
$value = $this->_getStoreDate($storeId, $value);
|
568 |
+
} else {
|
569 |
+
$inputType = $attribute->getFrontend()->getInputType();
|
570 |
+
if ($inputType == 'price') {
|
571 |
+
$value = Mage::app()->getStore($storeId)->roundPrice($value);
|
572 |
+
}
|
573 |
+
}
|
574 |
+
|
575 |
+
// Add spaces before HTML Tags, so that strip_tags() does not join word which were in different block elements
|
576 |
+
// Additional spaces are not an issue, because they will be removed in the next step anyway
|
577 |
+
$value = preg_replace('/</u', ' <', $value);
|
578 |
+
|
579 |
+
$value = preg_replace("#\s+#siu", ' ', trim(strip_tags($value)));
|
580 |
+
|
581 |
+
return $value;
|
582 |
+
}
|
583 |
+
|
584 |
+
/**
|
585 |
+
* get Attribute Row Array
|
586 |
+
*
|
587 |
+
* @param array $dataArray Export row Array
|
588 |
+
* @param array $attributes Attributes Array
|
589 |
+
* @param int $storeId Store ID
|
590 |
+
*/
|
591 |
+
protected function _getAttributesRowArray(&$dataArray, $values, $storeId=null)
|
592 |
+
{
|
593 |
+
// get attributes objects assigned to their position at the export
|
594 |
+
if ($this->_exportAttributes == null) {
|
595 |
+
$this->_exportAttributes = array_fill(0, sizeof($this->_getExportAttributes()), null);
|
596 |
+
|
597 |
+
$attributeCodes = array_flip($this->_getExportAttributes());
|
598 |
+
foreach ($this->_getSearchableAttributes() as $attribute) {
|
599 |
+
if (isset($attributeCodes[$attribute->getAttributeCode()]) && !in_array($attribute->getAttributeCode(), array('sku', 'status', 'visibility'))) {
|
600 |
+
$this->_exportAttributes[$attributeCodes[$attribute->getAttributeCode()]] = $attribute;
|
601 |
+
}
|
602 |
+
}
|
603 |
+
}
|
604 |
+
// fill dataArray with the values of the attributes that should be exported
|
605 |
+
foreach($this->_exportAttributes AS $pos => $attribute) {
|
606 |
+
if ($attribute != null) {
|
607 |
+
$value = isset($values[$attribute->getId()]) ? $values[$attribute->getId()] : null;
|
608 |
+
$dataArray[$pos] = $this->_getAttributeValue($attribute->getId(), $value, $storeId);
|
609 |
+
} else if (!array_key_exists($pos, $dataArray)) {
|
610 |
+
// it is very unlikely that an attribute exists in the header but is not delivered by "getSearchableAttributes",
|
611 |
+
// but actually it might be a result of a broken database or something like that..
|
612 |
+
$dataArray[$pos] = null;
|
613 |
+
}
|
614 |
+
}
|
615 |
+
}
|
616 |
+
}
|
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* This helper class provides the Stock export
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Export_Stock extends Mage_Core_Model_Mysql4_Abstract {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* defines Export Columns
|
25 |
-
* @var array
|
26 |
-
*/
|
27 |
-
protected $_exportColumns = array('product_id', 'qty', 'stock_status');
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Resource initialization
|
31 |
-
*/
|
32 |
-
protected function _construct(){
|
33 |
-
$this->_setResource('core');
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* add CSV Row
|
38 |
-
*
|
39 |
-
* @param array $data
|
40 |
-
*/
|
41 |
-
protected function _addCsvRow($data)
|
42 |
-
{
|
43 |
-
foreach($data as &$item){
|
44 |
-
$item = str_replace(array("\r", "\n", "\""), ' ', addcslashes(strip_tags($item), '"'));
|
45 |
-
}
|
46 |
-
|
47 |
-
echo '"'.implode('";"', $data).'"'."\n";
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* export Stock Data
|
52 |
-
* direct Output as CSV
|
53 |
-
*
|
54 |
-
* @param int $storeId Store Id
|
55 |
-
*/
|
56 |
-
public function doExport($storeId = null)
|
57 |
-
{
|
58 |
-
$this->_addCsvRow($this->_exportColumns);
|
59 |
-
for($i=1; $stocks = $this->_getStockData($storeId, $i); $i++){
|
60 |
-
foreach($stocks as $stock){
|
61 |
-
$this->_addCsvRow($stock);
|
62 |
-
}
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* get Stocks from Stock Index Table
|
68 |
-
*
|
69 |
-
* @param int $storeId Store ID
|
70 |
-
* @param int $part
|
71 |
-
* @param int $limit
|
72 |
-
* @return array
|
73 |
-
*/
|
74 |
-
protected function _getStockData($storeId, $part = 1, $limit = 100){
|
75 |
-
|
76 |
-
$store = Mage::app()->getStore($storeId);
|
77 |
-
$select = $this->_getWriteAdapter()->select()
|
78 |
-
->from(
|
79 |
-
array('e' => $this->getTable('cataloginventory/stock_status')),
|
80 |
-
$this->_exportColumns);
|
81 |
-
|
82 |
-
if($storeId !== null){
|
83 |
-
$select->where('e.website_id = ?', $store->getWebsiteId());
|
84 |
-
}
|
85 |
-
|
86 |
-
$select->limitPage($part, $limit)
|
87 |
-
->order('e.product_id');
|
88 |
-
|
89 |
-
return $this->_getWriteAdapter()->fetchAll($select);
|
90 |
-
}
|
91 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* This helper class provides the Stock export
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Export_Stock extends Mage_Core_Model_Mysql4_Abstract {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* defines Export Columns
|
25 |
+
* @var array
|
26 |
+
*/
|
27 |
+
protected $_exportColumns = array('product_id', 'qty', 'stock_status');
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Resource initialization
|
31 |
+
*/
|
32 |
+
protected function _construct(){
|
33 |
+
$this->_setResource('core');
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* add CSV Row
|
38 |
+
*
|
39 |
+
* @param array $data
|
40 |
+
*/
|
41 |
+
protected function _addCsvRow($data)
|
42 |
+
{
|
43 |
+
foreach($data as &$item){
|
44 |
+
$item = str_replace(array("\r", "\n", "\""), ' ', addcslashes(strip_tags($item), '"'));
|
45 |
+
}
|
46 |
+
|
47 |
+
echo '"'.implode('";"', $data).'"'."\n";
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* export Stock Data
|
52 |
+
* direct Output as CSV
|
53 |
+
*
|
54 |
+
* @param int $storeId Store Id
|
55 |
+
*/
|
56 |
+
public function doExport($storeId = null)
|
57 |
+
{
|
58 |
+
$this->_addCsvRow($this->_exportColumns);
|
59 |
+
for($i=1; $stocks = $this->_getStockData($storeId, $i); $i++){
|
60 |
+
foreach($stocks as $stock){
|
61 |
+
$this->_addCsvRow($stock);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* get Stocks from Stock Index Table
|
68 |
+
*
|
69 |
+
* @param int $storeId Store ID
|
70 |
+
* @param int $part
|
71 |
+
* @param int $limit
|
72 |
+
* @return array
|
73 |
+
*/
|
74 |
+
protected function _getStockData($storeId, $part = 1, $limit = 100){
|
75 |
+
|
76 |
+
$store = Mage::app()->getStore($storeId);
|
77 |
+
$select = $this->_getWriteAdapter()->select()
|
78 |
+
->from(
|
79 |
+
array('e' => $this->getTable('cataloginventory/stock_status')),
|
80 |
+
$this->_exportColumns);
|
81 |
+
|
82 |
+
if($storeId !== null){
|
83 |
+
$select->where('e.website_id = ?', $store->getWebsiteId());
|
84 |
+
}
|
85 |
+
|
86 |
+
$select->limitPage($part, $limit)
|
87 |
+
->order('e.product_id');
|
88 |
+
|
89 |
+
return $this->_getWriteAdapter()->fetchAll($select);
|
90 |
+
}
|
91 |
+
}
|
@@ -1,539 +1,549 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
require_once BP.DS.'lib'.DS.'FACTFinder'.DS.'Loader.php';
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Model class
|
14 |
-
*
|
15 |
-
* Facade that hides FACT-Finder API Framework for Magento
|
16 |
-
*
|
17 |
-
* @category Mage
|
18 |
-
* @package Flagbit_FactFinder
|
19 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
20 |
-
* @author Joerg Weller <weller@flagbit.de>
|
21 |
-
* @version $Id: Facade.php 906 2011-09-30 14:10:05Z tuerk $
|
22 |
-
*/
|
23 |
-
class Flagbit_FactFinder_Model_Facade
|
24 |
-
{
|
25 |
-
/**
|
26 |
-
* Two-dimensional array of FACT-Finder adapters
|
27 |
-
* First-dimension key corresponds to type
|
28 |
-
* Second-dimension key corresponds to channel
|
29 |
-
* @var array of FACTFinder_Abstract_Adapter
|
30 |
-
*/
|
31 |
-
protected $_adapters = array();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Key corresponds to channel
|
35 |
-
* @var array of FACTFinder_Http_StatusHelper
|
36 |
-
*/
|
37 |
-
protected $_statusHelpers = array();
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @var FACTFinder_Abstract_Configuration
|
41 |
-
*/
|
42 |
-
protected $_config = null;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @var FACTFinder_ParametersParser
|
46 |
-
*/
|
47 |
-
protected $_paramsParser = null;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* @var FACTFinder_Http_UrlBuilder
|
51 |
-
*/
|
52 |
-
protected $_urlBuilder = null;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* logger object to log all module internals
|
56 |
-
* @var FACTFinder_Abstract_Logger
|
57 |
-
*/
|
58 |
-
protected $_logger = null;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* map between known adapters and its state based on its parameters
|
62 |
-
* @var array
|
63 |
-
*/
|
64 |
-
protected $_paramHashes = array();
|
65 |
-
|
66 |
-
/**
|
67 |
-
* @var boolean is set to true, if caching is enabled and can be used
|
68 |
-
*/
|
69 |
-
private $_useCaching = null;
|
70 |
-
|
71 |
-
public function __construct($arg = null)
|
72 |
-
{
|
73 |
-
if ($arg === null || !($arg instanceof FACTFinder_Abstract_Logger)) {
|
74 |
-
$arg = Mage::helper('factfinder/debug');
|
75 |
-
}
|
76 |
-
FF::setLogger($arg);
|
77 |
-
$this->_logger = $arg;
|
78 |
-
}
|
79 |
-
|
80 |
-
public function getSearchAdapter($channel = null)
|
81 |
-
{
|
82 |
-
return $this->_getAdapter("search", $channel);
|
83 |
-
}
|
84 |
-
|
85 |
-
public function getScicAdapter($channel = null)
|
86 |
-
{
|
87 |
-
return $this->_getAdapter("scic", $channel);
|
88 |
-
}
|
89 |
-
|
90 |
-
public function getSuggestAdapter($channel = null)
|
91 |
-
{
|
92 |
-
return $this->_getAdapter("suggest", $channel);
|
93 |
-
}
|
94 |
-
|
95 |
-
public function getRecommendationAdapter($channel = null)
|
96 |
-
{
|
97 |
-
return $this->_getAdapter("recommendation", $channel);
|
98 |
-
}
|
99 |
-
|
100 |
-
public function getTagCloudAdapter($channel = null)
|
101 |
-
{
|
102 |
-
return $this->_getAdapter("tagCloud", $channel);
|
103 |
-
}
|
104 |
-
|
105 |
-
public function getCompareAdapter($channel = null)
|
106 |
-
{
|
107 |
-
return $this->_getAdapter("compare", $channel);
|
108 |
-
}
|
109 |
-
|
110 |
-
public function getImportAdapter($channel = null)
|
111 |
-
{
|
112 |
-
return $this->_getAdapter("import", $channel);
|
113 |
-
}
|
114 |
-
|
115 |
-
public function getProductCampaignAdapter($channel = null)
|
116 |
-
{
|
117 |
-
return $this->_getAdapter("productCampaign", $channel);
|
118 |
-
}
|
119 |
-
|
120 |
-
public function getSimilarRecordsAdapter($channel = null)
|
121 |
-
{
|
122 |
-
return $this->_getAdapter("similarRecords", $channel);
|
123 |
-
}
|
124 |
-
|
125 |
-
public function getTrackingAdapter($channel = null)
|
126 |
-
{
|
127 |
-
return $this->_getAdapter("tracking", $channel);
|
128 |
-
}
|
129 |
-
|
130 |
-
public function getLegacyTrackingAdapter($channel = null)
|
131 |
-
{
|
132 |
-
return $this->_getAdapter("legacyTracking", $channel);
|
133 |
-
}
|
134 |
-
|
135 |
-
public function configureSearchAdapter($params, $channel = null, $id = null)
|
136 |
-
{
|
137 |
-
$this->_configureAdapter($params, "search", $channel, $id);
|
138 |
-
}
|
139 |
-
|
140 |
-
public function configureScicAdapter($params, $channel = null, $id = null)
|
141 |
-
{
|
142 |
-
$this->_configureAdapter($params, "scic", $channel, $id);
|
143 |
-
}
|
144 |
-
|
145 |
-
public function configureSuggestAdapter($params, $channel = null, $id = null)
|
146 |
-
{
|
147 |
-
$this->_configureAdapter($params, "suggest", $channel, $id);
|
148 |
-
}
|
149 |
-
|
150 |
-
public function configureRecommendationAdapter($params, $channel = null, $id = null)
|
151 |
-
{
|
152 |
-
$this->_configureAdapter($params, "recommendation", $channel, $id);
|
153 |
-
}
|
154 |
-
|
155 |
-
public function configureTagCloudAdapter($params, $channel = null, $id = null)
|
156 |
-
{
|
157 |
-
$this->_configureAdapter($params, "tagCloud", $channel, $id);
|
158 |
-
}
|
159 |
-
|
160 |
-
public function configureCompareAdapter($params, $channel = null, $id = null)
|
161 |
-
{
|
162 |
-
$this->_configureAdapter($params, "compare", $channel, $id);
|
163 |
-
}
|
164 |
-
|
165 |
-
public function configureImportAdapter($params, $channel = null, $id = null)
|
166 |
-
{
|
167 |
-
$this->_configureAdapter($params, "import", $channel, $id);
|
168 |
-
}
|
169 |
-
|
170 |
-
public function configureProductCampaignAdapter($params, $channel = null, $id = null)
|
171 |
-
{
|
172 |
-
$this->_configureAdapter($params, "productCampaign", $channel, $id);
|
173 |
-
}
|
174 |
-
|
175 |
-
public function configureSimilarRecordsAdapter($params, $channel = null, $id = null)
|
176 |
-
{
|
177 |
-
$this->_configureAdapter($params, "similarRecords", $channel, $id);
|
178 |
-
}
|
179 |
-
|
180 |
-
public function configureTrackingAdapter($params, $channel = null, $id = null)
|
181 |
-
{
|
182 |
-
$this->_configureAdapter($params, "tracking", $channel, $id);
|
183 |
-
}
|
184 |
-
|
185 |
-
protected function _configureAdapter($params, $type, $channel = null, $id = null)
|
186 |
-
{
|
187 |
-
$adapter = $this->_getAdapter($type, $channel, $id);
|
188 |
-
$adapterId = $this->_getAdapterIdentifier($type, $channel, $id);
|
189 |
-
$this->_paramHashes[$adapterId] = $this->_createParametersHash($params);
|
190 |
-
|
191 |
-
foreach($params as $key => $value)
|
192 |
-
$adapter->setParam($key, $value);
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* returns the hash that identifies a certain combination of parameters.
|
197 |
-
* It represents the current parameter state of the adapter specified by $type, $channel and $id
|
198 |
-
*
|
199 |
-
* @param $type (any adapter type)
|
200 |
-
* @param $channel (default: null => default channel)
|
201 |
-
* @param $id (default: null => no special id)
|
202 |
-
* @return string
|
203 |
-
*/
|
204 |
-
protected function _getParametersHash($type, $channel = null, $id = null)
|
205 |
-
{
|
206 |
-
$returnValue = '';
|
207 |
-
$adapterId = $this->_getAdapterIdentifier($type, $channel, $id);
|
208 |
-
if (array_key_exists($adapterId, $this->_paramHashes))
|
209 |
-
{
|
210 |
-
$returnValue = $this->_paramHashes[$adapterId];
|
211 |
-
}
|
212 |
-
return $returnValue;
|
213 |
-
}
|
214 |
-
|
215 |
-
private function _createParametersHash($params)
|
216 |
-
{
|
217 |
-
$returnValue = '';
|
218 |
-
if($params) {
|
219 |
-
ksort($params);
|
220 |
-
$returnValue = md5(http_build_query($params));
|
221 |
-
}
|
222 |
-
return $returnValue;
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* get identifying hash for each adapter based on type, channel and id
|
227 |
-
* @param $type
|
228 |
-
* @param $channel (default: null)
|
229 |
-
* @param $id (default: null)
|
230 |
-
* @return string hash
|
231 |
-
*/
|
232 |
-
protected function _getAdapterIdentifier($type, $channel = null, $id = null)
|
233 |
-
{
|
234 |
-
$args = func_get_args();
|
235 |
-
return implode('_', $args);
|
236 |
-
}
|
237 |
-
|
238 |
-
/**
|
239 |
-
* @return FACTFinder_Abstract_Adapter
|
240 |
-
*/
|
241 |
-
protected function _getAdapter($type, $channel = null, $id = null)
|
242 |
-
{
|
243 |
-
$format = $this->_getFormat($type);
|
244 |
-
$hashKey = $this->_getAdapterIdentifier($type, $channel, $id);
|
245 |
-
|
246 |
-
// get the channel after calculating the adapter identifier
|
247 |
-
if(!$channel)
|
248 |
-
$channel = $this->_getConfiguration()->getChannel();
|
249 |
-
|
250 |
-
if(!isset($this->_adapters[$hashKey][$channel]))
|
251 |
-
{
|
252 |
-
$config = $this->_getConfiguration();
|
253 |
-
$encodingHandler = FF::getSingleton('encodingHandler', $config);
|
254 |
-
$dataProvider = $this->_getParallelDataProvider();
|
255 |
-
$dataProvider->setParam('channel', $channel);
|
256 |
-
|
257 |
-
/*
|
258 |
-
// new tracking needs session ID and sourceRefKey for every request
|
259 |
-
// helper must not be used inside this class, as it is also used without the app context
|
260 |
-
// TODO: do it in a different way
|
261 |
-
if(!Mage::helper('factfinder')->useOldTracking()) {
|
262 |
-
$dataProvider->setParam('sourceRefKey', Mage::getSingleton('core/session')->getFactFinderRefKey());
|
263 |
-
$dataProvider->setParam('sid' , md5(Mage::getSingleton('core/session')->getSessionId()));
|
264 |
-
}*/
|
265 |
-
|
266 |
-
$this->_adapters[$hashKey][$channel] = FF::getInstance(
|
267 |
-
$format.'/'.$type.'Adapter',
|
268 |
-
$dataProvider,
|
269 |
-
$this->_getParamsParser(),
|
270 |
-
$encodingHandler,
|
271 |
-
$this->_logger
|
272 |
-
);
|
273 |
-
}
|
274 |
-
return $this->_adapters[$hashKey][$channel];
|
275 |
-
}
|
276 |
-
|
277 |
-
protected function _getFormat($type)
|
278 |
-
{
|
279 |
-
$format = 'http';
|
280 |
-
if (!in_array($type, array('scic', 'suggest', 'legacyTracking'))) {
|
281 |
-
$version = $this->_getConfiguration()->getFactFinderVersion();
|
282 |
-
$format = 'xml' . $version;
|
283 |
-
return $format;
|
284 |
-
}
|
285 |
-
return $format;
|
286 |
-
}
|
287 |
-
|
288 |
-
public function configureStatusHelper($channel = null)
|
289 |
-
{
|
290 |
-
if(!$channel)
|
291 |
-
$channel = $this->_getConfiguration()->getChannel();
|
292 |
-
if(!isset($this->_statusHelpers[$channel]))
|
293 |
-
{
|
294 |
-
$config = $this->_getConfiguration();
|
295 |
-
$encodingHandler = FF::getSingleton('encodingHandler', $config);
|
296 |
-
$this->_statusHelpers[$channel] = FF::getInstance(
|
297 |
-
'http/statusHelper',
|
298 |
-
$config,
|
299 |
-
$this->_logger,
|
300 |
-
$channel
|
301 |
-
);
|
302 |
-
}
|
303 |
-
}
|
304 |
-
|
305 |
-
/**
|
306 |
-
* @return FACTFinderCustom_Configuration config
|
307 |
-
*/
|
308 |
-
protected function _getConfiguration($configArray = null)
|
309 |
-
{
|
310 |
-
if ($this->_config == null) {
|
311 |
-
$this->_config = FF::getSingleton('configuration', $configArray);
|
312 |
-
}
|
313 |
-
return $this->_config;
|
314 |
-
}
|
315 |
-
|
316 |
-
public function setConfiguration($configArray)
|
317 |
-
{
|
318 |
-
$this->_config = FF::getSingleton('configuration', $configArray);
|
319 |
-
}
|
320 |
-
|
321 |
-
/**
|
322 |
-
* @param int $storeId
|
323 |
-
* @return \Flagbit_FactFinder_Model_Facade
|
324 |
-
*/
|
325 |
-
public function setStoreId($storeId) {
|
326 |
-
$this->_getConfiguration()->setStoreId($storeId);
|
327 |
-
|
328 |
-
return $this;
|
329 |
-
}
|
330 |
-
|
331 |
-
/**
|
332 |
-
* @return FACTFinder_Abstract_DataProvider
|
333 |
-
**/
|
334 |
-
protected function _getParallelDataProvider()
|
335 |
-
{
|
336 |
-
$config = $this->_getConfiguration();
|
337 |
-
$params = $this->_getParamsParser()->getServerRequestParams();
|
338 |
-
$dp = FACTFinder_Http_ParallelDataProvider::getDataProvider($params, $config, $this->_logger);
|
339 |
-
return $dp;
|
340 |
-
}
|
341 |
-
|
342 |
-
/**
|
343 |
-
* @return FACTFinder_ParametersParser
|
344 |
-
*/
|
345 |
-
protected function _getParamsParser()
|
346 |
-
{
|
347 |
-
if ($this->_paramsParser == null) {
|
348 |
-
$config = $this->_getConfiguration();
|
349 |
-
$encodingHandler = FF::getSingleton('encodingHandler', $config);
|
350 |
-
$this->_paramsParser = FF::getInstance('parametersParser', $config, $encodingHandler);
|
351 |
-
}
|
352 |
-
return $this->_paramsParser;
|
353 |
-
}
|
354 |
-
|
355 |
-
public function getManagementUrl()
|
356 |
-
{
|
357 |
-
$urlBuilder = $this->_getUrlBuilder();
|
358 |
-
$urlBuilder->setAction('Management.ff');
|
359 |
-
return $urlBuilder->getNonAuthenticationUrl();
|
360 |
-
}
|
361 |
-
|
362 |
-
public function getSuggestUrl()
|
363 |
-
{
|
364 |
-
$urlBuilder = $this->_getUrlBuilder();
|
365 |
-
$urlBuilder->setAction('Suggest.ff');
|
366 |
-
$urlBuilder->setParams(array());
|
367 |
-
|
368 |
-
return $urlBuilder->getNonAuthenticationUrl();
|
369 |
-
}
|
370 |
-
|
371 |
-
protected function _getUrlBuilder()
|
372 |
-
{
|
373 |
-
if($this->_urlBuilder === null) {
|
374 |
-
$config = $this->_getConfiguration();
|
375 |
-
$params = $this->_getParamsParser()->getServerRequestParams();
|
376 |
-
|
377 |
-
$this->_urlBuilder = FF::getInstance('http/urlBuilder', $params, $config, $this->_logger);
|
378 |
-
}
|
379 |
-
return $this->_urlBuilder;
|
380 |
-
}
|
381 |
-
|
382 |
-
public function applyTracking($channel = null, $id = null)
|
383 |
-
{
|
384 |
-
return $this->_getFactFinderObject("tracking", "applyTracking", $channel, $id);
|
385 |
-
}
|
386 |
-
|
387 |
-
public function applyScicTracking($channel = null, $id = null)
|
388 |
-
{
|
389 |
-
return $this->_getFactFinderObject("scic", "applyTracking", $channel, $id);
|
390 |
-
}
|
391 |
-
|
392 |
-
public function
|
393 |
-
{
|
394 |
-
return $this->_getFactFinderObject("
|
395 |
-
}
|
396 |
-
|
397 |
-
public function
|
398 |
-
{
|
399 |
-
return $this->_getFactFinderObject("search", "
|
400 |
-
}
|
401 |
-
|
402 |
-
public function
|
403 |
-
{
|
404 |
-
return $this->_getFactFinderObject("
|
405 |
-
}
|
406 |
-
|
407 |
-
public function
|
408 |
-
{
|
409 |
-
return $this->_getFactFinderObject("
|
410 |
-
}
|
411 |
-
|
412 |
-
public function
|
413 |
-
{
|
414 |
-
return $this->_getFactFinderObject("
|
415 |
-
}
|
416 |
-
|
417 |
-
public function
|
418 |
-
{
|
419 |
-
return $this->_getFactFinderObject("search", "
|
420 |
-
}
|
421 |
-
|
422 |
-
public function
|
423 |
-
{
|
424 |
-
return $this->_getFactFinderObject("search", "
|
425 |
-
}
|
426 |
-
|
427 |
-
public function
|
428 |
-
{
|
429 |
-
return $this->_getFactFinderObject("search", "
|
430 |
-
}
|
431 |
-
|
432 |
-
public function
|
433 |
-
{
|
434 |
-
return $this->_getFactFinderObject("search", "
|
435 |
-
}
|
436 |
-
|
437 |
-
public function
|
438 |
-
{
|
439 |
-
return $this->_getFactFinderObject("
|
440 |
-
}
|
441 |
-
|
442 |
-
public function
|
443 |
-
{
|
444 |
-
return $this->_getFactFinderObject("
|
445 |
-
}
|
446 |
-
|
447 |
-
|
448 |
-
{
|
449 |
-
$
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
}
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
}
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
$
|
523 |
-
return
|
524 |
-
}
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
539 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
require_once BP.DS.'lib'.DS.'FACTFinder'.DS.'Loader.php';
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Model class
|
14 |
+
*
|
15 |
+
* Facade that hides FACT-Finder API Framework for Magento
|
16 |
+
*
|
17 |
+
* @category Mage
|
18 |
+
* @package Flagbit_FactFinder
|
19 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
20 |
+
* @author Joerg Weller <weller@flagbit.de>
|
21 |
+
* @version $Id: Facade.php 906 2011-09-30 14:10:05Z tuerk $
|
22 |
+
*/
|
23 |
+
class Flagbit_FactFinder_Model_Facade
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Two-dimensional array of FACT-Finder adapters
|
27 |
+
* First-dimension key corresponds to type
|
28 |
+
* Second-dimension key corresponds to channel
|
29 |
+
* @var array of FACTFinder_Abstract_Adapter
|
30 |
+
*/
|
31 |
+
protected $_adapters = array();
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Key corresponds to channel
|
35 |
+
* @var array of FACTFinder_Http_StatusHelper
|
36 |
+
*/
|
37 |
+
protected $_statusHelpers = array();
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @var FACTFinder_Abstract_Configuration
|
41 |
+
*/
|
42 |
+
protected $_config = null;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @var FACTFinder_ParametersParser
|
46 |
+
*/
|
47 |
+
protected $_paramsParser = null;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @var FACTFinder_Http_UrlBuilder
|
51 |
+
*/
|
52 |
+
protected $_urlBuilder = null;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* logger object to log all module internals
|
56 |
+
* @var FACTFinder_Abstract_Logger
|
57 |
+
*/
|
58 |
+
protected $_logger = null;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* map between known adapters and its state based on its parameters
|
62 |
+
* @var array
|
63 |
+
*/
|
64 |
+
protected $_paramHashes = array();
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @var boolean is set to true, if caching is enabled and can be used
|
68 |
+
*/
|
69 |
+
private $_useCaching = null;
|
70 |
+
|
71 |
+
public function __construct($arg = null)
|
72 |
+
{
|
73 |
+
if ($arg === null || !($arg instanceof FACTFinder_Abstract_Logger)) {
|
74 |
+
$arg = Mage::helper('factfinder/debug');
|
75 |
+
}
|
76 |
+
FF::setLogger($arg);
|
77 |
+
$this->_logger = $arg;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function getSearchAdapter($channel = null)
|
81 |
+
{
|
82 |
+
return $this->_getAdapter("search", $channel);
|
83 |
+
}
|
84 |
+
|
85 |
+
public function getScicAdapter($channel = null)
|
86 |
+
{
|
87 |
+
return $this->_getAdapter("scic", $channel);
|
88 |
+
}
|
89 |
+
|
90 |
+
public function getSuggestAdapter($channel = null)
|
91 |
+
{
|
92 |
+
return $this->_getAdapter("suggest", $channel);
|
93 |
+
}
|
94 |
+
|
95 |
+
public function getRecommendationAdapter($channel = null)
|
96 |
+
{
|
97 |
+
return $this->_getAdapter("recommendation", $channel);
|
98 |
+
}
|
99 |
+
|
100 |
+
public function getTagCloudAdapter($channel = null)
|
101 |
+
{
|
102 |
+
return $this->_getAdapter("tagCloud", $channel);
|
103 |
+
}
|
104 |
+
|
105 |
+
public function getCompareAdapter($channel = null)
|
106 |
+
{
|
107 |
+
return $this->_getAdapter("compare", $channel);
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getImportAdapter($channel = null)
|
111 |
+
{
|
112 |
+
return $this->_getAdapter("import", $channel);
|
113 |
+
}
|
114 |
+
|
115 |
+
public function getProductCampaignAdapter($channel = null)
|
116 |
+
{
|
117 |
+
return $this->_getAdapter("productCampaign", $channel);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getSimilarRecordsAdapter($channel = null)
|
121 |
+
{
|
122 |
+
return $this->_getAdapter("similarRecords", $channel);
|
123 |
+
}
|
124 |
+
|
125 |
+
public function getTrackingAdapter($channel = null)
|
126 |
+
{
|
127 |
+
return $this->_getAdapter("tracking", $channel);
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getLegacyTrackingAdapter($channel = null)
|
131 |
+
{
|
132 |
+
return $this->_getAdapter("legacyTracking", $channel);
|
133 |
+
}
|
134 |
+
|
135 |
+
public function configureSearchAdapter($params, $channel = null, $id = null)
|
136 |
+
{
|
137 |
+
$this->_configureAdapter($params, "search", $channel, $id);
|
138 |
+
}
|
139 |
+
|
140 |
+
public function configureScicAdapter($params, $channel = null, $id = null)
|
141 |
+
{
|
142 |
+
$this->_configureAdapter($params, "scic", $channel, $id);
|
143 |
+
}
|
144 |
+
|
145 |
+
public function configureSuggestAdapter($params, $channel = null, $id = null)
|
146 |
+
{
|
147 |
+
$this->_configureAdapter($params, "suggest", $channel, $id);
|
148 |
+
}
|
149 |
+
|
150 |
+
public function configureRecommendationAdapter($params, $channel = null, $id = null)
|
151 |
+
{
|
152 |
+
$this->_configureAdapter($params, "recommendation", $channel, $id);
|
153 |
+
}
|
154 |
+
|
155 |
+
public function configureTagCloudAdapter($params, $channel = null, $id = null)
|
156 |
+
{
|
157 |
+
$this->_configureAdapter($params, "tagCloud", $channel, $id);
|
158 |
+
}
|
159 |
+
|
160 |
+
public function configureCompareAdapter($params, $channel = null, $id = null)
|
161 |
+
{
|
162 |
+
$this->_configureAdapter($params, "compare", $channel, $id);
|
163 |
+
}
|
164 |
+
|
165 |
+
public function configureImportAdapter($params, $channel = null, $id = null)
|
166 |
+
{
|
167 |
+
$this->_configureAdapter($params, "import", $channel, $id);
|
168 |
+
}
|
169 |
+
|
170 |
+
public function configureProductCampaignAdapter($params, $channel = null, $id = null)
|
171 |
+
{
|
172 |
+
$this->_configureAdapter($params, "productCampaign", $channel, $id);
|
173 |
+
}
|
174 |
+
|
175 |
+
public function configureSimilarRecordsAdapter($params, $channel = null, $id = null)
|
176 |
+
{
|
177 |
+
$this->_configureAdapter($params, "similarRecords", $channel, $id);
|
178 |
+
}
|
179 |
+
|
180 |
+
public function configureTrackingAdapter($params, $channel = null, $id = null)
|
181 |
+
{
|
182 |
+
$this->_configureAdapter($params, "tracking", $channel, $id);
|
183 |
+
}
|
184 |
+
|
185 |
+
protected function _configureAdapter($params, $type, $channel = null, $id = null)
|
186 |
+
{
|
187 |
+
$adapter = $this->_getAdapter($type, $channel, $id);
|
188 |
+
$adapterId = $this->_getAdapterIdentifier($type, $channel, $id);
|
189 |
+
$this->_paramHashes[$adapterId] = $this->_createParametersHash($params);
|
190 |
+
|
191 |
+
foreach($params as $key => $value)
|
192 |
+
$adapter->setParam($key, $value);
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* returns the hash that identifies a certain combination of parameters.
|
197 |
+
* It represents the current parameter state of the adapter specified by $type, $channel and $id
|
198 |
+
*
|
199 |
+
* @param $type (any adapter type)
|
200 |
+
* @param $channel (default: null => default channel)
|
201 |
+
* @param $id (default: null => no special id)
|
202 |
+
* @return string
|
203 |
+
*/
|
204 |
+
protected function _getParametersHash($type, $channel = null, $id = null)
|
205 |
+
{
|
206 |
+
$returnValue = '';
|
207 |
+
$adapterId = $this->_getAdapterIdentifier($type, $channel, $id);
|
208 |
+
if (array_key_exists($adapterId, $this->_paramHashes))
|
209 |
+
{
|
210 |
+
$returnValue = $this->_paramHashes[$adapterId];
|
211 |
+
}
|
212 |
+
return $returnValue;
|
213 |
+
}
|
214 |
+
|
215 |
+
private function _createParametersHash($params)
|
216 |
+
{
|
217 |
+
$returnValue = '';
|
218 |
+
if($params) {
|
219 |
+
ksort($params);
|
220 |
+
$returnValue = md5(http_build_query($params));
|
221 |
+
}
|
222 |
+
return $returnValue;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* get identifying hash for each adapter based on type, channel and id
|
227 |
+
* @param $type
|
228 |
+
* @param $channel (default: null)
|
229 |
+
* @param $id (default: null)
|
230 |
+
* @return string hash
|
231 |
+
*/
|
232 |
+
protected function _getAdapterIdentifier($type, $channel = null, $id = null)
|
233 |
+
{
|
234 |
+
$args = func_get_args();
|
235 |
+
return implode('_', $args);
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* @return FACTFinder_Abstract_Adapter
|
240 |
+
*/
|
241 |
+
protected function _getAdapter($type, $channel = null, $id = null)
|
242 |
+
{
|
243 |
+
$format = $this->_getFormat($type);
|
244 |
+
$hashKey = $this->_getAdapterIdentifier($type, $channel, $id);
|
245 |
+
|
246 |
+
// get the channel after calculating the adapter identifier
|
247 |
+
if(!$channel)
|
248 |
+
$channel = $this->_getConfiguration()->getChannel();
|
249 |
+
|
250 |
+
if(!isset($this->_adapters[$hashKey][$channel]))
|
251 |
+
{
|
252 |
+
$config = $this->_getConfiguration();
|
253 |
+
$encodingHandler = FF::getSingleton('encodingHandler', $config);
|
254 |
+
$dataProvider = $this->_getParallelDataProvider();
|
255 |
+
$dataProvider->setParam('channel', $channel);
|
256 |
+
|
257 |
+
/*
|
258 |
+
// new tracking needs session ID and sourceRefKey for every request
|
259 |
+
// helper must not be used inside this class, as it is also used without the app context
|
260 |
+
// TODO: do it in a different way
|
261 |
+
if(!Mage::helper('factfinder')->useOldTracking()) {
|
262 |
+
$dataProvider->setParam('sourceRefKey', Mage::getSingleton('core/session')->getFactFinderRefKey());
|
263 |
+
$dataProvider->setParam('sid' , md5(Mage::getSingleton('core/session')->getSessionId()));
|
264 |
+
}*/
|
265 |
+
|
266 |
+
$this->_adapters[$hashKey][$channel] = FF::getInstance(
|
267 |
+
$format.'/'.$type.'Adapter',
|
268 |
+
$dataProvider,
|
269 |
+
$this->_getParamsParser(),
|
270 |
+
$encodingHandler,
|
271 |
+
$this->_logger
|
272 |
+
);
|
273 |
+
}
|
274 |
+
return $this->_adapters[$hashKey][$channel];
|
275 |
+
}
|
276 |
+
|
277 |
+
protected function _getFormat($type)
|
278 |
+
{
|
279 |
+
$format = 'http';
|
280 |
+
if (!in_array($type, array('scic', 'suggest', 'legacyTracking'))) {
|
281 |
+
$version = $this->_getConfiguration()->getFactFinderVersion();
|
282 |
+
$format = 'xml' . $version;
|
283 |
+
return $format;
|
284 |
+
}
|
285 |
+
return $format;
|
286 |
+
}
|
287 |
+
|
288 |
+
public function configureStatusHelper($channel = null)
|
289 |
+
{
|
290 |
+
if(!$channel)
|
291 |
+
$channel = $this->_getConfiguration()->getChannel();
|
292 |
+
if(!isset($this->_statusHelpers[$channel]))
|
293 |
+
{
|
294 |
+
$config = $this->_getConfiguration();
|
295 |
+
$encodingHandler = FF::getSingleton('encodingHandler', $config);
|
296 |
+
$this->_statusHelpers[$channel] = FF::getInstance(
|
297 |
+
'http/statusHelper',
|
298 |
+
$config,
|
299 |
+
$this->_logger,
|
300 |
+
$channel
|
301 |
+
);
|
302 |
+
}
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* @return FACTFinderCustom_Configuration config
|
307 |
+
*/
|
308 |
+
protected function _getConfiguration($configArray = null)
|
309 |
+
{
|
310 |
+
if ($this->_config == null) {
|
311 |
+
$this->_config = FF::getSingleton('configuration', $configArray);
|
312 |
+
}
|
313 |
+
return $this->_config;
|
314 |
+
}
|
315 |
+
|
316 |
+
public function setConfiguration($configArray)
|
317 |
+
{
|
318 |
+
$this->_config = FF::getSingleton('configuration', $configArray);
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* @param int $storeId
|
323 |
+
* @return \Flagbit_FactFinder_Model_Facade
|
324 |
+
*/
|
325 |
+
public function setStoreId($storeId) {
|
326 |
+
$this->_getConfiguration()->setStoreId($storeId);
|
327 |
+
|
328 |
+
return $this;
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* @return FACTFinder_Abstract_DataProvider
|
333 |
+
**/
|
334 |
+
protected function _getParallelDataProvider()
|
335 |
+
{
|
336 |
+
$config = $this->_getConfiguration();
|
337 |
+
$params = $this->_getParamsParser()->getServerRequestParams();
|
338 |
+
$dp = FACTFinder_Http_ParallelDataProvider::getDataProvider($params, $config, $this->_logger);
|
339 |
+
return $dp;
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* @return FACTFinder_ParametersParser
|
344 |
+
*/
|
345 |
+
protected function _getParamsParser()
|
346 |
+
{
|
347 |
+
if ($this->_paramsParser == null) {
|
348 |
+
$config = $this->_getConfiguration();
|
349 |
+
$encodingHandler = FF::getSingleton('encodingHandler', $config);
|
350 |
+
$this->_paramsParser = FF::getInstance('parametersParser', $config, $encodingHandler);
|
351 |
+
}
|
352 |
+
return $this->_paramsParser;
|
353 |
+
}
|
354 |
+
|
355 |
+
public function getManagementUrl()
|
356 |
+
{
|
357 |
+
$urlBuilder = $this->_getUrlBuilder();
|
358 |
+
$urlBuilder->setAction('Management.ff');
|
359 |
+
return $urlBuilder->getNonAuthenticationUrl();
|
360 |
+
}
|
361 |
+
|
362 |
+
public function getSuggestUrl()
|
363 |
+
{
|
364 |
+
$urlBuilder = $this->_getUrlBuilder();
|
365 |
+
$urlBuilder->setAction('Suggest.ff');
|
366 |
+
$urlBuilder->setParams(array());
|
367 |
+
|
368 |
+
return $urlBuilder->getNonAuthenticationUrl();
|
369 |
+
}
|
370 |
+
|
371 |
+
protected function _getUrlBuilder()
|
372 |
+
{
|
373 |
+
if($this->_urlBuilder === null) {
|
374 |
+
$config = $this->_getConfiguration();
|
375 |
+
$params = $this->_getParamsParser()->getServerRequestParams();
|
376 |
+
|
377 |
+
$this->_urlBuilder = FF::getInstance('http/urlBuilder', $params, $config, $this->_logger);
|
378 |
+
}
|
379 |
+
return $this->_urlBuilder;
|
380 |
+
}
|
381 |
+
|
382 |
+
public function applyTracking($channel = null, $id = null)
|
383 |
+
{
|
384 |
+
return $this->_getFactFinderObject("tracking", "applyTracking", $channel, $id);
|
385 |
+
}
|
386 |
+
|
387 |
+
public function applyScicTracking($channel = null, $id = null)
|
388 |
+
{
|
389 |
+
return $this->_getFactFinderObject("scic", "applyTracking", $channel, $id);
|
390 |
+
}
|
391 |
+
|
392 |
+
public function applyLegacyTracking($channel = null, $id = null)
|
393 |
+
{
|
394 |
+
return $this->_getFactFinderObject("legacyTracking", "applyTracking", $channel, $id);
|
395 |
+
}
|
396 |
+
|
397 |
+
public function getAfterSearchNavigation($channel = null, $id = null)
|
398 |
+
{
|
399 |
+
return $this->_getFactFinderObject("search", "getAsn", $channel, $id);
|
400 |
+
}
|
401 |
+
|
402 |
+
public function getCampaigns($channel = null, $id = null)
|
403 |
+
{
|
404 |
+
return $this->_getFactFinderObject("search", "getCampaigns", $channel, $id);
|
405 |
+
}
|
406 |
+
|
407 |
+
public function getProductCampaigns($channel = null, $id = null)
|
408 |
+
{
|
409 |
+
return $this->_getFactFinderObject("productCampaign", "getCampaigns", $channel, $id);
|
410 |
+
}
|
411 |
+
|
412 |
+
public function getRecommendations($channel = null, $id = null)
|
413 |
+
{
|
414 |
+
return $this->_getFactFinderObject("recommendation", "getRecommendations", $channel, $id);
|
415 |
+
}
|
416 |
+
|
417 |
+
public function getSearchError($channel = null, $id = null)
|
418 |
+
{
|
419 |
+
return $this->_getFactFinderObject("search", "getError", $channel, $id);
|
420 |
+
}
|
421 |
+
|
422 |
+
public function getSearchParams($channel = null, $id = null)
|
423 |
+
{
|
424 |
+
return $this->_getFactFinderObject("search", "getSearchParams", $channel, $id);
|
425 |
+
}
|
426 |
+
|
427 |
+
public function getSearchResult($channel = null, $id = null)
|
428 |
+
{
|
429 |
+
return $this->_getFactFinderObject("search", "getResult", $channel, $id);
|
430 |
+
}
|
431 |
+
|
432 |
+
public function getSearchStackTrace($channel = null, $id = null)
|
433 |
+
{
|
434 |
+
return $this->_getFactFinderObject("search", "getStackTrace", $channel, $id);
|
435 |
+
}
|
436 |
+
|
437 |
+
public function getSearchStatus($channel = null, $id = null)
|
438 |
+
{
|
439 |
+
return $this->_getFactFinderObject("search", "getStatus", $channel, $id);
|
440 |
+
}
|
441 |
+
|
442 |
+
public function getSuggestions($channel = null, $id = null)
|
443 |
+
{
|
444 |
+
return $this->_getFactFinderObject("suggest", "getSuggestions", $channel, $id);
|
445 |
+
}
|
446 |
+
|
447 |
+
public function getTagCloud($channel = null, $id = null)
|
448 |
+
{
|
449 |
+
return $this->_getFactFinderObject("tagCloud", "getTagCloud", $channel, $id);
|
450 |
+
}
|
451 |
+
|
452 |
+
protected function _getFactFinderObject($type, $objectGetter, $channel = null, $id = null)
|
453 |
+
{
|
454 |
+
$cacheKey = '';
|
455 |
+
$data = null;
|
456 |
+
|
457 |
+
if ($this->_useSearchCaching() && stripos($type, 'tracking') === false)
|
458 |
+
{
|
459 |
+
$adapterId = $this->_getAdapterIdentifier($type, $channel, $id);
|
460 |
+
$cacheKey = 'FACTFINDER_'.$adapterId . '_' . $objectGetter .'_'. $this->_getParametersHash($type, $channel, $id);
|
461 |
+
if($cache = Mage::app()->loadCache($cacheKey))
|
462 |
+
{
|
463 |
+
$data = unserialize($cache);
|
464 |
+
}
|
465 |
+
}
|
466 |
+
|
467 |
+
if ($data == null) {
|
468 |
+
try {
|
469 |
+
$this->_loadAllData();
|
470 |
+
|
471 |
+
// BUG Potential:
|
472 |
+
// if you read this because you got the error message, that you must call
|
473 |
+
// > 'loadAllData' before trying to get data! <
|
474 |
+
// this might have happened because you initialized another adapter and not the one
|
475 |
+
// that is called here
|
476 |
+
$adapter = $this->_getAdapter($type, $channel, $id);
|
477 |
+
$data = $adapter->$objectGetter();
|
478 |
+
|
479 |
+
if($this->_useSearchCaching())
|
480 |
+
{
|
481 |
+
Mage::app()->saveCache(serialize($data), $cacheKey, array('FACTFINDER_SEARCH'), 600);
|
482 |
+
}
|
483 |
+
|
484 |
+
} catch (Exception $e) {
|
485 |
+
Mage::logException($e);
|
486 |
+
}
|
487 |
+
}
|
488 |
+
return $data;
|
489 |
+
}
|
490 |
+
|
491 |
+
public function getActualFactFinderVersion()
|
492 |
+
{
|
493 |
+
try {
|
494 |
+
$channel = $this->_getConfiguration()->getChannel();
|
495 |
+
$this->_loadAllData();
|
496 |
+
return $this->_statusHelpers[$channel]->getVersionNumber();
|
497 |
+
} catch (Exception $e) {
|
498 |
+
Mage::logException($e);
|
499 |
+
return null;
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
+
private function _useSearchCaching()
|
504 |
+
{
|
505 |
+
if ($this->_useCaching == null)
|
506 |
+
{
|
507 |
+
// caching only works from version 5.3 because of php bug 45706 (http://bugs.php.net/45706):
|
508 |
+
// because of it, the asn objects can't be serialized and cached
|
509 |
+
// this bug was fixed with 5.3.0 (http://www.php.net/ChangeLog-5.php)
|
510 |
+
$this->_useCaching = (version_compare(PHP_VERSION, '5.3.0') >= 0 && Mage::app()->useCache('factfinder_search'));
|
511 |
+
}
|
512 |
+
return $this->_useCaching;
|
513 |
+
}
|
514 |
+
|
515 |
+
public function getActualFactFinderVersionString()
|
516 |
+
{
|
517 |
+
try {
|
518 |
+
$channel = $this->_getConfiguration()->getChannel();
|
519 |
+
$this->_loadAllData();
|
520 |
+
return $this->_statusHelpers[$channel]->getVersionString();
|
521 |
+
} catch (Exception $e) {
|
522 |
+
Mage::logException($e);
|
523 |
+
return null;
|
524 |
+
}
|
525 |
+
}
|
526 |
+
|
527 |
+
public function getFactFinderStatus($channel = null)
|
528 |
+
{
|
529 |
+
try {
|
530 |
+
if(!$channel)
|
531 |
+
$channel = $this->_getConfiguration()->getChannel();
|
532 |
+
$this->_loadAllData();
|
533 |
+
return $this->_statusHelpers[$channel]->getStatusCode();
|
534 |
+
} catch (Exception $e) {
|
535 |
+
Mage::logException($e);
|
536 |
+
return null;
|
537 |
+
}
|
538 |
+
}
|
539 |
+
|
540 |
+
protected function _loadAllData()
|
541 |
+
{
|
542 |
+
FACTFinder_Http_ParallelDataProvider::loadAllData();
|
543 |
+
}
|
544 |
+
|
545 |
+
public function getRequestParams()
|
546 |
+
{
|
547 |
+
return $this->_getParamsParser()->getRequestParams();
|
548 |
+
}
|
549 |
}
|
@@ -1,62 +1,64 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Handles tracking data
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
9 |
-
* @version $Id: Tracking.php 20.08.13 11:35 $
|
10 |
-
*
|
11 |
-
**/
|
12 |
-
class Flagbit_FactFinder_Model_Handler_Tracking
|
13 |
-
extends Flagbit_FactFinder_Model_Handler_Abstract
|
14 |
-
{
|
15 |
-
/**
|
16 |
-
* @var array
|
17 |
-
*/
|
18 |
-
protected $_trackingAdapter;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* {@inheritdoc}
|
22 |
-
*/
|
23 |
-
protected function configureFacade() {}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Get tracking adapter
|
27 |
-
*
|
28 |
-
* @return tracking adapter object
|
29 |
-
*/
|
30 |
-
public function getTrackingAdapter()
|
31 |
-
{
|
32 |
-
if($this->_trackingAdapter === null)
|
33 |
-
{
|
34 |
-
if(Mage::helper('factfinder')->useOldTracking()) {
|
35 |
-
$this->_trackingAdapter = Mage::getModel('factfinder/handler_tracking_scic');
|
36 |
-
}
|
37 |
-
// If old tracking was not activated use the new tracking
|
38 |
-
if ($this->_trackingAdapter === null) {
|
39 |
-
$this->_trackingAdapter = $this->_getFacade()->getTrackingAdapter();
|
40 |
-
}
|
41 |
-
if ($this->_trackingAdapter === null)
|
42 |
-
$this->_trackingAdapter = array();
|
43 |
-
}
|
44 |
-
return $this->_trackingAdapter;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Fire tracking request
|
49 |
-
*
|
50 |
-
* @return mixed|null
|
51 |
-
*/
|
52 |
-
public function applyTracking()
|
53 |
-
{
|
54 |
-
if(Mage::helper('factfinder')->
|
55 |
-
$result = $this->_getFacade()->
|
56 |
-
} else {
|
57 |
-
$result =
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
62 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handles tracking data
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
9 |
+
* @version $Id: Tracking.php 20.08.13 11:35 $
|
10 |
+
*
|
11 |
+
**/
|
12 |
+
class Flagbit_FactFinder_Model_Handler_Tracking
|
13 |
+
extends Flagbit_FactFinder_Model_Handler_Abstract
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
+
protected $_trackingAdapter;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* {@inheritdoc}
|
22 |
+
*/
|
23 |
+
protected function configureFacade() {}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Get tracking adapter
|
27 |
+
*
|
28 |
+
* @return tracking adapter object
|
29 |
+
*/
|
30 |
+
public function getTrackingAdapter()
|
31 |
+
{
|
32 |
+
if($this->_trackingAdapter === null)
|
33 |
+
{
|
34 |
+
if(Mage::helper('factfinder')->useOldTracking()) {
|
35 |
+
$this->_trackingAdapter = Mage::getModel('factfinder/handler_tracking_scic');
|
36 |
+
}
|
37 |
+
// If old tracking was not activated use the new tracking
|
38 |
+
if ($this->_trackingAdapter === null) {
|
39 |
+
$this->_trackingAdapter = $this->_getFacade()->getTrackingAdapter();
|
40 |
+
}
|
41 |
+
if ($this->_trackingAdapter === null)
|
42 |
+
$this->_trackingAdapter = array();
|
43 |
+
}
|
44 |
+
return $this->_trackingAdapter;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Fire tracking request
|
49 |
+
*
|
50 |
+
* @return mixed|null
|
51 |
+
*/
|
52 |
+
public function applyTracking()
|
53 |
+
{
|
54 |
+
if (Mage::helper('factfinder')->useLegacyTracking()) {
|
55 |
+
$result = $this->_getFacade()->applyLegacyTracking();
|
56 |
+
} else if(Mage::helper('factfinder')->useOldTracking()) {
|
57 |
+
$result = $this->_getFacade()->applyScicTracking();
|
58 |
+
} else {
|
59 |
+
$result = $this->_getFacade()->applyTracking();
|
60 |
+
}
|
61 |
+
|
62 |
+
return $result;
|
63 |
+
}
|
64 |
}
|
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Creates a mapping between new and old tracking methods
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
9 |
-
* @version $Id: Scic.php 26.08.13 15:05 $
|
10 |
-
*
|
11 |
-
**/
|
12 |
-
class Flagbit_FactFinder_Model_Handler_Tracking_Scic
|
13 |
-
extends Flagbit_FactFinder_Model_Handler_Abstract
|
14 |
-
{
|
15 |
-
protected function configureFacade() {}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Mapping method from new -> old tracking
|
19 |
-
*
|
20 |
-
* @param $event
|
21 |
-
* @param $inputParams
|
22 |
-
* @return FACTFinder_Default_ScicAdapter
|
23 |
-
*/
|
24 |
-
public function setupEventTracking($event, $inputParams)
|
25 |
-
{
|
26 |
-
/* @var $scicAdapter FACTFinder_Default_ScicAdapter */
|
27 |
-
if (Mage::helper('factfinder')->useLegacyTracking()) {
|
28 |
-
$scicAdapter = $this->_getFacade()->getLegacyTrackingAdapter();
|
29 |
-
} else {
|
30 |
-
$scicAdapter = $this->_getFacade()->getScicAdapter();
|
31 |
-
}
|
32 |
-
|
33 |
-
switch ($event) {
|
34 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_INSPECT:
|
35 |
-
$searchHelper = $searchHelper = Mage::helper('factfinder/search');
|
36 |
-
$scicAdapter->setupClickTracking(
|
37 |
-
$inputParams['id'],
|
38 |
-
$inputParams['sid'],
|
39 |
-
$searchHelper->getQuery()->getQueryText(),
|
40 |
-
1, //pos
|
41 |
-
1, //origPos
|
42 |
-
1, //page
|
43 |
-
$inputParams['product']->getSimilarity(),
|
44 |
-
$inputParams['product']->getName(),
|
45 |
-
$searchHelper->getPageLimit(),
|
46 |
-
$searchHelper->getDefaultPerPageValue());
|
47 |
-
break;
|
48 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_CART:
|
49 |
-
$scicAdapter->setupCartTracking(
|
50 |
-
$inputParams['id'],
|
51 |
-
$inputParams['sid'],
|
52 |
-
$inputParams['amount'],
|
53 |
-
$inputParams['price'],
|
54 |
-
$inputParams['uid']
|
55 |
-
);
|
56 |
-
break;
|
57 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_BUY:
|
58 |
-
$scicAdapter->setupCheckoutTracking(
|
59 |
-
$inputParams['id'],
|
60 |
-
$inputParams['sid'],
|
61 |
-
$inputParams['amount'],
|
62 |
-
$inputParams['price'],
|
63 |
-
$inputParams['uid']
|
64 |
-
);
|
65 |
-
break;
|
66 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_DISPLAY:
|
67 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_FEEDBACK:
|
68 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_AVAILABILITY_CHECK:
|
69 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_CACHE_HIT:
|
70 |
-
case FACTFinder_Default_TrackingAdapter::EVENT_SESSION_START:
|
71 |
-
// Not implemented yet
|
72 |
-
break;
|
73 |
-
}
|
74 |
-
|
75 |
-
return $scicAdapter;
|
76 |
-
}
|
77 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Creates a mapping between new and old tracking methods
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
9 |
+
* @version $Id: Scic.php 26.08.13 15:05 $
|
10 |
+
*
|
11 |
+
**/
|
12 |
+
class Flagbit_FactFinder_Model_Handler_Tracking_Scic
|
13 |
+
extends Flagbit_FactFinder_Model_Handler_Abstract
|
14 |
+
{
|
15 |
+
protected function configureFacade() {}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Mapping method from new -> old tracking
|
19 |
+
*
|
20 |
+
* @param $event
|
21 |
+
* @param $inputParams
|
22 |
+
* @return FACTFinder_Default_ScicAdapter
|
23 |
+
*/
|
24 |
+
public function setupEventTracking($event, $inputParams)
|
25 |
+
{
|
26 |
+
/* @var $scicAdapter FACTFinder_Default_ScicAdapter */
|
27 |
+
if (Mage::helper('factfinder')->useLegacyTracking()) {
|
28 |
+
$scicAdapter = $this->_getFacade()->getLegacyTrackingAdapter();
|
29 |
+
} else {
|
30 |
+
$scicAdapter = $this->_getFacade()->getScicAdapter();
|
31 |
+
}
|
32 |
+
|
33 |
+
switch ($event) {
|
34 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_INSPECT:
|
35 |
+
$searchHelper = $searchHelper = Mage::helper('factfinder/search');
|
36 |
+
$scicAdapter->setupClickTracking(
|
37 |
+
$inputParams['id'],
|
38 |
+
$inputParams['sid'],
|
39 |
+
$searchHelper->getQuery()->getQueryText(),
|
40 |
+
1, //pos
|
41 |
+
1, //origPos
|
42 |
+
1, //page
|
43 |
+
$inputParams['product']->getSimilarity(),
|
44 |
+
$inputParams['product']->getName(),
|
45 |
+
$searchHelper->getPageLimit(),
|
46 |
+
$searchHelper->getDefaultPerPageValue());
|
47 |
+
break;
|
48 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_CART:
|
49 |
+
$scicAdapter->setupCartTracking(
|
50 |
+
$inputParams['id'],
|
51 |
+
$inputParams['sid'],
|
52 |
+
$inputParams['amount'],
|
53 |
+
$inputParams['price'],
|
54 |
+
$inputParams['uid']
|
55 |
+
);
|
56 |
+
break;
|
57 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_BUY:
|
58 |
+
$scicAdapter->setupCheckoutTracking(
|
59 |
+
$inputParams['id'],
|
60 |
+
$inputParams['sid'],
|
61 |
+
$inputParams['amount'],
|
62 |
+
$inputParams['price'],
|
63 |
+
$inputParams['uid']
|
64 |
+
);
|
65 |
+
break;
|
66 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_DISPLAY:
|
67 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_FEEDBACK:
|
68 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_AVAILABILITY_CHECK:
|
69 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_CACHE_HIT:
|
70 |
+
case FACTFinder_Default_TrackingAdapter::EVENT_SESSION_START:
|
71 |
+
// Not implemented yet
|
72 |
+
break;
|
73 |
+
}
|
74 |
+
|
75 |
+
return $scicAdapter;
|
76 |
+
}
|
77 |
}
|
@@ -1,83 +1,83 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Block class for upselling
|
12 |
-
*
|
13 |
-
* Rewritten block - data is now caught by FACT-Finder, passed to normal collection, works quite as if it was the
|
14 |
-
* default behavior.
|
15 |
-
*
|
16 |
-
* @category Mage
|
17 |
-
* @package Flagbit_FactFinder
|
18 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
-
* @author Jörg Weller <weller@flagbit.de>
|
20 |
-
* @version $Id$
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_Model_Layer extends Flagbit_FactFinder_Model_Layer_Abstract
|
23 |
-
{
|
24 |
-
const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count';
|
25 |
-
|
26 |
-
protected $_productCollection = null;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Get current layer product collection
|
30 |
-
*
|
31 |
-
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
32 |
-
*/
|
33 |
-
public function getProductCollection()
|
34 |
-
{
|
35 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
36 |
-
return parent::getProductCollection();
|
37 |
-
}
|
38 |
-
|
39 |
-
// handle search
|
40 |
-
if($this instanceof Mage_CatalogSearch_Model_Layer){
|
41 |
-
if(is_null($this->_productCollection)){
|
42 |
-
$this->_productCollection = Mage::getResourceModel('factfinder/search_collection');
|
43 |
-
$this->prepareProductCollection($this->_productCollection);
|
44 |
-
}
|
45 |
-
$collection = $this->_productCollection;
|
46 |
-
|
47 |
-
// handle category listing
|
48 |
-
}else{
|
49 |
-
if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
|
50 |
-
$collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
|
51 |
-
}
|
52 |
-
else {
|
53 |
-
//$collection = $this->getCurrentCategory();
|
54 |
-
$collection = Mage::getResourceModel('factfinder/search_collection');
|
55 |
-
$this->prepareProductCollection($collection);
|
56 |
-
$this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
return $collection;
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Get collection of all filterable attributes for layer products set
|
66 |
-
*
|
67 |
-
* @return Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection
|
68 |
-
*/
|
69 |
-
public function getFilterableAttributes()
|
70 |
-
{
|
71 |
-
|
72 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
73 |
-
return parent::getFilterableAttributes();
|
74 |
-
}
|
75 |
-
|
76 |
-
/* @var $collection Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection */
|
77 |
-
$collection = Mage::getResourceModel('factfinder/product_attribute_collection')
|
78 |
-
->setItemObjectClass('catalog/resource_eav_attribute')
|
79 |
-
->setStoreId(Mage::app()->getStore()->getId());
|
80 |
-
|
81 |
-
return $collection;
|
82 |
-
}
|
83 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Block class for upselling
|
12 |
+
*
|
13 |
+
* Rewritten block - data is now caught by FACT-Finder, passed to normal collection, works quite as if it was the
|
14 |
+
* default behavior.
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Flagbit_FactFinder
|
18 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
+
* @author Jörg Weller <weller@flagbit.de>
|
20 |
+
* @version $Id$
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_Model_Layer extends Flagbit_FactFinder_Model_Layer_Abstract
|
23 |
+
{
|
24 |
+
const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count';
|
25 |
+
|
26 |
+
protected $_productCollection = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get current layer product collection
|
30 |
+
*
|
31 |
+
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
32 |
+
*/
|
33 |
+
public function getProductCollection()
|
34 |
+
{
|
35 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled()){
|
36 |
+
return parent::getProductCollection();
|
37 |
+
}
|
38 |
+
|
39 |
+
// handle search
|
40 |
+
if($this instanceof Mage_CatalogSearch_Model_Layer){
|
41 |
+
if(is_null($this->_productCollection)){
|
42 |
+
$this->_productCollection = Mage::getResourceModel('factfinder/search_collection');
|
43 |
+
$this->prepareProductCollection($this->_productCollection);
|
44 |
+
}
|
45 |
+
$collection = $this->_productCollection;
|
46 |
+
|
47 |
+
// handle category listing
|
48 |
+
}else{
|
49 |
+
if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
|
50 |
+
$collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
|
51 |
+
}
|
52 |
+
else {
|
53 |
+
//$collection = $this->getCurrentCategory();
|
54 |
+
$collection = Mage::getResourceModel('factfinder/search_collection');
|
55 |
+
$this->prepareProductCollection($collection);
|
56 |
+
$this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
return $collection;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Get collection of all filterable attributes for layer products set
|
66 |
+
*
|
67 |
+
* @return Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection
|
68 |
+
*/
|
69 |
+
public function getFilterableAttributes()
|
70 |
+
{
|
71 |
+
|
72 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
73 |
+
return parent::getFilterableAttributes();
|
74 |
+
}
|
75 |
+
|
76 |
+
/* @var $collection Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection */
|
77 |
+
$collection = Mage::getResourceModel('factfinder/product_attribute_collection')
|
78 |
+
->setItemObjectClass('catalog/resource_eav_attribute')
|
79 |
+
->setStoreId(Mage::app()->getStore()->getId());
|
80 |
+
|
81 |
+
return $collection;
|
82 |
+
}
|
83 |
+
}
|
@@ -1,7 +1,7 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if(Mage::helper('factfinder/search')->getIsOnSearchPage()){
|
4 |
-
class Flagbit_FactFinder_Model_Layer_Abstract extends Mage_CatalogSearch_Model_Layer {}
|
5 |
-
}else{
|
6 |
-
class Flagbit_FactFinder_Model_Layer_Abstract extends Mage_Catalog_Model_Layer {}
|
7 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if(Mage::helper('factfinder/search')->getIsOnSearchPage()){
|
4 |
+
class Flagbit_FactFinder_Model_Layer_Abstract extends Mage_CatalogSearch_Model_Layer {}
|
5 |
+
}else{
|
6 |
+
class Flagbit_FactFinder_Model_Layer_Abstract extends Mage_Catalog_Model_Layer {}
|
7 |
}
|
@@ -1,118 +1,118 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* This helper class provides the Price export
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Layer_Filter_Attribute_Abstract extends Mage_Catalog_Model_Layer_Filter_Attribute {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Array of Magento Layer Filter Items
|
25 |
-
* @var mixed
|
26 |
-
*/
|
27 |
-
protected $_filterItems = null;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Array of Selected Layer Filters
|
31 |
-
* @var mixed
|
32 |
-
*/
|
33 |
-
protected $_selectedFilterItems = array();
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Apply attribute option filter to product collection
|
37 |
-
*
|
38 |
-
* @param Zend_Controller_Request_Abstract $request
|
39 |
-
* @param Varien_Object $filterBlock
|
40 |
-
* @return Mage_Catalog_Model_Layer_Filter_Attribute
|
41 |
-
*/
|
42 |
-
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
|
43 |
-
{
|
44 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
45 |
-
return parent::apply($request, $filterBlock);
|
46 |
-
}
|
47 |
-
$this->_getItemsData();
|
48 |
-
$_attributeCode = $filterBlock->getAttributeModel()->getAttributeCode();
|
49 |
-
if (isset($this->_selectedFilterItems[$_attributeCode])
|
50 |
-
&& is_array($this->_selectedFilterItems[$_attributeCode])) {
|
51 |
-
|
52 |
-
foreach($this->_selectedFilterItems[$_attributeCode] as $option){
|
53 |
-
$this->getLayer()->getState()->addFilter($this->_createItem($option['label'], $option['value']));
|
54 |
-
}
|
55 |
-
}
|
56 |
-
return $this;
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Create filter item object
|
61 |
-
*
|
62 |
-
* @param string $label
|
63 |
-
* @param mixed $value
|
64 |
-
* @param int $count
|
65 |
-
* @return Mage_Catalog_Model_Layer_Filter_Item
|
66 |
-
*/
|
67 |
-
protected function _createItem($label, $value, $count=0)
|
68 |
-
{
|
69 |
-
|
70 |
-
if (!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')) {
|
71 |
-
return parent::_createItem($label, $value, $count);
|
72 |
-
}
|
73 |
-
|
74 |
-
return Mage::getModel('factfinder/layer_filter_item')
|
75 |
-
->setFilter($this)
|
76 |
-
->setLabel($label)
|
77 |
-
->setValue($value)
|
78 |
-
->setCount($count);
|
79 |
-
}
|
80 |
-
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Get data array for building attribute filter items
|
84 |
-
*
|
85 |
-
* @return array
|
86 |
-
*/
|
87 |
-
protected function _getItemsData()
|
88 |
-
{
|
89 |
-
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
90 |
-
return parent::_getItemsData();
|
91 |
-
}
|
92 |
-
|
93 |
-
if($this->_filterItems === null){
|
94 |
-
$attribute = $this->getAttributeModel();
|
95 |
-
$this->_requestVar = $attribute->getAttributeCode();
|
96 |
-
|
97 |
-
$key = $this->getLayer()->getStateKey().'_'.$this->_requestVar;
|
98 |
-
$data = $this->getLayer()->getAggregator()->getCacheData($key);
|
99 |
-
|
100 |
-
$options = $attribute->getItems();
|
101 |
-
$optionsCount = $attribute->getCount();
|
102 |
-
$this->_filterItems = array();
|
103 |
-
if(is_array($options)){
|
104 |
-
foreach ($options as $option) {
|
105 |
-
|
106 |
-
if($option['selected'] == true){
|
107 |
-
$this->_selectedFilterItems[$attribute->getAttributeCode()][] = $option;
|
108 |
-
continue;
|
109 |
-
}
|
110 |
-
$this->_filterItems[] = $option;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
return $this->_filterItems;
|
116 |
-
}
|
117 |
-
|
118 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* This helper class provides the Price export
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Layer_Filter_Attribute_Abstract extends Mage_Catalog_Model_Layer_Filter_Attribute {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Array of Magento Layer Filter Items
|
25 |
+
* @var mixed
|
26 |
+
*/
|
27 |
+
protected $_filterItems = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Array of Selected Layer Filters
|
31 |
+
* @var mixed
|
32 |
+
*/
|
33 |
+
protected $_selectedFilterItems = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Apply attribute option filter to product collection
|
37 |
+
*
|
38 |
+
* @param Zend_Controller_Request_Abstract $request
|
39 |
+
* @param Varien_Object $filterBlock
|
40 |
+
* @return Mage_Catalog_Model_Layer_Filter_Attribute
|
41 |
+
*/
|
42 |
+
public function apply(Zend_Controller_Request_Abstract $request, $filterBlock)
|
43 |
+
{
|
44 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
45 |
+
return parent::apply($request, $filterBlock);
|
46 |
+
}
|
47 |
+
$this->_getItemsData();
|
48 |
+
$_attributeCode = $filterBlock->getAttributeModel()->getAttributeCode();
|
49 |
+
if (isset($this->_selectedFilterItems[$_attributeCode])
|
50 |
+
&& is_array($this->_selectedFilterItems[$_attributeCode])) {
|
51 |
+
|
52 |
+
foreach($this->_selectedFilterItems[$_attributeCode] as $option){
|
53 |
+
$this->getLayer()->getState()->addFilter($this->_createItem($option['label'], $option['value']));
|
54 |
+
}
|
55 |
+
}
|
56 |
+
return $this;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Create filter item object
|
61 |
+
*
|
62 |
+
* @param string $label
|
63 |
+
* @param mixed $value
|
64 |
+
* @param int $count
|
65 |
+
* @return Mage_Catalog_Model_Layer_Filter_Item
|
66 |
+
*/
|
67 |
+
protected function _createItem($label, $value, $count=0)
|
68 |
+
{
|
69 |
+
|
70 |
+
if (!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')) {
|
71 |
+
return parent::_createItem($label, $value, $count);
|
72 |
+
}
|
73 |
+
|
74 |
+
return Mage::getModel('factfinder/layer_filter_item')
|
75 |
+
->setFilter($this)
|
76 |
+
->setLabel($label)
|
77 |
+
->setValue($value)
|
78 |
+
->setCount($count);
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get data array for building attribute filter items
|
84 |
+
*
|
85 |
+
* @return array
|
86 |
+
*/
|
87 |
+
protected function _getItemsData()
|
88 |
+
{
|
89 |
+
if(!Mage::helper('factfinder/search')->getIsEnabled(false, 'asn')){
|
90 |
+
return parent::_getItemsData();
|
91 |
+
}
|
92 |
+
|
93 |
+
if($this->_filterItems === null){
|
94 |
+
$attribute = $this->getAttributeModel();
|
95 |
+
$this->_requestVar = $attribute->getAttributeCode();
|
96 |
+
|
97 |
+
$key = $this->getLayer()->getStateKey().'_'.$this->_requestVar;
|
98 |
+
$data = $this->getLayer()->getAggregator()->getCacheData($key);
|
99 |
+
|
100 |
+
$options = $attribute->getItems();
|
101 |
+
$optionsCount = $attribute->getCount();
|
102 |
+
$this->_filterItems = array();
|
103 |
+
if(is_array($options)){
|
104 |
+
foreach ($options as $option) {
|
105 |
+
|
106 |
+
if($option['selected'] == true){
|
107 |
+
$this->_selectedFilterItems[$attribute->getAttributeCode()][] = $option;
|
108 |
+
continue;
|
109 |
+
}
|
110 |
+
$this->_filterItems[] = $option;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
return $this->_filterItems;
|
116 |
+
}
|
117 |
+
|
118 |
}
|
@@ -1,25 +1,25 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* This helper class provides the Price export
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalog extends Flagbit_FactFinder_Model_Layer_Filter_Attribute_Abstract {
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* This helper class provides the Price export
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalog extends Flagbit_FactFinder_Model_Layer_Filter_Attribute_Abstract {
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
}
|
@@ -1,35 +1,35 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* This helper class provides the Price export
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalogsearch extends Flagbit_FactFinder_Model_Layer_Filter_Attribute_Abstract {
|
22 |
-
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Check whether specified attribute can be used in LN
|
26 |
-
*
|
27 |
-
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
|
28 |
-
* @return bool
|
29 |
-
*/
|
30 |
-
protected function _getIsFilterableAttribute($attribute)
|
31 |
-
{
|
32 |
-
return $attribute->getIsFilterableInSearch();
|
33 |
-
}
|
34 |
-
|
35 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* This helper class provides the Price export
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalogsearch extends Flagbit_FactFinder_Model_Layer_Filter_Attribute_Abstract {
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Check whether specified attribute can be used in LN
|
26 |
+
*
|
27 |
+
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
|
28 |
+
* @return bool
|
29 |
+
*/
|
30 |
+
protected function _getIsFilterableAttribute($attribute)
|
31 |
+
{
|
32 |
+
return $attribute->getIsFilterableInSearch();
|
33 |
+
}
|
34 |
+
|
35 |
}
|
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
class Flagbit_FactFinder_Model_Layer_Filter_Item extends Mage_Catalog_Model_Layer_Filter_Item {
|
3 |
-
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Get url for remove item from filter
|
7 |
-
*
|
8 |
-
* @return string
|
9 |
-
*/
|
10 |
-
public function getRemoveUrl()
|
11 |
-
{
|
12 |
-
if (strtolower($this->getFilter()->getRequestVar()) == 'category' || $this->getValue() != '') {
|
13 |
-
$query = array($this->getFilter()->getRequestVar()=>$this->getValue());
|
14 |
-
$params['_current'] = true;
|
15 |
-
$params['_use_rewrite'] = true;
|
16 |
-
$params['_query'] = $query;
|
17 |
-
$params['_escape'] = true;
|
18 |
-
return Mage::getUrl('*/*/*', $params);
|
19 |
-
} else {
|
20 |
-
return parent::getRemoveUrl();
|
21 |
-
}
|
22 |
-
}
|
23 |
}
|
1 |
+
<?php
|
2 |
+
class Flagbit_FactFinder_Model_Layer_Filter_Item extends Mage_Catalog_Model_Layer_Filter_Item {
|
3 |
+
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Get url for remove item from filter
|
7 |
+
*
|
8 |
+
* @return string
|
9 |
+
*/
|
10 |
+
public function getRemoveUrl()
|
11 |
+
{
|
12 |
+
if (strtolower($this->getFilter()->getRequestVar()) == 'category' || $this->getValue() != '') {
|
13 |
+
$query = array($this->getFilter()->getRequestVar()=>$this->getValue());
|
14 |
+
$params['_current'] = true;
|
15 |
+
$params['_use_rewrite'] = true;
|
16 |
+
$params['_query'] = $query;
|
17 |
+
$params['_escape'] = true;
|
18 |
+
return Mage::getUrl('*/*/*', $params);
|
19 |
+
} else {
|
20 |
+
return parent::getRemoveUrl();
|
21 |
+
}
|
22 |
+
}
|
23 |
}
|
@@ -1,148 +1,148 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* Search Collection with FACT-Finder Search Results
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id: Collection.php 644 2011-03-17 13:26:59Z weller $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Mysql4_Campaign_Pushedproducts_Collection
|
22 |
-
extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* Get collection size
|
26 |
-
*
|
27 |
-
* @return int
|
28 |
-
*/
|
29 |
-
public function getSize()
|
30 |
-
{
|
31 |
-
return count($this->_getCampaign()->getPushedProducts());
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* get Campaign
|
36 |
-
*
|
37 |
-
* @return FACTFinder_Campaign
|
38 |
-
*/
|
39 |
-
protected function _getCampaign()
|
40 |
-
{
|
41 |
-
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
42 |
-
return Mage::getSingleton('factfinder/handler_search')->getCampaigns();
|
43 |
-
}
|
44 |
-
|
45 |
-
return null;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Load entities records into items
|
50 |
-
*
|
51 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
52 |
-
*/
|
53 |
-
public function _loadEntities($printQuery = false, $logQuery = false)
|
54 |
-
{
|
55 |
-
|
56 |
-
$productIds = array();
|
57 |
-
$campaigns = $this->_getCampaign();
|
58 |
-
|
59 |
-
if (!$campaigns) {
|
60 |
-
return $this;
|
61 |
-
}
|
62 |
-
|
63 |
-
foreach($campaigns->getPushedProducts() as $record){
|
64 |
-
$productIds[$record->getId()] = new Varien_Object(
|
65 |
-
array(
|
66 |
-
'similarity' => $record->getSimilarity(),
|
67 |
-
'position' => $record->getPosition(),
|
68 |
-
'original_position' => $record->getOriginalPosition()
|
69 |
-
)
|
70 |
-
);
|
71 |
-
}
|
72 |
-
$idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
|
73 |
-
|
74 |
-
if (!empty($productIds)) {
|
75 |
-
|
76 |
-
// add Filter to Query
|
77 |
-
$this->addFieldToFilter(
|
78 |
-
$idFieldName,
|
79 |
-
array('in'=>array_keys($productIds))
|
80 |
-
);
|
81 |
-
|
82 |
-
$this->_pageSize = null;
|
83 |
-
$entity = $this->getEntity();
|
84 |
-
|
85 |
-
$this->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
|
86 |
-
$this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);
|
87 |
-
|
88 |
-
$this->printLogQuery($printQuery, $logQuery);
|
89 |
-
Mage::helper('factfinder/debug')->log('Search SQL Query: '.$this->getSelect()->__toString());
|
90 |
-
|
91 |
-
try {
|
92 |
-
$rows = $this->_fetchAll($this->getSelect());
|
93 |
-
} catch (Exception $e) {
|
94 |
-
Mage::printException($e, $this->getSelect());
|
95 |
-
$this->printLogQuery(true, true, $this->getSelect());
|
96 |
-
throw $e;
|
97 |
-
}
|
98 |
-
|
99 |
-
$items = array();
|
100 |
-
foreach ($rows as $v) {
|
101 |
-
$items[$v[$idFieldName]] = $v;
|
102 |
-
}
|
103 |
-
|
104 |
-
foreach ($productIds as $productId => $additionalData){
|
105 |
-
|
106 |
-
if(empty($items[$productId])){
|
107 |
-
continue;
|
108 |
-
}
|
109 |
-
$v = array_merge($items[$productId], $additionalData->toArray());
|
110 |
-
$object = $this->getNewEmptyItem()
|
111 |
-
->setData($v);
|
112 |
-
|
113 |
-
$this->addItem($object);
|
114 |
-
if (isset($this->_itemsById[$object->getId()])) {
|
115 |
-
$this->_itemsById[$object->getId()][] = $object;
|
116 |
-
}
|
117 |
-
else {
|
118 |
-
$this->_itemsById[$object->getId()] = array($object);
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
122 |
-
}
|
123 |
-
return $this;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Add search query filter
|
128 |
-
*
|
129 |
-
* @param Mage_CatalogSearch_Model_Query $query
|
130 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
|
131 |
-
*/
|
132 |
-
public function addSearchFilter($query)
|
133 |
-
{
|
134 |
-
return $this;
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Set Order field
|
139 |
-
*
|
140 |
-
* @param string $attribute
|
141 |
-
* @param string $dir
|
142 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
143 |
-
*/
|
144 |
-
public function setOrder($attribute, $dir='desc')
|
145 |
-
{
|
146 |
-
return $this;
|
147 |
-
}
|
148 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* Search Collection with FACT-Finder Search Results
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id: Collection.php 644 2011-03-17 13:26:59Z weller $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Mysql4_Campaign_Pushedproducts_Collection
|
22 |
+
extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Get collection size
|
26 |
+
*
|
27 |
+
* @return int
|
28 |
+
*/
|
29 |
+
public function getSize()
|
30 |
+
{
|
31 |
+
return count($this->_getCampaign()->getPushedProducts());
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* get Campaign
|
36 |
+
*
|
37 |
+
* @return FACTFinder_Campaign
|
38 |
+
*/
|
39 |
+
protected function _getCampaign()
|
40 |
+
{
|
41 |
+
if(Mage::helper('factfinder/search')->getIsEnabled(false, 'campaign')){
|
42 |
+
return Mage::getSingleton('factfinder/handler_search')->getCampaigns();
|
43 |
+
}
|
44 |
+
|
45 |
+
return null;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Load entities records into items
|
50 |
+
*
|
51 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
52 |
+
*/
|
53 |
+
public function _loadEntities($printQuery = false, $logQuery = false)
|
54 |
+
{
|
55 |
+
|
56 |
+
$productIds = array();
|
57 |
+
$campaigns = $this->_getCampaign();
|
58 |
+
|
59 |
+
if (!$campaigns) {
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
|
63 |
+
foreach($campaigns->getPushedProducts() as $record){
|
64 |
+
$productIds[$record->getId()] = new Varien_Object(
|
65 |
+
array(
|
66 |
+
'similarity' => $record->getSimilarity(),
|
67 |
+
'position' => $record->getPosition(),
|
68 |
+
'original_position' => $record->getOriginalPosition()
|
69 |
+
)
|
70 |
+
);
|
71 |
+
}
|
72 |
+
$idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
|
73 |
+
|
74 |
+
if (!empty($productIds)) {
|
75 |
+
|
76 |
+
// add Filter to Query
|
77 |
+
$this->addFieldToFilter(
|
78 |
+
$idFieldName,
|
79 |
+
array('in'=>array_keys($productIds))
|
80 |
+
);
|
81 |
+
|
82 |
+
$this->_pageSize = null;
|
83 |
+
$entity = $this->getEntity();
|
84 |
+
|
85 |
+
$this->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
|
86 |
+
$this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);
|
87 |
+
|
88 |
+
$this->printLogQuery($printQuery, $logQuery);
|
89 |
+
Mage::helper('factfinder/debug')->log('Search SQL Query: '.$this->getSelect()->__toString());
|
90 |
+
|
91 |
+
try {
|
92 |
+
$rows = $this->_fetchAll($this->getSelect());
|
93 |
+
} catch (Exception $e) {
|
94 |
+
Mage::printException($e, $this->getSelect());
|
95 |
+
$this->printLogQuery(true, true, $this->getSelect());
|
96 |
+
throw $e;
|
97 |
+
}
|
98 |
+
|
99 |
+
$items = array();
|
100 |
+
foreach ($rows as $v) {
|
101 |
+
$items[$v[$idFieldName]] = $v;
|
102 |
+
}
|
103 |
+
|
104 |
+
foreach ($productIds as $productId => $additionalData){
|
105 |
+
|
106 |
+
if(empty($items[$productId])){
|
107 |
+
continue;
|
108 |
+
}
|
109 |
+
$v = array_merge($items[$productId], $additionalData->toArray());
|
110 |
+
$object = $this->getNewEmptyItem()
|
111 |
+
->setData($v);
|
112 |
+
|
113 |
+
$this->addItem($object);
|
114 |
+
if (isset($this->_itemsById[$object->getId()])) {
|
115 |
+
$this->_itemsById[$object->getId()][] = $object;
|
116 |
+
}
|
117 |
+
else {
|
118 |
+
$this->_itemsById[$object->getId()] = array($object);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Add search query filter
|
128 |
+
*
|
129 |
+
* @param Mage_CatalogSearch_Model_Query $query
|
130 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
|
131 |
+
*/
|
132 |
+
public function addSearchFilter($query)
|
133 |
+
{
|
134 |
+
return $this;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Set Order field
|
139 |
+
*
|
140 |
+
* @param string $attribute
|
141 |
+
* @param string $dir
|
142 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
143 |
+
*/
|
144 |
+
public function setOrder($attribute, $dir='desc')
|
145 |
+
{
|
146 |
+
return $this;
|
147 |
+
}
|
148 |
+
}
|
@@ -1,144 +1,144 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* Filter Attribute Collection
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Collection {
|
22 |
-
|
23 |
-
protected $_result = null;
|
24 |
-
protected $_attributeLabels = null;
|
25 |
-
protected $_storeId = null;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Get collection size
|
29 |
-
*
|
30 |
-
* @return int
|
31 |
-
*/
|
32 |
-
public function getSize()
|
33 |
-
{
|
34 |
-
return count($this->_getSearchHandler()->getAfterSearchNavigation());
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* get Facade
|
39 |
-
*
|
40 |
-
* @return Flagbit_FactFinder_Model_Facade
|
41 |
-
*/
|
42 |
-
protected function _getSearchHandler()
|
43 |
-
{
|
44 |
-
return Mage::getSingleton('factfinder/handler_search');
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Load entities records into items
|
49 |
-
*
|
50 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
51 |
-
*/
|
52 |
-
public function load($printQuery = false, $logQuery = false)
|
53 |
-
{
|
54 |
-
if ($this->isLoaded()) {
|
55 |
-
return $this;
|
56 |
-
}
|
57 |
-
|
58 |
-
$result = $this->_getSearchHandler()->getAfterSearchNavigation();
|
59 |
-
|
60 |
-
if (count($result)) {
|
61 |
-
$this->resetData();
|
62 |
-
|
63 |
-
foreach ($result as $row) {
|
64 |
-
$item = $this->getNewEmptyItem();
|
65 |
-
if ($this->getIdFieldName()) {
|
66 |
-
$item->setIdFieldName($this->getIdFieldName());
|
67 |
-
}
|
68 |
-
$row['store_label'] = $this->_getStoreLabelsByAttributeCode($row['name']);
|
69 |
-
$item->addData($row);
|
70 |
-
$this->addItem($item);
|
71 |
-
}
|
72 |
-
|
73 |
-
$this->_setIsLoaded();
|
74 |
-
$this->_afterLoad();
|
75 |
-
}
|
76 |
-
return $this;
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Add search query filter
|
82 |
-
*
|
83 |
-
* @param Mage_CatalogSearch_Model_Query $query
|
84 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
|
85 |
-
*/
|
86 |
-
public function addSearchFilter($query)
|
87 |
-
{
|
88 |
-
return $this;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Retrieve store labels by given attribute code
|
93 |
-
*
|
94 |
-
* @param string $attributeCode
|
95 |
-
* @return array
|
96 |
-
*/
|
97 |
-
protected function _getStoreLabelsByAttributeCode($attributeCode)
|
98 |
-
{
|
99 |
-
if($this->_attributeLabels === null){
|
100 |
-
$entityType = Mage::getSingleton('eav/config')->getEntityType('catalog_product');
|
101 |
-
|
102 |
-
$values = array();
|
103 |
-
|
104 |
-
$select = $this->getConnection()->select()
|
105 |
-
->from(array('main_table' => $this->getTable('eav/attribute')), array('attribute_code'))
|
106 |
-
->joinLeft(
|
107 |
-
array('additional_table' => $this->getTable('eav/attribute_label')),
|
108 |
-
'additional_table.attribute_id = main_table.attribute_id',
|
109 |
-
null
|
110 |
-
)
|
111 |
-
->columns(array('value' => new Zend_Db_Expr('IF(additional_table.value IS NULL, main_table.frontend_label, additional_table.value)')))
|
112 |
-
->where('main_table.entity_type_id = ?', $entityType->getEntityTypeId())
|
113 |
-
->where('additional_table.store_id IS NULL OR additional_table.store_id=?', $this->_storeId);
|
114 |
-
|
115 |
-
$this->_attributeLabels = $this->getConnection()->fetchPairs($select);
|
116 |
-
}
|
117 |
-
return isset($this->_attributeLabels[$attributeCode]) ? $this->_attributeLabels[$attributeCode] : $attributeCode;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* set Store ID
|
122 |
-
*
|
123 |
-
* @param int $storeId
|
124 |
-
* @return Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection
|
125 |
-
*/
|
126 |
-
public function setStoreId($storeId)
|
127 |
-
{
|
128 |
-
$this->_storeId = $storeId;
|
129 |
-
return $this;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Set Order field
|
134 |
-
*
|
135 |
-
* @param string $attribute
|
136 |
-
* @param string $dir
|
137 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
138 |
-
*/
|
139 |
-
public function setOrder($attribute, $dir='desc')
|
140 |
-
{
|
141 |
-
return $this;
|
142 |
-
}
|
143 |
-
|
144 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* Filter Attribute Collection
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Collection {
|
22 |
+
|
23 |
+
protected $_result = null;
|
24 |
+
protected $_attributeLabels = null;
|
25 |
+
protected $_storeId = null;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get collection size
|
29 |
+
*
|
30 |
+
* @return int
|
31 |
+
*/
|
32 |
+
public function getSize()
|
33 |
+
{
|
34 |
+
return count($this->_getSearchHandler()->getAfterSearchNavigation());
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* get Facade
|
39 |
+
*
|
40 |
+
* @return Flagbit_FactFinder_Model_Facade
|
41 |
+
*/
|
42 |
+
protected function _getSearchHandler()
|
43 |
+
{
|
44 |
+
return Mage::getSingleton('factfinder/handler_search');
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Load entities records into items
|
49 |
+
*
|
50 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
51 |
+
*/
|
52 |
+
public function load($printQuery = false, $logQuery = false)
|
53 |
+
{
|
54 |
+
if ($this->isLoaded()) {
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
|
58 |
+
$result = $this->_getSearchHandler()->getAfterSearchNavigation();
|
59 |
+
|
60 |
+
if (count($result)) {
|
61 |
+
$this->resetData();
|
62 |
+
|
63 |
+
foreach ($result as $row) {
|
64 |
+
$item = $this->getNewEmptyItem();
|
65 |
+
if ($this->getIdFieldName()) {
|
66 |
+
$item->setIdFieldName($this->getIdFieldName());
|
67 |
+
}
|
68 |
+
$row['store_label'] = $this->_getStoreLabelsByAttributeCode($row['name']);
|
69 |
+
$item->addData($row);
|
70 |
+
$this->addItem($item);
|
71 |
+
}
|
72 |
+
|
73 |
+
$this->_setIsLoaded();
|
74 |
+
$this->_afterLoad();
|
75 |
+
}
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Add search query filter
|
82 |
+
*
|
83 |
+
* @param Mage_CatalogSearch_Model_Query $query
|
84 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
|
85 |
+
*/
|
86 |
+
public function addSearchFilter($query)
|
87 |
+
{
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Retrieve store labels by given attribute code
|
93 |
+
*
|
94 |
+
* @param string $attributeCode
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
protected function _getStoreLabelsByAttributeCode($attributeCode)
|
98 |
+
{
|
99 |
+
if($this->_attributeLabels === null){
|
100 |
+
$entityType = Mage::getSingleton('eav/config')->getEntityType('catalog_product');
|
101 |
+
|
102 |
+
$values = array();
|
103 |
+
|
104 |
+
$select = $this->getConnection()->select()
|
105 |
+
->from(array('main_table' => $this->getTable('eav/attribute')), array('attribute_code'))
|
106 |
+
->joinLeft(
|
107 |
+
array('additional_table' => $this->getTable('eav/attribute_label')),
|
108 |
+
'additional_table.attribute_id = main_table.attribute_id',
|
109 |
+
null
|
110 |
+
)
|
111 |
+
->columns(array('value' => new Zend_Db_Expr('IF(additional_table.value IS NULL, main_table.frontend_label, additional_table.value)')))
|
112 |
+
->where('main_table.entity_type_id = ?', $entityType->getEntityTypeId())
|
113 |
+
->where('additional_table.store_id IS NULL OR additional_table.store_id=?', $this->_storeId);
|
114 |
+
|
115 |
+
$this->_attributeLabels = $this->getConnection()->fetchPairs($select);
|
116 |
+
}
|
117 |
+
return isset($this->_attributeLabels[$attributeCode]) ? $this->_attributeLabels[$attributeCode] : $attributeCode;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* set Store ID
|
122 |
+
*
|
123 |
+
* @param int $storeId
|
124 |
+
* @return Flagbit_FactFinder_Model_Mysql4_Product_Attribute_Collection
|
125 |
+
*/
|
126 |
+
public function setStoreId($storeId)
|
127 |
+
{
|
128 |
+
$this->_storeId = $storeId;
|
129 |
+
return $this;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Set Order field
|
134 |
+
*
|
135 |
+
* @param string $attribute
|
136 |
+
* @param string $dir
|
137 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
138 |
+
*/
|
139 |
+
public function setOrder($attribute, $dir='desc')
|
140 |
+
{
|
141 |
+
return $this;
|
142 |
+
}
|
143 |
+
|
144 |
}
|
@@ -1,59 +1,59 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Recommendation based product collection.
|
12 |
-
*
|
13 |
-
* Data is caught by FACT-Finder, passed to normal collection, works quite as if it was the default behavior.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <türk@flagbit.de>
|
19 |
-
* @version $Id: Search.php 678 2011-08-01 13:02:50Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Mysql4_Product_Recommendation_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Pass the product ids from FACT-Finder to the collection.
|
25 |
-
*
|
26 |
-
* @param array $recommendations Array with id information in Objects.
|
27 |
-
*/
|
28 |
-
public function setRecommendations($recommendations)
|
29 |
-
{
|
30 |
-
$ids = array();
|
31 |
-
foreach ($recommendations as $recommendationItem) {
|
32 |
-
$ids[] = $recommendationItem->getId();
|
33 |
-
}
|
34 |
-
|
35 |
-
$searchHelper = Mage::helper('factfinder/search');
|
36 |
-
$idFieldName = $searchHelper->getIdFieldName();
|
37 |
-
|
38 |
-
$this->addAttributeToFilter($idFieldName, array('in' => $ids));
|
39 |
-
|
40 |
-
$order = new Zend_Db_Expr($this->getConnection()->quoteInto('find_in_set(`e`.`' . $idFieldName . '`, ?)', implode(',', $ids)));
|
41 |
-
$this->getSelect()->order($order);
|
42 |
-
|
43 |
-
return $this;
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Helper function to exclude certain products that are already in the cart.
|
49 |
-
*
|
50 |
-
* @param array $ninIds Simple array of product ids
|
51 |
-
*/
|
52 |
-
public function addExcludeProductFilter($ninIds)
|
53 |
-
{
|
54 |
-
$this->addAttributeToFilter($this->getIdFieldName(), array('nin' => $ninIds));
|
55 |
-
|
56 |
-
return $this;
|
57 |
-
}
|
58 |
-
|
59 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Recommendation based product collection.
|
12 |
+
*
|
13 |
+
* Data is caught by FACT-Finder, passed to normal collection, works quite as if it was the default behavior.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <türk@flagbit.de>
|
19 |
+
* @version $Id: Search.php 678 2011-08-01 13:02:50Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Mysql4_Product_Recommendation_Collection extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Pass the product ids from FACT-Finder to the collection.
|
25 |
+
*
|
26 |
+
* @param array $recommendations Array with id information in Objects.
|
27 |
+
*/
|
28 |
+
public function setRecommendations($recommendations)
|
29 |
+
{
|
30 |
+
$ids = array();
|
31 |
+
foreach ($recommendations as $recommendationItem) {
|
32 |
+
$ids[] = $recommendationItem->getId();
|
33 |
+
}
|
34 |
+
|
35 |
+
$searchHelper = Mage::helper('factfinder/search');
|
36 |
+
$idFieldName = $searchHelper->getIdFieldName();
|
37 |
+
|
38 |
+
$this->addAttributeToFilter($idFieldName, array('in' => $ids));
|
39 |
+
|
40 |
+
$order = new Zend_Db_Expr($this->getConnection()->quoteInto('find_in_set(`e`.`' . $idFieldName . '`, ?)', implode(',', $ids)));
|
41 |
+
$this->getSelect()->order($order);
|
42 |
+
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Helper function to exclude certain products that are already in the cart.
|
49 |
+
*
|
50 |
+
* @param array $ninIds Simple array of product ids
|
51 |
+
*/
|
52 |
+
public function addExcludeProductFilter($ninIds)
|
53 |
+
{
|
54 |
+
$this->addAttributeToFilter($this->getIdFieldName(), array('nin' => $ninIds));
|
55 |
+
|
56 |
+
return $this;
|
57 |
+
}
|
58 |
+
|
59 |
}
|
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Ressource Model class
|
12 |
-
*
|
13 |
-
* Queue for SCIC orders. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Mysql4_Scic_Queue extends Mage_Core_Model_Mysql4_Abstract
|
22 |
-
{
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Constructor with simple Magento initialisation
|
26 |
-
*/
|
27 |
-
protected function _construct() {
|
28 |
-
$this->_init('factfinder/scic_queue', 'id');
|
29 |
-
}
|
30 |
-
|
31 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Ressource Model class
|
12 |
+
*
|
13 |
+
* Queue for SCIC orders. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Mysql4_Scic_Queue extends Mage_Core_Model_Mysql4_Abstract
|
22 |
+
{
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Constructor with simple Magento initialisation
|
26 |
+
*/
|
27 |
+
protected function _construct() {
|
28 |
+
$this->_init('factfinder/scic_queue', 'id');
|
29 |
+
}
|
30 |
+
|
31 |
}
|
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Collection class
|
12 |
-
*
|
13 |
-
* Queue for SCIC orders. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Mysql4_Scic_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
22 |
-
{
|
23 |
-
protected function _construct()
|
24 |
-
{
|
25 |
-
$this->_init('factfinder/scic_queue')
|
26 |
-
->setOrder('store_id', 'ASC');
|
27 |
-
}
|
28 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Collection class
|
12 |
+
*
|
13 |
+
* Queue for SCIC orders. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Mysql4_Scic_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
22 |
+
{
|
23 |
+
protected function _construct()
|
24 |
+
{
|
25 |
+
$this->_init('factfinder/scic_queue')
|
26 |
+
->setOrder('store_id', 'ASC');
|
27 |
+
}
|
28 |
}
|
@@ -1,135 +1,135 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* Search Collection with FACT-Finder Search Results
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <joerg.weller@flagbit.de>
|
19 |
-
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
20 |
-
* @version $Id$
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_Model_Mysql4_Search_Collection
|
23 |
-
extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
24 |
-
{
|
25 |
-
/**
|
26 |
-
* Get collection size
|
27 |
-
*
|
28 |
-
* @return int
|
29 |
-
*/
|
30 |
-
public function getSize()
|
31 |
-
{
|
32 |
-
return $this->_getSearchHandler()->getSearchResultCount();
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* get Factfinder Facade
|
37 |
-
*
|
38 |
-
* @return Flagbit_FactFinder_Model_Handler_Search
|
39 |
-
*/
|
40 |
-
protected function _getSearchHandler()
|
41 |
-
{
|
42 |
-
return Mage::getSingleton('factfinder/handler_search');
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Load entities records into items
|
47 |
-
*
|
48 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
49 |
-
*/
|
50 |
-
public function _loadEntities($printQuery = false, $logQuery = false)
|
51 |
-
{
|
52 |
-
// get product IDs from Fact-Finder
|
53 |
-
$productIds = $this->_getSearchHandler()->getSearchResult();
|
54 |
-
|
55 |
-
$searchResult = Mage::getSingleton('factfinder/facade')->getSearchResult();
|
56 |
-
if($searchResult && $refKey = $searchResult->getRefKey()) {
|
57 |
-
Mage::getSingleton('core/session')->setFactFinderRefKey($refKey);
|
58 |
-
}
|
59 |
-
|
60 |
-
if (!empty($productIds)) {
|
61 |
-
$idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
|
62 |
-
|
63 |
-
// add Filter to Query
|
64 |
-
$this->addFieldToFilter(
|
65 |
-
$idFieldName,
|
66 |
-
array('in'=>array_keys($productIds))
|
67 |
-
);
|
68 |
-
|
69 |
-
$this->_pageSize = null;
|
70 |
-
$entity = $this->getEntity();
|
71 |
-
|
72 |
-
$this->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
|
73 |
-
$this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);
|
74 |
-
|
75 |
-
$this->printLogQuery($printQuery, $logQuery);
|
76 |
-
Mage::helper('factfinder/debug')->log('Search SQL Query: '.$this->getSelect()->__toString());
|
77 |
-
|
78 |
-
try {
|
79 |
-
$rows = $this->_fetchAll($this->getSelect());
|
80 |
-
} catch (Exception $e) {
|
81 |
-
Mage::printException($e, $this->getSelect());
|
82 |
-
$this->printLogQuery(true, true, $this->getSelect());
|
83 |
-
throw $e;
|
84 |
-
}
|
85 |
-
|
86 |
-
$items = array();
|
87 |
-
foreach ($rows as $v) {
|
88 |
-
$items[trim($v[$idFieldName])] = $v;
|
89 |
-
}
|
90 |
-
|
91 |
-
foreach ($productIds as $productId => $additionalData){
|
92 |
-
|
93 |
-
if(empty($items[$productId])){
|
94 |
-
continue;
|
95 |
-
}
|
96 |
-
$v = array_merge($items[$productId], $additionalData->toArray());
|
97 |
-
$object = $this->getNewEmptyItem()
|
98 |
-
->setData($v);
|
99 |
-
|
100 |
-
$this->addItem($object);
|
101 |
-
if (isset($this->_itemsById[$object->getId()])) {
|
102 |
-
$this->_itemsById[$object->getId()][] = $object;
|
103 |
-
}
|
104 |
-
else {
|
105 |
-
$this->_itemsById[$object->getId()] = array($object);
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
}
|
110 |
-
return $this;
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Add search query filter
|
115 |
-
*
|
116 |
-
* @param Mage_CatalogSearch_Model_Query $query
|
117 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
|
118 |
-
*/
|
119 |
-
public function addSearchFilter($query)
|
120 |
-
{
|
121 |
-
return $this;
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Set Order field
|
126 |
-
*
|
127 |
-
* @param string $attribute
|
128 |
-
* @param string $dir
|
129 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
130 |
-
*/
|
131 |
-
public function setOrder($attribute, $dir='desc')
|
132 |
-
{
|
133 |
-
return $this;
|
134 |
-
}
|
135 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* Search Collection with FACT-Finder Search Results
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <joerg.weller@flagbit.de>
|
19 |
+
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
20 |
+
* @version $Id$
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_Model_Mysql4_Search_Collection
|
23 |
+
extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Get collection size
|
27 |
+
*
|
28 |
+
* @return int
|
29 |
+
*/
|
30 |
+
public function getSize()
|
31 |
+
{
|
32 |
+
return $this->_getSearchHandler()->getSearchResultCount();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* get Factfinder Facade
|
37 |
+
*
|
38 |
+
* @return Flagbit_FactFinder_Model_Handler_Search
|
39 |
+
*/
|
40 |
+
protected function _getSearchHandler()
|
41 |
+
{
|
42 |
+
return Mage::getSingleton('factfinder/handler_search');
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Load entities records into items
|
47 |
+
*
|
48 |
+
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
49 |
+
*/
|
50 |
+
public function _loadEntities($printQuery = false, $logQuery = false)
|
51 |
+
{
|
52 |
+
// get product IDs from Fact-Finder
|
53 |
+
$productIds = $this->_getSearchHandler()->getSearchResult();
|
54 |
+
|
55 |
+
$searchResult = Mage::getSingleton('factfinder/facade')->getSearchResult();
|
56 |
+
if($searchResult && $refKey = $searchResult->getRefKey()) {
|
57 |
+
Mage::getSingleton('core/session')->setFactFinderRefKey($refKey);
|
58 |
+
}
|
59 |
+
|
60 |
+
if (!empty($productIds)) {
|
61 |
+
$idFieldName = Mage::helper('factfinder/search')->getIdFieldName();
|
62 |
+
|
63 |
+
// add Filter to Query
|
64 |
+
$this->addFieldToFilter(
|
65 |
+
$idFieldName,
|
66 |
+
array('in'=>array_keys($productIds))
|
67 |
+
);
|
68 |
+
|
69 |
+
$this->_pageSize = null;
|
70 |
+
$entity = $this->getEntity();
|
71 |
+
|
72 |
+
$this->getSelect()->reset(Zend_Db_Select::LIMIT_COUNT);
|
73 |
+
$this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);
|
74 |
+
|
75 |
+
$this->printLogQuery($printQuery, $logQuery);
|
76 |
+
Mage::helper('factfinder/debug')->log('Search SQL Query: '.$this->getSelect()->__toString());
|
77 |
+
|
78 |
+
try {
|
79 |
+
$rows = $this->_fetchAll($this->getSelect());
|
80 |
+
} catch (Exception $e) {
|
81 |
+
Mage::printException($e, $this->getSelect());
|
82 |
+
$this->printLogQuery(true, true, $this->getSelect());
|
83 |
+
throw $e;
|
84 |
+
}
|
85 |
+
|
86 |
+
$items = array();
|
87 |
+
foreach ($rows as $v) {
|
88 |
+
$items[trim($v[$idFieldName])] = $v;
|
89 |
+
}
|
90 |
+
|
91 |
+
foreach ($productIds as $productId => $additionalData){
|
92 |
+
|
93 |
+
if(empty($items[$productId])){
|
94 |
+
continue;
|
95 |
+
}
|
96 |
+
$v = array_merge($items[$productId], $additionalData->toArray());
|
97 |
+
$object = $this->getNewEmptyItem()
|
98 |
+
->setData($v);
|
99 |
+
|
100 |
+
$this->addItem($object);
|
101 |
+
if (isset($this->_itemsById[$object->getId()])) {
|
102 |
+
$this->_itemsById[$object->getId()][] = $object;
|
103 |
+
}
|
104 |
+
else {
|
105 |
+
$this->_itemsById[$object->getId()] = array($object);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
110 |
+
return $this;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Add search query filter
|
115 |
+
*
|
116 |
+
* @param Mage_CatalogSearch_Model_Query $query
|
117 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Search_Collection
|
118 |
+
*/
|
119 |
+
public function addSearchFilter($query)
|
120 |
+
{
|
121 |
+
return $this;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Set Order field
|
126 |
+
*
|
127 |
+
* @param string $attribute
|
128 |
+
* @param string $dir
|
129 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
130 |
+
*/
|
131 |
+
public function setOrder($attribute, $dir='desc')
|
132 |
+
{
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
}
|
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* FACT-Finder Search Engine Model
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Mysql4_Search_Engine extends Mage_CatalogSearch_Model_Mysql4_Fulltext_Engine
|
22 |
-
{
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Retrieve fulltext search result data collection
|
26 |
-
*
|
27 |
-
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
28 |
-
*/
|
29 |
-
public function getResultCollection()
|
30 |
-
{
|
31 |
-
return Mage::getResourceModel('factfinder/search_collection');
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Define if Layered Navigation is allowed
|
36 |
-
*
|
37 |
-
* @return bool
|
38 |
-
*/
|
39 |
-
public function isLeyeredNavigationAllowed()
|
40 |
-
{
|
41 |
-
return true;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Define if engine is avaliable
|
46 |
-
*
|
47 |
-
* @return bool
|
48 |
-
*/
|
49 |
-
public function test()
|
50 |
-
{
|
51 |
-
return Mage::helper('factfinder/search')->getIsEnabled(false, 'asn');
|
52 |
-
}
|
53 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* FACT-Finder Search Engine Model
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Mysql4_Search_Engine extends Mage_CatalogSearch_Model_Mysql4_Fulltext_Engine
|
22 |
+
{
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Retrieve fulltext search result data collection
|
26 |
+
*
|
27 |
+
* @return Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection
|
28 |
+
*/
|
29 |
+
public function getResultCollection()
|
30 |
+
{
|
31 |
+
return Mage::getResourceModel('factfinder/search_collection');
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Define if Layered Navigation is allowed
|
36 |
+
*
|
37 |
+
* @return bool
|
38 |
+
*/
|
39 |
+
public function isLeyeredNavigationAllowed()
|
40 |
+
{
|
41 |
+
return true;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Define if engine is avaliable
|
46 |
+
*
|
47 |
+
* @return bool
|
48 |
+
*/
|
49 |
+
public function test()
|
50 |
+
{
|
51 |
+
return Mage::helper('factfinder/search')->getIsEnabled(false, 'asn');
|
52 |
+
}
|
53 |
+
}
|
@@ -1,394 +1,394 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* Observer for Magento events.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <michael.tuerk@flagbit.de>
|
19 |
-
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
20 |
-
* @version $Id: Observer.php 26.08.13 15:05 $
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_Model_Observer
|
23 |
-
{
|
24 |
-
const _asnBlockRegistryKey = 'FACTFINDER__asnBlock';
|
25 |
-
const _campaignRedirectRegistryKey = 'FACTFINDER__campaignRedirectBlock';
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Observer method.
|
29 |
-
* Sends information to FACT-Finder if item was added to cart.
|
30 |
-
*
|
31 |
-
* @param Varien_Event_Observer $observer
|
32 |
-
*/
|
33 |
-
public function addToCartSendSCIC($observer)
|
34 |
-
{
|
35 |
-
if (!Mage::getStoreConfigFlag('factfinder/export/track_carts')) {
|
36 |
-
return;
|
37 |
-
}
|
38 |
-
|
39 |
-
$quoteItem = $observer->getQuoteItem();
|
40 |
-
$product = $observer->getProduct();
|
41 |
-
|
42 |
-
$searchHelper = Mage::helper('factfinder/search');
|
43 |
-
$idFieldName = $searchHelper->getIdFieldName();
|
44 |
-
|
45 |
-
$qty = $quoteItem->getQty();
|
46 |
-
|
47 |
-
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
48 |
-
if ($customerId) {
|
49 |
-
$customerId = md5('customer_' . $customerId);
|
50 |
-
}
|
51 |
-
|
52 |
-
try {
|
53 |
-
/* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
|
54 |
-
$tracking = Mage::getModel('factfinder/handler_tracking');
|
55 |
-
$tracking->getTrackingAdapter()->setupEventTracking(
|
56 |
-
FACTFinder_Default_TrackingAdapter::EVENT_CART,
|
57 |
-
array(
|
58 |
-
'id' => $product->getData($idFieldName),
|
59 |
-
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
60 |
-
'amount' => $qty,
|
61 |
-
'price' => $product->getFinalPrice($qty),
|
62 |
-
'uid' => $customerId,
|
63 |
-
'site' => Mage::app()->getStore()->getCode(),
|
64 |
-
'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey()
|
65 |
-
)
|
66 |
-
);
|
67 |
-
$tracking->applyTracking();
|
68 |
-
}
|
69 |
-
catch (Exception $e) {
|
70 |
-
Mage::helper('factfinder/debug')->log($e->getMessage());
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Tracking of single product click
|
76 |
-
*
|
77 |
-
* @param $product
|
78 |
-
*/
|
79 |
-
protected function sendClickTrackingForSingleProduct($product)
|
80 |
-
{
|
81 |
-
$searchHelper = Mage::helper('factfinder/search');
|
82 |
-
|
83 |
-
if (!$searchHelper->getIsEnabled(false, 'clicktracking')) {
|
84 |
-
return;
|
85 |
-
}
|
86 |
-
|
87 |
-
try {
|
88 |
-
$idFieldName = $searchHelper->getIdFieldName();
|
89 |
-
|
90 |
-
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
91 |
-
if ($customerId) {
|
92 |
-
$customerId = md5('customer_' . $customerId);
|
93 |
-
}
|
94 |
-
|
95 |
-
/* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
|
96 |
-
$tracking = Mage::getModel('factfinder/handler_tracking');
|
97 |
-
$tracking->getTrackingAdapter()->setupEventTracking(
|
98 |
-
FACTFinder_Default_TrackingAdapter::EVENT_INSPECT,
|
99 |
-
array(
|
100 |
-
'id' => $product->getData($idFieldName),
|
101 |
-
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
102 |
-
'price' => $product->getFinalPrice(),
|
103 |
-
'uid' => $customerId,
|
104 |
-
'site' => Mage::app()->getStore()->getCode(),
|
105 |
-
'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey(),
|
106 |
-
'product' => $product
|
107 |
-
)
|
108 |
-
);
|
109 |
-
$tracking->applyTracking();
|
110 |
-
}
|
111 |
-
catch (Exception $e) {
|
112 |
-
Mage::helper('factfinder/debug')->log($e->getMessage());
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Observer method
|
118 |
-
* Adds all ordered items to queue that is sent to FACT-Finder by Cronjob.
|
119 |
-
*
|
120 |
-
* @param Varien_Event_Observer $observer
|
121 |
-
*/
|
122 |
-
public function addOrderDetailsToSCICQueue($observer)
|
123 |
-
{
|
124 |
-
if (!Mage::getStoreConfigFlag('factfinder/export/track_checkout')) {
|
125 |
-
return;
|
126 |
-
}
|
127 |
-
|
128 |
-
$order = $observer->getOrder();
|
129 |
-
$customerId = $order->getCustomerId();
|
130 |
-
if ($customerId) {
|
131 |
-
$customerId = md5('customer_' . $customerId);
|
132 |
-
}
|
133 |
-
|
134 |
-
$searchHelper = Mage::helper('factfinder/search');
|
135 |
-
$idFieldName = $searchHelper->getIdFieldName();
|
136 |
-
if ($idFieldName == 'entity_id') {
|
137 |
-
$idFieldName = 'product_id'; // sales_order_item does not contain a entity_id
|
138 |
-
}
|
139 |
-
|
140 |
-
foreach ($order->getAllItems() as $item) {
|
141 |
-
if ($item->getParentItem() != null) {
|
142 |
-
continue;
|
143 |
-
}
|
144 |
-
|
145 |
-
try {
|
146 |
-
Mage::getModel('factfinder/scic_queue')
|
147 |
-
->setProductId($item->getData($idFieldName))
|
148 |
-
->setSid(md5(Mage::getSingleton('core/session')->getSessionId()))
|
149 |
-
->setUserid($customerId)
|
150 |
-
->setPrice($item->getPrice())
|
151 |
-
->setCount($item->getQtyOrdered())
|
152 |
-
->setStoreId(Mage::app()->getStore()->getId())
|
153 |
-
->save();
|
154 |
-
}
|
155 |
-
catch (Exception $e) {
|
156 |
-
Mage::logException($e);
|
157 |
-
}
|
158 |
-
}
|
159 |
-
}
|
160 |
-
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Cronjob observer method.
|
164 |
-
* Processes all orders given in SCIC queue and sends them to FACT-Finder.
|
165 |
-
*
|
166 |
-
*/
|
167 |
-
public function processScicOrderQueue()
|
168 |
-
{
|
169 |
-
$queue = Mage::getModel('factfinder/scic_queue');
|
170 |
-
$collection = $queue->getCollection()->addOrder('store_id', 'ASC');
|
171 |
-
|
172 |
-
$storeId = null;
|
173 |
-
$scic = null;
|
174 |
-
foreach ($collection as $item) {
|
175 |
-
try {
|
176 |
-
$facade = Mage::getModel('factfinder/facade');
|
177 |
-
if ($item->getStoreId() != $storeId) {
|
178 |
-
$facade->setStoreId($item->getStoreId());
|
179 |
-
$storeId = $item->getStoreId();
|
180 |
-
}
|
181 |
-
|
182 |
-
/* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
|
183 |
-
$tracking = Mage::getModel('factfinder/handler_tracking');
|
184 |
-
$tracking->getTrackingAdapter()->setupEventTracking(
|
185 |
-
FACTFinder_Default_TrackingAdapter::EVENT_BUY,
|
186 |
-
array(
|
187 |
-
'id' => $item->getProductId(),
|
188 |
-
'sid' => $item->getSid(),
|
189 |
-
'amount' => $item->getCount(),
|
190 |
-
'price' => $item->getPrice(),
|
191 |
-
'uid' => md5('customer_' . $item->getUserid()),
|
192 |
-
'site' => Mage::app()->getStore($storeId)->getCode(),
|
193 |
-
'sourceRefKey' => ''
|
194 |
-
)
|
195 |
-
);
|
196 |
-
$tracking->applyTracking();
|
197 |
-
|
198 |
-
$item->delete($item);
|
199 |
-
}
|
200 |
-
catch (Exception $e) {
|
201 |
-
Mage::logException($e);
|
202 |
-
}
|
203 |
-
}
|
204 |
-
}
|
205 |
-
|
206 |
-
|
207 |
-
/**
|
208 |
-
* Checks configuration data before saving it to database.
|
209 |
-
*
|
210 |
-
* @param Varien_Event_Observer $observer
|
211 |
-
*/
|
212 |
-
public function setEnabledFlagInFactFinderConfig($observer)
|
213 |
-
{
|
214 |
-
$request = $observer->getControllerAction()->getRequest();
|
215 |
-
if ($request->getParam('section') != 'factfinder') {
|
216 |
-
return;
|
217 |
-
}
|
218 |
-
|
219 |
-
$groups = $request->getPost('groups');
|
220 |
-
$website = $request->getParam('website');
|
221 |
-
$store = $request->getParam('store');
|
222 |
-
|
223 |
-
if (
|
224 |
-
is_array($groups['search'])
|
225 |
-
&& is_array($groups['search']['fields'])
|
226 |
-
&& is_array($groups['search']['fields']['enabled'])
|
227 |
-
&& isset($groups['search']['fields']['enabled']['value'])
|
228 |
-
) {
|
229 |
-
$value = $groups['search']['fields']['enabled']['value'];
|
230 |
-
}
|
231 |
-
elseif ($store) {
|
232 |
-
$value = Mage::app()->getWebsite($website)->getConfig('factfinder/search/enabled');
|
233 |
-
}
|
234 |
-
else {
|
235 |
-
$value = (string) Mage::getConfig()->getNode('default/factfinder/search/enabled');
|
236 |
-
}
|
237 |
-
|
238 |
-
if (!$value) {
|
239 |
-
return;
|
240 |
-
}
|
241 |
-
|
242 |
-
$errors = Mage::helper('factfinder/backend')->checkConfigData($groups['search']['fields']);
|
243 |
-
if (!empty($errors)) {
|
244 |
-
$groups['search']['fields']['enabled']['errors'] = $errors;
|
245 |
-
} else {
|
246 |
-
// If there were no errors, reset the fallback feature
|
247 |
-
Mage::helper('factfinder/search')->resetFailedAttemptCount();
|
248 |
-
}
|
249 |
-
|
250 |
-
// if we have an error - unset inherit field so that Backend model processing is activated
|
251 |
-
if (!empty($errors) && isset($groups['search']['fields']['enabled']['inherit'])) {
|
252 |
-
unset($groups['search']['fields']['enabled']['inherit']);
|
253 |
-
$groups['search']['fields']['enabled']['value'] = $value;
|
254 |
-
}
|
255 |
-
|
256 |
-
$request->setPost('groups', $groups);
|
257 |
-
}
|
258 |
-
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Replaces the link to the management cockpit functionality in the Magento Backend with the external link that
|
262 |
-
* opens in a new browser tab. Pretty dirty solution, but Magento does not offer any possibility to edit link urls
|
263 |
-
* in its backend menu model, nor does it allow to add absolute links for external sites.
|
264 |
-
*
|
265 |
-
* @param Varien_Event_Observer $observer
|
266 |
-
*/
|
267 |
-
public function rewriteBackendMenuHtmlForCockpitRedirect($observer)
|
268 |
-
{
|
269 |
-
$block = $observer->getBlock();
|
270 |
-
if ($block->getNameInLayout() != 'menu') {
|
271 |
-
return;
|
272 |
-
}
|
273 |
-
|
274 |
-
$transport = $observer->getTransport();
|
275 |
-
$html = $transport->getHtml();
|
276 |
-
|
277 |
-
$matches = array();
|
278 |
-
$label = preg_quote(Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'));
|
279 |
-
$pattern = '/(\<a[^\>]*href=\"([^\"]*)\"[^\>]*)\>\w*\<span\>\w*' . $label . '\w*\<\/span\>/msU';
|
280 |
-
if (preg_match($pattern, $html, $matches)) {
|
281 |
-
$url = Mage::getSingleton('factfinder/facade')->getManagementUrl();
|
282 |
-
$replace = str_replace($matches[2], $url, $matches[1]) . ' target="_blank"';
|
283 |
-
|
284 |
-
$transport->setHtml(str_replace($matches[1], $replace, $html));
|
285 |
-
}
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Adds layout handles based on FACT-Finder configuration.
|
290 |
-
*
|
291 |
-
* @param Varien_Event_Observer $observer
|
292 |
-
*/
|
293 |
-
public function addActivationLayoutHandles($observer)
|
294 |
-
{
|
295 |
-
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'suggest')) {
|
296 |
-
$layout = $observer->getLayout();
|
297 |
-
$update = $layout->getUpdate();
|
298 |
-
$update->addHandle('factfinder_suggest_enabled');
|
299 |
-
|
300 |
-
if (Mage::getStoreConfig('factfinder/search/ffversion') <= 67)
|
301 |
-
{
|
302 |
-
$layout = $observer->getLayout();
|
303 |
-
$update = $layout->getUpdate();
|
304 |
-
$update->addHandle('factfinder_suggest_version_lt67');
|
305 |
-
}
|
306 |
-
else
|
307 |
-
{
|
308 |
-
$layout = $observer->getLayout();
|
309 |
-
$update = $layout->getUpdate();
|
310 |
-
$update->addHandle('factfinder_suggest_version_gt68');
|
311 |
-
}
|
312 |
-
}
|
313 |
-
|
314 |
-
$request = Mage::app()->getRequest();
|
315 |
-
//catalogsearch_result_index
|
316 |
-
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'clicktracking')
|
317 |
-
&& $request->getModuleName() == 'catalogsearch'
|
318 |
-
&& $request->getControllerName() == 'result'
|
319 |
-
&& $request->getActionName() == 'index') {
|
320 |
-
$layout = $observer->getLayout();
|
321 |
-
$update = $layout->getUpdate();
|
322 |
-
$update->addHandle('factfinder_clicktracking_enabled');
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
public function initializeAfterSearchNavigation()
|
327 |
-
{
|
328 |
-
$asnBlock = Mage::registry(self::_asnBlockRegistryKey);
|
329 |
-
if($asnBlock instanceof Flagbit_FactFinder_Block_Layer)
|
330 |
-
{
|
331 |
-
$asnBlock->initializeAfterSearchNavigation();
|
332 |
-
}
|
333 |
-
}
|
334 |
-
|
335 |
-
/**
|
336 |
-
* Handle redirects in this single method to control the execution order.
|
337 |
-
*
|
338 |
-
* @param Varien_Event_Observer $observer
|
339 |
-
*/
|
340 |
-
public function handleRedirects(Varien_Event_Observer $observer)
|
341 |
-
{
|
342 |
-
$this->_handleCampaignRedirect();
|
343 |
-
$this->_redirectToProductIfSingleResult();
|
344 |
-
}
|
345 |
-
|
346 |
-
/**
|
347 |
-
* Checks if the result set's size is one. If so the user is redirected to the product detail page. This is checked
|
348 |
-
* right before the first block is rendered so headers can still be sent. The ordinary collection load event is
|
349 |
-
* triggered too late.
|
350 |
-
*
|
351 |
-
*/
|
352 |
-
protected function _redirectToProductIfSingleResult()
|
353 |
-
{
|
354 |
-
if (!Mage::helper('factfinder/search')->getIsEnabled() || !Mage::helper('factfinder/search')->getIsOnSearchPage() || Mage::registry('redirectAlreadyChecked')) {
|
355 |
-
return;
|
356 |
-
}
|
357 |
-
|
358 |
-
Mage::register('redirectAlreadyChecked', 1);
|
359 |
-
if (Mage::getStoreConfig('factfinder/config/redirectOnSingleResult')) {
|
360 |
-
$block = Mage::app()->getLayout()->getBlock('search_result_list');
|
361 |
-
|
362 |
-
if (!$block instanceof Mage_Catalog_Block_Product_List) {
|
363 |
-
return;
|
364 |
-
}
|
365 |
-
|
366 |
-
$collection = $block->getLoadedProductCollection();
|
367 |
-
$collection->load();
|
368 |
-
|
369 |
-
if (count($collection) == 1) {
|
370 |
-
$product = $collection->getFirstItem();
|
371 |
-
|
372 |
-
$this->sendClickTrackingForSingleProduct($product);
|
373 |
-
|
374 |
-
$response = Mage::app()->getResponse();
|
375 |
-
$response->setRedirect($product->getProductUrl(false));
|
376 |
-
$response->sendResponse();
|
377 |
-
exit;
|
378 |
-
}
|
379 |
-
}
|
380 |
-
}
|
381 |
-
|
382 |
-
/**
|
383 |
-
* Handle campaign redirects
|
384 |
-
*
|
385 |
-
*/
|
386 |
-
protected function _handleCampaignRedirect()
|
387 |
-
{
|
388 |
-
$redirectBlock = Mage::registry(self::_campaignRedirectRegistryKey);
|
389 |
-
if($redirectBlock instanceof Flagbit_FactFinder_Block_Layer)
|
390 |
-
{
|
391 |
-
$redirectBlock->handleCampaignRedirect();
|
392 |
-
}
|
393 |
-
}
|
394 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* Observer for Magento events.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <michael.tuerk@flagbit.de>
|
19 |
+
* @author Nicolai Essig <nicolai.essig@flagbit.de>
|
20 |
+
* @version $Id: Observer.php 26.08.13 15:05 $
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_Model_Observer
|
23 |
+
{
|
24 |
+
const _asnBlockRegistryKey = 'FACTFINDER__asnBlock';
|
25 |
+
const _campaignRedirectRegistryKey = 'FACTFINDER__campaignRedirectBlock';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Observer method.
|
29 |
+
* Sends information to FACT-Finder if item was added to cart.
|
30 |
+
*
|
31 |
+
* @param Varien_Event_Observer $observer
|
32 |
+
*/
|
33 |
+
public function addToCartSendSCIC($observer)
|
34 |
+
{
|
35 |
+
if (!Mage::getStoreConfigFlag('factfinder/export/track_carts')) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
$quoteItem = $observer->getQuoteItem();
|
40 |
+
$product = $observer->getProduct();
|
41 |
+
|
42 |
+
$searchHelper = Mage::helper('factfinder/search');
|
43 |
+
$idFieldName = $searchHelper->getIdFieldName();
|
44 |
+
|
45 |
+
$qty = $quoteItem->getQty();
|
46 |
+
|
47 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
48 |
+
if ($customerId) {
|
49 |
+
$customerId = md5('customer_' . $customerId);
|
50 |
+
}
|
51 |
+
|
52 |
+
try {
|
53 |
+
/* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
|
54 |
+
$tracking = Mage::getModel('factfinder/handler_tracking');
|
55 |
+
$tracking->getTrackingAdapter()->setupEventTracking(
|
56 |
+
FACTFinder_Default_TrackingAdapter::EVENT_CART,
|
57 |
+
array(
|
58 |
+
'id' => $product->getData($idFieldName),
|
59 |
+
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
60 |
+
'amount' => $qty,
|
61 |
+
'price' => $product->getFinalPrice($qty),
|
62 |
+
'uid' => $customerId,
|
63 |
+
'site' => Mage::app()->getStore()->getCode(),
|
64 |
+
'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey()
|
65 |
+
)
|
66 |
+
);
|
67 |
+
$tracking->applyTracking();
|
68 |
+
}
|
69 |
+
catch (Exception $e) {
|
70 |
+
Mage::helper('factfinder/debug')->log($e->getMessage());
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Tracking of single product click
|
76 |
+
*
|
77 |
+
* @param $product
|
78 |
+
*/
|
79 |
+
protected function sendClickTrackingForSingleProduct($product)
|
80 |
+
{
|
81 |
+
$searchHelper = Mage::helper('factfinder/search');
|
82 |
+
|
83 |
+
if (!$searchHelper->getIsEnabled(false, 'clicktracking')) {
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
|
87 |
+
try {
|
88 |
+
$idFieldName = $searchHelper->getIdFieldName();
|
89 |
+
|
90 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
91 |
+
if ($customerId) {
|
92 |
+
$customerId = md5('customer_' . $customerId);
|
93 |
+
}
|
94 |
+
|
95 |
+
/* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
|
96 |
+
$tracking = Mage::getModel('factfinder/handler_tracking');
|
97 |
+
$tracking->getTrackingAdapter()->setupEventTracking(
|
98 |
+
FACTFinder_Default_TrackingAdapter::EVENT_INSPECT,
|
99 |
+
array(
|
100 |
+
'id' => $product->getData($idFieldName),
|
101 |
+
'sid' => md5(Mage::getSingleton('core/session')->getSessionId()),
|
102 |
+
'price' => $product->getFinalPrice(),
|
103 |
+
'uid' => $customerId,
|
104 |
+
'site' => Mage::app()->getStore()->getCode(),
|
105 |
+
'sourceRefKey' => Mage::getSingleton('core/session')->getFactFinderRefKey(),
|
106 |
+
'product' => $product
|
107 |
+
)
|
108 |
+
);
|
109 |
+
$tracking->applyTracking();
|
110 |
+
}
|
111 |
+
catch (Exception $e) {
|
112 |
+
Mage::helper('factfinder/debug')->log($e->getMessage());
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Observer method
|
118 |
+
* Adds all ordered items to queue that is sent to FACT-Finder by Cronjob.
|
119 |
+
*
|
120 |
+
* @param Varien_Event_Observer $observer
|
121 |
+
*/
|
122 |
+
public function addOrderDetailsToSCICQueue($observer)
|
123 |
+
{
|
124 |
+
if (!Mage::getStoreConfigFlag('factfinder/export/track_checkout')) {
|
125 |
+
return;
|
126 |
+
}
|
127 |
+
|
128 |
+
$order = $observer->getOrder();
|
129 |
+
$customerId = $order->getCustomerId();
|
130 |
+
if ($customerId) {
|
131 |
+
$customerId = md5('customer_' . $customerId);
|
132 |
+
}
|
133 |
+
|
134 |
+
$searchHelper = Mage::helper('factfinder/search');
|
135 |
+
$idFieldName = $searchHelper->getIdFieldName();
|
136 |
+
if ($idFieldName == 'entity_id') {
|
137 |
+
$idFieldName = 'product_id'; // sales_order_item does not contain a entity_id
|
138 |
+
}
|
139 |
+
|
140 |
+
foreach ($order->getAllItems() as $item) {
|
141 |
+
if ($item->getParentItem() != null) {
|
142 |
+
continue;
|
143 |
+
}
|
144 |
+
|
145 |
+
try {
|
146 |
+
Mage::getModel('factfinder/scic_queue')
|
147 |
+
->setProductId($item->getData($idFieldName))
|
148 |
+
->setSid(md5(Mage::getSingleton('core/session')->getSessionId()))
|
149 |
+
->setUserid($customerId)
|
150 |
+
->setPrice($item->getPrice())
|
151 |
+
->setCount($item->getQtyOrdered())
|
152 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
153 |
+
->save();
|
154 |
+
}
|
155 |
+
catch (Exception $e) {
|
156 |
+
Mage::logException($e);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Cronjob observer method.
|
164 |
+
* Processes all orders given in SCIC queue and sends them to FACT-Finder.
|
165 |
+
*
|
166 |
+
*/
|
167 |
+
public function processScicOrderQueue()
|
168 |
+
{
|
169 |
+
$queue = Mage::getModel('factfinder/scic_queue');
|
170 |
+
$collection = $queue->getCollection()->addOrder('store_id', 'ASC');
|
171 |
+
|
172 |
+
$storeId = null;
|
173 |
+
$scic = null;
|
174 |
+
foreach ($collection as $item) {
|
175 |
+
try {
|
176 |
+
$facade = Mage::getModel('factfinder/facade');
|
177 |
+
if ($item->getStoreId() != $storeId) {
|
178 |
+
$facade->setStoreId($item->getStoreId());
|
179 |
+
$storeId = $item->getStoreId();
|
180 |
+
}
|
181 |
+
|
182 |
+
/* @var $tracking Flagbit_FactFinder_Model_Handler_Tracking */
|
183 |
+
$tracking = Mage::getModel('factfinder/handler_tracking');
|
184 |
+
$tracking->getTrackingAdapter()->setupEventTracking(
|
185 |
+
FACTFinder_Default_TrackingAdapter::EVENT_BUY,
|
186 |
+
array(
|
187 |
+
'id' => $item->getProductId(),
|
188 |
+
'sid' => $item->getSid(),
|
189 |
+
'amount' => $item->getCount(),
|
190 |
+
'price' => $item->getPrice(),
|
191 |
+
'uid' => md5('customer_' . $item->getUserid()),
|
192 |
+
'site' => Mage::app()->getStore($storeId)->getCode(),
|
193 |
+
'sourceRefKey' => ''
|
194 |
+
)
|
195 |
+
);
|
196 |
+
$tracking->applyTracking();
|
197 |
+
|
198 |
+
$item->delete($item);
|
199 |
+
}
|
200 |
+
catch (Exception $e) {
|
201 |
+
Mage::logException($e);
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Checks configuration data before saving it to database.
|
209 |
+
*
|
210 |
+
* @param Varien_Event_Observer $observer
|
211 |
+
*/
|
212 |
+
public function setEnabledFlagInFactFinderConfig($observer)
|
213 |
+
{
|
214 |
+
$request = $observer->getControllerAction()->getRequest();
|
215 |
+
if ($request->getParam('section') != 'factfinder') {
|
216 |
+
return;
|
217 |
+
}
|
218 |
+
|
219 |
+
$groups = $request->getPost('groups');
|
220 |
+
$website = $request->getParam('website');
|
221 |
+
$store = $request->getParam('store');
|
222 |
+
|
223 |
+
if (
|
224 |
+
is_array($groups['search'])
|
225 |
+
&& is_array($groups['search']['fields'])
|
226 |
+
&& is_array($groups['search']['fields']['enabled'])
|
227 |
+
&& isset($groups['search']['fields']['enabled']['value'])
|
228 |
+
) {
|
229 |
+
$value = $groups['search']['fields']['enabled']['value'];
|
230 |
+
}
|
231 |
+
elseif ($store) {
|
232 |
+
$value = Mage::app()->getWebsite($website)->getConfig('factfinder/search/enabled');
|
233 |
+
}
|
234 |
+
else {
|
235 |
+
$value = (string) Mage::getConfig()->getNode('default/factfinder/search/enabled');
|
236 |
+
}
|
237 |
+
|
238 |
+
if (!$value) {
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
|
242 |
+
$errors = Mage::helper('factfinder/backend')->checkConfigData($groups['search']['fields']);
|
243 |
+
if (!empty($errors)) {
|
244 |
+
$groups['search']['fields']['enabled']['errors'] = $errors;
|
245 |
+
} else {
|
246 |
+
// If there were no errors, reset the fallback feature
|
247 |
+
Mage::helper('factfinder/search')->resetFailedAttemptCount();
|
248 |
+
}
|
249 |
+
|
250 |
+
// if we have an error - unset inherit field so that Backend model processing is activated
|
251 |
+
if (!empty($errors) && isset($groups['search']['fields']['enabled']['inherit'])) {
|
252 |
+
unset($groups['search']['fields']['enabled']['inherit']);
|
253 |
+
$groups['search']['fields']['enabled']['value'] = $value;
|
254 |
+
}
|
255 |
+
|
256 |
+
$request->setPost('groups', $groups);
|
257 |
+
}
|
258 |
+
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Replaces the link to the management cockpit functionality in the Magento Backend with the external link that
|
262 |
+
* opens in a new browser tab. Pretty dirty solution, but Magento does not offer any possibility to edit link urls
|
263 |
+
* in its backend menu model, nor does it allow to add absolute links for external sites.
|
264 |
+
*
|
265 |
+
* @param Varien_Event_Observer $observer
|
266 |
+
*/
|
267 |
+
public function rewriteBackendMenuHtmlForCockpitRedirect($observer)
|
268 |
+
{
|
269 |
+
$block = $observer->getBlock();
|
270 |
+
if ($block->getNameInLayout() != 'menu') {
|
271 |
+
return;
|
272 |
+
}
|
273 |
+
|
274 |
+
$transport = $observer->getTransport();
|
275 |
+
$html = $transport->getHtml();
|
276 |
+
|
277 |
+
$matches = array();
|
278 |
+
$label = preg_quote(Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'));
|
279 |
+
$pattern = '/(\<a[^\>]*href=\"([^\"]*)\"[^\>]*)\>\w*\<span\>\w*' . $label . '\w*\<\/span\>/msU';
|
280 |
+
if (preg_match($pattern, $html, $matches)) {
|
281 |
+
$url = Mage::getSingleton('factfinder/facade')->getManagementUrl();
|
282 |
+
$replace = str_replace($matches[2], $url, $matches[1]) . ' target="_blank"';
|
283 |
+
|
284 |
+
$transport->setHtml(str_replace($matches[1], $replace, $html));
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Adds layout handles based on FACT-Finder configuration.
|
290 |
+
*
|
291 |
+
* @param Varien_Event_Observer $observer
|
292 |
+
*/
|
293 |
+
public function addActivationLayoutHandles($observer)
|
294 |
+
{
|
295 |
+
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'suggest')) {
|
296 |
+
$layout = $observer->getLayout();
|
297 |
+
$update = $layout->getUpdate();
|
298 |
+
$update->addHandle('factfinder_suggest_enabled');
|
299 |
+
|
300 |
+
if (Mage::getStoreConfig('factfinder/search/ffversion') <= 67)
|
301 |
+
{
|
302 |
+
$layout = $observer->getLayout();
|
303 |
+
$update = $layout->getUpdate();
|
304 |
+
$update->addHandle('factfinder_suggest_version_lt67');
|
305 |
+
}
|
306 |
+
else
|
307 |
+
{
|
308 |
+
$layout = $observer->getLayout();
|
309 |
+
$update = $layout->getUpdate();
|
310 |
+
$update->addHandle('factfinder_suggest_version_gt68');
|
311 |
+
}
|
312 |
+
}
|
313 |
+
|
314 |
+
$request = Mage::app()->getRequest();
|
315 |
+
//catalogsearch_result_index
|
316 |
+
if (Mage::helper('factfinder/search')->getIsEnabled(false, 'clicktracking')
|
317 |
+
&& $request->getModuleName() == 'catalogsearch'
|
318 |
+
&& $request->getControllerName() == 'result'
|
319 |
+
&& $request->getActionName() == 'index') {
|
320 |
+
$layout = $observer->getLayout();
|
321 |
+
$update = $layout->getUpdate();
|
322 |
+
$update->addHandle('factfinder_clicktracking_enabled');
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
public function initializeAfterSearchNavigation()
|
327 |
+
{
|
328 |
+
$asnBlock = Mage::registry(self::_asnBlockRegistryKey);
|
329 |
+
if($asnBlock instanceof Flagbit_FactFinder_Block_Layer)
|
330 |
+
{
|
331 |
+
$asnBlock->initializeAfterSearchNavigation();
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Handle redirects in this single method to control the execution order.
|
337 |
+
*
|
338 |
+
* @param Varien_Event_Observer $observer
|
339 |
+
*/
|
340 |
+
public function handleRedirects(Varien_Event_Observer $observer)
|
341 |
+
{
|
342 |
+
$this->_handleCampaignRedirect();
|
343 |
+
$this->_redirectToProductIfSingleResult();
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Checks if the result set's size is one. If so the user is redirected to the product detail page. This is checked
|
348 |
+
* right before the first block is rendered so headers can still be sent. The ordinary collection load event is
|
349 |
+
* triggered too late.
|
350 |
+
*
|
351 |
+
*/
|
352 |
+
protected function _redirectToProductIfSingleResult()
|
353 |
+
{
|
354 |
+
if (!Mage::helper('factfinder/search')->getIsEnabled() || !Mage::helper('factfinder/search')->getIsOnSearchPage() || Mage::registry('redirectAlreadyChecked')) {
|
355 |
+
return;
|
356 |
+
}
|
357 |
+
|
358 |
+
Mage::register('redirectAlreadyChecked', 1);
|
359 |
+
if (Mage::getStoreConfig('factfinder/config/redirectOnSingleResult')) {
|
360 |
+
$block = Mage::app()->getLayout()->getBlock('search_result_list');
|
361 |
+
|
362 |
+
if (!$block instanceof Mage_Catalog_Block_Product_List) {
|
363 |
+
return;
|
364 |
+
}
|
365 |
+
|
366 |
+
$collection = $block->getLoadedProductCollection();
|
367 |
+
$collection->load();
|
368 |
+
|
369 |
+
if (count($collection) == 1) {
|
370 |
+
$product = $collection->getFirstItem();
|
371 |
+
|
372 |
+
$this->sendClickTrackingForSingleProduct($product);
|
373 |
+
|
374 |
+
$response = Mage::app()->getResponse();
|
375 |
+
$response->setRedirect($product->getProductUrl(false));
|
376 |
+
$response->sendResponse();
|
377 |
+
exit;
|
378 |
+
}
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Handle campaign redirects
|
384 |
+
*
|
385 |
+
*/
|
386 |
+
protected function _handleCampaignRedirect()
|
387 |
+
{
|
388 |
+
$redirectBlock = Mage::registry(self::_campaignRedirectRegistryKey);
|
389 |
+
if($redirectBlock instanceof Flagbit_FactFinder_Block_Layer)
|
390 |
+
{
|
391 |
+
$redirectBlock->handleCampaignRedirect();
|
392 |
+
}
|
393 |
+
}
|
394 |
}
|
@@ -1,270 +1,281 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
require_once BP.DS.'lib'.DS.'FACTFinder'.DS.'Loader.php';
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Model class
|
14 |
-
*
|
15 |
-
* Request Processor for fast handling
|
16 |
-
*
|
17 |
-
* @category Mage
|
18 |
-
* @package Flagbit_FactFinder
|
19 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
20 |
-
* @author Joerg Weller <weller@flagbit.de>
|
21 |
-
* @version $Id$
|
22 |
-
*/
|
23 |
-
class Flagbit_FactFinder_Model_Processor
|
24 |
-
{
|
25 |
-
|
26 |
-
const CACHE_TAG = 'FACTFINDER'; // Cache Tag
|
27 |
-
const REQUEST_ID_PREFIX = 'FACTFINDER_';
|
28 |
-
const XML_CONFIG_PATH = 'factfinder/search/';
|
29 |
-
|
30 |
-
|
31 |
-
/**
|
32 |
-
* FactFinder Facade
|
33 |
-
* @var Flagbit_FactFinder_Model_Facade
|
34 |
-
*/
|
35 |
-
protected $_facade;
|
36 |
-
|
37 |
-
/**
|
38 |
-
*
|
39 |
-
*/
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
$this->
|
150 |
-
$this->_getFacade());
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
return
|
219 |
-
}
|
220 |
-
|
221 |
-
/**
|
222 |
-
*
|
223 |
-
*
|
224 |
-
* @
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
*
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
*
|
244 |
-
* @return
|
245 |
-
*/
|
246 |
-
public function
|
247 |
-
{
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
require_once BP.DS.'lib'.DS.'FACTFinder'.DS.'Loader.php';
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Model class
|
14 |
+
*
|
15 |
+
* Request Processor for fast handling
|
16 |
+
*
|
17 |
+
* @category Mage
|
18 |
+
* @package Flagbit_FactFinder
|
19 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
20 |
+
* @author Joerg Weller <weller@flagbit.de>
|
21 |
+
* @version $Id$
|
22 |
+
*/
|
23 |
+
class Flagbit_FactFinder_Model_Processor
|
24 |
+
{
|
25 |
+
|
26 |
+
const CACHE_TAG = 'FACTFINDER'; // Cache Tag
|
27 |
+
const REQUEST_ID_PREFIX = 'FACTFINDER_';
|
28 |
+
const XML_CONFIG_PATH = 'factfinder/search/';
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* FactFinder Facade
|
33 |
+
* @var Flagbit_FactFinder_Model_Facade
|
34 |
+
*/
|
35 |
+
protected $_facade;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @var array with loaded config values
|
39 |
+
*/
|
40 |
+
protected $_config;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Class constructor
|
44 |
+
*/
|
45 |
+
public function __construct()
|
46 |
+
{
|
47 |
+
$uri = $this->_getFullPageUrl();
|
48 |
+
|
49 |
+
$this->_requestId = $uri;
|
50 |
+
$this->_requestCacheId = $this->prepareCacheId($this->_requestId);
|
51 |
+
$this->_requestTags = array(self::CACHE_TAG);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* get Fact-Finder Facade
|
56 |
+
* we do it manually, because we do not have the full magento context
|
57 |
+
*
|
58 |
+
* @return Flagbit_FactFinder_Model_Facade
|
59 |
+
*/
|
60 |
+
protected function _getFacade()
|
61 |
+
{
|
62 |
+
if($this->_facade === null){
|
63 |
+
$logger = new Flagbit_FactFinder_Helper_Debug();
|
64 |
+
$this->_facade = new Flagbit_FactFinder_Model_Facade($logger);
|
65 |
+
}
|
66 |
+
return $this->_facade;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get page content from cache storage
|
72 |
+
*
|
73 |
+
* @param string $content
|
74 |
+
* @return string | false
|
75 |
+
*/
|
76 |
+
public function extractContent($content)
|
77 |
+
{
|
78 |
+
// handle in App Request if "factfinder" in Request path
|
79 |
+
if (!$content
|
80 |
+
&& strpos($this->_requestId, 'factfinder')
|
81 |
+
&& $this->isAllowed()) {
|
82 |
+
|
83 |
+
$requestCacheId = $this->prepareCacheId($this->getRequestId().'request');
|
84 |
+
$request = Mage::app()->loadCache($requestCacheId);
|
85 |
+
if ($request) {
|
86 |
+
$content = $this->handleWithoutAppRequest($request);
|
87 |
+
}
|
88 |
+
|
89 |
+
}
|
90 |
+
return $content;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* handle in App Requests
|
95 |
+
*
|
96 |
+
* @param string $request
|
97 |
+
* @return string
|
98 |
+
*/
|
99 |
+
public function handleInAppRequest($request)
|
100 |
+
{
|
101 |
+
$requestCacheId = $this->prepareCacheId($this->getRequestId().'request');
|
102 |
+
Mage::app()->saveCache($request, $requestCacheId, $this->getRequestTags());
|
103 |
+
|
104 |
+
$configCacheId = $this->prepareCacheId($this->getRequestId().'config');
|
105 |
+
$this->_config = Mage::getStoreConfig('factfinder/search');
|
106 |
+
Mage::app()->saveCache(serialize($this->_config), $configCacheId, $this->getRequestTags());
|
107 |
+
|
108 |
+
return $this->_handleRequest($request);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* hanlde without App Requests
|
113 |
+
*
|
114 |
+
* @param string $request
|
115 |
+
* @return string
|
116 |
+
*/
|
117 |
+
public function handleWithoutAppRequest($request)
|
118 |
+
{
|
119 |
+
$configCacheId = $this->prepareCacheId($this->getRequestId().'config');
|
120 |
+
$config = null;
|
121 |
+
try{
|
122 |
+
$this->_config = unserialize(Mage::app()->loadCache($configCacheId));
|
123 |
+
} catch (Exception $e){
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
if(!is_array($this->_config) || empty($this->_config)){
|
127 |
+
return;
|
128 |
+
}
|
129 |
+
$this->_getFacade()->setConfiguration($this->_config);
|
130 |
+
return $this->_handleRequest($request);
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* handle Requests
|
135 |
+
*
|
136 |
+
* @param unknown_type $request
|
137 |
+
* @return string
|
138 |
+
*/
|
139 |
+
protected function _handleRequest($request)
|
140 |
+
{
|
141 |
+
switch ($request) {
|
142 |
+
case 'factfinder_proxy_scic':
|
143 |
+
$this->_getFacade()->getScicAdapter()->setupTrackingFromRequest();
|
144 |
+
return $this->_getFacade()->applyScicTracking();
|
145 |
+
break;
|
146 |
+
|
147 |
+
case 'factfinder_proxy_tracking':
|
148 |
+
if ($this->_config['ffversion'] <= 69) {
|
149 |
+
$this->_getFacade()->getLegacyTrackingAdapter()->setupTrackingFromRequest();
|
150 |
+
return $this->_getFacade()->applyLegacyTracking();
|
151 |
+
} else {
|
152 |
+
$this->_getFacade()->getTrackingAdapter()->setupTrackingFromRequest();
|
153 |
+
return $this->_getFacade()->applyTracking();
|
154 |
+
}
|
155 |
+
break;
|
156 |
+
|
157 |
+
case 'factfinder_proxy_suggest':
|
158 |
+
$handler = new Flagbit_FactFinder_Model_Handler_Suggest(
|
159 |
+
$this->_getRequestParam('query'),
|
160 |
+
$this->_getRequestParam('jquery_callback'),
|
161 |
+
$this->_getFacade());
|
162 |
+
return $handler->getSuggestions();
|
163 |
+
break;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* get Request Param by Key
|
169 |
+
*
|
170 |
+
* @param unknown_type $key
|
171 |
+
* @return string
|
172 |
+
*/
|
173 |
+
protected function _getRequestParam($key)
|
174 |
+
{
|
175 |
+
$value = null;
|
176 |
+
if(isset($_REQUEST[$key])){
|
177 |
+
$value = $_REQUEST[$key];
|
178 |
+
}
|
179 |
+
return $value;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Return current page base url
|
184 |
+
*
|
185 |
+
* @return string
|
186 |
+
*/
|
187 |
+
protected function _getFullPageUrl()
|
188 |
+
{
|
189 |
+
$uri = false;
|
190 |
+
/**
|
191 |
+
* Define server HTTP HOST
|
192 |
+
*/
|
193 |
+
if (isset($_SERVER['HTTP_HOST'])) {
|
194 |
+
$uri = $_SERVER['HTTP_HOST'];
|
195 |
+
} elseif (isset($_SERVER['SERVER_NAME'])) {
|
196 |
+
$uri = $_SERVER['SERVER_NAME'];
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Define request URI
|
201 |
+
*/
|
202 |
+
if ($uri) {
|
203 |
+
if (isset($_SERVER['REQUEST_URI'])) {
|
204 |
+
$uri.= $_SERVER['REQUEST_URI'];
|
205 |
+
} elseif (!empty($_SERVER['IIS_WasUrlRewritten']) && !empty($_SERVER['UNENCODED_URL'])) {
|
206 |
+
$uri.= $_SERVER['UNENCODED_URL'];
|
207 |
+
} elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
|
208 |
+
$uri.= $_SERVER['ORIG_PATH_INFO'];
|
209 |
+
if (!empty($_SERVER['QUERY_STRING'])) {
|
210 |
+
$uri.= $_SERVER['QUERY_STRING'];
|
211 |
+
}
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
$pieces = explode('?', $uri);
|
216 |
+
$uri = array_shift($pieces);
|
217 |
+
|
218 |
+
return $uri;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Prepare page identifier
|
223 |
+
*
|
224 |
+
* @param string $id
|
225 |
+
* @return string
|
226 |
+
*/
|
227 |
+
public function prepareCacheId($id)
|
228 |
+
{
|
229 |
+
return self::REQUEST_ID_PREFIX . md5($id);
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Get HTTP request identifier
|
234 |
+
*
|
235 |
+
* @return string
|
236 |
+
*/
|
237 |
+
public function getRequestId()
|
238 |
+
{
|
239 |
+
return $this->_requestId . (isset($_COOKIE['store']) ? $_COOKIE['store'] : '');
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Get page identifier for loading page from cache
|
244 |
+
* @return string
|
245 |
+
*/
|
246 |
+
public function getRequestCacheId()
|
247 |
+
{
|
248 |
+
return $this->_requestCacheId;
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Check if processor is allowed for current HTTP request.
|
253 |
+
* Disable processing HTTPS requests and requests with "NO_CACHE" cookie
|
254 |
+
*
|
255 |
+
* @return bool
|
256 |
+
*/
|
257 |
+
public function isAllowed()
|
258 |
+
{
|
259 |
+
if (!$this->_requestId) {
|
260 |
+
return false;
|
261 |
+
}
|
262 |
+
if (isset($_COOKIE['NO_CACHE'])) {
|
263 |
+
return false;
|
264 |
+
}
|
265 |
+
if (isset($_GET['no_cache'])) {
|
266 |
+
return false;
|
267 |
+
}
|
268 |
+
|
269 |
+
return true;
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Get cache request associated tags
|
274 |
+
* @return array
|
275 |
+
*/
|
276 |
+
public function getRequestTags()
|
277 |
+
{
|
278 |
+
return $this->_requestTags;
|
279 |
+
}
|
280 |
+
|
281 |
}
|
@@ -1,27 +1,27 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* Queue for SCIC orders. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_Scic_Queue extends Mage_Core_Model_Abstract
|
22 |
-
{
|
23 |
-
public function _construct()
|
24 |
-
{
|
25 |
-
$this->_init('factfinder/scic_queue');
|
26 |
-
}
|
27 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* Queue for SCIC orders. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_Scic_Queue extends Mage_Core_Model_Abstract
|
22 |
+
{
|
23 |
+
public function _construct()
|
24 |
+
{
|
25 |
+
$this->_init('factfinder/scic_queue');
|
26 |
+
}
|
27 |
}
|
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Mage
|
22 |
-
* @package Mage_CatalogInventory
|
23 |
-
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*/
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Backend for serialized array data
|
29 |
-
*
|
30 |
-
*/
|
31 |
-
class Flagbit_FactFinder_Model_System_Config_Backend_Attributes extends Mage_Core_Model_Config_Data
|
32 |
-
{
|
33 |
-
/**
|
34 |
-
* Process data after load
|
35 |
-
*/
|
36 |
-
protected function _afterLoad()
|
37 |
-
{
|
38 |
-
$value = $this->getValue();
|
39 |
-
$value = Mage::helper('factfinder/backend')->makeArrayFieldValue($value);
|
40 |
-
$this->setValue($value);
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Prepare data before save
|
45 |
-
*/
|
46 |
-
protected function _beforeSave()
|
47 |
-
{
|
48 |
-
$value = $this->getValue();
|
49 |
-
$value = Mage::helper('factfinder/backend')->makeStorableArrayFieldValue($value);
|
50 |
-
$this->setValue($value);
|
51 |
-
}
|
52 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_CatalogInventory
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Backend for serialized array data
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
class Flagbit_FactFinder_Model_System_Config_Backend_Attributes extends Mage_Core_Model_Config_Data
|
32 |
+
{
|
33 |
+
/**
|
34 |
+
* Process data after load
|
35 |
+
*/
|
36 |
+
protected function _afterLoad()
|
37 |
+
{
|
38 |
+
$value = $this->getValue();
|
39 |
+
$value = Mage::helper('factfinder/backend')->makeArrayFieldValue($value);
|
40 |
+
$this->setValue($value);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Prepare data before save
|
45 |
+
*/
|
46 |
+
protected function _beforeSave()
|
47 |
+
{
|
48 |
+
$value = $this->getValue();
|
49 |
+
$value = Mage::helper('factfinder/backend')->makeStorableArrayFieldValue($value);
|
50 |
+
$this->setValue($value);
|
51 |
+
}
|
52 |
+
}
|
@@ -1,57 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* Status Enabled Config Field Backend
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_System_Config_Backend_Enabled extends Mage_Core_Model_Config_Data {
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Check request for errors found by Helper and Observer. It will print error messages if errors found and
|
25 |
-
* in that case set value to 0.
|
26 |
-
*
|
27 |
-
* @return Flagbit_FactFinder_Model_System_Config_Backend_Enabled
|
28 |
-
*/
|
29 |
-
protected function _beforeSave()
|
30 |
-
{
|
31 |
-
if (!$this->getValue()) {
|
32 |
-
return $this;
|
33 |
-
}
|
34 |
-
|
35 |
-
$groups = Mage::app()->getRequest()->getPost('groups');
|
36 |
-
if (isset($groups['search']['fields']['enabled']['errors'])) {
|
37 |
-
$errors = $groups['search']['fields']['enabled']['errors'];
|
38 |
-
if (is_array($errors)) {
|
39 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('factfinder')->__('FACT-Finder cannot be activated:').' <br/>'. implode('<br/>', $errors));
|
40 |
-
}
|
41 |
-
elseif (is_string($errors)) {
|
42 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('factfinder')->__('FACT-Finder cannot be activated:').' <br/>' . $errors);
|
43 |
-
}
|
44 |
-
else {
|
45 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('factfinder')->__('FACT-Finder cannot be activated:'));
|
46 |
-
}
|
47 |
-
$this->setValue('0');
|
48 |
-
}
|
49 |
-
else {
|
50 |
-
Mage::app()->cleanCache(array(Flagbit_FactFinder_Model_Processor::CACHE_TAG));
|
51 |
-
}
|
52 |
-
|
53 |
-
return $this;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* Status Enabled Config Field Backend
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_System_Config_Backend_Enabled extends Mage_Core_Model_Config_Data {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Check request for errors found by Helper and Observer. It will print error messages if errors found and
|
25 |
+
* in that case set value to 0.
|
26 |
+
*
|
27 |
+
* @return Flagbit_FactFinder_Model_System_Config_Backend_Enabled
|
28 |
+
*/
|
29 |
+
protected function _beforeSave()
|
30 |
+
{
|
31 |
+
if (!$this->getValue()) {
|
32 |
+
return $this;
|
33 |
+
}
|
34 |
+
|
35 |
+
$groups = Mage::app()->getRequest()->getPost('groups');
|
36 |
+
if (isset($groups['search']['fields']['enabled']['errors'])) {
|
37 |
+
$errors = $groups['search']['fields']['enabled']['errors'];
|
38 |
+
if (is_array($errors)) {
|
39 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('factfinder')->__('FACT-Finder cannot be activated:').' <br/>'. implode('<br/>', $errors));
|
40 |
+
}
|
41 |
+
elseif (is_string($errors)) {
|
42 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('factfinder')->__('FACT-Finder cannot be activated:').' <br/>' . $errors);
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('factfinder')->__('FACT-Finder cannot be activated:'));
|
46 |
+
}
|
47 |
+
$this->setValue('0');
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
Mage::app()->cleanCache(array(Flagbit_FactFinder_Model_Processor::CACHE_TAG));
|
51 |
+
}
|
52 |
+
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
}
|
@@ -1,45 +1,45 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* provides Authtype Options
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_System_Config_Source_Authtype
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* get Authtypes as Option Array
|
25 |
-
*
|
26 |
-
* @return array
|
27 |
-
*/
|
28 |
-
public function toOptionArray()
|
29 |
-
{
|
30 |
-
return array(
|
31 |
-
array(
|
32 |
-
'value' => 'http',
|
33 |
-
'label' => Mage::helper('factfinder')->__('http')
|
34 |
-
),
|
35 |
-
array(
|
36 |
-
'value' => 'simple',
|
37 |
-
'label' => Mage::helper('factfinder')->__('simple')
|
38 |
-
),
|
39 |
-
array(
|
40 |
-
'value' => 'advanced',
|
41 |
-
'label' => Mage::helper('factfinder')->__('advanced')
|
42 |
-
)
|
43 |
-
);
|
44 |
-
}
|
45 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* provides Authtype Options
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_System_Config_Source_Authtype
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* get Authtypes as Option Array
|
25 |
+
*
|
26 |
+
* @return array
|
27 |
+
*/
|
28 |
+
public function toOptionArray()
|
29 |
+
{
|
30 |
+
return array(
|
31 |
+
array(
|
32 |
+
'value' => 'http',
|
33 |
+
'label' => Mage::helper('factfinder')->__('http')
|
34 |
+
),
|
35 |
+
array(
|
36 |
+
'value' => 'simple',
|
37 |
+
'label' => Mage::helper('factfinder')->__('simple')
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'value' => 'advanced',
|
41 |
+
'label' => Mage::helper('factfinder')->__('advanced')
|
42 |
+
)
|
43 |
+
);
|
44 |
+
}
|
45 |
+
}
|
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* provides FACT-Finder version options
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_System_Config_Source_Ffversion
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* get FACT-Finder versions as Option Array
|
25 |
-
*
|
26 |
-
* @return array
|
27 |
-
*/
|
28 |
-
public function toOptionArray()
|
29 |
-
{
|
30 |
-
return array(
|
31 |
-
array(
|
32 |
-
'value' => 69,
|
33 |
-
'label' => '6.9'
|
34 |
-
),
|
35 |
-
array(
|
36 |
-
'value' => 68,
|
37 |
-
'label' => '6.8'
|
38 |
-
),
|
39 |
-
array(
|
40 |
-
'value' => 67,
|
41 |
-
'label' => '6.7'
|
42 |
-
),
|
43 |
-
array(
|
44 |
-
'value' => 66,
|
45 |
-
'label' => '6.6'
|
46 |
-
),
|
47 |
-
array(
|
48 |
-
'value' => 65,
|
49 |
-
'label' => '6.5'
|
50 |
-
)
|
51 |
-
);
|
52 |
-
}
|
53 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* provides FACT-Finder version options
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_System_Config_Source_Ffversion
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* get FACT-Finder versions as Option Array
|
25 |
+
*
|
26 |
+
* @return array
|
27 |
+
*/
|
28 |
+
public function toOptionArray()
|
29 |
+
{
|
30 |
+
return array(
|
31 |
+
array(
|
32 |
+
'value' => 69,
|
33 |
+
'label' => '6.9'
|
34 |
+
),
|
35 |
+
array(
|
36 |
+
'value' => 68,
|
37 |
+
'label' => '6.8'
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'value' => 67,
|
41 |
+
'label' => '6.7'
|
42 |
+
),
|
43 |
+
array(
|
44 |
+
'value' => 66,
|
45 |
+
'label' => '6.6'
|
46 |
+
),
|
47 |
+
array(
|
48 |
+
'value' => 65,
|
49 |
+
'label' => '6.5'
|
50 |
+
)
|
51 |
+
);
|
52 |
+
}
|
53 |
+
}
|
@@ -1,41 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Model class
|
12 |
-
*
|
13 |
-
* provides Identifier Options
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Model_System_Config_Source_Identifier
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* get Authtypes as Option Array
|
25 |
-
*
|
26 |
-
* @return array
|
27 |
-
*/
|
28 |
-
public function toOptionArray()
|
29 |
-
{
|
30 |
-
return array(
|
31 |
-
array(
|
32 |
-
'value' => 'entity_id',
|
33 |
-
'label' => Mage::helper('factfinder')->__('Product ID (default)')
|
34 |
-
),
|
35 |
-
array(
|
36 |
-
'value' => 'sku',
|
37 |
-
'label' => Mage::helper('factfinder')->__('Product SKU')
|
38 |
-
)
|
39 |
-
);
|
40 |
-
}
|
41 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Model class
|
12 |
+
*
|
13 |
+
* provides Identifier Options
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Model_System_Config_Source_Identifier
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* get Authtypes as Option Array
|
25 |
+
*
|
26 |
+
* @return array
|
27 |
+
*/
|
28 |
+
public function toOptionArray()
|
29 |
+
{
|
30 |
+
return array(
|
31 |
+
array(
|
32 |
+
'value' => 'entity_id',
|
33 |
+
'label' => Mage::helper('factfinder')->__('Product ID (default)')
|
34 |
+
),
|
35 |
+
array(
|
36 |
+
'value' => 'sku',
|
37 |
+
'label' => Mage::helper('factfinder')->__('Product SKU')
|
38 |
+
)
|
39 |
+
);
|
40 |
+
}
|
41 |
+
}
|
@@ -1,37 +1,37 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Image type source model
|
12 |
-
*
|
13 |
-
* @category Mage
|
14 |
-
* @package Flagbit_FactFinder
|
15 |
-
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
-
* @author Francesco Marangi <f.marangi@mzentrale.de>
|
17 |
-
* @version $Id$
|
18 |
-
*/
|
19 |
-
class Flagbit_FactFinder_Model_System_Config_Source_Imagetype
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* Get available image types
|
23 |
-
*
|
24 |
-
* @return array
|
25 |
-
*/
|
26 |
-
public function toOptionArray()
|
27 |
-
{
|
28 |
-
$options = array();
|
29 |
-
foreach (Mage::getModel('catalog/product')->getMediaAttributes() as $key => $value) {
|
30 |
-
$options[] = array(
|
31 |
-
'label' => $value->getFrontendLabel(),
|
32 |
-
'value' => $key
|
33 |
-
);
|
34 |
-
}
|
35 |
-
return $options;
|
36 |
-
}
|
37 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Image type source model
|
12 |
+
*
|
13 |
+
* @category Mage
|
14 |
+
* @package Flagbit_FactFinder
|
15 |
+
* @copyright Copyright (c) 2013 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
16 |
+
* @author Francesco Marangi <f.marangi@mzentrale.de>
|
17 |
+
* @version $Id$
|
18 |
+
*/
|
19 |
+
class Flagbit_FactFinder_Model_System_Config_Source_Imagetype
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Get available image types
|
23 |
+
*
|
24 |
+
* @return array
|
25 |
+
*/
|
26 |
+
public function toOptionArray()
|
27 |
+
{
|
28 |
+
$options = array();
|
29 |
+
foreach (Mage::getModel('catalog/product')->getMediaAttributes() as $key => $value) {
|
30 |
+
$options[] = array(
|
31 |
+
'label' => $value->getFrontendLabel(),
|
32 |
+
'value' => $key
|
33 |
+
);
|
34 |
+
}
|
35 |
+
return $options;
|
36 |
+
}
|
37 |
+
}
|
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Black class
|
12 |
-
*
|
13 |
-
* This Block class provides the FACT-Finder Business User Cockpit Authentication URL
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Joerg Weller <weller@flagbit.de>
|
19 |
-
* @version $Id$
|
20 |
-
*/
|
21 |
-
class Flagbit_FactFinder_Adminhtml_Factfinder_CockpitController extends Mage_Adminhtml_Controller_Action
|
22 |
-
{
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Load layout, set active menu and breadcrumbs
|
26 |
-
*
|
27 |
-
* @return Mage_Widget_Adminhtml_Widget_InstanceController
|
28 |
-
*/
|
29 |
-
protected function _initAction()
|
30 |
-
{
|
31 |
-
$this->loadLayout()
|
32 |
-
->_setActiveMenu('catalog/factfinder_cockpit')
|
33 |
-
->_addBreadcrumb(Mage::helper('factfinder')->__('Catalog'),
|
34 |
-
Mage::helper('factfinder')->__('Catalog'))
|
35 |
-
->_addBreadcrumb(Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'),
|
36 |
-
Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'));
|
37 |
-
return $this;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* FACT-Finder Business User Cockpit Action
|
42 |
-
*/
|
43 |
-
public function indexAction()
|
44 |
-
{
|
45 |
-
$this->_title($this->__('factfinder'))->_title($this->__('FACT-Finder Business User Cockpit'));
|
46 |
-
|
47 |
-
$this->_initAction()
|
48 |
-
->renderLayout();
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Black class
|
12 |
+
*
|
13 |
+
* This Block class provides the FACT-Finder Business User Cockpit Authentication URL
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Joerg Weller <weller@flagbit.de>
|
19 |
+
* @version $Id$
|
20 |
+
*/
|
21 |
+
class Flagbit_FactFinder_Adminhtml_Factfinder_CockpitController extends Mage_Adminhtml_Controller_Action
|
22 |
+
{
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Load layout, set active menu and breadcrumbs
|
26 |
+
*
|
27 |
+
* @return Mage_Widget_Adminhtml_Widget_InstanceController
|
28 |
+
*/
|
29 |
+
protected function _initAction()
|
30 |
+
{
|
31 |
+
$this->loadLayout()
|
32 |
+
->_setActiveMenu('catalog/factfinder_cockpit')
|
33 |
+
->_addBreadcrumb(Mage::helper('factfinder')->__('Catalog'),
|
34 |
+
Mage::helper('factfinder')->__('Catalog'))
|
35 |
+
->_addBreadcrumb(Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'),
|
36 |
+
Mage::helper('factfinder')->__('FACT-Finder Business User Cockpit'));
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* FACT-Finder Business User Cockpit Action
|
42 |
+
*/
|
43 |
+
public function indexAction()
|
44 |
+
{
|
45 |
+
$this->_title($this->__('factfinder'))->_title($this->__('FACT-Finder Business User Cockpit'));
|
46 |
+
|
47 |
+
$this->_initAction()
|
48 |
+
->renderLayout();
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
}
|
@@ -1,141 +1,141 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Controller class
|
12 |
-
*
|
13 |
-
* This class the Export Controller
|
14 |
-
* It provides a Products, Prices and Stocks Export
|
15 |
-
*
|
16 |
-
* @category Mage
|
17 |
-
* @package Flagbit_FactFinder
|
18 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
-
* @author Joerg Weller <weller@flagbit.de>
|
20 |
-
* @version $Id$
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_ExportController extends Mage_Core_Controller_Front_Action {
|
23 |
-
|
24 |
-
const XML_AUTH_PASSWORD_PATH = 'factfinder/search/auth_password';
|
25 |
-
|
26 |
-
/**
|
27 |
-
* handle Export Authentification
|
28 |
-
*
|
29 |
-
* @return Mage_Core_Controller_Varien_Action
|
30 |
-
*/
|
31 |
-
public function preDispatch()
|
32 |
-
{
|
33 |
-
$this->_getStoreId();
|
34 |
-
$password = md5(Mage::getStoreConfig(self::XML_AUTH_PASSWORD_PATH));
|
35 |
-
|
36 |
-
if ($password == '' || $password != $this->getRequest()->getParam('key')) {
|
37 |
-
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
38 |
-
}
|
39 |
-
|
40 |
-
return parent::preDispatch();
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* get current Store ID
|
45 |
-
*
|
46 |
-
* @return int
|
47 |
-
*/
|
48 |
-
protected function _getStoreId()
|
49 |
-
{
|
50 |
-
if ($storeId = $this->getRequest()->getParam('store')) {
|
51 |
-
Mage::app()->setCurrentStore($storeId);
|
52 |
-
}
|
53 |
-
|
54 |
-
return Mage::app()->getStore()->getId();
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Initialize Product Export
|
59 |
-
*/
|
60 |
-
public function productAction()
|
61 |
-
{
|
62 |
-
try
|
63 |
-
{
|
64 |
-
$this->lockSemaphore();
|
65 |
-
}
|
66 |
-
catch(RuntimeException $e)
|
67 |
-
{
|
68 |
-
// TODO: use a proper template
|
69 |
-
echo
|
70 |
-
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
|
71 |
-
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">',
|
72 |
-
'<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head>',
|
73 |
-
'<body>',
|
74 |
-
$this->__('Another export is already running. Please wait for it to finish before you start a new export.'), "<br>\n",
|
75 |
-
$this->__('If you receive this message after another export has failed, please delete the file "ffexport.lock" within your Magento directory.'),
|
76 |
-
'</body></html>';
|
77 |
-
flush();
|
78 |
-
return;
|
79 |
-
}
|
80 |
-
|
81 |
-
try {
|
82 |
-
$exportModel = Mage::getModel('factfinder/export_product');
|
83 |
-
$exportModel->doExport(
|
84 |
-
$this->_getStoreId()
|
85 |
-
);
|
86 |
-
$this->releaseSemaphore(); // finally-workaround
|
87 |
-
} catch(Exception $e) {
|
88 |
-
$this->releaseSemaphore(); // finally-workaround
|
89 |
-
throw $e;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Initialize Price Export
|
95 |
-
*/
|
96 |
-
public function priceAction()
|
97 |
-
{
|
98 |
-
$exportModel = Mage::getModel('factfinder/export_price');
|
99 |
-
$exportModel->doExport(
|
100 |
-
$this->_getStoreId()
|
101 |
-
);
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Initialize Stock Export
|
106 |
-
*/
|
107 |
-
public function stockAction()
|
108 |
-
{
|
109 |
-
$exportModel = Mage::getModel('factfinder/export_stock');
|
110 |
-
$exportModel->doExport(
|
111 |
-
$this->_getStoreId()
|
112 |
-
);
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Locks the semaphore
|
117 |
-
* Throws an exception, if semaphore is already locked
|
118 |
-
**/
|
119 |
-
protected function lockSemaphore()
|
120 |
-
{
|
121 |
-
$mtime = @filemtime($this->_getLockFileName());
|
122 |
-
if($mtime && time() - $mtime < FF::getSingleton('configuration')->getSemaphoreTimeout())
|
123 |
-
{
|
124 |
-
throw new RuntimeException();
|
125 |
-
}
|
126 |
-
@touch($this->_getLockFileName());
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Release the semaphore
|
131 |
-
**/
|
132 |
-
protected function releaseSemaphore()
|
133 |
-
{
|
134 |
-
@unlink($this->_getLockFileName());
|
135 |
-
}
|
136 |
-
|
137 |
-
protected function _getLockFileName()
|
138 |
-
{
|
139 |
-
return "ffexport_".$this->_getStoreId().".lock";
|
140 |
-
}
|
141 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Controller class
|
12 |
+
*
|
13 |
+
* This class the Export Controller
|
14 |
+
* It provides a Products, Prices and Stocks Export
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Flagbit_FactFinder
|
18 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
+
* @author Joerg Weller <weller@flagbit.de>
|
20 |
+
* @version $Id$
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_ExportController extends Mage_Core_Controller_Front_Action {
|
23 |
+
|
24 |
+
const XML_AUTH_PASSWORD_PATH = 'factfinder/search/auth_password';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* handle Export Authentification
|
28 |
+
*
|
29 |
+
* @return Mage_Core_Controller_Varien_Action
|
30 |
+
*/
|
31 |
+
public function preDispatch()
|
32 |
+
{
|
33 |
+
$this->_getStoreId();
|
34 |
+
$password = md5(Mage::getStoreConfig(self::XML_AUTH_PASSWORD_PATH));
|
35 |
+
|
36 |
+
if ($password == '' || $password != $this->getRequest()->getParam('key')) {
|
37 |
+
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
|
38 |
+
}
|
39 |
+
|
40 |
+
return parent::preDispatch();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* get current Store ID
|
45 |
+
*
|
46 |
+
* @return int
|
47 |
+
*/
|
48 |
+
protected function _getStoreId()
|
49 |
+
{
|
50 |
+
if ($storeId = $this->getRequest()->getParam('store')) {
|
51 |
+
Mage::app()->setCurrentStore($storeId);
|
52 |
+
}
|
53 |
+
|
54 |
+
return Mage::app()->getStore()->getId();
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Initialize Product Export
|
59 |
+
*/
|
60 |
+
public function productAction()
|
61 |
+
{
|
62 |
+
try
|
63 |
+
{
|
64 |
+
$this->lockSemaphore();
|
65 |
+
}
|
66 |
+
catch(RuntimeException $e)
|
67 |
+
{
|
68 |
+
// TODO: use a proper template
|
69 |
+
echo
|
70 |
+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
|
71 |
+
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">',
|
72 |
+
'<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head>',
|
73 |
+
'<body>',
|
74 |
+
$this->__('Another export is already running. Please wait for it to finish before you start a new export.'), "<br>\n",
|
75 |
+
$this->__('If you receive this message after another export has failed, please delete the file "ffexport.lock" within your Magento directory.'),
|
76 |
+
'</body></html>';
|
77 |
+
flush();
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
try {
|
82 |
+
$exportModel = Mage::getModel('factfinder/export_product');
|
83 |
+
$exportModel->doExport(
|
84 |
+
$this->_getStoreId()
|
85 |
+
);
|
86 |
+
$this->releaseSemaphore(); // finally-workaround
|
87 |
+
} catch(Exception $e) {
|
88 |
+
$this->releaseSemaphore(); // finally-workaround
|
89 |
+
throw $e;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Initialize Price Export
|
95 |
+
*/
|
96 |
+
public function priceAction()
|
97 |
+
{
|
98 |
+
$exportModel = Mage::getModel('factfinder/export_price');
|
99 |
+
$exportModel->doExport(
|
100 |
+
$this->_getStoreId()
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Initialize Stock Export
|
106 |
+
*/
|
107 |
+
public function stockAction()
|
108 |
+
{
|
109 |
+
$exportModel = Mage::getModel('factfinder/export_stock');
|
110 |
+
$exportModel->doExport(
|
111 |
+
$this->_getStoreId()
|
112 |
+
);
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Locks the semaphore
|
117 |
+
* Throws an exception, if semaphore is already locked
|
118 |
+
**/
|
119 |
+
protected function lockSemaphore()
|
120 |
+
{
|
121 |
+
$mtime = @filemtime($this->_getLockFileName());
|
122 |
+
if($mtime && time() - $mtime < FF::getSingleton('configuration')->getSemaphoreTimeout())
|
123 |
+
{
|
124 |
+
throw new RuntimeException();
|
125 |
+
}
|
126 |
+
@touch($this->_getLockFileName());
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Release the semaphore
|
131 |
+
**/
|
132 |
+
protected function releaseSemaphore()
|
133 |
+
{
|
134 |
+
@unlink($this->_getLockFileName());
|
135 |
+
}
|
136 |
+
|
137 |
+
protected function _getLockFileName()
|
138 |
+
{
|
139 |
+
return "ffexport_".$this->_getStoreId().".lock";
|
140 |
+
}
|
141 |
}
|
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Controller class
|
12 |
-
*
|
13 |
-
* This class the Proxy Controller
|
14 |
-
* It provides a scic and a suggest Action
|
15 |
-
*
|
16 |
-
* @category Mage
|
17 |
-
* @package Flagbit_FactFinder
|
18 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
-
* @author Joerg Weller <weller@flagbit.de>
|
20 |
-
* @version $Id$
|
21 |
-
*/
|
22 |
-
class Flagbit_FactFinder_ProxyController extends Mage_Core_Controller_Front_Action {
|
23 |
-
|
24 |
-
/**
|
25 |
-
* tracking Action
|
26 |
-
*/
|
27 |
-
public function trackingAction()
|
28 |
-
{
|
29 |
-
$this->getResponse()->setBody(
|
30 |
-
Mage::getModel('factfinder/processor')->handleInAppRequest($this->getFullActionName())
|
31 |
-
);
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* scic Action
|
36 |
-
*/
|
37 |
-
public function scicAction()
|
38 |
-
{
|
39 |
-
$this->trackingAction();
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* suggest Action
|
44 |
-
*/
|
45 |
-
public function suggestAction()
|
46 |
-
{
|
47 |
-
$this->getResponse()->setHeader("Content-Type:", "text/javascript;charset=utf-8", true);
|
48 |
-
$this->getResponse()->setBody(
|
49 |
-
Mage::getModel('factfinder/processor')->handleInAppRequest($this->getFullActionName())
|
50 |
-
);
|
51 |
-
}
|
52 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Controller class
|
12 |
+
*
|
13 |
+
* This class the Proxy Controller
|
14 |
+
* It provides a scic and a suggest Action
|
15 |
+
*
|
16 |
+
* @category Mage
|
17 |
+
* @package Flagbit_FactFinder
|
18 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
19 |
+
* @author Joerg Weller <weller@flagbit.de>
|
20 |
+
* @version $Id$
|
21 |
+
*/
|
22 |
+
class Flagbit_FactFinder_ProxyController extends Mage_Core_Controller_Front_Action {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* tracking Action
|
26 |
+
*/
|
27 |
+
public function trackingAction()
|
28 |
+
{
|
29 |
+
$this->getResponse()->setBody(
|
30 |
+
Mage::getModel('factfinder/processor')->handleInAppRequest($this->getFullActionName())
|
31 |
+
);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* scic Action
|
36 |
+
*/
|
37 |
+
public function scicAction()
|
38 |
+
{
|
39 |
+
$this->trackingAction();
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* suggest Action
|
44 |
+
*/
|
45 |
+
public function suggestAction()
|
46 |
+
{
|
47 |
+
$this->getResponse()->setHeader("Content-Type:", "text/javascript;charset=utf-8", true);
|
48 |
+
$this->getResponse()->setBody(
|
49 |
+
Mage::getModel('factfinder/processor')->handleInAppRequest($this->getFullActionName())
|
50 |
+
);
|
51 |
+
}
|
52 |
}
|
@@ -1,49 +1,49 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* Flagbit_FactFinder
|
5 |
-
*
|
6 |
-
* @category Mage
|
7 |
-
* @package Flagbit_FactFinder
|
8 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
9 |
-
*/
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Module Config
|
13 |
-
*
|
14 |
-
* @category Mage
|
15 |
-
* @package Flagbit_FactFinder
|
16 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
17 |
-
* @author Joerg Weller <weller@flagbit.de>
|
18 |
-
* @version $Id$
|
19 |
-
*/
|
20 |
-
-->
|
21 |
-
<config>
|
22 |
-
<acl>
|
23 |
-
<resources>
|
24 |
-
<admin>
|
25 |
-
<children>
|
26 |
-
<catalog>
|
27 |
-
<children>
|
28 |
-
<factfinder_cockpit translate="title" module="factfinder">
|
29 |
-
<title>FACT-Finder Business User Cockpit</title>
|
30 |
-
<sort_order>35</sort_order>
|
31 |
-
</factfinder_cockpit>
|
32 |
-
</children>
|
33 |
-
</catalog>
|
34 |
-
</children>
|
35 |
-
</admin>
|
36 |
-
</resources>
|
37 |
-
</acl>
|
38 |
-
<menu>
|
39 |
-
<catalog>
|
40 |
-
<children>
|
41 |
-
<factfinder_cockpit translate="title" module="factfinder">
|
42 |
-
<title>FACT-Finder Business User Cockpit</title>
|
43 |
-
<sort_order>35</sort_order>
|
44 |
-
<action>adminhtml/factfinder_cockpit</action>
|
45 |
-
</factfinder_cockpit>
|
46 |
-
</children>
|
47 |
-
</catalog>
|
48 |
-
</menu>
|
49 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Flagbit_FactFinder
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Flagbit_FactFinder
|
8 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Module Config
|
13 |
+
*
|
14 |
+
* @category Mage
|
15 |
+
* @package Flagbit_FactFinder
|
16 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
17 |
+
* @author Joerg Weller <weller@flagbit.de>
|
18 |
+
* @version $Id$
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<acl>
|
23 |
+
<resources>
|
24 |
+
<admin>
|
25 |
+
<children>
|
26 |
+
<catalog>
|
27 |
+
<children>
|
28 |
+
<factfinder_cockpit translate="title" module="factfinder">
|
29 |
+
<title>FACT-Finder Business User Cockpit</title>
|
30 |
+
<sort_order>35</sort_order>
|
31 |
+
</factfinder_cockpit>
|
32 |
+
</children>
|
33 |
+
</catalog>
|
34 |
+
</children>
|
35 |
+
</admin>
|
36 |
+
</resources>
|
37 |
+
</acl>
|
38 |
+
<menu>
|
39 |
+
<catalog>
|
40 |
+
<children>
|
41 |
+
<factfinder_cockpit translate="title" module="factfinder">
|
42 |
+
<title>FACT-Finder Business User Cockpit</title>
|
43 |
+
<sort_order>35</sort_order>
|
44 |
+
<action>adminhtml/factfinder_cockpit</action>
|
45 |
+
</factfinder_cockpit>
|
46 |
+
</children>
|
47 |
+
</catalog>
|
48 |
+
</menu>
|
49 |
+
</config>
|
@@ -1,313 +1,313 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* Flagbit_FactFinder
|
5 |
-
*
|
6 |
-
* @category Mage
|
7 |
-
* @package Flagbit_FactFinder
|
8 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
9 |
-
*/
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Module Config
|
13 |
-
*
|
14 |
-
* @category Mage
|
15 |
-
* @package Flagbit_FactFinder
|
16 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
17 |
-
* @author Joerg Weller <weller@flagbit.de>
|
18 |
-
* @version $Id$
|
19 |
-
*/
|
20 |
-
-->
|
21 |
-
<config>
|
22 |
-
<modules>
|
23 |
-
<Flagbit_FactFinder>
|
24 |
-
<active>true</active>
|
25 |
-
<version>3.5.
|
26 |
-
</Flagbit_FactFinder>
|
27 |
-
</modules>
|
28 |
-
<global>
|
29 |
-
<helpers>
|
30 |
-
<factfinder>
|
31 |
-
<class>Flagbit_FactFinder_Helper</class>
|
32 |
-
</factfinder>
|
33 |
-
</helpers>
|
34 |
-
<blocks>
|
35 |
-
<factfinder>
|
36 |
-
<class>Flagbit_FactFinder_Block</class>
|
37 |
-
</factfinder>
|
38 |
-
<catalogsearch>
|
39 |
-
<rewrite>
|
40 |
-
<term>Flagbit_FactFinder_Block_TagCloud</term>
|
41 |
-
<layer>Flagbit_FactFinder_Block_Layer</layer>
|
42 |
-
</rewrite>
|
43 |
-
</catalogsearch>
|
44 |
-
<catalog>
|
45 |
-
<rewrite>
|
46 |
-
<layer_view>Flagbit_FactFinder_Block_Layer</layer_view>
|
47 |
-
<product_list_upsell>Flagbit_FactFinder_Block_Product_List_Upsell</product_list_upsell>
|
48 |
-
<product_list_crosssell>Flagbit_FactFinder_Block_Product_List_Crosssell</product_list_crosssell>
|
49 |
-
</rewrite>
|
50 |
-
</catalog>
|
51 |
-
<checkout>
|
52 |
-
<rewrite>
|
53 |
-
<cart_crosssell>Flagbit_FactFinder_Block_Cart_Crosssell</cart_crosssell>
|
54 |
-
</rewrite>
|
55 |
-
</checkout>
|
56 |
-
<enterprise_search>
|
57 |
-
<rewrite>
|
58 |
-
<catalogsearch_layer>Flagbit_FactFinder_Block_Layer</catalogsearch_layer>
|
59 |
-
<catalog_layer_view>Flagbit_FactFinder_Block_Layer</catalog_layer_view>
|
60 |
-
</rewrite>
|
61 |
-
</enterprise_search>
|
62 |
-
<xmlconnect>
|
63 |
-
<rewrite>
|
64 |
-
<catalog_search>Flagbit_FactFinder_Block_XmlConnect_Catalog_Search</catalog_search>
|
65 |
-
<catalog_search_suggest>Flagbit_FactFinder_Block_XmlConnect_Catalog_Search_Suggest</catalog_search_suggest>
|
66 |
-
<catalog_product_list>Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List</catalog_product_list>
|
67 |
-
</rewrite>
|
68 |
-
</xmlconnect>
|
69 |
-
</blocks>
|
70 |
-
<models>
|
71 |
-
<factfinder>
|
72 |
-
<class>Flagbit_FactFinder_Model</class>
|
73 |
-
<resourceModel>factfinder_mysql4</resourceModel>
|
74 |
-
</factfinder>
|
75 |
-
<factfinder_mysql4>
|
76 |
-
<class>Flagbit_FactFinder_Model_Mysql4</class>
|
77 |
-
<entities>
|
78 |
-
<scic_queue><table>flagbit_factfinder_scic_queue</table></scic_queue>
|
79 |
-
</entities>
|
80 |
-
</factfinder_mysql4>
|
81 |
-
<catalogsearch>
|
82 |
-
<rewrite>
|
83 |
-
<layer>Flagbit_FactFinder_Model_Layer</layer>
|
84 |
-
<layer_filter_attribute>Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalogsearch</layer_filter_attribute>
|
85 |
-
</rewrite>
|
86 |
-
</catalogsearch>
|
87 |
-
<catalog>
|
88 |
-
<rewrite>
|
89 |
-
<layer>Flagbit_FactFinder_Model_Layer</layer>
|
90 |
-
<layer_filter_attribute>Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalog</layer_filter_attribute>
|
91 |
-
</rewrite>
|
92 |
-
</catalog>
|
93 |
-
</models>
|
94 |
-
<resources>
|
95 |
-
<factfinder_setup>
|
96 |
-
<setup>
|
97 |
-
<module>Flagbit_FactFinder</module>
|
98 |
-
</setup>
|
99 |
-
<connection>
|
100 |
-
<use>core_setup</use>
|
101 |
-
</connection>
|
102 |
-
</factfinder_setup>
|
103 |
-
</resources>
|
104 |
-
<events>
|
105 |
-
<controller_action_predispatch_adminhtml_system_config_save>
|
106 |
-
<observers>
|
107 |
-
<setEnabledFlagInFactFinderConfig>
|
108 |
-
<class>factfinder/observer</class>
|
109 |
-
<method>setEnabledFlagInFactFinderConfig</method>
|
110 |
-
</setEnabledFlagInFactFinderConfig>
|
111 |
-
</observers>
|
112 |
-
</controller_action_predispatch_adminhtml_system_config_save>
|
113 |
-
</events>
|
114 |
-
<cache>
|
115 |
-
<types>
|
116 |
-
<factfinder_search translate="label,description" module="factfinder">
|
117 |
-
<label>FACT-Finder</label>
|
118 |
-
<description>Search Request Cache (won't work with PHP 5.2 or less)</description>
|
119 |
-
<tags>FACTFINDER_SEARCH</tags>
|
120 |
-
</factfinder_search>
|
121 |
-
</types>
|
122 |
-
</cache>
|
123 |
-
</global>
|
124 |
-
<frontend>
|
125 |
-
<layout>
|
126 |
-
<updates>
|
127 |
-
<factfinder>
|
128 |
-
<file>factfinder.xml</file>
|
129 |
-
</factfinder>
|
130 |
-
</updates>
|
131 |
-
</layout>
|
132 |
-
<routers>
|
133 |
-
<factfinder>
|
134 |
-
<use>standard</use>
|
135 |
-
<args>
|
136 |
-
<module>Flagbit_FactFinder</module>
|
137 |
-
<frontName>factfinder</frontName>
|
138 |
-
</args>
|
139 |
-
</factfinder>
|
140 |
-
</routers>
|
141 |
-
<events>
|
142 |
-
<checkout_cart_product_add_after>
|
143 |
-
<observers>
|
144 |
-
<addToCartSendSCIC>
|
145 |
-
<class>factfinder/observer</class>
|
146 |
-
<method>addToCartSendSCIC</method>
|
147 |
-
</addToCartSendSCIC>
|
148 |
-
</observers>
|
149 |
-
</checkout_cart_product_add_after>
|
150 |
-
<sales_order_place_after>
|
151 |
-
<observers>
|
152 |
-
<addOrderDetailsToSCICQueue>
|
153 |
-
<class>factfinder/observer</class>
|
154 |
-
<method>addOrderDetailsToSCICQueue</method>
|
155 |
-
</addOrderDetailsToSCICQueue>
|
156 |
-
</observers>
|
157 |
-
</sales_order_place_after>
|
158 |
-
<controller_action_layout_load_before>
|
159 |
-
<observers>
|
160 |
-
<addActivationLayoutHandles>
|
161 |
-
<class>factfinder/observer</class>
|
162 |
-
<method>addActivationLayoutHandles</method>
|
163 |
-
</addActivationLayoutHandles>
|
164 |
-
</observers>
|
165 |
-
</controller_action_layout_load_before>
|
166 |
-
<controller_action_layout_generate_blocks_after>
|
167 |
-
<observers>
|
168 |
-
<initializeAfterSearchNavigation>
|
169 |
-
<class>factfinder/observer</class>
|
170 |
-
<method>initializeAfterSearchNavigation</method>
|
171 |
-
</initializeAfterSearchNavigation>
|
172 |
-
<handleRedirects>
|
173 |
-
<class>factfinder/observer</class>
|
174 |
-
<method>handleRedirects</method>
|
175 |
-
</handleRedirects>
|
176 |
-
</observers>
|
177 |
-
</controller_action_layout_generate_blocks_after>
|
178 |
-
</events>
|
179 |
-
<translate>
|
180 |
-
<modules>
|
181 |
-
<Flagbit_FactFinder>
|
182 |
-
<files>
|
183 |
-
<default>Flagbit_FactFinder.csv</default>
|
184 |
-
</files>
|
185 |
-
</Flagbit_FactFinder>
|
186 |
-
</modules>
|
187 |
-
</translate>
|
188 |
-
</frontend>
|
189 |
-
<adminhtml>
|
190 |
-
<acl>
|
191 |
-
<resources>
|
192 |
-
<admin>
|
193 |
-
<children>
|
194 |
-
<system>
|
195 |
-
<children>
|
196 |
-
<config>
|
197 |
-
<children>
|
198 |
-
<factfinder>
|
199 |
-
<title>FACT-Finder</title>
|
200 |
-
</factfinder>
|
201 |
-
</children>
|
202 |
-
</config>
|
203 |
-
</children>
|
204 |
-
</system>
|
205 |
-
</children>
|
206 |
-
</admin>
|
207 |
-
</resources>
|
208 |
-
</acl>
|
209 |
-
<translate>
|
210 |
-
<modules>
|
211 |
-
<Flagbit_FactFinder>
|
212 |
-
<files>
|
213 |
-
<default>Flagbit_FactFinder.csv</default>
|
214 |
-
</files>
|
215 |
-
</Flagbit_FactFinder>
|
216 |
-
</modules>
|
217 |
-
</translate>
|
218 |
-
<layout>
|
219 |
-
<updates>
|
220 |
-
<factfinder>
|
221 |
-
<file>factfinder.xml</file>
|
222 |
-
</factfinder>
|
223 |
-
</updates>
|
224 |
-
</layout>
|
225 |
-
<events>
|
226 |
-
<core_block_abstract_to_html_after>
|
227 |
-
<observers>
|
228 |
-
<rewriteBackendMenuHtmlForCockpitRedirect>
|
229 |
-
<class>factfinder/observer</class>
|
230 |
-
<method>rewriteBackendMenuHtmlForCockpitRedirect</method>
|
231 |
-
</rewriteBackendMenuHtmlForCockpitRedirect>
|
232 |
-
</observers>
|
233 |
-
</core_block_abstract_to_html_after>
|
234 |
-
</events>
|
235 |
-
</adminhtml>
|
236 |
-
<admin>
|
237 |
-
<routers>
|
238 |
-
<adminhtml>
|
239 |
-
<args>
|
240 |
-
<modules>
|
241 |
-
<factfinder before="Mage_Adminhtml">Flagbit_FactFinder_Adminhtml</factfinder>
|
242 |
-
</modules>
|
243 |
-
</args>
|
244 |
-
</adminhtml>
|
245 |
-
</routers>
|
246 |
-
</admin>
|
247 |
-
<crontab>
|
248 |
-
<jobs>
|
249 |
-
<factfinder_scic_queue_processing>
|
250 |
-
<schedule><cron_expr>* * * * *</cron_expr></schedule>
|
251 |
-
<run><model>factfinder/observer::processScicOrderQueue</model></run>
|
252 |
-
</factfinder_scic_queue_processing>
|
253 |
-
</jobs>
|
254 |
-
</crontab>
|
255 |
-
<default>
|
256 |
-
<catalog>
|
257 |
-
<search>
|
258 |
-
<engine>factfinder/search_engine</engine>
|
259 |
-
</search>
|
260 |
-
</catalog>
|
261 |
-
<factfinder>
|
262 |
-
<version>3.5.
|
263 |
-
<revision>$Rev: 25896 $</revision>
|
264 |
-
<debug>false</debug>
|
265 |
-
|
266 |
-
<!-- search settings: WARNING: dont change settings here, please use the Magento backoffice ...
|
267 |
-
if you still have to change something here, dont forget to clear the configuration cache -->
|
268 |
-
<search>
|
269 |
-
<address>example.com</address>
|
270 |
-
<port>80</port>
|
271 |
-
<protocol>http</protocol> <!-- possible values: http, https -->
|
272 |
-
|
273 |
-
<ffversion>68</ffversion>
|
274 |
-
|
275 |
-
<auth_user></auth_user>
|
276 |
-
<auth_password></auth_password>
|
277 |
-
<auth_type>advanced</auth_type> <!-- possible values: http (for FF <= 6.4); simple | advanced (for FF >= 6.5)-->
|
278 |
-
<auth_advancedPrefix>FACT-FINDER</auth_advancedPrefix>
|
279 |
-
<auth_advancedPostfix>FACT-FINDER</auth_advancedPostfix>
|
280 |
-
|
281 |
-
<context></context>
|
282 |
-
<channel></channel>
|
283 |
-
<language></language>
|
284 |
-
</search>
|
285 |
-
<fallback>
|
286 |
-
<use_fallback>0</use_fallback>
|
287 |
-
<wait_time>15</wait_time>
|
288 |
-
</fallback>
|
289 |
-
<export>
|
290 |
-
<urls>0</urls>
|
291 |
-
<suggest_image_size>40</suggest_image_size>
|
292 |
-
<suggest_image_type>image</suggest_image_type>
|
293 |
-
<track_carts>1</track_carts>
|
294 |
-
<track_checkout>1</track_checkout>
|
295 |
-
</export>
|
296 |
-
<config>
|
297 |
-
<identifier>entity_id</identifier>
|
298 |
-
<proxy>0</proxy>
|
299 |
-
<debug>0</debug>
|
300 |
-
<navigation>0</navigation>
|
301 |
-
<upsell>0</upsell>
|
302 |
-
<crosssell>0</crosssell>
|
303 |
-
</config>
|
304 |
-
|
305 |
-
<!-- encoding settings -->
|
306 |
-
<encoding>
|
307 |
-
<pageContent>UTF-8</pageContent>
|
308 |
-
<serverURI>UTF-8</serverURI>
|
309 |
-
<pageURI>UTF-8</pageURI>
|
310 |
-
</encoding>
|
311 |
-
</factfinder>
|
312 |
-
</default>
|
313 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Flagbit_FactFinder
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Flagbit_FactFinder
|
8 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Module Config
|
13 |
+
*
|
14 |
+
* @category Mage
|
15 |
+
* @package Flagbit_FactFinder
|
16 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
17 |
+
* @author Joerg Weller <weller@flagbit.de>
|
18 |
+
* @version $Id$
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<modules>
|
23 |
+
<Flagbit_FactFinder>
|
24 |
+
<active>true</active>
|
25 |
+
<version>3.5.5</version>
|
26 |
+
</Flagbit_FactFinder>
|
27 |
+
</modules>
|
28 |
+
<global>
|
29 |
+
<helpers>
|
30 |
+
<factfinder>
|
31 |
+
<class>Flagbit_FactFinder_Helper</class>
|
32 |
+
</factfinder>
|
33 |
+
</helpers>
|
34 |
+
<blocks>
|
35 |
+
<factfinder>
|
36 |
+
<class>Flagbit_FactFinder_Block</class>
|
37 |
+
</factfinder>
|
38 |
+
<catalogsearch>
|
39 |
+
<rewrite>
|
40 |
+
<term>Flagbit_FactFinder_Block_TagCloud</term>
|
41 |
+
<layer>Flagbit_FactFinder_Block_Layer</layer>
|
42 |
+
</rewrite>
|
43 |
+
</catalogsearch>
|
44 |
+
<catalog>
|
45 |
+
<rewrite>
|
46 |
+
<layer_view>Flagbit_FactFinder_Block_Layer</layer_view>
|
47 |
+
<product_list_upsell>Flagbit_FactFinder_Block_Product_List_Upsell</product_list_upsell>
|
48 |
+
<product_list_crosssell>Flagbit_FactFinder_Block_Product_List_Crosssell</product_list_crosssell>
|
49 |
+
</rewrite>
|
50 |
+
</catalog>
|
51 |
+
<checkout>
|
52 |
+
<rewrite>
|
53 |
+
<cart_crosssell>Flagbit_FactFinder_Block_Cart_Crosssell</cart_crosssell>
|
54 |
+
</rewrite>
|
55 |
+
</checkout>
|
56 |
+
<enterprise_search>
|
57 |
+
<rewrite>
|
58 |
+
<catalogsearch_layer>Flagbit_FactFinder_Block_Layer</catalogsearch_layer>
|
59 |
+
<catalog_layer_view>Flagbit_FactFinder_Block_Layer</catalog_layer_view>
|
60 |
+
</rewrite>
|
61 |
+
</enterprise_search>
|
62 |
+
<xmlconnect>
|
63 |
+
<rewrite>
|
64 |
+
<catalog_search>Flagbit_FactFinder_Block_XmlConnect_Catalog_Search</catalog_search>
|
65 |
+
<catalog_search_suggest>Flagbit_FactFinder_Block_XmlConnect_Catalog_Search_Suggest</catalog_search_suggest>
|
66 |
+
<catalog_product_list>Flagbit_FactFinder_Block_XmlConnect_Catalog_Product_List</catalog_product_list>
|
67 |
+
</rewrite>
|
68 |
+
</xmlconnect>
|
69 |
+
</blocks>
|
70 |
+
<models>
|
71 |
+
<factfinder>
|
72 |
+
<class>Flagbit_FactFinder_Model</class>
|
73 |
+
<resourceModel>factfinder_mysql4</resourceModel>
|
74 |
+
</factfinder>
|
75 |
+
<factfinder_mysql4>
|
76 |
+
<class>Flagbit_FactFinder_Model_Mysql4</class>
|
77 |
+
<entities>
|
78 |
+
<scic_queue><table>flagbit_factfinder_scic_queue</table></scic_queue>
|
79 |
+
</entities>
|
80 |
+
</factfinder_mysql4>
|
81 |
+
<catalogsearch>
|
82 |
+
<rewrite>
|
83 |
+
<layer>Flagbit_FactFinder_Model_Layer</layer>
|
84 |
+
<layer_filter_attribute>Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalogsearch</layer_filter_attribute>
|
85 |
+
</rewrite>
|
86 |
+
</catalogsearch>
|
87 |
+
<catalog>
|
88 |
+
<rewrite>
|
89 |
+
<layer>Flagbit_FactFinder_Model_Layer</layer>
|
90 |
+
<layer_filter_attribute>Flagbit_FactFinder_Model_Layer_Filter_Attribute_Catalog</layer_filter_attribute>
|
91 |
+
</rewrite>
|
92 |
+
</catalog>
|
93 |
+
</models>
|
94 |
+
<resources>
|
95 |
+
<factfinder_setup>
|
96 |
+
<setup>
|
97 |
+
<module>Flagbit_FactFinder</module>
|
98 |
+
</setup>
|
99 |
+
<connection>
|
100 |
+
<use>core_setup</use>
|
101 |
+
</connection>
|
102 |
+
</factfinder_setup>
|
103 |
+
</resources>
|
104 |
+
<events>
|
105 |
+
<controller_action_predispatch_adminhtml_system_config_save>
|
106 |
+
<observers>
|
107 |
+
<setEnabledFlagInFactFinderConfig>
|
108 |
+
<class>factfinder/observer</class>
|
109 |
+
<method>setEnabledFlagInFactFinderConfig</method>
|
110 |
+
</setEnabledFlagInFactFinderConfig>
|
111 |
+
</observers>
|
112 |
+
</controller_action_predispatch_adminhtml_system_config_save>
|
113 |
+
</events>
|
114 |
+
<cache>
|
115 |
+
<types>
|
116 |
+
<factfinder_search translate="label,description" module="factfinder">
|
117 |
+
<label>FACT-Finder</label>
|
118 |
+
<description>Search Request Cache (won't work with PHP 5.2 or less)</description>
|
119 |
+
<tags>FACTFINDER_SEARCH</tags>
|
120 |
+
</factfinder_search>
|
121 |
+
</types>
|
122 |
+
</cache>
|
123 |
+
</global>
|
124 |
+
<frontend>
|
125 |
+
<layout>
|
126 |
+
<updates>
|
127 |
+
<factfinder>
|
128 |
+
<file>factfinder.xml</file>
|
129 |
+
</factfinder>
|
130 |
+
</updates>
|
131 |
+
</layout>
|
132 |
+
<routers>
|
133 |
+
<factfinder>
|
134 |
+
<use>standard</use>
|
135 |
+
<args>
|
136 |
+
<module>Flagbit_FactFinder</module>
|
137 |
+
<frontName>factfinder</frontName>
|
138 |
+
</args>
|
139 |
+
</factfinder>
|
140 |
+
</routers>
|
141 |
+
<events>
|
142 |
+
<checkout_cart_product_add_after>
|
143 |
+
<observers>
|
144 |
+
<addToCartSendSCIC>
|
145 |
+
<class>factfinder/observer</class>
|
146 |
+
<method>addToCartSendSCIC</method>
|
147 |
+
</addToCartSendSCIC>
|
148 |
+
</observers>
|
149 |
+
</checkout_cart_product_add_after>
|
150 |
+
<sales_order_place_after>
|
151 |
+
<observers>
|
152 |
+
<addOrderDetailsToSCICQueue>
|
153 |
+
<class>factfinder/observer</class>
|
154 |
+
<method>addOrderDetailsToSCICQueue</method>
|
155 |
+
</addOrderDetailsToSCICQueue>
|
156 |
+
</observers>
|
157 |
+
</sales_order_place_after>
|
158 |
+
<controller_action_layout_load_before>
|
159 |
+
<observers>
|
160 |
+
<addActivationLayoutHandles>
|
161 |
+
<class>factfinder/observer</class>
|
162 |
+
<method>addActivationLayoutHandles</method>
|
163 |
+
</addActivationLayoutHandles>
|
164 |
+
</observers>
|
165 |
+
</controller_action_layout_load_before>
|
166 |
+
<controller_action_layout_generate_blocks_after>
|
167 |
+
<observers>
|
168 |
+
<initializeAfterSearchNavigation>
|
169 |
+
<class>factfinder/observer</class>
|
170 |
+
<method>initializeAfterSearchNavigation</method>
|
171 |
+
</initializeAfterSearchNavigation>
|
172 |
+
<handleRedirects>
|
173 |
+
<class>factfinder/observer</class>
|
174 |
+
<method>handleRedirects</method>
|
175 |
+
</handleRedirects>
|
176 |
+
</observers>
|
177 |
+
</controller_action_layout_generate_blocks_after>
|
178 |
+
</events>
|
179 |
+
<translate>
|
180 |
+
<modules>
|
181 |
+
<Flagbit_FactFinder>
|
182 |
+
<files>
|
183 |
+
<default>Flagbit_FactFinder.csv</default>
|
184 |
+
</files>
|
185 |
+
</Flagbit_FactFinder>
|
186 |
+
</modules>
|
187 |
+
</translate>
|
188 |
+
</frontend>
|
189 |
+
<adminhtml>
|
190 |
+
<acl>
|
191 |
+
<resources>
|
192 |
+
<admin>
|
193 |
+
<children>
|
194 |
+
<system>
|
195 |
+
<children>
|
196 |
+
<config>
|
197 |
+
<children>
|
198 |
+
<factfinder>
|
199 |
+
<title>FACT-Finder</title>
|
200 |
+
</factfinder>
|
201 |
+
</children>
|
202 |
+
</config>
|
203 |
+
</children>
|
204 |
+
</system>
|
205 |
+
</children>
|
206 |
+
</admin>
|
207 |
+
</resources>
|
208 |
+
</acl>
|
209 |
+
<translate>
|
210 |
+
<modules>
|
211 |
+
<Flagbit_FactFinder>
|
212 |
+
<files>
|
213 |
+
<default>Flagbit_FactFinder.csv</default>
|
214 |
+
</files>
|
215 |
+
</Flagbit_FactFinder>
|
216 |
+
</modules>
|
217 |
+
</translate>
|
218 |
+
<layout>
|
219 |
+
<updates>
|
220 |
+
<factfinder>
|
221 |
+
<file>factfinder.xml</file>
|
222 |
+
</factfinder>
|
223 |
+
</updates>
|
224 |
+
</layout>
|
225 |
+
<events>
|
226 |
+
<core_block_abstract_to_html_after>
|
227 |
+
<observers>
|
228 |
+
<rewriteBackendMenuHtmlForCockpitRedirect>
|
229 |
+
<class>factfinder/observer</class>
|
230 |
+
<method>rewriteBackendMenuHtmlForCockpitRedirect</method>
|
231 |
+
</rewriteBackendMenuHtmlForCockpitRedirect>
|
232 |
+
</observers>
|
233 |
+
</core_block_abstract_to_html_after>
|
234 |
+
</events>
|
235 |
+
</adminhtml>
|
236 |
+
<admin>
|
237 |
+
<routers>
|
238 |
+
<adminhtml>
|
239 |
+
<args>
|
240 |
+
<modules>
|
241 |
+
<factfinder before="Mage_Adminhtml">Flagbit_FactFinder_Adminhtml</factfinder>
|
242 |
+
</modules>
|
243 |
+
</args>
|
244 |
+
</adminhtml>
|
245 |
+
</routers>
|
246 |
+
</admin>
|
247 |
+
<crontab>
|
248 |
+
<jobs>
|
249 |
+
<factfinder_scic_queue_processing>
|
250 |
+
<schedule><cron_expr>* * * * *</cron_expr></schedule>
|
251 |
+
<run><model>factfinder/observer::processScicOrderQueue</model></run>
|
252 |
+
</factfinder_scic_queue_processing>
|
253 |
+
</jobs>
|
254 |
+
</crontab>
|
255 |
+
<default>
|
256 |
+
<catalog>
|
257 |
+
<search>
|
258 |
+
<engine>factfinder/search_engine</engine>
|
259 |
+
</search>
|
260 |
+
</catalog>
|
261 |
+
<factfinder>
|
262 |
+
<version>3.5.5</version>
|
263 |
+
<revision>$Rev: 25896 $</revision>
|
264 |
+
<debug>false</debug>
|
265 |
+
|
266 |
+
<!-- search settings: WARNING: dont change settings here, please use the Magento backoffice ...
|
267 |
+
if you still have to change something here, dont forget to clear the configuration cache -->
|
268 |
+
<search>
|
269 |
+
<address>example.com</address>
|
270 |
+
<port>80</port>
|
271 |
+
<protocol>http</protocol> <!-- possible values: http, https -->
|
272 |
+
|
273 |
+
<ffversion>68</ffversion>
|
274 |
+
|
275 |
+
<auth_user></auth_user>
|
276 |
+
<auth_password></auth_password>
|
277 |
+
<auth_type>advanced</auth_type> <!-- possible values: http (for FF <= 6.4); simple | advanced (for FF >= 6.5)-->
|
278 |
+
<auth_advancedPrefix>FACT-FINDER</auth_advancedPrefix>
|
279 |
+
<auth_advancedPostfix>FACT-FINDER</auth_advancedPostfix>
|
280 |
+
|
281 |
+
<context></context>
|
282 |
+
<channel></channel>
|
283 |
+
<language></language>
|
284 |
+
</search>
|
285 |
+
<fallback>
|
286 |
+
<use_fallback>0</use_fallback>
|
287 |
+
<wait_time>15</wait_time>
|
288 |
+
</fallback>
|
289 |
+
<export>
|
290 |
+
<urls>0</urls>
|
291 |
+
<suggest_image_size>40</suggest_image_size>
|
292 |
+
<suggest_image_type>image</suggest_image_type>
|
293 |
+
<track_carts>1</track_carts>
|
294 |
+
<track_checkout>1</track_checkout>
|
295 |
+
</export>
|
296 |
+
<config>
|
297 |
+
<identifier>entity_id</identifier>
|
298 |
+
<proxy>0</proxy>
|
299 |
+
<debug>0</debug>
|
300 |
+
<navigation>0</navigation>
|
301 |
+
<upsell>0</upsell>
|
302 |
+
<crosssell>0</crosssell>
|
303 |
+
</config>
|
304 |
+
|
305 |
+
<!-- encoding settings -->
|
306 |
+
<encoding>
|
307 |
+
<pageContent>UTF-8</pageContent>
|
308 |
+
<serverURI>UTF-8</serverURI>
|
309 |
+
<pageURI>UTF-8</pageURI>
|
310 |
+
</encoding>
|
311 |
+
</factfinder>
|
312 |
+
</default>
|
313 |
</config>
|
@@ -1,398 +1,398 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* Flagbit_FactFinder
|
5 |
-
*
|
6 |
-
* @category Mage
|
7 |
-
* @package Flagbit_FactFinder
|
8 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
9 |
-
*/
|
10 |
-
|
11 |
-
/**
|
12 |
-
* System Config
|
13 |
-
*
|
14 |
-
* @category Mage
|
15 |
-
* @package Flagbit_FactFinder
|
16 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
17 |
-
* @author Joerg Weller <weller@flagbit.de>
|
18 |
-
* @version $Id$
|
19 |
-
*/
|
20 |
-
-->
|
21 |
-
<config>
|
22 |
-
<sections>
|
23 |
-
<factfinder translate="label" module="factfinder">
|
24 |
-
<label>FACT-Finder</label>
|
25 |
-
<tab>catalog</tab>
|
26 |
-
<sort_order>420</sort_order>
|
27 |
-
<frontend_type>text</frontend_type>
|
28 |
-
<show_in_default>1</show_in_default>
|
29 |
-
<show_in_website>1</show_in_website>
|
30 |
-
<show_in_store>1</show_in_store>
|
31 |
-
<groups>
|
32 |
-
<search translate="label">
|
33 |
-
<label>FACT-Finder Access Data</label>
|
34 |
-
<frontend_type>text</frontend_type>
|
35 |
-
<sort_order>10</sort_order>
|
36 |
-
<show_in_default>1</show_in_default>
|
37 |
-
<show_in_website>1</show_in_website>
|
38 |
-
<show_in_store>1</show_in_store>
|
39 |
-
<fields>
|
40 |
-
<enabled translate="label">
|
41 |
-
<label>Enabled</label>
|
42 |
-
<frontend_type>select</frontend_type>
|
43 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
44 |
-
<backend_model>factfinder/system_config_backend_enabled</backend_model>
|
45 |
-
<show_in_default>1</show_in_default>
|
46 |
-
<show_in_website>1</show_in_website>
|
47 |
-
<show_in_store>1</show_in_store>
|
48 |
-
</enabled>
|
49 |
-
<address translate="label">
|
50 |
-
<label>Server URL</label>
|
51 |
-
<frontend_type>text</frontend_type>
|
52 |
-
<sort_order>20</sort_order>
|
53 |
-
<show_in_default>1</show_in_default>
|
54 |
-
<show_in_website>1</show_in_website>
|
55 |
-
<show_in_store>1</show_in_store>
|
56 |
-
</address>
|
57 |
-
<port translate="label">
|
58 |
-
<label>Server Port</label>
|
59 |
-
<frontend_type>text</frontend_type>
|
60 |
-
<sort_order>30</sort_order>
|
61 |
-
<show_in_default>1</show_in_default>
|
62 |
-
<show_in_website>1</show_in_website>
|
63 |
-
<show_in_store>1</show_in_store>
|
64 |
-
</port>
|
65 |
-
<context translate="label comment">
|
66 |
-
<label>Context Name</label>
|
67 |
-
<comment>Name of the FACT-Finder application</comment>
|
68 |
-
<frontend_type>text</frontend_type>
|
69 |
-
<sort_order>40</sort_order>
|
70 |
-
<show_in_default>1</show_in_default>
|
71 |
-
<show_in_website>1</show_in_website>
|
72 |
-
<show_in_store>1</show_in_store>
|
73 |
-
</context>
|
74 |
-
<ffversion translate="label comment">
|
75 |
-
<label>FACT-Finder version</label>
|
76 |
-
<comment>Please select the version of your FACT-Finder application to enable all of its features.</comment>
|
77 |
-
<frontend_type>select</frontend_type>
|
78 |
-
<source_model>factfinder/system_config_source_ffversion</source_model>
|
79 |
-
<sort_order>45</sort_order>
|
80 |
-
<show_in_default>1</show_in_default>
|
81 |
-
<show_in_website>1</show_in_website>
|
82 |
-
<show_in_store>1</show_in_store>
|
83 |
-
</ffversion>
|
84 |
-
<auth_user translate="label comment">
|
85 |
-
<label>User name</label>
|
86 |
-
<comment>User name for authentication</comment>
|
87 |
-
<frontend_type>text</frontend_type>
|
88 |
-
<sort_order>50</sort_order>
|
89 |
-
<show_in_default>1</show_in_default>
|
90 |
-
<show_in_website>1</show_in_website>
|
91 |
-
<show_in_store>1</show_in_store>
|
92 |
-
</auth_user>
|
93 |
-
<auth_password translate="label">
|
94 |
-
<label>Password</label>
|
95 |
-
<frontend_type>password</frontend_type>
|
96 |
-
<sort_order>60</sort_order>
|
97 |
-
<show_in_default>1</show_in_default>
|
98 |
-
<show_in_website>1</show_in_website>
|
99 |
-
<show_in_store>1</show_in_store>
|
100 |
-
</auth_password>
|
101 |
-
<channel translate="label comment">
|
102 |
-
<label>Primary Channel</label>
|
103 |
-
<comment>FACT-Finder can provide multiple search indexes, each represented by a "channel". Enter the channel that will be filled with your Magento export. Leave empty to use the default channel.</comment>
|
104 |
-
<frontend_type>text</frontend_type>
|
105 |
-
<sort_order>70</sort_order>
|
106 |
-
<show_in_default>1</show_in_default>
|
107 |
-
<show_in_website>1</show_in_website>
|
108 |
-
<show_in_store>1</show_in_store>
|
109 |
-
</channel>
|
110 |
-
<secondary_channels translate="label">
|
111 |
-
<label>Secondary Channels</label>
|
112 |
-
<comment>Enter any secondary channels you want to search. Multiple channels should be separated by semicolons. NOTE: Secondary channels will only be considered for Suggest results if the proxy is used (see option in section "FACT-Finder Config Data")!</comment>
|
113 |
-
<frontend_type>text</frontend_type>
|
114 |
-
<sort_order>75</sort_order>
|
115 |
-
<show_in_default>1</show_in_default>
|
116 |
-
<show_in_website>1</show_in_website>
|
117 |
-
<show_in_store>1</show_in_store>
|
118 |
-
</secondary_channels>
|
119 |
-
<language translate="label comment">
|
120 |
-
<label>Language</label>
|
121 |
-
<comment>Some text strings come directly from FACT-Finder. Enter the language code here. Leave empty to use the language specified by the user's browser.</comment>
|
122 |
-
<frontend_type>text</frontend_type>
|
123 |
-
<sort_order>80</sort_order>
|
124 |
-
<show_in_default>1</show_in_default>
|
125 |
-
<show_in_website>1</show_in_website>
|
126 |
-
<show_in_store>1</show_in_store>
|
127 |
-
</language>
|
128 |
-
<auth_type translate="label">
|
129 |
-
<label>Authentication Type</label>
|
130 |
-
<frontend_type>select</frontend_type>
|
131 |
-
<source_model>factfinder/system_config_source_authtype</source_model>
|
132 |
-
<sort_order>90</sort_order>
|
133 |
-
<show_in_default>1</show_in_default>
|
134 |
-
<show_in_website>1</show_in_website>
|
135 |
-
<show_in_store>1</show_in_store>
|
136 |
-
</auth_type>
|
137 |
-
<auth_advancedPrefix translate="label comment">
|
138 |
-
<label>Advanced Authentication Prefix</label>
|
139 |
-
<frontend_type>text</frontend_type>
|
140 |
-
<comment>The advanced authentication post- and prefix are only used when the authentication type is "advanced".</comment>
|
141 |
-
<sort_order>100</sort_order>
|
142 |
-
<show_in_default>1</show_in_default>
|
143 |
-
<show_in_website>1</show_in_website>
|
144 |
-
<show_in_store>1</show_in_store>
|
145 |
-
</auth_advancedPrefix>
|
146 |
-
<auth_advancedPostfix>
|
147 |
-
<label>Advanced Authentication Postfix</label>
|
148 |
-
<frontend_type>text</frontend_type>
|
149 |
-
<sort_order>110</sort_order>
|
150 |
-
<show_in_default>1</show_in_default>
|
151 |
-
<show_in_website>1</show_in_website>
|
152 |
-
<show_in_store>1</show_in_store>
|
153 |
-
</auth_advancedPostfix>
|
154 |
-
</fields>
|
155 |
-
</search>
|
156 |
-
<fallback translate="label">
|
157 |
-
<label>FACT-Finder Fallback Configuration</label>
|
158 |
-
<frontend_type>text</frontend_type>
|
159 |
-
<sort_order>15</sort_order>
|
160 |
-
<show_in_default>1</show_in_default>
|
161 |
-
<show_in_website>1</show_in_website>
|
162 |
-
<show_in_store>1</show_in_store>
|
163 |
-
<fields>
|
164 |
-
<use_fallback translate="label comment">
|
165 |
-
<label>Use Fallback</label>
|
166 |
-
<comment>If activated and FACT-Finder cannot be contacted, Magento's built-in search will be used instead.</comment>
|
167 |
-
<frontend_type>select</frontend_type>
|
168 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
169 |
-
<sort_order>10</sort_order>
|
170 |
-
<show_in_default>1</show_in_default>
|
171 |
-
<show_in_website>1</show_in_website>
|
172 |
-
<show_in_store>1</show_in_store>
|
173 |
-
</use_fallback>
|
174 |
-
<wait_time translate="label comment">
|
175 |
-
<label>Minutes before next attempt</label>
|
176 |
-
<comment>After three failed attempts, the module can revert to using Magento for searches. After the specified amount of time has passed, the module will try to contact FACT-Finder again. If you enter 0, the module will first attempt to contact FACT-Finder for every search.</comment>
|
177 |
-
<frontend_type>text</frontend_type>
|
178 |
-
<sort_order>20</sort_order>
|
179 |
-
<show_in_default>1</show_in_default>
|
180 |
-
<show_in_website>1</show_in_website>
|
181 |
-
<show_in_store>1</show_in_store>
|
182 |
-
</wait_time>
|
183 |
-
</fields>
|
184 |
-
</fallback>
|
185 |
-
<export translate="label">
|
186 |
-
<label>FACT-Finder Export Configuration</label>
|
187 |
-
<frontend_type>text</frontend_type>
|
188 |
-
<sort_order>20</sort_order>
|
189 |
-
<show_in_default>1</show_in_default>
|
190 |
-
<show_in_website>1</show_in_website>
|
191 |
-
<show_in_store>1</show_in_store>
|
192 |
-
<fields>
|
193 |
-
<urls translate="label">
|
194 |
-
<label>Export Images and Deeplinks</label>
|
195 |
-
<frontend_type>select</frontend_type>
|
196 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
197 |
-
<sort_order>10</sort_order>
|
198 |
-
<show_in_default>1</show_in_default>
|
199 |
-
<show_in_website>1</show_in_website>
|
200 |
-
<show_in_store>1</show_in_store>
|
201 |
-
</urls>
|
202 |
-
<suggest_image_size translate="label comment">
|
203 |
-
<label>Size of Suggest images</label>
|
204 |
-
<comment>Please enter the desired edge length of the Suggest images in pixels. If you do not want them to be resized, enter 0.</comment>
|
205 |
-
<frontend_type>text</frontend_type>
|
206 |
-
<sort_order>15</sort_order>
|
207 |
-
<show_in_default>1</show_in_default>
|
208 |
-
<show_in_website>1</show_in_website>
|
209 |
-
<show_in_store>1</show_in_store>
|
210 |
-
</suggest_image_size>
|
211 |
-
<suggest_image_type translate="label">
|
212 |
-
<label>Type of Suggest images</label>
|
213 |
-
<frontend_type>select</frontend_type>
|
214 |
-
<source_model>factfinder/system_config_source_imagetype</source_model>
|
215 |
-
<sort_order>16</sort_order>
|
216 |
-
<show_in_default>1</show_in_default>
|
217 |
-
<show_in_website>1</show_in_website>
|
218 |
-
<show_in_store>1</show_in_store>
|
219 |
-
</suggest_image_type>
|
220 |
-
<clicktracking translate="label">
|
221 |
-
<label>Track product-clicks</label>
|
222 |
-
<frontend_type>select</frontend_type>
|
223 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
224 |
-
<sort_order>20</sort_order>
|
225 |
-
<show_in_default>1</show_in_default>
|
226 |
-
<show_in_website>1</show_in_website>
|
227 |
-
<show_in_store>1</show_in_store>
|
228 |
-
</clicktracking>
|
229 |
-
<track_carts translate="label">
|
230 |
-
<label>Track "Add to cart" events</label>
|
231 |
-
<frontend_type>select</frontend_type>
|
232 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
233 |
-
<sort_order>30</sort_order>
|
234 |
-
<show_in_default>1</show_in_default>
|
235 |
-
<show_in_website>1</show_in_website>
|
236 |
-
<show_in_store>1</show_in_store>
|
237 |
-
</track_carts>
|
238 |
-
<track_checkout translate="label">
|
239 |
-
<label>Track checkout</label>
|
240 |
-
<frontend_type>select</frontend_type>
|
241 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
242 |
-
<sort_order>40</sort_order>
|
243 |
-
<show_in_default>1</show_in_default>
|
244 |
-
<show_in_website>1</show_in_website>
|
245 |
-
<show_in_store>1</show_in_store>
|
246 |
-
</track_checkout>
|
247 |
-
<attributes translate="label">
|
248 |
-
<label>Attributes</label>
|
249 |
-
<frontend_model>factfinder/adminhtml_form_field_attributes</frontend_model>
|
250 |
-
<backend_model>factfinder/system_config_backend_attributes</backend_model>
|
251 |
-
<sort_order>50</sort_order>
|
252 |
-
<show_in_default>0</show_in_default>
|
253 |
-
<show_in_website>0</show_in_website>
|
254 |
-
<show_in_store>1</show_in_store>
|
255 |
-
</attributes>
|
256 |
-
<export_url translate="label">
|
257 |
-
<label></label>
|
258 |
-
<frontend_model>factfinder/adminhtml_exportlink</frontend_model>
|
259 |
-
<sort_order>60</sort_order>
|
260 |
-
<show_in_default>1</show_in_default>
|
261 |
-
<show_in_website>1</show_in_website>
|
262 |
-
<show_in_store>1</show_in_store>
|
263 |
-
</export_url>
|
264 |
-
</fields>
|
265 |
-
</export>
|
266 |
-
<config translate="label">
|
267 |
-
<label>FACT-Finder Config Data</label>
|
268 |
-
<frontend_type>text</frontend_type>
|
269 |
-
<sort_order>30</sort_order>
|
270 |
-
<show_in_default>1</show_in_default>
|
271 |
-
<show_in_website>1</show_in_website>
|
272 |
-
<show_in_store>1</show_in_store>
|
273 |
-
<fields>
|
274 |
-
<identifier translate="label">
|
275 |
-
<label>Product Identifier</label>
|
276 |
-
<frontend_type>select</frontend_type>
|
277 |
-
<source_model>factfinder/system_config_source_identifier</source_model>
|
278 |
-
<sort_order>10</sort_order>
|
279 |
-
<show_in_default>1</show_in_default>
|
280 |
-
<show_in_website>1</show_in_website>
|
281 |
-
<show_in_store>1</show_in_store>
|
282 |
-
</identifier>
|
283 |
-
<redirectOnSingleResult>
|
284 |
-
<label>Redirect to product details page for single results</label>
|
285 |
-
<frontend_type>select</frontend_type>
|
286 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
287 |
-
<sort_order>20</sort_order>
|
288 |
-
<show_in_default>1</show_in_default>
|
289 |
-
<show_in_website>1</show_in_website>
|
290 |
-
<show_in_store>1</show_in_store>
|
291 |
-
</redirectOnSingleResult>
|
292 |
-
<proxy translate="label">
|
293 |
-
<label>Use Proxy for Suggest</label>
|
294 |
-
<comment>This option must be enabled if secondary channels are to be considered for Suggest results.</comment>
|
295 |
-
<frontend_type>select</frontend_type>
|
296 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
297 |
-
<sort_order>30</sort_order>
|
298 |
-
<show_in_default>1</show_in_default>
|
299 |
-
<show_in_website>1</show_in_website>
|
300 |
-
<show_in_store>1</show_in_store>
|
301 |
-
</proxy>
|
302 |
-
<internal_ip translate="label">
|
303 |
-
<label>Internal IPs</label>
|
304 |
-
<comment>Enter your internal IP addresses. Multiple IP addresses should be separated by semicolons.</comment>
|
305 |
-
<frontend_type>text</frontend_type>
|
306 |
-
<sort_order>40</sort_order>
|
307 |
-
<show_in_default>1</show_in_default>
|
308 |
-
<show_in_website>1</show_in_website>
|
309 |
-
<show_in_store>1</show_in_store>
|
310 |
-
</internal_ip>
|
311 |
-
<debug translate="label">
|
312 |
-
<label>Debug Log</label>
|
313 |
-
<frontend_type>select</frontend_type>
|
314 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
315 |
-
<sort_order>50</sort_order>
|
316 |
-
<show_in_default>1</show_in_default>
|
317 |
-
<show_in_website>1</show_in_website>
|
318 |
-
<show_in_store>1</show_in_store>
|
319 |
-
</debug>
|
320 |
-
</fields>
|
321 |
-
</config>
|
322 |
-
<activation translate="label">
|
323 |
-
<label>FACT-Finder Module Activation</label>
|
324 |
-
<frontend_type>text</frontend_type>
|
325 |
-
<sort_order>40</sort_order>
|
326 |
-
<show_in_default>1</show_in_default>
|
327 |
-
<show_in_website>1</show_in_website>
|
328 |
-
<show_in_store>1</show_in_store>
|
329 |
-
<fields>
|
330 |
-
<suggest translate="label">
|
331 |
-
<label>Use FACT-Finder Suggest Functionality</label>
|
332 |
-
<frontend_type>select</frontend_type>
|
333 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
334 |
-
<sort_order>10</sort_order>
|
335 |
-
<show_in_default>1</show_in_default>
|
336 |
-
<show_in_website>1</show_in_website>
|
337 |
-
<show_in_store>1</show_in_store>
|
338 |
-
</suggest>
|
339 |
-
<campaign translate="label">
|
340 |
-
<label>Use FACT-Finder Campaign Functionality</label>
|
341 |
-
<frontend_type>select</frontend_type>
|
342 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
343 |
-
<sort_order>20</sort_order>
|
344 |
-
<show_in_default>1</show_in_default>
|
345 |
-
<show_in_website>1</show_in_website>
|
346 |
-
<show_in_store>1</show_in_store>
|
347 |
-
</campaign>
|
348 |
-
<asn translate="label">
|
349 |
-
<label>Use FACT-Finder After Search Navigation Functionality</label>
|
350 |
-
<frontend_type>select</frontend_type>
|
351 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
352 |
-
<sort_order>30</sort_order>
|
353 |
-
<show_in_default>1</show_in_default>
|
354 |
-
<show_in_website>1</show_in_website>
|
355 |
-
<show_in_store>1</show_in_store>
|
356 |
-
</asn>
|
357 |
-
<navigation translate="label">
|
358 |
-
<label>Use FACT-Finder for Layered Navigation</label>
|
359 |
-
<frontend_type>select</frontend_type>
|
360 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
361 |
-
<sort_order>50</sort_order>
|
362 |
-
<show_in_default>1</show_in_default>
|
363 |
-
<show_in_website>1</show_in_website>
|
364 |
-
<show_in_store>1</show_in_store>
|
365 |
-
</navigation>
|
366 |
-
<upsell translate="label">
|
367 |
-
<label>Use FACT-Finder for product upselling</label>
|
368 |
-
<frontend_type>select</frontend_type>
|
369 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
370 |
-
<sort_order>60</sort_order>
|
371 |
-
<show_in_default>1</show_in_default>
|
372 |
-
<show_in_website>1</show_in_website>
|
373 |
-
<show_in_store>1</show_in_store>
|
374 |
-
</upsell>
|
375 |
-
<crosssell translate="label">
|
376 |
-
<label>Use FACT-Finder for product cross-selling</label>
|
377 |
-
<frontend_type>select</frontend_type>
|
378 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
379 |
-
<sort_order>70</sort_order>
|
380 |
-
<show_in_default>1</show_in_default>
|
381 |
-
<show_in_website>1</show_in_website>
|
382 |
-
<show_in_store>1</show_in_store>
|
383 |
-
</crosssell>
|
384 |
-
<tagcloud translate="label">
|
385 |
-
<label>Use FACT-Finder for tag cloud computation</label>
|
386 |
-
<frontend_type>select</frontend_type>
|
387 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
388 |
-
<sort_order>80</sort_order>
|
389 |
-
<show_in_default>1</show_in_default>
|
390 |
-
<show_in_website>1</show_in_website>
|
391 |
-
<show_in_store>1</show_in_store>
|
392 |
-
</tagcloud>
|
393 |
-
</fields>
|
394 |
-
</activation>
|
395 |
-
</groups>
|
396 |
-
</factfinder>
|
397 |
-
</sections>
|
398 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Flagbit_FactFinder
|
5 |
+
*
|
6 |
+
* @category Mage
|
7 |
+
* @package Flagbit_FactFinder
|
8 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* System Config
|
13 |
+
*
|
14 |
+
* @category Mage
|
15 |
+
* @package Flagbit_FactFinder
|
16 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
17 |
+
* @author Joerg Weller <weller@flagbit.de>
|
18 |
+
* @version $Id$
|
19 |
+
*/
|
20 |
+
-->
|
21 |
+
<config>
|
22 |
+
<sections>
|
23 |
+
<factfinder translate="label" module="factfinder">
|
24 |
+
<label>FACT-Finder</label>
|
25 |
+
<tab>catalog</tab>
|
26 |
+
<sort_order>420</sort_order>
|
27 |
+
<frontend_type>text</frontend_type>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>1</show_in_store>
|
31 |
+
<groups>
|
32 |
+
<search translate="label">
|
33 |
+
<label>FACT-Finder Access Data</label>
|
34 |
+
<frontend_type>text</frontend_type>
|
35 |
+
<sort_order>10</sort_order>
|
36 |
+
<show_in_default>1</show_in_default>
|
37 |
+
<show_in_website>1</show_in_website>
|
38 |
+
<show_in_store>1</show_in_store>
|
39 |
+
<fields>
|
40 |
+
<enabled translate="label">
|
41 |
+
<label>Enabled</label>
|
42 |
+
<frontend_type>select</frontend_type>
|
43 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
44 |
+
<backend_model>factfinder/system_config_backend_enabled</backend_model>
|
45 |
+
<show_in_default>1</show_in_default>
|
46 |
+
<show_in_website>1</show_in_website>
|
47 |
+
<show_in_store>1</show_in_store>
|
48 |
+
</enabled>
|
49 |
+
<address translate="label">
|
50 |
+
<label>Server URL</label>
|
51 |
+
<frontend_type>text</frontend_type>
|
52 |
+
<sort_order>20</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
</address>
|
57 |
+
<port translate="label">
|
58 |
+
<label>Server Port</label>
|
59 |
+
<frontend_type>text</frontend_type>
|
60 |
+
<sort_order>30</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>1</show_in_store>
|
64 |
+
</port>
|
65 |
+
<context translate="label comment">
|
66 |
+
<label>Context Name</label>
|
67 |
+
<comment>Name of the FACT-Finder application</comment>
|
68 |
+
<frontend_type>text</frontend_type>
|
69 |
+
<sort_order>40</sort_order>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>1</show_in_store>
|
73 |
+
</context>
|
74 |
+
<ffversion translate="label comment">
|
75 |
+
<label>FACT-Finder version</label>
|
76 |
+
<comment>Please select the version of your FACT-Finder application to enable all of its features.</comment>
|
77 |
+
<frontend_type>select</frontend_type>
|
78 |
+
<source_model>factfinder/system_config_source_ffversion</source_model>
|
79 |
+
<sort_order>45</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</ffversion>
|
84 |
+
<auth_user translate="label comment">
|
85 |
+
<label>User name</label>
|
86 |
+
<comment>User name for authentication</comment>
|
87 |
+
<frontend_type>text</frontend_type>
|
88 |
+
<sort_order>50</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
</auth_user>
|
93 |
+
<auth_password translate="label">
|
94 |
+
<label>Password</label>
|
95 |
+
<frontend_type>password</frontend_type>
|
96 |
+
<sort_order>60</sort_order>
|
97 |
+
<show_in_default>1</show_in_default>
|
98 |
+
<show_in_website>1</show_in_website>
|
99 |
+
<show_in_store>1</show_in_store>
|
100 |
+
</auth_password>
|
101 |
+
<channel translate="label comment">
|
102 |
+
<label>Primary Channel</label>
|
103 |
+
<comment>FACT-Finder can provide multiple search indexes, each represented by a "channel". Enter the channel that will be filled with your Magento export. Leave empty to use the default channel.</comment>
|
104 |
+
<frontend_type>text</frontend_type>
|
105 |
+
<sort_order>70</sort_order>
|
106 |
+
<show_in_default>1</show_in_default>
|
107 |
+
<show_in_website>1</show_in_website>
|
108 |
+
<show_in_store>1</show_in_store>
|
109 |
+
</channel>
|
110 |
+
<secondary_channels translate="label">
|
111 |
+
<label>Secondary Channels</label>
|
112 |
+
<comment>Enter any secondary channels you want to search. Multiple channels should be separated by semicolons. NOTE: Secondary channels will only be considered for Suggest results if the proxy is used (see option in section "FACT-Finder Config Data")!</comment>
|
113 |
+
<frontend_type>text</frontend_type>
|
114 |
+
<sort_order>75</sort_order>
|
115 |
+
<show_in_default>1</show_in_default>
|
116 |
+
<show_in_website>1</show_in_website>
|
117 |
+
<show_in_store>1</show_in_store>
|
118 |
+
</secondary_channels>
|
119 |
+
<language translate="label comment">
|
120 |
+
<label>Language</label>
|
121 |
+
<comment>Some text strings come directly from FACT-Finder. Enter the language code here. Leave empty to use the language specified by the user's browser.</comment>
|
122 |
+
<frontend_type>text</frontend_type>
|
123 |
+
<sort_order>80</sort_order>
|
124 |
+
<show_in_default>1</show_in_default>
|
125 |
+
<show_in_website>1</show_in_website>
|
126 |
+
<show_in_store>1</show_in_store>
|
127 |
+
</language>
|
128 |
+
<auth_type translate="label">
|
129 |
+
<label>Authentication Type</label>
|
130 |
+
<frontend_type>select</frontend_type>
|
131 |
+
<source_model>factfinder/system_config_source_authtype</source_model>
|
132 |
+
<sort_order>90</sort_order>
|
133 |
+
<show_in_default>1</show_in_default>
|
134 |
+
<show_in_website>1</show_in_website>
|
135 |
+
<show_in_store>1</show_in_store>
|
136 |
+
</auth_type>
|
137 |
+
<auth_advancedPrefix translate="label comment">
|
138 |
+
<label>Advanced Authentication Prefix</label>
|
139 |
+
<frontend_type>text</frontend_type>
|
140 |
+
<comment>The advanced authentication post- and prefix are only used when the authentication type is "advanced".</comment>
|
141 |
+
<sort_order>100</sort_order>
|
142 |
+
<show_in_default>1</show_in_default>
|
143 |
+
<show_in_website>1</show_in_website>
|
144 |
+
<show_in_store>1</show_in_store>
|
145 |
+
</auth_advancedPrefix>
|
146 |
+
<auth_advancedPostfix>
|
147 |
+
<label>Advanced Authentication Postfix</label>
|
148 |
+
<frontend_type>text</frontend_type>
|
149 |
+
<sort_order>110</sort_order>
|
150 |
+
<show_in_default>1</show_in_default>
|
151 |
+
<show_in_website>1</show_in_website>
|
152 |
+
<show_in_store>1</show_in_store>
|
153 |
+
</auth_advancedPostfix>
|
154 |
+
</fields>
|
155 |
+
</search>
|
156 |
+
<fallback translate="label">
|
157 |
+
<label>FACT-Finder Fallback Configuration</label>
|
158 |
+
<frontend_type>text</frontend_type>
|
159 |
+
<sort_order>15</sort_order>
|
160 |
+
<show_in_default>1</show_in_default>
|
161 |
+
<show_in_website>1</show_in_website>
|
162 |
+
<show_in_store>1</show_in_store>
|
163 |
+
<fields>
|
164 |
+
<use_fallback translate="label comment">
|
165 |
+
<label>Use Fallback</label>
|
166 |
+
<comment>If activated and FACT-Finder cannot be contacted, Magento's built-in search will be used instead.</comment>
|
167 |
+
<frontend_type>select</frontend_type>
|
168 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
169 |
+
<sort_order>10</sort_order>
|
170 |
+
<show_in_default>1</show_in_default>
|
171 |
+
<show_in_website>1</show_in_website>
|
172 |
+
<show_in_store>1</show_in_store>
|
173 |
+
</use_fallback>
|
174 |
+
<wait_time translate="label comment">
|
175 |
+
<label>Minutes before next attempt</label>
|
176 |
+
<comment>After three failed attempts, the module can revert to using Magento for searches. After the specified amount of time has passed, the module will try to contact FACT-Finder again. If you enter 0, the module will first attempt to contact FACT-Finder for every search.</comment>
|
177 |
+
<frontend_type>text</frontend_type>
|
178 |
+
<sort_order>20</sort_order>
|
179 |
+
<show_in_default>1</show_in_default>
|
180 |
+
<show_in_website>1</show_in_website>
|
181 |
+
<show_in_store>1</show_in_store>
|
182 |
+
</wait_time>
|
183 |
+
</fields>
|
184 |
+
</fallback>
|
185 |
+
<export translate="label">
|
186 |
+
<label>FACT-Finder Export Configuration</label>
|
187 |
+
<frontend_type>text</frontend_type>
|
188 |
+
<sort_order>20</sort_order>
|
189 |
+
<show_in_default>1</show_in_default>
|
190 |
+
<show_in_website>1</show_in_website>
|
191 |
+
<show_in_store>1</show_in_store>
|
192 |
+
<fields>
|
193 |
+
<urls translate="label">
|
194 |
+
<label>Export Images and Deeplinks</label>
|
195 |
+
<frontend_type>select</frontend_type>
|
196 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
197 |
+
<sort_order>10</sort_order>
|
198 |
+
<show_in_default>1</show_in_default>
|
199 |
+
<show_in_website>1</show_in_website>
|
200 |
+
<show_in_store>1</show_in_store>
|
201 |
+
</urls>
|
202 |
+
<suggest_image_size translate="label comment">
|
203 |
+
<label>Size of Suggest images</label>
|
204 |
+
<comment>Please enter the desired edge length of the Suggest images in pixels. If you do not want them to be resized, enter 0.</comment>
|
205 |
+
<frontend_type>text</frontend_type>
|
206 |
+
<sort_order>15</sort_order>
|
207 |
+
<show_in_default>1</show_in_default>
|
208 |
+
<show_in_website>1</show_in_website>
|
209 |
+
<show_in_store>1</show_in_store>
|
210 |
+
</suggest_image_size>
|
211 |
+
<suggest_image_type translate="label">
|
212 |
+
<label>Type of Suggest images</label>
|
213 |
+
<frontend_type>select</frontend_type>
|
214 |
+
<source_model>factfinder/system_config_source_imagetype</source_model>
|
215 |
+
<sort_order>16</sort_order>
|
216 |
+
<show_in_default>1</show_in_default>
|
217 |
+
<show_in_website>1</show_in_website>
|
218 |
+
<show_in_store>1</show_in_store>
|
219 |
+
</suggest_image_type>
|
220 |
+
<clicktracking translate="label">
|
221 |
+
<label>Track product-clicks</label>
|
222 |
+
<frontend_type>select</frontend_type>
|
223 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
224 |
+
<sort_order>20</sort_order>
|
225 |
+
<show_in_default>1</show_in_default>
|
226 |
+
<show_in_website>1</show_in_website>
|
227 |
+
<show_in_store>1</show_in_store>
|
228 |
+
</clicktracking>
|
229 |
+
<track_carts translate="label">
|
230 |
+
<label>Track "Add to cart" events</label>
|
231 |
+
<frontend_type>select</frontend_type>
|
232 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
233 |
+
<sort_order>30</sort_order>
|
234 |
+
<show_in_default>1</show_in_default>
|
235 |
+
<show_in_website>1</show_in_website>
|
236 |
+
<show_in_store>1</show_in_store>
|
237 |
+
</track_carts>
|
238 |
+
<track_checkout translate="label">
|
239 |
+
<label>Track checkout</label>
|
240 |
+
<frontend_type>select</frontend_type>
|
241 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
242 |
+
<sort_order>40</sort_order>
|
243 |
+
<show_in_default>1</show_in_default>
|
244 |
+
<show_in_website>1</show_in_website>
|
245 |
+
<show_in_store>1</show_in_store>
|
246 |
+
</track_checkout>
|
247 |
+
<attributes translate="label">
|
248 |
+
<label>Attributes</label>
|
249 |
+
<frontend_model>factfinder/adminhtml_form_field_attributes</frontend_model>
|
250 |
+
<backend_model>factfinder/system_config_backend_attributes</backend_model>
|
251 |
+
<sort_order>50</sort_order>
|
252 |
+
<show_in_default>0</show_in_default>
|
253 |
+
<show_in_website>0</show_in_website>
|
254 |
+
<show_in_store>1</show_in_store>
|
255 |
+
</attributes>
|
256 |
+
<export_url translate="label">
|
257 |
+
<label></label>
|
258 |
+
<frontend_model>factfinder/adminhtml_exportlink</frontend_model>
|
259 |
+
<sort_order>60</sort_order>
|
260 |
+
<show_in_default>1</show_in_default>
|
261 |
+
<show_in_website>1</show_in_website>
|
262 |
+
<show_in_store>1</show_in_store>
|
263 |
+
</export_url>
|
264 |
+
</fields>
|
265 |
+
</export>
|
266 |
+
<config translate="label">
|
267 |
+
<label>FACT-Finder Config Data</label>
|
268 |
+
<frontend_type>text</frontend_type>
|
269 |
+
<sort_order>30</sort_order>
|
270 |
+
<show_in_default>1</show_in_default>
|
271 |
+
<show_in_website>1</show_in_website>
|
272 |
+
<show_in_store>1</show_in_store>
|
273 |
+
<fields>
|
274 |
+
<identifier translate="label">
|
275 |
+
<label>Product Identifier</label>
|
276 |
+
<frontend_type>select</frontend_type>
|
277 |
+
<source_model>factfinder/system_config_source_identifier</source_model>
|
278 |
+
<sort_order>10</sort_order>
|
279 |
+
<show_in_default>1</show_in_default>
|
280 |
+
<show_in_website>1</show_in_website>
|
281 |
+
<show_in_store>1</show_in_store>
|
282 |
+
</identifier>
|
283 |
+
<redirectOnSingleResult>
|
284 |
+
<label>Redirect to product details page for single results</label>
|
285 |
+
<frontend_type>select</frontend_type>
|
286 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
287 |
+
<sort_order>20</sort_order>
|
288 |
+
<show_in_default>1</show_in_default>
|
289 |
+
<show_in_website>1</show_in_website>
|
290 |
+
<show_in_store>1</show_in_store>
|
291 |
+
</redirectOnSingleResult>
|
292 |
+
<proxy translate="label">
|
293 |
+
<label>Use Proxy for Suggest</label>
|
294 |
+
<comment>This option must be enabled if secondary channels are to be considered for Suggest results.</comment>
|
295 |
+
<frontend_type>select</frontend_type>
|
296 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
297 |
+
<sort_order>30</sort_order>
|
298 |
+
<show_in_default>1</show_in_default>
|
299 |
+
<show_in_website>1</show_in_website>
|
300 |
+
<show_in_store>1</show_in_store>
|
301 |
+
</proxy>
|
302 |
+
<internal_ip translate="label">
|
303 |
+
<label>Internal IPs</label>
|
304 |
+
<comment>Enter your internal IP addresses. Multiple IP addresses should be separated by semicolons.</comment>
|
305 |
+
<frontend_type>text</frontend_type>
|
306 |
+
<sort_order>40</sort_order>
|
307 |
+
<show_in_default>1</show_in_default>
|
308 |
+
<show_in_website>1</show_in_website>
|
309 |
+
<show_in_store>1</show_in_store>
|
310 |
+
</internal_ip>
|
311 |
+
<debug translate="label">
|
312 |
+
<label>Debug Log</label>
|
313 |
+
<frontend_type>select</frontend_type>
|
314 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
315 |
+
<sort_order>50</sort_order>
|
316 |
+
<show_in_default>1</show_in_default>
|
317 |
+
<show_in_website>1</show_in_website>
|
318 |
+
<show_in_store>1</show_in_store>
|
319 |
+
</debug>
|
320 |
+
</fields>
|
321 |
+
</config>
|
322 |
+
<activation translate="label">
|
323 |
+
<label>FACT-Finder Module Activation</label>
|
324 |
+
<frontend_type>text</frontend_type>
|
325 |
+
<sort_order>40</sort_order>
|
326 |
+
<show_in_default>1</show_in_default>
|
327 |
+
<show_in_website>1</show_in_website>
|
328 |
+
<show_in_store>1</show_in_store>
|
329 |
+
<fields>
|
330 |
+
<suggest translate="label">
|
331 |
+
<label>Use FACT-Finder Suggest Functionality</label>
|
332 |
+
<frontend_type>select</frontend_type>
|
333 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
334 |
+
<sort_order>10</sort_order>
|
335 |
+
<show_in_default>1</show_in_default>
|
336 |
+
<show_in_website>1</show_in_website>
|
337 |
+
<show_in_store>1</show_in_store>
|
338 |
+
</suggest>
|
339 |
+
<campaign translate="label">
|
340 |
+
<label>Use FACT-Finder Campaign Functionality</label>
|
341 |
+
<frontend_type>select</frontend_type>
|
342 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
343 |
+
<sort_order>20</sort_order>
|
344 |
+
<show_in_default>1</show_in_default>
|
345 |
+
<show_in_website>1</show_in_website>
|
346 |
+
<show_in_store>1</show_in_store>
|
347 |
+
</campaign>
|
348 |
+
<asn translate="label">
|
349 |
+
<label>Use FACT-Finder After Search Navigation Functionality</label>
|
350 |
+
<frontend_type>select</frontend_type>
|
351 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
352 |
+
<sort_order>30</sort_order>
|
353 |
+
<show_in_default>1</show_in_default>
|
354 |
+
<show_in_website>1</show_in_website>
|
355 |
+
<show_in_store>1</show_in_store>
|
356 |
+
</asn>
|
357 |
+
<navigation translate="label">
|
358 |
+
<label>Use FACT-Finder for Layered Navigation</label>
|
359 |
+
<frontend_type>select</frontend_type>
|
360 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
361 |
+
<sort_order>50</sort_order>
|
362 |
+
<show_in_default>1</show_in_default>
|
363 |
+
<show_in_website>1</show_in_website>
|
364 |
+
<show_in_store>1</show_in_store>
|
365 |
+
</navigation>
|
366 |
+
<upsell translate="label">
|
367 |
+
<label>Use FACT-Finder for product upselling</label>
|
368 |
+
<frontend_type>select</frontend_type>
|
369 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
370 |
+
<sort_order>60</sort_order>
|
371 |
+
<show_in_default>1</show_in_default>
|
372 |
+
<show_in_website>1</show_in_website>
|
373 |
+
<show_in_store>1</show_in_store>
|
374 |
+
</upsell>
|
375 |
+
<crosssell translate="label">
|
376 |
+
<label>Use FACT-Finder for product cross-selling</label>
|
377 |
+
<frontend_type>select</frontend_type>
|
378 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
379 |
+
<sort_order>70</sort_order>
|
380 |
+
<show_in_default>1</show_in_default>
|
381 |
+
<show_in_website>1</show_in_website>
|
382 |
+
<show_in_store>1</show_in_store>
|
383 |
+
</crosssell>
|
384 |
+
<tagcloud translate="label">
|
385 |
+
<label>Use FACT-Finder for tag cloud computation</label>
|
386 |
+
<frontend_type>select</frontend_type>
|
387 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
388 |
+
<sort_order>80</sort_order>
|
389 |
+
<show_in_default>1</show_in_default>
|
390 |
+
<show_in_website>1</show_in_website>
|
391 |
+
<show_in_store>1</show_in_store>
|
392 |
+
</tagcloud>
|
393 |
+
</fields>
|
394 |
+
</activation>
|
395 |
+
</groups>
|
396 |
+
</factfinder>
|
397 |
+
</sections>
|
398 |
</config>
|
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Flagbit_FactFinder
|
4 |
-
*
|
5 |
-
* @category Mage
|
6 |
-
* @package Flagbit_FactFinder
|
7 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Install script
|
12 |
-
*
|
13 |
-
* Install script for SCIC queue. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
-
*
|
15 |
-
* @category Mage
|
16 |
-
* @package Flagbit_FactFinder
|
17 |
-
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
-
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
-
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
-
*/
|
21 |
-
|
22 |
-
$installer = $this;
|
23 |
-
$installer->startSetup();
|
24 |
-
|
25 |
-
$installer->run("
|
26 |
-
CREATE TABLE `{$installer->getTable('factfinder/scic_queue')}` (
|
27 |
-
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
|
28 |
-
`product_id` varchar(64) NOT NULL DEFAULT '',
|
29 |
-
`sid` varchar(32) NOT NULL DEFAULT '',
|
30 |
-
`userid` varchar(32) NOT NULL DEFAULT '',
|
31 |
-
`price` decimal(12,4) NOT NULL default '0.0000',
|
32 |
-
`count` smallint(5) unsigned NOT NULL default '1',
|
33 |
-
|
34 |
-
PRIMARY KEY (`id`)
|
35 |
-
) ENGINE = InnoDB ;
|
36 |
-
");
|
37 |
-
|
38 |
$installer->endSetup();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Flagbit_FactFinder
|
4 |
+
*
|
5 |
+
* @category Mage
|
6 |
+
* @package Flagbit_FactFinder
|
7 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Install script
|
12 |
+
*
|
13 |
+
* Install script for SCIC queue. Orders are sent to FACT-Finder asynchronously by cronjobs.
|
14 |
+
*
|
15 |
+
* @category Mage
|
16 |
+
* @package Flagbit_FactFinder
|
17 |
+
* @copyright Copyright (c) 2010 Flagbit GmbH & Co. KG (http://www.flagbit.de/)
|
18 |
+
* @author Michael Türk <tuerk@flagbit.de>
|
19 |
+
* @version $Id: Processor.php 647 2011-03-21 10:32:14Z rudolf_batt $
|
20 |
+
*/
|
21 |
+
|
22 |
+
$installer = $this;
|
23 |
+
$installer->startSetup();
|
24 |
+
|
25 |
+
$installer->run("
|
26 |
+
CREATE TABLE `{$installer->getTable('factfinder/scic_queue')}` (
|
27 |
+
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
|
28 |
+
`product_id` varchar(64) NOT NULL DEFAULT '',
|
29 |
+
`sid` varchar(32) NOT NULL DEFAULT '',
|
30 |
+
`userid` varchar(32) NOT NULL DEFAULT '',
|
31 |
+
`price` decimal(12,4) NOT NULL default '0.0000',
|
32 |
+
`count` smallint(5) unsigned NOT NULL default '1',
|
33 |
+
|
34 |
+
PRIMARY KEY (`id`)
|
35 |
+
) ENGINE = InnoDB ;
|
36 |
+
");
|
37 |
+
|
38 |
$installer->endSetup();
|
@@ -1,91 +1,91 @@
|
|
1 |
-
"advanced", "fortgeschritten"
|
2 |
-
"Advanced Authentication Postfix", "Suffix für fortgeschrittene Authentifizierung"
|
3 |
-
"Advanced Authentication Prefix", "Präfix für fortgeschrittene Authentifizierung"
|
4 |
-
"After three failed attempts, the module can revert to using Magento for searches. After the specified amount of time has passed, the module will try to contact FACT-Finder again. If you enter 0, the module will first attempt to contact FACT-Finder for every search.", "Nach drei fehlgeschlagenen Versuchen, kann das Modul dauerhaft Magentos Suche benutzen. Nachdem die hier eingegebene Zeit verstrichen ist, versucht das Modul dann erneut FACT-Finder zu verwenden. Wenn Sie 0 eingeben, wird das Modul für alle Suchanfragen zunächst versuchen FACT-Finder zu erreichen."
|
5 |
-
"Another export is already running. Please wait for it to finish before you start a new export.", "Ein anderer Export wurde bereits gestartet. Bitte warten Sie auf dessen Fertigstellung, bevor Sie ein neuen Export beginnen."
|
6 |
-
"If you receive this message after another export has failed, please delete the file ""export.lock"" within your Magento directory.", "Wenn Sie diese Meldung sehen, nachdem ein anderer Export abgebrochen wurde, löschen Sie bitte die Datei ""export.lock"" aus Ihrem Magento-Verzeichnis."
|
7 |
-
"Authentication Type", "Authentifizierungstyp"
|
8 |
-
"Catalog", "Katalog"
|
9 |
-
"Channel", "Channel"
|
10 |
-
"Channel does not exist or the specified user does not have sufficient rights.", "Channel existiert nicht oder der verwendete User hat nicht die benötigten Rechte."
|
11 |
-
"Channel: dev-content", "Inhalte"
|
12 |
-
"Please select the version of your FACT-Finder application to enable all of its features.", "Wählen Sie die Version Ihrer FACT-Finder-Applikation um alle Funktionen nutzen zu können."
|
13 |
-
"Context Name", "Kontext-Name"
|
14 |
-
"Could not establish HTTP connection.", "HTTP-Verbindung konnte nicht hergestellt werden."
|
15 |
-
"Could not log into FACT-Finder with the given settings. Please check username, password, prefix and postfix.", "FACT-Finder-Login mit gegebenen Einstellungen nicht möglich. Bitte überprüfen Sie Benutzernamen, Passwort, Präfix und Suffix."
|
16 |
-
"Could not contact FACT-Finder.", "FACT-Finder konnte nicht erreicht werden."
|
17 |
-
"Debug Log", "Debug Log"
|
18 |
-
"Download export", "Export herunterladen"
|
19 |
-
"Enabled", "Aktiviert"
|
20 |
-
"Enter your internal IP addresses. Multiple IP addresses should be separated by semicolons.", "Geben Sie hier Ihre internen IP-Adressen ein. Mehrere IP-Adressen werden mit Semikolon getrennt."
|
21 |
-
"Enter any secondary channels you want to search. Multiple channels should be separated by semicolons. NOTE: Secondary channels will only be considered for Suggest results if the proxy is used (see option in section ""FACT-Finder Config Data"")!", "Geben Sie hier weitere Channels an, die Sie durchsuchen wollen. Mehrere Channels werden mit Semikolon getrennt. Hinweis: Damit sekundäre Channels in der Autovervollständigung berücksichtigt werden, muss der Proxy verwendet werden (siehe Option im Abschnitt ""FACT-Finder Konfigurationsdaten"")!"
|
22 |
-
"Error in Channel", "Fehler in Channel"
|
23 |
-
"Error in Primary Channel", "Fehler im primären Channel"
|
24 |
-
"Export Images and Deeplinks", "Bilder und Deeplinks exportieren"
|
25 |
-
"FACT-Finder", "FACT-Finder"
|
26 |
-
"FACT-Finder Access Data", "FACT-Finder: Zugangsdaten"
|
27 |
-
"FACT-Finder Business User Cockpit", "FACT-Finder Business User Cockpit"
|
28 |
-
"FACT-Finder can provide multiple search indexes, each represented by a ""channel"". Enter the channel that will be filled with your Magento export. Leave empty to use the default channel.", "FACT-Finder kann mehrere Such-Indizes zur Verfügung stellen. Jeder Index wird durch einen ""Channel"" dargestellt. Tragen Sie den Channel ein, der mit Ihrem Magento-Export gefüllt wird. Wenn kein Wert angegeben ist, wird der Standard-Channel genutzt."
|
29 |
-
"FACT-Finder cannot be activated:", "FACT-Finder konnte nicht aktiviert werden:"
|
30 |
-
"FACT-Finder Config Data", "FACT-Finder-Konfigurationsdaten"
|
31 |
-
"FACT-Finder Export Configuration", "FACT-Finder: Export-Konfiguration"
|
32 |
-
"FACT-Finder Fallback Configuration", "FACT-Finder: Fallback-Konfiguration"
|
33 |
-
"FACT-Finder Module Activation", "FACT-Finder: Modul-Auswahl"
|
34 |
-
"FACT-Finder not found on server. Please check your context setting.", "FACT-Finder konnte auf dem Server nicht gefunden werden. Bitte überprüfen Sie Ihre Kontexteinstellung."
|
35 |
-
"FACT-Finder Status", "FACT-Finder Status"
|
36 |
-
"FACT-Finder version", "FACT-Finder-Version"
|
37 |
-
"http", "http"
|
38 |
-
"If activated and FACT-Finder cannot be contacted, Magento's built-in search will be used instead.", "Wenn diese Option aktiviert ist und FACT-Finder nicht erreicht werden kann, wird stattdessen Magentos eingebaute Suche verwendet."
|
39 |
-
"Internal IPs", "Interne IPs"
|
40 |
-
"Language", "Sprache"
|
41 |
-
"Minutes before next attempt", "Minuten bis zum erneuten Versuch"
|
42 |
-
"Name of the FACT-Finder application", "Name der FACT-Finder-Applikation"
|
43 |
-
"No", "Nein"
|
44 |
-
"Password", "Passwort"
|
45 |
-
"Please enter the desired edge length of the Suggest images in pixels. If you do not want them to be resized, enter 0.", "Bitte tragen Sie die gewünschte Seitenlänge der Autovervollständigungs-Bilder in Pixeln ein. Wenn die Bilder in Originalgröße abgelegt werden sollen, tragen Sie 0 ein."
|
46 |
-
"Primary Channel", "Primärer Channel"
|
47 |
-
"Product ID (default)", "Produkt-ID (Standard)"
|
48 |
-
"Product Identifier", "Produkt-Identifizierung"
|
49 |
-
"Product SKU", "Produkt-SKU (Artikelnummer)"
|
50 |
-
"Products", "Produkte"
|
51 |
-
"Redirect to product details page for single results", "Bei eindeutigem Resultat auf Produkt-Detailseite weiterleiten"
|
52 |
-
"Secondary Result", "Sekundäre Ergebnisse"
|
53 |
-
"Search", "Suche"
|
54 |
-
"Search entire shop here...", "Den gesamten Shop durchsuchen..."
|
55 |
-
"Search:", "Suche:"
|
56 |
-
"Secondary Channels", "Sekundäre Channel"
|
57 |
-
"Server Port", "Server-Port"
|
58 |
-
"Server URL", "Server-URL"
|
59 |
-
"The server name should contain only the IP address or the domain - no ""http://"" or any slashes!", "Der Servername sollte ausschließlich die IP-Adresse oder die Domain enthalten - kein ""http://"" und keine Slashes (/ oder \)!"
|
60 |
-
"simple", "einfach"
|
61 |
-
"Size of Suggest images", "Größe der Autovervollständigungs-Bilder"
|
62 |
-
"Type of Suggest images", "Typ der Autovervollständigungs-Bilder"
|
63 |
-
"Some text strings come directly from FACT-Finder. Enter the language code here. Leave empty to use the language specified by the user's browser.", "Einige Texte kommen direkt von FACT-Finder. Mit dem Sprach-Code in diesem Feld können Sie die Sprache festlegen. Bei leerem Wert erhält der Benutzer Labels in seiner angegebenen Browser-Sprache."
|
64 |
-
"The advanced authentication post- and prefix are only used when the authentication type is ""advanced"".", "Die Werte der Prä- und Suffixes werden ausschließlich bei fortgeschrittener Authentifizierung verwendet."
|
65 |
-
"The configuration has been saved.", "Die Konfigurationsdaten wurden gespeichert."
|
66 |
-
"The configured FACT-Finder version is higher than the actual version of your FACT-Finder. Consider upgrading your FACT-Finder, or reduce the configured version to ", "Die eingestellte FACT-Finder-Version ist höher als die tatsächliche Version Ihres FACT-Finders. Überlegen Sie Ihren FACT-Finder zu erneuern, oder reduzieren Sie die eingestellte Version auf "
|
67 |
-
"The value for ""port"" must be an integer!", "Der Wert für den Server-Port muss numerisch sein!"
|
68 |
-
"The value for ""port"" must be an integer greater or equals 80!", "Der Wert für den Server-Port muss größer oder gleich 80 sein!"
|
69 |
-
"An unknown error has occurred. Please contact FACT-Finder Support.", "Unbekannter Fehler aufgetreten. Bitte kontaktieren Sie Ihren FACT-Finder-Support."
|
70 |
-
"There is a Class Rewrite Conflict: ""%s"" already overwritten by ""%s""", "Es besteht ein Klassen-Rewrite-Konflikt: ""%s"" wurde bereits durch ""%s"" überschrieben!"
|
71 |
-
"There is a problem with FACT-Finder. Please contact FACT-Finder Support.", "Es besteht ein Problem mit FACT-Finder. Bitte kontaktieren Sie Ihren FACT-Finder-Support."
|
72 |
-
"A user name must be provided if a password is to be used.", "Sie müssen einen Benutzernamen verwenden."
|
73 |
-
"This option must be enabled if secondary channels are to be considered for Suggest results.", "Diese Option muss aktiviert sein, damit sekundäre Channels in der Autovervollständigung berücksichtigt werden."
|
74 |
-
"Track ""Add to cart"" events", "Warenkorb-Events tracken"
|
75 |
-
"Track checkout", "Verkaufte Produkte tracken"
|
76 |
-
"Track product-clicks", "Produkt-Klicks tracken"
|
77 |
-
"Use FACT-Finder After Search Navigation Functionality", "FACT-Finders After Search Navigation einsetzen"
|
78 |
-
"Use FACT-Finder Campaign Functionality", "FACT-Finder-Kampagnen einsetzen"
|
79 |
-
"Use FACT-Finder for Layered Navigation", "FACT-Finder für Layered Navigation einsetzen"
|
80 |
-
"Use FACT-Finder for product cross-selling", "FACT-Finder für Cross-Sells einsetzen"
|
81 |
-
"Use FACT-Finder for product upselling", "FACT-Finder für Upsells einsetzen"
|
82 |
-
"Use FACT-Finder for tag cloud computation", "FACT-Finder für die Berechnung der TagCloud verwenden"
|
83 |
-
"Use FACT-Finder Search", "FACT-Finder-Suche nutzen"
|
84 |
-
"Use FACT-Finder Suggest Functionality", "FACT-Finder für Autovervollständigung verwenden"
|
85 |
-
"Use Fallback", "Fallback verwenden"
|
86 |
-
"Use Proxy for Suggest", "Proxy für Autovervollständigung nutzen"
|
87 |
-
"User name", "Benutzername"
|
88 |
-
"User name for authentication", "Benutzername für Authentifizierung"
|
89 |
-
"Yes", "Ja"
|
90 |
-
"Your server's clock does not agree with FACT-Finder's. Please make sure your clock is set correctly.", "Ihre Serverzeit stimmt nicht mit der von FACT-Finder überein. Bitte stellen Sie sicher, dass Ihre Serverzeit korrekt eingestellt ist."
|
91 |
-
"Search Request Cache","Suchanfragen Cache"
|
1 |
+
"advanced", "fortgeschritten"
|
2 |
+
"Advanced Authentication Postfix", "Suffix für fortgeschrittene Authentifizierung"
|
3 |
+
"Advanced Authentication Prefix", "Präfix für fortgeschrittene Authentifizierung"
|
4 |
+
"After three failed attempts, the module can revert to using Magento for searches. After the specified amount of time has passed, the module will try to contact FACT-Finder again. If you enter 0, the module will first attempt to contact FACT-Finder for every search.", "Nach drei fehlgeschlagenen Versuchen, kann das Modul dauerhaft Magentos Suche benutzen. Nachdem die hier eingegebene Zeit verstrichen ist, versucht das Modul dann erneut FACT-Finder zu verwenden. Wenn Sie 0 eingeben, wird das Modul für alle Suchanfragen zunächst versuchen FACT-Finder zu erreichen."
|
5 |
+
"Another export is already running. Please wait for it to finish before you start a new export.", "Ein anderer Export wurde bereits gestartet. Bitte warten Sie auf dessen Fertigstellung, bevor Sie ein neuen Export beginnen."
|
6 |
+
"If you receive this message after another export has failed, please delete the file ""export.lock"" within your Magento directory.", "Wenn Sie diese Meldung sehen, nachdem ein anderer Export abgebrochen wurde, löschen Sie bitte die Datei ""export.lock"" aus Ihrem Magento-Verzeichnis."
|
7 |
+
"Authentication Type", "Authentifizierungstyp"
|
8 |
+
"Catalog", "Katalog"
|
9 |
+
"Channel", "Channel"
|
10 |
+
"Channel does not exist or the specified user does not have sufficient rights.", "Channel existiert nicht oder der verwendete User hat nicht die benötigten Rechte."
|
11 |
+
"Channel: dev-content", "Inhalte"
|
12 |
+
"Please select the version of your FACT-Finder application to enable all of its features.", "Wählen Sie die Version Ihrer FACT-Finder-Applikation um alle Funktionen nutzen zu können."
|
13 |
+
"Context Name", "Kontext-Name"
|
14 |
+
"Could not establish HTTP connection.", "HTTP-Verbindung konnte nicht hergestellt werden."
|
15 |
+
"Could not log into FACT-Finder with the given settings. Please check username, password, prefix and postfix.", "FACT-Finder-Login mit gegebenen Einstellungen nicht möglich. Bitte überprüfen Sie Benutzernamen, Passwort, Präfix und Suffix."
|
16 |
+
"Could not contact FACT-Finder.", "FACT-Finder konnte nicht erreicht werden."
|
17 |
+
"Debug Log", "Debug Log"
|
18 |
+
"Download export", "Export herunterladen"
|
19 |
+
"Enabled", "Aktiviert"
|
20 |
+
"Enter your internal IP addresses. Multiple IP addresses should be separated by semicolons.", "Geben Sie hier Ihre internen IP-Adressen ein. Mehrere IP-Adressen werden mit Semikolon getrennt."
|
21 |
+
"Enter any secondary channels you want to search. Multiple channels should be separated by semicolons. NOTE: Secondary channels will only be considered for Suggest results if the proxy is used (see option in section ""FACT-Finder Config Data"")!", "Geben Sie hier weitere Channels an, die Sie durchsuchen wollen. Mehrere Channels werden mit Semikolon getrennt. Hinweis: Damit sekundäre Channels in der Autovervollständigung berücksichtigt werden, muss der Proxy verwendet werden (siehe Option im Abschnitt ""FACT-Finder Konfigurationsdaten"")!"
|
22 |
+
"Error in Channel", "Fehler in Channel"
|
23 |
+
"Error in Primary Channel", "Fehler im primären Channel"
|
24 |
+
"Export Images and Deeplinks", "Bilder und Deeplinks exportieren"
|
25 |
+
"FACT-Finder", "FACT-Finder"
|
26 |
+
"FACT-Finder Access Data", "FACT-Finder: Zugangsdaten"
|
27 |
+
"FACT-Finder Business User Cockpit", "FACT-Finder Business User Cockpit"
|
28 |
+
"FACT-Finder can provide multiple search indexes, each represented by a ""channel"". Enter the channel that will be filled with your Magento export. Leave empty to use the default channel.", "FACT-Finder kann mehrere Such-Indizes zur Verfügung stellen. Jeder Index wird durch einen ""Channel"" dargestellt. Tragen Sie den Channel ein, der mit Ihrem Magento-Export gefüllt wird. Wenn kein Wert angegeben ist, wird der Standard-Channel genutzt."
|
29 |
+
"FACT-Finder cannot be activated:", "FACT-Finder konnte nicht aktiviert werden:"
|
30 |
+
"FACT-Finder Config Data", "FACT-Finder-Konfigurationsdaten"
|
31 |
+
"FACT-Finder Export Configuration", "FACT-Finder: Export-Konfiguration"
|
32 |
+
"FACT-Finder Fallback Configuration", "FACT-Finder: Fallback-Konfiguration"
|
33 |
+
"FACT-Finder Module Activation", "FACT-Finder: Modul-Auswahl"
|
34 |
+
"FACT-Finder not found on server. Please check your context setting.", "FACT-Finder konnte auf dem Server nicht gefunden werden. Bitte überprüfen Sie Ihre Kontexteinstellung."
|
35 |
+
"FACT-Finder Status", "FACT-Finder Status"
|
36 |
+
"FACT-Finder version", "FACT-Finder-Version"
|
37 |
+
"http", "http"
|
38 |
+
"If activated and FACT-Finder cannot be contacted, Magento's built-in search will be used instead.", "Wenn diese Option aktiviert ist und FACT-Finder nicht erreicht werden kann, wird stattdessen Magentos eingebaute Suche verwendet."
|
39 |
+
"Internal IPs", "Interne IPs"
|
40 |
+
"Language", "Sprache"
|
41 |
+
"Minutes before next attempt", "Minuten bis zum erneuten Versuch"
|
42 |
+
"Name of the FACT-Finder application", "Name der FACT-Finder-Applikation"
|
43 |
+
"No", "Nein"
|
44 |
+
"Password", "Passwort"
|
45 |
+
"Please enter the desired edge length of the Suggest images in pixels. If you do not want them to be resized, enter 0.", "Bitte tragen Sie die gewünschte Seitenlänge der Autovervollständigungs-Bilder in Pixeln ein. Wenn die Bilder in Originalgröße abgelegt werden sollen, tragen Sie 0 ein."
|
46 |
+
"Primary Channel", "Primärer Channel"
|
47 |
+
"Product ID (default)", "Produkt-ID (Standard)"
|
48 |
+
"Product Identifier", "Produkt-Identifizierung"
|
49 |
+
"Product SKU", "Produkt-SKU (Artikelnummer)"
|
50 |
+
"Products", "Produkte"
|
51 |
+
"Redirect to product details page for single results", "Bei eindeutigem Resultat auf Produkt-Detailseite weiterleiten"
|
52 |
+
"Secondary Result", "Sekundäre Ergebnisse"
|
53 |
+
"Search", "Suche"
|
54 |
+
"Search entire shop here...", "Den gesamten Shop durchsuchen..."
|
55 |
+
"Search:", "Suche:"
|
56 |
+
"Secondary Channels", "Sekundäre Channel"
|
57 |
+
"Server Port", "Server-Port"
|
58 |
+
"Server URL", "Server-URL"
|
59 |
+
"The server name should contain only the IP address or the domain - no ""http://"" or any slashes!", "Der Servername sollte ausschließlich die IP-Adresse oder die Domain enthalten - kein ""http://"" und keine Slashes (/ oder \)!"
|
60 |
+
"simple", "einfach"
|
61 |
+
"Size of Suggest images", "Größe der Autovervollständigungs-Bilder"
|
62 |
+
"Type of Suggest images", "Typ der Autovervollständigungs-Bilder"
|
63 |
+
"Some text strings come directly from FACT-Finder. Enter the language code here. Leave empty to use the language specified by the user's browser.", "Einige Texte kommen direkt von FACT-Finder. Mit dem Sprach-Code in diesem Feld können Sie die Sprache festlegen. Bei leerem Wert erhält der Benutzer Labels in seiner angegebenen Browser-Sprache."
|
64 |
+
"The advanced authentication post- and prefix are only used when the authentication type is ""advanced"".", "Die Werte der Prä- und Suffixes werden ausschließlich bei fortgeschrittener Authentifizierung verwendet."
|
65 |
+
"The configuration has been saved.", "Die Konfigurationsdaten wurden gespeichert."
|
66 |
+
"The configured FACT-Finder version is higher than the actual version of your FACT-Finder. Consider upgrading your FACT-Finder, or reduce the configured version to ", "Die eingestellte FACT-Finder-Version ist höher als die tatsächliche Version Ihres FACT-Finders. Überlegen Sie Ihren FACT-Finder zu erneuern, oder reduzieren Sie die eingestellte Version auf "
|
67 |
+
"The value for ""port"" must be an integer!", "Der Wert für den Server-Port muss numerisch sein!"
|
68 |
+
"The value for ""port"" must be an integer greater or equals 80!", "Der Wert für den Server-Port muss größer oder gleich 80 sein!"
|
69 |
+
"An unknown error has occurred. Please contact FACT-Finder Support.", "Unbekannter Fehler aufgetreten. Bitte kontaktieren Sie Ihren FACT-Finder-Support."
|
70 |
+
"There is a Class Rewrite Conflict: ""%s"" already overwritten by ""%s""", "Es besteht ein Klassen-Rewrite-Konflikt: ""%s"" wurde bereits durch ""%s"" überschrieben!"
|
71 |
+
"There is a problem with FACT-Finder. Please contact FACT-Finder Support.", "Es besteht ein Problem mit FACT-Finder. Bitte kontaktieren Sie Ihren FACT-Finder-Support."
|
72 |
+
"A user name must be provided if a password is to be used.", "Sie müssen einen Benutzernamen verwenden."
|
73 |
+
"This option must be enabled if secondary channels are to be considered for Suggest results.", "Diese Option muss aktiviert sein, damit sekundäre Channels in der Autovervollständigung berücksichtigt werden."
|
74 |
+
"Track ""Add to cart"" events", "Warenkorb-Events tracken"
|
75 |
+
"Track checkout", "Verkaufte Produkte tracken"
|
76 |
+
"Track product-clicks", "Produkt-Klicks tracken"
|
77 |
+
"Use FACT-Finder After Search Navigation Functionality", "FACT-Finders After Search Navigation einsetzen"
|
78 |
+
"Use FACT-Finder Campaign Functionality", "FACT-Finder-Kampagnen einsetzen"
|
79 |
+
"Use FACT-Finder for Layered Navigation", "FACT-Finder für Layered Navigation einsetzen"
|
80 |
+
"Use FACT-Finder for product cross-selling", "FACT-Finder für Cross-Sells einsetzen"
|
81 |
+
"Use FACT-Finder for product upselling", "FACT-Finder für Upsells einsetzen"
|
82 |
+
"Use FACT-Finder for tag cloud computation", "FACT-Finder für die Berechnung der TagCloud verwenden"
|
83 |
+
"Use FACT-Finder Search", "FACT-Finder-Suche nutzen"
|
84 |
+
"Use FACT-Finder Suggest Functionality", "FACT-Finder für Autovervollständigung verwenden"
|
85 |
+
"Use Fallback", "Fallback verwenden"
|
86 |
+
"Use Proxy for Suggest", "Proxy für Autovervollständigung nutzen"
|
87 |
+
"User name", "Benutzername"
|
88 |
+
"User name for authentication", "Benutzername für Authentifizierung"
|
89 |
+
"Yes", "Ja"
|
90 |
+
"Your server's clock does not agree with FACT-Finder's. Please make sure your clock is set correctly.", "Ihre Serverzeit stimmt nicht mit der von FACT-Finder überein. Bitte stellen Sie sicher, dass Ihre Serverzeit korrekt eingestellt ist."
|
91 |
+
"Search Request Cache","Suchanfragen Cache"
|
@@ -1,86 +1,86 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* FACT-Finder PHP Framework
|
4 |
-
*
|
5 |
-
* @category Library
|
6 |
-
* @package FACTFinder\Xml65
|
7 |
-
* @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* import adapter using the xml interface
|
12 |
-
*
|
13 |
-
* @author Rudolf Batt <rb@omikron.net>
|
14 |
-
* @version $Id: TagCloudAdapter.php 25893 2010-06-29 08:19:43Z rb $
|
15 |
-
* @package FACTFinder\Xml65
|
16 |
-
*/
|
17 |
-
class FACTFinder_Xml65_ImportAdapter extends FACTFinder_Default_ImportAdapter
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* @return void
|
21 |
-
**/
|
22 |
-
public function init()
|
23 |
-
{
|
24 |
-
$this->log->info("Initializing new import adapter.");
|
25 |
-
$this->getDataProvider()->setParam('format', 'xml');
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* try to parse data as xml
|
30 |
-
*
|
31 |
-
* @throws Exception of data is no valid XML
|
32 |
-
* @return SimpleXMLElement
|
33 |
-
*/
|
34 |
-
protected function getData()
|
35 |
-
{
|
36 |
-
FACTFinder_Http_ParallelDataProvider::loadAllData();
|
37 |
-
|
38 |
-
libxml_use_internal_errors(true);
|
39 |
-
return new SimpleXMLElement(parent::getData()); //throws exception on error
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* @param bool $download import files will also be updated if true
|
44 |
-
* @param string $type determines which import will be triggered. can be 'data', 'suggest' or 'recommendation'
|
45 |
-
* @return object $report import report in xml format
|
46 |
-
*/
|
47 |
-
protected function triggerImport($download, $type = 'data')
|
48 |
-
{
|
49 |
-
$this->getDataProvider()->setCurlOptions(array(
|
50 |
-
CURLOPT_CONNECTTIMEOUT => $this->getDataProvider()->getConfig()->getImportConnectTimeout(),
|
51 |
-
CURLOPT_TIMEOUT => $this->getDataProvider()->getConfig()->getImportTimeout()
|
52 |
-
));
|
53 |
-
|
54 |
-
$this->getDataProvider()->setParam('download', $download ? 'true' : 'false');
|
55 |
-
switch($type)
|
56 |
-
{
|
57 |
-
case 'suggest':
|
58 |
-
$this->getDataProvider()->setType('Import.ff');
|
59 |
-
$this->getDataProvider()->setParam('type', 'suggest');
|
60 |
-
break;
|
61 |
-
case 'recommendation':
|
62 |
-
$this->getDataProvider()->setType('Recommender.ff');
|
63 |
-
$this->getDataProvider()->setParam('do', 'importData');
|
64 |
-
break;
|
65 |
-
case 'data':
|
66 |
-
default:
|
67 |
-
$this->getDataProvider()->setType('Import.ff');
|
68 |
-
break;
|
69 |
-
}
|
70 |
-
|
71 |
-
$report = $this->getData();
|
72 |
-
|
73 |
-
// clean up for next import
|
74 |
-
switch($type)
|
75 |
-
{
|
76 |
-
case 'suggest':
|
77 |
-
$this->getDataProvider()->unsetParam('type');
|
78 |
-
break;
|
79 |
-
case 'recommendation':
|
80 |
-
$this->getDataProvider()->unsetParam('do');
|
81 |
-
break;
|
82 |
-
}
|
83 |
-
|
84 |
-
return $report;
|
85 |
-
}
|
86 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FACT-Finder PHP Framework
|
4 |
+
*
|
5 |
+
* @category Library
|
6 |
+
* @package FACTFinder\Xml65
|
7 |
+
* @copyright Copyright (c) 2012 Omikron Data Quality GmbH (www.omikron.net)
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* import adapter using the xml interface
|
12 |
+
*
|
13 |
+
* @author Rudolf Batt <rb@omikron.net>
|
14 |
+
* @version $Id: TagCloudAdapter.php 25893 2010-06-29 08:19:43Z rb $
|
15 |
+
* @package FACTFinder\Xml65
|
16 |
+
*/
|
17 |
+
class FACTFinder_Xml65_ImportAdapter extends FACTFinder_Default_ImportAdapter
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* @return void
|
21 |
+
**/
|
22 |
+
public function init()
|
23 |
+
{
|
24 |
+
$this->log->info("Initializing new import adapter.");
|
25 |
+
$this->getDataProvider()->setParam('format', 'xml');
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* try to parse data as xml
|
30 |
+
*
|
31 |
+
* @throws Exception of data is no valid XML
|
32 |
+
* @return SimpleXMLElement
|
33 |
+
*/
|
34 |
+
protected function getData()
|
35 |
+
{
|
36 |
+
FACTFinder_Http_ParallelDataProvider::loadAllData();
|
37 |
+
|
38 |
+
libxml_use_internal_errors(true);
|
39 |
+
return new SimpleXMLElement(parent::getData()); //throws exception on error
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @param bool $download import files will also be updated if true
|
44 |
+
* @param string $type determines which import will be triggered. can be 'data', 'suggest' or 'recommendation'
|
45 |
+
* @return object $report import report in xml format
|
46 |
+
*/
|
47 |
+
protected function triggerImport($download, $type = 'data')
|
48 |
+
{
|
49 |
+
$this->getDataProvider()->setCurlOptions(array(
|
50 |
+
CURLOPT_CONNECTTIMEOUT => $this->getDataProvider()->getConfig()->getImportConnectTimeout(),
|
51 |
+
CURLOPT_TIMEOUT => $this->getDataProvider()->getConfig()->getImportTimeout()
|
52 |
+
));
|
53 |
+
|
54 |
+
$this->getDataProvider()->setParam('download', $download ? 'true' : 'false');
|
55 |
+
switch($type)
|
56 |
+
{
|
57 |
+
case 'suggest':
|
58 |
+
$this->getDataProvider()->setType('Import.ff');
|
59 |
+
$this->getDataProvider()->setParam('type', 'suggest');
|
60 |
+
break;
|
61 |
+
case 'recommendation':
|
62 |
+
$this->getDataProvider()->setType('Recommender.ff');
|
63 |
+
$this->getDataProvider()->setParam('do', 'importData');
|
64 |
+
break;
|
65 |
+
case 'data':
|
66 |
+
default:
|
67 |
+
$this->getDataProvider()->setType('Import.ff');
|
68 |
+
break;
|
69 |
+
}
|
70 |
+
|
71 |
+
$report = $this->getData();
|
72 |
+
|
73 |
+
// clean up for next import
|
74 |
+
switch($type)
|
75 |
+
{
|
76 |
+
case 'suggest':
|
77 |
+
$this->getDataProvider()->unsetParam('type');
|
78 |
+
break;
|
79 |
+
case 'recommendation':
|
80 |
+
$this->getDataProvider()->unsetParam('do');
|
81 |
+
break;
|
82 |
+
}
|
83 |
+
|
84 |
+
return $report;
|
85 |
+
}
|
86 |
+
}
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Flagbit_Factfinder</name>
|
4 |
-
<version>3.5.
|
5 |
<stability>stable</stability>
|
6 |
<license/>
|
7 |
<channel>community</channel>
|
@@ -20,9 +20,9 @@ FIX: Prevent fatal errors in factfinder/search_collection closing #54
|
|
20 |
FIX: added names to the campaign blocks at the layout xml file
|
21 |
FIX: get caching working; however it won't work with php 5.2 or less!</notes>
|
22 |
<authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
|
23 |
-
<date>2014-
|
24 |
-
<time>
|
25 |
-
<contents><target name="mageetc"><dir><dir><file name="factfinder.xml" hash="ca4dac634339217dd2ee6e8dc477d694"/></dir><dir name="modules"><file name="Flagbit_FactFinder.xml" hash="99c6b4e5981ac7592830a9fb3f5e5a0e"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="5e5cb94967917aa2784d19434d02b2d4"/></dir><dir name="template"><dir name="factfinder"><file name="cockpit.phtml" hash="db2b5c21f817f1abdab3dabce26c699f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="205773215ef818caa64d7450c02ea1e8"/></dir><dir name="template"><dir name="factfinder"><file name="form.advancedsuggest.phtml" hash="d51345fde3b0cbede02f4d2ac7d43af0"/><file name="form.advancedsuggest68.phtml" hash="40f1abe8fad017cc52442bd6a4a8ef35"/><file name="form.mini.phtml" hash="eb49c2fb57594e2ebeed1ffb01c2606d"/><file name="logo.phtml" hash="7a40d67bf648e65345f69b2cf9d3c6b6"/><file name="secondaryresult.phtml" hash="a4cdff409ccedb16d4fe9a038a4dd9e8"/><file name="tracking.phtml" hash="c7b2320cc4e8e4937d9df731397bdc60"/><dir name="campaign"><file name="advisory.phtml" hash="d0ef29b97aa4c3bdfa2b94596beb5b21"/><file name="feedback.phtml" hash="a00ad977b82b199630371aef060f25ab"/><dir name="cart"><file name="advisory.phtml" hash="bb994272a6daaaba298a38023f6db212"/><file name="feedback.phtml" hash="01fa6a9cd024a2a8edaea7013b00fc89"/></dir><dir name="product"><file name="advisory.phtml" hash="00c978cf9c129c777fecf4cbbbb9d218"/><file name="feedback.phtml" hash="1bb121e2708490793190ce9f2d6ee666"/></dir></dir><dir name="filter"><file name="scriptaculousSlider.phtml" hash="e3ee4dbb6bc6e0546b4374078a9d88bc"/><file name="slider.phtml" hash="80e4e9e1c81437fe41b6a52d98e73549"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Flagbit_FactFinder.csv" hash="eacf94cdf077a77bece17ef67d09b829"/></dir></dir></target><target name="magelib"><dir><dir name="FACTFinder"><file name="AdvisorAnswer.php" hash="b6dfbe2d43660b1624ce7788bef7356a"/><file name="AdvisorQuestion.php" hash="7f3d039dc86c5baebb4702f8a66ca6d4"/><file name="Asn.php" hash="8a3753feea0901c7ace25e011be38e56"/><file name="AsnFilterItem.php" hash="cdd0bb237873b54877b4b52744250018"/><file name="AsnGroup.php" hash="e2aaefed8203667491262c6bf6f41f03"/><file name="AsnSliderFilter.php" hash="14fcd343b14d85b53d2908e04132bca4"/><file name="BreadCrumbItem.php" hash="115ffb2f30e346b29f93ce2d84be724e"/><file name="Campaign.php" hash="138f990ff2180d369bd0b441998b9cb4"/><file name="CampaignIterator.php" hash="d58f054580f0057e8471dbd8334157f1"/><file name="Configuration.php" hash="972367363e6c84fe80f2c73a1528b8aa"/><file name="Curl.php" hash="967c0b604dfdc045c9de70e9e9a44bea"/><file name="CurlHandle.php" hash="2c9dfeccd8256c16def2685e7498ae1c"/><file name="CurlInterface.php" hash="a57574dcd102ff54575cbc9131687854"/><file name="CurlStub.php" hash="01b5a07b0599ccd4b7e1b102cbdc3993"/><file name="EncodingHandler.php" hash="4f0b616bca9158bfb7eddcfcba192dc6"/><file name="Item.php" hash="b8bae7f7d296a5acca29dc3ce0c46642"/><file name="Loader.php" hash="c26cc57da777bfe7096fadbfeb6e1645"/><file name="Log4PhpLogger.php" hash="ecfb1f084b8d0bd2d51bf417fa0b0b3c"/><file name="NullLogger.php" hash="be8782000070665f0e9fcc011ae4fe77"/><file name="Paging.php" hash="4ca274beffac0c0a8cb5136b08fa8b24"/><file name="Parameters.php" hash="612c4a9b98cb8a17d0f2d30cf2641936"/><file name="ParametersParser.php" hash="9b55a42ea9195c2b40f9640ac3ba3b1a"/><file name="ProductsPerPageOptions.php" hash="1e69121e89109f31b0929706ea3dcabc"/><file name="Record.php" hash="46319caed19fbdeb5fc065ddd395b18f"/><file name="Result.php" hash="8f97f1509ee78d773aa2c5ace2830225"/><file name="SingleWordSearchItem.php" hash="8f0feac780e68a8b0eab6d44dd6c6813"/><file name="SuggestQuery.php" hash="847d637921e9bc46b9c1d3d8b03737af"/><file name="TagQuery.php" hash="ece1fda66af2c6053507941f35423c5f"/><file name="Util.php" hash="0a26a0d655c3f257b74302683a4859ba"/><dir name="Abstract"><file name="Adapter.php" hash="1c3acf21c0e5bb954973e22e52910906"/><file name="Configuration.php" hash="233565de45f56ba7bdcd604817dd7fc6"/><file name="DataProvider.php" hash="8b1dfc68d335aa006f7af9f2a60e519d"/><file name="Logger.php" hash="c5b1ace6158035e80b3d4a79a942a381"/></dir><dir name="Default"><file name="CompareAdapter.php" hash="8a8b027675e195b7be2bf5bf64666926"/><file name="ImportAdapter.php" hash="50c1a885dabcad55d4f7b6de00800701"/><file name="ProductCampaignAdapter.php" hash="049bfd0c3831114a2cd632af96aa0aaf"/><file name="RecommendationAdapter.php" hash="1858f0553c6deb21fb561cb454974a4e"/><file name="ScicAdapter.php" hash="8fd1c9e60cdb039ce4369af63d72a459"/><file name="SearchAdapter.php" hash="b0b1c7f8527e0e286b55028e305b7c86"/><file name="SimilarRecordsAdapter.php" hash="b498d3df0fc663c40fc362fd20134b43"/><file name="SuggestAdapter.php" hash="f74d7d5578131355f8e44e8b6e0734c7"/><file name="TagCloudAdapter.php" hash="c2ecc0d869d232ce4b8f09eb497e2b64"/><file name="TrackingAdapter.php" hash="9229b7d36802d1fb9584c7d6fa9ccd1e"/></dir><dir name="Http"><file name="DataProvider.php" hash="e0eb9dfa37502f71d6c76acf28d1a8c7"/><file name="DummyProvider.php" hash="fcf82a2349f5b403912b1cb62907439c"/><file name="LegacyTrackingAdapter.php" hash="5af8090c44db0d7a2f630b3afe21da3d"/><file name="ParallelDataProvider.php" hash="71f895680f881d06793507f7ac8e7ef3"/><file name="ScicAdapter.php" hash="c283d851d23e531a1c26fee3d8c49ea8"/><file name="StatusHelper.php" hash="e4760fadae33a5574f9445bbc73c1283"/><file name="SuggestAdapter.php" hash="875adeae854b52bb6a20322c2934423c"/><file name="TrackingAdapter.php" hash="9ce06d21ea64a7dd329ce12e28576488"/><file name="UrlBuilder.php" hash="99efad6cb8243ee93a5d4b61c93d8303"/></dir><dir name="Json66"><file name="CompareAdapter.php" hash="3034c100a97d222704b1462db0b97811"/><file name="ImportAdapter.php" hash="63b19c72cfcf52d9832a81080678232c"/><file name="RecommendationAdapter.php" hash="9f4fed83d6d6c10b471ef8f4810eefa5"/><file name="ScicAdapter.php" hash="f484fd9b7ed416f122bb71e75e544049"/><file name="SearchAdapter.php" hash="90f60bedc69a748e6e18d49c3243bc3d"/><file name="SimilarRecordsAdapter.php" hash="6f3565723be247381f561b60ed49d8da"/><file name="SuggestAdapter.php" hash="e06a19df2260abcd6ce46a8744ca58b0"/><file name="TagCloudAdapter.php" hash="0ef622889613de3660591ef41c08c65d"/></dir><dir name="Json67"><file name="CompareAdapter.php" hash="2324e34be1d48e42a1dafff4a6368863"/><file name="ImportAdapter.php" hash="295fa619d1a020f87e3d6772e428f4b3"/><file name="ProductCampaignAdapter.php" hash="c43222b1d277e2965e1209ff6375500c"/><file name="RecommendationAdapter.php" hash="db72e4179a831b331f53505a2ba9d01f"/><file name="ScicAdapter.php" hash="f76d589d684a68707b3ed86632d7742f"/><file name="SearchAdapter.php" hash="c69ac5f6fcfe47351ed3b601d03e18ad"/><file name="SimilarRecordsAdapter.php" hash="55f5553511f5fb965fa9b6abf5e9ba01"/><file name="SuggestAdapter.php" hash="ae47090fab5d202a22c8dbf9e604e2d1"/><file name="TagCloudAdapter.php" hash="1d7fdbd4ea8488d1bdfd0a4143a1a130"/></dir><dir name="Json68"><file name="CompareAdapter.php" hash="f3c610d6347a6671f5ee1bf716801ae2"/><file name="ImportAdapter.php" hash="c7ec5f12e1f7f17084de9d71c4d4051d"/><file name="ProductCampaignAdapter.php" hash="1ffc9f568d7ee73722765f16fdf45b07"/><file name="RecommendationAdapter.php" hash="b5082f0db80730bb866ac332d143f4a8"/><file name="ScicAdapter.php" hash="33da9351e28946900e620b011f1891bb"/><file name="SearchAdapter.php" hash="5814eb254324b96b10a35411bea6bc6c"/><file name="SimilarRecordsAdapter.php" hash="51412237e3233ccc3bfc124e3e9abee6"/><file name="SuggestAdapter.php" hash="9bfbd6a282aba70e3b1f2e1f632c113f"/><file name="TagCloudAdapter.php" hash="b632b03f8e044ebdd3a4f318c8e50c3a"/></dir><dir name="Json69"><file name="CompareAdapter.php" hash="e0ab8d442b26ca492d3986a32ea7a7a4"/><file name="ImportAdapter.php" hash="e969905c5ef9a2577eb80df12f5350c5"/><file name="ProductCampaignAdapter.php" hash="1ab5cb62aafe5f67c1f77461b89fe24d"/><file name="RecommendationAdapter.php" hash="0036cea44c296a3f9c8ac5c7458afb83"/><file name="ScicAdapter.php" hash="3e37ab5db7240aad6a7f2c3a971014c4"/><file name="SearchAdapter.php" hash="bc5b9f9404017d003fb27d21b2837609"/><file name="SimilarRecordsAdapter.php" hash="aee8d4212c9e3f1b62035be5307c73f1"/><file name="SuggestAdapter.php" hash="fce98d2451db47e4608e6f252f3759ff"/><file name="TagCloudAdapter.php" hash="e1b77df045382804e6ddfe2a05180469"/></dir><dir name="Xml64"><file name="SearchAdapter.php" hash="58a49882c741216cf278c4556ea7d224"/></dir><dir name="Xml65"><file name="ImportAdapter.php" hash="3e24dbe7875252ebc0ddb3e932da3d4a"/><file name="RecommendationAdapter.php" hash="dda97f6db1ae97c5a217632067d7c101"/><file name="ScicAdapter.php" hash="23b169cdb295245a52b96234e10627fa"/><file name="SearchAdapter.php" hash="0afda4c378e041c882739a0035382125"/><file name="SuggestAdapter.php" hash="e5381502b74dd62be1a7aa833cbb03e2"/><file name="TagCloudAdapter.php" hash="3bca14558fbd758207e97566dafb1ca2"/></dir><dir name="Xml66"><file name="CompareAdapter.php" hash="a1e323dec8fbee2930d531765adef0cc"/><file name="ImportAdapter.php" hash="5ea0d06cc2ddc7a1b7c880203c38fe40"/><file name="RecommendationAdapter.php" hash="9490ea2b17fded94d087046065596b1b"/><file name="ScicAdapter.php" hash="3d1fbfeb016b5cbca426835da7abe472"/><file name="SearchAdapter.php" hash="aba7b0e052a28c93bad70786706e2475"/><file name="SimilarRecordsAdapter.php" hash="f6c70898407d65c5b315a9ec5ebba166"/><file name="SuggestAdapter.php" hash="813bfb64ac9d2dc45443cc7c33e854a7"/><file name="TagCloudAdapter.php" hash="a44dd623910bbb6766a0b0c25584212c"/></dir><dir name="Xml67"><file name="CompareAdapter.php" hash="37980ec507fd7f13e81ece413915da2d"/><file name="ImportAdapter.php" hash="dc0d334439aa59f3e0a4226bbf1456d2"/><file name="ProductCampaignAdapter.php" hash="794020c94d6d62c3d835f167c484f674"/><file name="RecommendationAdapter.php" hash="b991b5e2570c28530164b3cacfffa6e1"/><file name="ScicAdapter.php" hash="62b5573da44cae7fc7db15c5a4eaebb5"/><file name="SearchAdapter.php" hash="1458660092403f1c1f3c088c40b54550"/><file name="SimilarRecordsAdapter.php" hash="b60a974a22d3e473538524dc57d1e91d"/><file name="SuggestAdapter.php" hash="7290503daae4ae9e595cc5b1480ce8a1"/><file name="TagCloudAdapter.php" hash="d3efa6616331286cb221f8ca79021324"/></dir><dir name="Xml68"><file name="CompareAdapter.php" hash="0a8ebc48d90e7aaf131b66180d10ba11"/><file name="ImportAdapter.php" hash="bf483742e13d647da407f7da85828b98"/><file name="ProductCampaignAdapter.php" hash="db981749b20f69eca65d5ac1e622bafe"/><file name="RecommendationAdapter.php" hash="69e031adc81be7a88a0cffbe1b96c317"/><file name="ScicAdapter.php" hash="820e46185da76067d6fd28824aca47e1"/><file name="SearchAdapter.php" hash="5f33b2af574a27ce54da2fd200e54bf8"/><file name="SimilarRecordsAdapter.php" hash="b9c70b5c7d6d803bb1c7f1255be55285"/><file name="SuggestAdapter.php" hash="5cf5b95340983823c9e7a3fd0dc20a0b"/><file name="TagCloudAdapter.php" hash="3bfa1e877269be17ee08c403254925bf"/></dir><dir name="Xml69"><file name="CompareAdapter.php" hash="7fb11570f8ff0d4375808e2848b9a4e5"/><file name="ImportAdapter.php" hash="38ca51ae3571aa19df0552592c3ca7a1"/><file name="ProductCampaignAdapter.php" hash="b8387c660a11be69d4a549226fe398a9"/><file name="RecommendationAdapter.php" hash="2dcb3dd6cf309a5f0c2ae43fb203b26b"/><file name="ScicAdapter.php" hash="6c20f0e9fbfaf3429723dd664cb465ef"/><file name="SearchAdapter.php" hash="d40a1e847d228fa5018c47b43eb26d57"/><file name="SimilarRecordsAdapter.php" hash="ba87aaa6a786094720941117c976899d"/><file name="SuggestAdapter.php" hash="b0c54b42c01101adda15e3634b896e56"/><file name="TagCloudAdapter.php" hash="9529b709e9f1d897776d33fea96bb4df"/><file name="TrackingAdapter.php" hash="5fab2bf699274380c07988cdad48913a"/></dir></dir><dir name="FACTFinderCustom"><file name="Configuration.php" hash="8afbd5bb2669f4f34a7d577437d0e69c"/></dir><dir name="SAI"><file name="Curl.php" hash="1fb18096257151b5b47bc2964dd9fe39"/><file name="CurlInterface.php" hash="714fa045dd4546d0c92cd022efb09422"/><file name="CurlStub.php" hash="2521763ee414683aced1afd1ec12511d"/><dir name="Curl"><file name="Handle.php" hash="0fc7132737da7cee7df6b974447864ac"/></dir></dir></dir></target><target name="magecommunity"><dir><dir name="Flagbit"><dir name="FactFinder"><dir name="Block"><file name="Layer.php" hash="8cc0245865ee5760fbfe7442cf859ade"/><file name="Secondaryresult.php" hash="41ee25e0adeb033ca6e5eef2d50c0f90"/><file name="TagCloud.php" hash="6e3769771ef5a1b50fc1d9a963e90aad"/><file name="Tracking.php" hash="7ce879afb562e5a0e96132fa31ebe98d"/><dir name="Adminhtml"><file name="Cockpit.php" hash="e12c45f55d5fd31d164187bd9d16a0bd"/><file name="Exportlink.php" hash="6aa91d07c5e0094c89b2494bac9d1ed3"/><dir name="Form"><dir name="Field"><file name="Attribute.php" hash="2e60d7473163fa523f10b2d0c441fe24"/><file name="Attributes.php" hash="cbaf317aa5ce4417cfcd02a6c4f36486"/></dir></dir></dir><dir name="Campaign"><file name="Advisory.php" hash="04e35a0e8a75a7ddd4e3af385f933aa5"/><file name="Feedback.php" hash="a1e1f1d393bea196e07f92e171e10513"/><dir name="Cart"><file name="Advisory.php" hash="14791cddb1fd131f7f78928e7877fc48"/><file name="Feedback.php" hash="c5a0f657037274881f7d2846e004f164"/></dir><dir name="Product"><file name="Advisory.php" hash="bd1f468d56b6bc1fa3541406796c133a"/><file name="Feedback.php" hash="576bd4801d14f08bc1c62688ffab2e04"/></dir></dir><dir name="Cart"><file name="Crosssell.php" hash="96c00a397ef7e32cb0babfab8b109494"/></dir><dir name="Filter"><file name="Slider.php" hash="159d3e1b403625dbbb970e5e7ada4ec7"/></dir><dir name="Layer"><file name="Abstract.php" hash="f53a3e2d6ce0da4afee58b4ea806a342"/></dir><dir name="Product"><dir name="List"><file name="Crosssell.php" hash="86590a3e65ffe074950f4c630fc10826"/><file name="Upsell.php" hash="2651771f335616765f26a611486b9e25"/></dir></dir><dir name="XmlConnect"><dir name="Catalog"><file name="Search.php" hash="a5719137254795a4e9053bd801bc1f39"/><dir name="Product"><file name="List.php" hash="5c6ddfd680c0bcf597d07f02de69c4a7"/></dir><dir name="Search"><file name="Suggest.php" hash="a0fed06b80840e63f9983909847d7e58"/></dir></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="1a0ab571e3cc525b043c39c8d71c0e18"/><file name="ProxyController.php" hash="1fc770e60199e28aedabba1578f569cd"/><dir name="Adminhtml"><dir name="Factfinder"><file name="CockpitController.php" hash="4c8665feaf14c38e6ba2384db496c95a"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="1165a0fecfaa31f2aa4a882d1d8bc033"/><file name="config.xml" hash="b34ed09ca9e8817fd01beba3d0e4d9c7"/><file name="system.xml" hash="4e232a8d8e9ba653ba658b510470a20d"/></dir><dir name="Helper"><file name="Backend.php" hash="87b662c7c7242ef349f4606ad2ab5279"/><file name="Data.php" hash="d567225cfe69304e975c18b25123a58f"/><file name="Debug.php" hash="24b939b03efb2cd5f7815562f896576f"/><file name="Search.php" hash="0ec62f809330706c441c60ad96970880"/></dir><dir name="Model"><file name="Facade.php" hash="cfd1c9a0d8660457aa9455c42367f75c"/><file name="Layer.php" hash="9da16c44259b4a31d73f63d87787ff11"/><file name="Observer.php" hash="99b06cdb299cd09e4dfafc0f9ab2d541"/><file name="Processor.php" hash="dd87fcca325fc9bfb30e52f5a0c484fb"/><dir name="Export"><file name="Price.php" hash="5561605bf639385c211f339f0c752a0f"/><file name="Product.php" hash="929ffca44ce0cba1b9ab8a2c3027a665"/><file name="Stock.php" hash="28e819f8f317957a70a7d4d318e04791"/></dir><dir name="Handler"><file name="Abstract.php" hash="f5724a1c82becbc4d76a6f46dc591977"/><file name="CheckStatus.php" hash="73bf9fec9e0e97a3261b8fad292b1f96"/><file name="ProductCampaign.php" hash="831d8d3ff2cd29e090cff10c3a9c8844"/><file name="ProductDetailCampaign.php" hash="25175d7b6809c9db30e1400f4f800739"/><file name="Recommendations.php" hash="47b12e1f2f1e1d83ecaba77fdb20b63b"/><file name="Search.php" hash="cb749d336fd6e2a1dea373ff1a286d94"/><file name="SecondarySearch.php" hash="68395df0f8f61c0776a36b5079ebd720"/><file name="ShoppingCartCampaign.php" hash="202fc9ab4018247dfb8e8bcefd417465"/><file name="Suggest.php" hash="3b286cbda3cad188b10f7fac06e0ca32"/><file name="TagCloud.php" hash="e60bd2a5d314cfe3bad445ba88740878"/><file name="Tracking.php" hash="5aefdfa31865227c1a953c0f1447ab0b"/><dir name="Tracking"><file name="Scic.php" hash="2e34f18eac2125c2017970fcfca22730"/></dir></dir><dir name="Layer"><file name="Abstract.php" hash="0a0505e719ca55320da35c7510b82d3a"/><dir name="Filter"><file name="Item.php" hash="d51a705d6690e06934b81f4ed12c6f3b"/><dir name="Attribute"><file name="Abstract.php" hash="2ad710352f1803d15ba056cd93d519f1"/><file name="Catalog.php" hash="f6dce5ea64da9dfb3458ae9ff4b58a7b"/><file name="Catalogsearch.php" hash="75536576aaaa0186f166550ee746ae04"/></dir></dir></dir><dir name="Mysql4"><dir name="Campaign"><dir name="Pushedproducts"><file name="Collection.php" hash="c657b421e0137bf842ec78c26718363f"/></dir></dir><dir name="Product"><dir name="Attribute"><file name="Collection.php" hash="a5b47ca867be314d2d0edf1621608d8b"/></dir><dir name="Recommendation"><file name="Collection.php" hash="fdb6f35fa1cca09aa405bc5cd0c68601"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="a1521000a1a10df8e6b580f33d06cf23"/><dir name="Queue"><file name="Collection.php" hash="5f6b0b6a50838929065ebd941cedce42"/></dir></dir><dir name="Search"><file name="Collection.php" hash="efe031e2f8701d1fa4f0059238144aad"/><file name="Engine.php" hash="88a56eb3b4587d87bb1152476b64036e"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="828d391339a22c15ad74ae1a2e784b41"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Attributes.php" hash="8259883090dc4bca9b858d047983e736"/><file name="Enabled.php" hash="3b4d1f4b37d7ddba9768a7da6e3fc778"/></dir><dir name="Source"><file name="Authtype.php" hash="5bc0b1c745782cc51d44d56299059bcb"/><file name="Ffversion.php" hash="7cd3f4ed651c206e7684b2c5b7c2e788"/><file name="Identifier.php" hash="cec45238f0e28a1bf66d10dee513c2ca"/><file name="Imagetype.php" hash="9f0fc4aaaf6343163a4a2e3b42aaa41c"/></dir></dir></dir></dir><dir name="sql"><dir name="factfinder_setup"><file name="mysql4-install-3.2.0.php" hash="1342320595048cd96659c454381cfbb4"/><file name="mysql4-upgrade-3.2.0-3.2.1.php" hash="3d5276dfe971a6bd48aa8e2a085de004"/><file name="mysql4-upgrade-3.2.1-3.3.0.php" hash="71954ea0cf400950d23b020ff095a9ee"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="factfinder.css" hash="16766d07b20544e11184ee21f95b2692"/></dir></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><dir name="factfinder"><file name="jXHR.js" hash="0473a3ea88f08797737814c7ffbeba18"/><file name="suggest.js" hash="b45f28b377c73463527d9aa44e37589b"/><file name="tracking.js" hash="d0c9a7839c7066eec168950c37b0faf2"/></dir></dir></dir></target></contents>
|
26 |
<compatible/>
|
27 |
<dependencies/>
|
28 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Flagbit_Factfinder</name>
|
4 |
+
<version>3.5.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license/>
|
7 |
<channel>community</channel>
|
20 |
FIX: added names to the campaign blocks at the layout xml file
|
21 |
FIX: get caching working; however it won't work with php 5.2 or less!</notes>
|
22 |
<authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
|
23 |
+
<date>2014-09-25</date>
|
24 |
+
<time>09:42:43</time>
|
25 |
+
<contents><target name="mageetc"><dir><dir><file name="factfinder.xml" hash="ca4dac634339217dd2ee6e8dc477d694"/></dir><dir name="modules"><file name="Flagbit_FactFinder.xml" hash="99c6b4e5981ac7592830a9fb3f5e5a0e"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="5e5cb94967917aa2784d19434d02b2d4"/></dir><dir name="template"><dir name="factfinder"><file name="cockpit.phtml" hash="db2b5c21f817f1abdab3dabce26c699f"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="factfinder.xml" hash="205773215ef818caa64d7450c02ea1e8"/></dir><dir name="template"><dir name="factfinder"><file name="form.advancedsuggest.phtml" hash="d51345fde3b0cbede02f4d2ac7d43af0"/><file name="form.advancedsuggest68.phtml" hash="40f1abe8fad017cc52442bd6a4a8ef35"/><file name="form.mini.phtml" hash="eb49c2fb57594e2ebeed1ffb01c2606d"/><file name="logo.phtml" hash="7a40d67bf648e65345f69b2cf9d3c6b6"/><file name="secondaryresult.phtml" hash="a4cdff409ccedb16d4fe9a038a4dd9e8"/><file name="tracking.phtml" hash="c7b2320cc4e8e4937d9df731397bdc60"/><dir name="campaign"><file name="advisory.phtml" hash="d0ef29b97aa4c3bdfa2b94596beb5b21"/><file name="feedback.phtml" hash="a00ad977b82b199630371aef060f25ab"/><dir name="cart"><file name="advisory.phtml" hash="bb994272a6daaaba298a38023f6db212"/><file name="feedback.phtml" hash="01fa6a9cd024a2a8edaea7013b00fc89"/></dir><dir name="product"><file name="advisory.phtml" hash="00c978cf9c129c777fecf4cbbbb9d218"/><file name="feedback.phtml" hash="1bb121e2708490793190ce9f2d6ee666"/></dir></dir><dir name="filter"><file name="scriptaculousSlider.phtml" hash="e3ee4dbb6bc6e0546b4374078a9d88bc"/><file name="slider.phtml" hash="80e4e9e1c81437fe41b6a52d98e73549"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Flagbit_FactFinder.csv" hash="e3e5a161927728f6de2c9e4c8532c779"/></dir></dir></target><target name="magelib"><dir><dir name="FACTFinder"><file name="AdvisorAnswer.php" hash="b6dfbe2d43660b1624ce7788bef7356a"/><file name="AdvisorQuestion.php" hash="7f3d039dc86c5baebb4702f8a66ca6d4"/><file name="Asn.php" hash="8a3753feea0901c7ace25e011be38e56"/><file name="AsnFilterItem.php" hash="cdd0bb237873b54877b4b52744250018"/><file name="AsnGroup.php" hash="e2aaefed8203667491262c6bf6f41f03"/><file name="AsnSliderFilter.php" hash="14fcd343b14d85b53d2908e04132bca4"/><file name="BreadCrumbItem.php" hash="115ffb2f30e346b29f93ce2d84be724e"/><file name="Campaign.php" hash="138f990ff2180d369bd0b441998b9cb4"/><file name="CampaignIterator.php" hash="d58f054580f0057e8471dbd8334157f1"/><file name="Configuration.php" hash="972367363e6c84fe80f2c73a1528b8aa"/><file name="Curl.php" hash="967c0b604dfdc045c9de70e9e9a44bea"/><file name="CurlHandle.php" hash="2c9dfeccd8256c16def2685e7498ae1c"/><file name="CurlInterface.php" hash="a57574dcd102ff54575cbc9131687854"/><file name="CurlStub.php" hash="01b5a07b0599ccd4b7e1b102cbdc3993"/><file name="EncodingHandler.php" hash="4f0b616bca9158bfb7eddcfcba192dc6"/><file name="Item.php" hash="b8bae7f7d296a5acca29dc3ce0c46642"/><file name="Loader.php" hash="c26cc57da777bfe7096fadbfeb6e1645"/><file name="Log4PhpLogger.php" hash="ecfb1f084b8d0bd2d51bf417fa0b0b3c"/><file name="NullLogger.php" hash="be8782000070665f0e9fcc011ae4fe77"/><file name="Paging.php" hash="4ca274beffac0c0a8cb5136b08fa8b24"/><file name="Parameters.php" hash="612c4a9b98cb8a17d0f2d30cf2641936"/><file name="ParametersParser.php" hash="9b55a42ea9195c2b40f9640ac3ba3b1a"/><file name="ProductsPerPageOptions.php" hash="1e69121e89109f31b0929706ea3dcabc"/><file name="Record.php" hash="46319caed19fbdeb5fc065ddd395b18f"/><file name="Result.php" hash="8f97f1509ee78d773aa2c5ace2830225"/><file name="SingleWordSearchItem.php" hash="8f0feac780e68a8b0eab6d44dd6c6813"/><file name="SuggestQuery.php" hash="847d637921e9bc46b9c1d3d8b03737af"/><file name="TagQuery.php" hash="ece1fda66af2c6053507941f35423c5f"/><file name="Util.php" hash="0a26a0d655c3f257b74302683a4859ba"/><dir name="Abstract"><file name="Adapter.php" hash="1c3acf21c0e5bb954973e22e52910906"/><file name="Configuration.php" hash="233565de45f56ba7bdcd604817dd7fc6"/><file name="DataProvider.php" hash="8b1dfc68d335aa006f7af9f2a60e519d"/><file name="Logger.php" hash="c5b1ace6158035e80b3d4a79a942a381"/></dir><dir name="Default"><file name="CompareAdapter.php" hash="8a8b027675e195b7be2bf5bf64666926"/><file name="ImportAdapter.php" hash="50c1a885dabcad55d4f7b6de00800701"/><file name="ProductCampaignAdapter.php" hash="049bfd0c3831114a2cd632af96aa0aaf"/><file name="RecommendationAdapter.php" hash="1858f0553c6deb21fb561cb454974a4e"/><file name="ScicAdapter.php" hash="8fd1c9e60cdb039ce4369af63d72a459"/><file name="SearchAdapter.php" hash="b0b1c7f8527e0e286b55028e305b7c86"/><file name="SimilarRecordsAdapter.php" hash="b498d3df0fc663c40fc362fd20134b43"/><file name="SuggestAdapter.php" hash="f74d7d5578131355f8e44e8b6e0734c7"/><file name="TagCloudAdapter.php" hash="c2ecc0d869d232ce4b8f09eb497e2b64"/><file name="TrackingAdapter.php" hash="9229b7d36802d1fb9584c7d6fa9ccd1e"/></dir><dir name="Http"><file name="DataProvider.php" hash="e0eb9dfa37502f71d6c76acf28d1a8c7"/><file name="DummyProvider.php" hash="fcf82a2349f5b403912b1cb62907439c"/><file name="LegacyTrackingAdapter.php" hash="5af8090c44db0d7a2f630b3afe21da3d"/><file name="ParallelDataProvider.php" hash="71f895680f881d06793507f7ac8e7ef3"/><file name="ScicAdapter.php" hash="c283d851d23e531a1c26fee3d8c49ea8"/><file name="StatusHelper.php" hash="e4760fadae33a5574f9445bbc73c1283"/><file name="SuggestAdapter.php" hash="875adeae854b52bb6a20322c2934423c"/><file name="TrackingAdapter.php" hash="9ce06d21ea64a7dd329ce12e28576488"/><file name="UrlBuilder.php" hash="99efad6cb8243ee93a5d4b61c93d8303"/></dir><dir name="Json66"><file name="CompareAdapter.php" hash="3034c100a97d222704b1462db0b97811"/><file name="ImportAdapter.php" hash="63b19c72cfcf52d9832a81080678232c"/><file name="RecommendationAdapter.php" hash="9f4fed83d6d6c10b471ef8f4810eefa5"/><file name="ScicAdapter.php" hash="f484fd9b7ed416f122bb71e75e544049"/><file name="SearchAdapter.php" hash="90f60bedc69a748e6e18d49c3243bc3d"/><file name="SimilarRecordsAdapter.php" hash="6f3565723be247381f561b60ed49d8da"/><file name="SuggestAdapter.php" hash="e06a19df2260abcd6ce46a8744ca58b0"/><file name="TagCloudAdapter.php" hash="0ef622889613de3660591ef41c08c65d"/></dir><dir name="Json67"><file name="CompareAdapter.php" hash="2324e34be1d48e42a1dafff4a6368863"/><file name="ImportAdapter.php" hash="295fa619d1a020f87e3d6772e428f4b3"/><file name="ProductCampaignAdapter.php" hash="c43222b1d277e2965e1209ff6375500c"/><file name="RecommendationAdapter.php" hash="db72e4179a831b331f53505a2ba9d01f"/><file name="ScicAdapter.php" hash="f76d589d684a68707b3ed86632d7742f"/><file name="SearchAdapter.php" hash="c69ac5f6fcfe47351ed3b601d03e18ad"/><file name="SimilarRecordsAdapter.php" hash="55f5553511f5fb965fa9b6abf5e9ba01"/><file name="SuggestAdapter.php" hash="ae47090fab5d202a22c8dbf9e604e2d1"/><file name="TagCloudAdapter.php" hash="1d7fdbd4ea8488d1bdfd0a4143a1a130"/></dir><dir name="Json68"><file name="CompareAdapter.php" hash="f3c610d6347a6671f5ee1bf716801ae2"/><file name="ImportAdapter.php" hash="c7ec5f12e1f7f17084de9d71c4d4051d"/><file name="ProductCampaignAdapter.php" hash="1ffc9f568d7ee73722765f16fdf45b07"/><file name="RecommendationAdapter.php" hash="b5082f0db80730bb866ac332d143f4a8"/><file name="ScicAdapter.php" hash="33da9351e28946900e620b011f1891bb"/><file name="SearchAdapter.php" hash="5814eb254324b96b10a35411bea6bc6c"/><file name="SimilarRecordsAdapter.php" hash="51412237e3233ccc3bfc124e3e9abee6"/><file name="SuggestAdapter.php" hash="9bfbd6a282aba70e3b1f2e1f632c113f"/><file name="TagCloudAdapter.php" hash="b632b03f8e044ebdd3a4f318c8e50c3a"/></dir><dir name="Json69"><file name="CompareAdapter.php" hash="e0ab8d442b26ca492d3986a32ea7a7a4"/><file name="ImportAdapter.php" hash="e969905c5ef9a2577eb80df12f5350c5"/><file name="ProductCampaignAdapter.php" hash="1ab5cb62aafe5f67c1f77461b89fe24d"/><file name="RecommendationAdapter.php" hash="0036cea44c296a3f9c8ac5c7458afb83"/><file name="ScicAdapter.php" hash="3e37ab5db7240aad6a7f2c3a971014c4"/><file name="SearchAdapter.php" hash="bc5b9f9404017d003fb27d21b2837609"/><file name="SimilarRecordsAdapter.php" hash="aee8d4212c9e3f1b62035be5307c73f1"/><file name="SuggestAdapter.php" hash="fce98d2451db47e4608e6f252f3759ff"/><file name="TagCloudAdapter.php" hash="e1b77df045382804e6ddfe2a05180469"/></dir><dir name="Xml64"><file name="SearchAdapter.php" hash="58a49882c741216cf278c4556ea7d224"/></dir><dir name="Xml65"><file name="ImportAdapter.php" hash="e88d4f94cbf27aa6cadccbb6f6a69098"/><file name="RecommendationAdapter.php" hash="dda97f6db1ae97c5a217632067d7c101"/><file name="ScicAdapter.php" hash="23b169cdb295245a52b96234e10627fa"/><file name="SearchAdapter.php" hash="0afda4c378e041c882739a0035382125"/><file name="SuggestAdapter.php" hash="e5381502b74dd62be1a7aa833cbb03e2"/><file name="TagCloudAdapter.php" hash="3bca14558fbd758207e97566dafb1ca2"/></dir><dir name="Xml66"><file name="CompareAdapter.php" hash="a1e323dec8fbee2930d531765adef0cc"/><file name="ImportAdapter.php" hash="5ea0d06cc2ddc7a1b7c880203c38fe40"/><file name="RecommendationAdapter.php" hash="9490ea2b17fded94d087046065596b1b"/><file name="ScicAdapter.php" hash="3d1fbfeb016b5cbca426835da7abe472"/><file name="SearchAdapter.php" hash="aba7b0e052a28c93bad70786706e2475"/><file name="SimilarRecordsAdapter.php" hash="f6c70898407d65c5b315a9ec5ebba166"/><file name="SuggestAdapter.php" hash="813bfb64ac9d2dc45443cc7c33e854a7"/><file name="TagCloudAdapter.php" hash="a44dd623910bbb6766a0b0c25584212c"/></dir><dir name="Xml67"><file name="CompareAdapter.php" hash="37980ec507fd7f13e81ece413915da2d"/><file name="ImportAdapter.php" hash="dc0d334439aa59f3e0a4226bbf1456d2"/><file name="ProductCampaignAdapter.php" hash="794020c94d6d62c3d835f167c484f674"/><file name="RecommendationAdapter.php" hash="b991b5e2570c28530164b3cacfffa6e1"/><file name="ScicAdapter.php" hash="62b5573da44cae7fc7db15c5a4eaebb5"/><file name="SearchAdapter.php" hash="1458660092403f1c1f3c088c40b54550"/><file name="SimilarRecordsAdapter.php" hash="b60a974a22d3e473538524dc57d1e91d"/><file name="SuggestAdapter.php" hash="7290503daae4ae9e595cc5b1480ce8a1"/><file name="TagCloudAdapter.php" hash="d3efa6616331286cb221f8ca79021324"/></dir><dir name="Xml68"><file name="CompareAdapter.php" hash="0a8ebc48d90e7aaf131b66180d10ba11"/><file name="ImportAdapter.php" hash="bf483742e13d647da407f7da85828b98"/><file name="ProductCampaignAdapter.php" hash="db981749b20f69eca65d5ac1e622bafe"/><file name="RecommendationAdapter.php" hash="69e031adc81be7a88a0cffbe1b96c317"/><file name="ScicAdapter.php" hash="820e46185da76067d6fd28824aca47e1"/><file name="SearchAdapter.php" hash="5f33b2af574a27ce54da2fd200e54bf8"/><file name="SimilarRecordsAdapter.php" hash="b9c70b5c7d6d803bb1c7f1255be55285"/><file name="SuggestAdapter.php" hash="5cf5b95340983823c9e7a3fd0dc20a0b"/><file name="TagCloudAdapter.php" hash="3bfa1e877269be17ee08c403254925bf"/></dir><dir name="Xml69"><file name="CompareAdapter.php" hash="7fb11570f8ff0d4375808e2848b9a4e5"/><file name="ImportAdapter.php" hash="38ca51ae3571aa19df0552592c3ca7a1"/><file name="ProductCampaignAdapter.php" hash="b8387c660a11be69d4a549226fe398a9"/><file name="RecommendationAdapter.php" hash="2dcb3dd6cf309a5f0c2ae43fb203b26b"/><file name="ScicAdapter.php" hash="6c20f0e9fbfaf3429723dd664cb465ef"/><file name="SearchAdapter.php" hash="d40a1e847d228fa5018c47b43eb26d57"/><file name="SimilarRecordsAdapter.php" hash="ba87aaa6a786094720941117c976899d"/><file name="SuggestAdapter.php" hash="b0c54b42c01101adda15e3634b896e56"/><file name="TagCloudAdapter.php" hash="9529b709e9f1d897776d33fea96bb4df"/><file name="TrackingAdapter.php" hash="5fab2bf699274380c07988cdad48913a"/></dir></dir><dir name="FACTFinderCustom"><file name="Configuration.php" hash="8afbd5bb2669f4f34a7d577437d0e69c"/></dir><dir name="SAI"><file name="Curl.php" hash="1fb18096257151b5b47bc2964dd9fe39"/><file name="CurlInterface.php" hash="714fa045dd4546d0c92cd022efb09422"/><file name="CurlStub.php" hash="2521763ee414683aced1afd1ec12511d"/><dir name="Curl"><file name="Handle.php" hash="0fc7132737da7cee7df6b974447864ac"/></dir></dir></dir></target><target name="magecommunity"><dir><dir name="Flagbit"><dir name="FactFinder"><dir name="Block"><file name="Layer.php" hash="ad93ca551bcb3a33b9c172ad7410a363"/><file name="Secondaryresult.php" hash="25b4557e5a02f74cd4b2f2f7b7167005"/><file name="TagCloud.php" hash="cb3fdbbc134ac49e7043487601832a07"/><file name="Tracking.php" hash="661cbb52bd14ad74e3ba040831870e69"/><dir name="Adminhtml"><file name="Cockpit.php" hash="f9d0c4d257f0f86f62692045e4b57724"/><file name="Exportlink.php" hash="a3a50a88ae7001406def0c073033e515"/><dir name="Form"><dir name="Field"><file name="Attribute.php" hash="370d674516f4d5878c0216559937fd5a"/><file name="Attributes.php" hash="8b7e2016ceeb25f4581c3a0bb29e60e0"/></dir></dir></dir><dir name="Campaign"><file name="Advisory.php" hash="632532ceaef78238fe874a01f8b63788"/><file name="Feedback.php" hash="ffaeb2a721d41ab9b3c8e2a54aa00fdc"/><dir name="Cart"><file name="Advisory.php" hash="23575419bc4f1239d0118f40b0f9f994"/><file name="Feedback.php" hash="2a1225e9d7c5b25e0e9dd0ffe3f4df06"/></dir><dir name="Product"><file name="Advisory.php" hash="2e3dbf33928bfcdd54689bbfe72fe3f0"/><file name="Feedback.php" hash="74d7fd895cee563082bf0517427b12e3"/></dir></dir><dir name="Cart"><file name="Crosssell.php" hash="ebd4e49bbba7981b591060083da63083"/></dir><dir name="Filter"><file name="Slider.php" hash="1c70f3a6272c26aa0f93a10c54fa1e97"/></dir><dir name="Layer"><file name="Abstract.php" hash="7cfe81385205516291d11659f421c2d8"/></dir><dir name="Product"><dir name="List"><file name="Crosssell.php" hash="f8b96ec1dfb9b460597a24ec58c675a8"/><file name="Upsell.php" hash="d4c633951a0b4723e19e92cf38d11b66"/></dir></dir><dir name="XmlConnect"><dir name="Catalog"><file name="Search.php" hash="701eadbb7f3a3231731740a712444326"/><dir name="Product"><file name="List.php" hash="7a3b96d1a76b30df09cda7141c169bd8"/></dir><dir name="Search"><file name="Suggest.php" hash="33b00e5132aa92c3a4b57c7ca9b0db3e"/></dir></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="591dd266a6ada6fc6172000abadac064"/><file name="ProxyController.php" hash="456383c6937f36081ed4e2334bb1e258"/><dir name="Adminhtml"><dir name="Factfinder"><file name="CockpitController.php" hash="44f85c4dfdddc0244a1ea0875c74c4be"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="3e7112ce14717a29fd3d63db384cf162"/><file name="config.xml" hash="156d9272328664a408b32cb3bce7ed7c"/><file name="system.xml" hash="39ac0b4aa2bec9fbd0dec8f97bc68522"/></dir><dir name="Helper"><file name="Backend.php" hash="e9c4c2989b212a503faec394d0cae28f"/><file name="Data.php" hash="5545e50433fe628b3881fd79ed00cdb5"/><file name="Debug.php" hash="e6cc073e7d25f444fd4b9f8dc64142be"/><file name="Search.php" hash="d95378f4759c19507abcf27b7e4c85ca"/></dir><dir name="Model"><file name="Facade.php" hash="d0db05dea7a050ffec227ccb7d6cf525"/><file name="Layer.php" hash="6f75e0556165d168a26be36c8082a1ff"/><file name="Observer.php" hash="fd272db10cb62ef8ab650e6184db236d"/><file name="Processor.php" hash="2a919741fe0ac1d4826f91b5316020bc"/><dir name="Export"><file name="Price.php" hash="04ac55e577fec2af1d61394df472dd1f"/><file name="Product.php" hash="316456743b4100906a09810ec975a9a6"/><file name="Stock.php" hash="50e32596c797143102c9472e87458c4e"/></dir><dir name="Handler"><file name="Abstract.php" hash="f5724a1c82becbc4d76a6f46dc591977"/><file name="CheckStatus.php" hash="73bf9fec9e0e97a3261b8fad292b1f96"/><file name="ProductCampaign.php" hash="831d8d3ff2cd29e090cff10c3a9c8844"/><file name="ProductDetailCampaign.php" hash="25175d7b6809c9db30e1400f4f800739"/><file name="Recommendations.php" hash="47b12e1f2f1e1d83ecaba77fdb20b63b"/><file name="Search.php" hash="cb749d336fd6e2a1dea373ff1a286d94"/><file name="SecondarySearch.php" hash="68395df0f8f61c0776a36b5079ebd720"/><file name="ShoppingCartCampaign.php" hash="202fc9ab4018247dfb8e8bcefd417465"/><file name="Suggest.php" hash="3b286cbda3cad188b10f7fac06e0ca32"/><file name="TagCloud.php" hash="e60bd2a5d314cfe3bad445ba88740878"/><file name="Tracking.php" hash="1eaf5a148a4ef2abcf6057785b540987"/><dir name="Tracking"><file name="Scic.php" hash="174e0685a5d91e2fd4433a91562ce3c9"/></dir></dir><dir name="Layer"><file name="Abstract.php" hash="761e3356e1259749ac3635ae05ddf6be"/><dir name="Filter"><file name="Item.php" hash="7c22a6b1908bebb866bf7dac7a783472"/><dir name="Attribute"><file name="Abstract.php" hash="92f87b0a8080ad3fd4806d5ee7ef9d5b"/><file name="Catalog.php" hash="1515061cf9b4f30661a7ddaf27f26c7f"/><file name="Catalogsearch.php" hash="be6b796fc3863ed890385a43f3f8d206"/></dir></dir></dir><dir name="Mysql4"><dir name="Campaign"><dir name="Pushedproducts"><file name="Collection.php" hash="85ccd72832a961eeb73fbbd9a8c891d1"/></dir></dir><dir name="Product"><dir name="Attribute"><file name="Collection.php" hash="f7a7d2796b1616f5aa393ae67e00faf1"/></dir><dir name="Recommendation"><file name="Collection.php" hash="0592db86de4f8520fc23e3dfae27e373"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="231d7b05bfa56b3997ebb61fb80c91ed"/><dir name="Queue"><file name="Collection.php" hash="81ab17041139640a791891dc715cbc08"/></dir></dir><dir name="Search"><file name="Collection.php" hash="b0445ad45c840a2ce55ca29ee75213af"/><file name="Engine.php" hash="4cf21f85f8864f01a5effb2a6176abc4"/></dir></dir><dir name="Scic"><file name="Queue.php" hash="a59dc0dfcb707e0e4c6be60d005b969f"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Attributes.php" hash="fcdede5656ef38b23ce7c93976409718"/><file name="Enabled.php" hash="bfa27814c3502fd75049ea4bc51b9eee"/></dir><dir name="Source"><file name="Authtype.php" hash="b2f1c9839314efc9bb632f4c6dacef46"/><file name="Ffversion.php" hash="32bcc2e44b89d4b1a3965ac7681dde67"/><file name="Identifier.php" hash="96da83c37b2b71b9c302f2997d9b01e5"/><file name="Imagetype.php" hash="918611ce306148a735577cab62344e93"/></dir></dir></dir></dir><dir name="sql"><dir name="factfinder_setup"><file name="mysql4-install-3.2.0.php" hash="279ef1d5b00f2f261504ab97a4458253"/><file name="mysql4-upgrade-3.2.0-3.2.1.php" hash="3d5276dfe971a6bd48aa8e2a085de004"/><file name="mysql4-upgrade-3.2.1-3.3.0.php" hash="71954ea0cf400950d23b020ff095a9ee"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="factfinder.css" hash="16766d07b20544e11184ee21f95b2692"/></dir></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><dir name="factfinder"><file name="jXHR.js" hash="0473a3ea88f08797737814c7ffbeba18"/><file name="suggest.js" hash="b45f28b377c73463527d9aa44e37589b"/><file name="tracking.js" hash="d0c9a7839c7066eec168950c37b0faf2"/></dir></dir></dir></target></contents>
|
26 |
<compatible/>
|
27 |
<dependencies/>
|
28 |
</package>
|