Magmodules_Channable - Version 1.3.0

Version Notes

Channable Connect

Download this release

Release Info

Developer Magento Core Team
Extension Magmodules_Channable
Version 1.3.0
Comparing to
See all releases


Version 1.3.0

Files changed (36) hide show
  1. app/code/community/Magmodules/Channable/Block/Adminhtml/Config/Form/Field/Extra.php +52 -0
  2. app/code/community/Magmodules/Channable/Block/Adminhtml/Config/Form/Field/Shipping.php +48 -0
  3. app/code/community/Magmodules/Channable/Block/Adminhtml/Config/Form/Renderer/Select.php +161 -0
  4. app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Feeds.php +45 -0
  5. app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Heading.php +28 -0
  6. app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Note.php +26 -0
  7. app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Token.php +45 -0
  8. app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Version.php +27 -0
  9. app/code/community/Magmodules/Channable/Block/Adminhtml/Widget/Info/Info.php +72 -0
  10. app/code/community/Magmodules/Channable/Helper/Data.php +588 -0
  11. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Backend/Design/Extra.php +52 -0
  12. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Backend/Design/Shipping.php +55 -0
  13. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Action.php +28 -0
  14. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Attribute.php +36 -0
  15. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Category.php +61 -0
  16. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Categorytype.php +28 -0
  17. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Configurable.php +33 -0
  18. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Images.php +28 -0
  19. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Pricemodel.php +29 -0
  20. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Selectattribute.php +49 -0
  21. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Tax.php +29 -0
  22. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Textattribute.php +71 -0
  23. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Type.php +28 -0
  24. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Visibility.php +30 -0
  25. app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Weight.php +30 -0
  26. app/code/community/Magmodules/Channable/Model/Channable.php +263 -0
  27. app/code/community/Magmodules/Channable/Model/Common.php +107 -0
  28. app/code/community/Magmodules/Channable/controllers/Adminhtml/ChannableController.php +30 -0
  29. app/code/community/Magmodules/Channable/controllers/FeedController.php +47 -0
  30. app/code/community/Magmodules/Channable/etc/adminhtml.xml +39 -0
  31. app/code/community/Magmodules/Channable/etc/config.xml +101 -0
  32. app/code/community/Magmodules/Channable/etc/system.xml +559 -0
  33. app/etc/modules/Magmodules_Channable.xml +9 -0
  34. app/locale/en_US/Magmodules_Channable.csv +57 -0
  35. app/locale/nl_NL/Magmodules_Channable.csv +57 -0
  36. package.xml +18 -0
app/code/community/Magmodules/Channable/Block/Adminhtml/Config/Form/Field/Extra.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_Config_Form_Field_Extra extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
19
+
20
+ protected $_renders = array();
21
+
22
+ public function __construct()
23
+ {
24
+ $layout = Mage::app()->getFrontController()->getAction()->getLayout();
25
+ $renderer_attributes = $layout->createBlock('channable/adminhtml_config_form_renderer_select', '', array('is_render_to_js_template' => true));
26
+ $renderer_attributes->setOptions(Mage::getModel('channable/adminhtml_system_config_source_attribute')->toOptionArray());
27
+
28
+ $this->addColumn('attribute', array(
29
+ 'label' => Mage::helper('channable')->__('Magento Attribute'),
30
+ 'style' => 'width:120px',
31
+ 'renderer' => $renderer_attributes
32
+ ));
33
+
34
+ $this->addColumn('label', array(
35
+ 'label' => Mage::helper('channable')->__('Title'),
36
+ 'style' => 'width:120px',
37
+ ));
38
+
39
+ $this->_renders['attribute'] = $renderer_attributes;
40
+ $this->_addAfter = false;
41
+ $this->_addButtonLabel = Mage::helper('channable')->__('Add Attribute');
42
+ parent::__construct();
43
+ }
44
+
45
+ protected function _prepareArrayRow(Varien_Object $row)
46
+ {
47
+ foreach ($this->_renders as $key => $render) {
48
+ $row->setData('option_extra_attr_' . $render->calcOptionHash($row->getData($key)), 'selected="selected"');
49
+ }
50
+ }
51
+
52
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/Config/Form/Field/Shipping.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_Config_Form_Field_Shipping extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
19
+
20
+ protected $_renders = array();
21
+
22
+ public function __construct()
23
+ {
24
+ $this->addColumn('price_from', array(
25
+ 'label' => Mage::helper('channable')->__('Price From'),
26
+ 'style' => 'width:40px',
27
+ ));
28
+ $this->addColumn('price_to', array(
29
+ 'label' => Mage::helper('channable')->__('Price To'),
30
+ 'style' => 'width:40px',
31
+ ));
32
+ $this->addColumn('cost', array(
33
+ 'label' => Mage::helper('channable')->__('Cost'),
34
+ 'style' => 'width:40px',
35
+ ));
36
+ $this->_addAfter = false;
37
+ $this->_addButtonLabel = Mage::helper('channable')->__('Add Option');
38
+ parent::__construct();
39
+ }
40
+
41
+ protected function _prepareArrayRow(Varien_Object $row)
42
+ {
43
+ foreach ($this->_renders as $key => $render) {
44
+ $row->setData('option_extra_attr_' . $render->calcOptionHash($row->getData($key)), 'selected="selected"');
45
+ }
46
+ }
47
+
48
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/Config/Form/Renderer/Select.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_Config_Form_Renderer_Select extends Mage_Core_Block_Html_Select {
19
+
20
+ public function setInputName($inputName)
21
+ {
22
+ $this->setData('inputname', $inputName);
23
+ return $this;
24
+ }
25
+
26
+ public function getInputName()
27
+ {
28
+ return $this->getData('inputname');
29
+ }
30
+
31
+ public function setColumnName($columnName)
32
+ {
33
+ $this->setData('columnname', $columnName);
34
+ return $this;
35
+ }
36
+
37
+ public function getColumnName()
38
+ {
39
+ return $this->getData('columnname');
40
+ }
41
+
42
+ public function setColumn($column)
43
+ {
44
+ $this->setData('column', $column);
45
+ return $this;
46
+ }
47
+
48
+ public function getColumn()
49
+ {
50
+ return $this->getData('column');
51
+ }
52
+
53
+ public function getExtraParams()
54
+ {
55
+ $column = $this->getColumn();
56
+ if($column && isset($column['style'])) {
57
+ return ' style="'.$column['style'].'" ';
58
+ } else {
59
+ return '';
60
+ }
61
+ }
62
+
63
+ protected function _toHtml()
64
+ {
65
+ if(!$this->_beforeToHtml()) {
66
+ return '';
67
+ }
68
+
69
+ $html = '<select name="'.$this->getInputName().'" class="'.$this->getClass().'" '.$this->getExtraParams().'>';
70
+
71
+ $values = $this->getValue();
72
+
73
+ if (!is_array($values)){
74
+ if (!is_null($values)) {
75
+ $values = array($values);
76
+ } else {
77
+ $values = array();
78
+ }
79
+ }
80
+
81
+ $isArrayOption = true;
82
+
83
+ foreach($this->getOptions() as $key => $option) {
84
+ if($isArrayOption && is_array($option)) {
85
+ $value = $option['value'];
86
+ $label = $option['label'];
87
+ $params = (!empty($option['params'])) ? $option['params'] : array();
88
+ } else {
89
+ $value = $key;
90
+ $label = $option;
91
+ $isArrayOption = false;
92
+ $params = array();
93
+ }
94
+
95
+ if(is_array($value)) {
96
+ $html.= '<optgroup label="'.$label.'">';
97
+ foreach($value as $keyGroup => $optionGroup) {
98
+ if(!is_array($optionGroup)) {
99
+ $optionGroup = array(
100
+ 'value' => $keyGroup,
101
+ 'label' => $optionGroup
102
+ );
103
+ }
104
+ $html.= $this->_optionToHtml(
105
+ $optionGroup,
106
+ in_array($optionGroup['value'], $values)
107
+ );
108
+ }
109
+ $html.= '</optgroup>';
110
+ } else {
111
+ $html.= $this->_optionToHtml(array(
112
+ 'value' => $value,
113
+ 'label' => $label,
114
+ 'params' => $params
115
+ ),
116
+ in_array($value, $values)
117
+ );
118
+ }
119
+ }
120
+ $html.= '</select>';
121
+ return $html;
122
+ }
123
+
124
+ protected function _optionToHtml($option, $selected = false)
125
+ {
126
+ $selectedHtml = $selected ? ' selected="selected"' : '';
127
+ if ($this->getIsRenderToJsTemplate() === true) {
128
+ $selectedHtml .= ' #{option_extra_attr_' . self::calcOptionHash($option['value']) . '}';
129
+ }
130
+
131
+ $params = '';
132
+ if (!empty($option['params']) && is_array($option['params'])) {
133
+ foreach ($option['params'] as $key => $value) {
134
+ if (is_array($value)) {
135
+ foreach ($value as $keyMulti => $valueMulti) {
136
+ $params .= sprintf(' %s="%s" ', $keyMulti, $valueMulti);
137
+ }
138
+ } else {
139
+ $params .= sprintf(' %s="%s" ', $key, $value);
140
+ }
141
+ }
142
+ }
143
+
144
+ return sprintf('<option value="%s"%s %s>%s</option>',
145
+ $this->htmlEscape($option['value']),
146
+ $selectedHtml,
147
+ $params,
148
+ $this->htmlEscape($option['label']));
149
+ }
150
+
151
+ public function getHtml()
152
+ {
153
+ return $this->toHtml();
154
+ }
155
+
156
+ public function calcOptionHash($optionValue)
157
+ {
158
+ return sprintf('%u', crc32($this->getColumnName() . $this->getInputName() . $optionValue));
159
+ }
160
+
161
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Feeds.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ *
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_System_Config_Form_Field_Feeds extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
19
+
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $storeIds = Mage::helper('channable')->getStoreIds('channable/connect/enabled');
23
+ $token = Mage::getStoreConfig('channable/connect/token');
24
+ $html_feedlinks = '';
25
+
26
+ foreach($storeIds as $storeId) {
27
+ $base_url = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
28
+ $channable_feed = $base_url . 'channable/feed/get/code/' . $token .'/store/' . $storeId . '/array/1';
29
+ $store_title = Mage::app()->getStore($storeId)->getName();
30
+ $html_feedlinks .= '<tr><td>' . $store_title . '</td><td><a href="' . $channable_feed . '">Preview</a></td><td><a href="https://app.channable.com/connect/magento.html?store_id=' . $storeId . '&url=' . $base_url . '&token=' . $token . '" target="_blank">Click to auto connect with Channable</a></td></tr>';
31
+ }
32
+
33
+ if(!$html_feedlinks) {
34
+ $html_feedlinks = Mage::helper('channable')->__('No enabled feed(s) found');
35
+ } else {
36
+ $html_header = '<div class="grid"><table cellpadding="0" cellspacing="0" class="border" style="width:425px;"><tbody><tr class="headings"><th>Store</th><th>Preview</th><th>Connect</th></tr>';
37
+ $html_footer = '</tbody></table></div>';
38
+ $html_feedlinks = $html_header . $html_feedlinks . $html_footer;
39
+ }
40
+
41
+
42
+ return sprintf('<tr id="row_%s"><td colspan="6" class="label" style="margin-bottom: 10px;">%s</td></tr>', $element->getHtmlId(), $html_feedlinks);
43
+ }
44
+
45
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Heading.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_System_Config_Form_Field_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
19
+
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $useContainerId = $element->getData('use_container_id');
23
+ return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4>%s</h4></td></tr>',
24
+ $element->getHtmlId(), $element->getLabel()
25
+ );
26
+ }
27
+
28
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Note.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_System_Config_Form_Field_Note extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
19
+
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $useContainerId = $element->getData('use_container_id');
23
+ return sprintf('<tr id="row_%s"><td colspan="5" class="label" style="margin-bottom: 10px;">%s</td></tr>', $element->getHtmlId(), $element->getLabel());
24
+ }
25
+
26
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Token.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_System_Config_Form_Field_Token extends Mage_Adminhtml_Block_System_Config_Form_Field {
19
+
20
+ public function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ if($token = Mage::getStoreConfig('channable/connect/token')) {
23
+ return $token;
24
+ } else {
25
+ if($license = Mage::getStoreConfig('channable/general/license_key')) {
26
+ $token = substr(Mage::getStoreConfig('channable/general/license_key'), 10, -15);
27
+ $config = new Mage_Core_Model_Config();
28
+ $config->saveConfig('channable/connect/token', $token, 'default', 0);
29
+ Mage::app()->getCacheInstance()->cleanType('config');
30
+ return $token;
31
+ } else {
32
+ $token = '';
33
+ $chars = str_split("abcdefghijklmnopqrstuvwxyz0123456789");
34
+ for($i = 0; $i < 16; $i++) {
35
+ $token .= $chars[array_rand($chars)];
36
+ }
37
+ $config = new Mage_Core_Model_Config();
38
+ $config->saveConfig('channable/connect/token', $token, 'default', 0);
39
+ Mage::app()->getCacheInstance()->cleanType('config');
40
+ return $token;
41
+ }
42
+ }
43
+ }
44
+
45
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/System/Config/Form/Field/Version.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_System_Config_Form_Field_Version extends Mage_Adminhtml_Block_System_Config_Form_Field {
19
+
20
+ public function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+ $modules = Mage::getConfig()->getNode('modules')->children();
23
+ $modulesArray = (array)$modules;
24
+ return $modulesArray['Magmodules_Channable']->version;
25
+ }
26
+
27
+ }
app/code/community/Magmodules/Channable/Block/Adminhtml/Widget/Info/Info.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
19
+
20
+ public function render(Varien_Data_Form_Element_Abstract $element)
21
+ {
22
+
23
+ $magento_version = Mage::getVersion();
24
+ $logo_link = '//www.magmodules.eu/logo/channable/1.3.0/' . $magento_version . '/logo.png';
25
+
26
+ $html = '<div style="background:url(\'' . $logo_link . '\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
27
+ <h4>About Magmodules.eu</h4>
28
+ <p>We are a Magento only E-commerce Agency located in the Netherlands.<br>
29
+ <br />
30
+ <table width="500px" border="0">
31
+ <tr>
32
+ <td width="58%">View more extensions from us:</td>
33
+ <td width="42%"><a href="http://www.magentocommerce.com/magento-connect/developer/Magmodules" target="_blank">Magento Connect</a></td>
34
+ </tr>
35
+ <td>Send us an E-mail:
36
+ <td><a href="mailto:info@magmodules.eu">info@magmodules.eu</a></td>
37
+ </tr>
38
+ <tr>
39
+ <td height="30">Visit our website:</td>
40
+ <td><a href="http://www.magmodules.eu" target="_blank">www.magmodules.eu</a></td>
41
+ </tr>
42
+ <tr>
43
+ <td>&nbsp;</td>
44
+ <td>&nbsp;</td>
45
+ </tr>
46
+ <tr>
47
+ <td height="30"><strong>Need help?</strong></td>
48
+ <td><strong><a href="http://www.magmodules.eu/help/channable" target="_blank">Online manual</a></strong></td>
49
+ </tr>
50
+ </table>
51
+ </div>';
52
+
53
+ if(Mage::helper('channable')->checkOldVersion('Channable')) {
54
+ $msg = '<div id="messages"><ul class="messages"><li class="error-msg"><ul><li><span>' . Mage::helper('channable')->__('Old version detected on the server, please remove the directory <u>app/code/local/Magmodules/Channable</u> and flush cache!') . '</span></li></ul></li></ul></div>';
55
+ $html = $msg . $html;
56
+ }
57
+
58
+ if(empty($oldversion)) {
59
+ if(Mage::getStoreConfig('catalog/frontend/flat_catalog_product')) {
60
+ $non_flat_attributes = Mage::helper('channable')->checkFlatCatalog(Mage::getModel("channable/channable")->getFeedAttributes());
61
+ if(count($non_flat_attributes) > 0) {
62
+ $html .= '<div id="messages"><ul class="messages"><li class="error-msg"><ul><li><span>';
63
+ $html .= $this->__('Warning: The following used attribute(s) were not found in the flat catalog: %s. This can result in empty data or higher resource usage. Click <a href="%s">here</a> to add these to the flat catalog. ', implode($non_flat_attributes, ', '), $this->getUrl('*/channable/addToFlat'));
64
+ $html .= '</span></ul></li></ul></div>';
65
+ }
66
+ }
67
+ }
68
+
69
+ return $html;
70
+ }
71
+
72
+ }
app/code/community/Magmodules/Channable/Helper/Data.php ADDED
@@ -0,0 +1,588 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * @version 16-11-2015
16
+ * =============================================================
17
+ */
18
+
19
+ class Magmodules_Channable_Helper_Data extends Mage_Core_Helper_Abstract {
20
+
21
+ public function getStoreIds($path)
22
+ {
23
+ $store_ids = array();
24
+ foreach(Mage::app()->getStores() as $store) {
25
+ $store_id = Mage::app()->getStore($store)->getId();
26
+ if(Mage::getStoreConfig($path, $store_id)) {
27
+ $store_ids[] = $store_id;
28
+ }
29
+ }
30
+ return $store_ids;
31
+ }
32
+
33
+ public function getProductDataRow($product, $config, $parent)
34
+ {
35
+ $fields = $config['field'];
36
+ $data = array();
37
+
38
+ if(!$this->validateProduct($product, $config)) { return false; }
39
+ if(!$this->validateParent($parent, $config, $product)) { $parent = ''; }
40
+
41
+ foreach($fields as $key => $field) {
42
+ $rows = $this->getAttributeValue($key, $product, $config, $field['action'], $parent);
43
+ if(is_array($rows)) {
44
+ $data = array_merge($data, $rows);
45
+ }
46
+ }
47
+ if(empty($config['skip_validation'])) {
48
+ if(!empty($data[$fields['price']['label']])) {
49
+ return $data;
50
+ }
51
+ } else {
52
+ return $data;
53
+ }
54
+ }
55
+
56
+ public function getAttributeValue($field, $product, $config, $actions = '', $parent)
57
+ {
58
+ $data = $config['field'][$field];
59
+ $product_data = $product;
60
+
61
+ if(!empty($parent)) {
62
+ if(!empty($data['parent'])) {
63
+ $product_data = $parent;
64
+ }
65
+ }
66
+
67
+ switch($field) {
68
+ case 'product_url':
69
+ $value = $this->getProductUrl($product_data, $config);
70
+ break;
71
+ case 'image_link':
72
+ $value = $this->getProductImage($product_data, $config);
73
+ break;
74
+ case 'condition':
75
+ $value = $this->getProductCondition($product_data, $config);
76
+ break;
77
+ case 'availability':
78
+ $value = $this->getProductAvailability($product_data, $config);
79
+ break;
80
+ case 'weight':
81
+ $value = $this->getProductWeight($product_data, $config);
82
+ break;
83
+ case 'price':
84
+ $value = $this->getProductPrice($product_data, $config);
85
+ break;
86
+ case 'bundle':
87
+ $value = $this->getProductBundle($product_data, $config);
88
+ break;
89
+ case 'parent_id':
90
+ $value = $this->getProductData($parent, $data);
91
+ break;
92
+ case 'categories':
93
+ $value = $this->getProductCategories($product_data, $config);
94
+ break;
95
+ default:
96
+ if(!empty($data['source'])) {
97
+ $value = $this->getProductData($product_data, $data);
98
+ } else {
99
+ $value = '';
100
+ }
101
+ break;
102
+ }
103
+
104
+ if(in_array($field, array('thumbnail','small_image'))) {
105
+ if(!empty($value)) {
106
+ $value = $config['media_url'] . 'catalog/product' . $value;
107
+ }
108
+ }
109
+
110
+ if((isset($actions)) && (!empty($value))) {
111
+ $value = $this->cleanData($value, $actions);
112
+ }
113
+
114
+ if((is_array($value) && ($field == 'image_link'))) {
115
+ $i = 1;
116
+ foreach($value as $key => $val) {
117
+ $data_row[$key] = $val;
118
+ $i++;
119
+ }
120
+ return $data_row;
121
+ }
122
+
123
+ if(!empty($value)) {
124
+ $data_row[$data['label']] = $value;
125
+ return $data_row;
126
+ }
127
+ }
128
+
129
+ public function cleanData($st, $action = '')
130
+ {
131
+ if($action) {
132
+ $actions = explode('_', $action);
133
+ if(in_array('striptags', $actions)) {
134
+ $st = $this->stripTags($st);
135
+ $st = trim($st);
136
+ }
137
+ if(in_array('rn', $actions)) {
138
+ $st = str_replace(array("\r", "\n"), "", $st);
139
+ }
140
+ if(in_array('truncate', $actions)) {
141
+ $st = Mage::helper('core/string')->truncate($st, '5000');
142
+ }
143
+ if(in_array('cdata', $actions)) {
144
+ $st = '<![CDATA[' . $st . ']]>';
145
+ }
146
+ if(in_array('round', $actions)) {
147
+ $st = round($st);
148
+ }
149
+ if(in_array('boolean', $actions)) {
150
+ ($st > 0 ? $st = 1 : $st = 0);
151
+ }
152
+ }
153
+ return $st;
154
+ }
155
+
156
+ public function getProductUrl($product, $config)
157
+ {
158
+ if($product->getUrlPath()) {
159
+ $url = Mage::helper('core')->escapeHtml(trim($config['website_url'] . $product->getUrlPath()));
160
+ } else {
161
+ $url = Mage::getModel('catalog/product')->setStoreId($config['store_id'])->load($product->getId())->getProductUrl();
162
+ $url = preg_replace('/\?.*/', '', $url);
163
+ }
164
+ if(!empty($config['url_suffix'])) {
165
+ $url = $url . '?' . $config['url_suffix'];
166
+ }
167
+ return $url;
168
+ }
169
+
170
+ public function getProductImage($product, $config)
171
+ {
172
+
173
+ $image = '';
174
+ if($product->getThumbnail()) {
175
+ if($product->getThumbnail() != 'no_selection') {
176
+ $image = $config['media_image_url'] . $product->getThumbnail();
177
+ }
178
+ }
179
+ if($product->getSmallImage()) {
180
+ if($product->getSmallImage() != 'no_selection') {
181
+ $image = $config['media_image_url'] . $product->getSmallImage();
182
+ }
183
+ }
184
+ if($product->getImage()) {
185
+ if($product->getImage() != 'no_selection') {
186
+ $image = $config['media_image_url'] . $product->getImage();
187
+ }
188
+ }
189
+
190
+ if(!empty($config['images'])) {
191
+ $image_data = array();
192
+ $image_data['image_link'] = $image;
193
+ $container = new Varien_Object(array('attribute' => new Varien_Object(array('id' => $config['media_gallery_id']))));
194
+ $img_product = new Varien_Object(array('id' => $product->getId(),'store_id' => $config['store_id']));
195
+ $gallery = Mage::getResourceModel('catalog/product_attribute_backend_media')->loadGallery($img_product, $container);
196
+ $images = array();
197
+ foreach($gallery as $gal_image) {
198
+ if($gal_image['disabled'] == 0) {
199
+ if($config['media_image_url'] . $gal_image['file'] != $image_data['image_link']) {
200
+ $images[] = $config['media_image_url'] . $gal_image['file'];
201
+ }
202
+ }
203
+ }
204
+ if(count($images)) {
205
+ if(count($images) > 1) {
206
+ $image_data['additional_imagelinks'] = implode(';', $images);
207
+ } else {
208
+ $image_data['additional_imagelinks'] = $images[0];
209
+ }
210
+ }
211
+ return $image_data;
212
+ } else {
213
+ return $image;
214
+ }
215
+ }
216
+
217
+ public function getProductCondition($product, $config)
218
+ {
219
+ if(isset($config['condition_attribute'])) {
220
+ if($condition = $product->getAttributeText($config['condition_attribute'])) {
221
+ return $condition;
222
+ }
223
+ }
224
+ return $config['condition_default'];
225
+ }
226
+
227
+ public function getProductBundle($product, $config)
228
+ {
229
+ if($product->getTypeId() == 'bundle') {
230
+ return 'true';
231
+ }
232
+ }
233
+
234
+ public function getProductAvailability($product, $config)
235
+ {
236
+ if(!empty($config['stock_instock'])) {
237
+ if($product->getUseConfigManageStock()) {
238
+ $manage_stock = $config['stock_manage'];
239
+ } else {
240
+ $manage_stock = $product->getManageStock();
241
+ }
242
+ if($manage_stock) {
243
+ if($product['stock_status']) {
244
+ $availability = $config['stock_instock'];
245
+ } else {
246
+ $availability = $config['stock_outofstock'];
247
+ }
248
+ } else {
249
+ $availability = $config['stock_instock'];
250
+ }
251
+ return $availability;
252
+ }
253
+ }
254
+
255
+ public function getProductWeight($product, $config)
256
+ {
257
+ if(!empty($config['weight'])) {
258
+ $weight = number_format($product->getWeight(), 2, '.', '');
259
+ if(isset($config['weight_units'])) {
260
+ $weight = $weight . ' ' . $config['weight_units'];
261
+ }
262
+ return $weight;
263
+ }
264
+ }
265
+
266
+ public function getProductCategories($product, $config)
267
+ {
268
+ if(isset($config['category_data'])) {
269
+ $category_data = $config['category_data'];
270
+ $products_cat = array();
271
+ $category_ids = $product->getCategoryIds();
272
+ $level = 0;
273
+ if(!empty($config['category_full'])) {
274
+ $path = array();
275
+ foreach($category_ids as $category_id) {
276
+ if(isset($category_data[$category_id])) {
277
+ $path[] = $category_data[$category_id]['name'];
278
+ }
279
+ }
280
+ $products_cat = array('path' => $path);
281
+ } else {
282
+ foreach($category_ids as $category_id) {
283
+ if(isset($category_data[$category_id])) {
284
+ if($category_data[$category_id]['level'] > $level) {
285
+ $products_cat = $category_data[$category_id];
286
+ $level = $category_data[$category_id]['level'];
287
+ }
288
+ }
289
+ }
290
+ }
291
+ return $products_cat;
292
+ }
293
+ }
294
+
295
+ public function getProductData($product, $data)
296
+ {
297
+ $type = $data['type'];
298
+ $source = $data['source'];
299
+ $value = '';
300
+ switch($type) {
301
+ case 'text':
302
+ case 'textarea':
303
+ $value = $product[$source];
304
+ break;
305
+ case 'select':
306
+ $value = $product->getAttributeText($source);
307
+ break;
308
+ default:
309
+ if(!empty($product[$source])) {
310
+ $value = $product[$source];
311
+ }
312
+ break;
313
+ }
314
+ return $value;
315
+ }
316
+
317
+
318
+ public function getProductPrice($product, $config)
319
+ {
320
+ $price_data = array();
321
+ $price_markup = $this->getPriceMarkup($config);
322
+ $tax_param = $config['use_tax'];
323
+
324
+ if(!empty($config['hide_currency'])) {
325
+ $currency = '';
326
+ } else {
327
+ $currency = ' ' . $config['currency'];
328
+ }
329
+
330
+ if(!empty($config['price_scope'])) {
331
+ $price = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product->getId(), 'price', $config['store_id']);
332
+ } else {
333
+ $price = $product->getPrice();
334
+ }
335
+
336
+ $price = Mage::helper('tax')->getPrice($product, $price, $tax_param);
337
+ $price_data['regular_price'] = number_format(($price * $price_markup), 2, '.', '') . $currency;
338
+ $pricerule_price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), $tax_param);
339
+
340
+ $special_price = ''; $special_date = '';
341
+ if(($pricerule_price > 0) && ($pricerule_price < $product->getPrice())) {
342
+ $sales_price = $pricerule_price;
343
+ $specialPriceFromDate = $product->getSpecialFromDate();
344
+ $specialPriceToDate = $product->getSpecialToDate();
345
+ $today = time();
346
+ if($today >= strtotime($specialPriceFromDate)) {
347
+ if($today <= strtotime($specialPriceToDate) || is_null($specialPriceToDate)) {
348
+ $price_data['sales_date_start'] = $specialPriceFromDate;
349
+ $price_data['sales_date_end'] = $specialPriceToDate;
350
+ }
351
+ }
352
+ }
353
+
354
+
355
+ if(($product->getTypeId() == 'bundle') && ($price < 0.01)) {
356
+ $price = $this->getPriceBundle($product, $config['store_id']);
357
+ }
358
+
359
+ if($product->getTypeId() == 'grouped') {
360
+ if(!empty($config['price_grouped'])) {
361
+ $price = $this->getPriceGrouped($product, $config['price_grouped']);
362
+ } else {
363
+ if($price < 0.01) {
364
+ $price = $this->getPriceGrouped($product);
365
+ }
366
+ }
367
+ }
368
+
369
+ $price_data['final_price_clean'] = $price;
370
+ $price_data['price'] = number_format(($price * $price_markup), 2, '.', '') . $currency;
371
+
372
+ if(isset($sales_price)) {
373
+ if($product->getTypeId() == 'bundle') {
374
+ $sales_price = (($sales_price * $price) / 100);
375
+ }
376
+ $price_data['sales_price'] = number_format(($sales_price * $price_markup), 2, '.', '') . $currency;
377
+ }
378
+
379
+ if($price_data['final_price_clean'] > 0.01) {
380
+ return $price_data;
381
+ }
382
+
383
+ }
384
+
385
+ public function getPriceMarkup($config)
386
+ {
387
+ $markup = 1;
388
+ if(!empty($config['price_add_tax']) && !empty($config['price_add_tax_perc'])) {
389
+ $markup = 1 + ($config['price_add_tax_perc'] / 100);
390
+ }
391
+ if(!empty($config['exchange_rate'])) {
392
+ $markup = ($markup * $config['exchange_rate']);
393
+ }
394
+ return $markup;
395
+ }
396
+
397
+ public function getTaxUsage($config)
398
+ {
399
+ if(!empty($config['force_tax'])) {
400
+ if($config['force_tax'] == 'incl') {
401
+ return 'true';
402
+ } else {
403
+ return '';
404
+ }
405
+ } else {
406
+ return 'true';
407
+ }
408
+ }
409
+
410
+ public function addAttributeData($attributes, $config = '')
411
+ {
412
+ foreach($attributes as $key => $attribute) {
413
+ $type = (!empty($attribute['type']) ? $attribute['type'] : '');
414
+ $action = (!empty($attribute['action']) ? $attribute['action'] : '');
415
+ $parent = (!empty($attribute['parent']) ? $attribute['parent'] : '');
416
+ if(isset($attribute['source'])) {
417
+ $attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attribute['source']);
418
+ $type = $attributeModel->getFrontendInput();
419
+ }
420
+ if(!empty($config['conf_fields'])) {
421
+ $conf_attributes = explode(',', $config['conf_fields']);
422
+ if(in_array($key, $conf_attributes)) {
423
+ $parent = '1';
424
+ }
425
+ }
426
+ $attributes[$key] = array('label' => $attribute['label'], 'source' => $attribute['source'], 'type' => $type, 'action' => $action, 'parent' => $parent);
427
+ }
428
+ return $attributes;
429
+ }
430
+
431
+ public function getCategoryData($config, $storeId)
432
+ {
433
+ $eavAttribute = new Mage_Eav_Model_Mysql4_Entity_Attribute();
434
+ $attributes = array('entity_id','path','name','level');
435
+
436
+ if(!empty($config['category_custom'])) {
437
+ $attributes[] = $config['category_custom'];
438
+ }
439
+ if(!empty($config['category_replace'])) {
440
+ $attributes[] = $config['category_replace'];
441
+ }
442
+
443
+ $categories = Mage::getModel('catalog/category')->setStoreId($storeId)->getCollection()->addAttributeToSelect($attributes);
444
+ $_categories = array();
445
+
446
+ foreach($categories as $cat) {
447
+ $custom = ''; $name = '';
448
+ if(!empty($config['category_replace'])) {
449
+ if(!empty($cat[$config['category_replace']])) {
450
+ $name = $cat[$config['category_replace']];
451
+ }
452
+ }
453
+ if(isset($config['category_custom'])) {
454
+ if(!empty($cat[$config['category_custom']])) {
455
+ $custom = $cat[$config['category_custom']];
456
+ }
457
+ }
458
+ if(empty($name)) { $name = $cat['name']; }
459
+ $_categories[$cat->getId()] = array('path' => $cat['path'], 'custom' => $custom, 'name' => $name, 'level' => $cat['level']);
460
+ }
461
+
462
+ foreach($_categories as $key => $cat) {
463
+ $path = array();
464
+ $paths = explode('/', $cat['path']);
465
+ foreach($paths as $p) {
466
+ if(!empty($_categories[$p]['name'])) {
467
+ if($_categories[$p]['level'] > 1) {
468
+ $path[] = $_categories[$p]['name'];
469
+ }
470
+ }
471
+ }
472
+ $_categories[$key] = array('path' => $this->cleanData($path, 'stiptags'), 'custom' => $this->cleanData($cat['custom'], 'striptags'), 'name' => $this->cleanData($cat['name'], 'striptags'), 'level' => $cat['level']);
473
+ }
474
+ return $_categories;
475
+ }
476
+
477
+ public function getParentData($product, $config)
478
+ {
479
+ if(!empty($config['conf_enabled'])) {
480
+ if(($product['type_id'] == 'simple')) {
481
+ $config_ids = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
482
+ $group_ids = Mage::getResourceSingleton('catalog/product_link')->getParentIdsByChild($product->getId(), Mage_Catalog_Model_Product_Link::LINK_TYPE_GROUPED);
483
+ if($config_ids) {
484
+ return $config_ids[0];
485
+ }
486
+ if($group_ids) {
487
+ return $group_ids[0];
488
+ }
489
+ }
490
+ }
491
+ }
492
+
493
+ public function validateProduct($product, $config)
494
+ {
495
+ if(empty($config['skip_validation'])) {
496
+ if(!empty($config['filter_exclude'])) {
497
+ if($product[$config['filter_exclude']] == 1) {
498
+ return false;
499
+ }
500
+ }
501
+ if(!empty($config['hide_no_stock'])) {
502
+ if($product->getUseConfigManageStock()) {
503
+ $manage_stock = $config['stock_manage'];
504
+ } else {
505
+ $manage_stock = $product->getManageStock();
506
+ }
507
+ if($manage_stock) {
508
+ if(!$product['stock_status']) {
509
+ return false;
510
+ }
511
+ }
512
+ }
513
+ }
514
+ return true;
515
+ }
516
+
517
+ public function validateParent($parent, $config, $product)
518
+ {
519
+ return $this->validateProduct($product, $config);
520
+ }
521
+
522
+ public function getPriceBundle($product, $storeId)
523
+ {
524
+ if(($product->getPriceType() == '1') && ($product->getFinalPrice() > 0)) {
525
+ $price = $product->getFinalPrice();
526
+ } else {
527
+ $priceModel = $product->getPriceModel();
528
+ $block = Mage::getSingleton('core/layout')->createBlock('bundle/catalog_product_view_type_bundle');
529
+ $options = $block->setProduct($product)->getOptions();
530
+ $price = 0;
531
+
532
+ foreach ($options as $option) {
533
+ $selection = $option->getDefaultSelection();
534
+ if($selection === null) { continue; }
535
+ $prod_option = Mage::getModel('catalog/product')->setStoreId($storeId)->load($selection->getProductId());
536
+ $price += ($prod_option->getFinalPrice() * $selection->getSelectionQty());
537
+ }
538
+ }
539
+ if($price < 0.01) {
540
+ $price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), true);
541
+ }
542
+ return $price;
543
+ }
544
+
545
+ public function getPriceGrouped($product, $pricemodel = '')
546
+ {
547
+ if(!$pricemodel) { $pricemodel = 'min'; }
548
+ $prices = array();
549
+ $_associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
550
+ foreach($_associatedProducts as $_item) {
551
+ $price_associated = Mage::helper('tax')->getPrice($_item, $_item->getFinalPrice(), true);
552
+ if($price_associated > 0) {
553
+ $prices[] = $price_associated;
554
+ }
555
+ }
556
+ if($pricemodel == 'min') { return min($prices); }
557
+ if($pricemodel == 'max') { return max($prices); }
558
+ if($pricemodel == 'total') { return array_sum($prices); }
559
+ }
560
+
561
+
562
+ public function checkOldVersion($dir)
563
+ {
564
+ if($dir) {
565
+ $dir = Mage::getBaseDir('app') . DS . 'code' . DS . 'local' . DS . 'Magmodules' . DS . $dir;
566
+ return file_exists($dir);
567
+ }
568
+ }
569
+
570
+ public function checkFlatCatalog($attributes)
571
+ {
572
+ $non_flat_attributes = array();
573
+ foreach($attributes as $key => $attribute) {
574
+ if(!empty($attribute['source'])) {
575
+ if(($attribute['source'] != 'entity_id') && ($attribute['source'] != 'sku')) {
576
+ $_attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attribute['source']);
577
+ if($_attribute->getUsedInProductListing() == 0) {
578
+ if($_attribute->getId()) {
579
+ $non_flat_attributes[$_attribute->getId()] = $_attribute->getFrontendLabel();
580
+ }
581
+ }
582
+ }
583
+ }
584
+ }
585
+ return $non_flat_attributes;
586
+ }
587
+
588
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Backend/Design/Extra.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Backend_Design_Extra extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array {
19
+
20
+ protected function _beforeSave()
21
+ {
22
+ $value = $this->getValue();
23
+ if(is_array($value)) {
24
+ unset($value['__empty']);
25
+ if(count($value)) {
26
+ $value = $this->orderData($value, 'label');
27
+ $keys = array();
28
+ for($i=0; $i < count($value); $i++){
29
+ $keys[] = 'fields_' . uniqid();
30
+ }
31
+ foreach($value as $key => $field){
32
+ $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $field['attribute']);
33
+ $label = str_replace(" ", "_", trim($field['label']));
34
+ $value[$key]['label'] = strtolower($label);
35
+ $value[$key]['attribute'] = $field['attribute'];
36
+ }
37
+ $value = array_combine($keys, array_values($value));
38
+ }
39
+ }
40
+
41
+ $this->setValue($value);
42
+ parent::_beforeSave();
43
+ }
44
+
45
+ function orderData($data, $sort)
46
+ {
47
+ $code = "return strnatcmp(\$a['$sort'], \$b['$sort']);";
48
+ usort($data, create_function('$a,$b', $code));
49
+ return $data;
50
+ }
51
+
52
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Backend/Design/Shipping.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Backend_Design_Shipping extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array {
19
+
20
+ protected function _beforeSave()
21
+ {
22
+ $value = $this->getValue();
23
+ if(is_array($value)) {
24
+ unset($value['__empty']);
25
+ if(count($value)){
26
+ $value = $this->orderData($value, 'price_from');
27
+ $keys = array();
28
+ for($i=0; $i < count($value); $i++){
29
+ $keys[] = 'shipping_' . uniqid();
30
+ }
31
+ foreach($value as $key => $field){
32
+ $price_from = str_replace(',','.',$field['price_from']);
33
+ $price_to = str_replace(',','.',$field['price_to']);
34
+ $cost = str_replace(',','.',$field['cost']);
35
+ $value[$key]['price_from'] = number_format($price_from, 2, '.', '');
36
+ $value[$key]['price_to'] = number_format($price_to, 2, '.', '');
37
+ $value[$key]['cost'] = number_format($cost, 2, '.', '');
38
+ }
39
+
40
+ $value = array_combine($keys, array_values($value));
41
+ }
42
+ }
43
+ $this->setValue($value);
44
+
45
+ parent::_beforeSave();
46
+ }
47
+
48
+ function orderData($data, $sort)
49
+ {
50
+ $code = "return strnatcmp(\$a['$sort'], \$b['$sort']);";
51
+ usort($data, create_function('$a,$b', $code));
52
+ return $data;
53
+ }
54
+
55
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Action.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Action {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $position = array();
23
+ $position[] = array('value'=> '', 'label'=> Mage::helper('channable')->__('-- None'));
24
+ $position[] = array('value'=> 'strip_tags', 'label'=> Mage::helper('channable')->__('Strip Tags'));
25
+ return $position;
26
+ }
27
+
28
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Attribute.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Attribute {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $optionArray = array();
23
+ $backend_types = array('text', 'select', 'textarea', 'date', 'int', 'boolean', 'static', 'varchar');
24
+ $attributes = Mage::getResourceModel('catalog/product_attribute_collection')->setOrder('frontend_label','ASC')->addFieldToFilter('backend_type', $backend_types);
25
+ foreach($attributes as $attribute) {
26
+ if($attribute->getData('frontend_label')) {
27
+ $optionArray[] = array(
28
+ 'value' => $attribute->getData('attribute_code'),
29
+ 'label' => str_replace("'", "", $attribute->getData('frontend_label')),
30
+ );
31
+ }
32
+ }
33
+ return $optionArray;
34
+ }
35
+
36
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Category.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Category {
19
+
20
+ public function toOptionArray($addEmpty = true)
21
+ {
22
+ $options = array();
23
+ $collection = Mage::getResourceModel('catalog/category_collection');
24
+ $collection->addAttributeToSelect('name')->addPathFilter('^1/[0-9/]+')->load();
25
+ $cats = array();
26
+ foreach ($collection as $category) {
27
+ $cat = new stdClass();
28
+ $cat->label = $category->getName();
29
+ $cat->value = $category->getId();
30
+ $cat->level = $category->getLevel();
31
+ $cat->parentid = $category->getParentId();
32
+ $cats[$cat->value] = $cat;
33
+ }
34
+ foreach($cats as $id => $cat) {
35
+ if(isset($cats[$cat->parentid])){
36
+ if(!isset($cats[$cat->parentid]->child)) {
37
+ $cats[$cat->parentid]->child = array();
38
+ }
39
+ $cats[$cat->parentid]->child[] =& $cats[$id];
40
+ }
41
+ }
42
+ foreach($cats as $id => $cat){
43
+ if(!isset($cats[$cat->parentid])){
44
+ $stack = array($cats[$id]);
45
+ while(count($stack)>0 ){
46
+ $opt = array_pop($stack);
47
+ $option = array('label' => ($opt->level>1 ? str_repeat('- ', $opt->level-1) : '') . $opt->label, 'value' => $opt->value);
48
+ array_push($options, $option);
49
+ if(isset($opt->child) && count($opt->child)) {
50
+ foreach(array_reverse($opt->child) as $child) {
51
+ array_push($stack, $child);
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ unset($cats);
58
+ return $options;
59
+ }
60
+
61
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Categorytype.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Categorytype {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $type = array();
23
+ $type[] = array('value'=>'include', 'label'=> Mage::helper('channable')->__('Include by Category'));
24
+ $type[] = array('value'=>'exclude', 'label'=> Mage::helper('channable')->__('Exclude by Category'));
25
+ return $type;
26
+ }
27
+
28
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Configurable.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Configurable {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $attributes = Mage::getModel("channable/channable")->getFeedAttributes();
23
+ $attributes_skip = array('id','parent_id','price');
24
+ $att = array();
25
+ foreach ($attributes as $key => $attribute) {
26
+ if(!in_array($key,$attributes_skip)) {
27
+ $att[] = array('value'=> $key, 'label'=> $key);
28
+ }
29
+ }
30
+ return $att;
31
+ }
32
+
33
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Images.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Images {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $type = array();
23
+ $type[] = array('value'=>'', 'label'=> Mage::helper('channable')->__('Only Base Image'));
24
+ $type[] = array('value'=>'all', 'label'=> Mage::helper('channable')->__('All Images'));
25
+ return $type;
26
+ }
27
+
28
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Pricemodel.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Pricemodel {
19
+
20
+ public function toOptionArray() {
21
+ $type = array();
22
+ $type[] = array('value'=>'', 'label'=> Mage::helper('adminhtml')->__('Use default price'));
23
+ $type[] = array('value'=>'min', 'label'=> Mage::helper('adminhtml')->__('Use minimum price'));
24
+ $type[] = array('value'=>'max', 'label'=> Mage::helper('adminhtml')->__('Use maximum price'));
25
+ $type[] = array('value'=>'total', 'label'=> Mage::helper('adminhtml')->__('Use total price'));
26
+ return $type;
27
+ }
28
+
29
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Selectattribute.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Selectattribute {
19
+
20
+ protected $_ignore = array(
21
+ 'ebizmarts_mark_visited',
22
+ 'is_recurring',
23
+ 'links_purchased_separately',
24
+ 'price_view',
25
+ 'status',
26
+ 'tax_class_id',
27
+ 'visibility',
28
+ 'shipment_type',
29
+ );
30
+
31
+ public function toOptionArray()
32
+ {
33
+ $options = array();
34
+ $options[] = array('value' => '', 'label' => Mage::helper('channable')->__('-- none'));
35
+ $entityTypeId = Mage::getModel('eav/entity_type')->loadByCode('catalog_product')->getEntityTypeId();
36
+ $attributes = Mage::getModel('eav/entity_attribute')->getCollection()->addFilter('entity_type_id', $entityTypeId)->setOrder('attribute_code', 'ASC');
37
+ foreach ($attributes as $attribute){
38
+ if($attribute->getBackendType() == 'int') {
39
+ if($attribute->getFrontendLabel()) {
40
+ if(!in_array($attribute->getAttributeCode(), $this->_ignore)) {
41
+ $options[] = array('value'=> $attribute->getAttributeCode(), 'label'=> $attribute->getFrontendLabel());
42
+ }
43
+ }
44
+ }
45
+ }
46
+ return $options;
47
+ }
48
+
49
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Tax.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Tax {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $position = array();
23
+ $position[] = array('value'=> '', 'label'=> Mage::helper('channable')->__('No'));
24
+ $position[] = array('value'=> 'incl', 'label'=> Mage::helper('channable')->__('Force including Tax'));
25
+ $position[] = array('value'=> 'excl', 'label'=> Mage::helper('channable')->__('Force excluding Tax'));
26
+ return $position;
27
+ }
28
+
29
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Textattribute.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Textattribute {
19
+
20
+ protected $_ignore = array(
21
+ 'compatibility',
22
+ 'gallery',
23
+ 'installation',
24
+ 'language_support',
25
+ 'country_of_manufacture',
26
+ 'links_title',
27
+ 'current_version',
28
+ 'custom_design',
29
+ 'custom_layout_update',
30
+ 'gift_message_available',
31
+ 'image',
32
+ 'image_label',
33
+ 'media_gallery',
34
+ 'msrp_display_actual_price_type',
35
+ 'msrp_enabled',
36
+ 'options_container',
37
+ 'price_view',
38
+ 'page_layout',
39
+ 'samples_title',
40
+ 'sku_type',
41
+ 'tier_price',
42
+ 'url_key',
43
+ 'small_image',
44
+ 'small_image_label',
45
+ 'thumbnail',
46
+ 'thumbnail_label',
47
+ 'recurring_profile',
48
+ 'version_info',
49
+ 'meta_title',
50
+ 'meta_keyword',
51
+ );
52
+
53
+ public function toOptionArray()
54
+ {
55
+ $options = array();
56
+ $options[] = array('value' => '', 'label' => Mage::helper('channable')->__('-- none'));
57
+ $entityTypeId = Mage::getModel('eav/entity_type')->loadByCode('catalog_product')->getEntityTypeId();
58
+ $attributes = Mage::getModel('eav/entity_attribute')->getCollection()->addFilter('entity_type_id', $entityTypeId)->setOrder('attribute_code', 'ASC');
59
+ foreach ($attributes as $attribute){
60
+ if(($attribute->getBackendType() == 'text') || ($attribute->getBackendType() == 'varchar') || ($attribute->getBackendType() == 'static')) {
61
+ if($attribute->getFrontendLabel()) {
62
+ if(!in_array($attribute->getAttributeCode(), $this->_ignore)) {
63
+ $options[] = array('value'=> $attribute->getAttributeCode(), 'label'=> $attribute->getFrontendLabel());
64
+ }
65
+ }
66
+ }
67
+ }
68
+ return $options;
69
+ }
70
+
71
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Type.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Type {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $type = array();
23
+ $type[] = array('value'=>'fixed', 'label'=> Mage::helper('channable')->__('Static'));
24
+ $type[] = array('value'=>'attribute', 'label'=> Mage::helper('channable')->__('Use Attribute'));
25
+ return $type;
26
+ }
27
+
28
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Visibility.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Visibility {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $type = array();
23
+ $type[] = array('value'=>'1', 'label'=> Mage::helper('adminhtml')->__('Not Visible Individually'));
24
+ $type[] = array('value'=>'2', 'label'=> Mage::helper('adminhtml')->__('Catalog'));
25
+ $type[] = array('value'=>'3', 'label'=> Mage::helper('adminhtml')->__('Search'));
26
+ $type[] = array('value'=>'4', 'label'=> Mage::helper('adminhtml')->__('Catalog, Search'));
27
+ return $type;
28
+ }
29
+
30
+ }
app/code/community/Magmodules/Channable/Model/Adminhtml/System/Config/Source/Weight.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Adminhtml_System_Config_Source_Weight {
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $type = array();
23
+ $type[] = array('value'=>'lb', 'label'=> Mage::helper('adminhtml')->__('Pounds (lb)'));
24
+ $type[] = array('value'=>'oz', 'label'=> Mage::helper('adminhtml')->__('Ounces (oz)'));
25
+ $type[] = array('value'=>'g', 'label'=> Mage::helper('adminhtml')->__('Grams (g)'));
26
+ $type[] = array('value'=>'kg', 'label'=> Mage::helper('adminhtml')->__('Kilograms (kg)'));
27
+ return $type;
28
+ }
29
+
30
+ }
app/code/community/Magmodules/Channable/Model/Channable.php ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Channable extends Magmodules_Channable_Model_Common {
19
+
20
+ public function generateFeed($storeId, $limit = '', $page = '', $time_start)
21
+ {
22
+ $config = $this->getFeedConfig($storeId);
23
+ $products = $this->getProducts($config, $config['limit'], $page);
24
+ if($feed = $this->getFeedData($products, $config, $time_start)) {
25
+ return $feed;
26
+ }
27
+ }
28
+
29
+ public function getFeedData($products, $config, $time_start)
30
+ {
31
+ $count = $this->getProducts($config, '', '', 'count');
32
+ foreach($products as $product) {
33
+ $parent_id = Mage::helper('channable')->getParentData($product, $config);
34
+ if($parent_id > 0) { $parent = $products->getItemById($parent_id); } else { $parent = ''; }
35
+ if(($parent_id > 0) && (empty($parent))) { $parent = Mage::getModel('catalog/product')->setStoreId($config['store_id'])->load($parent_id); }
36
+ if($product_data = Mage::helper('channable')->getProductDataRow($product, $config, $parent)) {
37
+ foreach($product_data as $key => $value) {
38
+ if(!is_array($value)) { $product_row[$key] = $value; }
39
+ }
40
+ if($extra_data = $this->getExtraDataFields($product_data, $config, $product)) {
41
+ $product_row = array_merge($product_row, $extra_data);
42
+ }
43
+ $feed['products'][] = $product_row;
44
+ unset($product_row);
45
+ }
46
+ }
47
+ if(!empty($feed)) {
48
+ $return_feed = array();
49
+ $return_feed['config'] = $this->getFeedHeader($config, $count, $time_start, count($feed['products']));
50
+ $return_feed['products'] = $feed['products'];
51
+ return $return_feed;
52
+ } else {
53
+ $return_feed = array();
54
+ $return_feed['config'] = $this->getFeedHeader($config, $count, $time_start);
55
+ return $return_feed;
56
+ }
57
+ }
58
+
59
+ public function getFeedConfig($storeId)
60
+ {
61
+
62
+ $config = array();
63
+ $feed = Mage::helper('channable');
64
+ $websiteId = Mage::app()->getStore($storeId)->getWebsiteId();
65
+
66
+ // DEFAULTS
67
+ $config['store_id'] = $storeId;
68
+ $config['website_name'] = $feed->cleanData(Mage::getModel('core/website')->load($websiteId)->getName(), 'striptags');
69
+ $config['website_url'] = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
70
+ $config['media_url'] = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
71
+ $config['media_image_url'] = $config['media_url'] . 'catalog' . DS . 'product';
72
+ $config['limit'] = Mage::getStoreConfig('channable/connect/max_products', $storeId);
73
+ $config['version'] = (string)Mage::getConfig()->getNode()->modules->Magmodules_Channable->version;
74
+ $config['media_gallery_id'] = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', 'media_gallery');
75
+
76
+ // PRODUCT & CATEGORY
77
+ $config['filter_enabled'] = Mage::getStoreConfig('channable/filter/category_enabled', $storeId);
78
+ $config['filter_cat'] = Mage::getStoreConfig('channable/filter/categories', $storeId);
79
+ $config['filter_type'] = Mage::getStoreConfig('channable/filter/category_type', $storeId);
80
+ $config['filter_status'] = Mage::getStoreConfig('channable/filter/visibility_inc', $storeId);
81
+ $config['hide_no_stock'] = Mage::getStoreConfig('channable/filter/stock', $storeId);
82
+ $config['conf_enabled'] = Mage::getStoreConfig('channable/data/conf_enabled', $storeId);
83
+ $config['conf_fields'] = Mage::getStoreConfig('channable/data/conf_fields', $storeId);
84
+ $config['stock_manage'] = Mage::getStoreConfig('cataloginventory/item_options/manage_stock');
85
+ $config['delivery'] = Mage::getStoreConfig('channable/data/delivery', $storeId);
86
+ $config['delivery_att'] = Mage::getStoreConfig('channable/data/delivery_att', $storeId);
87
+ $config['delivery_in'] = Mage::getStoreConfig('channable/data/delivery_in', $storeId);
88
+ $config['delivery_out'] = Mage::getStoreConfig('channable/data/delivery_out', $storeId);
89
+
90
+ $config['images'] = Mage::getStoreConfig('channable/data/images', $storeId);
91
+ $config['skip_validation'] = true;
92
+ $config['category_full'] = true;
93
+
94
+ // WEIGHT
95
+ $config['weight'] = Mage::getStoreConfig('channable/data/weight', $storeId);
96
+ $config['weight_units'] = Mage::getStoreConfig('channable/data/weight_units', $storeId);
97
+
98
+ // PRICE
99
+ $config['price_scope'] = Mage::getStoreConfig('catalog/price/scope');
100
+ $config['price_add_tax'] = Mage::getStoreConfig('channable/data/add_tax', $storeId);
101
+ $config['price_add_tax_perc'] = Mage::getStoreConfig('channable/data/tax_percentage', $storeId);
102
+ $config['force_tax'] = Mage::getStoreConfig('channable/data/force_tax', $storeId);
103
+ $config['currency'] = Mage::app()->getStore($storeId)->getCurrentCurrencyCode();
104
+ $config['base_currency_code'] = Mage::app()->getStore($storeId)->getBaseCurrencyCode();
105
+ $config['markup'] = Mage::helper('channable')->getPriceMarkup($config);
106
+ $config['use_tax'] = Mage::helper('channable')->getTaxUsage($config);
107
+
108
+ // SHIPPING
109
+ $config['shipping'] = @unserialize(Mage::getStoreConfig('channable/advanced/shipping_price', $storeId));
110
+
111
+ // FIELD & CATEGORY DATA
112
+ $config['field'] = $this->getFeedAttributes($config, $storeId);
113
+ $config['category_data'] = $feed->getCategoryData($config, $storeId);
114
+
115
+ return $config;
116
+ }
117
+
118
+ public function getFeedAttributes($config = '', $storeId = 0)
119
+ {
120
+ $attributes = array();
121
+ $attributes['id'] = array('label' => 'id', 'source' => 'entity_id');
122
+ $attributes['name'] = array('label' => 'name', 'source' => 'name');
123
+ $attributes['description'] = array('label' => 'description', 'source' => Mage::getStoreConfig('channable/data/description', $storeId), 'action' => 'striptags');
124
+ $attributes['product_url'] = array('label' => 'url', 'source' => '');
125
+ $attributes['image_link'] = array('label' => 'image', 'source' => '');
126
+ $attributes['price'] = array('label' => 'price', 'source' => '');
127
+ $attributes['sku'] = array('label' => 'sku', 'source' => Mage::getStoreConfig('channable/data/sku', $storeId));
128
+ $attributes['brand'] = array('label' => 'brand', 'source' => Mage::getStoreConfig('channable/data/brand', $storeId));
129
+ $attributes['size'] = array('label' => 'size', 'source' => Mage::getStoreConfig('channable/data/size', $storeId));
130
+ $attributes['color'] = array('label' => 'color', 'source' => Mage::getStoreConfig('channable/data/color', $storeId));
131
+ $attributes['material'] = array('label' => 'material', 'source' => Mage::getStoreConfig('channable/data/material', $storeId));
132
+ $attributes['gender'] = array('label' => 'gender', 'source' => Mage::getStoreConfig('channable/data/gender', $storeId));
133
+ $attributes['ean'] = array('label' => 'ean', 'source' => Mage::getStoreConfig('channable/data/ean', $storeId));
134
+ $attributes['categories'] = array('label' => 'categories', 'source' => '', 'parent' => 1);
135
+ $attributes['type'] = array('label' => 'type', 'source' => 'type_id');
136
+ $attributes['status'] = array('label' => 'status', 'source' => 'status', 'parent' => 1);
137
+ $attributes['parent_id'] = array('label' => 'item_group_id', 'source' => 'entity_id', 'parent' => 1);
138
+ $attributes['weight'] = array('label' => 'weight', 'source' => '');
139
+
140
+ if(Mage::getStoreConfig('channable/data/stock_status', $storeId)) {
141
+ $attributes['stock_status'] = array('label' => 'stock_status', 'source' => 'stock_status');
142
+ }
143
+ if(Mage::getStoreConfig('channable/data/stock', $storeId)) {
144
+ $attributes['stock'] = array('label' => 'qty', 'source' => 'qty', 'action' => 'round');
145
+ }
146
+
147
+ if($extra_fields = @unserialize(Mage::getStoreConfig('channable/advanced/extra', $storeId))) {
148
+ foreach($extra_fields as $extra_field) {
149
+ $attributes[$extra_field['attribute']] = array('label' => $extra_field['label'], 'source' => $extra_field['attribute'], 'action' => '');
150
+ }
151
+ }
152
+ return Mage::helper('channable')->addAttributeData($attributes, $config);
153
+ }
154
+
155
+ protected function getPrices($data)
156
+ {
157
+ $prices = array();
158
+ $prices['price'] = $data['price'];
159
+ $prices['special_price'] = '';
160
+ $prices['special_price_from'] = '';
161
+ $prices['special_price_to'] = '';
162
+ if(isset($data['sales_price'])) {
163
+ $prices['price'] = $data['regular_price'];
164
+ $prices['special_price'] = $data['sales_price'];
165
+ if(isset($data['sales_date_start'])) {
166
+ $prices['special_price_from'] = $data['sales_date_start'];
167
+ }
168
+ if(isset($data['sales_date_end'])) {
169
+ $prices['special_price_to'] = $data['sales_date_end'];
170
+ }
171
+ }
172
+ return $prices;
173
+ }
174
+
175
+ protected function getShipping($data, $config, $product)
176
+ {
177
+ $shipping_array = array();
178
+ if(($config['delivery'] == 'attribute') && ($config['delivery_att'])) {
179
+ $shipping_array['delivery_period'] = $data[$feed_config['delivery_att']];
180
+ } else {
181
+ if(!empty($config['delivery_in'])) {
182
+ if($product->getUseConfigManageStock()) {
183
+ $manage_stock = $config['stock_manage'];
184
+ } else {
185
+ $manage_stock = $product->getManageStock();
186
+ }
187
+ if($manage_stock) {
188
+ if($product['stock_status']) {
189
+ $shipping_array['delivery_period'] = $config['delivery_in'];
190
+ } else {
191
+ $shipping_array['delivery_period'] = $config['delivery_out'];
192
+ }
193
+ } else {
194
+ $shipping_array['delivery_period'] = $config['delivery_in'];
195
+ }
196
+ }
197
+ }
198
+ $i = 1;
199
+ $shipping_cost = '0.00';
200
+ if(!empty($data['price']['final_price_clean'])) {
201
+ $price = $data['price']['final_price_clean'];
202
+ if(!empty($config['shipping'])) {
203
+ foreach($config['shipping'] as $shipping_price) {
204
+ if(($price >= $shipping_price['price_from']) && ($price <= $shipping_price['price_to'])) {
205
+ if($shipping_price['cost'] > 0) {
206
+ $shipping_cost = $shipping_price['cost'];
207
+ $shipping_cost = number_format($shipping_cost, 2, '.', '');
208
+ $shipping_array['shipping'] = $shipping_cost . ' ' . $config['currency'];
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
214
+ return $shipping_array;
215
+ }
216
+
217
+ protected function getCategoryData($product_data, $config)
218
+ {
219
+ $category = array();
220
+ if(!empty($product_data['categories'])) {
221
+ if(is_array($product_data['categories']['path'])) {
222
+ $path_array = array_unique($product_data['categories']['path']);
223
+ $category['categories'] = implode(' > ', $path_array);
224
+ }
225
+ }
226
+ return $category;
227
+ }
228
+
229
+ protected function getExtraDataFields($product_data, $config, $product)
230
+ {
231
+ $_extra = array();
232
+ if($_prices = $this->getPrices($product_data['price'])) {
233
+ $_extra = array_merge($_extra, $_prices);
234
+ }
235
+ if($_shipping = $this->getShipping($product_data, $config, $product)) {
236
+ $_extra = array_merge($_extra, $_shipping);
237
+ }
238
+ if($_category_data = $this->getCategoryData($product_data, $config)) {
239
+ $_extra = array_merge($_extra, $_category_data);
240
+ }
241
+ return $_extra;
242
+ }
243
+
244
+ protected function getFeedHeader($config, $count, $time_start, $product_count = 0) {
245
+ $header = array();
246
+ $header['system'] = 'Magento';
247
+ $header['extension'] = 'Magmodules_Channable';
248
+ $header['extension_version'] = $config['version'];
249
+ $header['store'] = $config['website_name'];
250
+ $header['url'] = $config['website_url'];
251
+ $header['products_total'] = $count;
252
+ $header['products_limit'] = $config['limit'];
253
+ $header['products_pages'] = (($config['limit']) && ($count > $config['limit'])) ? ceil($count / $config['limit']) : 1;
254
+ $header['processing_time'] = number_format((microtime(true) - $time_start), 4);
255
+ if(($count > 0) && ($config['limit'] == $product_count)) {
256
+ $header['next_page'] = 'true';
257
+ } else {
258
+ $header['next_page'] = 'false';
259
+ }
260
+ return $header;
261
+ }
262
+
263
+ }
app/code/community/Magmodules/Channable/Model/Common.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Model_Common extends Mage_Core_Helper_Abstract {
19
+
20
+ public function getProducts($config, $limit = '', $page = 1, $type = '')
21
+ {
22
+
23
+ $store_id = $config['store_id'];
24
+ $collection = Mage::getResourceModel('catalog/product_collection');
25
+ $collection->setStore($store_id);
26
+ $collection->addStoreFilter($store_id);
27
+
28
+ if(!empty($config['filter_enabled'])) {
29
+ $type = $config['filter_type'];
30
+ $categories = $config['filter_cat'];
31
+ if($type && $categories) {
32
+ $table = Mage::getSingleton('core/resource')->getTableName('catalog_category_product');
33
+ if($type == 'include') {
34
+ $collection->getSelect()->join(array('cats' => $table), 'cats.product_id = e.entity_id');
35
+ $collection->getSelect()->where('cats.category_id in (' . $categories . ')');
36
+ } else {
37
+ $collection->getSelect()->join(array('cats' => $table), 'cats.product_id = e.entity_id');
38
+ $collection->getSelect()->where('cats.category_id not in (' . $categories . ')');
39
+ }
40
+ }
41
+ }
42
+
43
+ if(!empty($config['filter_status'])) {
44
+ $visibility = $config['filter_status'];
45
+ if(strlen($visibility) > 1) {
46
+ $visibility = explode(',', $visibility);
47
+ if($config['conf_enabled']) {
48
+ $visibility[] = '1';
49
+ }
50
+ $collection->addAttributeToFilter('visibility', array('in' => array($visibility)));
51
+ } else {
52
+ if(!empty($config['conf_enabled'])) {
53
+ $visibility = '1,' . $visibility;
54
+ $visibility = explode(',', $visibility);
55
+ $collection->addAttributeToFilter('visibility', array('in' => array($visibility)));
56
+ } else {
57
+ $collection->addAttributeToFilter('visibility', array('eq' => array($visibility)));
58
+ }
59
+ }
60
+ }
61
+
62
+ if(($limit) && ($type != 'count')) {
63
+ $collection->setPage($page, $limit)->getCurPage();
64
+ }
65
+
66
+ if($type != 'count') {
67
+ $attributes = array();
68
+ $attributes[] = 'url_path';
69
+ $attributes[] = 'price';
70
+ $attributes[] = 'final_price';
71
+ $attributes[] = 'price_model';
72
+ $attributes[] = 'price_type';
73
+ $attributes[] = 'special_price';
74
+ $attributes[] = 'special_from_date';
75
+ $attributes[] = 'special_to_date';
76
+ $attributes[] = 'type_id';
77
+ $attributes[] = 'tax_class_id';
78
+ $attributes[] = 'tax_percent';
79
+ $attributes[] = 'weight';
80
+ $attributes[] = 'visibility';
81
+ $attributes[] = 'type_id';
82
+ $attributes[] = 'image';
83
+ $attributes[] = 'small_image';
84
+ $attributes[] = 'thumbnail';
85
+
86
+ if(!empty($config['filter_exclude'])) {
87
+ $attributes[] = $config['filter_exclude'];
88
+ }
89
+
90
+ foreach($config['field'] as $field) {
91
+ if(!empty($field['source'])) {
92
+ $attributes[] = $field['source'];
93
+ }
94
+ }
95
+
96
+ $collection->addAttributeToSelect($attributes);
97
+ $collection->joinTable('cataloginventory/stock_item', 'product_id=entity_id', array("qty" => "qty", "stock_status" => "is_in_stock", "manage_stock" => "manage_stock", "use_config_manage_stock" => "use_config_manage_stock"))->addAttributeToSelect(array('qty', 'stock_status', 'manage_stock', 'use_config_manage_stock'));
98
+ $collection->getSelect()->group('e.entity_id');
99
+ $products = $collection->load();
100
+ } else {
101
+ $products = $collection->getSize();
102
+ }
103
+
104
+ return $products;
105
+ }
106
+
107
+ }
app/code/community/Magmodules/Channable/controllers/Adminhtml/ChannableController.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_Adminhtml_ChannableController extends Mage_Adminhtml_Controller_Action {
19
+
20
+ public function addToFlatAction()
21
+ {
22
+ $non_flat_attributes = Mage::helper('channable')->checkFlatCatalog(Mage::getModel("channable/channable")->getFeedAttributes());
23
+ foreach($non_flat_attributes as $key => $value) {
24
+ $_attribute = Mage::getModel('catalog/resource_eav_attribute')->load($key)->setUsedInProductListing(1)->save();
25
+ }
26
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('channable')->__('Attributes added to Flat Catalog, please reindex Product Flat Data.'));
27
+ $this->_redirect('adminhtml/system_config/edit/section/channable');
28
+ }
29
+
30
+ }
app/code/community/Magmodules/Channable/controllers/FeedController.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Channable
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Channable_FeedController extends Mage_Core_Controller_Front_Action {
19
+
20
+ public function getAction()
21
+ {
22
+ $storeId = $this->getRequest()->getParam('store');
23
+ if(Mage::getStoreConfig('channable/connect/enabled', $storeId)) {
24
+ $code = $this->getRequest()->getParam('code');
25
+ $page = $this->getRequest()->getParam('page');
26
+ if($storeId && $code) {
27
+ if($code == Mage::getStoreConfig('channable/connect/token')) {
28
+ $time_start = microtime(true);
29
+ $limit = Mage::getStoreConfig('channable/connect/max_products', $storeId);
30
+ $appEmulation = Mage::getSingleton('core/app_emulation');
31
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
32
+ Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS)->loadArea(Mage_Core_Model_App_Area::AREA_FRONTEND);
33
+ if($feed = Mage::getModel('channable/channable')->generateFeed($storeId, $limit, $page, $time_start)) {
34
+ if($this->getRequest()->getParam('array')) {
35
+ $this->getResponse()->setBody(Zend_Debug::dump($feed, null, false));
36
+ } else {
37
+ $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
38
+ $this->getResponse()->setBody(json_encode($feed));
39
+ }
40
+ }
41
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ }
app/code/community/Magmodules/Channable/etc/adminhtml.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
5
+ * =============================================================
6
+ * NOTICE OF LICENSE [Single domain license]
7
+ * This source file is subject to the EULA that is
8
+ * available through the world-wide-web at:
9
+ * http://www.magmodules.eu/license-agreement/
10
+ * =============================================================
11
+ * @category Magmodules
12
+ * @package Magmodules_Channable
13
+ * @author Magmodules <info@magmodules.eu>
14
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
15
+ * @license http://www.magmodules.eu/license-agreement/
16
+ * =============================================================
17
+ */
18
+ -->
19
+ <config>
20
+ <acl>
21
+ <resources>
22
+ <admin>
23
+ <children>
24
+ <system>
25
+ <children>
26
+ <config>
27
+ <children>
28
+ <channable translate="title" module="channable">
29
+ <title>Channable Connect</title>
30
+ </channable>
31
+ </children>
32
+ </config>
33
+ </children>
34
+ </system>
35
+ </children>
36
+ </admin>
37
+ </resources>
38
+ </acl>
39
+ </config>
app/code/community/Magmodules/Channable/etc/config.xml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
5
+ * =============================================================
6
+ * NOTICE OF LICENSE [Single domain license]
7
+ * This source file is subject to the EULA that is
8
+ * available through the world-wide-web at:
9
+ * http://www.magmodules.eu/license-agreement/
10
+ * =============================================================
11
+ * @category Magmodules
12
+ * @package Magmodules_Channable
13
+ * @author Magmodules <info@magmodules.eu>
14
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
15
+ * @license http://www.magmodules.eu/license-agreement/
16
+ * =============================================================
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Magmodules_Channable>
22
+ <version>1.3.0</version>
23
+ </Magmodules_Channable>
24
+ </modules>
25
+ <global>
26
+ <helpers>
27
+ <channable>
28
+ <class>Magmodules_Channable_Helper</class>
29
+ </channable>
30
+ </helpers>
31
+ <blocks>
32
+ <channable>
33
+ <class>Magmodules_Channable_Block</class>
34
+ </channable>
35
+ </blocks>
36
+ <models>
37
+ <channable>
38
+ <class>Magmodules_Channable_Model</class>
39
+ </channable>
40
+ </models>
41
+ </global>
42
+ <frontend>
43
+ <routers>
44
+ <channable>
45
+ <use>standard</use>
46
+ <args>
47
+ <module>Magmodules_Channable</module>
48
+ <frontName>channable</frontName>
49
+ </args>
50
+ </channable>
51
+ </routers>
52
+ </frontend>
53
+ <admin>
54
+ <routers>
55
+ <adminhtml>
56
+ <args>
57
+ <modules>
58
+ <magmodules_channable after="Mage_Adminhtml">Magmodules_Channable_Adminhtml</magmodules_channable>
59
+ </modules>
60
+ </args>
61
+ </adminhtml>
62
+ </routers>
63
+ </admin>
64
+ <adminhtml>
65
+ <translate>
66
+ <modules>
67
+ <magmodules_channable>
68
+ <files>
69
+ <default>Magmodules_Channable.csv</default>
70
+ </files>
71
+ </magmodules_channable>
72
+ </modules>
73
+ </translate>
74
+ </adminhtml>
75
+ <default>
76
+ <channable>
77
+ <connect>
78
+ <token></token>
79
+ <enabled>1</enabled>
80
+ <max_products>50</max_products>
81
+ </connect>
82
+ <data>
83
+ <description>description</description>
84
+ <brand>manufacturer</brand>
85
+ <ean>sku</ean>
86
+ <sku>sku</sku>
87
+ <color>color</color>
88
+ <size></size>
89
+ <material></material>
90
+ <gender></gender>
91
+ <delivery_in>24 Hours</delivery_in>
92
+ <delivery_out>1-7 Days</delivery_out>
93
+ <stock_status>1</stock_status>
94
+ <stock>1</stock>
95
+ </data>
96
+ <filter>
97
+ <visibility_inc>4</visibility_inc>
98
+ </filter>
99
+ </channable>
100
+ </default>
101
+ </config>
app/code/community/Magmodules/Channable/etc/system.xml ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
5
+ * =============================================================
6
+ * NOTICE OF LICENSE [Single domain license]
7
+ * This source file is subject to the EULA that is
8
+ * available through the world-wide-web at:
9
+ * http://www.magmodules.eu/license-agreement/
10
+ * =============================================================
11
+ * @category Magmodules
12
+ * @package Magmodules_Channable
13
+ * @author Magmodules <info@magmodules.eu>
14
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
15
+ * @license http://www.magmodules.eu/license-agreement/
16
+ * =============================================================
17
+ */
18
+ -->
19
+ <config>
20
+ <tabs>
21
+ <magmodules translate="label" module="channable">
22
+ <label>Magmodules</label>
23
+ <sort_order>200</sort_order>
24
+ </magmodules>
25
+ </tabs>
26
+ <sections>
27
+ <channable translate="label" module="channable">
28
+ <label>Channable Connect</label>
29
+ <tab>magmodules</tab>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>103</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <groups>
36
+ <info>
37
+ <frontend_model>channable/adminhtml_widget_info_info</frontend_model>
38
+ <sort_order>1</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ </info>
43
+ <connect translate="label" module="channable">
44
+ <label>General - Settings</label>
45
+ <frontend_type>text</frontend_type>
46
+ <sort_order>3</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ <expanded>1</expanded>
51
+ <fields>
52
+ <version translate="label">
53
+ <label>Extension Version</label>
54
+ <frontend_type>text</frontend_type>
55
+ <frontend_model>channable/adminhtml_system_config_form_field_version</frontend_model>
56
+ <sort_order>1</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>0</show_in_website>
59
+ <show_in_store>0</show_in_store>
60
+ </version>
61
+ <token translate="label">
62
+ <label>Connect Token</label>
63
+ <frontend_type>text</frontend_type>
64
+ <frontend_model>channable/adminhtml_system_config_form_field_token</frontend_model>
65
+ <sort_order>2</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>0</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </token>
70
+ <connect_heading translate="label">
71
+ <label>Feed settings</label>
72
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
73
+ <sort_order>10</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </connect_heading>
78
+ <enabled translate="label">
79
+ <label>Enabled Feed</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>adminhtml/system_config_source_yesno</source_model>
82
+ <sort_order>11</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </enabled>
87
+ <max_products translate="label">
88
+ <label>Products per feed</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>13</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ <comment>Limit products per feed</comment>
95
+ </max_products>
96
+ </fields>
97
+ </connect>
98
+ <data translate="label" module="channable">
99
+ <label>Products - Data</label>
100
+ <frontend_type>text</frontend_type>
101
+ <sort_order>4</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ <expanded>1</expanded>
106
+ <fields>
107
+ <note translate="label">
108
+ <label><![CDATA[In this section you will see listed all of the standard attributes needed for the Channable Connect. In order to prevent some errors please fill in as many attributes as you can, this will also improve the usability of your data on the Channable platform.]]></label>
109
+ <frontend_model>channable/adminhtml_system_config_form_field_note</frontend_model>
110
+ <sort_order>1</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>1</show_in_store>
114
+ </note>
115
+ <heading_map translate="label">
116
+ <label>General Fields</label>
117
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
118
+ <sort_order>10</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
+ </heading_map>
123
+ <description translate="label">
124
+ <label>Description</label>
125
+ <frontend_type>select</frontend_type>
126
+ <source_model>channable/adminhtml_system_config_source_textattribute</source_model>
127
+ <sort_order>11</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
+ </description>
132
+ <brand translate="label">
133
+ <label>Brand</label>
134
+ <frontend_type>select</frontend_type>
135
+ <source_model>channable/adminhtml_system_config_source_selectattribute</source_model>
136
+ <sort_order>12</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
+ </brand>
141
+ <ean translate="label">
142
+ <label>EAN-code</label>
143
+ <frontend_type>select</frontend_type>
144
+ <source_model>channable/adminhtml_system_config_source_textattribute</source_model>
145
+ <sort_order>14</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
+ </ean>
150
+ <images translate="label">
151
+ <label>Images</label>
152
+ <frontend_type>select</frontend_type>
153
+ <source_model>channable/adminhtml_system_config_source_images</source_model>
154
+ <sort_order>15</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ </images>
159
+ <heading_map2 translate="label">
160
+ <label>Additional Fields</label>
161
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
162
+ <sort_order>20</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>1</show_in_website>
165
+ <show_in_store>1</show_in_store>
166
+ </heading_map2>
167
+ <sku translate="label">
168
+ <label>SKU</label>
169
+ <frontend_type>select</frontend_type>
170
+ <source_model>channable/adminhtml_system_config_source_textattribute</source_model>
171
+ <sort_order>21</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>1</show_in_store>
175
+ </sku>
176
+ <size translate="label">
177
+ <label>Size</label>
178
+ <frontend_type>select</frontend_type>
179
+ <source_model>channable/adminhtml_system_config_source_selectattribute</source_model>
180
+ <sort_order>22</sort_order>
181
+ <show_in_default>1</show_in_default>
182
+ <show_in_website>1</show_in_website>
183
+ <show_in_store>1</show_in_store>
184
+ </size>
185
+ <color translate="label">
186
+ <label>Color</label>
187
+ <frontend_type>select</frontend_type>
188
+ <source_model>channable/adminhtml_system_config_source_selectattribute</source_model>
189
+ <sort_order>23</sort_order>
190
+ <show_in_default>1</show_in_default>
191
+ <show_in_website>1</show_in_website>
192
+ <show_in_store>1</show_in_store>
193
+ </color>
194
+ <material translate="label">
195
+ <label>Material</label>
196
+ <frontend_type>select</frontend_type>
197
+ <source_model>channable/adminhtml_system_config_source_selectattribute</source_model>
198
+ <sort_order>24</sort_order>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>1</show_in_website>
201
+ <show_in_store>1</show_in_store>
202
+ </material>
203
+ <gender translate="label">
204
+ <label>Gender</label>
205
+ <frontend_type>select</frontend_type>
206
+ <source_model>channable/adminhtml_system_config_source_selectattribute</source_model>
207
+ <sort_order>25</sort_order>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>1</show_in_store>
211
+ </gender>
212
+ <heading_delivery translate="label">
213
+ <label>Delivery Time</label>
214
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
215
+ <sort_order>40</sort_order>
216
+ <show_in_default>1</show_in_default>
217
+ <show_in_website>1</show_in_website>
218
+ <show_in_store>1</show_in_store>
219
+ </heading_delivery>
220
+ <delivery translate="label">
221
+ <label>Type</label>
222
+ <frontend_type>select</frontend_type>
223
+ <source_model>channable/adminhtml_system_config_source_type</source_model>
224
+ <sort_order>41</sort_order>
225
+ <show_in_default>1</show_in_default>
226
+ <show_in_website>1</show_in_website>
227
+ <show_in_store>1</show_in_store>
228
+ </delivery>
229
+ <delivery_att translate="label">
230
+ <label>Attribute</label>
231
+ <frontend_type>select</frontend_type>
232
+ <source_model>channable/adminhtml_system_config_source_selectattribute</source_model>
233
+ <sort_order>42</sort_order>
234
+ <show_in_default>1</show_in_default>
235
+ <show_in_website>1</show_in_website>
236
+ <show_in_store>1</show_in_store>
237
+ <depends><delivery>attribute</delivery></depends>
238
+ </delivery_att>
239
+ <delivery_in translate="label">
240
+ <label>Delivery Time - In Stock</label>
241
+ <frontend_type>text</frontend_type>
242
+ <sort_order>42</sort_order>
243
+ <show_in_default>1</show_in_default>
244
+ <show_in_website>1</show_in_website>
245
+ <show_in_store>1</show_in_store>
246
+ <depends><delivery>fixed</delivery></depends>
247
+ </delivery_in>
248
+ <delivery_out translate="label">
249
+ <label>Delivery Time - Out of Stock</label>
250
+ <frontend_type>text</frontend_type>
251
+ <sort_order>43</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ <depends><delivery>fixed</delivery></depends>
256
+ </delivery_out>
257
+ <heading_stock translate="label">
258
+ <label>Stock</label>
259
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
260
+ <sort_order>60</sort_order>
261
+ <show_in_default>1</show_in_default>
262
+ <show_in_website>1</show_in_website>
263
+ <show_in_store>1</show_in_store>
264
+ </heading_stock>
265
+ <stock_status translate="label">
266
+ <label>Send Status</label>
267
+ <frontend_type>select</frontend_type>
268
+ <source_model>adminhtml/system_config_source_yesno</source_model>
269
+ <sort_order>61</sort_order>
270
+ <show_in_default>1</show_in_default>
271
+ <show_in_website>1</show_in_website>
272
+ <show_in_store>1</show_in_store>
273
+ </stock_status>
274
+ <stock translate="label">
275
+ <label>Send Stock Level</label>
276
+ <frontend_type>select</frontend_type>
277
+ <source_model>adminhtml/system_config_source_yesno</source_model>
278
+ <sort_order>62</sort_order>
279
+ <show_in_default>1</show_in_default>
280
+ <show_in_website>1</show_in_website>
281
+ <show_in_store>1</show_in_store>
282
+ </stock>
283
+ <weight_heading translate="label">
284
+ <label>Weight</label>
285
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
286
+ <sort_order>70</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ </weight_heading>
291
+ <weight translate="label">
292
+ <label>Include Weight Field</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>adminhtml/system_config_source_yesno</source_model>
295
+ <sort_order>71</sort_order>
296
+ <show_in_default>1</show_in_default>
297
+ <show_in_website>1</show_in_website>
298
+ <show_in_store>1</show_in_store>
299
+ </weight>
300
+ <weight_units translate="label">
301
+ <label>Weight Units</label>
302
+ <frontend_type>select</frontend_type>
303
+ <source_model>channable/adminhtml_system_config_source_weight</source_model>
304
+ <sort_order>72</sort_order>
305
+ <show_in_default>1</show_in_default>
306
+ <show_in_website>1</show_in_website>
307
+ <show_in_store>1</show_in_store>
308
+ <depends><weight>1</weight></depends>
309
+ </weight_units>
310
+ <price_heading translate="label">
311
+ <label>Price Customization</label>
312
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
313
+ <sort_order>80</sort_order>
314
+ <show_in_default>1</show_in_default>
315
+ <show_in_website>1</show_in_website>
316
+ <show_in_store>1</show_in_store>
317
+ </price_heading>
318
+ <force_tax translate="label">
319
+ <label>Force Tax Usage</label>
320
+ <frontend_type>select</frontend_type>
321
+ <source_model>channable/adminhtml_system_config_source_tax</source_model>
322
+ <sort_order>82</sort_order>
323
+ <show_in_default>1</show_in_default>
324
+ <show_in_website>1</show_in_website>
325
+ <show_in_store>1</show_in_store>
326
+ </force_tax>
327
+ <add_tax translate="label">
328
+ <label>Manually Add Tax</label>
329
+ <frontend_type>select</frontend_type>
330
+ <source_model>adminhtml/system_config_source_yesno</source_model>
331
+ <sort_order>83</sort_order>
332
+ <show_in_default>1</show_in_default>
333
+ <show_in_website>1</show_in_website>
334
+ <show_in_store>1</show_in_store>
335
+ </add_tax>
336
+ <tax_percentage translate="label">
337
+ <label>Percentage</label>
338
+ <frontend_type>text</frontend_type>
339
+ <sort_order>84</sort_order>
340
+ <show_in_default>1</show_in_default>
341
+ <show_in_website>1</show_in_website>
342
+ <show_in_store>1</show_in_store>
343
+ <comment><![CDATA[When the tax percentage is 21% use 21.]]></comment>
344
+ <depends><add_tax>1</add_tax></depends>
345
+ </tax_percentage>
346
+ <configurable_heading translate="label">
347
+ <label>Configurable &amp; Grouped data linkage</label>
348
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
349
+ <sort_order>90</sort_order>
350
+ <show_in_default>1</show_in_default>
351
+ <show_in_website>1</show_in_website>
352
+ <show_in_store>1</show_in_store>
353
+ </configurable_heading>
354
+ <conf_enabled translate="label">
355
+ <label>Enable</label>
356
+ <frontend_type>select</frontend_type>
357
+ <source_model>adminhtml/system_config_source_yesno</source_model>
358
+ <sort_order>91</sort_order>
359
+ <show_in_default>1</show_in_default>
360
+ <show_in_website>1</show_in_website>
361
+ <show_in_store>1</show_in_store>
362
+ </conf_enabled>
363
+ <conf_fields translate="label">
364
+ <label>Use Parent Data for Simple</label>
365
+ <frontend_type>multiselect</frontend_type>
366
+ <source_model>channable/adminhtml_system_config_source_configurable</source_model>
367
+ <sort_order>92</sort_order>
368
+ <show_in_default>1</show_in_default>
369
+ <show_in_website>0</show_in_website>
370
+ <show_in_store>0</show_in_store>
371
+ <depends><conf_enabled>1</conf_enabled></depends>
372
+ <comment>Use parent data</comment>
373
+ </conf_fields>
374
+ <grouped_price translate="label">
375
+ <label>Grouped Price</label>
376
+ <frontend_type>select</frontend_type>
377
+ <source_model>channable/adminhtml_system_config_source_pricemodel</source_model>
378
+ <sort_order>93</sort_order>
379
+ <show_in_default>1</show_in_default>
380
+ <show_in_website>1</show_in_website>
381
+ <show_in_store>1</show_in_store>
382
+ </grouped_price>
383
+ </fields>
384
+ </data>
385
+ <advanced translate="label" module="channable">
386
+ <label>Products - Extra data fields &amp; Shipping</label>
387
+ <frontend_type>text</frontend_type>
388
+ <sort_order>5</sort_order>
389
+ <show_in_default>1</show_in_default>
390
+ <show_in_website>1</show_in_website>
391
+ <show_in_store>1</show_in_store>
392
+ <expanded>1</expanded>
393
+ <fields>
394
+ <note translate="label">
395
+ <label><![CDATA[We recommend adding as many attributes as possible to the Channable feed as this will greatly improve the quality of your data. Enter the Shipping Price by using the designated extra field.]]></label>
396
+ <frontend_model>channable/adminhtml_system_config_form_field_note</frontend_model>
397
+ <sort_order>1</sort_order>
398
+ <show_in_default>1</show_in_default>
399
+ <show_in_website>1</show_in_website>
400
+ <show_in_store>1</show_in_store>
401
+ </note>
402
+ <extra_heading translate="label">
403
+ <label>Extra Fields</label>
404
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
405
+ <sort_order>30</sort_order>
406
+ <show_in_default>1</show_in_default>
407
+ <show_in_website>1</show_in_website>
408
+ <show_in_store>1</show_in_store>
409
+ </extra_heading>
410
+ <extra>
411
+ <label>Extra Fields</label>
412
+ <frontend_model>channable/adminhtml_config_form_field_extra</frontend_model>
413
+ <backend_model>channable/adminhtml_system_config_backend_design_extra</backend_model>
414
+ <sort_order>32</sort_order>
415
+ <show_in_default>1</show_in_default>
416
+ <show_in_website>1</show_in_website>
417
+ <show_in_store>1</show_in_store>
418
+ </extra>
419
+ <heading_shipping translate="label">
420
+ <label>Shipping Price</label>
421
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
422
+ <sort_order>50</sort_order>
423
+ <show_in_default>1</show_in_default>
424
+ <show_in_website>1</show_in_website>
425
+ <show_in_store>1</show_in_store>
426
+ </heading_shipping>
427
+ <shipping_price>
428
+ <label>Shipping Price</label>
429
+ <frontend_model>channable/adminhtml_config_form_field_shipping</frontend_model>
430
+ <backend_model>channable/adminhtml_system_config_backend_design_shipping</backend_model>
431
+ <sort_order>51</sort_order>
432
+ <show_in_default>1</show_in_default>
433
+ <show_in_website>1</show_in_website>
434
+ <show_in_store>1</show_in_store>
435
+ </shipping_price>
436
+ </fields>
437
+ </advanced>
438
+ <filter translate="label" module="channable">
439
+ <label>Channable - Filter Conditions</label>
440
+ <frontend_type>text</frontend_type>
441
+ <sort_order>6</sort_order>
442
+ <show_in_default>1</show_in_default>
443
+ <show_in_website>1</show_in_website>
444
+ <show_in_store>1</show_in_store>
445
+ <expanded>1</expanded>
446
+ <fields>
447
+ <note translate="label">
448
+ <label><![CDATA[This option allows you to include/exclude product from the Google Shopping Feed. To exclude certain products from the Google Shopping feed you easily select yes in the Google Shopping tab on your product configuration page.<br>]]></label>
449
+ <frontend_model>channable/adminhtml_system_config_form_field_note</frontend_model>
450
+ <sort_order>1</sort_order>
451
+ <show_in_default>1</show_in_default>
452
+ <show_in_website>1</show_in_website>
453
+ <show_in_store>1</show_in_store>
454
+ </note>
455
+ <visibility_heading translate="label">
456
+ <label>Only add products with the following visibility</label>
457
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
458
+ <sort_order>10</sort_order>
459
+ <show_in_default>1</show_in_default>
460
+ <show_in_website>1</show_in_website>
461
+ <show_in_store>1</show_in_store>
462
+ </visibility_heading>
463
+ <visibility_inc translate="label">
464
+ <label>Visibility</label>
465
+ <frontend_type>multiselect</frontend_type>
466
+ <source_model>channable/adminhtml_system_config_source_visibility</source_model>
467
+ <sort_order>11</sort_order>
468
+ <show_in_default>1</show_in_default>
469
+ <show_in_website>1</show_in_website>
470
+ <show_in_store>1</show_in_store>
471
+ <comment>Include products with this visibility</comment>
472
+ </visibility_inc>
473
+ <category_heading translate="label">
474
+ <label>Filter by Category</label>
475
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
476
+ <sort_order>20</sort_order>
477
+ <show_in_default>1</show_in_default>
478
+ <show_in_website>1</show_in_website>
479
+ <show_in_store>1</show_in_store>
480
+ </category_heading>
481
+ <category_enabled translate="label">
482
+ <label>Enabled</label>
483
+ <frontend_type>select</frontend_type>
484
+ <source_model>adminhtml/system_config_source_yesno</source_model>
485
+ <sort_order>21</sort_order>
486
+ <show_in_default>1</show_in_default>
487
+ <show_in_website>1</show_in_website>
488
+ <show_in_store>1</show_in_store>
489
+ </category_enabled>
490
+ <category_type translate="label">
491
+ <label>Type of filter</label>
492
+ <frontend_type>select</frontend_type>
493
+ <source_model>channable/adminhtml_system_config_source_categorytype</source_model>
494
+ <sort_order>22</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <show_in_store>1</show_in_store>
498
+ <depends><category_enabled>1</category_enabled></depends>
499
+ </category_type>
500
+ <categories translate="label">
501
+ <label>Category</label>
502
+ <frontend_type>multiselect</frontend_type>
503
+ <source_model>channable/adminhtml_system_config_source_category</source_model>
504
+ <sort_order>23</sort_order>
505
+ <show_in_default>1</show_in_default>
506
+ <show_in_website>1</show_in_website>
507
+ <show_in_store>1</show_in_store>
508
+ <depends><category_enabled>1</category_enabled></depends>
509
+ </categories>
510
+ <stock_heading translate="label">
511
+ <label>Exclude Products on Stock level</label>
512
+ <frontend_model>channable/adminhtml_system_config_form_field_heading</frontend_model>
513
+ <sort_order>30</sort_order>
514
+ <show_in_default>1</show_in_default>
515
+ <show_in_website>1</show_in_website>
516
+ <show_in_store>1</show_in_store>
517
+ </stock_heading>
518
+ <stock translate="label">
519
+ <label>Exclude out of stock products</label>
520
+ <frontend_type>select</frontend_type>
521
+ <source_model>adminhtml/system_config_source_yesno</source_model>
522
+ <sort_order>31</sort_order>
523
+ <show_in_default>1</show_in_default>
524
+ <show_in_website>1</show_in_website>
525
+ <show_in_store>1</show_in_store>
526
+ </stock>
527
+ </fields>
528
+ </filter>
529
+ <settings translate="label" module="channable">
530
+ <label>Feeds - Available</label>
531
+ <frontend_type>text</frontend_type>
532
+ <sort_order>7</sort_order>
533
+ <show_in_default>1</show_in_default>
534
+ <show_in_website>1</show_in_website>
535
+ <show_in_store>1</show_in_store>
536
+ <expanded>1</expanded>
537
+ <fields>
538
+ <note translate="label">
539
+ <label><![CDATA[Each store view will have their own Channable feed, you can easily activate or de-activate the Channable feed generation on store level by using the general settings. Use the auto connect button to connect the Feed with your Channable account.]]></label>
540
+ <frontend_model>channable/adminhtml_system_config_form_field_note</frontend_model>
541
+ <sort_order>1</sort_order>
542
+ <show_in_default>1</show_in_default>
543
+ <show_in_website>1</show_in_website>
544
+ <show_in_store>1</show_in_store>
545
+ </note>
546
+ <feeds_text translate="label">
547
+ <label>Text</label>
548
+ <frontend_model>channable/adminhtml_system_config_form_field_feeds</frontend_model>
549
+ <sort_order>11</sort_order>
550
+ <show_in_default>1</show_in_default>
551
+ <show_in_website>1</show_in_website>
552
+ <show_in_store>1</show_in_store>
553
+ </feeds_text>
554
+ </fields>
555
+ </settings>
556
+ </groups>
557
+ </channable>
558
+ </sections>
559
+ </config>
app/etc/modules/Magmodules_Channable.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magmodules_Channable>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Magmodules_Channable>
8
+ </modules>
9
+ </config>
app/locale/en_US/Magmodules_Channable.csv ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "-- None","-- None"
2
+ "-- none","-- none"
3
+ "Each store view will have their own Channable feed, you can easily activate or de-activate the Channable feed generation on store level by using the general settings. You can easily copy the url to your Channable account.","Each store view will have their own Channable feed, you can easily activate or de-activate the Channable feed generation on store level by using the general settings. You can easily copy the url to your Channable account."
4
+ "Add Attribute","Add Attribute"
5
+ "Add Option","Add Option"
6
+ "Always Use Parent Data","Always Use Parent Data"
7
+ "Additional Fields","Additional Fields"
8
+ "Attribute","Attribute"
9
+ "Brand","Brand"
10
+ "Channable Connect","Channable Connect"
11
+ "Color","Color"
12
+ "Connector Code","Connector Code"
13
+ "Cost","Cost"
14
+ "Data Selection","Data Selection"
15
+ "Delivery Time","Delivery Time"
16
+ "Delivery Time - In Stock","Delivery Time - In Stock"
17
+ "Delivery Time - Out of Stock","Delivery Time - Out of Stock"
18
+ "Description","Description"
19
+ "EAN-code","EAN-code"
20
+ "Enabled","Enabled"
21
+ "Enabled Feed","Enabled Feed"
22
+ "Extra Fields","Extra Fields"
23
+ "Feeds - Available","Feeds - Available"
24
+ "Gender","Gender"
25
+ "General - Settings","General - Settings"
26
+ "General Fields","General Fields"
27
+ "Licence","Licence"
28
+ "License Key","License Key"
29
+ "Magento Attribute","Magento Attribute"
30
+ "Magmodules","Magmodules"
31
+ "Material","Material"
32
+ "Products - Configurable Products","Products - Configurable Products"
33
+ "Price From","Price From"
34
+ "Price To","Price To"
35
+ "Products - Data","Products - Data"
36
+ "Products - Data Extra fields & Shipping","Products - Data Extra fields & Shipping"
37
+ "Products per feed","Products per feed"
38
+ "SKU","SKU"
39
+ "Set the configurable products to your needs with the option to always use the parent data from the product inside the configurable product, only when the data is not available (as a fallback) or to use the simple product data anytime.","Set the configurable products to your needs with the option to always use the parent data from the product inside the configurable product, only when the data is not available (as a fallback) or to use the simple product data anytime."
40
+ "Send Status","Send Status"
41
+ "Send Stock Level","Send Stock Level"
42
+ "Server Name","Server Name"
43
+ "Settings","Settings"
44
+ "Shipping Price","Shipping Price"
45
+ "Size","Size"
46
+ "Static","Static"
47
+ "Stock","Stock"
48
+ "Strip Tags","Strip Tags"
49
+ "Fill in a valid Channable Connector code and set a product limit to your Feed whenever you want this, use 0 to export all your products into the Channable Feed. You can also enable or disable the Feed generation on certain Store Views.","Fill in a valid Channable Connector code and set a product limit to your Feed whenever you want this, use 0 to export all your products into the Channable Feed. You can also enable or disable the Feed generation on certain Store Views."
50
+ "Text","Text"
51
+ "Add all your attributes into the Channable Feed to create a high quality data feed. We recommend that you use as many attributes to make your feed even more valuable. Enter the shipping price in the fields below the extra fields.","Add all your attributes into the Channable Feed to create a high quality data feed. We recommend that you use as many attributes to make your feed even more valuable. Enter the shipping price in the fields below the extra fields."
52
+ "This section lists all the standard attributes for the Channable Feed. The more attributes you use the better you can use the data in Channable. To avoid errors in Channable feed please make sure that you provide most available attributes.","This section lists all the standard attributes for the Channable Feed. The more attributes you use the better you can use the data in Channable. To avoid errors in Channable feed please make sure that you provide most available attributes."
53
+ "Title","Title"
54
+ "Type","Type"
55
+ "Use Attribute","Use Attribute"
56
+ "Use Simple Product Data","Use Simple Product Data"
57
+ "Use Parent Data as fallback","Use Parent Data as fallback"
app/locale/nl_NL/Magmodules_Channable.csv ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "-- None","-- Geen"
2
+ "-- none","-- geen"
3
+ "Each store view will have their own Channable feed, you can easily activate or de-activate the Channable feed generation on store level by using the general settings. You can easily copy the url to your Channable account.","Er wordt voor elk winkelzicht een eigen Channable-feed gegenereerd, dit is eenvoudig te activeren of deactiveren in de algemene instellingen tab van deze extensie. U kunt de URL van de Feed vervolgens eenvoudig kopiëren naar uw Channable account."
4
+ "Add Attribute","Attribuut toevoegen"
5
+ "Always Use Parent Data","Altijd data gebruiken bovenliggende product"
6
+ "Add Option","Optie toevoegen"
7
+ "Additional Fields","Extra velden"
8
+ "Attribute","Attribuut"
9
+ "Brand","Merk"
10
+ "Channable Connect","Channable Connect"
11
+ "Color","Kleur"
12
+ "Connector Code","Connector Code"
13
+ "Cost","Kosten"
14
+ "Data Selection","Data selectie"
15
+ "Delivery Time","Levertijd"
16
+ "Delivery Time - In Stock","Levertijd - op voorraad"
17
+ "Delivery Time - Out of Stock","Levertijd - uit voorraad"
18
+ "Description","Omschrijving"
19
+ "EAN-code","EAN-code"
20
+ "Enabled","Geactiveerd"
21
+ "Enabled Feed","Geactiveerde Feed"
22
+ "Extra Fields","Extra velden"
23
+ "Feeds - Available","Feeds - Beschikbaar"
24
+ "Gender","Geslacht"
25
+ "General - Settings","Algemeen - Instellingen"
26
+ "General Fields","Algemene velden"
27
+ "Licence","Licentie"
28
+ "License Key","Licentie code"
29
+ "Magento Attribute","Magento attribuut"
30
+ "Magmodules","Magmodules"
31
+ "Material","materiaal"
32
+ "Products - Configurable Products","Product - Configureerbaar product"
33
+ "Price From","Prijs vanaf"
34
+ "Price To","Prijs tot"
35
+ "Products - Data","Product - Data"
36
+ "Products - Data Extra fields & Shipping","Product - Data extra velden & verzending"
37
+ "Products per feed","Producten per feed"
38
+ "SKU","SKU"
39
+ "Set the configurable products to your needs with the option to always use the parent data from the product inside the configurable product, only when the data is not available (as a fallback) or to use the simple product data anytime.","Stel de configureerbare producten in naar wens. Dit is mogelijk door de optie te gebruiken welke altijd de bovenliggende productinformatie pakt, de optie met de fallback welke enkel de bovenliggende productinformatie pakt indien er geen informatie beschikbaar is of de optie om altijd de simpel product informatie te pakken."
40
+ "Send Status","Stuur status"
41
+ "Send Stock Level","Stuur voorraadniveau"
42
+ "Server Name","Servernaam"
43
+ "Settings","Instellingen"
44
+ "Shipping Price","Verzendkosten"
45
+ "Size","Maat"
46
+ "Static","Static"
47
+ "Stock","Voorraad"
48
+ "Strip Tags","Strip Tags"
49
+ "Fill in a valid Channable Connector code and set a product limit to your Feed whenever you want this, use 0 to export all your products into the Channable Feed. You can also enable or disable the Feed generation on certain Store Views.","Vul een geldige Channable Connector code en stel een product limiet in per Feed. Indien u alle producten wenst te exporteren naar de Channable Feed kunt u 0 gebruiken. Het is mogelijk om de feed generatie in of uit te schakelen op winkelniveau."
50
+ "Text","Tekst"
51
+ "We recommend adding as many attributes as possible to the Channable feed as this will greatly improve the quality of your data. Enter the Shipping Price by using the designated extra field.","Voeg alle attributen in de Channable Feed om een hoge kwaliteit data feed te maken. Wij raden u aan zo veel mogelijk attributen gebruiken om de feed nog waardevoller te maken. Voer eventuele verzendkosten in om deze mee te nemen in de Feed."
52
+ "In this section you will see listed all of the standard attributes needed for the Channable Connect. In order to prevent some errors please fill in as many attributes as you can, this will also improve the usability of your data on the Channable platform.","Dit gedeelte bevat alle standaard attributen voor de Channable Feed. Hoe meer data in de feed hoe beter u de gegevens kunt gebruiken in Channable. Om het optimale uit Channable te halen moet u ervoor zorgen dat u de meeste beschikbare attributen mee neemt in de Feed."
53
+ "Title","Titel"
54
+ "Type","Type"
55
+ "Use Attribute","Gebruik attribuut"
56
+ "Use Simple Product Data","Gebruik data van simpel product"
57
+ "Use Parent Data as fallback","Gebruik data bovenliggend product als fallback"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Magmodules_Channable</name>
4
+ <version>1.3.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.magmodules.eu/license-agreement/">Single Server License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Magmodules_Channable</summary>
10
+ <description>Magmodules_Channable</description>
11
+ <notes>Channable Connect</notes>
12
+ <authors><author><name>Magmodules</name><user>auto-converted</user><email>info@magmodules.nl</email></author></authors>
13
+ <date>2015-11-18</date>
14
+ <time>20:22:22</time>
15
+ <contents><target name="magecommunity"><dir name="Magmodules"><dir name="Channable"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Extra.php" hash="9288e8a22a0134475bc44fd5c1240849"/><file name="Shipping.php" hash="0fa8d17c32c828a0d4f68d897c455f3b"/></dir><dir name="Renderer"><file name="Select.php" hash="2657667fe85d29ddf2a5080ff2ec5a50"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Feeds.php" hash="a52355d4909a425a0f4cbbfb137f6d04"/><file name="Heading.php" hash="633b7c330bcb5900c7feae34e95d9fda"/><file name="Note.php" hash="ad97b87c2e8a0692098fb667dde75331"/><file name="Token.php" hash="2776dfd599605df190c4cf21833751c1"/><file name="Version.php" hash="31ab0c3609ee145b551f0158268bc212"/></dir></dir></dir></dir><dir name="Widget"><dir name="Info"><file name="Info.php" hash="7ac9087428330d5fb6c46be612dda16d"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="6d4b47c5e56c7c8e74606bb8679c5596"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Design"><file name="Extra.php" hash="eb3f7a890881c91e81cb77689f96d788"/><file name="Shipping.php" hash="adc990676f255344e267b91e194ec093"/></dir></dir><dir name="Source"><file name="Action.php" hash="51da5aa9c1bcfd691d4ed32e82f89541"/><file name="Attribute.php" hash="cd7715df0bda2432e304f7383349cefa"/><file name="Category.php" hash="9f4b9c7b0430bb9a454afec43d5a446b"/><file name="Categorytype.php" hash="e0438b44f2b29674456728145d1f4f9c"/><file name="Configurable.php" hash="225cbd8f3b9f1381136a3ef79be5dc9f"/><file name="Images.php" hash="7f0fc55582c25580fc230fb247a7fd86"/><file name="Pricemodel.php" hash="265f426b67355ed02fd4aad9179a8bf7"/><file name="Selectattribute.php" hash="c0fe15d0206bc7fd6ec2a39cd97f349d"/><file name="Tax.php" hash="534795c315765bc4ec23fdef8184ba31"/><file name="Textattribute.php" hash="8093b591bba8554936f5c84d9bfb11a6"/><file name="Type.php" hash="083a651459b0c0ca5fa939d2528fad87"/><file name="Visibility.php" hash="c2e80831d9d8b5fc6cd642a590812a56"/><file name="Weight.php" hash="ba1e3c862ea2779c275d3d267b819435"/></dir></dir></dir></dir><file name="Channable.php" hash="fafcaadbe2dc3466ce2ffeeefc766577"/><file name="Common.php" hash="1f3e47fa8822f7b387bba64d753e4886"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChannableController.php" hash="48df5bf9be057470fba5fe211989717e"/></dir><file name="FeedController.php" hash="473afd692bfff811fbe199ce39899e79"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dd413d854f9353da0aa8005fb2969f63"/><file name="config.xml" hash="f431225e4307567c0d7264c886700eb1"/><file name="system.xml" hash="3bb7f27720258b187be0fe217dafc51b"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Magmodules_Channable.csv" hash="342ab8e5f81e36067a6129189ca72b6e"/></dir><dir name="nl_NL"><file name="Magmodules_Channable.csv" hash="462df316feb223708a2a104cd11d556c"/></dir></target><target name="mageetc"><dir name="modules"><file name="Magmodules_Channable.xml" hash="061032d718f1ddd64de211fc7133685c"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>