Foxyfeeds_Foxyfeeds - Version 1.0.0

Version Notes

The first version for FoxyFeeds.

Download this release

Release Info

Developer FoxyFeeds
Extension Foxyfeeds_Foxyfeeds
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (44) hide show
  1. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport.php +43 -0
  2. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport/Grid.php +87 -0
  3. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport/View.php +53 -0
  4. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport/View/Form.php +61 -0
  5. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Abstract.php +45 -0
  6. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Exportfields.php +79 -0
  7. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Replacefields.php +74 -0
  8. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Specialfields.php +55 -0
  9. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Trackingkeys.php +67 -0
  10. app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Hintlogo.php +11 -0
  11. app/code/community/Foxyfeeds/Foxyfeeds/Block/Tracking/Tracking.php +140 -0
  12. app/code/community/Foxyfeeds/Foxyfeeds/Helper/Data.php +55 -0
  13. app/code/community/Foxyfeeds/Foxyfeeds/Helper/Export.php +888 -0
  14. app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Articlenumber.php +33 -0
  15. app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Cookiemode.php +33 -0
  16. app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Exportmethod.php +34 -0
  17. app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Imagenumber.php +54 -0
  18. app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Producturlgeneration.php +40 -0
  19. app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Trackingmethod.php +34 -0
  20. app/code/community/Foxyfeeds/Foxyfeeds/Model/Feedexport/Indexer.php +150 -0
  21. app/code/community/Foxyfeeds/Foxyfeeds/Model/Observer.php +99 -0
  22. app/code/community/Foxyfeeds/Foxyfeeds/Model/Resource/Feedexport/Indexer.php +213 -0
  23. app/code/community/Foxyfeeds/Foxyfeeds/Model/Resource/Feedexport/Indexer/Collection.php +32 -0
  24. app/code/community/Foxyfeeds/Foxyfeeds/controllers/Adminhtml/Foxyfeeds/FeedexportController.php +55 -0
  25. app/code/community/Foxyfeeds/Foxyfeeds/controllers/IndexController.php +33 -0
  26. app/code/community/Foxyfeeds/Foxyfeeds/etc/adminhtml.xml +76 -0
  27. app/code/community/Foxyfeeds/Foxyfeeds/etc/config.xml +154 -0
  28. app/code/community/Foxyfeeds/Foxyfeeds/etc/system.xml +214 -0
  29. app/code/community/Foxyfeeds/Foxyfeeds/sql/foxyfeeds_setup/mysql4-install-1.0.0.php +70 -0
  30. app/design/adminhtml/base/default/layout/foxyfeeds.xml +41 -0
  31. app/design/adminhtml/base/default/template/foxyfeeds/array_dropdown.phtml +174 -0
  32. app/design/adminhtml/base/default/template/foxyfeeds/config_hint.phtml +128 -0
  33. app/design/frontend/base/default/layout/Foxyfeeds/foxyfeeds.xml +43 -0
  34. app/design/frontend/base/default/template/Foxyfeeds/clicktracking_js.phtml +26 -0
  35. app/design/frontend/base/default/template/Foxyfeeds/salestracking_js.phtml +46 -0
  36. app/design/frontend/base/default/template/Foxyfeeds/tracking_image.phtml +26 -0
  37. app/etc/modules/Foxyfeeds_Foxyfeeds.xml +31 -0
  38. app/locale/en_AU/Foxyfeeds_Foxyfeeds.csv +55 -0
  39. app/locale/en_CA/Foxyfeeds_Foxyfeeds.csv +55 -0
  40. app/locale/en_GB/Foxyfeeds_Foxyfeeds.csv +55 -0
  41. app/locale/en_IE/Foxyfeeds_Foxyfeeds.csv +55 -0
  42. app/locale/en_NZ/Foxyfeeds_Foxyfeeds.csv +55 -0
  43. app/locale/en_US/Foxyfeeds_Foxyfeeds.csv +55 -0
  44. package.xml +28 -0
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Feedexport extends Mage_Adminhtml_Block_Widget_Grid_Container
24
+ {
25
+ public function __construct()
26
+ {
27
+ $this->_blockGroup = 'foxyfeeds';
28
+ $this->_controller = 'adminhtml_feedexport';
29
+ $this->_headerText = Mage::helper('foxyfeeds')->__('FF Foxyfeeds Product Feed Export');
30
+
31
+ parent::__construct();
32
+ $this->_removeButton('add');
33
+
34
+ $helper = Mage::helper('foxyfeeds');
35
+ $this->_addButton('truncate_index_table', array(
36
+ 'label' => $helper->__('FF Truncate Index Table'),
37
+ 'onclick' => "
38
+ if(confirm('{$helper->__('FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?')}')) setLocation('{$this->getUrl('*/*/truncate')}')
39
+ ",
40
+ 'class' => 'delete'
41
+ ));
42
+ }
43
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport/Grid.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Feedexport_Grid extends Mage_Adminhtml_Block_Widget_Grid
24
+ {
25
+ public function __construct()
26
+ {
27
+ parent::__construct();
28
+ $this->setId('foxyfeeds_feed_export');
29
+ $this->setDefaultDir('product_id');
30
+ $this->setDefaultDir('ASC');
31
+ $this->setSaveParametersInSession(true);
32
+ $this->setUseAjax(false);
33
+ }
34
+
35
+ protected function _prepareCollection()
36
+ {
37
+ /** @var $storeSwitcherBlock Mage_Adminhtml_Block_Store_Switcher */
38
+ $storeSwitcherBlock = $this->getLayout()->getBlock('store_switcher');
39
+ $storeId = $storeSwitcherBlock->getStoreId();
40
+ $collection = Mage::getModel('foxyfeeds/feedexport_indexer')->getCollection()
41
+ ->addFieldToFilter('store_id', array('eq' => $storeId));
42
+
43
+ $this->setCollection($collection);
44
+ parent::_prepareCollection();
45
+
46
+ return $this;
47
+ }
48
+
49
+ protected function _prepareColumns()
50
+ {
51
+ $helper = Mage::helper('foxyfeeds');
52
+
53
+ $this->addColumn('product_id', array(
54
+ 'header' => $helper->__('FF Product ID'),
55
+ 'index' => 'product_id',
56
+ 'type' => 'text',
57
+ ));
58
+
59
+ $this->addColumn('sku', array(
60
+ 'header' => $helper->__('FF Product SKU'),
61
+ 'index' => 'sku',
62
+ 'type' => 'text',
63
+ ));
64
+
65
+ $this->addColumn('created_at', array(
66
+ 'header' => $helper->__('FF Created At'),
67
+ 'index' => 'created_at',
68
+ 'type' => 'datetime',
69
+ 'filter' => false,
70
+ ));
71
+
72
+ return parent::_prepareColumns();
73
+ }
74
+
75
+ public function getGridUrl()
76
+ {
77
+ return $this->getUrl('*/*/', array('_current' => true));
78
+ }
79
+
80
+ public function getRowUrl($row)
81
+ {
82
+ return $this->getUrl('*/*/view', array(
83
+ 'store'=>$this->getRequest()->getParam('store'),
84
+ 'product_id'=>$row->getProductId())
85
+ );
86
+ }
87
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport/View.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Feedexport_View extends Mage_Adminhtml_Block_Widget_Form_Container
24
+ {
25
+ public function __construct()
26
+ {
27
+ parent::__construct();
28
+
29
+ $this->_objectId = 'product_id';
30
+ $this->_blockGroup = 'foxyfeeds';
31
+ $this->_controller = 'adminhtml_feedexport';
32
+ $this->_mode = 'view';
33
+
34
+ $this->_removeButton('save');
35
+ $this->_removeButton('delete');
36
+ $this->_removeButton('reset');
37
+ }
38
+
39
+ public function getHeaderText()
40
+ {
41
+ $productId = $this->getRequest()->getParam('product_id');
42
+ $storeId = $this->getRequest()->getParam('store', 1);
43
+ $data = Mage::getResourceModel('foxyfeeds/feedexport_indexer')->getDataForProductIdAndStoreId($productId, $storeId);
44
+ Mage::register('ff_product_feed_data', $data);
45
+ return Mage::helper('foxyfeeds')->__('FF Showing feed export data for product %s and store %s - Created at: %s', $productId, $storeId, $data['created_at']);
46
+ }
47
+
48
+ public function getBackUrl()
49
+ {
50
+ $storeId = $this->getRequest()->getParam('store');
51
+ return $this->getUrl('*/*/', array('store' => $storeId));
52
+ }
53
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Feedexport/View/Form.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Feedexport_View_Form extends Mage_Adminhtml_Block_Widget_Form
24
+ {
25
+ protected function _prepareForm()
26
+ {
27
+ $form = new Varien_Data_Form(array(
28
+ 'id' => 'view_form',
29
+ 'action' => '',
30
+ 'method' => 'post',
31
+ ));
32
+ $form->setUseContainer(true);
33
+ $this->setForm($form);
34
+
35
+ $data = Mage::registry('ff_product_feed_data');
36
+
37
+ if(is_array($data) && isset($data['product_data'])) {
38
+ $productData = $data['product_data'];
39
+
40
+ $fieldset = $form->addFieldset('view_product_data', array(
41
+ ));
42
+
43
+ $xml = simplexml_load_string($productData);
44
+ $children = $xml->children();
45
+ $data = array();
46
+ foreach($children as $key => $value) {
47
+ $data[$key] = $value;
48
+ $fieldType = (strlen($value) > 50) ? 'textarea' : 'text';
49
+ $fieldset->addField($key, $fieldType, array(
50
+ 'label' => $key,
51
+ 'name' => $key,
52
+ 'disabled' => true,
53
+ ));
54
+ }
55
+
56
+ $form->setValues($data);
57
+ }
58
+
59
+ return parent::_prepareForm();
60
+ }
61
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Abstract.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @subpackage block_adminhtml_field
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+
24
+ abstract class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Abstract extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
26
+ /**
27
+ * Get all product attribute codes as array. Returned format:
28
+ * [0] => Array
29
+ * (
30
+ * [attribute_code] => code
31
+ * )
32
+ * @param array $excludeAttributeCodes Attribute codes used for a NOT IN filter
33
+ * @return array
34
+ */
35
+ protected function _getProductAttributeCodes(array $excludeAttributeCodes = array()) {
36
+ $query = new Zend_Db_Select(Mage::getSingleton('core/resource')->getConnection('core_read'));
37
+ $query->from(Mage::getSingleton('core/resource')->getTableName('eav_entity_type'), array('entity_type_id'))
38
+ ->where('entity_type_code = ?', 'catalog_product');
39
+ return Mage::getResourceModel('eav/entity_attribute_collection')
40
+ ->addFieldToSelect('attribute_code')
41
+ ->addFieldToFilter('entity_type_id', array('eq' => new Zend_Db_Expr('('.$query.')')))
42
+ ->addFieldToFilter('attribute_code', array('nin' => $excludeAttributeCodes))
43
+ ->getData();
44
+ }
45
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Exportfields.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage block_adminhtml_field
19
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Exportfields extends Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Abstract {
25
+
26
+ public function __construct() {
27
+ $this->addColumn('productattribute', array(
28
+ 'label' => Mage::helper('adminhtml')->__('Data field'),
29
+ 'size' => 30
30
+ ));
31
+ $this->_addAfter = false;
32
+
33
+ parent::__construct();
34
+ $this->setTemplate('foxyfeeds/array_dropdown.phtml');
35
+ }
36
+
37
+ protected function _renderCellTemplate($columnName) {
38
+ if (empty($this->_columns[$columnName])) {
39
+ throw new Exception('Wrong column name specified.');
40
+ }
41
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
42
+
43
+ if ($columnName == 'productattribute') {
44
+ $rendered = '<select name="' . $inputName . '">';
45
+
46
+ // Get attribute codes and types
47
+ $attributes = $this->_getProductAttributeCodes(array(
48
+ 'sku','price','name','description','manufacturer','color','weight', 'parent_id'
49
+ ));
50
+
51
+ $attributes[]['attribute_code'] = 'qty';
52
+ $attributes[]['attribute_code'] = 'stock_status';
53
+ $attributes[]['attribute_code'] = 'ff_color_attribute_id';
54
+ $attributes[]['attribute_code'] = 'type_id';
55
+ $attributes[]['attribute_code'] = 'parent_id';
56
+ $attributes[]['attribute_code'] = 'min_sale_qty';
57
+ $attributes[]['attribute_code'] = 'max_sale_qty';
58
+ asort($attributes);
59
+ foreach ($attributes as $attribute) {
60
+ if($attribute['attribute_code'] == 'group_price') {
61
+ $customerGroupCollection = Mage::getModel('customer/group')->getCollection();
62
+ $strGroupPrice = 'group_price';
63
+ foreach($customerGroupCollection as $group) {
64
+ $rendered .= '<option value="' . $strGroupPrice.'_'.$group->getId(). '">' . $strGroupPrice.' - '.$group->getCustomerGroupCode() . '</option>';
65
+ }
66
+ } else {
67
+ $rendered .= '<option value="' . $attribute['attribute_code'] . '">' . $attribute['attribute_code'] . '</option>';
68
+ }
69
+ }
70
+ $rendered .= '</select>';
71
+ return $rendered;
72
+ }
73
+
74
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
75
+ }
76
+
77
+ }
78
+
79
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Replacefields.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage block_adminhtml_field
19
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Replacefields extends Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Abstract {
25
+
26
+ public function __construct() {
27
+ $this->addColumn('productattribute', array(
28
+ 'label' => Mage::helper('adminhtml')->__('Data field'),
29
+ 'size' => 30
30
+ ));
31
+ $this->_addAfter = false;
32
+
33
+ parent::__construct();
34
+ $this->setTemplate('foxyfeeds/array_dropdown.phtml');
35
+ }
36
+
37
+ protected function _renderCellTemplate($columnName) {
38
+ if (empty($this->_columns[$columnName])) {
39
+ throw new Exception('Wrong column name specified.');
40
+ }
41
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
42
+
43
+ if ($columnName == 'productattribute') {
44
+ $rendered = '<select name="' . $inputName . '">';
45
+ $attributes = $this->_getProductAttributeCodes(array(
46
+ 'sku','price','name','description','manufacturer','color','weight'
47
+ ));
48
+
49
+ $attributes[]['attribute_code'] = 'qty';
50
+ $attributes[]['attribute_code'] = 'stock_status';
51
+ $attributes[]['attribute_code'] = 'ff_color_attribute_id';
52
+ $attributes[]['attribute_code'] = 'min_sale_qty';
53
+ $attributes[]['attribute_code'] = 'max_sale_qty';
54
+
55
+ $attributes[]['attribute_code'] = 'categories';
56
+ $attributes[]['attribute_code'] = 'ff_image_url';
57
+ $attributes[]['attribute_code'] = 'ff_product_url';
58
+ $attributes[]['attribute_code'] = 'ff_additional_image_1';
59
+ $attributes[]['attribute_code'] = 'ff_additional_image_2';
60
+ $attributes[]['attribute_code'] = 'ff_additional_image_3';
61
+ asort($attributes);
62
+ foreach ($attributes as $attribute) {
63
+ $rendered .= '<option value="' . $attribute['attribute_code'] . '">' . $attribute['attribute_code'] . '</option>';
64
+ }
65
+ $rendered .= '</select>';
66
+ return $rendered;
67
+ }
68
+
69
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
70
+ }
71
+
72
+ }
73
+
74
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Specialfields.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage block_adminhtml_field
19
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Specialfields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
26
+ protected $magentoAttributes;
27
+
28
+ public function __construct() {
29
+ $this->addColumn('name', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Data field name'),
31
+ 'size' => 30
32
+ ));
33
+ $this->addColumn('value', array(
34
+ 'label' => Mage::helper('adminhtml')->__('Data field value'),
35
+ 'size' => 30
36
+ ));
37
+ $this->_addAfter = false;
38
+
39
+ parent::__construct();
40
+ $this->setTemplate('foxyfeeds/array_dropdown.phtml');
41
+ }
42
+
43
+ protected function _renderCellTemplate($columnName) {
44
+ if (empty($this->_columns[$columnName])) {
45
+ throw new Exception('Wrong column name specified.');
46
+ }
47
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
48
+
49
+
50
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
51
+ }
52
+
53
+ }
54
+
55
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Field/Trackingkeys.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage block_adminhtml_field
19
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Field_Trackingkeys extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
26
+ protected $magentoAttributes;
27
+
28
+ public function __construct() {
29
+ $this->addColumn('shop', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Shop'),
31
+ 'size' => 15
32
+ ));
33
+ $this->addColumn('trackingkey', array(
34
+ 'label' => Mage::helper('adminhtml')->__('TrackingKey'),
35
+ 'size' => 28
36
+ ));
37
+ $this->_addAfter = false;
38
+
39
+ parent::__construct();
40
+ $this->setTemplate('foxyfeeds/array_dropdown.phtml');
41
+ }
42
+
43
+ protected function _renderCellTemplate($columnName) {
44
+ if (empty($this->_columns[$columnName])) {
45
+ throw new Exception('Wrong column name specified.');
46
+ }
47
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
48
+
49
+ if ($columnName == 'shop') {
50
+ $rendered = '<select name="' . $inputName . '">';
51
+ $storeCollection = Mage::getSingleton('core/store')->getCollection()
52
+ ->addFieldToFilter('code', array('neq' => Mage_Core_Model_Store::ADMIN_CODE))
53
+ ->setOrder('website_id', 'ASC');
54
+
55
+ foreach ($storeCollection as $store) {
56
+ $rendered .= '<option value="' . $store->getId() . '">' . $store->getName() . '</option>';
57
+ }
58
+
59
+ $rendered .= '</select>';
60
+ return $rendered;
61
+ }
62
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
63
+ }
64
+
65
+ }
66
+
67
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Block/Adminhtml/Hintlogo.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Foxyfeeds_Foxyfeeds_Block_Adminhtml_Hintlogo extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
4
+
5
+ protected $_template = 'foxyfeeds/config_hint.phtml';
6
+
7
+ public function render(Varien_Data_Form_Element_Abstract $element) {
8
+ return $this->toHtml();
9
+ }
10
+
11
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Block/Tracking/Tracking.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Bj�rn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Block_Tracking_Tracking extends Mage_Core_Block_Template
24
+ {
25
+ const IMAGE_URL_CLICK = 'https://click.cptrack.de/verify';
26
+ const IMAGE_URL_SALE = 'https://sale.cptrack.de/';
27
+
28
+ /**
29
+ * Flag to wether use the click or sales tracking.
30
+ * @var bool
31
+ */
32
+ protected $_isSale;
33
+
34
+ public function __construct() {
35
+ $this->_isSale = false;
36
+ }
37
+
38
+ /**
39
+ * Check if tracking is enabled.
40
+ * @return bool
41
+ */
42
+ public function isEnabled() {
43
+ return Mage::getStoreConfigFlag('foxyfeeds_tracking/foxyfeeds_tracking/foxyfeeds_useTracking');
44
+ }
45
+
46
+ /**
47
+ * Check if the current tracking mode is set to "Image".
48
+ * @return bool
49
+ */
50
+ public function isTrackingModeImage() {
51
+ return Mage::getStoreConfig('foxyfeeds_tracking/foxyfeeds_tracking/method') == Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Trackingmethod::TRACKING_METHOD_IMAGE;
52
+ }
53
+
54
+ /**
55
+ * Get the tracking key for the current shop.
56
+ * @return mixed
57
+ */
58
+ public function getTrackingKey() {
59
+ $storeId = Mage::app()->getStore()->getId();
60
+ $trackingKeys = unserialize(Mage::getStoreConfig('foxyfeeds_tracking/foxyfeeds_tracking/foxyfeeds_trackingkeys'));
61
+ foreach ($trackingKeys as $element) {
62
+ if ($element['shop'] == $storeId) {
63
+ return $element['trackingkey'];
64
+ }
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Get the order with the last increment id from the checkout session.
70
+ * Returns false if the order could not be loaded.
71
+ * @return Mage_Sales_Model_Order | bool
72
+ */
73
+ public function getOrder() {
74
+ $lastIncrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
75
+ $order = Mage::getModel('sales/order')->loadByIncrementId($lastIncrementId);
76
+ if($order && $order->getId()) {
77
+ return $order;
78
+ }
79
+
80
+ Mage::log('Could not load order with increment id '.$lastIncrementId.' for sales tracking.');
81
+ return false;
82
+ }
83
+
84
+ /**
85
+ * Get the identifier field for the product (entity_id oder sku).
86
+ * @return string
87
+ */
88
+ public function getProductIdField() {
89
+ return Mage::getStoreConfig('foxyfeeds_tracking/foxyfeeds_tracking/foxyfeeds_articlenumber');
90
+ }
91
+
92
+ /**
93
+ * Get the tracking cookie mode.
94
+ * @return string
95
+ */
96
+ public function getCookieMode() {
97
+ return Mage::getStoreConfig('foxyfeeds_tracking/foxyfeeds_tracking/foxyfeeds_cookiemode');
98
+ }
99
+
100
+ /**
101
+ * Get the url for the tracking image.
102
+ * @return string
103
+ */
104
+ public function getImageUrl() {
105
+ if($this->_isSale) {
106
+ $order = $this->getOrder();
107
+ if($order) {
108
+ $url = self::IMAGE_URL_SALE
109
+ . '?trackingKey='.urlencode($this->getTrackingKey())
110
+ . '&cookie='.urlencode($this->getCookieMode())
111
+ . '&orderId='.urlencode($order->getId())
112
+ . '&orderTotal='.urlencode($order->getGrandTotal() - $order->getTaxAmount());
113
+
114
+ $productIdField = $this->getProductIdField();
115
+ $i = 1;
116
+ foreach($order->getItemsCollection(array(), true) as $item) {
117
+ $url .= '&id'.$i.'='.urlencode($item->getData($productIdField))
118
+ . '&price'.$i.'='.urlencode($item->getPrice())
119
+ . '&amount'.$i.'='.urlencode($item->getQtyOrdered());
120
+ $i++;
121
+ }
122
+
123
+ return $url;
124
+ }
125
+ return '';
126
+ }
127
+ return self::IMAGE_URL_CLICK;
128
+ }
129
+
130
+ /**
131
+ * Set the isSale flag. If the param is set to anything that can be interpreted as
132
+ * true, the class variable _isSale is set to true.
133
+ * @param bool|false $isSale
134
+ */
135
+ public function setIsSale($isSale = false) {
136
+ if($isSale) {
137
+ $this->_isSale = true;
138
+ }
139
+ }
140
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Helper/Data.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage helper
19
+ * @copyright Copyright (c) 2013 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+
25
+ class Foxyfeeds_Foxyfeeds_Helper_Data extends Mage_Core_Helper_Abstract {
26
+
27
+ public function __construct($root = 'root') {
28
+
29
+ }
30
+
31
+ public function createXml() {
32
+ if (Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_useExport')) {
33
+ $password = Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_password');
34
+ $paramPassword = Mage::app()->getRequest()->getParam('password', false);
35
+ if ($password == '' || ($paramPassword AND $paramPassword == $password)) {
36
+ Mage::helper('foxyfeeds/export')->startExport();
37
+ exit();
38
+ }
39
+ }
40
+ return;
41
+ }
42
+
43
+ public function getAllStoreIds() {
44
+ $storeIds = array();
45
+
46
+ /** @var $website Mage_Core_Model_Website */
47
+ foreach(Mage::app()->getWebsites() as $website) {
48
+ $storeIds = array_merge($storeIds, $website->getStoreIds());
49
+ }
50
+
51
+ return $storeIds;
52
+ }
53
+ }
54
+
55
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Helper/Export.php ADDED
@@ -0,0 +1,888 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Helper_Export extends Mage_Core_Helper_Abstract
24
+ {
25
+ const MAX_ATTRIBUTE_COUNT_FOR_LIVE_EXPORT = 40;
26
+
27
+ protected $_storeId;
28
+ protected $_siteId;
29
+ protected $_customerGroupId;
30
+ protected $_mediaUrl;
31
+ protected $_webUrl;
32
+ protected $_allCat;
33
+ protected $_limit;
34
+ protected $_last;
35
+ protected $_blankProduct;
36
+ protected $_configurableAttributes = array();
37
+ protected $_imageBaseUrl;
38
+ protected $_maxAdditionalImages;
39
+ protected $_exportFields;
40
+ protected $_currencyChange;
41
+ protected $_replaceFields;
42
+ protected $_parents;
43
+ protected $_backendModel;
44
+ protected $_chunkSize;
45
+ protected $_stockId;
46
+ /** @var $_eavEntity Mage_Eav_Model_Entity_Abstract */
47
+ protected $_eavEntity;
48
+
49
+ public function __construct() {
50
+ $this->_init();
51
+ }
52
+
53
+ /**
54
+ * Handle status event
55
+ *
56
+ */
57
+ public function startExport() {
58
+ ini_set('max_execution_time', 7200);
59
+ $store = Mage::app()->getRequest()->getParam('store', null);
60
+ try {
61
+ $this->_storeId = Mage::app()->getStore($store)->getId();
62
+ } catch(Exception $e) {
63
+ $this->_handleStoreException();
64
+ return;
65
+ }
66
+
67
+ // start the xml output right now to output the exported products as soon as
68
+ // each product has been processed
69
+ header('Content-Type: text/xml; charset=utf-8');
70
+ echo '<?xml version="1.0"?>';
71
+ echo '<root><catalog>';
72
+
73
+ $this->_export();
74
+
75
+ echo "</catalog></root>";
76
+ }
77
+
78
+ /**
79
+ * Display an error message based on current export (and therefore display) method
80
+ * if an exception has occured during Mage::app()->getStore().
81
+ */
82
+ protected function _handleStoreException() {
83
+ // The exception thrown by Mage::app()->getStore() has an empty message ...
84
+ $xml = new SimpleXMLElement('<root></root>');
85
+ $xml->addChild('error', 'Error retrieving store.');
86
+ header('Content-Type: text/xml; charset=utf-8');
87
+ echo $xml->asXML();
88
+ exit();
89
+ }
90
+
91
+ /**
92
+ * Callback function used for the collection iterator.
93
+ * The function receives an array containing the fetched row from the database.
94
+ * Saves the product to export in the _productData array.
95
+ * @param $args array
96
+ */
97
+ public function indexedExportCallback($args)
98
+ {
99
+ $row = $args['row'];
100
+ echo $row['product_data'];
101
+ }
102
+
103
+ /**
104
+ * Export the products and return them as array.
105
+ */
106
+ protected function _export() {
107
+ $flatEnabled = false;
108
+ if(class_exists('Mage_Core_Model_App_Emulation')) {
109
+ /* @var $flatHelper Mage_Catalog_Helper_Product_Flat */
110
+ $flatHelper = Mage::helper('catalog/product_flat');
111
+ /* @var $emulationModel Mage_Core_Model_App_Emulation */
112
+ $emulationModel = Mage::getModel('core/app_emulation');
113
+ if ($flatHelper) {
114
+ $flatEnabled = method_exists($flatHelper, 'isAvailable') ? $flatHelper->isAvailable() : $flatHelper->isEnabled();
115
+ if($flatEnabled) {
116
+ // Emulate admin environment to disable using flat model - otherwise we won't get global stats
117
+ // for all stores
118
+ $initialEnvironmentInfo = $emulationModel->startEnvironmentEmulation(0, Mage_Core_Model_App_Area::AREA_ADMINHTML);
119
+ }
120
+ }
121
+ }
122
+
123
+ $exportMethod = Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_export_method');
124
+
125
+ // live export
126
+ if(
127
+ $exportMethod == Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Exportmethod::EXPORT_METHOD_LIVE &&
128
+ $this->getAttributeCount() <= Foxyfeeds_Foxyfeeds_Helper_Export::MAX_ATTRIBUTE_COUNT_FOR_LIVE_EXPORT
129
+ ) {
130
+ $collection = $this->getProductCollection($this->_storeId);
131
+
132
+ // collection could not be loaded
133
+ if($collection === null) {
134
+ return null;
135
+ }
136
+
137
+ $chunkSize = $this->getChunkSize();
138
+ $pages = ceil($collection->getSize() / $chunkSize);
139
+
140
+ $collection->setPageSize($chunkSize);
141
+
142
+ $backendModel = $this->getBackendModel();
143
+
144
+ for($i = 1; $i <= $pages; $i++) {
145
+ $collection->clear();
146
+ $collection->setCurPage($i);
147
+ foreach($collection as $item) {
148
+
149
+ $backendModel->afterLoad($item);
150
+ $productData = $this->getFullProductData($item);
151
+
152
+ $productXml = new SimpleXMLElement('<product></product>');
153
+ $this->productToXml($productData, $productXml);
154
+ $dom = dom_import_simplexml($productXml);
155
+ echo $dom->ownerDocument->saveXML($dom->ownerDocument->documentElement);
156
+ }
157
+ }
158
+ } else { // indexed export
159
+ $collection = Mage::getModel('foxyfeeds/feedexport_indexer')
160
+ ->getCollection()
161
+ ->addFieldToFilter('store_id', array('eq' => $this->_storeId));
162
+
163
+ // output an error in case the collection is empty / no data found for store
164
+ if($collection->getSize() == 0) {
165
+ $xml = new SimpleXMLElement('<error></error>');
166
+ $xml->addChild('message', 'No data found for store '.$this->_storeId.' in index table. Please reindex the data.');
167
+ $dom = dom_import_simplexml($xml);
168
+ echo $dom->ownerDocument->saveXML($dom->ownerDocument->documentElement);
169
+ return;
170
+ }
171
+
172
+ $iterator = Mage::getSingleton('core/resource_iterator');
173
+ $iterator->walk($collection->getSelect(), array(array($this, 'indexedExportCallback')));
174
+ }
175
+
176
+ // stop emulating admin store and set initial environment
177
+ if ($flatEnabled) {
178
+ $emulationModel->stopEnvironmentEmulation($initialEnvironmentInfo);
179
+ }
180
+ }
181
+
182
+ /**
183
+ * Check if another currency (other than the base currency) should be used. Displays an error if the
184
+ * given currency could not be found.
185
+ */
186
+ protected function _initCurrencyChange() {
187
+ $this->_currencyChange = null;
188
+ $currencyCode = Mage::app()->getRequest()->getParam('currency', false);
189
+ if ($currencyCode && $currencyCode != '') {
190
+ $result = Mage::getModel('directory/currency')->getCurrencyRates(Mage::app()->getBaseCurrencyCode(), $currencyCode);
191
+ if(count($result) === 0){
192
+ $xml = new SimpleXMLElement('<root></root>');
193
+ $xml->addChild('error', 'wrong currency');
194
+ header('Content-Type: text/xml; charset=utf-8');
195
+ echo $xml->asXML();
196
+ exit();
197
+ }
198
+ $this->_currencyChange = $result[$currencyCode];
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Get PHP's memory limit in bytes.
204
+ * @return int|string
205
+ */
206
+ protected function getPhpMemoryLimitInBytes ()
207
+ {
208
+ $limit = ini_get('memory_limit');
209
+ switch (substr ($limit, -1))
210
+ {
211
+ case 'M': case 'm': return (int)$limit * 1048576; // 1024 * 1024
212
+ case 'K': case 'k': return (int)$limit * 1024;
213
+ case 'G': case 'g': return (int)$limit * 1073741824; // 1024 * 1024 * 1024
214
+ default: return $limit;
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Initialize the export.
220
+ *
221
+ * @param int $storeId
222
+ */
223
+ protected function _init() {
224
+ // Initialize the admin application
225
+ Mage::app('admin');
226
+
227
+ $this->_blankProduct = array();
228
+ $this->_blankProduct['entity_id'] = '';
229
+ $this->_blankProduct['sku'] = '';
230
+ $this->_blankProduct['parent_id'] = '';
231
+ $this->_blankProduct['variationTheme'] = '';
232
+ $this->_blankProduct['name'] = '';
233
+ $this->_blankProduct['description'] = '';
234
+ $this->_blankProduct['price'] = '';
235
+ $this->_blankProduct['categories'] = '';
236
+ $this->_blankProduct['manufacturer'] = '';
237
+ $this->_blankProduct['manufacturer_name'] = '';
238
+ $this->_blankProduct['ff_product_url'] = '';
239
+ $this->_blankProduct['ff_image_url'] = '';
240
+ $this->_blankProduct['color'] = '';
241
+ $this->_blankProduct['weight'] = '';
242
+ for($i = 1; $i <= Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_imagenumber'); $i++) {
243
+ $this->_blankProduct['ff_additional_image_'.$i] = '';
244
+ }
245
+
246
+ $specialExportFields = unserialize(Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_specialexportfields'));
247
+ if(!empty($specialExportFields)) {
248
+ foreach($specialExportFields as $field) {
249
+ if (!empty($field['name'])) {
250
+ $this->_blankProduct[preg_replace('/\W/', '', $field['name'])] = $field['value'];
251
+ }
252
+ }
253
+ }
254
+
255
+ $this->_customerGroupId = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID;
256
+
257
+ $this->_buildCategoryTree();
258
+ $this->_initCurrencyChange();
259
+ $this->_initConfigurableAttributes();
260
+
261
+ /** @var $mediaConfig Mage_Catalog_Model_Product_Media_Config */
262
+ $mediaConfig = Mage::getSingleton('catalog/product_media_config');
263
+ $this->_imageBaseUrl = $mediaConfig->getBaseMediaUrl();
264
+
265
+ $this->_maxAdditionalImages = Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_imagenumber');
266
+ $this->_exportFields = unserialize(Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_exportfields'));
267
+ $this->_replaceFields = unserialize(Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_replacefields'));
268
+
269
+ $this->_initChunkSize();
270
+
271
+ $this->_parents = array();
272
+ }
273
+
274
+ /**
275
+ * Initialize the chunk size for the collection based on PHP's memory limit.
276
+ */
277
+ protected function _initChunkSize() {
278
+ $memoryLimit = $this->getPhpMemoryLimitInBytes();
279
+
280
+ switch($memoryLimit) {
281
+ case $memoryLimit <= 33554432: // 32M
282
+ $this->_chunkSize = 10;
283
+ break;
284
+ case $memoryLimit <= 67108864: // 64M
285
+ $this->_chunkSize = 25;
286
+ break;
287
+ case $memoryLimit <= 134217728: // 128M
288
+ $this->_chunkSize = 50;
289
+ break;
290
+ case $memoryLimit <= 268435456: // 256M
291
+ $this->_chunkSize = 75;
292
+ break;
293
+ default:
294
+ $this->_chunkSize = 100;
295
+ }
296
+ }
297
+
298
+ /**
299
+ * Build the category tree.
300
+ */
301
+ protected function _buildCategoryTree() {
302
+ $this->_allCat = array();
303
+
304
+ $categoryCollection = Mage::getModel('catalog/category')->getCollection()
305
+ ->addAttributeToSelect('name')
306
+ ->addAttributeToSort('path');
307
+
308
+ foreach($categoryCollection as $category) {
309
+ $path = $this->_getCategory($category->getPath());
310
+ if($path !== 0) {
311
+ $this->_allCat[$category->getPath()] = str_replace('Root Catalog', 'Home', $path . '>' . $category->getName());
312
+ } else {
313
+ $this->_allCat[$category->getPath()] = str_replace('Root Catalog', 'Home', $category->getName());
314
+ }
315
+ }
316
+ }
317
+
318
+ /**
319
+ * Get the category id from a path.
320
+ * @param $key
321
+ * @return int | string
322
+ */
323
+ protected function _getCategory($key) {
324
+ $return = 0;
325
+ if (strpos($key, '/') != false) {
326
+ $tmpKey = substr($key, 0, strpos($key, strrchr($key, '/')));
327
+ if (isset($this->_allCat[$tmpKey])) {
328
+ $return = $this->_allCat[$tmpKey];
329
+ } else {
330
+ $return = $this->_getCategory($tmpKey);
331
+ }
332
+ }
333
+ return $return;
334
+ }
335
+
336
+ /**
337
+ * Initialize the configurableAttributes array.
338
+ * Array(
339
+ * [PRODUCT_ID] => ARRAY(
340
+ * [ATTRIBUTE_CODE] => [FRONTEND_LABEL]
341
+ * )
342
+ * )
343
+ */
344
+ protected function _initConfigurableAttributes() {
345
+ $this->_configurableAttributes = array();
346
+
347
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
348
+
349
+ $select = $connection->select()
350
+ ->from(array('super_attribute' => Mage::getSingleton('core/resource')->getTableName('catalog/product_super_attribute')), array('attribute_id', 'product_id'))
351
+ ->join(array('attribute' => Mage::getSingleton('core/resource')->getTableName('eav/attribute')),
352
+ 'attribute.attribute_id = super_attribute.attribute_id',
353
+ array('attribute_code', 'frontend_label')
354
+ );
355
+
356
+ $result = $connection->fetchAll($select);
357
+
358
+ foreach($result as $attribute) {
359
+ if(!isset($this->_configurableAttributes[$attribute['product_id']])) {
360
+ $this->_configurableAttributes[$attribute['product_id']] = array();
361
+ }
362
+ $this->_configurableAttributes[$attribute['product_id']][$attribute['attribute_code']] = $attribute['frontend_label'];
363
+ }
364
+ }
365
+
366
+ /**
367
+ * Get an array of attribute codes for all configurable attributes of a product ID.
368
+ *
369
+ * @param int $productId
370
+ * @return array
371
+ */
372
+ protected function _getConfigurableAttributes($productId) {
373
+ $attributeOptions = array();
374
+ if(isset($this->_configurableAttributes[$productId])) {
375
+ foreach($this->_configurableAttributes[$productId] as $attributeCode => $label) {
376
+ $attributeOptions[] = $label;
377
+ }
378
+ }
379
+ return $attributeOptions;
380
+ }
381
+
382
+ /**
383
+ * Get all attributes that need to be selected from the database.
384
+ * @param $attributes array
385
+ * @return array
386
+ */
387
+ protected function _getAttributesForSelect($attributes) {
388
+ $attributesToSelect = array(
389
+ 'entity_id',
390
+ 'sku',
391
+ 'name',
392
+ 'description',
393
+ 'price',
394
+ 'manufacturer',
395
+ 'color',
396
+ 'weight',
397
+ 'media_gallery',
398
+ 'url_key',
399
+ 'url_path',
400
+ 'image',
401
+ 'type_id'
402
+ );
403
+
404
+ $attributeCodes = array();
405
+
406
+ // save all available attribute codes
407
+ foreach($attributes as $code => $attribute) {
408
+ $attributeCodes[] = $code;
409
+ }
410
+
411
+ // add all attributes from the config if the attribute is a Magento attribute and it has
412
+ // not already been added to the $attributesToSelect array
413
+ foreach($this->_exportFields as $field) {
414
+ $attrCode = $field['productattribute'];
415
+ if(in_array($attrCode, $attributeCodes) && !in_array($attrCode, $attributesToSelect)) {
416
+ $attributesToSelect[] = $attrCode;
417
+ }
418
+ }
419
+
420
+ return $attributesToSelect;
421
+
422
+ }
423
+
424
+ /**
425
+ * Sets store specific values for the export based on the parameter $storeId.
426
+ * Returns false if an error occured / the store with id $storeId does not exist.
427
+ * @param int $storeId
428
+ * @return bool
429
+ * @throws Mage_Core_Exception
430
+ */
431
+ protected function _setStoreValues($storeId) {
432
+ try {
433
+ $store = Mage::app()->getStore($storeId);
434
+ } catch(Exception $e) {
435
+ Mage::logException($e);
436
+ return false;;
437
+ }
438
+
439
+ $this->_storeId = $store->getId();
440
+ $this->_siteId = $store->getWebsiteId();
441
+ $this->_webUrl = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
442
+ $this->_mediaUrl = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
443
+
444
+ $stockId = $store->getWebsite()->getStockId();
445
+ $this->_stockId = (!empty($stockId)) ? $stockId : 1;
446
+
447
+ return true;
448
+ }
449
+
450
+ /**
451
+ * @param int $storeId
452
+ * @param array $filterIds
453
+ * @return Mage_Catalog_Model_Resource_Product_Collection|null
454
+ * @throws Mage_Core_Exception
455
+ */
456
+ public function getProductCollection($storeId, array $filterIds = array()) {
457
+ // Set the store values. If an error occurs, return null.
458
+ if(!$this->_setStoreValues($storeId)) {
459
+ return null;
460
+ }
461
+
462
+ /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
463
+ $collection = Mage::getModel('catalog/product')->getCollection();
464
+ $this->_eavEntity = $collection->getEntity();
465
+ $attributes = $collection->getEntity()->loadAllAttributes()->getAttributesByCode();
466
+
467
+ $connection = $collection->getConnection();
468
+
469
+ // addPriceData uses inner join to get the price data for a website_id and a customer_group id
470
+ // so all products that are not associated to $this->_siteId and the customerGroupId (NOT LOGGED IN (0) by default)
471
+ // are not included in this collection.
472
+ // addPriceData is needed for getting the minimal price for bundels
473
+ $collection
474
+ ->addAttributeToSelect('*')
475
+ ->addPriceData($this->_customerGroupId, $this->_siteId)
476
+ ->joinField('qty',
477
+ 'cataloginventory/stock_item',
478
+ 'qty',
479
+ 'product_id=entity_id',
480
+ $connection->quoteInto('{{table}}.stock_id=?', $this->_stockId),
481
+ 'left')
482
+ ->joinField('min_sale_qty',
483
+ 'cataloginventory/stock_item',
484
+ 'min_sale_qty',
485
+ 'product_id=entity_id',
486
+ $connection->quoteInto('{{table}}.stock_id=?', $this->_stockId),
487
+ 'left')
488
+ ->joinField('max_sale_qty',
489
+ 'cataloginventory/stock_item',
490
+ 'max_sale_qty',
491
+ 'product_id=entity_id',
492
+ $connection->quoteInto('{{table}}.stock_id=?', $this->_stockId),
493
+ 'left')
494
+ ->joinField('is_in_stock',
495
+ 'cataloginventory/stock_item',
496
+ 'is_in_stock',
497
+ 'product_id=entity_id',
498
+ $connection->quoteInto('{{table}}.stock_id=?', $this->_stockId),
499
+ 'left')
500
+ ->setStoreId($this->_storeId);
501
+
502
+ // add group price fields
503
+ foreach($this->_exportFields as $field) {
504
+ if(strpos($field['productattribute'], 'group_price') !== false) {
505
+ $groupId = substr($field['productattribute'], 12);
506
+ if(is_numeric($groupId)) {
507
+ $collection->joinField('group_price_'.$groupId,
508
+ 'catalog/product_index_price',
509
+ 'group_price',
510
+ 'entity_id=entity_id',
511
+ $connection->quoteInto('{{table}}.customer_group_id=?', $groupId),
512
+ 'left');
513
+ }
514
+ }
515
+ }
516
+
517
+ if(!empty($filterIds)) {
518
+ $collection->addFieldToFilter('entity_id', array('in' => $filterIds));
519
+ }
520
+
521
+ $this->_backendModel = $collection->getResource()->getAttribute('media_gallery')->getBackend();
522
+
523
+ return $collection;
524
+ }
525
+
526
+ /**
527
+ * Get the url for the product based on the selected method in the system config or from the param $method.
528
+ * @param Mage_Catalog_Model_Product $product
529
+ * @param null|int $method
530
+ * @return string
531
+ */
532
+ public function getProductUrl(Mage_Catalog_Model_Product $product, $method = null) {
533
+ if($method === null) {
534
+ $method = Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/product_url_generation_method');
535
+ }
536
+
537
+ switch($method) {
538
+ case Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Producturlgeneration::METHOD_URL_PATH:
539
+ $url = $this->_webUrl . $product->getUrlPath();
540
+ break;
541
+ case Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Producturlgeneration::METHOD_URL_KEY:
542
+ $url = $this->_webUrl . $product->getUrlKey();
543
+ break;
544
+ case Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Producturlgeneration::METHOD_URL_KEY_HTML:
545
+ $url = $this->_webUrl . $product->getUrlKey() . '.html';
546
+ break;
547
+ case Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Producturlgeneration::METHOD_GET_PRODUCT_URL:
548
+ $url = $product->getProductUrl();
549
+ break;
550
+ case Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Producturlgeneration::METHOD_GET_URL_IN_STORE:
551
+ $url = $product->getUrlInStore($product, array('_store' => $this->_storeId));
552
+ break;
553
+ default:
554
+ $url = '';
555
+ }
556
+
557
+ return $url;
558
+ }
559
+
560
+ /**
561
+ * Get the current $item as array.
562
+ * Returns Array(
563
+ * [ATTRIBUTE_CODE] => [VALUE]
564
+ * )
565
+ * @param Mage_Catalog_Model_Product $item
566
+ * @return array
567
+ */
568
+ public function getFullProductData(Mage_Catalog_Model_Product $item) {
569
+ $imageUrl = $this->_imageBaseUrl . $item->getImage();
570
+
571
+ $isParent = 0;
572
+ if ($item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
573
+ $isParent = 1;
574
+ }
575
+
576
+ $parentId = null;
577
+ if ($item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
578
+ $parentId = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($item->getId());
579
+ $parentId = (is_array($parentId) && !empty($parentId)) ? $parentId[0] : null;
580
+ }
581
+
582
+ $configurableAttributes = array();
583
+ if($parentId && isset($this->_variationThemes[$parentId])) {
584
+ $configurableAttributes = $this->_variationThemes[$parentId];
585
+ } else if($isParent && $parentId === null) {
586
+ $configurableAttributes = $this->_getConfigurableAttributes($item->getId());
587
+ $configurableAttributes = (!empty($configurableAttributes)) ? implode('|', $configurableAttributes) : '';
588
+ $this->_variationThemes[$item->getId()] = $configurableAttributes;
589
+ }
590
+
591
+ $colorText = ($this->_eavEntity->getAttribute('color')) ? $item->getAttributeText('color') : '';
592
+
593
+ // set the value to the minimal price if the current product is a bundle, otherwise the product's price
594
+ $calcPrice = ($item->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) ? Mage::getModel('bundle/product_price')->getTotalPrices($item, 'min', true, false) : $item->getPrice();
595
+
596
+ $rulePrice = Mage::getModel('catalogrule/rule')->calcProductPriceRule($item->setStoreId($this->_storeId),$calcPrice);
597
+ $price = ($rulePrice) ? $rulePrice : $calcPrice;
598
+
599
+ $product = $this->_blankProduct;
600
+
601
+ $product['entity_id'] = $item->getId();
602
+ $product['sku'] = $item->getSku();
603
+ $product['parent_id'] = $parentId;
604
+ $product['variationTheme'] = $configurableAttributes;
605
+ $product['name'] = $this->_getCleanedStringForXml($item->getName());
606
+ $product['description'] = $this->_getCleanedStringForXml($item->getDescription());
607
+
608
+ $product['price'] = $price;
609
+ if($this->_currencyChange) {
610
+ $product['price'] = round($product['price']*$this->_currencyChange, 2);
611
+ }
612
+
613
+ $product['categories'] = $this->_getCategoryInformation($item);
614
+ if($this->_eavEntity->getAttribute('manufacturer')) {
615
+ $product['manufacturer'] = $this->_getCleanedStringForXml($item->getManufacturer());
616
+ $product['manufacturer_name'] = $this->_getCleanedStringForXml($item->getAttributeText('manufacturer'));
617
+ }
618
+ $product['ff_product_url'] = $this->getProductUrl($item);
619
+ $product['ff_image_url'] = $imageUrl;
620
+ $product['color'] = ($colorText) ? $this->_getCleanedStringForXml($colorText) : null;
621
+ $product['weight'] = $item->getWeight();
622
+
623
+ $product = array_merge($product, $this->_getAdditionalImages($item));
624
+
625
+ $product['is_parent'] = $isParent;
626
+
627
+ $this->_addExportFields($product, $item);
628
+
629
+ if(!empty($this->_replaceFields) && !$isParent && $parentId !== null) {
630
+ $this->_replaceFields($product, $parentId);
631
+ }
632
+
633
+ return $product;
634
+ }
635
+
636
+ /**
637
+ * Get the additional images for a product
638
+ * @param Mage_Catalog_Model_Product $product
639
+ * @return array
640
+ */
641
+ protected function _getAdditionalImages(Mage_Catalog_Model_Product $product) {
642
+ $counter = 1;
643
+ $productData = array();
644
+ $mediaGalleryImages = array();
645
+ if($product->getMediaGalleryImages()) {
646
+ $mediaGalleryImages = $product->getMediaGalleryImages();
647
+ }
648
+ foreach ($mediaGalleryImages as $image) {
649
+ // break if the maximum amount of additional images has been reached
650
+ if ($counter > $this->_maxAdditionalImages) {
651
+ break;
652
+ }
653
+
654
+ // ignore the base image; it has already been added
655
+ if ($image->getFile() == $product->getImage()) {
656
+ continue;
657
+ }
658
+
659
+ $productData['ff_additional_image_' . $counter] = $this->_imageBaseUrl . $image->getFile();
660
+ $counter++;
661
+ }
662
+
663
+ return $productData;
664
+ }
665
+
666
+ /**
667
+ * Add all fields to a product that need to be exported
668
+ * @param $product
669
+ * @param Mage_Catalog_Model_Product $item
670
+ */
671
+ protected function _addExportFields(&$product, Mage_Catalog_Model_Product $item) {
672
+ foreach($this->_exportFields as $field) {
673
+ $code = $field['productattribute'];
674
+ if(strpos($code, 'group_price') !== false) {
675
+ $groupId = substr($code, 12);
676
+ $customerGroup = Mage::getModel('customer/group')->load($groupId);
677
+ $groupCode = str_replace(' ', '_', $customerGroup->getCustomerGroupCode());
678
+ $product['group_price_'.$groupCode] = $item->getData('group_price_'.$customerGroup->getId());
679
+ } else {
680
+ switch($code) {
681
+ // ignore
682
+ case 'parent_id':
683
+ break;
684
+ case 'qty':
685
+ $product[$code] = $item->getQty();
686
+ break;
687
+ case 'stock_status':
688
+ $product[$code] = $item->getIsInStock();
689
+ break;
690
+ case 'min_sale_qty':
691
+ case 'max_sale_qty':
692
+ case 'tax_class_id':
693
+ $product[$code] = $item->getData($code);
694
+ break;
695
+ default:
696
+ $attributeText = ($item->getResource()->getAttribute($code)) ? $item->getAttributeText($code) : false;
697
+ if(is_array($attributeText)) {
698
+ $attributeText = implode(',',$attributeText);
699
+ }
700
+ $product[$code] = ($attributeText) ? $this->_getCleanedStringForXml($attributeText) : $this->_getCleanedStringForXml($item->getData($code));
701
+ }
702
+ }
703
+ }
704
+ }
705
+
706
+ /**
707
+ * Replace all selected fields with the parent's values.
708
+ * @param $product
709
+ * @param $parentId
710
+ */
711
+ protected function _replaceFields(&$product, $parentId) {
712
+ $parent = $this->_getParentById($parentId);
713
+ if($parent !== null && $parent->getId()) {
714
+ $parentImages = $this->_getAdditionalImages($parent);
715
+ foreach($this->_replaceFields as $field) {
716
+ $code = $field['productattribute'];
717
+ if(strpos($code, 'group_price') !== false) {
718
+ $groupId = substr($code, 12);
719
+ $customerGroup = Mage::getModel('customer/group')->load($groupId);
720
+ $groupPrices = $parent->getData('group_price');
721
+ foreach($groupPrices as $groupPrice) {
722
+ if($groupPrice['cust_group'] == $groupId) {
723
+ $groupCode = str_replace(' ', '_', $customerGroup->getCustomerGroupCode());
724
+ $product['group_price_'.$groupCode] = $groupPrice['price'];
725
+ }
726
+ }
727
+ } else if(strpos($code, 'ff_additional_image') !== false && isset($parentImages[$code])) {
728
+ $product[$code] = $parentImages[$code];
729
+ } else {
730
+ switch($code) {
731
+ case 'categories':
732
+ $product['categories'] = $this->_getCategoryInformation($parent);
733
+ break;
734
+ case 'ff_product_url':
735
+ $product[$code] = $this->getProductUrl($parent);
736
+ break;
737
+ case 'ff_image_url':
738
+ $product[$code] = $this->_imageBaseUrl . $parent->getImage();
739
+ break;
740
+ case 'qty':
741
+ $product[$code] = $parent->getStockItem()->getQty();
742
+ break;
743
+ case 'stock_status':
744
+ $product[$code] = $parent->getStockItem()->getIsInStock();
745
+ break;
746
+ case 'min_sale_qty':
747
+ $product[$code] = $parent->getStockItem()->getMinSaleQty();
748
+ break;
749
+ case 'max_sale_qty':
750
+ $product[$code] = $parent->getStockItem()->getMaxSaleQty();
751
+ break;
752
+ case 'tax_class_id':
753
+ $product[$code] = $parent->getData($code);
754
+ break;
755
+ default:
756
+ $attributeText = ($parent->getResource()->getAttribute($code)) ? $parent->getAttributeText($code) : false;
757
+ if(is_array($attributeText)) {
758
+ $attributeText = implode(',',$attributeText);
759
+ }
760
+ $product[$code] = ($attributeText) ? $this->_getCleanedStringForXml($attributeText) : $this->_getCleanedStringForXml($parent->getData($code));
761
+ }
762
+ }
763
+ }
764
+ }
765
+ }
766
+
767
+ /**
768
+ * Adds the values of the $product array to the $xml structure.
769
+ * @param array $product
770
+ * @param SimpleXMLElement $xml
771
+ */
772
+ public function productToXml(array $product, SimpleXMLElement $xml) {
773
+ foreach($product as $code => $value) {
774
+ if(is_array($value)) {
775
+ $node = $xml->addChild($code);
776
+ $this->productToXml($value, $node);
777
+ } else if (is_string($value) || is_numeric($value) || is_bool($value) || is_null($value)) {
778
+ $xml->addChild($code, htmlspecialchars($value));
779
+ }
780
+ }
781
+ }
782
+
783
+ /**
784
+ * Get the category information for a product.
785
+ * @param Mage_Catalog_Model_Product $product
786
+ * @return string
787
+ */
788
+ protected function _getCategoryInformation(Mage_Catalog_Model_Product $product) {
789
+ $arrPath = array();
790
+
791
+ /** @var $category Mage_Catalog_Model_Category */
792
+ foreach($product->getCategoryCollection() as $category) {
793
+ if(isset($this->_allCat[$category->getPath()])) {
794
+ $arrPath[] = $this->_allCat[$category->getPath()];
795
+ }
796
+ }
797
+
798
+ return ltrim(implode(',', $arrPath), '>');
799
+ }
800
+
801
+ /**
802
+ * Get a product by its id. Save the loaded product to an array to cache it.
803
+ * It is used for parent products only so these products do not need to be loaded by each
804
+ * of its child products.
805
+ * @param $parentId
806
+ * @return mixed
807
+ */
808
+ protected function _getParentById($parentId) {
809
+ if(!isset($this->_parents[$parentId])) {
810
+ $parent = Mage::getModel('catalog/product')->load($parentId);
811
+ $this->_parents[$parentId] = ($parent->getId()) ? $parent : null;
812
+ }
813
+ return $this->_parents[$parentId];
814
+ }
815
+
816
+ /**
817
+ * Clean a string for usage in XML.
818
+ * @param $string
819
+ * @return mixed
820
+ */
821
+ protected function _getCleanedStringForXml($string) {
822
+ return $this->_utf8ForXml(html_entity_decode($string));
823
+ }
824
+
825
+ /**
826
+ * Replace all UTF-8 characters that are not allowed in XML with a space.
827
+ * @param $string
828
+ * @return mixed
829
+ */
830
+ protected function _utf8ForXml($string) {
831
+ return preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $string);
832
+ }
833
+
834
+ /**
835
+ * @return mixed
836
+ */
837
+ public function getStoreId()
838
+ {
839
+ return $this->_storeId;
840
+ }
841
+
842
+ public function setStoreVariables($storeId) {
843
+ try {
844
+ $store = Mage::app()->getStore($storeId);
845
+ $this->_storeId = $storeId;
846
+ $this->_siteId = $store->getWebsiteId();
847
+ $this->_webUrl = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
848
+ $this->_mediaUrl = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
849
+ } catch(Exception $e) {
850
+ Mage::logException($e);
851
+ }
852
+ }
853
+
854
+ /**
855
+ * @return mixed
856
+ */
857
+ public function getChunkSize()
858
+ {
859
+ if(empty($this->_chunkSize)) {
860
+ $this->_initChunkSize();
861
+ }
862
+ return $this->_chunkSize;
863
+ }
864
+
865
+ /**
866
+ * @param mixed $chunkSize
867
+ */
868
+ public function setChunkSize($chunkSize)
869
+ {
870
+ $this->_chunkSize = $chunkSize;
871
+ }
872
+
873
+ /**
874
+ * @return mixed
875
+ */
876
+ public function getAttributeCount()
877
+ {
878
+ return (!empty($this->_exportFields)) ? count($this->_exportFields) : 0;
879
+ }
880
+
881
+ /**
882
+ * @return mixed
883
+ */
884
+ public function getBackendModel()
885
+ {
886
+ return $this->_backendModel;
887
+ }
888
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Articlenumber.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @subpackage adminhtml_model_cookiemode
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Articlenumber
24
+ {
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => 'product_id', 'label'=>'Entity ID'),
29
+ array('value' => 'sku', 'label'=>'Sku')
30
+ );
31
+ }
32
+ }
33
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Cookiemode.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @subpackage adminhtml_model_cookiemode
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Cookiemode
24
+ {
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => 'last', 'label'=>'Last Cookie Wins'),
29
+ array('value' => 'first', 'label'=>'First Cookie Wins')
30
+ );
31
+ }
32
+ }
33
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Exportmethod.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Exportmethod
24
+ {
25
+ const EXPORT_METHOD_LIVE = 1;
26
+ const EXPORT_METHOD_INDEXED = 2;
27
+
28
+ public function toOptionArray() {
29
+ return array(
30
+ array('value' => self::EXPORT_METHOD_LIVE, 'label' => Mage::helper('foxyfeeds')->__('FF Live')),
31
+ array('value' => self::EXPORT_METHOD_INDEXED, 'label' => Mage::helper('foxyfeeds')->__('FF Indexed')),
32
+ );
33
+ }
34
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Imagenumber.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage adminhtml_model_cookiemode
19
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+ class Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Imagenumber
25
+ {
26
+
27
+ public function toOptionArray() {
28
+ return array(
29
+ array('value' => '1', 'label' => '1'),
30
+ array('value' => '2', 'label' => '2'),
31
+ array('value' => '3', 'label' => '3'),
32
+ array('value' => '4', 'label' => '4'),
33
+ array('value' => '5', 'label' => '5'),
34
+ array('value' => '6', 'label' => '6'),
35
+ array('value' => '7', 'label' => '7'),
36
+ array('value' => '8', 'label' => '8'),
37
+ array('value' => '9', 'label' => '9'),
38
+ array('value' => '10', 'label' => '10'),
39
+ array('value' => '11', 'label' => '11'),
40
+ array('value' => '12', 'label' => '12'),
41
+ array('value' => '13', 'label' => '13'),
42
+ array('value' => '14', 'label' => '14'),
43
+ array('value' => '15', 'label' => '15'),
44
+ array('value' => '16', 'label' => '16'),
45
+ array('value' => '17', 'label' => '17'),
46
+ array('value' => '18', 'label' => '18'),
47
+ array('value' => '19', 'label' => '19'),
48
+ array('value' => '20', 'label' => '20')
49
+ );
50
+ }
51
+
52
+ }
53
+
54
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Producturlgeneration.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Producturlgeneration
24
+ {
25
+ const METHOD_URL_PATH = 1;
26
+ const METHOD_URL_KEY = 2;
27
+ const METHOD_URL_KEY_HTML = 3;
28
+ const METHOD_GET_PRODUCT_URL = 4;
29
+ const METHOD_GET_URL_IN_STORE = 5;
30
+
31
+ public function toOptionArray() {
32
+ return array(
33
+ array('value' => self::METHOD_URL_PATH, 'label' => Mage::helper('foxyfeeds')->__("FF base url + url_path")),
34
+ array('value' => self::METHOD_URL_KEY, 'label' => Mage::helper('foxyfeeds')->__("FF base url + url_key")),
35
+ array('value' => self::METHOD_URL_KEY_HTML, 'label' => Mage::helper('foxyfeeds')->__("FF base url + url_key + .html")),
36
+ array('value' => self::METHOD_GET_PRODUCT_URL, 'label' => Mage::helper('foxyfeeds')->__("FF Method getProductUrl")),
37
+ array('value' => self::METHOD_GET_URL_IN_STORE, 'label' => Mage::helper('foxyfeeds')->__("FF Method getUrlInStore")),
38
+ );
39
+ }
40
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Adminhtml/Source/Trackingmethod.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Bj�rn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Trackingmethod
24
+ {
25
+ const TRACKING_METHOD_IMAGE = 1;
26
+ const TRACKING_METHOD_JS = 2;
27
+
28
+ public function toOptionArray() {
29
+ return array(
30
+ array('value' => self::TRACKING_METHOD_IMAGE, 'label' => Mage::helper('foxyfeeds')->__('FF Image')),
31
+ array('value' => self::TRACKING_METHOD_JS, 'label' => Mage::helper('foxyfeeds')->__('FF JavaScript')),
32
+ );
33
+ }
34
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Feedexport/Indexer.php ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer extends Mage_Index_Model_Indexer_Abstract
24
+ {
25
+ const EVENT_MATCH_RESULT_KEY = 'foxyfeeds_product_feed_export_result';
26
+
27
+ const EVENT_KEY_UPDATE_PRODUCT_ID = 'foxyfeeds_feed_export_update_product_id';
28
+ const EVENT_KEY_DELETE_PRODUCT_ID = 'foxyfeeds_feed_export_delete_product_id';
29
+ const EVENT_KEY_MASS_ACTION_PRODUCT_IDS = 'foxyfeeds_feed_export_mass_action_product_ids';
30
+
31
+ /**
32
+ * @var array
33
+ */
34
+ protected $_matchedEntities = array(
35
+ Mage_Catalog_Model_Product::ENTITY => array(
36
+ Mage_Index_Model_Event::TYPE_SAVE,
37
+ Mage_Index_Model_Event::TYPE_DELETE,
38
+ Mage_Index_Model_Event::TYPE_MASS_ACTION,
39
+ )
40
+ );
41
+
42
+ /**
43
+ * Initialize resource model
44
+ *
45
+ */
46
+ protected function _construct()
47
+ {
48
+ $this->_init('foxyfeeds/feedexport_indexer');
49
+ }
50
+
51
+ /**
52
+ * Retrieve Indexer name
53
+ *
54
+ * @return string
55
+ */
56
+ public function getName()
57
+ {
58
+ return Mage::helper('foxyfeeds')->__('FF Foxyfeeds Product Feed Export');
59
+ }
60
+
61
+ /**
62
+ * Retrieve Indexer description
63
+ *
64
+ * @return string
65
+ */
66
+ public function getDescription()
67
+ {
68
+ return Mage::helper('foxyfeeds')->__('FF Index product data for the Foxyfeeds product feed export');
69
+ }
70
+
71
+ /**
72
+ *
73
+ * @param Mage_Index_Model_Event $event
74
+ */
75
+ protected function _registerEvent(Mage_Index_Model_Event $event)
76
+ {
77
+ $dataObj = $event->getDataObject();
78
+ switch($event->getType()) {
79
+ case Mage_Index_Model_Event::TYPE_SAVE:
80
+ $event->addNewData(self::EVENT_KEY_UPDATE_PRODUCT_ID, $dataObj->getId());
81
+ break;
82
+ case Mage_Index_Model_Event::TYPE_DELETE:
83
+ $event->addNewData(self::EVENT_KEY_DELETE_PRODUCT_ID, $dataObj->getId());
84
+ break;
85
+ case Mage_Index_Model_Event::TYPE_MASS_ACTION:
86
+ $event->addNewData(self::EVENT_KEY_MASS_ACTION_PRODUCT_IDS, $dataObj->getProductIds());
87
+ break;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * @param Mage_Index_Model_Event $event
93
+ */
94
+ protected function _processEvent(Mage_Index_Model_Event $event)
95
+ {
96
+ $data = $event->getNewData();
97
+ if(
98
+ (isset($data[self::EVENT_KEY_UPDATE_PRODUCT_ID]) && !empty($data[self::EVENT_KEY_UPDATE_PRODUCT_ID]))
99
+ || (isset($data[self::EVENT_KEY_DELETE_PRODUCT_ID]) && !empty($data[self::EVENT_KEY_DELETE_PRODUCT_ID]))
100
+ ||(isset($data[self::EVENT_KEY_MASS_ACTION_PRODUCT_IDS]) && !empty($data[self::EVENT_KEY_MASS_ACTION_PRODUCT_IDS]))
101
+ ) {
102
+ $this->callEventHandler($event);
103
+ }
104
+ }
105
+
106
+ /**
107
+ * match whether the reindexing should be fired
108
+ * @param Mage_Index_Model_Event $event
109
+ * @return bool
110
+ */
111
+ public function matchEvent(Mage_Index_Model_Event $event)
112
+ {
113
+ $data = $event->getNewData();
114
+ if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
115
+ return $data[self::EVENT_MATCH_RESULT_KEY];
116
+ }
117
+ $entity = $event->getEntity();
118
+ $result = true;
119
+ if($entity != Mage_Catalog_Model_Product::ENTITY){
120
+ return;
121
+ }
122
+ $event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
123
+ return $result;
124
+ }
125
+
126
+ /**
127
+ * Rebuild all index data
128
+ */
129
+ public function reindexAll()
130
+ {
131
+ $this->_getResource()->reindexAll();
132
+ }
133
+
134
+ /**
135
+ * Get data for a specific productId and storeId.
136
+ * @param int $productId
137
+ * @param int $storeId
138
+ * @return mixed
139
+ */
140
+ public function getDataForProductIdAndStoreId($productId, $storeId) {
141
+ return $this->_getResource()->getDataForProductIdAndStoreId($productId, $storeId);
142
+ }
143
+
144
+ /**
145
+ * Truncate the index table.
146
+ */
147
+ public function truncateIndexTable() {
148
+ $this->_getResource()->truncateIndexTable();
149
+ }
150
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Observer.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Observer
24
+ {
25
+ /**
26
+ * @param Varien_Event_Observer $observer
27
+ */
28
+ public function modelConfigDataSaveBefore(Varien_Event_Observer $observer) {
29
+ $event = $observer->getEvent();
30
+ $config = $event->getObject();
31
+ $section = $config->getSection();
32
+ if(strtolower($section) == 'foxyfeeds_export') {
33
+ $groups = $config->getGroups();
34
+ $groups = $this->_checkDataFields($groups);
35
+ $config->setGroups($groups);
36
+ $this->_checkProductUrlGenerationMethod($groups);
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Change the status of the product feed export to require reindex.
42
+ */
43
+ protected function _changeStatusToRequireReindex() {
44
+ // set status to require reindex for the product export feed index
45
+ /** @var $process Mage_Index_Model_Indexer */
46
+ $process = Mage::getSingleton('index/indexer')->getProcessByCode('foxyfeeds_feed_export');
47
+ $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
48
+ }
49
+
50
+ /**
51
+ * Checks if the data fields have changed. In that case set the index status to "require reindex" for the
52
+ * product feed export index.
53
+ * It will also create a (session) message for the user. This notice will be shown if the user
54
+ * selected too many data fields if the export method is set to "live" and will tell the user that the
55
+ * export will now use the indexed method and that the product feed export index needs to be kept up to date.
56
+ * @param array $groups
57
+ */
58
+ protected function _checkDataFields($groups) {
59
+ if(isset($groups['foxyfeeds_productfeed']['fields']['foxyfeeds_exportfields']['value'])) {
60
+ $currentDataFields = unserialize(Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/foxyfeeds_exportfields'));
61
+ $dataFields = $groups['foxyfeeds_productfeed']['fields']['foxyfeeds_exportfields']['value'];
62
+ if(isset($dataFields['__empty'])) {
63
+ unset($dataFields['__empty']);
64
+ }
65
+
66
+ // check if the selected data fields have changed
67
+ if(count($dataFields) != count($currentDataFields)) {
68
+ $this->_changeStatusToRequireReindex();
69
+
70
+ // add a notice if the export method is set to live and there are too many datafields selected
71
+ if(
72
+ $groups['foxyfeeds_productfeed']['fields']['foxyfeeds_export_method']['value'] == Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Exportmethod::EXPORT_METHOD_LIVE
73
+ && count($dataFields) > Foxyfeeds_Foxyfeeds_Helper_Export::MAX_ATTRIBUTE_COUNT_FOR_LIVE_EXPORT
74
+ ) {
75
+ Mage::getSingleton('adminhtml/session')->addNotice(
76
+ Mage::helper('foxyfeeds')->__("FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.", Foxyfeeds_Foxyfeeds_Helper_Export::MAX_ATTRIBUTE_COUNT_FOR_LIVE_EXPORT)
77
+ );
78
+ $groups['foxyfeeds_productfeed']['fields']['foxyfeeds_export_method']['value'] = Foxyfeeds_Foxyfeeds_Model_Adminhtml_Source_Exportmethod::EXPORT_METHOD_INDEXED;
79
+ }
80
+ }
81
+ }
82
+ return $groups;
83
+ }
84
+
85
+ /**
86
+ * Checks if the method to generate the product url has been changed. In this case
87
+ * set the indexer process status to require reindex if the export method is set to indexed.
88
+ * @param array $groups
89
+ */
90
+ protected function _checkProductUrlGenerationMethod($groups) {
91
+ $currentProductUrlGenerationMethod = Mage::getStoreConfig('foxyfeeds_export/foxyfeeds_productfeed/product_url_generation_method');
92
+ if(isset($groups['foxyfeeds_productfeed']['fields']['product_url_generation_method']['value'])) {
93
+ $method = $groups['foxyfeeds_productfeed']['fields']['product_url_generation_method']['value'];
94
+ if($method != $currentProductUrlGenerationMethod) {
95
+ $this->_changeStatusToRequireReindex();
96
+ }
97
+ }
98
+ }
99
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Resource/Feedexport/Indexer.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer extends Mage_Index_Model_Resource_Abstract
24
+ {
25
+ /**
26
+ * Define main index table
27
+ *
28
+ */
29
+ protected function _construct()
30
+ {
31
+ $this->_init('foxyfeeds/product_feed_export_index', 'product_id');
32
+ }
33
+
34
+ /**
35
+ * @param array $productIds the product ids that should be reindexed
36
+ * @param array $storeIds the store ids that should be used for reindexing the product data
37
+ * @return Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer
38
+ * @throws Exception
39
+ */
40
+ protected function _reindexProductIds($productIds, $storeIds) {
41
+ if(empty($productIds)) {
42
+ $productIds = array();
43
+ }
44
+
45
+ if(!is_array($productIds)) {
46
+ $productIds = array($productIds);
47
+ }
48
+
49
+ if(!is_array($storeIds)) {
50
+ $storeIds = array($storeIds);
51
+ }
52
+
53
+ $adapter = $this->_getWriteAdapter();
54
+
55
+ try {
56
+ /** @var $export Foxyfeeds_Foxyfeeds_Model_Export */
57
+ $export = Mage::helper('foxyfeeds/export');
58
+ $chunkSize = $export->getChunkSize();
59
+ foreach($storeIds as $storeId) {
60
+
61
+ $collection = $export->getProductCollection($storeId, $productIds);
62
+ if($collection === null) {
63
+ continue;
64
+ }
65
+ $pages = ceil($collection->getSize() / $chunkSize);
66
+
67
+ $collection->setPageSize($chunkSize);
68
+
69
+ for($i = 1; $i <= $pages; $i++) {
70
+ $adapter->beginTransaction();
71
+
72
+ $collection->clear();
73
+ $collection->setCurPage($i);
74
+ foreach($collection as $item) {
75
+ $where = array();
76
+ $where[] = $adapter->quoteInto('product_id = ?', $item->getId());
77
+ $where[] = $adapter->quoteInto('store_id = ?', $storeId);
78
+ $adapter->delete($this->getMainTable(), $where);
79
+
80
+ $bind = array();
81
+
82
+ $productData = $export->getFullProductData($item);
83
+
84
+ $productXml = new SimpleXMLElement('<product></product>');
85
+ $export->productToXml($productData, $productXml);
86
+ $dom = dom_import_simplexml($productXml);
87
+
88
+ $bind['product_id'] = $item->getId();
89
+ $bind['store_id'] = $storeId;
90
+ $bind['sku'] = $item->getData('sku');
91
+ $bind['created_at'] = now();
92
+ $bind['product_data'] = $dom->ownerDocument->saveXML($dom->ownerDocument->documentElement);
93
+ $adapter->insert($this->getMainTable(), $bind);
94
+ }
95
+
96
+ $adapter->commit();
97
+ }
98
+ }
99
+ } catch (Exception $e) {
100
+ $adapter->rollBack();
101
+ throw $e;
102
+ }
103
+
104
+ return $this;
105
+ }
106
+
107
+ /**
108
+ * @return Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer
109
+ * @throws Exception
110
+ */
111
+ public function reindexAll() {
112
+ $storeIds = Mage::helper('foxyfeeds')->getAllStoreIds();
113
+ $this->_reindexProductIds(null, $storeIds);
114
+ return $this;
115
+ }
116
+
117
+ /**
118
+ * Process produce delete
119
+ * If the deleted product was found in a composite product(s) update it
120
+ *
121
+ * @param Mage_Index_Model_Event $event
122
+ * @return Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer
123
+ */
124
+ public function catalogProductDelete(Mage_Index_Model_Event $event)
125
+ {
126
+ $data = $event->getNewData();
127
+ if(!isset($data[Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer::EVENT_KEY_UPDATE_PRODUCT_ID])) {
128
+ return $this;
129
+ }
130
+ /** @var $dataObject Mage_Catalog_Model_Product */
131
+ $dataObject = $event->getDataObject();
132
+ $storeIds = $dataObject->getStoreId();
133
+ if($storeIds == 0) {
134
+ $storeIds = $event->getDataObject()->getStoreIds();
135
+ }
136
+ $this->_reindexProductIds($data[Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer::EVENT_KEY_UPDATE_PRODUCT_ID], $storeIds);
137
+
138
+ return $this;
139
+ }
140
+
141
+ /**
142
+ * Process product save.
143
+ * Method is responsible for index support
144
+ * when product was saved and changed attribute(s) has an effect on price.
145
+ *
146
+ * @param Mage_Index_Model_Event $event
147
+ * @return Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer
148
+ */
149
+ public function catalogProductSave(Mage_Index_Model_Event $event)
150
+ {
151
+ $data = $event->getNewData();
152
+ if(!isset($data[Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer::EVENT_KEY_UPDATE_PRODUCT_ID])) {
153
+ return $this;
154
+ }
155
+ /** @var $dataObject Mage_Catalog_Model_Product */
156
+ $dataObject = $event->getDataObject();
157
+ $storeIds = $dataObject->getStoreId();
158
+ if($storeIds == 0) {
159
+ $storeIds = $event->getDataObject()->getStoreIds();
160
+ }
161
+ $this->_reindexProductIds($data[Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer::EVENT_KEY_UPDATE_PRODUCT_ID], $storeIds);
162
+
163
+ return $this;
164
+ }
165
+
166
+ /**
167
+ * Process product mass update action
168
+ *
169
+ * @param Mage_Index_Model_Event $event
170
+ * @return Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer
171
+ */
172
+ public function catalogProductMassAction(Mage_Index_Model_Event $event)
173
+ {
174
+ $data = $event->getNewData();
175
+ if(!isset($data[Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer::EVENT_KEY_MASS_ACTION_PRODUCT_IDS])) {
176
+ return $this;
177
+ }
178
+
179
+ $storeIds = Mage::helper('foxyfeeds')->getAllStoreIds();
180
+ $this->_reindexProductIds($data[Foxyfeeds_Foxyfeeds_Model_Feedexport_Indexer::EVENT_KEY_MASS_ACTION_PRODUCT_IDS], $storeIds);
181
+
182
+ return $this;
183
+ }
184
+
185
+ /**
186
+ * Load the entry for a specific productId and storeId.
187
+ * @param int $productId
188
+ * @param int $storeId
189
+ * @return array
190
+ */
191
+ public function getDataForProductIdAndStoreId($productId, $storeId) {
192
+ $read = $this->getReadConnection();
193
+ if($read) {
194
+ $select = $read->select()
195
+ ->from($this->getTable('foxyfeeds/product_feed_export_index'))
196
+ ->where($read->quoteInto('product_id = ?', $productId))
197
+ ->where($read->quoteInto('store_id = ?', $storeId));
198
+
199
+ return $read->fetchRow($select);
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Truncate the index table.
205
+ */
206
+ public function truncateIndexTable() {
207
+ $write = $this->_getWriteAdapter();
208
+
209
+ if($write) {
210
+ $write->truncateTable($this->getMainTable());
211
+ }
212
+ }
213
+ }
app/code/community/Foxyfeeds/Foxyfeeds/Model/Resource/Feedexport/Indexer/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Model_Resource_Feedexport_Indexer_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
24
+ {
25
+ /**
26
+ * Model initialization
27
+ *
28
+ */
29
+ protected function _construct() {
30
+ $this->_init('foxyfeeds/feedexport_indexer');
31
+ }
32
+ }
app/code/community/Foxyfeeds/Foxyfeeds/controllers/Adminhtml/Foxyfeeds/FeedexportController.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ class Foxyfeeds_Foxyfeeds_Adminhtml_Foxyfeeds_FeedexportController extends Mage_Adminhtml_Controller_Action
24
+ {
25
+ public function indexAction() {
26
+ $this->loadLayout();
27
+ $this->renderLayout();
28
+ }
29
+
30
+ public function viewAction(){
31
+ $storeId = $this->getRequest()->getParam('store', false);
32
+ if($storeId === false) {
33
+ Mage::getSingleton('adminhtml/session')->addNotice(
34
+ Mage::helper('foxyfeeds')->__('FF Please specify store.')
35
+ );
36
+ $this->_redirect('*/*/');
37
+ return;
38
+ }
39
+ $this->loadLayout();
40
+ $this->renderLayout();
41
+ }
42
+
43
+ public function truncateAction() {
44
+ $helper = Mage::helper('foxyfeeds');
45
+
46
+ Mage::getModel('foxyfeeds/feedexport_indexer')->truncateIndexTable();
47
+
48
+ /** @var $process Mage_Index_Model_Indexer */
49
+ $process = Mage::getSingleton('index/indexer')->getProcessByCode('foxyfeeds_feed_export');
50
+ $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
51
+
52
+ Mage::getSingleton('adminhtml/session')->addSuccess($helper->__('FF The data has been deleted. Please reindex the export data.'));
53
+ $this->_redirect('*/*/');
54
+ }
55
+ }
app/code/community/Foxyfeeds/Foxyfeeds/controllers/IndexController.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
13
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
14
+ * needs please refer to http://www.foxyfeeds.com for more information.
15
+ *
16
+ * @category Foxyfeeds
17
+ * @package Foxyfeeds_Foxyfeeds
18
+ * @subpackage controllers
19
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
20
+ * @author Björn Wehner <info@foxyfeeds.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.foxyfeeds.com
23
+ */
24
+ class Foxyfeeds_Foxyfeeds_IndexController extends Mage_Core_Controller_Front_Action {
25
+
26
+ public function indexAction() {
27
+ Mage::helper('foxyfeeds')->createXml();
28
+ $this->getResponse()->setRedirect(Mage::app()->getStore()->getBaseUrl());
29
+ }
30
+
31
+ }
32
+
33
+ ?>
app/code/community/Foxyfeeds/Foxyfeeds/etc/adminhtml.xml ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?><!--
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @subpackage etc
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ -->
24
+ <config>
25
+ <menu>
26
+ <system translate="title" module="adminhtml">
27
+ <children>
28
+ <convert>
29
+ <children>
30
+ <ff_product_feed_export translate="title" module="foxyfeeds">
31
+ <title>FF Foxyfeeds Product Feed Export</title>
32
+ <action>adminhtml/foxyfeeds_feedexport</action>
33
+ <sort_order>100</sort_order>
34
+ </ff_product_feed_export>
35
+ </children>
36
+ </convert>
37
+ </children>
38
+ </system>
39
+ </menu>
40
+ <acl>
41
+ <resources>
42
+ <admin>
43
+ <children>
44
+ <system>
45
+ <children>
46
+ <convert>
47
+ <children>
48
+ <ff_product_feed_export>
49
+ <title>FF Foxyfeeds Product Feed Export</title>
50
+ <sort_order>100</sort_order>
51
+ </ff_product_feed_export>
52
+ </children>
53
+ </convert>
54
+ <config>
55
+ <children>
56
+ <foxyfeeds_general translate="title" module="foxyfeeds">
57
+ <title>foxyfeeds_general Section</title>
58
+ <sort_order>100</sort_order>
59
+ </foxyfeeds_general>
60
+ <foxyfeeds_tracking translate="title" module="foxyfeeds">
61
+ <title>foxyfeeds_tracking Section</title>
62
+ <sort_order>200</sort_order>
63
+ </foxyfeeds_tracking>
64
+ <foxyfeeds_export translate="title" module="foxyfeeds">
65
+ <title>foxyfeeds_export Section</title>
66
+ <sort_order>300</sort_order>
67
+ </foxyfeeds_export>
68
+ </children>
69
+ </config>
70
+ </children>
71
+ </system>
72
+ </children>
73
+ </admin>
74
+ </resources>
75
+ </acl>
76
+ </config>
app/code/community/Foxyfeeds/Foxyfeeds/etc/config.xml ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?><!--
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @subpackage etc
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Foxyfeeds_Foxyfeeds>
27
+ <version>1.0.0</version>
28
+ </Foxyfeeds_Foxyfeeds>
29
+ </modules>
30
+ <global>
31
+ <index>
32
+ <indexer>
33
+ <foxyfeeds_feed_export>
34
+ <model>foxyfeeds/feedexport_indexer</model>
35
+ </foxyfeeds_feed_export>
36
+ </indexer>
37
+ </index>
38
+ <models>
39
+ <foxyfeeds>
40
+ <class>Foxyfeeds_Foxyfeeds_Model</class>
41
+ <resourceModel>foxyfeeds_resource</resourceModel>
42
+ </foxyfeeds>
43
+ <foxyfeeds_resource>
44
+ <class>Foxyfeeds_Foxyfeeds_Model_Resource</class>
45
+ <entities>
46
+ <product_feed_export_index>
47
+ <table>foxyfeeds_product_feed_export_index</table>
48
+ </product_feed_export_index>
49
+ </entities>
50
+ </foxyfeeds_resource>
51
+ </models>
52
+ <resources>
53
+ <default_setup>
54
+ <connection>
55
+ <charset>utf8</charset>
56
+ </connection>
57
+ </default_setup>
58
+ <foxyfeeds_setup>
59
+ <setup>
60
+ <module>Foxyfeeds_Foxyfeeds</module>
61
+ </setup>
62
+ <connection>
63
+ <charset>utf8</charset>
64
+ <use>core_setup</use>
65
+ </connection>
66
+ </foxyfeeds_setup>
67
+ </resources>
68
+ <blocks>
69
+ <foxyfeeds>
70
+ <class>Foxyfeeds_Foxyfeeds_Block</class>
71
+ </foxyfeeds>
72
+ </blocks>
73
+ <helpers>
74
+ <foxyfeeds>
75
+ <class>Foxyfeeds_Foxyfeeds_Helper</class>
76
+ </foxyfeeds>
77
+ </helpers>
78
+ <events>
79
+ <model_config_data_save_before>
80
+ <observers>
81
+ <foxyfeeds_check_for_changed_export_data_fields>
82
+ <type>singleton</type>
83
+ <class>foxyfeeds/observer</class>
84
+ <method>modelConfigDataSaveBefore</method>
85
+ </foxyfeeds_check_for_changed_export_data_fields>
86
+ </observers>
87
+ </model_config_data_save_before>
88
+ </events>
89
+ </global>
90
+ <adminhtml>
91
+ <translate>
92
+ <modules>
93
+ <Foxyfeeds_Foxyfeeds>
94
+ <files>
95
+ <default>Foxyfeeds_Foxyfeeds.csv</default>
96
+ </files>
97
+ </Foxyfeeds_Foxyfeeds>
98
+ </modules>
99
+ </translate>
100
+ <layout>
101
+ <updates>
102
+ <Foxyfeeds_Foxyfeeds>
103
+ <file>foxyfeeds.xml</file>
104
+ </Foxyfeeds_Foxyfeeds>
105
+ </updates>
106
+ </layout>
107
+ </adminhtml>
108
+ <frontend>
109
+ <routers>
110
+ <foxyfeeds>
111
+ <use>standard</use>
112
+ <args>
113
+ <module>Foxyfeeds_Foxyfeeds</module>
114
+ <frontName>foxyfeeds</frontName>
115
+ </args>
116
+ </foxyfeeds>
117
+ </routers>
118
+ <layout>
119
+ <updates>
120
+ <Foxyfeeds_Foxyfeeds>
121
+ <file>Foxyfeeds/foxyfeeds.xml</file>
122
+ </Foxyfeeds_Foxyfeeds>
123
+ </updates>
124
+ </layout>
125
+ </frontend>
126
+ <default>
127
+ <foxyfeeds_tracking>
128
+ <foxyfeeds_tracking>
129
+ <foxyfeeds_useTracking>0</foxyfeeds_useTracking>
130
+ <method>2</method>
131
+ <foxyfeeds_cookiemode>last</foxyfeeds_cookiemode>
132
+ <foxyfeeds_articlenumber>product_id</foxyfeeds_articlenumber>
133
+ </foxyfeeds_tracking>
134
+ </foxyfeeds_tracking>
135
+ <foxyfeeds_export>
136
+ <foxyfeeds_productfeed>
137
+ <foxyfeeds_export_method>1</foxyfeeds_export_method>
138
+ <foxyfeeds_useExport>0</foxyfeeds_useExport>
139
+ <product_url_generation_method>4</product_url_generation_method>
140
+ </foxyfeeds_productfeed>
141
+ </foxyfeeds_export>
142
+ </default>
143
+ <admin>
144
+ <routers>
145
+ <adminhtml>
146
+ <args>
147
+ <modules>
148
+ <Foxyfeeds_Foxyfeeds after="Mage_Adminhtml">Foxyfeeds_Foxyfeeds_Adminhtml</Foxyfeeds_Foxyfeeds>
149
+ </modules>
150
+ </args>
151
+ </adminhtml>
152
+ </routers>
153
+ </admin>
154
+ </config>
app/code/community/Foxyfeeds/Foxyfeeds/etc/system.xml ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?><!--
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @subpackage etc
18
+ * @copyright Copyright (c) 2012 <info@Foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ -->
24
+ <config>
25
+ <tabs>
26
+ <foxyfeeds_config translate="label" module="foxyfeeds">
27
+ <label><![CDATA[<div style="overflow:hidden; background-image: url('https://go.foxyfeeds.com/css/gfx/logo.foxyfeeds.png');background-size: 70px; background-repeat: no-repeat; background-position: 0px 1px;"><div style="display:block; height: 20px;"></div></div>]]></label>
28
+ <class>tab-foxyfeeds</class>
29
+ <sort_order>401</sort_order>
30
+ </foxyfeeds_config>
31
+ </tabs>
32
+ <sections>
33
+ <foxyfeeds_tracking translate="label" module="foxyfeeds">
34
+ <label>FF Tracking</label>
35
+ <tab>foxyfeeds_config</tab>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>2000</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ <groups>
42
+ <hint>
43
+ <frontend_model>foxyfeeds/adminhtml_hintlogo</frontend_model>
44
+ <sort_order>0</sort_order>
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
+ </hint>
49
+ <foxyfeeds_tracking translate="label">
50
+ <label>FF Tracking Settings</label>
51
+ <frontend_type>text</frontend_type>
52
+ <expanded>1</expanded>
53
+ <sort_order>2</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ <fields>
58
+ <foxyfeeds_useTracking>
59
+ <label>FF Activate?</label>
60
+ <frontend_type>select</frontend_type>
61
+ <source_model>adminhtml/system_config_source_yesno</source_model>
62
+ <sort_order>0</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ </foxyfeeds_useTracking>
67
+ <method>
68
+ <label>FF Tracking Method</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>foxyfeeds/adminhtml_source_trackingmethod</source_model>
71
+ <sort_order>5</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ </method>
76
+ <foxyfeeds_cookiemode>
77
+ <label>FF Cookiemode</label>
78
+ <frontend_type>select</frontend_type>
79
+ <source_model>foxyfeeds/adminhtml_source_cookiemode</source_model>
80
+ <sort_order>10</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>1</show_in_store>
84
+ </foxyfeeds_cookiemode>
85
+ <foxyfeeds_trackingkeys>
86
+ <label>FF Trackingkeys</label>
87
+ <frontend_model>foxyfeeds/adminhtml_field_trackingkeys</frontend_model>
88
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
89
+ <sort_order>20</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </foxyfeeds_trackingkeys>
94
+ <foxyfeeds_articlenumber>
95
+ <label>FF Articlenumber</label>
96
+ <frontend_type>select</frontend_type>
97
+ <source_model>foxyfeeds/adminhtml_source_articlenumber</source_model>
98
+ <sort_order>30</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </foxyfeeds_articlenumber>
103
+ </fields>
104
+ </foxyfeeds_tracking>
105
+ </groups>
106
+ </foxyfeeds_tracking>
107
+ <foxyfeeds_export translate="label" module="foxyfeeds">
108
+ <label>FF Data Feed Export</label>
109
+ <tab>foxyfeeds_config</tab>
110
+ <frontend_type>text</frontend_type>
111
+ <sort_order>3000</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <groups>
116
+ <hint>
117
+ <frontend_model>foxyfeeds/adminhtml_hintlogo</frontend_model>
118
+ <sort_order>0</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>1</show_in_store>
122
+ </hint>
123
+ <foxyfeeds_productfeed translate="label">
124
+ <label>FF Export Settings</label>
125
+ <frontend_type>text</frontend_type>
126
+ <expanded>1</expanded>
127
+ <sort_order>1</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>1</show_in_store>
131
+ <fields>
132
+ <foxyfeeds_useExport>
133
+ <label>FF Activate?</label>
134
+ <frontend_type>select</frontend_type>
135
+ <source_model>adminhtml/system_config_source_yesno</source_model>
136
+ <sort_order>10</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ </foxyfeeds_useExport>
141
+ <foxyfeeds_password translate="label">
142
+ <label>FF Password</label>
143
+ <comment>FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'</comment>
144
+ <frontend_type>password</frontend_type>
145
+ <sort_order>20</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ </foxyfeeds_password>
150
+ <foxyfeeds_export_method>
151
+ <label>FF Export Method</label>
152
+ <comment>FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.</comment>
153
+ <frontend_type>select</frontend_type>
154
+ <source_model>foxyfeeds/adminhtml_source_exportmethod</source_model>
155
+ <sort_order>25</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ </foxyfeeds_export_method>
160
+ <product_url_generation_method>
161
+ <label>FF Product Url Generation Method</label>
162
+ <frontend_type>select</frontend_type>
163
+ <source_model>foxyfeeds/adminhtml_source_producturlgeneration</source_model>
164
+ <sort_order>29</sort_order>
165
+ <show_in_default>1</show_in_default>
166
+ <show_in_website>1</show_in_website>
167
+ <show_in_store>1</show_in_store>
168
+ </product_url_generation_method>
169
+ <foxyfeeds_exportfields>
170
+ <label>FF Select data fields</label>
171
+ <comment>FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)</comment>
172
+ <frontend_model>foxyfeeds/adminhtml_field_exportfields</frontend_model>
173
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
174
+ <sort_order>30</sort_order>
175
+ <show_in_default>1</show_in_default>
176
+ <show_in_website>1</show_in_website>
177
+ <show_in_store>1</show_in_store>
178
+ </foxyfeeds_exportfields>
179
+ <foxyfeeds_specialexportfields>
180
+ <label>FF Create static data fields</label>
181
+ <comment>FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.</comment>
182
+ <frontend_model>foxyfeeds/adminhtml_field_specialfields</frontend_model>
183
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
184
+ <sort_order>40</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ </foxyfeeds_specialexportfields>
189
+ <foxyfeeds_replacefields>
190
+ <label>FF Product variant data fields</label>
191
+ <comment>FF Select the data fields you want to be overwritten by the respective value of the parent article.</comment>
192
+ <frontend_model>foxyfeeds/adminhtml_field_replacefields</frontend_model>
193
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
194
+ <sort_order>50</sort_order>
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>1</show_in_website>
197
+ <show_in_store>1</show_in_store>
198
+ </foxyfeeds_replacefields>
199
+ <foxyfeeds_imagenumber>
200
+ <label>FF Number additional productimages</label>
201
+ <comment>FF How many additional productimages should be exported?</comment>
202
+ <frontend_type>select</frontend_type>
203
+ <source_model>foxyfeeds/adminhtml_source_imagenumber</source_model>
204
+ <sort_order>60</sort_order>
205
+ <show_in_default>1</show_in_default>
206
+ <show_in_website>1</show_in_website>
207
+ <show_in_store>1</show_in_store>
208
+ </foxyfeeds_imagenumber>
209
+ </fields>
210
+ </foxyfeeds_productfeed>
211
+ </groups>
212
+ </foxyfeeds_export>
213
+ </sections>
214
+ </config>
app/code/community/Foxyfeeds/Foxyfeeds/sql/foxyfeeds_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package Foxyfeeds_Foxyfeeds
17
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
18
+ * @author Björn Wehner <info@foxyfeeds.com>
19
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
20
+ * @link http://www.foxyfeeds.com
21
+ */
22
+
23
+ $installer = $this;
24
+
25
+ $installer->startSetup();
26
+ $adapter = $installer->getConnection();
27
+
28
+ /**
29
+ * Create table 'foxyfeeds/product_feed_export_index'
30
+ */
31
+ $table = $adapter->newTable($installer->getTable('foxyfeeds/product_feed_export_index'))
32
+ ->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 10, array(
33
+ 'unsigned' => true,
34
+ 'nullable' => false,
35
+ 'primary' => true,
36
+ ), 'product_id')
37
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER, 5, array(
38
+ 'nullable' => false,
39
+ 'unsigned' => true,
40
+ 'primary' => true,
41
+ ), 'store_id')
42
+ ->addColumn('sku', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
43
+ 'nullable' => false,
44
+ ), 'sku')
45
+ ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
46
+ 'nullable' => false,
47
+ ), 'created_at')
48
+ ->addColumn('product_data', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
49
+ 'nullable' => false,
50
+ ), 'product_data')
51
+ ->addForeignKey('FK_FF_FEED_EXPORT_PRODUCT_ID',
52
+ 'product_id',
53
+ $installer->getTable('catalog/product'),
54
+ 'entity_id',
55
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
56
+ Varien_Db_Ddl_Table::ACTION_CASCADE
57
+ )
58
+ ->addForeignKey('FK_FF_FEED_EXPORT_STORE_ID',
59
+ 'store_id',
60
+ $installer->getTable('core/store'),
61
+ 'store_id',
62
+ Varien_Db_Ddl_Table::ACTION_CASCADE,
63
+ Varien_Db_Ddl_Table::ACTION_CASCADE
64
+ )
65
+ ->addIndex('IDX_FF_FEED_EXPORT_PRODUCT_ID', 'product_id')
66
+ ->addIndex('IDX_FF_FEED_EXPORT_STORE_ID', 'store_id')
67
+ ->addIndex('IDX_FF_FEED_EXPORT_SKU', 'sku');
68
+ $adapter->createTable($table);
69
+
70
+ $installer->endSetup();
app/design/adminhtml/base/default/layout/foxyfeeds.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?><!--
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Clicktracking to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Clicktracking for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package design_frontend_base_default
17
+ * @subpackage layout_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ -->
24
+ <layout version="0.1.0">
25
+ <adminhtml_foxyfeeds_feedexport_index>
26
+ <reference name="content">
27
+ <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher" template="store/switcher.phtml">
28
+ <action method="setUseConfirm">
29
+ <params>0</params>
30
+ </action>
31
+ </block>
32
+ <block type="foxyfeeds/adminhtml_feedexport" name="feedexport_grid" />
33
+ </reference>
34
+ </adminhtml_foxyfeeds_feedexport_index>
35
+
36
+ <adminhtml_foxyfeeds_feedexport_view>
37
+ <reference name="content">
38
+ <block type="foxyfeeds/adminhtml_feedexport_view" name="feedexport_view" />
39
+ </reference>
40
+ </adminhtml_foxyfeeds_feedexport_view>
41
+ </layout>
app/design/adminhtml/base/default/template/foxyfeeds/array_dropdown.phtml ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package design_adminhtml_base_default
17
+ * @subpackage template_foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ ?>
24
+
25
+ <?php
26
+ $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
27
+
28
+ $_colspan = 2;
29
+ if (!$this->_addAfter) {
30
+ $_colspan -= 1;
31
+ }
32
+ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
33
+ ?>
34
+
35
+ <div class="grid" id="grid<?php echo $_htmlId ?>">
36
+ <table cellpadding="0" cellspacing="0" class="border">
37
+ <tbody>
38
+
39
+ <tr class="headings" id="headings<?php echo $_htmlId ?>">
40
+ <?php foreach ($this->_columns as $columnName => $column):?>
41
+ <th><?php echo $column['label'] ?></th>
42
+ <?php endforeach;?>
43
+ <th <?php echo $_colspan?>></th>
44
+ </tr>
45
+
46
+ <tr id="addRow<?php echo $_htmlId ?>">
47
+ <td colspan="<?php echo count($this->_columns) ?>"></td>
48
+ <td <?php echo $_colspan?>>
49
+ <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>">
50
+ <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
51
+ </button>
52
+ </td>
53
+ </tr>
54
+
55
+ </tbody>
56
+ </table>
57
+ <input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
58
+ </div>
59
+ <div id="empty<?php echo $_htmlId ?>">
60
+ <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>">
61
+ <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
62
+ </button>
63
+ </div>
64
+
65
+ <script type="text/javascript">
66
+ //<![CDATA[
67
+ // create row creator
68
+ var arrayRow<?php echo $_htmlId ?> = {
69
+ // define row prototypeJS template
70
+ template : new Template(
71
+ '<tr id="#{_id}">'
72
+ <?php foreach ($this->_columns as $columnName => $column):?>
73
+ +'<td class="#{_id}-<?php echo $columnName?>">'
74
+ +'<?php echo $this->_renderCellTemplate($columnName)?>'
75
+ +'<\/td>'
76
+ <?php endforeach;?>
77
+ <?php if ($this->_addAfter):?>
78
+ +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><span><span><?php echo Mage::helper('adminhtml')->__('Add after') ?><\/span><\/span><\/span><\/button><\/td>'
79
+ <?php endif;?>
80
+ +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><span><span><?php echo Mage::helper('adminhtml')->__('Delete') ?><\/span><\/span><\/span><\/button><\/td>'
81
+ +'<\/tr>'
82
+ ),
83
+
84
+ rowsCount : 0,
85
+
86
+ add : function(templateData, insertAfterId)
87
+ {
88
+ // generate default template data
89
+ if ('' == templateData) {
90
+ var d = new Date();
91
+ var templateData = {
92
+ <?php foreach ($this->_columns as $columnName => $column):?>
93
+ <?php echo $columnName ?> : '',
94
+ <?php endforeach;?>
95
+ _id : '_' + d.getTime() + '_' + d.getMilliseconds()
96
+ };
97
+ }
98
+
99
+ // insert before last row
100
+ if ('' == insertAfterId) {
101
+ Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
102
+ }
103
+ // insert after specified row
104
+ else {
105
+ Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
106
+ }
107
+
108
+ // set the selected drop-down list item
109
+ <?php foreach ($this->_columns as $columnName => $column):?>
110
+ var options = $$('td.' + templateData._id + '-' + '<?php echo $columnName?>' + ' option')
111
+ for(var index = 0; index < options.length; ++index)
112
+ {
113
+ var option = options[index]
114
+ if(option.getAttribute('value') == templateData.<?php echo $columnName?>)
115
+ {
116
+ option.selected = true
117
+ }
118
+ }
119
+ <?php endforeach;?>
120
+
121
+ <?php if ($this->_addAfter):?>
122
+ Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
123
+ <?php endif;?>
124
+
125
+ this.rowsCount += 1;
126
+ },
127
+
128
+ del : function(rowId)
129
+ {
130
+ $(rowId).remove();
131
+ this.rowsCount -= 1;
132
+ if (0 == this.rowsCount) {
133
+ this.showButtonOnly();
134
+ }
135
+ },
136
+
137
+ showButtonOnly : function()
138
+ {
139
+ $('grid<?php echo $_htmlId ?>').hide();
140
+ $('empty<?php echo $_htmlId ?>').show();
141
+ }
142
+ }
143
+
144
+ // bind add action to "Add" button in last row
145
+ Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
146
+
147
+ // add existing rows
148
+ <?php
149
+ $_addAfterId = "headings{$_htmlId}";
150
+ foreach ($this->getArrayRows() as $_rowId => $_row) {
151
+ echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
152
+ $_addAfterId = $_rowId;
153
+ }
154
+ ?>
155
+
156
+ // initialize standalone button
157
+ $('empty<?php echo $_htmlId ?>').hide();
158
+ Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () {
159
+ $('grid<?php echo $_htmlId ?>').show();
160
+ $('empty<?php echo $_htmlId ?>').hide();
161
+ arrayRow<?php echo $_htmlId ?>.add('', '');
162
+ });
163
+
164
+ // if no rows, hide grid and show button only
165
+ <?php if (!$this->getArrayRows()):?>
166
+ arrayRow<?php echo $_htmlId ?>.showButtonOnly();
167
+ <?php endif;?>
168
+
169
+ // toggle the grid, if element is disabled (depending on scope)
170
+ <?php if ($this->getElement()->getDisabled()):?>
171
+ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
172
+ <?php endif;?>
173
+ //]]>
174
+ </script>
app/design/adminhtml/base/default/template/foxyfeeds/config_hint.phtml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $config = $_SERVER['REQUEST_URI'];
3
+
4
+ ?>
5
+ <style>
6
+ .content-header {
7
+ background-image: url('https://go.foxyfeeds.com/css/gfx/foxyfeed.header.png');
8
+ background-repeat: no-repeat;
9
+ background-size: 100%;
10
+ margin-bottom: 0;
11
+ border-bottom: 0;
12
+ padding-bottom: 0;
13
+ }
14
+ .content-header table{
15
+ padding: 5px 20px 5px 10px;
16
+ }
17
+ .main-col-inner .content-header tbody{
18
+ height: 66px;
19
+ background-image: url('https://go.foxyfeeds.com/css/gfx/logo.foxyfeeds.png');
20
+ background-repeat: no-repeat;
21
+ background-position: 0 0;
22
+ }
23
+
24
+ .content-header-floating .content-header td{
25
+ height: 66px;
26
+ background-image: url('https://go.foxyfeeds.com/css/gfx/logo.foxyfeeds.png');
27
+ background-repeat: no-repeat;
28
+ background-position: 0 0;
29
+ min-width: 264px;
30
+ }
31
+
32
+ .content-header-floating .content-header tbody .form-buttons {
33
+ height: 55px;
34
+ background: none !important;
35
+ }
36
+ .content-header h3 {
37
+ display: none;
38
+ }
39
+ .content-header button{
40
+ margin-top: 23px;
41
+ margin-bottom: 22px !important;
42
+ }
43
+
44
+ .section-config:first-of-type .entry-edit-head {
45
+ padding-top: 10px;
46
+ padding-bottom: 0px;
47
+ margin-top: 0;
48
+ border-bottom: 2px solid rgba(0, 0, 0, 0.1);
49
+ border-top: 2px solid rgba(0, 0, 0, 0.1);
50
+ }
51
+
52
+ .section-config:first-of-type {
53
+ margin-top: 0px;
54
+ }
55
+
56
+ .section-config {
57
+ margin-top: 25px;
58
+ }
59
+
60
+ .section-config .entry-edit-head {
61
+ padding-top: 7px;
62
+ padding-bottom: 0px;
63
+ margin-top: 0;
64
+ background: none;
65
+ }
66
+
67
+ .section-config:first-of-type .entry-edit-head a{
68
+ font-weight: 600;
69
+ color: #fa5716;
70
+ margin-bottom: -2px;
71
+ border-top: 2px solid rgba(0, 0, 0, 0.1);
72
+ border-left: 2px solid rgba(0, 0, 0, 0.1);
73
+ border-right: 2px solid rgba(0, 0, 0, 0.1);
74
+ }
75
+
76
+ .section-config .entry-edit-head a{
77
+ font-family: "Open Sans";
78
+ font-weight: 300;
79
+ font-size: 13px;
80
+ float:left;
81
+ padding: 5px 20px 2px;
82
+ color: #53473b;
83
+ text-transform: uppercase;
84
+ background: #FFFFFF !important;
85
+ }
86
+
87
+ .section-config .entry-edit-head a:hover{
88
+ color: #fa5716;
89
+ }
90
+
91
+ .section-config:first-of-type fieldset {
92
+ padding-top: 25px;
93
+ }
94
+ .section-config fieldset {
95
+ font-size: 12px;
96
+ font-weight: 400;
97
+ font-family: "Open Sans";
98
+ border: 0px;
99
+ background: #FFFFFF !important;
100
+ }
101
+
102
+ .section-config fieldset select, .section-config fieldset input{
103
+ font-family: "Open Sans";
104
+ background: -moz-linear-gradient(center top , #d6cec6 0px, #ebe8e4 2em) repeat scroll 0 0 #e1dbd5;
105
+ padding: 3px 3px;
106
+ }
107
+
108
+ .form-list .label label {
109
+ margin-left: 10px;
110
+ }
111
+
112
+ .form-list .value .grid .headings{
113
+ background: #5c4f41;
114
+ }
115
+ .form-list .value .grid th, .form-list .value .grid td {
116
+ border: 0;
117
+ }
118
+ .form-list .value .grid th {
119
+ font-family: "Open Sans";
120
+ color: #ffffff;
121
+ font-size: 12px;
122
+ text-align: center;
123
+ }
124
+ .form-list .value .grid table{
125
+ border: 1px solid #3e352c;
126
+ background: rgba(62, 53, 44, 0.02);
127
+ }
128
+ </style>
app/design/frontend/base/default/layout/Foxyfeeds/foxyfeeds.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?><!--
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Clicktracking to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Clicktracking for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package design_frontend_base_default
17
+ * @subpackage layout_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ -->
24
+ <layout version="0.1.0">
25
+ <default>
26
+ <reference name="after_body_start">
27
+ <block type="foxyfeeds/tracking_tracking" name="cptracking" as="cptracking" template="Foxyfeeds/tracking_image.phtml" />
28
+ </reference>
29
+ <reference name="head">
30
+ <block type="foxyfeeds/tracking_tracking" name="clicktracking" as="clicktracking" template="Foxyfeeds/clicktracking_js.phtml" />
31
+ </reference>
32
+ </default>
33
+
34
+ <checkout_onepage_success>
35
+ <reference name="cptracking">
36
+ <action method="setIsSale"><param>1</param></action>
37
+ </reference>
38
+ <reference name="head">
39
+ <remove name="clicktracking" />
40
+ <block type="foxyfeeds/tracking_tracking" name="salestracking" as="salestracking" template="Foxyfeeds/salestracking_js.phtml" />
41
+ </reference>
42
+ </checkout_onepage_success>
43
+ </layout>
app/design/frontend/base/default/template/Foxyfeeds/clicktracking_js.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Clicktracking to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Clicktracking for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package design_frontend_base_default
17
+ * @subpackage template_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Bj?rn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ ?>
24
+ <?php if($this->isEnabled() && !$this->isTrackingModeImage()): ?>
25
+ <script type="text/javascript" src="//content.cptrack.de/clicks.js"></script>
26
+ <?php endif; ?>
app/design/frontend/base/default/template/Foxyfeeds/salestracking_js.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Clicktracking to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Clicktracking for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package design_frontend_base_default
17
+ * @subpackage template_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Bj?rn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ ?>
24
+ <?php if($this->isEnabled() && !$this->isTrackingModeImage()): ?>
25
+ <?php $_order = $this->getOrder(); ?>
26
+
27
+ <?php if($_order): ?>
28
+ <script type="text/javascript">
29
+ var cpSale = {
30
+ trackingKey: "<?php echo $this->getTrackingKey(); ?>",
31
+ orderId: "<?php echo $_order->getId(); ?>",
32
+ orderTotal: <?php echo ($_order->getGrandTotal() - $_order->getTaxAmount()); ?>,
33
+ cookie: "<?php echo $this->getCookieMode(); ?>",
34
+ shoppingCart: new Array()
35
+ };
36
+
37
+ <?php $_productIdField = $this->getProductIdField(); ?>
38
+ <?php foreach($_order->getItemsCollection(array(), true) as $_item): ?>
39
+ cpSale.shoppingCart.push({id: "<?php echo $_item->getData($_productIdField); ?>", price: <?php echo $_item->getPrice(); ?>, amount: <?php echo $_item->getQtyOrdered(); ?>});
40
+ <?php endforeach; ?>
41
+ </script>
42
+
43
+ <script type="text/javascript" src="//content.cptrack.de/sales.js"></script>
44
+ <?php endif; ?>
45
+ <?php endif; ?>
46
+
app/design/frontend/base/default/template/Foxyfeeds/tracking_image.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Clicktracking to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Clicktracking for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package design_frontend_base_default
17
+ * @subpackage template_Foxyfeeds
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Bj�rn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ ?>
24
+ <?php if($this->isEnabled() && $this->isTrackingModeImage()): ?>
25
+ <img src="<?php echo $this->getImageUrl(); ?>" width="0" height="0" alt="" style="display: none">
26
+ <?php endif; ?>
app/etc/modules/Foxyfeeds_Foxyfeeds.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?><!--
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Foxyfeeds_Foxyfeeds to newer
12
+ * versions in the future. If you wish to customize Foxyfeeds_Foxyfeeds for your
13
+ * needs please refer to http://www.foxyfeeds.com for more information.
14
+ *
15
+ * @category Foxyfeeds
16
+ * @package etc
17
+ * @subpackage
18
+ * @copyright Copyright (c) 2012 <info@foxyfeeds.com> - www.foxyfeeds.com
19
+ * @author Björn Wehner <info@foxyfeeds.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.foxyfeeds.com
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Foxyfeeds_Foxyfeeds>
27
+ <active>true</active>
28
+ <codePool>community</codePool>
29
+ </Foxyfeeds_Foxyfeeds>
30
+ </modules>
31
+ </config>
app/locale/en_AU/Foxyfeeds_Foxyfeeds.csv ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "FF Articlenumber","Item number"
2
+
3
+ "FF Tracking","Tracking"
4
+ "FF Tracking Settings","Tracking settings"
5
+ "FF Cookiemode","Cookie mode"
6
+ "FF Trackingkeys","Tracking keys"
7
+ "FF Shop","Shop"
8
+ "FF TrackingKey","Tracking key"
9
+
10
+ "FF Data Feed Export","Data feed export"
11
+ "FF Export Settings","Export settings"
12
+ "FF Password","Password"
13
+ "FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'","Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'"
14
+ "FF Select data fields","Select data fields"
15
+ "FF Data field","Data field"
16
+ "FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)","Select the data fields you would like to provide Foxyfeeds. Some data fields are permanently included within the product catalogue. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, etc.)"
17
+ "FF Create static data fields","Create static data fields"
18
+ "FF Data field name","Data field name"
19
+ "FF Data field value","Data field value"
20
+ "FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.","Set up additional data fields with static product values i.e. For additional delivery costs."
21
+ "FF Product variant data fields","Customise variant data fields"
22
+ "FF Select the data fields you want to be overwritten by the respective value of the parent article.","Select the data fields you would like the parent item to replace"
23
+ "FF Number additional productimages","Number additional productimages"
24
+ "FF How many additional productimages should be exported?","How many additional productimages should be exported?"
25
+
26
+ "FF Activate?","Activate?"
27
+ "FF Add","Add"
28
+ "FF Delete","Delete"
29
+
30
+ "FF Tracking Method","Tracking Method"
31
+ "FF Image","Image"
32
+ "FF JavaScript","JavaScript"
33
+
34
+ "FF Export Method","Export Method"
35
+ "FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.","If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option."
36
+ "FF Live","Live"
37
+ "FF Indexed","Indexed"
38
+ "FF Foxyfeeds Product Feed Export","Foxyfeeds Product Feed Export"
39
+ "FF Index product data for the Foxyfeeds product feed export","Index product data for the Foxyfeeds product feed export"
40
+ "FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.","You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date."
41
+ "FF Product ID","Product ID"
42
+ "FF Product SKU","Product SKU"
43
+ "FF Created At","Created at"
44
+ "FF Showing feed export data for product %s and store %s - Created at: %s","Showing feed export data for product %s and store %s - Created at: %s"
45
+ "FF Please specify store.","Please specify store."
46
+ "FF The data has been deleted. Please reindex the export data.","The data has been deleted. Please reindex the export data."
47
+ "FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?","Warning, this will delete all entries and the data has to be reindexed. Do you wish to proceed ?"
48
+ "FF Truncate Index Table","Truncate Index Table"
49
+
50
+ "FF Product Url Generation Method","Product Url Generation Method"
51
+ "FF base url + url_path","base url + url_path"
52
+ "FF base url + url_key","base url + url_key"
53
+ "FF base url + url_key + .html","base url + url_key + .html"
54
+ "FF Method getProductUrl","Method getProductUrl"
55
+ "FF Method getUrlInStore","Method getUrlInStore"
app/locale/en_CA/Foxyfeeds_Foxyfeeds.csv ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "FF Articlenumber","Item number"
2
+
3
+ "FF Tracking","Tracking"
4
+ "FF Tracking Settings","Tracking settings"
5
+ "FF Cookiemode","Cookie mode"
6
+ "FF Trackingkeys","Tracking keys"
7
+ "FF Shop","Shop"
8
+ "FF TrackingKey","Tracking key"
9
+
10
+ "FF Data Feed Export","Data feed export"
11
+ "FF Export Settings","Export settings"
12
+ "FF Password","Password"
13
+ "FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'","Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'"
14
+ "FF Select data fields","Select data fields"
15
+ "FF Data field","Data field"
16
+ "FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)","Select the data fields you would like to provide Foxyfeeds. Some data fields are permanently included within the product catalogue. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, etc.)"
17
+ "FF Create static data fields","Create static data fields"
18
+ "FF Data field name","Data field name"
19
+ "FF Data field value","Data field value"
20
+ "FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.","Set up additional data fields with static product values i.e. For additional delivery costs."
21
+ "FF Product variant data fields","Customise variant data fields"
22
+ "FF Select the data fields you want to be overwritten by the respective value of the parent article.","Select the data fields you would like the parent item to replace"
23
+ "FF Number additional productimages","Number additional productimages"
24
+ "FF How many additional productimages should be exported?","How many additional productimages should be exported?"
25
+
26
+ "FF Activate?","Activate?"
27
+ "FF Add","Add"
28
+ "FF Delete","Delete"
29
+
30
+ "FF Tracking Method","Tracking Method"
31
+ "FF Image","Image"
32
+ "FF JavaScript","JavaScript"
33
+
34
+ "FF Export Method","Export Method"
35
+ "FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.","If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option."
36
+ "FF Live","Live"
37
+ "FF Indexed","Indexed"
38
+ "FF Foxyfeeds Product Feed Export","Foxyfeeds Product Feed Export"
39
+ "FF Index product data for the Foxyfeeds product feed export","Index product data for the Foxyfeeds product feed export"
40
+ "FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.","You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date."
41
+ "FF Product ID","Product ID"
42
+ "FF Product SKU","Product SKU"
43
+ "FF Created At","Created at"
44
+ "FF Showing feed export data for product %s and store %s - Created at: %s","Showing feed export data for product %s and store %s - Created at: %s"
45
+ "FF Please specify store.","Please specify store."
46
+ "FF The data has been deleted. Please reindex the export data.","The data has been deleted. Please reindex the export data."
47
+ "FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?","Warning, this will delete all entries and the data has to be reindexed. Do you wish to proceed ?"
48
+ "FF Truncate Index Table","Truncate Index Table"
49
+
50
+ "FF Product Url Generation Method","Product Url Generation Method"
51
+ "FF base url + url_path","base url + url_path"
52
+ "FF base url + url_key","base url + url_key"
53
+ "FF base url + url_key + .html","base url + url_key + .html"
54
+ "FF Method getProductUrl","Method getProductUrl"
55
+ "FF Method getUrlInStore","Method getUrlInStore"
app/locale/en_GB/Foxyfeeds_Foxyfeeds.csv ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "FF Articlenumber","Item number"
2
+
3
+ "FF Tracking","Tracking"
4
+ "FF Tracking Settings","Tracking settings"
5
+ "FF Cookiemode","Cookie mode"
6
+ "FF Trackingkeys","Tracking keys"
7
+ "FF Shop","Shop"
8
+ "FF TrackingKey","Tracking key"
9
+
10
+ "FF Data Feed Export","Data feed export"
11
+ "FF Export Settings","Export settings"
12
+ "FF Password","Password"
13
+ "FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'","Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'"
14
+ "FF Select data fields","Select data fields"
15
+ "FF Data field","Data field"
16
+ "FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)","Select the data fields you would like to provide Foxyfeeds. Some data fields are permanently included within the product catalogue. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, etc.)"
17
+ "FF Create static data fields","Create static data fields"
18
+ "FF Data field name","Data field name"
19
+ "FF Data field value","Data field value"
20
+ "FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.","Set up additional data fields with static product values i.e. For additional delivery costs."
21
+ "FF Product variant data fields","Customise variant data fields"
22
+ "FF Select the data fields you want to be overwritten by the respective value of the parent article.","Select the data fields you would like the parent item to replace"
23
+ "FF Number additional productimages","Number additional productimages"
24
+ "FF How many additional productimages should be exported?","How many additional productimages should be exported?"
25
+
26
+ "FF Activate?","Activate?"
27
+ "FF Add","Add"
28
+ "FF Delete","Delete"
29
+
30
+ "FF Tracking Method","Tracking Method"
31
+ "FF Image","Image"
32
+ "FF JavaScript","JavaScript"
33
+
34
+ "FF Export Method","Export Method"
35
+ "FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.","If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option."
36
+ "FF Live","Live"
37
+ "FF Indexed","Indexed"
38
+ "FF Foxyfeeds Product Feed Export","Foxyfeeds Product Feed Export"
39
+ "FF Index product data for the Foxyfeeds product feed export","Index product data for the Foxyfeeds product feed export"
40
+ "FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.","You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date."
41
+ "FF Product ID","Product ID"
42
+ "FF Product SKU","Product SKU"
43
+ "FF Created At","Created at"
44
+ "FF Showing feed export data for product %s and store %s - Created at: %s","Showing feed export data for product %s and store %s - Created at: %s"
45
+ "FF Please specify store.","Please specify store."
46
+ "FF The data has been deleted. Please reindex the export data.","The data has been deleted. Please reindex the export data."
47
+ "FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?","Warning, this will delete all entries and the data has to be reindexed. Do you wish to proceed ?"
48
+ "FF Truncate Index Table","Truncate Index Table"
49
+
50
+ "FF Product Url Generation Method","Product Url Generation Method"
51
+ "FF base url + url_path","base url + url_path"
52
+ "FF base url + url_key","base url + url_key"
53
+ "FF base url + url_key + .html","base url + url_key + .html"
54
+ "FF Method getProductUrl","Method getProductUrl"
55
+ "FF Method getUrlInStore","Method getUrlInStore"
app/locale/en_IE/Foxyfeeds_Foxyfeeds.csv ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "FF Articlenumber","Item number"
2
+
3
+ "FF Tracking","Tracking"
4
+ "FF Tracking Settings","Tracking settings"
5
+ "FF Cookiemode","Cookie mode"
6
+ "FF Trackingkeys","Tracking keys"
7
+ "FF Shop","Shop"
8
+ "FF TrackingKey","Tracking key"
9
+
10
+ "FF Data Feed Export","Data feed export"
11
+ "FF Export Settings","Export settings"
12
+ "FF Password","Password"
13
+ "FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'","Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'"
14
+ "FF Select data fields","Select data fields"
15
+ "FF Data field","Data field"
16
+ "FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)","Select the data fields you would like to provide Foxyfeeds. Some data fields are permanently included within the product catalogue. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, etc.)"
17
+ "FF Create static data fields","Create static data fields"
18
+ "FF Data field name","Data field name"
19
+ "FF Data field value","Data field value"
20
+ "FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.","Set up additional data fields with static product values i.e. For additional delivery costs."
21
+ "FF Product variant data fields","Customise variant data fields"
22
+ "FF Select the data fields you want to be overwritten by the respective value of the parent article.","Select the data fields you would like the parent item to replace"
23
+ "FF Number additional productimages","Number additional productimages"
24
+ "FF How many additional productimages should be exported?","How many additional productimages should be exported?"
25
+
26
+ "FF Activate?","Activate?"
27
+ "FF Add","Add"
28
+ "FF Delete","Delete"
29
+
30
+ "FF Tracking Method","Tracking Method"
31
+ "FF Image","Image"
32
+ "FF JavaScript","JavaScript"
33
+
34
+ "FF Export Method","Export Method"
35
+ "FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.","If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option."
36
+ "FF Live","Live"
37
+ "FF Indexed","Indexed"
38
+ "FF Foxyfeeds Product Feed Export","Foxyfeeds Product Feed Export"
39
+ "FF Index product data for the Foxyfeeds product feed export","Index product data for the Foxyfeeds product feed export"
40
+ "FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.","You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date."
41
+ "FF Product ID","Product ID"
42
+ "FF Product SKU","Product SKU"
43
+ "FF Created At","Created at"
44
+ "FF Showing feed export data for product %s and store %s - Created at: %s","Showing feed export data for product %s and store %s - Created at: %s"
45
+ "FF Please specify store.","Please specify store."
46
+ "FF The data has been deleted. Please reindex the export data.","The data has been deleted. Please reindex the export data."
47
+ "FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?","Warning, this will delete all entries and the data has to be reindexed. Do you wish to proceed ?"
48
+ "FF Truncate Index Table","Truncate Index Table"
49
+
50
+ "FF Product Url Generation Method","Product Url Generation Method"
51
+ "FF base url + url_path","base url + url_path"
52
+ "FF base url + url_key","base url + url_key"
53
+ "FF base url + url_key + .html","base url + url_key + .html"
54
+ "FF Method getProductUrl","Method getProductUrl"
55
+ "FF Method getUrlInStore","Method getUrlInStore"
app/locale/en_NZ/Foxyfeeds_Foxyfeeds.csv ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "FF Articlenumber","Item number"
2
+
3
+ "FF Tracking","Tracking"
4
+ "FF Tracking Settings","Tracking settings"
5
+ "FF Cookiemode","Cookie mode"
6
+ "FF Trackingkeys","Tracking keys"
7
+ "FF Shop","Shop"
8
+ "FF TrackingKey","Tracking key"
9
+
10
+ "FF Data Feed Export","Data feed export"
11
+ "FF Export Settings","Export settings"
12
+ "FF Password","Password"
13
+ "FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'","Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'"
14
+ "FF Select data fields","Select data fields"
15
+ "FF Data field","Data field"
16
+ "FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)","Select the data fields you would like to provide Foxyfeeds. Some data fields are permanently included within the product catalogue. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, etc.)"
17
+ "FF Create static data fields","Create static data fields"
18
+ "FF Data field name","Data field name"
19
+ "FF Data field value","Data field value"
20
+ "FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.","Set up additional data fields with static product values i.e. For additional delivery costs."
21
+ "FF Product variant data fields","Customise variant data fields"
22
+ "FF Select the data fields you want to be overwritten by the respective value of the parent article.","Select the data fields you would like the parent item to replace"
23
+ "FF Number additional productimages","Number additional productimages"
24
+ "FF How many additional productimages should be exported?","How many additional productimages should be exported?"
25
+
26
+ "FF Activate?","Activate?"
27
+ "FF Add","Add"
28
+ "FF Delete","Delete"
29
+
30
+ "FF Tracking Method","Tracking Method"
31
+ "FF Image","Image"
32
+ "FF JavaScript","JavaScript"
33
+
34
+ "FF Export Method","Export Method"
35
+ "FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.","If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option."
36
+ "FF Live","Live"
37
+ "FF Indexed","Indexed"
38
+ "FF Foxyfeeds Product Feed Export","Foxyfeeds Product Feed Export"
39
+ "FF Index product data for the Foxyfeeds product feed export","Index product data for the Foxyfeeds product feed export"
40
+ "FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.","You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date."
41
+ "FF Product ID","Product ID"
42
+ "FF Product SKU","Product SKU"
43
+ "FF Created At","Created at"
44
+ "FF Showing feed export data for product %s and store %s - Created at: %s","Showing feed export data for product %s and store %s - Created at: %s"
45
+ "FF Please specify store.","Please specify store."
46
+ "FF The data has been deleted. Please reindex the export data.","The data has been deleted. Please reindex the export data."
47
+ "FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?","Warning, this will delete all entries and the data has to be reindexed. Do you wish to proceed ?"
48
+ "FF Truncate Index Table","Truncate Index Table"
49
+
50
+ "FF Product Url Generation Method","Product Url Generation Method"
51
+ "FF base url + url_path","base url + url_path"
52
+ "FF base url + url_key","base url + url_key"
53
+ "FF base url + url_key + .html","base url + url_key + .html"
54
+ "FF Method getProductUrl","Method getProductUrl"
55
+ "FF Method getUrlInStore","Method getUrlInStore"
app/locale/en_US/Foxyfeeds_Foxyfeeds.csv ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "FF Articlenumber","Item number"
2
+
3
+ "FF Tracking","Tracking"
4
+ "FF Tracking Settings","Tracking settings"
5
+ "FF Cookiemode","Cookie mode"
6
+ "FF Trackingkeys","Tracking keys"
7
+ "FF Shop","Shop"
8
+ "FF TrackingKey","Tracking key"
9
+
10
+ "FF Data Feed Export","Data feed export"
11
+ "FF Export Settings","Export settings"
12
+ "FF Password","Password"
13
+ "FF Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'","Protect your data feed with a password. For example: 'www.testshop.com/foxyfeeds?password=12345'"
14
+ "FF Select data fields","Select data fields"
15
+ "FF Data field","Data field"
16
+ "FF Select the data fields you want to provide on Foxyfeeds. Some product attributes are always included. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, additional_image_1, additional_image_2, additional_image_3, weight)","Select the data fields you would like to provide Foxyfeeds. Some data fields are permanently included within the product catalogue. (Entity_Id, Sku, name, description, price, manufacturer, color, categories, product_url, image_url, etc.)"
17
+ "FF Create static data fields","Create static data fields"
18
+ "FF Data field name","Data field name"
19
+ "FF Data field value","Data field value"
20
+ "FF Set up additional data fields. These fields have for every product the same value. E.g. for additional delivery costs.","Set up additional data fields with static product values i.e. For additional delivery costs."
21
+ "FF Product variant data fields","Customise variant data fields"
22
+ "FF Select the data fields you want to be overwritten by the respective value of the parent article.","Select the data fields you would like the parent item to replace"
23
+ "FF Number additional productimages","Number additional productimages"
24
+ "FF How many additional productimages should be exported?","How many additional productimages should be exported?"
25
+
26
+ "FF Activate?","Activate?"
27
+ "FF Add","Add"
28
+ "FF Delete","Delete"
29
+
30
+ "FF Tracking Method","Tracking Method"
31
+ "FF Image","Image"
32
+ "FF JavaScript","JavaScript"
33
+
34
+ "FF Export Method","Export Method"
35
+ "FF If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option.","If you choose the indexed method, make sure that the 'Foxyfeeds Product Feed Export' index is always up to date. Please note, that if you select more than 40 data fields, that the indexed method will be used regardless of the selected option."
36
+ "FF Live","Live"
37
+ "FF Indexed","Indexed"
38
+ "FF Foxyfeeds Product Feed Export","Foxyfeeds Product Feed Export"
39
+ "FF Index product data for the Foxyfeeds product feed export","Index product data for the Foxyfeeds product feed export"
40
+ "FF You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date.","You have added more than %s data fields for the product feed export. Please note that with this amount the 'indexed' export method will re used regardless of the selected one. Keep in mind that you have to keep the Foxyfeeds Product Feed Export index up to date."
41
+ "FF Product ID","Product ID"
42
+ "FF Product SKU","Product SKU"
43
+ "FF Created At","Created at"
44
+ "FF Showing feed export data for product %s and store %s - Created at: %s","Showing feed export data for product %s and store %s - Created at: %s"
45
+ "FF Please specify store.","Please specify store."
46
+ "FF The data has been deleted. Please reindex the export data.","The data has been deleted. Please reindex the export data."
47
+ "FF Warning, this will delete all entries and the data has to be reindexed. Proceed ?","Warning, this will delete all entries and the data has to be reindexed. Do you wish to proceed ?"
48
+ "FF Truncate Index Table","Truncate Index Table"
49
+
50
+ "FF Product Url Generation Method","Product Url Generation Method"
51
+ "FF base url + url_path","base url + url_path"
52
+ "FF base url + url_key","base url + url_key"
53
+ "FF base url + url_key + .html","base url + url_key + .html"
54
+ "FF Method getProductUrl","Method getProductUrl"
55
+ "FF Method getUrlInStore","Method getUrlInStore"
package.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Foxyfeeds_Foxyfeeds</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Foxy Feeds is a free cloud based solution for handling data feeds.</summary>
10
+ <description>Foxy Feeds is a user-friendly solution that helps web shops to publish their products on multiple channels, ensuring a continuous increase in sales. Through Foxy Feeds, online shops can connect to over 2000 marketing channels around the world, including, price comparison sites, product listing ads, affiliate platforms and retargeting networks, and applications, under a single account. Merchants will also benefit from an easy connection to the ChannelPilot plug-ins and modules, thus making the opening months on the platform quick and simple. &#xD;
11
+ &#xD;
12
+ How Foxy Feeds will benefit you:&#xD;
13
+ - The most relevant marketing channels: List on all the most relevant price search engines, shopping portals, affiliate and retargeting networks around the world with Foxy Feeds. &#xD;
14
+ - Product Listing Ads within a click: publish your product catalogue in Google Shopping, Facebook and many more.&#xD;
15
+ - Improve your data feed: get access to an automated feed optimization to improve your performance.&#xD;
16
+ - Filters and rules: a vast variety of filters and rules can help you to get an accurate import and an effective distribution. &#xD;
17
+ - Go international: with Foxy Feeds you can access all the markets around the world.&#xD;
18
+ - Foxy Feeds Multiplatform: access your account on any device (e.g. computer, tablet or smartphone), wherever you are, when you want. &#xD;
19
+ &#xD;
20
+ Get more information about Foxy Feeds in www.foxyfeeds.com.</description>
21
+ <notes>The first version for FoxyFeeds.</notes>
22
+ <authors><author><name>FoxyFeeds</name><user>FoxyFeeds</user><email>info@foxyfeeds.com</email></author></authors>
23
+ <date>2016-02-22</date>
24
+ <time>08:22:30</time>
25
+ <contents><target name="magecommunity"><dir name="Foxyfeeds"><dir name="Foxyfeeds"><dir name="Block"><dir name="Adminhtml"><dir name="Feedexport"><file name="Grid.php" hash="afeb9275e292e4cd224b0fef597d75aa"/><dir name="View"><file name="Form.php" hash="360be7a3c77582e171e5d99266b52fcb"/></dir><file name="View.php" hash="a39440cc3bb51cec59a389c1f17c25a2"/></dir><file name="Feedexport.php" hash="30a9ad8301e2092380a040d6da74e4f4"/><dir name="Field"><file name="Abstract.php" hash="1567cf1cddf0aabd0c8667176c036789"/><file name="Exportfields.php" hash="221f7cd8b7febf210d5d02e982d2ba52"/><file name="Replacefields.php" hash="16149ed53b234bec66a5dcd198b93d98"/><file name="Specialfields.php" hash="b4675eb7f1bdf6835573331291ded1b5"/><file name="Trackingkeys.php" hash="48dd9f0dfd1084abe733a557f579dee9"/></dir><file name="Hintlogo.php" hash="ed4d98e4c98847e4aa80d72406518de9"/></dir><dir name="Tracking"><file name="Tracking.php" hash="edc441ca301fcb99d8863a0977d50391"/></dir></dir><dir name="Helper"><file name="Data.php" hash="248acf4ddfcc312ff0e6080a402fa749"/><file name="Export.php" hash="8c7724cf8d242d02c270393753fbd14b"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Source"><file name="Articlenumber.php" hash="693d1fd6d24c4cea32cd1ecce11ed3b4"/><file name="Cookiemode.php" hash="9769471984be535af4d25d295a986d62"/><file name="Exportmethod.php" hash="bca6974c93ce66a7f8fdd47823d700c9"/><file name="Imagenumber.php" hash="ccbfd14a7beb85402205dc602bd0a864"/><file name="Producturlgeneration.php" hash="f50d48e77a49971ce4acf3483b9e29a0"/><file name="Trackingmethod.php" hash="01552998535c739fb3f44af2e41df087"/></dir></dir><dir name="Feedexport"><file name="Indexer.php" hash="ca429ca718a56c8ab18df729f9ac3f98"/></dir><file name="Observer.php" hash="5fa611c4cb6470a1b669b876324ddf1f"/><dir name="Resource"><dir name="Feedexport"><dir name="Indexer"><file name="Collection.php" hash="119a5ec6410e64c41c137f8dc295d893"/></dir><file name="Indexer.php" hash="900aec4719f7fb21165bffc6f4e026f9"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Foxyfeeds"><file name="FeedexportController.php" hash="ecd2a430d6f837dfa76d09d2e4926c51"/></dir></dir><file name="IndexController.php" hash="bf61012c04a9bd38d3b5514a705703b6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="498863d73c8820bf7627faf365b24baa"/><file name="config.xml" hash="1d248fbb1de3fa355878e79a0b1dec77"/><file name="system.xml" hash="b27b5ffa86fc973ef194f31fba4cbd20"/></dir><dir name="sql"><dir name="foxyfeeds_setup"><file name="mysql4-install-1.0.0.php" hash="28e8d31b3b5ccaf566666397a909acb5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Foxyfeeds_Foxyfeeds.xml" hash="c1a29d3405a531b1ca3a3ef62f6c5980"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="Foxyfeeds"><file name="foxyfeeds.xml" hash="ae18f6ccf0d528949bb875ebd2a796af"/></dir></dir><dir name="template"><dir name="Foxyfeeds"><file name="clicktracking_js.phtml" hash="b6dfdf21e6271625a0d48ed9071dd2df"/><file name="salestracking_js.phtml" hash="467c77e34fb7844e434af51f9e06e4de"/><file name="tracking_image.phtml" hash="bb325a31ed3890d491f8eb60e8af22be"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="foxyfeeds"><file name="array_dropdown.phtml" hash="76d6ac2b350d27d0b222f30cafe98a0d"/><file name="config_hint.phtml" hash="701f26adf3213879198bce258bb0c75a"/></dir></dir><dir name="layout"><file name="foxyfeeds.xml" hash="ca56f063930e442af00024782f0146a5"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_AU"><file name="Foxyfeeds_Foxyfeeds.csv" hash="010246c8bd62c5052c4f473b37560057"/></dir><dir name="en_CA"><file name="Foxyfeeds_Foxyfeeds.csv" hash="010246c8bd62c5052c4f473b37560057"/></dir><dir name="en_GB"><file name="Foxyfeeds_Foxyfeeds.csv" hash="010246c8bd62c5052c4f473b37560057"/></dir><dir name="en_IE"><file name="Foxyfeeds_Foxyfeeds.csv" hash="010246c8bd62c5052c4f473b37560057"/></dir><dir name="en_NZ"><file name="Foxyfeeds_Foxyfeeds.csv" hash="010246c8bd62c5052c4f473b37560057"/></dir><dir name="en_US"><file name="Foxyfeeds_Foxyfeeds.csv" hash="010246c8bd62c5052c4f473b37560057"/></dir></target></contents>
26
+ <compatible/>
27
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
+ </package>