Channelpilotsolutions_Channelpilot - Version 2.1.0

Version Notes

- some bug fixes
- optimize price control
- new design

Download this release

Release Info

Developer Magento Core Team
Extension Channelpilotsolutions_Channelpilot
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.0.2 to 2.1.0

Files changed (33) hide show
  1. app/{design/adminhtml/default/default/layout/Channelpilotsolutions/channelpilot.xml → code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Grossnet/Values.php} +16 -13
  2. app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Imagenumber/Values.php +53 -0
  3. app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Truefalse/Values.php +10 -8
  4. app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Truefalsesecurity/Values.php +10 -8
  5. app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Exportfields.php +38 -40
  6. app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Replacefields.php +37 -39
  7. app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Specialfields.php +32 -32
  8. app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Trackingkeys.php +35 -36
  9. app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Hintlogo.php +11 -0
  10. app/code/community/Channelpilotsolutions/Channelpilot/Helper/Data.php +2 -2
  11. app/code/community/Channelpilotsolutions/Channelpilot/Helper/ExportData.php +30 -4
  12. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPAbstractHandler.php +1 -0
  13. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPDeliveryHandler.php +6 -5
  14. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPNewPriceHandler.php +43 -24
  15. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPOrderHandler.php +75 -21
  16. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPStatusHandler.php +30 -14
  17. app/code/community/Channelpilotsolutions/Channelpilot/Helper/special/CustomerFunctions.php +16 -11
  18. app/code/community/Channelpilotsolutions/Channelpilot/Model/Abstract.php +201 -0
  19. app/code/community/Channelpilotsolutions/Channelpilot/Model/Payment.php +112 -0
  20. app/code/community/Channelpilotsolutions/Channelpilot/Model/PaymentTypes.php +24 -0
  21. app/code/community/Channelpilotsolutions/Channelpilot/Model/Paymenttypes.php +18 -0
  22. app/code/community/Channelpilotsolutions/Channelpilot/etc/config.xml +17 -11
  23. app/code/community/Channelpilotsolutions/Channelpilot/etc/system.xml +235 -128
  24. app/code/community/Channelpilotsolutions/Channelpilot/sql/channelpilot_setup/mysql4-install-2.0.0.php +127 -126
  25. app/design/adminhtml/base/default/template/Channelpilotsolutions/array_dropdown.phtml +0 -174
  26. app/design/frontend/base/default/template/Channelpilotsolutions/channelpilot.phtml +1 -1
  27. app/etc/modules/Channelpilotsolutions_Channelpilot.xml +3 -0
  28. app/locale/de_AT/Channelpilotsolutions_Channelpilot.csv +0 -37
  29. app/locale/de_CH/Channelpilotsolutions_Channelpilot.csv +40 -31
  30. app/locale/de_DE/Channelpilotsolutions_Channelpilot.csv +42 -31
  31. app/locale/fr_FR/Channelpilotsolutions_Channelpilot.csv +46 -0
  32. package.xml +7 -6
  33. skin/adminhtml/default/default/Channelpilotsolutions/Channelpilot/icon.css +0 -4
app/{design/adminhtml/default/default/layout/Channelpilotsolutions/channelpilot.xml → code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Grossnet/Values.php} RENAMED
@@ -1,4 +1,5 @@
1
- <?xml version="1.0"?><!--
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -13,20 +14,22 @@
13
  * needs please refer to http://www.channelpilot.com for more information.
14
  *
15
  * @category Channelpilotsolutions
16
- * @package design_adminhtml_default_default
17
- * @subpackage layout
18
  * @copyright Copyright (c) 2012 <info@channelpilot.com> - www.channelpilot.com
19
  * @author Peter Hoffmann <info@channelpilot.com>
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- -->
24
- <layout>
25
- <default>
26
- <reference name="head">
27
- <action method="addCss">
28
- <name>Channelpilotsolutions/channelpilot/icon.css</name>
29
- </action>
30
- </reference>
31
- </default>
32
- </layout>
 
 
1
+ <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
14
  * needs please refer to http://www.channelpilot.com for more information.
15
  *
16
  * @category Channelpilotsolutions
17
+ * @package Channelpilotsolutions_Channelpilot
18
+ * @subpackage adminhtml_model_cookiemode
19
  * @copyright Copyright (c) 2012 <info@channelpilot.com> - www.channelpilot.com
20
  * @author Peter Hoffmann <info@channelpilot.com>
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Grossnet_Values {
25
+
26
+ public function toOptionArray() {
27
+ return array(
28
+ array('value' => 'gross', 'label' => 'gross'),
29
+ array('value' => 'net', 'label' => 'net')
30
+ );
31
+ }
32
+
33
+ }
34
+
35
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Imagenumber/Values.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Channelpilotsolutions_Channelpilot to newer
13
+ * versions in the future. If you wish to customize Channelpilotsolutions_Channelpilot for your
14
+ * needs please refer to http://www.channelpilot.com for more information.
15
+ *
16
+ * @category Channelpilotsolutions
17
+ * @package Channelpilotsolutions_Channelpilot
18
+ * @subpackage adminhtml_model_cookiemode
19
+ * @copyright Copyright (c) 2012 <info@channelpilot.com> - www.channelpilot.com
20
+ * @author Peter Hoffmann <info@channelpilot.com>
21
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
+ * @link http://www.channelpilot.com
23
+ */
24
+ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Imagenumber_Values {
25
+
26
+ public function toOptionArray() {
27
+ return array(
28
+ array('value' => '1', 'label' => '1'),
29
+ array('value' => '2', 'label' => '2'),
30
+ array('value' => '3', 'label' => '3'),
31
+ array('value' => '4', 'label' => '4'),
32
+ array('value' => '5', 'label' => '5'),
33
+ array('value' => '6', 'label' => '6'),
34
+ array('value' => '7', 'label' => '7'),
35
+ array('value' => '8', 'label' => '8'),
36
+ array('value' => '9', 'label' => '9'),
37
+ array('value' => '10', 'label' => '10'),
38
+ array('value' => '11', 'label' => '11'),
39
+ array('value' => '12', 'label' => '12'),
40
+ array('value' => '13', 'label' => '13'),
41
+ array('value' => '14', 'label' => '14'),
42
+ array('value' => '15', 'label' => '15'),
43
+ array('value' => '16', 'label' => '16'),
44
+ array('value' => '17', 'label' => '17'),
45
+ array('value' => '18', 'label' => '18'),
46
+ array('value' => '19', 'label' => '19'),
47
+ array('value' => '20', 'label' => '20')
48
+ );
49
+ }
50
+
51
+ }
52
+
53
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Truefalse/Values.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -20,14 +21,15 @@
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Truefalse_Values
24
- {
25
- public function toOptionArray()
26
- {
27
  return array(
28
- array('value' => 'false', 'label'=>'No'),
29
- array('value' => 'true', 'label'=>'Yes')
30
- );
31
- }
 
32
  }
 
33
  ?>
1
  <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Truefalse_Values {
25
+
26
+ public function toOptionArray() {
 
27
  return array(
28
+ array('value' => 'false', 'label' => 'CP No'),
29
+ array('value' => 'true', 'label' => 'CP Yes')
30
+ );
31
+ }
32
+
33
  }
34
+
35
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Truefalsesecurity/Values.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -20,14 +21,15 @@
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Truefalsesecurity_Values
24
- {
25
- public function toOptionArray()
26
- {
27
  return array(
28
- array('value' => 'true', 'label'=>'Yes'),
29
- array('value' => 'false', 'label'=>'No')
30
- );
31
- }
 
32
  }
 
33
  ?>
1
  <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Truefalsesecurity_Values {
25
+
26
+ public function toOptionArray() {
 
27
  return array(
28
+ array('value' => 'true', 'label' => 'Yes'),
29
+ array('value' => 'false', 'label' => 'No')
30
+ );
31
+ }
32
+
33
  }
34
+
35
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Exportfields.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -20,64 +21,61 @@
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Exportfields
24
- extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
25
- {
26
-
27
  private $_standardattributes;
28
-
29
- public function __construct()
30
- {
31
- $this->addColumn('productattribute', array(
32
- 'label' => Mage::helper('adminhtml')->__('Data field'),
33
- 'size' => 30
34
- ));
35
- $this->_addAfter = false;
36
-
37
- parent::__construct();
38
- $this->setTemplate('Channelpilotsolutions/array_dropdown.phtml');
39
- }
40
-
41
- protected function _renderCellTemplate($columnName)
42
- {
43
- $this->_standardattributes = "('sku','price','name','description','manufacturer','color','weight')";
44
- if (empty($this->_columns[$columnName])) {
45
- throw new Exception('Wrong column name specified.');
46
- }
47
- $column = $this->_columns[$columnName];
48
- $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
49
-
50
- if($columnName == 'productattribute')
51
- {
52
- $rendered = '<select name="'.$inputName.'">';
53
-
54
  $tableName = Mage::getSingleton('core/resource')->getTableName('core_website');
55
  $tablePrefix = substr($tableName, 0, strpos($tableName, 'core_website'));
56
- $dbConnection = Mage::getSingleton('core/resource') ->getConnection('core_read');
57
-
58
  // Get attribute codes and types
59
  $query = "SELECT attribute_code
60
  FROM ChannelPilotSolutions_ChannelPilot_eav_attribute
61
- WHERE entity_type_id = (SELECT entity_type_id FROM
62
  ChannelPilotSolutions_ChannelPilot_eav_entity_type WHERE entity_type_code = 'catalog_product') AND
63
  attribute_code NOT IN $this->_standardattributes
64
  ";
65
  $query = str_replace('ChannelPilotSolutions_ChannelPilot_', $tablePrefix, $query);
66
  $attributes = $dbConnection->FetchAssoc($query);
67
-
68
  $attributes[]['attribute_code'] = 'qty';
69
  $attributes[]['attribute_code'] = 'stock_status';
70
  $attributes[]['attribute_code'] = 'cp_color_attribute_id';
71
- $attributes[]['attribute_code'] = 'parent_id';
72
  asort($attributes);
73
  foreach ($attributes as $attribute) {
74
- $rendered .= '<option value="'.$attribute['attribute_code'].'">'.$attribute['attribute_code'].'</option>';
75
  }
76
  $rendered .= '</select>';
77
  return $rendered;
78
- }
79
-
80
- return '<input type="text" name="'.$inputName.'" value="#{' . $columnName . '}"/>';
81
- }
 
82
  }
 
83
  ?>
1
  <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Exportfields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
 
 
26
  private $_standardattributes;
27
+
28
+ public function __construct() {
29
+ $this->addColumn('productattribute', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Data field'),
31
+ 'size' => 30
32
+ ));
33
+ $this->_addAfter = false;
34
+
35
+ parent::__construct();
36
+ $this->setTemplate('channelpilotsolutions/array_dropdown.phtml');
37
+ }
38
+
39
+ protected function _renderCellTemplate($columnName) {
40
+ $this->_standardattributes = "('sku','price','name','description','manufacturer','color','weight', 'parent_id')";
41
+ if (empty($this->_columns[$columnName])) {
42
+ throw new Exception('Wrong column name specified.');
43
+ }
44
+ $column = $this->_columns[$columnName];
45
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
46
+
47
+ if ($columnName == 'productattribute') {
48
+ $rendered = '<select name="' . $inputName . '">';
49
+
 
 
 
50
  $tableName = Mage::getSingleton('core/resource')->getTableName('core_website');
51
  $tablePrefix = substr($tableName, 0, strpos($tableName, 'core_website'));
52
+ $dbConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
53
+
54
  // Get attribute codes and types
55
  $query = "SELECT attribute_code
56
  FROM ChannelPilotSolutions_ChannelPilot_eav_attribute
57
+ WHERE entity_type_id = (SELECT entity_type_id FROM
58
  ChannelPilotSolutions_ChannelPilot_eav_entity_type WHERE entity_type_code = 'catalog_product') AND
59
  attribute_code NOT IN $this->_standardattributes
60
  ";
61
  $query = str_replace('ChannelPilotSolutions_ChannelPilot_', $tablePrefix, $query);
62
  $attributes = $dbConnection->FetchAssoc($query);
63
+
64
  $attributes[]['attribute_code'] = 'qty';
65
  $attributes[]['attribute_code'] = 'stock_status';
66
  $attributes[]['attribute_code'] = 'cp_color_attribute_id';
67
+ // $attributes[]['attribute_code'] = 'parent_id';
68
  asort($attributes);
69
  foreach ($attributes as $attribute) {
70
+ $rendered .= '<option value="' . $attribute['attribute_code'] . '">' . $attribute['attribute_code'] . '</option>';
71
  }
72
  $rendered .= '</select>';
73
  return $rendered;
74
+ }
75
+
76
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
77
+ }
78
+
79
  }
80
+
81
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Replacefields.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -20,56 +21,51 @@
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Replacefields
24
- extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
25
- {
26
-
27
  private $_standardattributes;
28
-
29
- public function __construct()
30
- {
31
- $this->addColumn('productattribute', array(
32
- 'label' => Mage::helper('adminhtml')->__('Data field'),
33
- 'size' => 30
34
- ));
35
- $this->_addAfter = false;
36
-
37
- parent::__construct();
38
- $this->setTemplate('Channelpilotsolutions/array_dropdown.phtml');
39
- }
40
-
41
- protected function _renderCellTemplate($columnName)
42
- {
43
  $this->_standardattributes = "('sku','price','name','description','manufacturer','color','weight')";
44
- if (empty($this->_columns[$columnName])) {
45
- throw new Exception('Wrong column name specified.');
46
- }
47
- $column = $this->_columns[$columnName];
48
- $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
49
-
50
- if($columnName == 'productattribute')
51
- {
52
- $rendered = '<select name="'.$inputName.'">';
53
-
54
  $tableName = Mage::getSingleton('core/resource')->getTableName('core_website');
55
  $tablePrefix = substr($tableName, 0, strpos($tableName, 'core_website'));
56
- $dbConnection = Mage::getSingleton('core/resource') ->getConnection('core_read');
57
-
58
  // Get attribute codes and types
59
  $query = "SELECT attribute_code
60
  FROM ChannelPilotSolutions_ChannelPilot_eav_attribute
61
- WHERE entity_type_id = (SELECT entity_type_id FROM
62
  ChannelPilotSolutions_ChannelPilot_eav_entity_type WHERE entity_type_code = 'catalog_product') AND
63
  attribute_code NOT IN $this->_standardattributes
64
  ";
65
  $query = str_replace('ChannelPilotSolutions_ChannelPilot_', $tablePrefix, $query);
66
  $attributes = $dbConnection->FetchAssoc($query);
67
-
68
  $attributes[]['attribute_code'] = 'qty';
69
  $attributes[]['attribute_code'] = 'stock_status';
70
  $attributes[]['attribute_code'] = 'cp_color_attribute_id';
71
  $attributes[]['attribute_code'] = 'parent_id';
72
-
73
  $attributes[]['attribute_code'] = 'categories';
74
  $attributes[]['attribute_code'] = 'cp_image_url';
75
  $attributes[]['attribute_code'] = 'cp_product_url';
@@ -78,13 +74,15 @@ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Replacefields
78
  $attributes[]['attribute_code'] = 'cp_additional_image_3';
79
  asort($attributes);
80
  foreach ($attributes as $attribute) {
81
- $rendered .= '<option value="'.$attribute['attribute_code'].'">'.$attribute['attribute_code'].'</option>';
82
  }
83
  $rendered .= '</select>';
84
  return $rendered;
85
- }
86
-
87
- return '<input type="text" name="'.$inputName.'" value="#{' . $columnName . '}"/>';
88
- }
 
89
  }
 
90
  ?>
1
  <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Replacefields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
 
 
26
  private $_standardattributes;
27
+
28
+ public function __construct() {
29
+ $this->addColumn('productattribute', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Data field'),
31
+ 'size' => 30
32
+ ));
33
+ $this->_addAfter = false;
34
+
35
+ parent::__construct();
36
+ $this->setTemplate('channelpilotsolutions/array_dropdown.phtml');
37
+ }
38
+
39
+ protected function _renderCellTemplate($columnName) {
 
 
40
  $this->_standardattributes = "('sku','price','name','description','manufacturer','color','weight')";
41
+ if (empty($this->_columns[$columnName])) {
42
+ throw new Exception('Wrong column name specified.');
43
+ }
44
+ $column = $this->_columns[$columnName];
45
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
46
+
47
+ if ($columnName == 'productattribute') {
48
+ $rendered = '<select name="' . $inputName . '">';
49
+
 
50
  $tableName = Mage::getSingleton('core/resource')->getTableName('core_website');
51
  $tablePrefix = substr($tableName, 0, strpos($tableName, 'core_website'));
52
+ $dbConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
53
+
54
  // Get attribute codes and types
55
  $query = "SELECT attribute_code
56
  FROM ChannelPilotSolutions_ChannelPilot_eav_attribute
57
+ WHERE entity_type_id = (SELECT entity_type_id FROM
58
  ChannelPilotSolutions_ChannelPilot_eav_entity_type WHERE entity_type_code = 'catalog_product') AND
59
  attribute_code NOT IN $this->_standardattributes
60
  ";
61
  $query = str_replace('ChannelPilotSolutions_ChannelPilot_', $tablePrefix, $query);
62
  $attributes = $dbConnection->FetchAssoc($query);
63
+
64
  $attributes[]['attribute_code'] = 'qty';
65
  $attributes[]['attribute_code'] = 'stock_status';
66
  $attributes[]['attribute_code'] = 'cp_color_attribute_id';
67
  $attributes[]['attribute_code'] = 'parent_id';
68
+
69
  $attributes[]['attribute_code'] = 'categories';
70
  $attributes[]['attribute_code'] = 'cp_image_url';
71
  $attributes[]['attribute_code'] = 'cp_product_url';
74
  $attributes[]['attribute_code'] = 'cp_additional_image_3';
75
  asort($attributes);
76
  foreach ($attributes as $attribute) {
77
+ $rendered .= '<option value="' . $attribute['attribute_code'] . '">' . $attribute['attribute_code'] . '</option>';
78
  }
79
  $rendered .= '</select>';
80
  return $rendered;
81
+ }
82
+
83
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
84
+ }
85
+
86
  }
87
+
88
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Specialfields.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -20,37 +21,36 @@
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Specialfields
24
- extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
25
- {
26
- protected $magentoAttributes;
27
-
28
- public function __construct()
29
- {
30
- $this->addColumn('name', array(
31
- 'label' => Mage::helper('adminhtml')->__('Data field name'),
32
- 'size' => 30
33
- ));
34
- $this->addColumn('value', array(
35
- 'label' => Mage::helper('adminhtml')->__('Data field value'),
36
- 'size' => 30
37
- ));
38
- $this->_addAfter = false;
39
-
40
- parent::__construct();
41
- $this->setTemplate('Channelpilotsolutions/array_dropdown.phtml');
42
- }
43
-
44
- protected function _renderCellTemplate($columnName)
45
- {
46
- if (empty($this->_columns[$columnName])) {
47
- throw new Exception('Wrong column name specified.');
48
- }
49
- $column = $this->_columns[$columnName];
50
- $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
51
-
52
-
53
- return '<input type="text" name="'.$inputName.'" value="#{' . $columnName . '}"/>';
54
- }
55
  }
 
56
  ?>
1
  <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Specialfields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
26
+ protected $magentoAttributes;
27
+
28
+ public function __construct() {
29
+ $this->addColumn('name', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Data field name'),
31
+ 'size' => 30
32
+ ));
33
+ $this->addColumn('value', array(
34
+ 'label' => Mage::helper('adminhtml')->__('Data field value'),
35
+ 'size' => 30
36
+ ));
37
+ $this->_addAfter = false;
38
+
39
+ parent::__construct();
40
+ $this->setTemplate('channelpilotsolutions/array_dropdown.phtml');
41
+ }
42
+
43
+ protected function _renderCellTemplate($columnName) {
44
+ if (empty($this->_columns[$columnName])) {
45
+ throw new Exception('Wrong column name specified.');
46
+ }
47
+ $column = $this->_columns[$columnName];
48
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
49
+
50
+
51
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
52
+ }
53
+
 
 
54
  }
55
+
56
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Field/Trackingkeys.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  *
4
  * NOTICE OF LICENSE
@@ -20,50 +21,48 @@
20
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
  * @link http://www.channelpilot.com
22
  */
23
- class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Trackingkeys
24
- extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
25
- {
26
- protected $magentoAttributes;
27
-
28
- public function __construct()
29
- {
30
- $this->addColumn('shop', array(
31
- 'label' => Mage::helper('adminhtml')->__('Shop'),
32
- 'size' => 15
33
- ));
34
- $this->addColumn('trackingkey', array(
35
- 'label' => Mage::helper('adminhtml')->__('TrackingKey'),
36
- 'size' => 28
37
- ));
38
- $this->_addAfter = false;
39
-
40
- parent::__construct();
41
- $this->setTemplate('Channelpilotsolutions/array_dropdown.phtml');
42
- }
43
-
44
- protected function _renderCellTemplate($columnName)
45
- {
46
- if (empty($this->_columns[$columnName])) {
47
- throw new Exception('Wrong column name specified.');
48
- }
49
- $column = $this->_columns[$columnName];
50
- $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
51
-
52
- if($columnName == 'shop')
53
- {
54
- $rendered = '<select name="'.$inputName.'">';
55
  foreach (Mage::app()->getWebsites() as $website) {
56
  foreach ($website->getGroups() as $group) {
57
  $stores = $group->getStores();
58
  foreach ($stores as $store) {
59
- $rendered .= '<option value="'.$store->getId().'">'.$store->getName().'</option>';
60
  }
61
  }
62
  }
63
  $rendered .= '</select>';
64
  return $rendered;
65
- }
66
- return '<input type="text" name="'.$inputName.'" value="#{' . $columnName . '}"/>';
67
- }
 
68
  }
 
69
  ?>
1
  <?php
2
+
3
  /**
4
  *
5
  * NOTICE OF LICENSE
21
  * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
22
  * @link http://www.channelpilot.com
23
  */
24
+ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Field_Trackingkeys extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {
25
+
26
+ protected $magentoAttributes;
27
+
28
+ public function __construct() {
29
+ $this->addColumn('shop', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Shop'),
31
+ 'size' => 15
32
+ ));
33
+ $this->addColumn('trackingkey', array(
34
+ 'label' => Mage::helper('adminhtml')->__('TrackingKey'),
35
+ 'size' => 28
36
+ ));
37
+ $this->_addAfter = false;
38
+
39
+ parent::__construct();
40
+ $this->setTemplate('channelpilotsolutions/array_dropdown.phtml');
41
+ }
42
+
43
+ protected function _renderCellTemplate($columnName) {
44
+ if (empty($this->_columns[$columnName])) {
45
+ throw new Exception('Wrong column name specified.');
46
+ }
47
+ $column = $this->_columns[$columnName];
48
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
49
+
50
+ if ($columnName == 'shop') {
51
+ $rendered = '<select name="' . $inputName . '">';
 
 
 
 
52
  foreach (Mage::app()->getWebsites() as $website) {
53
  foreach ($website->getGroups() as $group) {
54
  $stores = $group->getStores();
55
  foreach ($stores as $store) {
56
+ $rendered .= '<option value="' . $store->getId() . '">' . $store->getName() . '</option>';
57
  }
58
  }
59
  }
60
  $rendered .= '</select>';
61
  return $rendered;
62
+ }
63
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}"/>';
64
+ }
65
+
66
  }
67
+
68
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Block/Adminhtml/Hintlogo.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Channelpilotsolutions_Channelpilot_Block_Adminhtml_Hintlogo extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
4
+
5
+ protected $_template = 'channelpilotsolutions/config_hint.phtml';
6
+
7
+ public function render(Varien_Data_Form_Element_Abstract $element) {
8
+ return $this->toHtml();
9
+ }
10
+
11
+ }
app/code/community/Channelpilotsolutions/Channelpilot/Helper/Data.php CHANGED
@@ -66,7 +66,7 @@ class Channelpilotsolutions_Channelpilot_Helper_Data extends Mage_Core_Helper_Ab
66
  }
67
 
68
  public function createXml() {
69
- if (strcmp(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_useExport'), "true") === 0) {
70
  $password = Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_password');
71
  if ($password == '' || (isset($_GET['password']) AND $_GET['password'] == $password)) {
72
  header('Content-Type: text/xml; charset=utf-8');
@@ -101,7 +101,7 @@ class Channelpilotsolutions_Channelpilot_Helper_Data extends Mage_Core_Helper_Ab
101
  $marketplaceActive = true;
102
  }
103
  $pricecontrolActive = false;
104
- if (strcmp(Mage::getStoreConfig('channelpilot_pricecontrol/general/channelpilot_usePricecontrol'), "true") === 0) {
105
  $pricecontrolActive = true;
106
  }
107
  $exportActive = false;
66
  }
67
 
68
  public function createXml() {
69
+ if (strpos(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_useExport'), "true") !== false || strpos(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_useExport'), "1") !== false) {
70
  $password = Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_password');
71
  if ($password == '' || (isset($_GET['password']) AND $_GET['password'] == $password)) {
72
  header('Content-Type: text/xml; charset=utf-8');
101
  $marketplaceActive = true;
102
  }
103
  $pricecontrolActive = false;
104
+ if (strcmp(Mage::getStoreConfig('channelpilot_pricecontrol/channelpilot_general/channelpilot_usePricecontrol'), "true") === 0) {
105
  $pricecontrolActive = true;
106
  }
107
  $exportActive = false;
app/code/community/Channelpilotsolutions/Channelpilot/Helper/ExportData.php CHANGED
@@ -86,7 +86,7 @@ class ExportData {
86
 
87
  // Extract natively directly from the database
88
  private function _extractFromMySQL() {
89
- $selectLimit = 1000;
90
 
91
  // Increase maximium length for group_concat (for additional image URLs field)
92
  $query = "SET SESSION group_concat_max_len = 1000000;";
@@ -163,6 +163,8 @@ class ExportData {
163
  $blankProduct = array();
164
  $blankProduct['entity_id'] = '';
165
  $blankProduct['sku'] = '';
 
 
166
  $blankProduct['name'] = '';
167
  $blankProduct['description'] = '';
168
  $blankProduct['price'] = '';
@@ -172,7 +174,6 @@ class ExportData {
172
  $blankProduct['cp_image_url'] = '';
173
  $blankProduct['color'] = '';
174
  $blankProduct['weight'] = '';
175
-
176
  $blankProduct['cp_additional_image_1'] = '';
177
  $blankProduct['cp_additional_image_2'] = '';
178
  $blankProduct['cp_additional_image_3'] = '';
@@ -333,7 +334,7 @@ class ExportData {
333
  $parentProductArray = array();
334
  $replace_fields = unserialize(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_replacefields'));
335
 
336
-
337
  while ($counter <= $border) {
338
  // Get all entity_ids for all products in the selected store
339
  $query = "
@@ -358,6 +359,8 @@ class ExportData {
358
  // Loop through each product and output the data
359
  foreach ($EntityIds as $entity) {
360
 
 
 
361
  // Fill the master query with the entity ID
362
  // $entity[0] = entity_id
363
  // $entity[1] = sku
@@ -365,9 +368,32 @@ class ExportData {
365
  $query = $this->_applyTablePrefix($query);
366
  $result = $this->_dbConnection->query($query);
367
 
368
- // Create a new product record
 
369
  $product = $blankProduct;
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  // Initialize basic product data
372
  $product['entity_id'] = $entity[0];
373
  $product['sku'] = $entity[1];
86
 
87
  // Extract natively directly from the database
88
  private function _extractFromMySQL() {
89
+ $selectLimit = 100;
90
 
91
  // Increase maximium length for group_concat (for additional image URLs field)
92
  $query = "SET SESSION group_concat_max_len = 1000000;";
163
  $blankProduct = array();
164
  $blankProduct['entity_id'] = '';
165
  $blankProduct['sku'] = '';
166
+ $blankProduct['parent_id'] = '';
167
+ $blankProduct['variationTheme'] = '';
168
  $blankProduct['name'] = '';
169
  $blankProduct['description'] = '';
170
  $blankProduct['price'] = '';
174
  $blankProduct['cp_image_url'] = '';
175
  $blankProduct['color'] = '';
176
  $blankProduct['weight'] = '';
 
177
  $blankProduct['cp_additional_image_1'] = '';
178
  $blankProduct['cp_additional_image_2'] = '';
179
  $blankProduct['cp_additional_image_3'] = '';
334
  $parentProductArray = array();
335
  $replace_fields = unserialize(Mage::getStoreConfig('channelpilot_export/channelpilot_productfeed/channelpilot_replacefields'));
336
 
337
+ $variationThemes = array();
338
  while ($counter <= $border) {
339
  // Get all entity_ids for all products in the selected store
340
  $query = "
359
  // Loop through each product and output the data
360
  foreach ($EntityIds as $entity) {
361
 
362
+
363
+
364
  // Fill the master query with the entity ID
365
  // $entity[0] = entity_id
366
  // $entity[1] = sku
368
  $query = $this->_applyTablePrefix($query);
369
  $result = $this->_dbConnection->query($query);
370
 
371
+
372
+ // Create a new product record
373
  $product = $blankProduct;
374
 
375
+ if (intval($entity[3]) > 0) {
376
+ $varQuery = "SELECT ea.attribute_code FROM ChannelPilotSolutions_ChannelPilot_catalog_product_super_attribute cpsa
377
+ LEFT JOIN ChannelPilotSolutions_ChannelPilot_eav_attribute ea ON ea.attribute_id = cpsa.attribute_id
378
+ WHERE cpsa.product_id = '$entity[0]' ORDER BY ea.attribute_id; ";
379
+ $varQuery = $this->_applyTablePrefix($varQuery);
380
+ $varresults = $this->_dbConnection->fetchAll($varQuery);
381
+ $variationTheme = "";
382
+ foreach ($varresults as $varresult) {
383
+ $variationTheme = $variationTheme . "|" . $varresult[0];
384
+ }
385
+ $product['variationTheme'] = ltrim($variationTheme, "|");
386
+ $variationThemes[$entity[0]] = ltrim($variationTheme, "|");
387
+ } else {
388
+ if (empty($entity[2]) != true) {
389
+ $product['variationTheme'] = $variationThemes[$entity[2]];
390
+ }
391
+ }
392
+
393
+
394
+
395
+
396
+
397
  // Initialize basic product data
398
  $product['entity_id'] = $entity[0];
399
  $product['sku'] = $entity[1];
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPAbstractHandler.php CHANGED
@@ -11,6 +11,7 @@ class CPAbstractHandler {
11
  const errorHeader_forbidden = "HTTP/1.0 403 Forbidden";
12
  const ChannelPilot_IP = "148.251.65.130";
13
  const DB_REGISTRATION = "cp_registration";
 
14
  const DB_ORDERS = "cp_marketplace_orders";
15
  const DB_ORDER_ITEMS = "cp_marketplace_order_items";
16
 
11
  const errorHeader_forbidden = "HTTP/1.0 403 Forbidden";
12
  const ChannelPilot_IP = "148.251.65.130";
13
  const DB_REGISTRATION = "cp_registration";
14
+ const DB_PRICES = "cp_prices";
15
  const DB_ORDERS = "cp_marketplace_orders";
16
  const DB_ORDER_ITEMS = "cp_marketplace_order_items";
17
 
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPDeliveryHandler.php CHANGED
@@ -17,11 +17,12 @@ class CPDeliveryHandler extends CPAbstractHandler {
17
  if (isset($_GET['limit'])) {
18
  $dbReadConnection = null;
19
  $dbWriteConnection = null;
20
- $query = "SELECT @CP_ORDERS.order_id, @CP_ORDERS.order_nr, @CP_ORDERS.marketplace, sales_flat_shipment_track.track_number, sales_flat_shipment_track.created_at, sales_flat_shipment_track.title, sales_flat_order.shipping_method
21
- FROM @CP_ORDERS
22
- LEFT JOIN sales_flat_shipment_track ON sales_flat_shipment_track.order_id = @CP_ORDERS.order_id
23
- LEFT JOIN sales_flat_order ON sales_flat_order.entity_id = @CP_ORDERS.order_id
24
- WHERE @CP_ORDERS.status = '" . CPOrderStatus::ID_IMPORTED . "' GROUP BY sales_flat_shipment_track.order_id LIMIT " . intval($_GET['limit']) . ";";
 
25
  try {
26
  $query = str_replace('@CP_ORDERS', self::DB_ORDERS, $query);
27
  $dbReadConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
17
  if (isset($_GET['limit'])) {
18
  $dbReadConnection = null;
19
  $dbWriteConnection = null;
20
+ $query = "SELECT @CP_ORDERS.order_id, @CP_ORDERS.order_nr, @CP_ORDERS.marketplace, sales_flat_shipment_track.track_number, sales_flat_shipment.created_at, sales_flat_shipment_track.title, sales_flat_order.shipping_method
21
+ FROM @CP_ORDERS
22
+ LEFT JOIN sales_flat_shipment ON sales_flat_shipment.order_id = @CP_ORDERS.order_id
23
+ LEFT JOIN sales_flat_shipment_track ON sales_flat_shipment_track.order_id = @CP_ORDERS.order_id
24
+ LEFT JOIN sales_flat_order ON sales_flat_order.entity_id = @CP_ORDERS.order_id
25
+ WHERE @CP_ORDERS.status = '" . CPOrderStatus::ID_IMPORTED . "' AND sales_flat_shipment.created_at IS NOT NULL GROUP BY @CP_ORDERS.order_id LIMIT " . intval($_GET['limit']) . ";";
26
  try {
27
  $query = str_replace('@CP_ORDERS', self::DB_ORDERS, $query);
28
  $dbReadConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPNewPriceHandler.php CHANGED
@@ -16,60 +16,71 @@ class CPNewPriceHandler extends CPAbstractHandler {
16
  if (isset($_GET['token']) && self::isIpAllowedViaSecurityToken($_GET['token'])) {
17
  if (isset($_GET['priceId'])) {
18
  $merchantId = self::getMerchantId($_GET['token']);
19
- $api = new ChannelPilotSellerAPI_v1_0($merchantId, $_GET['token']);
 
 
 
20
  $priceId = $_GET['priceId'];
21
- $filterFrom = self::getLastPriceUpdate($_GET['token']);
22
  $method = "all";
23
  if (isset($filterFrom)) {
24
  $method = "update";
25
  }
26
  $filterArticles = null;
 
 
27
  $result = $api->getDynamicArticlePrices($priceId, $method, $filterArticles, $filterFrom);
28
  $unknownArticles = array();
29
  $lastPriceUpdate = null;
30
 
31
  if (isset($result->managedArticlePrices)) {
 
 
 
 
 
 
 
32
  foreach ($result->managedArticlePrices as $articlePrice) {
33
  $id = $articlePrice->article->id;
34
- $price = $articlePrice->price;
35
-
36
  $articleNumber = Mage::getStoreConfig('channelpilot_general/channelpilot_general/channelpilot_articlenumber');
37
  $product = null;
38
  switch ($articleNumber) {
39
  case 'product_id':
40
- $product = Mage::getModel('catalog/product')->load($id);
41
  break;
42
-
43
  case 'sku':
44
- $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $id);
45
  break;
46
-
47
  default:
48
  CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Error by choosing article number '$articleNumber'", "Error by choosing article number '$articleNumber'");
49
  break;
50
  }
51
- if (isset($product['entity_id'])) {
 
 
 
 
 
 
52
  $field = Mage::getStoreConfig('channelpilot_pricecontrol/general_prices/channelpilot_generalPriceField');
53
  switch ($field) {
54
  case 'price':
55
- $product->setPrice($price);
56
  break;
57
  case 'special_price':
58
- $product->setSpecialPrice($price);
59
- break;
60
- case 'minimal_price':
61
- $product->setMinimalPrice($price);
62
  break;
63
  default:
64
- CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Error by choosing price field '$field'", "Error by choosing price field '$field'");
65
  break;
66
  }
67
- $product->save();
68
- } else {
69
- $unknownArticles[] = $id;
70
  }
71
  $lastPriceUpdate = $articlePrice->lastUpdate;
72
  }
 
 
 
73
  }
74
 
75
  if (isset($lastPriceUpdate)) {
@@ -79,8 +90,7 @@ class CPNewPriceHandler extends CPAbstractHandler {
79
  $dbWriteConnection->query($sQuery);
80
  $dbWriteConnection->closeConnection();
81
  } catch (Exception $e) {
82
- $dbWriteConnection->closeConnection();
83
- CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Exception during set last_price_update: " . $e->getMessage(), "Exception during set last_price_update: '$sQuery'\n" . $e->getMessage());
84
  }
85
  }
86
  self::hookResult($result->moreAvailable, $unknownArticles);
@@ -109,22 +119,31 @@ class CPNewPriceHandler extends CPAbstractHandler {
109
  $hook->writeResponse(self::defaultHeader, json_encode($hook));
110
  }
111
 
112
- private function getLastPriceUpdate($token) {
113
  $dbConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
114
- $sQuery = "SELECT last_price_update FROM " . self::DB_REGISTRATION . " WHERE securityToken = ?;";
115
- $array = array($token);
116
  try {
117
  $sResult = $dbConnection->fetchOne($sQuery, $array);
118
  $dbConnection->closeConnection();
119
  if (isset($sResult)) {
120
  $date = new DateTime($sResult);
121
  return date_format($date, 'Y-m-d') . "T" . date_format($date, 'H:i:s');
 
 
 
 
 
 
 
 
 
 
122
  }
123
  } catch (Exception $e) {
124
  $dbConnection->closeConnection();
125
  CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Exception in getLastPriceUpdate(): " . $e->getMessage(), "Exception in getLastPriceUpdate(): '$sQuery'\n" . print_r($array, true) . "\n" . $e->getMessage());
126
  }
127
- return null;
128
  }
129
 
130
  }
16
  if (isset($_GET['token']) && self::isIpAllowedViaSecurityToken($_GET['token'])) {
17
  if (isset($_GET['priceId'])) {
18
  $merchantId = self::getMerchantId($_GET['token']);
19
+ $shopId = self::getShopId($_GET['token'], Mage::getSingleton('core/resource')->getConnection('core_read'));
20
+ $store = Mage::getSingleton('core/store')->load($shopId);
21
+
22
+
23
  $priceId = $_GET['priceId'];
24
+ $filterFrom = self::getLastPriceUpdate($priceId);
25
  $method = "all";
26
  if (isset($filterFrom)) {
27
  $method = "update";
28
  }
29
  $filterArticles = null;
30
+
31
+ $api = new ChannelPilotSellerAPI_v1_0($merchantId, $_GET['token']);
32
  $result = $api->getDynamicArticlePrices($priceId, $method, $filterArticles, $filterFrom);
33
  $unknownArticles = array();
34
  $lastPriceUpdate = null;
35
 
36
  if (isset($result->managedArticlePrices)) {
37
+ $useNet = false;
38
+ if (Mage::getStoreConfig('channelpilot_pricecontrol/channelpilot_general/channelpilot_saveGrossOrNetPrices') === "net") {
39
+ $useNet = true;
40
+ }
41
+ $taxCalculation = Mage::getModel('tax/calculation');
42
+ $taxRateRequest = $taxCalculation->getRateRequest(null, null, null, $store);
43
+ $taxRates = array();
44
  foreach ($result->managedArticlePrices as $articlePrice) {
45
  $id = $articlePrice->article->id;
 
 
46
  $articleNumber = Mage::getStoreConfig('channelpilot_general/channelpilot_general/channelpilot_articlenumber');
47
  $product = null;
48
  switch ($articleNumber) {
49
  case 'product_id':
50
+ $product = Mage::getSingleton('catalog/product')->load($id);
51
  break;
 
52
  case 'sku':
53
+ $product = Mage::getSingleton('catalog/product')->loadByAttribute('sku', $id);
54
  break;
 
55
  default:
56
  CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Error by choosing article number '$articleNumber'", "Error by choosing article number '$articleNumber'");
57
  break;
58
  }
59
+ if (empty($product)) {
60
+ $unknownArticles[] = $id;
61
+ } else {
62
+ if ($useNet && empty($taxRates[$product->getTaxClassId()])) {
63
+ $taxRates[$product->getTaxClassId()] = $taxCalculation->getRate($taxRateRequest->setProductClassId($product->getTaxClassId()));
64
+ }
65
+ $price = $useNet ? $articlePrice->price / (($taxRates[$product->getTaxClassId()] / 100) + 1) : $articlePrice->price;
66
  $field = Mage::getStoreConfig('channelpilot_pricecontrol/general_prices/channelpilot_generalPriceField');
67
  switch ($field) {
68
  case 'price':
69
+ Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->entityId), array('price' => round($price, 4)), $shopId);
70
  break;
71
  case 'special_price':
72
+ Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->entityId), array('special_price' => round($price, 4)), $shopId);
 
 
 
73
  break;
74
  default:
75
+ CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, " Error by choosing price field '$field'", "Error by choosing price field '$field'");
76
  break;
77
  }
 
 
 
78
  }
79
  $lastPriceUpdate = $articlePrice->lastUpdate;
80
  }
81
+
82
+ // reindex prices
83
+ Mage::getModel('index/process')->load(2)->reindexEverything();
84
  }
85
 
86
  if (isset($lastPriceUpdate)) {
90
  $dbWriteConnection->query($sQuery);
91
  $dbWriteConnection->closeConnection();
92
  } catch (Exception $e) {
93
+ CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Exception during set last_price_update: " . $e->getMessage(), " Exception during set last_price_update: '$sQuery'\n" . $e->getMessage());
 
94
  }
95
  }
96
  self::hookResult($result->moreAvailable, $unknownArticles);
119
  $hook->writeResponse(self::defaultHeader, json_encode($hook));
120
  }
121
 
122
+ private function getLastPriceUpdate($priceId) {
123
  $dbConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
124
+ $sQuery = "SELECT last_price_update FROM " . self::DB_PRICES . " WHERE price_id = ?;";
125
+ $array = array($priceId);
126
  try {
127
  $sResult = $dbConnection->fetchOne($sQuery, $array);
128
  $dbConnection->closeConnection();
129
  if (isset($sResult)) {
130
  $date = new DateTime($sResult);
131
  return date_format($date, 'Y-m-d') . "T" . date_format($date, 'H:i:s');
132
+ } else {
133
+ $sQuery = "INSERT INTO " . self::DB_PRICES . " (price_id) VALUES ('" . $priceId . "');";
134
+ try {
135
+ $dbWriteConnection = Mage::getSingleton('core/resource')->getConnection('core_write');
136
+ $dbWriteConnection->query($sQuery);
137
+ $dbWriteConnection->closeConnection();
138
+ return null;
139
+ } catch (Exception $e) {
140
+ CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Exception during set last_price_update: " . $e->getMessage(), " Exception during set last_price_update: '$sQuery'\n" . $e->getMessage());
141
+ }
142
  }
143
  } catch (Exception $e) {
144
  $dbConnection->closeConnection();
145
  CPErrorHandler::handle(CPResultCodes::SYSTEM_ERROR, "Exception in getLastPriceUpdate(): " . $e->getMessage(), "Exception in getLastPriceUpdate(): '$sQuery'\n" . print_r($array, true) . "\n" . $e->getMessage());
146
  }
 
147
  }
148
 
149
  }
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPOrderHandler.php CHANGED
@@ -32,7 +32,6 @@ class CPOrderHandler extends CPAbstractHandler {
32
  ini_set('allow_url_fopen', 'On');
33
  $api = new ChannelPilotSellerAPI_v1_0($merchantId, $_GET['token']);
34
  $result = $api->getNewMarketplaceOrders();
35
-
36
  // Check ResultCode of getNewMarketplaceOrders Result
37
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
38
  $moreAvailable = (bool) $result->moreAvailable;
@@ -109,7 +108,7 @@ class CPOrderHandler extends CPAbstractHandler {
109
 
110
  foreach ($apiOrder->itemsOrdered as $orderItem) {
111
  $product = $this->getProduct($orderItem->article->id);
112
- if ($product->getName() == null) {
113
  CPErrorHandler::logError("NO ARTICLE FOR IDENTIFIER: " . $orderItem->article->id);
114
  $apiOrder->orderHeader->status->hasError = true;
115
  $apiOrder->orderHeader->status->errorMessage = "Unknown article: " . $orderItem->article->id;
@@ -120,7 +119,13 @@ class CPOrderHandler extends CPAbstractHandler {
120
  }
121
 
122
  $quote->getBillingAddress()->importCustomerAddress(Mage::getModel('customer/address')->load($customer->getDefaultBilling()));
 
123
  $shippingAddress = $quote->getShippingAddress()->importCustomerAddress(Mage::getModel('customer/address')->load($customer->getDefaultShipping()));
 
 
 
 
 
124
  $shippingAddress
125
  ->setCollectShippingRates(true)
126
  ->collectShippingRates()
@@ -128,7 +133,15 @@ class CPOrderHandler extends CPAbstractHandler {
128
  ->setPaymentMethod($apiOrder->payment->typeId);
129
  $quote->setShippingAddress($shippingAddress);
130
 
131
- $quote->getPayment()->importData(array('method' => $apiOrder->payment->typeId));
 
 
 
 
 
 
 
 
132
  $quote->collectTotals()->save();
133
 
134
  $service = Mage::getModel('sales/service_quote', $quote);
@@ -156,8 +169,9 @@ class CPOrderHandler extends CPAbstractHandler {
156
  $orderItemsResponse = array();
157
  try {
158
  foreach ($items as $item) {
 
159
  foreach ($apiOrder->itemsOrdered as $orderItem) {
160
- if ($orderItem->article->id == $item->getSku()) {
161
  $item->setPrice($orderItem->costsSingle->net);
162
  $item->setCustomPrice($orderItem->costsSingle->net);
163
  $item->setBasePrice($orderItem->costsSingle->net);
@@ -175,10 +189,22 @@ class CPOrderHandler extends CPAbstractHandler {
175
  $item->save();
176
  $orderItem->id = $item->getId();
177
  $orderItemsResponse[] = $orderItem;
178
-
179
  $query = "insert into " . self::DB_ORDER_ITEMS . " (order_item_id, marketplace_order_item_id, order_id) VALUES (?, ?, ?);";
180
  $array = array($item->getId(), $orderItem->idExternal, $order->getId());
181
- $this->dbWriteConnection->query($query, $array);
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  }
183
  }
184
  }
@@ -228,7 +254,7 @@ class CPOrderHandler extends CPAbstractHandler {
228
  }
229
 
230
  /**
231
- *
232
  * @param type $id
233
  */
234
  private function getProduct($id) {
@@ -237,10 +263,17 @@ class CPOrderHandler extends CPAbstractHandler {
237
  switch ($selectedArticleId) {
238
  case "product_id":
239
  $product = Mage::getModel('catalog/product')->load($id);
 
 
 
240
  break;
241
  case "sku":
242
  $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $id);
243
- $product = Mage::getModel('catalog/product')->load($product->getId());
 
 
 
 
244
  break;
245
  default:
246
  break;
@@ -251,7 +284,7 @@ class CPOrderHandler extends CPAbstractHandler {
251
  private function getCustomer($apiOrder) {
252
  $customer = Mage::getModel('customer/customer')
253
  ->setWebsiteId($this->websiteId)
254
- ->loadByEmail($apiOrder->customer->email);
255
  if ($customer->getId() == null) {
256
  $customer = Mage::getModel("customer/customer");
257
  $customer->website_id = $this->websiteId;
@@ -284,6 +317,7 @@ class CPOrderHandler extends CPAbstractHandler {
284
  }
285
  }
286
  $customer->setCreatedAt($apiOrder->orderHeader->orderTime);
 
287
  $customer->save();
288
 
289
  $shippingAddress = Mage::getModel('customer/address');
@@ -297,8 +331,13 @@ class CPOrderHandler extends CPAbstractHandler {
297
  $shippingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressDelivery->state, $apiOrder->addressDelivery->countryIso2);
298
  $shippingAddress->setRegion($shippingRegion->getName());
299
  $shippingAddress->setRegionId($shippingRegion->getId());
300
- $shippingAddress->setCompany($apiOrder->addressDelivery->company);
301
- $shippingAddress->setTelephone(empty($apiOrder->addressDelivery->phone) ? "0000000000" : $apiOrder->addressDelivery->phone);
 
 
 
 
 
302
  $shippingAddress->setIsDefaultShipping(true);
303
  $shippingAddress->save();
304
  $customer->setDefaultShipping($shippingAddress->getId());
@@ -315,8 +354,13 @@ class CPOrderHandler extends CPAbstractHandler {
315
  $billingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressInvoice->state, $apiOrder->addressInvoice->countryIso2);
316
  $billingAddress->setRegion($billingRegion->getName());
317
  $billingAddress->setRegionId($billingRegion->getId());
318
- $billingAddress->setCompany($apiOrder->addressInvoice->company);
319
- $billingAddress->setTelephone($apiOrder->addressInvoice->phone);
 
 
 
 
 
320
  $billingAddress->setIsDefaultBilling(true);
321
  $billingAddress->save();
322
 
@@ -358,8 +402,13 @@ class CPOrderHandler extends CPAbstractHandler {
358
  $shippingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressDelivery->state, $apiOrder->addressDelivery->countryIso2);
359
  $shippingAddress->setRegion($shippingRegion->getName());
360
  $shippingAddress->setRegionId($shippingRegion->getId());
361
- $shippingAddress->setCompany($apiOrder->addressDelivery->company);
362
- $shippingAddress->setTelephone(empty($apiOrder->addressDelivery->phone) ? "0000000000" : $apiOrder->addressDelivery->phone);
 
 
 
 
 
363
  $shippingAddress->setIsDefaultShipping(true);
364
  $shippingAddress->save();
365
 
@@ -374,8 +423,13 @@ class CPOrderHandler extends CPAbstractHandler {
374
  $billingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressInvoice->state, $apiOrder->addressInvoice->countryIso2);
375
  $billingAddress->setRegion($billingRegion->getName());
376
  $billingAddress->setRegionId($billingRegion->getId());
377
- $billingAddress->setCompany($apiOrder->addressInvoice->company);
378
- $billingAddress->setTelephone($apiOrder->addressInvoice->phone);
 
 
 
 
 
379
  $billingAddress->setIsDefaultBilling(true);
380
  $billingAddress->save();
381
  }
@@ -383,15 +437,15 @@ class CPOrderHandler extends CPAbstractHandler {
383
  }
384
 
385
  /**
386
- *
387
  * @param type $apiOrder
388
  * @return boolean
389
  */
390
  private function getOrderItems($apiOrder) {
391
  $dbOrderItems = array();
392
- $query = "SELECT cp_items.order_item_id, cp_items.marketplace_order_item_id
393
  FROM " . self::DB_ORDER_ITEMS . " cp_items
394
- LEFT JOIN " . self::DB_ORDERS . " cp_orders ON cp_orders.order_id = cp_items.order_id
395
  WHERE cp_orders.marketplace_order_id = ? AND cp_orders.marketplace = ?";
396
  $array = array($apiOrder->orderHeader->orderIdExternal, $apiOrder->orderHeader->source);
397
  $sResult = $this->dbReadConnection->fetchAll($query, $array);
@@ -433,7 +487,7 @@ class CPOrderHandler extends CPAbstractHandler {
433
  $orders = array();
434
 
435
  $query = "SELECT cp_orders.order_nr AS orderId, cp_orders.marketplace_order_id AS externalOrderId,
436
- cp_orders.marketplace AS source, cp_items.order_item_id AS orderItemId,
437
  cp_items.marketplace_order_item_id AS externalOrderItemId, cp_orders.status
438
  FROM " . self::DB_ORDER_ITEMS . " cp_items
439
  LEFT JOIN " . self::DB_ORDERS . " cp_orders ON cp_orders.order_id = cp_items.order_id
32
  ini_set('allow_url_fopen', 'On');
33
  $api = new ChannelPilotSellerAPI_v1_0($merchantId, $_GET['token']);
34
  $result = $api->getNewMarketplaceOrders();
 
35
  // Check ResultCode of getNewMarketplaceOrders Result
36
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
37
  $moreAvailable = (bool) $result->moreAvailable;
108
 
109
  foreach ($apiOrder->itemsOrdered as $orderItem) {
110
  $product = $this->getProduct($orderItem->article->id);
111
+ if ($product == null) {
112
  CPErrorHandler::logError("NO ARTICLE FOR IDENTIFIER: " . $orderItem->article->id);
113
  $apiOrder->orderHeader->status->hasError = true;
114
  $apiOrder->orderHeader->status->errorMessage = "Unknown article: " . $orderItem->article->id;
119
  }
120
 
121
  $quote->getBillingAddress()->importCustomerAddress(Mage::getModel('customer/address')->load($customer->getDefaultBilling()));
122
+
123
  $shippingAddress = $quote->getShippingAddress()->importCustomerAddress(Mage::getModel('customer/address')->load($customer->getDefaultShipping()));
124
+ if (substr(Mage::getVersion(), 2, 3) >= 9) {
125
+ $quote->getBillingAddress()->setCompany($apiOrder->addressInvoice->company);
126
+ $shippingAddress->setCompany($apiOrder->addressDelivery->company);
127
+ }
128
+
129
  $shippingAddress
130
  ->setCollectShippingRates(true)
131
  ->collectShippingRates()
133
  ->setPaymentMethod($apiOrder->payment->typeId);
134
  $quote->setShippingAddress($shippingAddress);
135
 
136
+ if (strpos($apiOrder->payment->typeId, 'cp_mp') === false) {
137
+ $quote->getPayment()->importData(array('method' => $apiOrder->payment->typeId));
138
+ } else {
139
+ $quote->getPayment()->importData(array('method' => 'cp_mp',
140
+ 'cc_type' => $apiOrder->payment->typeId
141
+ )
142
+ );
143
+ }
144
+
145
  $quote->collectTotals()->save();
146
 
147
  $service = Mage::getModel('sales/service_quote', $quote);
169
  $orderItemsResponse = array();
170
  try {
171
  foreach ($items as $item) {
172
+
173
  foreach ($apiOrder->itemsOrdered as $orderItem) {
174
+ if ($orderItem->article->id == $item->getSku() || $orderItem->article->id == $item->getProductId()) {
175
  $item->setPrice($orderItem->costsSingle->net);
176
  $item->setCustomPrice($orderItem->costsSingle->net);
177
  $item->setBasePrice($orderItem->costsSingle->net);
189
  $item->save();
190
  $orderItem->id = $item->getId();
191
  $orderItemsResponse[] = $orderItem;
 
192
  $query = "insert into " . self::DB_ORDER_ITEMS . " (order_item_id, marketplace_order_item_id, order_id) VALUES (?, ?, ?);";
193
  $array = array($item->getId(), $orderItem->idExternal, $order->getId());
194
+ try {
195
+ $this->dbWriteConnection->query($query, $array);
196
+ } catch (Exception $e) {
197
+ self::deleteCPOrder($order->getId());
198
+ $this->closeConnections();
199
+ Mage::register('isSecureArea', true);
200
+ Mage::app('admin');
201
+ $order->delete();
202
+ CPErrorHandler::logError("Exception during insert into " . self::DB_ORDER_ITEMS . ": '$query'\n" . print_r($array, true) . "\n" . $e->getMessage() . "\n" . $e->getTraceAsString());
203
+ $apiOrder->orderHeader->status->hasError = true;
204
+ $apiOrder->orderHeader->status->errorMessage = "Exception during insert into " . self::DB_ORDER_ITEMS . ": " . $e->getMessage();
205
+ $apiOrder->orderHeader->status->errorCode = CPResultCodes::SYSTEM_ERROR;
206
+ return $apiOrder;
207
+ }
208
  }
209
  }
210
  }
254
  }
255
 
256
  /**
257
+ *
258
  * @param type $id
259
  */
260
  private function getProduct($id) {
263
  switch ($selectedArticleId) {
264
  case "product_id":
265
  $product = Mage::getModel('catalog/product')->load($id);
266
+ if (!is_object($product)) {
267
+ $product = null;
268
+ }
269
  break;
270
  case "sku":
271
  $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $id);
272
+ if (is_object($product)) {
273
+ $product = Mage::getModel('catalog/product')->load($product->getId());
274
+ } else {
275
+ $product = null;
276
+ }
277
  break;
278
  default:
279
  break;
284
  private function getCustomer($apiOrder) {
285
  $customer = Mage::getModel('customer/customer')
286
  ->setWebsiteId($this->websiteId)
287
+ ->loadByEmail(CustomerFunctions::getUserName($apiOrder->customer->email));
288
  if ($customer->getId() == null) {
289
  $customer = Mage::getModel("customer/customer");
290
  $customer->website_id = $this->websiteId;
317
  }
318
  }
319
  $customer->setCreatedAt($apiOrder->orderHeader->orderTime);
320
+ $customer = CustomerFunctions::insertOrUpdateUser($customer, $apiOrder);
321
  $customer->save();
322
 
323
  $shippingAddress = Mage::getModel('customer/address');
331
  $shippingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressDelivery->state, $apiOrder->addressDelivery->countryIso2);
332
  $shippingAddress->setRegion($shippingRegion->getName());
333
  $shippingAddress->setRegionId($shippingRegion->getId());
334
+ if (substr(Mage::getVersion(), 2, 3) < 9) {
335
+ $shippingAddress->setCompany($apiOrder->addressDelivery->company);
336
+ }
337
+ if (isset($apiOrder->addressDelivery->phone)) {
338
+ $shippingAddress->setTelephone($apiOrder->addressDelivery->phone);
339
+ }
340
+ $shippingAddress = CustomerFunctions::createAddress($shippingAddress, $apiOrder);
341
  $shippingAddress->setIsDefaultShipping(true);
342
  $shippingAddress->save();
343
  $customer->setDefaultShipping($shippingAddress->getId());
354
  $billingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressInvoice->state, $apiOrder->addressInvoice->countryIso2);
355
  $billingAddress->setRegion($billingRegion->getName());
356
  $billingAddress->setRegionId($billingRegion->getId());
357
+ if (substr(Mage::getVersion(), 2, 3) < 9) {
358
+ $billingAddress->setCompany($apiOrder->addressInvoice->company);
359
+ }
360
+ if (isset($apiOrder->addressInvoice->phone)) {
361
+ $billingAddress->setTelephone($apiOrder->addressInvoice->phone);
362
+ }
363
+ $billingAddress = CustomerFunctions::createAddress($billingAddress, $apiOrder);
364
  $billingAddress->setIsDefaultBilling(true);
365
  $billingAddress->save();
366
 
402
  $shippingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressDelivery->state, $apiOrder->addressDelivery->countryIso2);
403
  $shippingAddress->setRegion($shippingRegion->getName());
404
  $shippingAddress->setRegionId($shippingRegion->getId());
405
+ if (substr(Mage::getVersion(), 2, 3) < 9) {
406
+ $shippingAddress->setCompany($apiOrder->addressDelivery->company);
407
+ }
408
+ if (isset($apiOrder->addressDelivery->phone)) {
409
+ $shippingAddress->setTelephone($apiOrder->addressDelivery->phone);
410
+ }
411
+ $shippingAddress = CustomerFunctions::createAddress($shippingAddress, $apiOrder);
412
  $shippingAddress->setIsDefaultShipping(true);
413
  $shippingAddress->save();
414
 
423
  $billingRegion = Mage::getModel('directory/region')->loadByName($apiOrder->addressInvoice->state, $apiOrder->addressInvoice->countryIso2);
424
  $billingAddress->setRegion($billingRegion->getName());
425
  $billingAddress->setRegionId($billingRegion->getId());
426
+ if (substr(Mage::getVersion(), 2, 3) < 9) {
427
+ $billingAddress->setCompany($apiOrder->addressInvoice->company);
428
+ }
429
+ if (isset($apiOrder->addressInvoice->phone)) {
430
+ $billingAddress->setTelephone($apiOrder->addressInvoice->phone);
431
+ }
432
+ $billingAddress = CustomerFunctions::createAddress($billingAddress, $apiOrder);
433
  $billingAddress->setIsDefaultBilling(true);
434
  $billingAddress->save();
435
  }
437
  }
438
 
439
  /**
440
+ *
441
  * @param type $apiOrder
442
  * @return boolean
443
  */
444
  private function getOrderItems($apiOrder) {
445
  $dbOrderItems = array();
446
+ $query = "SELECT cp_items.order_item_id, cp_items.marketplace_order_item_id
447
  FROM " . self::DB_ORDER_ITEMS . " cp_items
448
+ LEFT JOIN " . self::DB_ORDERS . " cp_orders ON cp_orders.order_id = cp_items.order_id
449
  WHERE cp_orders.marketplace_order_id = ? AND cp_orders.marketplace = ?";
450
  $array = array($apiOrder->orderHeader->orderIdExternal, $apiOrder->orderHeader->source);
451
  $sResult = $this->dbReadConnection->fetchAll($query, $array);
487
  $orders = array();
488
 
489
  $query = "SELECT cp_orders.order_nr AS orderId, cp_orders.marketplace_order_id AS externalOrderId,
490
+ cp_orders.marketplace AS source, cp_items.order_item_id AS orderItemId,
491
  cp_items.marketplace_order_item_id AS externalOrderItemId, cp_orders.status
492
  FROM " . self::DB_ORDER_ITEMS . " cp_items
493
  LEFT JOIN " . self::DB_ORDERS . " cp_orders ON cp_orders.order_id = cp_items.order_id
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPStatusHandler.php CHANGED
@@ -22,6 +22,7 @@ class CPShop {
22
  * @version 1.0
23
  */
24
  class CPPaymentType {
 
25
  public $title;
26
  public $id;
27
  public $active;
@@ -95,7 +96,7 @@ class CPStatusHandler extends CPAbstractHandler {
95
  $deliveryTypes = array();
96
  foreach ($methods as $_ccode => $_carrier) {
97
  if ($carrierMethods = $_carrier->getAllowedMethods()) {
98
- if (!$_title = Mage::getStoreConfig("carriers/$_ccode/title", $shopId)){
99
  $_title = $_ccode;
100
  }
101
  foreach ($carrierMethods as $_mcode => $_method) {
@@ -115,21 +116,36 @@ class CPStatusHandler extends CPAbstractHandler {
115
  $paymentTypes = array();
116
  $payments = Mage::getSingleton('payment/config')->getActiveMethods();
117
  foreach ($payments as $paymentCode => $paymentModel) {
118
- $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title', $shopId);
119
- $paymentType = new CPPaymentType();
120
- $paymentType->id = $paymentCode;
121
- if (empty($paymentTitle)) {
122
- $paymentType->title = $paymentCode;
123
- } else {
124
- $paymentType->title = $paymentTitle;
125
- }
126
- $status = $paymentModel->canUseCheckout();
127
- if ($status == 1 && $paymentCode != 'free') {
128
- $paymentType->active = true;
 
129
  } else {
130
- $paymentType->active = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
- $paymentTypes[] = $paymentType;
133
  }
134
  return $paymentTypes;
135
  }
22
  * @version 1.0
23
  */
24
  class CPPaymentType {
25
+
26
  public $title;
27
  public $id;
28
  public $active;
96
  $deliveryTypes = array();
97
  foreach ($methods as $_ccode => $_carrier) {
98
  if ($carrierMethods = $_carrier->getAllowedMethods()) {
99
+ if (!$_title = Mage::getStoreConfig("carriers/$_ccode/title", $shopId)) {
100
  $_title = $_ccode;
101
  }
102
  foreach ($carrierMethods as $_mcode => $_method) {
116
  $paymentTypes = array();
117
  $payments = Mage::getSingleton('payment/config')->getActiveMethods();
118
  foreach ($payments as $paymentCode => $paymentModel) {
119
+ if ($paymentCode === Mage::getSingleton('channelpilot/payment')->getCode()) {
120
+ $types = Mage::getStoreConfig('payment/' . $paymentCode . '/types', $shopId);
121
+ $cpmp_types = Mage::getSingleton('channelpilot/payment')->getCcTypes();
122
+ foreach (explode(',', $types) as $type) {
123
+ if (isset($cpmp_types[$type])) {
124
+ $paymentType = new CPPaymentType();
125
+ $paymentType->id = $type;
126
+ $paymentType->title = $cpmp_types[$type];
127
+ $paymentType->active = true;
128
+ $paymentTypes[] = $paymentType;
129
+ }
130
+ }
131
  } else {
132
+
133
+ $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title', $shopId);
134
+ $paymentType = new CPPaymentType();
135
+ $paymentType->id = $paymentCode;
136
+ if (empty($paymentTitle)) {
137
+ $paymentType->title = $paymentCode;
138
+ } else {
139
+ $paymentType->title = $paymentTitle;
140
+ }
141
+ $status = $paymentModel->canUseCheckout();
142
+ if ($status == 1 && $paymentCode != 'free') {
143
+ $paymentType->active = true;
144
+ } else {
145
+ $paymentType->active = false;
146
+ }
147
+ $paymentTypes[] = $paymentType;
148
  }
 
149
  }
150
  return $paymentTypes;
151
  }
app/code/community/Channelpilotsolutions/Channelpilot/Helper/special/CustomerFunctions.php CHANGED
@@ -1,24 +1,29 @@
1
  <?php
 
2
  /**
3
  * special customer functions
4
  * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
  * @version 1.0
6
  */
7
  class CustomerFunctions {
8
-
9
- public static function insertOrder($oOrder, $apiOrder){
10
- $oOrder->oxorder__oxbillemail->value = str_replace("@","[at]",$apiOrder->customer->email);
11
  return $oOrder;
12
  }
13
-
14
- public static function insertOrUpdateUser($oUser, $apiOrder){
15
- $oUser->oxuser__oxusername->value = str_replace("@","[at]",$apiOrder->customer->email);
16
- return $oUser;
17
  }
18
-
19
- public static function getUserName($userName){
20
- return str_replace("@","[at]",$userName);
21
  }
22
-
 
 
 
 
23
  }
 
24
  ?>
1
  <?php
2
+
3
  /**
4
  * special customer functions
5
  * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
  * @version 1.0
7
  */
8
  class CustomerFunctions {
9
+
10
+ public static function insertOrder($oOrder, $apiOrder) {
 
11
  return $oOrder;
12
  }
13
+
14
+ public static function insertOrUpdateUser($oCustomer, $apiOrder) {
15
+ $oCustomer->email = str_replace("@", "[at]", $apiOrder->customer->email);
16
+ return $oCustomer;
17
  }
18
+
19
+ public static function getUserName($userName) {
20
+ return str_replace("@", "[at]", $userName);
21
  }
22
+
23
+ public static function createAddress($oAddress, $apiOrder) {
24
+ return $oAddress;
25
+ }
26
+
27
  }
28
+
29
  ?>
app/code/community/Channelpilotsolutions/Channelpilot/Model/Abstract.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Channelpilotsolutions_Channelpilot_Model_Abstract extends Mage_Payment_Model_Method_Abstract {
4
+
5
+ protected $_formBlockType = 'payment/form_cc';
6
+ protected $_infoBlockType = 'payment/info_cc';
7
+ protected $_canSaveCc = false;
8
+
9
+ public function assignData($data) {
10
+ if (!($data instanceof Varien_Object)) {
11
+ $data = new Varien_Object($data);
12
+ }
13
+ $info = $this->getInfoInstance();
14
+ $info->setCcType($data->getCcType())
15
+ ->setCcOwner($data->getCcOwner())
16
+ ->setCcLast4(substr($data->getCcNumber(), -4))
17
+ ->setCcNumber($data->getCcNumber())
18
+ ->setCcCid($data->getCcCid())
19
+ ->setCcExpMonth($data->getCcExpMonth())
20
+ ->setCcExpYear($data->getCcExpYear())
21
+ ->setCcSsIssue($data->getCcSsIssue())
22
+ ->setCcSsStartMonth($data->getCcSsStartMonth())
23
+ ->setCcSsStartYear($data->getCcSsStartYear())
24
+ ;
25
+ return $this;
26
+ }
27
+
28
+ public function prepareSave() {
29
+ $info = $this->getInfoInstance();
30
+ if ($this->_canSaveCc) {
31
+ $info->setCcNumberEnc($info->encrypt($info->getCcNumber()));
32
+ }
33
+ //$info->setCcCidEnc($info->encrypt($info->getCcCid()));
34
+ $info->setCcNumber(null)
35
+ ->setCcCid(null);
36
+ return $this;
37
+ }
38
+
39
+ public function validate() {
40
+ $info = $this->getInfoInstance();
41
+ $errorMsg = false;
42
+ $availableTypes = explode(',', $this->getConfigData('cctypes'));
43
+
44
+ $ccNumber = $info->getCcNumber();
45
+
46
+ // remove credit card number delimiters such as "-" and space
47
+ $ccNumber = preg_replace('/[\-\s]+/', '', $ccNumber);
48
+ $info->setCcNumber($ccNumber);
49
+
50
+ $ccType = '';
51
+ $specifiedCCType = $info->getCcType();
52
+
53
+ return $this;
54
+ }
55
+
56
+ public function hasVerification() {
57
+ Mage::log("hasVerification\n", null, 'cp_plugincc.log');
58
+ $configData = $this->getConfigData('useccv');
59
+ if (is_null($configData)) {
60
+ return true;
61
+ }
62
+ return (bool) $configData;
63
+ }
64
+
65
+ public function getVerificationRegEx() {
66
+ Mage::log("getVerificationRegEx\n", null, 'cp_plugincc.log');
67
+ $verificationExpList = array(
68
+ 'VI' => '/^[0-9]{3}$/', // Visa
69
+ 'MC' => '/^[0-9]{3}$/', // Master Card
70
+ 'AE' => '/^[0-9]{4}$/', // American Express
71
+ 'DI' => '/^[0-9]{3}$/', // Discovery
72
+ 'SS' => '/^[0-9]{3,4}$/',
73
+ 'SM' => '/^[0-9]{3,4}$/', // Switch or Maestro
74
+ 'SO' => '/^[0-9]{3,4}$/', // Solo
75
+ 'OT' => '/^[0-9]{3,4}$/',
76
+ 'JCB' => '/^[0-9]{3,4}$/' //JCB
77
+ );
78
+ return $verificationExpList;
79
+ }
80
+
81
+ public function validateCcNum($ccNumber) {
82
+
83
+
84
+ $cardNumber = strrev($ccNumber);
85
+ $numSum = 0;
86
+
87
+ for ($i = 0; $i < strlen($cardNumber); $i++) {
88
+ $currentNum = substr($cardNumber, $i, 1);
89
+
90
+ /**
91
+ * Double every second digit
92
+ */
93
+ if ($i % 2 == 1) {
94
+ $currentNum *= 2;
95
+ }
96
+
97
+ /**
98
+ * Add digits of 2-digit numbers together
99
+ */
100
+ if ($currentNum > 9) {
101
+ $firstNum = $currentNum % 10;
102
+ $secondNum = ($currentNum - $firstNum) / 10;
103
+ $currentNum = $firstNum + $secondNum;
104
+ }
105
+
106
+ $numSum += $currentNum;
107
+ }
108
+
109
+ /**
110
+ * If the total has no remainder it's OK
111
+ */
112
+ Mage::log("validateCcNum: " . ($numSum % 10 == 0) . "\n", null, 'cp_plugincc.log');
113
+ return ($numSum % 10 == 0);
114
+ }
115
+
116
+ public function validateCcNumOther($ccNumber) {
117
+
118
+ return preg_match('/^\\d+$/', $ccNumber);
119
+ }
120
+
121
+ public function isAvailable($quote = null) {
122
+ Mage::log($this->getConfigData('cctypes', ($quote ? $quote->getStoreId() : null)) && parent::isAvailable($quote) . " isAvailable\n", null, 'cp_plugincc.log');
123
+ return $this->getConfigData('cctypes', ($quote ? $quote->getStoreId() : null)) && parent::isAvailable($quote);
124
+ }
125
+
126
+ public function getIsCentinelValidationEnabled() {
127
+ return false !== Mage::getConfig()->getNode('modules/Mage_Centinel') && 1 == $this->getConfigData('centinel');
128
+ }
129
+
130
+ public function getCentinelValidator() {
131
+ $validator = Mage::getSingleton('centinel/service');
132
+ $validator
133
+ ->setIsModeStrict($this->getConfigData('centinel_is_mode_strict'))
134
+ ->setCustomApiEndpointUrl($this->getConfigData('centinel_api_url'))
135
+ ->setStore($this->getStore())
136
+ ->setIsPlaceOrder($this->_isPlaceOrder());
137
+ return $validator;
138
+ }
139
+
140
+ public function getCentinelValidationData() {
141
+ $info = $this->getInfoInstance();
142
+ $params = new Varien_Object();
143
+ $params
144
+ ->setPaymentMethodCode($this->getCode())
145
+ ->setCardType($info->getCcType())
146
+ ->setCardNumber($info->getCcNumber())
147
+ ->setCardExpMonth($info->getCcExpMonth())
148
+ ->setCardExpYear($info->getCcExpYear())
149
+ ->setAmount($this->_getAmount())
150
+ ->setCurrencyCode($this->_getCurrencyCode())
151
+ ->setOrderNumber($this->_getOrderId());
152
+ return $params;
153
+ }
154
+
155
+ private function _getOrderId() {
156
+ $info = $this->getInfoInstance();
157
+
158
+ if ($this->_isPlaceOrder()) {
159
+ return $info->getOrder()->getIncrementId();
160
+ } else {
161
+ if (!$info->getQuote()->getReservedOrderId()) {
162
+ $info->getQuote()->reserveOrderId();
163
+ }
164
+ return $info->getQuote()->getReservedOrderId();
165
+ }
166
+ }
167
+
168
+ private function _getAmount() {
169
+ $info = $this->getInfoInstance();
170
+ if ($this->_isPlaceOrder()) {
171
+ return (double) $info->getOrder()->getQuoteBaseGrandTotal();
172
+ } else {
173
+ return (double) $info->getQuote()->getBaseGrandTotal();
174
+ }
175
+ }
176
+
177
+ private function _getCurrencyCode() {
178
+ $info = $this->getInfoInstance();
179
+
180
+ if ($this->_isPlaceOrder()) {
181
+ return $info->getOrder()->getBaseCurrencyCode();
182
+ } else {
183
+ return $info->getQuote()->getBaseCurrencyCode();
184
+ }
185
+ }
186
+
187
+ private function _isPlaceOrder() {
188
+ $info = $this->getInfoInstance();
189
+ if ($info instanceof Mage_Sales_Model_Quote_Payment) {
190
+ return false;
191
+ } elseif ($info instanceof Mage_Sales_Model_Order_Payment) {
192
+ return true;
193
+ }
194
+ }
195
+
196
+ public function getInfoInstance() {
197
+ $instance = Mage::getSingleton('channelpilot/payment');
198
+ return $instance;
199
+ }
200
+
201
+ }
app/code/community/Channelpilotsolutions/Channelpilot/Model/Payment.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Channelpilotsolutions_Channelpilot_Model_Payment extends Mage_Payment_Model_Method_Abstract {
4
+
5
+ /**
6
+ * unique internal payment method identifier
7
+ *
8
+ * @var string [a-z0-9_]
9
+ */
10
+ protected $_code = 'cp_mp';
11
+
12
+ /**
13
+ * Is this payment method a gateway (online auth/charge) ?
14
+ */
15
+ protected $_isGateway = false;
16
+
17
+ /**
18
+ * Can authorize online?
19
+ */
20
+ protected $_canAuthorize = true;
21
+
22
+ /**
23
+ * Can capture funds online?
24
+ */
25
+ protected $_canCapture = true;
26
+
27
+ /**
28
+ * Can capture partial amounts online?
29
+ */
30
+ protected $_canCapturePartial = false;
31
+
32
+ /**
33
+ * Can refund online?
34
+ */
35
+ protected $_canRefund = false;
36
+
37
+ /**
38
+ * Can void transactions online?
39
+ */
40
+ protected $_canVoid = true;
41
+
42
+ /**
43
+ * Can use this payment method in administration panel?
44
+ */
45
+ protected $_canUseInternal = true;
46
+
47
+ /**
48
+ * Can show this payment method as an option on checkout payment page?
49
+ */
50
+ protected $_canUseCheckout = false;
51
+
52
+ /**
53
+ * Is this payment method suitable for multi-shipping checkout?
54
+ */
55
+ protected $_canUseForMultishipping = true;
56
+
57
+ /**
58
+ * Can save credit card information for future processing?
59
+ */
60
+ protected $_canSaveCc = false;
61
+
62
+ public function getCode() {
63
+ return $this->_code;
64
+ }
65
+
66
+ public function getCcTypes() {
67
+ $types = array();
68
+ $types["cp_mp_default"] = "ChannelPilot Marketplace Payment Default";
69
+ $types["cp_mp_amazon"] = "ChannelPilot Marketplace Payment Amazon";
70
+ // $types["cp_mp_ebay"] = "ChannelPilot Marketplace Payment Ebay";
71
+ // $types["cp_mp_rakuten"] = "ChannelPilot Marketplace Payment Rakuten";
72
+ // $types["cp_mp_cdiscount"] = "ChannelPilot Marketplace Payment CDiscount";
73
+ return $types;
74
+ }
75
+
76
+ protected $_formBlockType = 'payment/form_cc';
77
+ protected $_infoBlockType = 'payment/info_cc';
78
+
79
+ public function assignData($data) {
80
+ if (!($data instanceof Varien_Object)) {
81
+ $data = new Varien_Object($data);
82
+ }
83
+ $info = $this->getInfoInstance();
84
+ $tmp = $this->getCCTypes();
85
+ $info->setCcType($tmp[$data->getCcType()]);
86
+ return $this;
87
+ }
88
+
89
+ public function prepareSave() {
90
+ $info = $this->getInfoInstance();
91
+ $info->setCcNumber(null)
92
+ ->setCcCid(null);
93
+ return $this;
94
+ }
95
+
96
+ public function validate() {
97
+ parent::validate();
98
+
99
+ $info = $this->getInfoInstance();
100
+ $tmp = $this->getCCTypes();
101
+ $activeTypes = explode(',', Mage::getStoreConfig('payment/' . $this->_code . '/types', Mage::app()->getStore()->getStoreId()));
102
+ foreach ($activeTypes as $value) {
103
+ if ($tmp[$value] === $info->getCcType()) {
104
+ return $this;
105
+ }
106
+ }
107
+ Mage::throwException('unknown type for ' . $this->_code);
108
+ }
109
+
110
+ }
111
+
112
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Model/PaymentTypes.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this license header, choose License Headers in Project Properties.
5
+ * To change this template file, choose Tools | Templates
6
+ * and open the template in the editor.
7
+ */
8
+
9
+ class Channelpilotsolutions_Channelpilot_Model_Paymenttypes {
10
+
11
+ public function toOptionArray() {
12
+ $options = array();
13
+
14
+ foreach (Mage::getSingleton('channelpilot/payment')->getCcTypes() as $code => $name) {
15
+ $options[] = array(
16
+ 'value' => $code,
17
+ 'label' => $name
18
+ );
19
+ }
20
+
21
+ return $options;
22
+ }
23
+
24
+ }
app/code/community/Channelpilotsolutions/Channelpilot/Model/Paymenttypes.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Channelpilotsolutions_Channelpilot_Model_Paymenttypes {
4
+
5
+ public function toOptionArray() {
6
+ $options = array();
7
+
8
+ foreach (Mage::getSingleton('channelpilot/payment')->getCcTypes() as $code => $name) {
9
+ $options[] = array(
10
+ 'value' => $code,
11
+ 'label' => $name
12
+ );
13
+ }
14
+
15
+ return $options;
16
+ }
17
+
18
+ }
app/code/community/Channelpilotsolutions/Channelpilot/etc/config.xml CHANGED
@@ -24,7 +24,7 @@
24
  <config>
25
  <modules>
26
  <Channelpilotsolutions_Channelpilot>
27
- <version>2.0.0</version>
28
  </Channelpilotsolutions_Channelpilot>
29
  </modules>
30
  <global>
@@ -47,6 +47,9 @@
47
  <items>
48
  <table>cp_marketplace_order_items</table>
49
  </items>
 
 
 
50
  <logs>
51
  <table>cp_logging</table>
52
  </logs>
@@ -68,16 +71,6 @@
68
  <use>core_setup</use>
69
  </connection>
70
  </channelpilot_setup>
71
- <!-- <channelpilot_write>
72
- <connection>
73
- <use>core_write</use>
74
- </connection>
75
- </channelpilot_write>
76
- <channelpilot_read>
77
- <connection>
78
- <use>core_read</use>
79
- </connection>
80
- </channelpilot_read>-->
81
  </resources>
82
  <extraconfig />
83
  <blocks>
@@ -127,4 +120,17 @@
127
  </updates>
128
  </layout>
129
  </frontend>
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  </config>
24
  <config>
25
  <modules>
26
  <Channelpilotsolutions_Channelpilot>
27
+ <version>2.1.0</version>
28
  </Channelpilotsolutions_Channelpilot>
29
  </modules>
30
  <global>
47
  <items>
48
  <table>cp_marketplace_order_items</table>
49
  </items>
50
+ <prices>
51
+ <table>cp_prices</table>
52
+ </prices>
53
  <logs>
54
  <table>cp_logging</table>
55
  </logs>
71
  <use>core_setup</use>
72
  </connection>
73
  </channelpilot_setup>
 
 
 
 
 
 
 
 
 
 
74
  </resources>
75
  <extraconfig />
76
  <blocks>
120
  </updates>
121
  </layout>
122
  </frontend>
123
+ <default>
124
+ <payment>
125
+ <cp_mp>
126
+ <active>0</active>
127
+ <model>channelpilot/payment</model>
128
+ <order_status>processing</order_status>
129
+ <payment_action>authorize</payment_action>
130
+ <allowspecific>0</allowspecific>
131
+ <email_customer>0</email_customer>
132
+ <title>ChannelPilot Marketplace Payment</title>
133
+ </cp_mp>
134
+ </payment>
135
+ </default>
136
  </config>
app/code/community/Channelpilotsolutions/Channelpilot/etc/system.xml CHANGED
@@ -24,14 +24,15 @@
24
  <config>
25
  <tabs>
26
  <channelpilot_config translate="label" module="channelpilot">
27
- <label>Channelpilot</label>
28
- <class>tab-channelpilot</class>
 
29
  <sort_order>401</sort_order>
30
  </channelpilot_config>
31
  </tabs>
32
  <sections>
33
  <channelpilot_general translate="label" module="channelpilot">
34
- <label>General</label>
35
  <tab>channelpilot_config</tab>
36
  <frontend_type>text</frontend_type>
37
  <sort_order>1000</sort_order>
@@ -39,9 +40,16 @@
39
  <show_in_website>1</show_in_website>
40
  <show_in_store>1</show_in_store>
41
  <groups>
 
 
 
 
 
 
 
42
  <channelpilot_general translate="label">
43
- <label>General ChannelPilot Settings</label>
44
- <frontend_type>text</frontend_type>
45
  <expanded>1</expanded>
46
  <sort_order>1</sort_order>
47
  <show_in_default>1</show_in_default>
@@ -49,39 +57,39 @@
49
  <show_in_store>1</show_in_store>
50
  <fields>
51
  <channelpilot_useNews>
52
- <label>Activate backendnews?</label>
53
  <frontend_type>select</frontend_type>
54
- <source_model>channelpilot_adminhtml/truefalse_values</source_model>
55
- <sort_order>1</sort_order>
56
- <show_in_default>1</show_in_default>
57
- <show_in_website>1</show_in_website>
58
- <show_in_store>1</show_in_store>
59
  </channelpilot_useNews>
60
  <channelpilot_checkIp>
61
- <label>Should the IP for API access be checked?</label>
62
  <frontend_type>select</frontend_type>
63
- <source_model>channelpilot_adminhtml/truefalsesecurity_values</source_model>
64
- <sort_order>2</sort_order>
65
- <show_in_default>1</show_in_default>
66
- <show_in_website>1</show_in_website>
67
- <show_in_store>1</show_in_store>
68
  </channelpilot_checkIp>
69
  <channelpilot_articlenumber>
70
- <label>Articlenumber</label>
71
- <comment>This applies to the tracking as well as the market place connection or the price control.</comment>
72
  <frontend_type>select</frontend_type>
73
- <source_model>channelpilot_adminhtml/articlenumber_values</source_model>
74
- <sort_order>3</sort_order>
75
- <show_in_default>1</show_in_default>
76
- <show_in_website>1</show_in_website>
77
- <show_in_store>1</show_in_store>
78
  </channelpilot_articlenumber>
79
  </fields>
80
  </channelpilot_general>
81
  </groups>
82
  </channelpilot_general>
83
  <channelpilot_tracking translate="label" module="channelpilot">
84
- <label>Tracking</label>
85
  <tab>channelpilot_config</tab>
86
  <frontend_type>text</frontend_type>
87
  <sort_order>2000</sort_order>
@@ -89,9 +97,16 @@
89
  <show_in_website>1</show_in_website>
90
  <show_in_store>1</show_in_store>
91
  <groups>
 
 
 
 
 
 
 
92
  <channelpilot_tracking translate="label">
93
- <label>Tracking Settings</label>
94
- <frontend_type>text</frontend_type>
95
  <expanded>1</expanded>
96
  <sort_order>2</sort_order>
97
  <show_in_default>1</show_in_default>
@@ -99,38 +114,38 @@
99
  <show_in_store>1</show_in_store>
100
  <fields>
101
  <channelpilot_useTracking>
102
- <label>Activate tracking?</label>
103
  <frontend_type>select</frontend_type>
104
- <source_model>channelpilot_adminhtml/truefalse_values</source_model>
105
- <sort_order>0</sort_order>
106
- <show_in_default>1</show_in_default>
107
- <show_in_website>1</show_in_website>
108
- <show_in_store>1</show_in_store>
109
  </channelpilot_useTracking>
110
  <channelpilot_cookiemode>
111
- <label>Cookiemode</label>
112
  <frontend_type>select</frontend_type>
113
- <source_model>channelpilot_adminhtml/cookiemode_values</source_model>
114
- <sort_order>1</sort_order>
115
- <show_in_default>1</show_in_default>
116
- <show_in_website>1</show_in_website>