Smilla_Sobuintegration - Version 1.0.6

Version Notes

Kleinere Fehlerbehebungen

Download this release

Release Info

Developer smilla AG
Extension Smilla_Sobuintegration
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

Files changed (37) hide show
  1. app/code/local/Smilla/PostChShippingLabel/Block/Sales/Order/Grid.php +0 -17
  2. app/code/local/Smilla/PostChShippingLabel/Block/View/Postchshippinglabel.php +0 -15
  3. app/code/local/Smilla/PostChShippingLabel/Helper/Data.php +0 -6
  4. app/code/local/Smilla/PostChShippingLabel/Model/Source/Codeoptions.php +0 -13
  5. app/code/local/Smilla/PostChShippingLabel/Model/Source/Formatoptions.php +0 -13
  6. app/code/local/Smilla/PostChShippingLabel/controllers/PostchshippinglabelController.php +0 -170
  7. app/code/local/Smilla/PostChShippingLabel/etc/config.xml +0 -86
  8. app/code/local/Smilla/PostChShippingLabel/etc/system.xml +0 -136
  9. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log.php +0 -28
  10. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log/Grid.php +0 -69
  11. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Options.php +0 -12
  12. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Options/Abstract.php +0 -71
  13. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Productxml.php +0 -105
  14. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/RicardoIntegrationbackend.php +0 -5
  15. app/code/local/Smilla/RicardoIntegration/Helper/Data.php +0 -35
  16. app/code/local/Smilla/RicardoIntegration/Helper/Sftp.php +0 -18
  17. app/code/local/Smilla/RicardoIntegration/Helper/Xml.php +0 -43
  18. app/code/local/Smilla/RicardoIntegration/Model/Cron.php +0 -31
  19. app/code/local/Smilla/RicardoIntegration/Model/Entity/Attribute.php +0 -91
  20. app/code/local/Smilla/RicardoIntegration/Model/Log.php +0 -12
  21. app/code/local/Smilla/RicardoIntegration/Model/Mysql4/Log.php +0 -8
  22. app/code/local/Smilla/RicardoIntegration/Model/Mysql4/Log/Collection.php +0 -12
  23. app/code/local/Smilla/RicardoIntegration/Model/Observer.php +0 -12
  24. app/code/local/Smilla/RicardoIntegration/controllers/Adminhtml/LogController.php +0 -140
  25. app/code/local/Smilla/RicardoIntegration/controllers/Adminhtml/RicardointegrationbackendController.php +0 -174
  26. app/code/local/Smilla/RicardoIntegration/etc/adminhtml.xml +0 -23
  27. app/code/local/Smilla/RicardoIntegration/etc/config.xml +0 -241
  28. app/code/local/Smilla/RicardoIntegration/etc/system.xml +0 -94
  29. app/code/local/Smilla/RicardoIntegration/sql/attributericardo_setup/mysql4-install-0.1.0.php +0 -13
  30. app/code/local/Smilla/RicardoIntegration/sql/categoryattributericardo_setup/mysql4-install-0.1.0.php +0 -29
  31. app/code/local/Smilla/RicardoIntegration/sql/logtablericardo_setup/mysql4-install-0.1.0.php +0 -19
  32. app/code/local/Smilla/RicardoIntegration/sql/productattributericardo_setup/mysql4-install-0.1.0.php +0 -25
  33. app/code/local/Smilla/RicardoIntegration/sql/salesattributericardo_setup/mysql4-install-0.1.0.php +0 -11
  34. app/code/local/Smilla/RicardoIntegration/xsd/orderImport.xsd +0 -219
  35. app/code/local/Smilla/RicardoIntegration/xsd/productImport.xsd +0 -132
  36. app/code/local/Smilla/Sobuintegration/controllers/ShareController.php +11 -4
  37. package.xml +4 -4
app/code/local/Smilla/PostChShippingLabel/Block/Sales/Order/Grid.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- class Smilla_PostChShippingLabel_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
4
- {
5
-
6
- protected function _prepareMassaction()
7
- {
8
- parent::_prepareMassaction();
9
- $this->getMassactionBlock()->addItem('postch_shippinglabel', array(
10
- 'label'=> Mage::helper('sales')->__('Post.CH Labels drucken'),
11
- 'url' => $this->getUrl('smillaadmin/postchshippinglabel/multipleShippingLabel'),
12
- ));
13
-
14
-
15
- return $this;
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/Block/View/Postchshippinglabel.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Smilla_PostChShippingLabel_Block_View_Postchshippinglabel extends Mage_Adminhtml_Block_Sales_Order_View
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->_addButton('postch_shippinglabel', array(
10
- 'label' => Mage::helper('sales')->__('Post.CH Label drucken'),
11
- 'onclick' => 'setLocation(\'' . $this->getUrl('smillaadmin/postchshippinglabel/singleShippingLabel') . '\')',
12
- ));
13
- }
14
-
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
-
3
- class Smilla_PostChShippingLabel_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
-
6
- }
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/Model/Source/Codeoptions.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
-
3
- class Smilla_PostChShippingLabel_Model_Source_Codeoptions
4
- {
5
- public function toOptionArray()
6
- {
7
- return array(
8
- array('value' => 'ECO', 'label' =>'PostPac Economy'),
9
- array('value' => 'PRI', 'label' =>'PostPac Priority'),
10
- array('value' => 'A7', 'label' =>'A7'),
11
- );
12
- }
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/Model/Source/Formatoptions.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
-
3
- class Smilla_PostChShippingLabel_Model_Source_Formatoptions
4
- {
5
- public function toOptionArray()
6
- {
7
- return array(
8
- array('value' => 'A5', 'label' =>'A5'),
9
- array('value' => 'A6', 'label' =>'A6'),
10
- array('value' => 'A7', 'label' =>'A7'),
11
- );
12
- }
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/controllers/PostchshippinglabelController.php DELETED
@@ -1,170 +0,0 @@
1
- <?php
2
- require_once("Mage/Adminhtml/controllers/Sales/ShipmentController.php");
3
- class Smilla_PostChShippingLabel_PostchshippinglabelController extends Mage_Adminhtml_Controller_Sales_Shipment
4
- {
5
-
6
- public function singleShippingLabelAction()
7
- {
8
- $request = $this->getRequest();
9
-
10
- $ids = $request->getParam('order_id');
11
- $order = Mage::getModel('sales/order')->load($ids);
12
-
13
- $labelBinaryData = $this->generateLabel($order);
14
- $pdf = Zend_Pdf::parse($labelBinaryData);
15
-
16
- $this->_prepareDownloadResponse('ShippingLabel-'.$ids.'.pdf', $pdf->render(), 'application/pdf');
17
-
18
- }
19
-
20
- public function multipleShippingLabelAction()
21
- {
22
- $request = $this->getRequest();
23
-
24
- $ids = $request->getParam('order_ids');
25
-
26
- if(!$ids){
27
- $ids = array($request->getParam('order_id'));
28
- }
29
-
30
- $pdf = new Zend_Pdf(); // Initializing the merged PDF
31
-
32
- for($i=0;$i<count($ids);$i++){
33
-
34
- $order = Mage::getModel('sales/order')->load($ids[$i]);
35
-
36
- // Generate Label
37
- $labelBinaryData = $this->generateLabel($order);
38
-
39
- // Copy Page to multipage PDF
40
- $tmp_pdf = Zend_Pdf::parse($labelBinaryData);
41
- $tmp_page = clone $tmp_pdf->pages[0];
42
- $pdf->pages[] = $tmp_page;
43
-
44
- }
45
-
46
- $this->_prepareDownloadResponse('ShippingLabels-'.implode('-', $ids).'.pdf', $pdf->render(), 'application/pdf');
47
-
48
- }
49
-
50
-
51
- /**
52
- * Get PDF Label From Post.CH Webservice
53
- */
54
- protected function generateLabel($order){
55
- $tarif = 'ECO';
56
-
57
- // SOAP Config
58
- /* TODO: Datei auslesen */
59
- $SOAP_wsdl_file_path = 'post/barcode_v2_1.wsdl';
60
- $SOAP_config = array(
61
-
62
- // Webservice Endpoint URL
63
- 'location' => Mage::getStoreConfig('postchshippinglabel/settings/endpointurl'),
64
-
65
- // Webservice Barcode Login
66
- 'login' => Mage::getStoreConfig('postchshippinglabel/settings/username'),
67
- //'password' => Mage::getStoreConfig('postchshippinglabel/settings/password'),
68
- 'password' => 'SktNuAM2u8'
69
- );
70
-
71
- $SOAP_Client = new SoapClient($SOAP_wsdl_file_path, $SOAP_config);
72
-
73
- // Franking License Configuration
74
- $generateLabelRequest = array(
75
- 'Language' => 'de',
76
- 'Envelope' => array(
77
- 'LabelDefinition' => array(
78
- 'LabelLayout' => Mage::getStoreConfig('postchshippinglabel/advanced_settings/format'),
79
- 'PrintAddresses' => 'RecipientAndCustomer',
80
- 'ImageFileType' => 'PDF',
81
- 'ImageResolution' => 300,
82
- 'PrintPreview' => false
83
- ),
84
- 'FileInfos' => array(
85
- 'FrankingLicense' => Mage::getStoreConfig('postchshippinglabel/settings/licenseno'),
86
- 'PpFranking' => false,
87
- 'Customer' => array(
88
- 'Name1' => Mage::getStoreConfig('postchshippinglabel/customer/company'),
89
- 'Street' => Mage::getStoreConfig('postchshippinglabel/customer/street'),
90
- 'ZIP' => Mage::getStoreConfig('postchshippinglabel/customer/postcode'),
91
- 'City' => Mage::getStoreConfig('postchshippinglabel/customer/city'),
92
- ),
93
- 'CustomerSystem' => 'Magento Labeling Extension by Smilla AG'
94
- ),
95
- 'Data' => array(
96
- 'Provider' => array(
97
- 'Sending' => array(
98
- 'Item' => array(
99
- array(
100
- 'ItemID' => $order->getRealOrderId(),
101
- 'Recipient' => array(
102
- 'Title' => $order->getShippingAddress()->getTitle(),
103
- 'Name1' => $order->getShippingAddress()->getFirstname().' '.$order->getShippingAddress()->getLastname(),
104
- 'Name2' => $order->getShippingAddress()->getCompany(),
105
- 'Street' => implode(", ", $order->getShippingAddress()->getStreet()),
106
- 'ZIP' => substr($order->getShippingAddress()->getPostcode(), 0, 4),
107
- 'City' => $order->getShippingAddress()->getCity(),
108
- 'EMail' => $order->getShippingAddress()->getEmail()
109
- ),
110
- 'Attributes' => array(
111
- 'PRZL' => array(
112
- Mage::getStoreConfig('postchshippinglabel/advanced_settings/code')
113
- ),
114
- 'ProClima' => (Mage::getStoreConfig('postchshippinglabel/advanced_settings/proclima') == 1)
115
- )
116
- )
117
- )
118
- )
119
- )
120
- )
121
- )
122
- );
123
-
124
-
125
- // Web service call
126
- $response = null;
127
- $response = $SOAP_Client->GenerateLabel($generateLabelRequest);
128
-
129
- $item = $response->Envelope->Data->Provider->Sending->Item;
130
- if (isset($item->Errors)) {
131
- $errorMessages = "";
132
- $delimiter="";
133
- foreach ($item->Errors as $error) {
134
- $errorMessages .= $delimiter.$error->Message;
135
- $delimiter=",";
136
- }
137
- echo '<p>ERROR for item with itemID='.$item->ItemID.": ".$errorMessages.'.<br/></p>';
138
- die();
139
-
140
- }
141
-
142
- // Save Tracking Code (Swiss Post)
143
- $identCode = $item->IdentCode;
144
- $shipment_collection = Mage::getResourceModel('sales/order_shipment_collection');
145
- $shipment_collection->addAttributeToFilter('order_id', $order->getId());
146
-
147
- foreach($shipment_collection as $sc) {
148
- $shipment = Mage::getModel('sales/order_shipment');
149
- $shipment->load($sc->getId());
150
-
151
- if($shipment->getId() != '') {
152
- $track = Mage::getModel('sales/order_shipment_track')
153
- ->setShipment($shipment)
154
- ->setData('title', 'Bestellung '.$order->getRealOrderId())
155
- ->setData('number', $identCode)
156
- ->setData('carrier_code', 'swisspost')
157
- ->setData('order_id', $shipment->getData('order_id'))
158
- ->save();
159
- }
160
- }
161
-
162
- // Get successfully generated label as binary data:
163
- return $item->Label;
164
-
165
-
166
- }
167
-
168
-
169
-
170
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/etc/config.xml DELETED
@@ -1,86 +0,0 @@
1
- <?xml version = "1.0"?>
2
- <config>
3
- <modules>
4
- <Smilla_PostChShippingLabel>
5
- <version>0.1.0</version>
6
- </Smilla_PostChShippingLabel>
7
- </modules>
8
- <global>
9
- <models>
10
- <postchshippinglabel>
11
- <class>Smilla_PostChShippingLabel_Model</class>
12
- </postchshippinglabel>
13
- </models>
14
- <blocks>
15
- <adminhtml>
16
- <rewrite>
17
- <sales_order_grid>Smilla_PostChShippingLabel_Block_Sales_Order_Grid</sales_order_grid>
18
- </rewrite>
19
- <rewrite>
20
- <sales_order_view>Smilla_PostChShippingLabel_Block_View_Postchshippinglabel</sales_order_view>
21
- </rewrite>
22
- </adminhtml>
23
- </blocks>
24
- <helpers>
25
- <postchshippinglabel>
26
- <class>Smilla_PostChShippingLabel_Helper</class>
27
- </postchshippinglabel>
28
- </helpers>
29
- </global>
30
- <admin>
31
- <routers>
32
- <smilla_postchshippinglabel>
33
- <use>admin</use>
34
- <args>
35
- <module>Smilla_PostChShippingLabel</module>
36
- <frontName>smillaadmin</frontName>
37
- </args>
38
- </smilla_postchshippinglabel>
39
-
40
- </routers>
41
- </admin>
42
-
43
-
44
- <adminhtml>
45
- <acl>
46
- <resources>
47
- <all>
48
- <title>Allow Everything</title>
49
- </all>
50
- <admin>
51
- <children>
52
- <smilla_postchshippinglabel>
53
- <title>Post.CH Shippinglabel 1</title>
54
- </smilla_postchshippinglabel>
55
- <Smilla_PostChShippingLabel>
56
- <title>Post.CH Shippinglabel 2</title>
57
- </Smilla_PostChShippingLabel>
58
- <smillaadmin>
59
- <title>Post.CH Shippinglabel 2</title>
60
- </smillaadmin>
61
- <system>
62
- <children>
63
- <config>
64
- <children>
65
- <postchshippinglabel>
66
- <title>Post.CH Shippinglabel Settings</title>
67
- </postchshippinglabel>
68
- </children>
69
- </config>
70
- </children>
71
- </system>
72
- </children>
73
- </admin>
74
- </resources>
75
- </acl>
76
- </adminhtml>
77
-
78
-
79
- <default>
80
- <postchshippinglabel>
81
- <settings>
82
- <endpointurl>https://int.mypostbusiness.ch/wsbc/barcode/v2_1</endpointurl>
83
- </settings>
84
- </postchshippinglabel>
85
- </default>
86
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/PostChShippingLabel/etc/system.xml DELETED
@@ -1,136 +0,0 @@
1
- <config>
2
- <sections>
3
- <postchshippinglabel module="postchshippinglabel">
4
- <label>Post.CH Labeling</label>
5
- <tab>sales</tab>
6
- <frontend_type>text</frontend_type>
7
- <show_in_default>1</show_in_default>
8
- <show_in_website>1</show_in_website>
9
- <show_in_store>1</show_in_store>
10
- <sort_order>100</sort_order>
11
- <groups>
12
- <settings translate="label">
13
- <label>Webservice Zugangsdaten</label>
14
- <frontend_type>text</frontend_type>
15
- <sort_order>10</sort_order>
16
- <show_in_default>1</show_in_default>
17
- <show_in_website>1</show_in_website>
18
- <show_in_store>1</show_in_store>
19
- <fields>
20
- <endpointurl translate="label">
21
- <label>Endpoint-URL</label>
22
- <frontend_type>text</frontend_type>
23
- <sort_order>10</sort_order>
24
- <show_in_default>1</show_in_default>
25
- <show_in_website>1</show_in_website>
26
- <show_in_store>1</show_in_store>
27
- </endpointurl>
28
- <username translate="label">
29
- <label>Webservice-Benutzername</label>
30
- <frontend_type>text</frontend_type>
31
- <sort_order>20</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
- </username>
36
- <password translate="label">
37
- <label>Webservice-Passwort</label>
38
- <frontend_type>text</frontend_type>
39
- <sort_order>30</sort_order>
40
- <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
- <show_in_store>1</show_in_store>
43
- </password>
44
- <licenseno translate="label">
45
- <label>Frankierlizenz-Nr. (8-stellig)</label>
46
- <frontend_type>text</frontend_type>
47
- <sort_order>40</sort_order>
48
- <show_in_default>1</show_in_default>
49
- <show_in_website>1</show_in_website>
50
- <show_in_store>1</show_in_store>
51
- </licenseno>
52
- </fields>
53
- </settings>
54
- <advanced_settings translate="label">
55
- <label>Einstellungen</label>
56
- <frontend_type>text</frontend_type>
57
- <sort_order>10</sort_order>
58
- <show_in_default>1</show_in_default>
59
- <show_in_website>1</show_in_website>
60
- <show_in_store>1</show_in_store>
61
- <fields>
62
- <format translate="label">
63
- <label>Label-Format</label>
64
- <frontend_type>select</frontend_type>
65
- <source_model>postchshippinglabel/source_formatoptions</source_model>
66
- <sort_order>10</sort_order>
67
- <show_in_default>1</show_in_default>
68
- <show_in_website>1</show_in_website>
69
- <show_in_store>1</show_in_store>
70
- </format>
71
- <code translate="label">
72
- <label>Dienstleistungscode</label>
73
- <frontend_type>select</frontend_type>
74
- <source_model>postchshippinglabel/source_codeoptions</source_model>
75
- <sort_order>30</sort_order>
76
- <show_in_default>1</show_in_default>
77
- <show_in_website>1</show_in_website>
78
- <show_in_store>1</show_in_store>
79
- </code>
80
- <proclima translate="label">
81
- <label>ProClima</label>
82
- <frontend_type>select</frontend_type>
83
- <source_model>adminhtml/system_config_source_yesno</source_model>
84
- <sort_order>40</sort_order>
85
- <show_in_default>1</show_in_default>
86
- <show_in_website>1</show_in_website>
87
- <show_in_store>1</show_in_store>
88
- </proclima>
89
- </fields>
90
- </advanced_settings>
91
- <customer translate="label">
92
- <label>Absenderadresse</label>
93
- <frontend_type>text</frontend_type>
94
- <sort_order>20</sort_order>
95
- <show_in_default>1</show_in_default>
96
- <show_in_website>1</show_in_website>
97
- <show_in_store>1</show_in_store>
98
- <fields>
99
- <company translate="label">
100
- <label>Firma/Name</label>
101
- <frontend_type>text</frontend_type>
102
- <sort_order>10</sort_order>
103
- <show_in_default>1</show_in_default>
104
- <show_in_website>1</show_in_website>
105
- <show_in_store>1</show_in_store>
106
- </company>
107
- <street translate="label">
108
- <label>Straße / Hausnummer</label>
109
- <frontend_type>text</frontend_type>
110
- <sort_order>20</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
- </street>
115
- <postcode translate="label">
116
- <label>PLZ</label>
117
- <frontend_type>text</frontend_type>
118
- <sort_order>30</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
- </postcode>
123
- <city translate="label">
124
- <label>Ort</label>
125
- <frontend_type>text</frontend_type>
126
- <sort_order>40</sort_order>
127
- <show_in_default>1</show_in_default>
128
- <show_in_website>1</show_in_website>
129
- <show_in_store>1</show_in_store>
130
- </city>
131
- </fields>
132
- </customer>
133
- </groups>
134
- </postchshippinglabel>
135
- </sections>
136
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
-
4
- class Smilla_RicardoIntegration_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container{
5
-
6
- public function __construct()
7
- {
8
-
9
- $this->_controller = "adminhtml_log";
10
- $this->_blockGroup = "ricardointegration";
11
- $this->_headerText = Mage::helper("ricardointegration")->__("Log Manager");
12
- $this->_addButtonLabel = Mage::helper("ricardointegration")->__("Add New Item");
13
-
14
-
15
- $data = array(
16
- 'label' => 'Download Product XML',
17
- 'onclick' => "window.open('".$this->getUrl('ricardointegration/adminhtml_ricardointegrationbackend/products')."')"
18
- );
19
- Mage_Adminhtml_Block_Widget_Container::addButton('download_to_mas', $data, 0, 100, 'header', 'header');
20
-
21
-
22
-
23
-
24
- parent::__construct();
25
- $this->_removeButton('add');
26
- }
27
-
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log/Grid.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- class Smilla_RicardoIntegration_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId("logGrid");
10
- $this->setDefaultSort("id");
11
- $this->setDefaultDir("DESC");
12
- $this->setSaveParametersInSession(true);
13
- }
14
-
15
- protected function _prepareCollection()
16
- {
17
- $collection = Mage::getModel("ricardointegration/log")->getCollection();
18
- $this->setCollection($collection);
19
- return parent::_prepareCollection();
20
- }
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn("id", array(
24
- "header" => Mage::helper("ricardointegration")->__("ID"),
25
- "align" =>"right",
26
- "width" => "50px",
27
- "type" => "number",
28
- "index" => "id",
29
- ));
30
-
31
- $this->addColumn("execution_time", array(
32
- "header" => Mage::helper("ricardointegration")->__("Execution Time"),
33
- "index" => "execution_time",
34
- "type" => "datetime",
35
- ));
36
-
37
- $this->addColumn('type', array(
38
- 'header' => Mage::helper('ricardointegration')->__('Type'),
39
- 'index' => 'type',
40
- ));
41
-
42
- $this->addColumn("status", array(
43
- "header" => Mage::helper("ricardointegration")->__("Status"),
44
- "index" => "status",
45
- "type" => "options",
46
- "frame_callback" => array(Mage::helper('ricardointegration'), 'decorateStatus'),
47
- "options" => array(
48
- Mage_Cron_Model_Schedule::STATUS_PENDING => Mage_Cron_Model_Schedule::STATUS_PENDING,
49
- Mage_Cron_Model_Schedule::STATUS_SUCCESS => Mage_Cron_Model_Schedule::STATUS_SUCCESS,
50
- Mage_Cron_Model_Schedule::STATUS_ERROR => Mage_Cron_Model_Schedule::STATUS_ERROR,
51
- Mage_Cron_Model_Schedule::STATUS_MISSED => Mage_Cron_Model_Schedule::STATUS_MISSED,
52
- Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage_Cron_Model_Schedule::STATUS_RUNNING,
53
- )
54
- ));
55
-
56
- //$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
57
-
58
- return parent::_prepareColumns();
59
- }
60
-
61
- public function getRowUrl($row)
62
- {
63
- return '#';
64
- }
65
-
66
-
67
-
68
-
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Options.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
-
4
- class Smilla_RicardoIntegration_Block_Adminhtml_Options extends Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
5
- {
6
- public function __construct()
7
- {
8
-
9
- parent::__construct();
10
- $this->setTemplate('ricardointegration/attribute/options.phtml');
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Options/Abstract.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
- abstract class Smilla_RicardoIntegration_Block_Adminhtml_Options_Abstract extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract {
3
-
4
- /**
5
- * Retrieve attribute option values if attribute input type select or multiselect
6
- *
7
- * @return array
8
- */
9
- public function getOptionValues()
10
- {
11
- $attributeType = $this->getAttributeObject()->getFrontendInput();
12
- $defaultValues = $this->getAttributeObject()->getDefaultValue();
13
- if ($attributeType == 'select' || $attributeType == 'multiselect') {
14
- $defaultValues = explode(',', $defaultValues);
15
- } else {
16
- $defaultValues = array();
17
- }
18
-
19
- switch ($attributeType) {
20
- case 'select':
21
- $inputType = 'radio';
22
- break;
23
- case 'multiselect':
24
- $inputType = 'checkbox';
25
- break;
26
- default:
27
- $inputType = '';
28
- break;
29
- }
30
-
31
- $values = $this->getData('option_values');
32
- if (is_null($values)) {
33
- $values = array();
34
- $optionCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
35
- ->setAttributeFilter($this->getAttributeObject()->getId())
36
- ->setPositionOrder('desc', true)
37
- ->load();
38
-
39
- foreach ($optionCollection as $option) {
40
- $value = array();
41
- if (in_array($option->getId(), $defaultValues)) {
42
- $value['checked'] = 'checked="checked"';
43
- } else {
44
- $value['checked'] = '';
45
- }
46
-
47
- $value['intype'] = $inputType;
48
- $value['id'] = $option->getId();
49
- /* edit start */
50
- $value['ricardo_code'] = $option->getRicardoCode();
51
- /* edit end */
52
- $value['sort_order'] = $option->getSortOrder();
53
- foreach ($this->getStores() as $store) {
54
- $storeValues = $this->getStoreOptionValues($store->getId());
55
- if (isset($storeValues[$option->getId()])) {
56
- $value['store'.$store->getId()] = htmlspecialchars($storeValues[$option->getId()]);
57
- }
58
- else {
59
- $value['store'.$store->getId()] = '';
60
- }
61
- }
62
- $values[] = new Varien_Object($value);
63
- }
64
- $this->setData('option_values', $values);
65
- }
66
-
67
- return $values;
68
- }
69
-
70
-
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Productxml.php DELETED
@@ -1,105 +0,0 @@
1
- <?php
2
-
3
- class Smilla_RicardoIntegration_Block_Adminhtml_Productxml extends Mage_Adminhtml_Block_Template {
4
- public function getRicardoCategories($product){
5
- if(count($product->getCategoryIds()) == 0){
6
- return array();
7
- }
8
-
9
- $result = array();
10
- $categoryCollection = Mage::getResourceModel('catalog/category_collection')
11
- ->addAttributeToSelect('name')
12
- ->addAttributeToSelect('ricardo_category')
13
- ->addAttributeToFilter('entity_id', $product->getCategoryIds())
14
- ->addIsActiveFilter();
15
-
16
- foreach($categoryCollection as $category){
17
- if(strlen(trim($category->getRicardoCategory())) > 0){
18
- $result[] = $category;
19
- }
20
- }
21
-
22
-
23
- return $result;
24
-
25
- }
26
-
27
- public function getAdditionalAttributes($product){
28
-
29
- // Read Attributemapping from Configuration
30
- $attributesString = Mage::getStoreConfig('ricardosettings/catalog/attributes', Mage::app()->getStore());
31
-
32
- $mappedAttributes = array();
33
- foreach(preg_split("/((\r?\n)|(\r\n?))/", $attributesString) as $attributesMapping){
34
- list($magentoAttribute, $ricardoAttribute) = explode('>', $attributesMapping);
35
- $mappedAttributes[trim($magentoAttribute)] = trim($ricardoAttribute);
36
- }
37
-
38
- $result = array();
39
-
40
- // Read Magento Product attributes
41
- foreach($product->getAttributes() as $attribute){
42
- if(array_key_exists($attribute->getAttributeCode(), $mappedAttributes)){
43
- $ricardoAttribute = $mappedAttributes[$attribute->getAttributeCode()];
44
- $result[$ricardoAttribute] = $attribute;
45
- }
46
- }
47
-
48
-
49
-
50
- return $result;
51
- }
52
-
53
- public function getParentProduct($_product){
54
- $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($_product->getId());
55
- if(isset($parentIds[0])){
56
- return $_configurable_product = Mage::getModel('catalog/product')->load($parentIds[0]);
57
- } else {
58
- return false;
59
- }
60
- }
61
-
62
- public function getAttributeValue($_product, $attribute_code){
63
- if(strlen($ricardocode = $_product->getAttributeRicardoCode($attribute_code)) > 0){
64
- // Ricardo Code Value
65
- $result = $ricardocode;
66
- } else {
67
- // Dropdown text
68
- if(strlen($dropdownvalue = $_product->getAttributeText($attribute_code)) > 0){
69
- $result = $dropdownvalue;
70
- } else {
71
- if(strlen($value = $_product->getData($attribute_code)) > 0 || !$this->getParentProduct($_product)){
72
- $result = $value;
73
- } else {
74
- $result = $this->getParentProduct()->getData($attribute_code);
75
- }
76
- }
77
- }
78
- return $result;
79
- }
80
-
81
- /*
82
- <?php $ricardocode = $_product->getAttributeRicardoCode($attribute->getAttributeCode()); ?>
83
-
84
- (strlen($ricardocode) > 0) ? $ricardocode : $_product->getAttributeText($attribute->getAttributeCode()); ?>
85
- <?php $value = (strlen($value) == 0 && $_configurable_product) ? $_configurable_product->getData($attribute->getAttributeCode()) : $value; ?>
86
- */
87
-
88
- public function getBundlingId($product){
89
-
90
- $attributeCode = Mage::getStoreConfig('ricardosettings/catalog/bundleattribute', Mage::app()->getStore());
91
- return $product->getData($attributeCode);
92
- }
93
-
94
- public function getLocalizedProduct($product){
95
- $storeViews = Mage::getModel('core/store')
96
- ->getCollection()
97
- ->setLoadDefault(true);
98
- $result = array();
99
- foreach($storeViews as $storeId => $store) {
100
- $locale = substr(Mage::getStoreConfig('general/locale/code', $storeId), 0, 2);
101
- $result[$locale] = Mage::getModel('catalog/product')->setStoreId($storeId)->load($product->getId());
102
- }
103
- return $result;
104
- }
105
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/RicardoIntegrationbackend.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
- class Smilla_RicardoIntegration_Block_Adminhtml_RicardoIntegrationbackend extends Mage_Adminhtml_Block_Template {
4
-
5
- }
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Helper/Data.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Helper_Data extends Mage_Core_Helper_Abstract
3
- {
4
-
5
- /**
6
- * Decorate status values
7
- *
8
- * @param $status
9
- * @return string
10
- */
11
- public function decorateStatus($status) {
12
- switch ($status) {
13
- case Mage_Cron_Model_Schedule::STATUS_SUCCESS:
14
- $result = '<span class="grid-severity-notice"><span>'.$status.'</span></span>';
15
- break;
16
- case Mage_Cron_Model_Schedule::STATUS_PENDING:
17
- $result = '<span class="bar-lightgray"><span>'.$status.'</span></span>';
18
- break;
19
- case Mage_Cron_Model_Schedule::STATUS_RUNNING:
20
- $result = '<span class="bar-yellow"><span>'.$status.'</span></span>';
21
- break;
22
- case Mage_Cron_Model_Schedule::STATUS_MISSED:
23
- $result = '<span class="bar-orange"><span>'.$status.'</span></span>';
24
- break;
25
- case Mage_Cron_Model_Schedule::STATUS_ERROR:
26
- $result = '<span class="grid-severity-critical"><span>'.$status.'</span></span>';
27
- break;
28
- default:
29
- $result = $status;
30
- break;
31
- }
32
- return $result;
33
- }
34
- }
35
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Helper/Sftp.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Helper_Sftp extends Mage_Core_Helper_Abstract
3
- {
4
- public function writeRemoteFile($remoteFilename, $content){
5
- require_once('lib'.DS .'phpseclib'.DS .'Net'.DS .'SFTP.php');
6
-
7
- // SFTP
8
- $sftp = new Net_SFTP('www.ncn.eu');
9
- if (!$sftp->login('ssh-649954-ncn', 'q2w3e4r')) {
10
- exit('Login Failed');
11
- }
12
- #$attributesString = Mage::getStoreConfig('ricardosettings/catalog/attributes', Mage::app()->getStore());
13
-
14
- return $sftp->put($remoteFilename, $content);
15
-
16
- }
17
- }
18
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Helper/Xml.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Helper_Xml extends Mage_Core_Helper_Abstract
3
- {
4
- public function generateProductXml(){
5
-
6
- $collection = Mage::getModel('catalog/product')
7
- ->getCollection()
8
- #->addAttributeToFilter('export_ricardo', 1)
9
- ->addAttributeToFilter('status', 1)
10
- ->addAttributeToSelect('*');
11
-
12
-
13
- $layout = Mage::getSingleton('core/layout');
14
- $block_header = Mage::getSingleton('core/layout')->createBlock(
15
- 'Smilla_RicardoIntegration_Block_Adminhtml_Productxml',
16
- 'productxml',
17
- array('template' => 'ricardointegration/productxml.phtml')
18
- );
19
- $block_header->setCollection($collection);
20
-
21
- $xmlresult = $block_header->toHtml();
22
-
23
-
24
- // Check against XSD File
25
- if(!@$this->checkXsd($xmlresult, Mage::getModuleDir('', 'Smilla_RicardoIntegration').DS.'xsd'.DS .'productImport.xsd')){
26
- echo "Fehler bei XSD Validierung!";
27
- }
28
-
29
- return $xmlresult;
30
-
31
-
32
-
33
- }
34
-
35
- private function checkXsd($content, $xsdfilepath){
36
- $xml= new DOMDocument();
37
- $xml->loadXML($content, LIBXML_NOBLANKS);
38
- return $xml->schemaValidate($xsdfilepath);
39
- }
40
-
41
-
42
- }
43
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Model/Cron.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Model_Cron{
3
- public function SyncCatalog(){
4
-
5
-
6
- $xmlhelper = Mage::helper('ricardointegration/xml');
7
- $sftphelper = Mage::helper('ricardointegration/sftp');
8
- $filename = 'products_'.time().'.cron.xml';
9
-
10
- $log = Mage::getModel("ricardointegration/log")
11
- ->setExecutionTime(date('Y-m-d H:i:s'))
12
- ->setType('Write Product Catalog ('.$filename.'). '.(string) $result)
13
- ->setStatus(Mage_Cron_Model_Schedule::STATUS_SUCCESS) // Mage_Cron_Model_Schedule::STATUS_ERROR
14
- ->save();
15
-
16
- $result = $sftphelper->writeRemoteFile('/kunden/179933_49716/rp-hosting/2/2/ricardotest/'.$filename, $xmlhelper->generateProductXml());
17
-
18
-
19
- }
20
- public function SyncSales(){
21
- //do something
22
- /*
23
- $log = Mage::getModel("ricardointegration/log")
24
- ->setExecutionTime(date('Y-m-d H:i:s'))
25
- ->setType('Read Sale File XXXX.xml')
26
- ->setStatus(Mage_Cron_Model_Schedule::STATUS_SUCCESS) // Mage_Cron_Model_Schedule::STATUS_ERROR
27
- ->save();
28
- */
29
-
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Model/Entity/Attribute.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Model_Entity_Attribute extends Mage_Eav_Model_Resource_Entity_Attribute
3
- {
4
-
5
-
6
- /**
7
- * Save attribute options
8
- *
9
- * @param Mage_Eav_Model_Entity_Attribute $object
10
- * @return Mage_Eav_Model_Resource_Entity_Attribute
11
- */
12
- protected function _saveOption(Mage_Core_Model_Abstract $object)
13
- {
14
- $option = $object->getOption();
15
- if (is_array($option)) {
16
- $adapter = $this->_getWriteAdapter();
17
- $optionTable = $this->getTable('eav/attribute_option');
18
- $optionValueTable = $this->getTable('eav/attribute_option_value');
19
-
20
- $stores = Mage::app()->getStores(true);
21
- if (isset($option['value'])) {
22
- $attributeDefaultValue = array();
23
- if (!is_array($object->getDefault())) {
24
- $object->setDefault(array());
25
- }
26
-
27
- foreach ($option['value'] as $optionId => $values) {
28
- $intOptionId = (int) $optionId;
29
- if (!empty($option['delete'][$optionId])) {
30
- if ($intOptionId) {
31
- $adapter->delete($optionTable, array('option_id = ?' => $intOptionId));
32
- }
33
- continue;
34
- }
35
- /* changes start */
36
- $sortOrder = !empty($option['order'][$optionId]) ? $option['order'][$optionId] : 0;
37
- $ricardo_code = !empty($option['ricardo_code'][$optionId]) ? $option['ricardo_code'][$optionId] : '';
38
-
39
- if (!$intOptionId) {
40
- $data = array(
41
- 'attribute_id' => $object->getId(),
42
- 'sort_order' => $sortOrder,
43
- 'ricardo_code' => $ricardo_code
44
- );
45
- $adapter->insert($optionTable, $data);
46
- $intOptionId = $adapter->lastInsertId($optionTable);
47
- } else {
48
- $data = array('sort_order' => $sortOrder, 'ricardo_code' => $ricardo_code);
49
- $where = array('option_id =?' => $intOptionId);
50
- $adapter->update($optionTable, $data, $where);
51
- }
52
- /* changes end */
53
- if (in_array($optionId, $object->getDefault())) {
54
- if ($object->getFrontendInput() == 'multiselect') {
55
- $attributeDefaultValue[] = $intOptionId;
56
- } elseif ($object->getFrontendInput() == 'select') {
57
- $attributeDefaultValue = array($intOptionId);
58
- }
59
- }
60
-
61
- // Default value
62
- if (!isset($values[0])) {
63
- Mage::throwException(Mage::helper('eav')->__('Default option value is not defined'));
64
- }
65
-
66
- $adapter->delete($optionValueTable, array('option_id =?' => $intOptionId));
67
- foreach ($stores as $store) {
68
- if (isset($values[$store->getId()])
69
- && (!empty($values[$store->getId()])
70
- || $values[$store->getId()] == "0")
71
- ) {
72
- $data = array(
73
- 'option_id' => $intOptionId,
74
- 'store_id' => $store->getId(),
75
- 'value' => $values[$store->getId()],
76
- );
77
- $adapter->insert($optionValueTable, $data);
78
- }
79
- }
80
- }
81
- $bind = array('default_value' => implode(',', $attributeDefaultValue));
82
- $where = array('attribute_id =?' => $object->getId());
83
- $adapter->update($this->getMainTable(), $bind, $where);
84
- }
85
- }
86
-
87
- return $this;
88
- }
89
-
90
-
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Model/Log.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- class Smilla_RicardoIntegration_Model_Log extends Mage_Core_Model_Abstract
4
- {
5
- protected function _construct(){
6
-
7
- $this->_init("ricardointegration/log");
8
-
9
- }
10
-
11
- }
12
-
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Model/Mysql4/Log.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
3
- {
4
- protected function _construct()
5
- {
6
- $this->_init("ricardointegration/log", "id");
7
- }
8
- }
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Model/Mysql4/Log/Collection.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
- {
4
-
5
- public function _construct(){
6
- $this->_init("ricardointegration/log");
7
- }
8
-
9
-
10
-
11
- }
12
-
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/Model/Observer.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Model_Observer
3
- {
4
-
5
- public function salesUpdate(Varien_Event_Observer $observer)
6
- {
7
- //Mage::dispatchEvent('admin_session_user_login_success', array('user'=>$user));
8
- //$user = $observer->getEvent()->getUser();
9
- //$user->doSomething();
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/controllers/Adminhtml/LogController.php DELETED
@@ -1,140 +0,0 @@
1
- <?php
2
-
3
- class Smilla_RicardoIntegration_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
4
- {
5
- protected function _initAction()
6
- {
7
- $this->loadLayout()->_setActiveMenu("ricardointegration/log")->_addBreadcrumb(Mage::helper("adminhtml")->__("Log Manager"),Mage::helper("adminhtml")->__("Log Manager"));
8
- return $this;
9
- }
10
- public function indexAction()
11
- {
12
- $this->_title($this->__("RicardoIntegration"));
13
- $this->_title($this->__("Manager Log"));
14
-
15
- $this->_initAction();
16
- $this->renderLayout();
17
- }
18
- public function editAction()
19
- {
20
- $this->_title($this->__("RicardoIntegration"));
21
- $this->_title($this->__("Log"));
22
- $this->_title($this->__("Edit Item"));
23
-
24
- $id = $this->getRequest()->getParam("id");
25
- $model = Mage::getModel("ricardointegration/log")->load($id);
26
- if ($model->getId()) {
27
- Mage::register("log_data", $model);
28
- $this->loadLayout();
29
- $this->_setActiveMenu("ricardointegration/log");
30
- $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Log Manager"), Mage::helper("adminhtml")->__("Log Manager"));
31
- $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Log Description"), Mage::helper("adminhtml")->__("Log Description"));
32
- $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
33
- $this->_addContent($this->getLayout()->createBlock("ricardointegration/adminhtml_log_edit"))->_addLeft($this->getLayout()->createBlock("ricardointegration/adminhtml_log_edit_tabs"));
34
- $this->renderLayout();
35
- }
36
- else {
37
- Mage::getSingleton("adminhtml/session")->addError(Mage::helper("ricardointegration")->__("Item does not exist."));
38
- $this->_redirect("*/*/");
39
- }
40
- }
41
-
42
- public function newAction()
43
- {
44
-
45
- $this->_title($this->__("RicardoIntegration"));
46
- $this->_title($this->__("Log"));
47
- $this->_title($this->__("New Item"));
48
-
49
- $id = $this->getRequest()->getParam("id");
50
- $model = Mage::getModel("ricardointegration/log")->load($id);
51
-
52
- $data = Mage::getSingleton("adminhtml/session")->getFormData(true);
53
- if (!empty($data)) {
54
- $model->setData($data);
55
- }
56
-
57
- Mage::register("log_data", $model);
58
-
59
- $this->loadLayout();
60
- $this->_setActiveMenu("ricardointegration/log");
61
-
62
- $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
63
-
64
- $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Log Manager"), Mage::helper("adminhtml")->__("Log Manager"));
65
- $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Log Description"), Mage::helper("adminhtml")->__("Log Description"));
66
-
67
-
68
- $this->_addContent($this->getLayout()->createBlock("ricardointegration/adminhtml_log_edit"))->_addLeft($this->getLayout()->createBlock("ricardointegration/adminhtml_log_edit_tabs"));
69
-
70
- $this->renderLayout();
71
-
72
- }
73
- public function saveAction()
74
- {
75
-
76
- $post_data=$this->getRequest()->getPost();
77
-
78
-
79
- if ($post_data) {
80
-
81
- try {
82
-
83
-
84
-
85
- $model = Mage::getModel("ricardointegration/log")
86
- ->addData($post_data)
87
- ->setId($this->getRequest()->getParam("id"))
88
- ->save();
89
-
90
- Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Log was successfully saved"));
91
- Mage::getSingleton("adminhtml/session")->setLogData(false);
92
-
93
- if ($this->getRequest()->getParam("back")) {
94
- $this->_redirect("*/*/edit", array("id" => $model->getId()));
95
- return;
96
- }
97
- $this->_redirect("*/*/");
98
- return;
99
- }
100
- catch (Exception $e) {
101
- Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
102
- Mage::getSingleton("adminhtml/session")->setLogData($this->getRequest()->getPost());
103
- $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
104
- return;
105
- }
106
-
107
- }
108
- $this->_redirect("*/*/");
109
- }
110
-
111
-
112
-
113
- public function deleteAction()
114
- {
115
- if( $this->getRequest()->getParam("id") > 0 ) {
116
- try {
117
- $model = Mage::getModel("ricardointegration/log");
118
- $model->setId($this->getRequest()->getParam("id"))->delete();
119
- Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
120
- $this->_redirect("*/*/");
121
- }
122
- catch (Exception $e) {
123
- Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
124
- $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
125
- }
126
- }
127
- $this->_redirect("*/*/");
128
- }
129
-
130
-
131
- /**
132
- * Export order grid to CSV format
133
- */
134
- public function exportCsvAction()
135
- {
136
- $fileName = 'log.csv';
137
- $grid = $this->getLayout()->createBlock('ricardointegration/adminhtml_log_grid');
138
- $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
139
- }
140
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/controllers/Adminhtml/RicardointegrationbackendController.php DELETED
@@ -1,174 +0,0 @@
1
- <?php
2
- class Smilla_RicardoIntegration_Adminhtml_RicardointegrationbackendController extends Mage_Adminhtml_Controller_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- $xmlhelper = Mage::helper('ricardointegration/xml');
8
- $sftphelper = Mage::helper('ricardointegration/sftp');
9
- $xmlcontent = $xmlhelper->generateProductXml();
10
- #$sftphelper->writeRemoteFile('/kunden/179933_49716/rp-hosting/2/2/ricardotest/products_'.time().'.xml', $xmlhelper->generateProductXml());
11
-
12
-
13
- $orderxml = simplexml_load_file('orders_example.xml');
14
-
15
- $transaction = Mage::getModel('core/resource_transaction');
16
- $storeId = 1;
17
- $groupId = 1;
18
- $currency = 'CHF';
19
-
20
-
21
-
22
-
23
-
24
-
25
- $reservedOrderId = Mage::getSingleton('eav/config')->getEntityType('order')->fetchNewIncrementId($storeId);
26
-
27
- $order = Mage::getModel('sales/order')
28
- ->setIncrementId($reservedOrderId)
29
- ->setStoreId($storeId)
30
- ->setQuoteId(0)
31
- ->setGlobal_currency_code($currency)
32
- ->setBase_currency_code($currency)
33
- ->setStore_currency_code($currency)
34
- ->setRicardo_customerid($orderxml->order->customerId)
35
- ->setRicardo_ordernumber($orderxml->order->orderNumber)
36
- ->setOrder_currency_code($currency);
37
- //Set your store currency USD or any other
38
-
39
- // set Customer data
40
- $order->setCustomerPrefix($orderxml->order->paymentAddress->title)
41
- ->setCustomerFirstname($orderxml->order->paymentAddress->firstName)
42
- #->setCustomer_email('hu@smilla.com')
43
- ->setCustomerLastname($orderxml->order->paymentAddress->lastName)
44
- ->setCustomerGroupId($groupId)
45
- ->setCustomer_is_guest(1);
46
-
47
- // set Billing Address
48
- $billingAddress = Mage::getModel('sales/order_address')
49
- ->setStoreId($storeId)
50
- ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_BILLING)
51
- ->setPrefix($orderxml->order->paymentAddress->title)
52
- ->setFirstname($orderxml->order->paymentAddress->firstName)
53
- #->setMiddlename('')
54
- ->setLastname($orderxml->order->paymentAddress->lastName)
55
- #->setCompany('smilla')
56
- ->setStreet($orderxml->order->paymentAddress->streetName.' '.$orderxml->order->paymentAddress->streetNumber)
57
- ->setPostcode($orderxml->order->paymentAddress->zip)
58
- ->setCity($orderxml->order->paymentAddress->city)
59
- ->setCountry_id($orderxml->order->paymentAddress->country)
60
- #->setRegion($billing->getRegion())
61
- #->setRegion_id($billing->getRegionId())
62
- #->setTelephone('1234435')
63
- ->setFax('');
64
- $order->setBillingAddress($billingAddress);
65
-
66
- $shippingAddress = Mage::getModel('sales/order_address')
67
- ->setStoreId($storeId)
68
- ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
69
- ->setPrefix($orderxml->order->deliveryAddress->title)
70
- ->setFirstname($orderxml->order->deliveryAddress->firstName)
71
- #->setMiddlename('')
72
- ->setLastname($orderxml->order->deliveryAddress->lastName)
73
- #->setCompany('smilla')
74
- ->setStreet($orderxml->order->deliveryAddress->streetName.' '.$orderxml->order->deliveryAddress->streetNumber)
75
- ->setPostcode($orderxml->order->deliveryAddress->zip)
76
- ->setCity($orderxml->order->deliveryAddress->city)
77
- ->setCountry_id($orderxml->order->deliveryAddress->country)
78
- #->setRegion($shipping->getRegion())
79
- #->setRegion_id($shipping->getRegionId())
80
- #->setTelephone('1234435')
81
- ->setFax('');
82
-
83
- $order->setShippingAddress($shippingAddress)
84
- ->setShipping_method('flatrate_flatrate')
85
- ->setCollectShippingRates(false);
86
- /*->setShippingDescription($this->getCarrierName('flatrate'));*/
87
- /*some error i am getting here need to solve further*/
88
-
89
- //you can set your payment method name here as per your need
90
- $orderPayment = Mage::getModel('sales/order_payment')
91
- ->setStoreId($storeId)
92
- ->setCustomerPaymentId(0)
93
- ->setMethod('purchaseorder')
94
- ->setPo_number($orderxml->order->paymentOrderNumber);
95
- $order->setPayment($orderPayment);
96
-
97
- // let say, we have 2 products
98
- //check that your products exists
99
- //need to add code for configurable products if any
100
- $subTotal = 0;
101
- $products = array(
102
- '5' => array(
103
- 'qty' => 2
104
- ),
105
- '6' => array(
106
- 'qty' => 1
107
- )
108
- );
109
-
110
- foreach ($products as $productId=>$product) {
111
- $_product = Mage::getModel('catalog/product')->load($productId);
112
- $rowTotal = $_product->getPrice() * $product['qty'];
113
- $orderItem = Mage::getModel('sales/order_item')
114
- ->setStoreId($storeId)
115
- ->setQuoteItemId(0)
116
- ->setQuoteParentItemId(NULL)
117
- ->setProductId($productId)
118
- ->setProductType($_product->getTypeId())
119
- ->setQtyBackordered(NULL)
120
- #->setTotalQtyOrdered($product['rqty'])
121
- ->setTaxPercent(8)
122
- ->setTaxAmount(5.67)
123
- ->setQtyOrdered($product['qty'])
124
- ->setName($_product->getName())
125
- ->setSku($_product->getSku())
126
- ->setPrice($_product->getPrice())
127
- ->setBasePrice($_product->getPrice() / 1.19)
128
- ->setOriginalPrice($_product->getPrice())
129
- ->setRowTotal($rowTotal * $product['qty'])
130
- ->setBaseRowTotal($rowTotal * $product['qty'] / 1.19)#
131
-
132
- ;
133
-
134
-
135
- $subTotal += $rowTotal;
136
- $order->addItem($orderItem);
137
- }
138
-
139
- $order->setSubtotal($orderxml->order->totalPrice / 1.08)
140
- ->setBaseSubtotal($orderxml->order->totalPrice / 1.08)
141
- ->setTaxAmount($orderxml->order->totalPrice * 0.08)
142
- ->setBaseTaxAmount($orderxml->order->totalPrice * 0.08)
143
- ->setShippingAmount((double) $orderxml->order->deliveryCosts)
144
- ->setBaseShippingAmount((double) $orderxml->order->deliveryCosts)
145
- ->setGrandTotal((double) $orderxml->order->totalPrice + (double) $orderxml->order->deliveryCosts)
146
- ->setBaseGrandTotal((double) $orderxml->order->totalPrice + (double) $orderxml->order->deliveryCosts);
147
-
148
- #$order->setCustomerNote('Comment duummy');
149
-
150
- #$order->collectShippingRates();
151
-
152
- $transaction->addObject($order);
153
- $transaction->addCommitCallback(array($order, 'place'));
154
- $transaction->addCommitCallback(array($order, 'save'));
155
- $transaction->save();
156
- echo "Order created";
157
- #$this->loadLayout();
158
- #$this->_title($this->__("Ricardo Integration"));
159
- #$this->renderLayout();
160
- }
161
-
162
- public function productsAction()
163
- {
164
-
165
- $xmlhelper = Mage::helper('ricardointegration/xml');
166
- $xmlcontent = $xmlhelper->generateProductXml();
167
-
168
- $this->getResponse()->setHeader('Content-type', 'application/xml');
169
- $this->getResponse()->setHeader('Content-Disposition', 'attachment;filename=products_'.time().'.xml');
170
- $this->getResponse()->setBody($xmlcontent);
171
-
172
- }
173
-
174
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/etc/adminhtml.xml DELETED
@@ -1,23 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <acl>
4
- <resources>
5
- <admin>
6
- <children>
7
- <system>
8
- <children>
9
- <config>
10
- <children>
11
- <ricardosettings translate="title" module="ricardointegration">
12
- <title>Settings Section</title>
13
- <sort_order>0</sort_order>
14
- </ricardosettings>
15
- </children>
16
- </config>
17
- </children>
18
- </system>
19
- </children>
20
- </admin>
21
- </resources>
22
- </acl>
23
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/etc/config.xml DELETED
@@ -1,241 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Smilla_RicardoIntegration>
5
- <version>0.1.0</version>
6
- </Smilla_RicardoIntegration>
7
- </modules>
8
- <global>
9
- <helpers>
10
- <ricardointegration>
11
- <class>Smilla_RicardoIntegration_Helper</class>
12
- </ricardointegration>
13
- </helpers>
14
- <blocks>
15
- <adminhtml>
16
- <rewrite>
17
- <catalog_product_attribute_edit_tab_options>Smilla_RicardoIntegration_Block_Adminhtml_Options</catalog_product_attribute_edit_tab_options>
18
- </rewrite>
19
- </adminhtml>
20
-
21
- <ricardointegration>
22
- <class>Smilla_RicardoIntegration_Block</class>
23
- </ricardointegration>
24
- </blocks>
25
- <models>
26
- <ricardointegration>
27
- <class>Smilla_RicardoIntegration_Model</class>
28
- <resourceModel>ricardointegration_mysql4</resourceModel>
29
- </ricardointegration>
30
- <ricardointegration_mysql4>
31
- <class>Smilla_RicardoIntegration_Model_Mysql4</class>
32
- <entities>
33
- <log>
34
- <table>ricardolog</table>
35
- </log>
36
- </entities>
37
- </ricardointegration_mysql4>
38
- <eav_resource>
39
- <rewrite>
40
- <attribute>Smilla_RicardoIntegration_Model_Entity_Attribute</attribute>
41
- </rewrite>
42
- </eav_resource>
43
- </models>
44
- <resources>
45
- <ricardointegration_setup>
46
- <setup>
47
- <module>Smilla_RicardoIntegration</module>
48
- </setup>
49
- <connection>
50
- <use>core_setup</use>
51
- </connection>
52
- </ricardointegration_setup>
53
- <ricardointegration_write>
54
- <connection>
55
- <use>core_write</use>
56
- </connection>
57
- </ricardointegration_write>
58
- <ricardointegration_read>
59
- <connection>
60
- <use>core_read</use>
61
- </connection>
62
- </ricardointegration_read>
63
- <categoryattributericardo_setup>
64
- <setup>
65
- <module>Smilla_RicardoIntegration</module>
66
- <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
67
- </setup>
68
- <connection>
69
- <use>core_setup</use>
70
- </connection>
71
- </categoryattributericardo_setup>
72
- <categoryattributericardo_write>
73
- <connection>
74
- <use>core_write</use>
75
- </connection>
76
- </categoryattributericardo_write>
77
- <categoryattributericardo_read>
78
- <connection>
79
- <use>core_read</use>
80
- </connection>
81
- </categoryattributericardo_read>
82
- <salesattributericardo_setup>
83
- <setup>
84
- <module>Smilla_RicardoIntegration</module>
85
- <class>Mage_Sales_Model_Mysql4_Setup</class>
86
- </setup>
87
- <connection>
88
- <use>core_setup</use>
89
- </connection>
90
- </salesattributericardo_setup>
91
-
92
- <logtablericardo_setup>
93
- <setup>
94
- <module>Smilla_RicardoIntegration</module>
95
- <class>Mage_Sales_Model_Mysql4_Setup</class>
96
- </setup>
97
- <connection>
98
- <use>core_setup</use>
99
- </connection>
100
- </logtablericardo_setup>
101
- <logtablericardo_setup>
102
- <connection>
103
- <use>core_write</use>
104
- </connection>
105
- </logtablericardo_setup>
106
- <logtablericardo_setup>
107
- <connection>
108
- <use>core_read</use>
109
- </connection>
110
- </logtablericardo_setup>
111
-
112
- <attributericardo_setup>
113
- <setup>
114
- <module>Smilla_RicardoIntegration</module>
115
- <class>Mage_Sales_Model_Mysql4_Setup</class>
116
- </setup>
117
- <connection>
118
- <use>core_setup</use>
119
- </connection>
120
- </attributericardo_setup>
121
- <salesattributericardo_write>
122
- <connection>
123
- <use>core_write</use>
124
- </connection>
125
- </salesattributericardo_write>
126
- <salesattributericardo_read>
127
- <connection>
128
- <use>core_read</use>
129
- </connection>
130
- </salesattributericardo_read>
131
-
132
- <productattributericardo_setup>
133
- <setup>
134
- <module>Smilla_RicardoIntegration</module>
135
- <class>Mage_Sales_Model_Mysql4_Setup</class>
136
- </setup>
137
- <connection>
138
- <use>core_setup</use>
139
- </connection>
140
- </productattributericardo_setup>
141
- <productattributericardo_setup>
142
- <connection>
143
- <use>core_write</use>
144
- </connection>
145
- </productattributericardo_setup>
146
- <productattributericardo_setup>
147
- <connection>
148
- <use>core_read</use>
149
- </connection>
150
- </productattributericardo_setup>
151
-
152
-
153
- </resources>
154
- <events>
155
- <sales_model_service_quote_submit_success> <!-- identifier of the event we want to catch -->
156
- <observers>
157
- <sales_model_service_quote_submit_success_handler> <!-- identifier of the event handler -->
158
- <type>model</type> <!-- class method call type; valid are model, object and singleton -->
159
- <class>ricardointegration/observer</class> <!-- observers class alias -->
160
- <method>salesUpdate</method> <!-- observer's method to be called -->
161
- <args></args> <!-- additional arguments passed to observer -->
162
- </sales_model_service_quote_submit_success_handler>
163
- </observers>
164
- </sales_model_service_quote_submit_success>
165
- </events>
166
- </global>
167
- <admin>
168
- <routers>
169
- <ricardointegration>
170
- <use>admin</use>
171
- <args>
172
- <module>Smilla_RicardoIntegration</module>
173
- <frontName>ricardointegration</frontName>
174
- </args>
175
- </ricardointegration>
176
- </routers>
177
- </admin>
178
- <adminhtml>
179
- <menu>
180
- <ricardointegration module="ricardointegration">
181
- <title>RicardoIntegration</title>
182
- <sort_order>100</sort_order>
183
- <children>
184
- <ricardointegrationbackend module="ricardointegration">
185
- <title>Ricardo Integration</title>
186
- <sort_order>0</sort_order>
187
- <action>ricardointegration/adminhtml_ricardointegrationbackend</action>
188
- </ricardointegrationbackend>
189
- <log module="ricardointegration">
190
- <title>Log</title>
191
- <sort_order>0</sort_order>
192
- <action>ricardointegration/adminhtml_log</action>
193
- </log>
194
- </children>
195
- </ricardointegration>
196
- </menu>
197
- <acl>
198
- <resources>
199
- <all>
200
- <title>Allow Everything</title>
201
- </all>
202
- <admin>
203
- <children>
204
- <ricardointegration translate="title" module="ricardointegration">
205
- <title>Ricardo</title>
206
- <sort_order>1000</sort_order>
207
- <children>
208
- <ricardointegrationbackend translate="title">
209
- <title>Test</title>
210
- </ricardointegrationbackend>
211
- <log translate="title">
212
- <title>Manage Log</title>
213
- <sort_order>0</sort_order>
214
- </log>
215
- </children>
216
- </ricardointegration>
217
- </children>
218
- </admin>
219
- </resources>
220
- </acl>
221
- <layout>
222
- <updates>
223
- <ricardointegration>
224
- <file>ricardointegration.xml</file>
225
- </ricardointegration>
226
- </updates>
227
- </layout>
228
- </adminhtml>
229
- <crontab>
230
- <jobs>
231
- <ricardointegration_synccatalog>
232
- <schedule><cron_expr>0 0 * * *</cron_expr></schedule>
233
- <run><model>ricardointegration/cron::SyncCatalog</model></run>
234
- </ricardointegration_synccatalog>
235
- <ricardointegration_syncsales>
236
- <schedule><cron_expr>*/10 * * * *</cron_expr></schedule>
237
- <run><model>ricardointegration/cron::SyncSales</model></run>
238
- </ricardointegration_syncsales>
239
- </jobs>
240
- </crontab>
241
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/etc/system.xml DELETED
@@ -1,94 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <tabs>
4
- <ricardo translate="label" module="ricardointegration">
5
- <label>Ricardo</label>
6
- <sort_order>100</sort_order>
7
- </ricardo>
8
- </tabs>
9
- <sections>
10
- <ricardosettings translate="label" module="ricardointegration">
11
- <label>Settings</label>
12
- <tab>ricardo</tab>
13
- <frontend_type>text</frontend_type>
14
- <sort_order>0</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <groups>
19
- <general translate="label">
20
- <label>General</label>
21
- <frontend_type>text</frontend_type>
22
- <sort_order>0</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <show_in_store>1</show_in_store>
26
- <fields>
27
- <sftphost translate="label">
28
- <label>Ricardo SFTP Server</label>
29
- <frontend_type>text</frontend_type>
30
- <sort_order>10</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- </sftphost>
35
- <sftpuser translate="label">
36
- <label>Ricardo SFTP Username</label>
37
- <frontend_type>text</frontend_type>
38
- <sort_order>20</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
- </sftpuser>
43
- <sftppassword translate="label">
44
- <label>Ricardo SFTP Password</label>
45
- <frontend_type>text</frontend_type>
46
- <sort_order>30</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
- </sftppassword>
51
-
52
- </fields>
53
- </general>
54
- <catalog translate="label">
55
- <label>Catalog Mapping Settings</label>
56
- <frontend_type>text</frontend_type>
57
- <sort_order>10</sort_order>
58
- <show_in_default>1</show_in_default>
59
- <show_in_website>1</show_in_website>
60
- <show_in_store>1</show_in_store>
61
- <fields>
62
- <attributes translate="label">
63
- <label>Attribute Mapping</label>
64
- <comment>
65
- <![CDATA[Magento Attributes mapped to Ricardo Attributes.<br>
66
- One per Line.<br>
67
- Example: "manufacturer > brand"
68
- ]]>
69
- </comment>
70
- <frontend_type>textarea</frontend_type>
71
- <sort_order>10</sort_order>
72
- <show_in_default>1</show_in_default>
73
- <show_in_website>1</show_in_website>
74
- <show_in_store>1</show_in_store>
75
- </attributes>
76
- <bundleattribute translate="label">
77
- <label>Bundeling ID Attributecode</label>
78
- <comment>
79
- <![CDATA[
80
- Magento Attribute Code for Ricardo Bundling (EAN)
81
- ]]>
82
- </comment>
83
- <frontend_type>text</frontend_type>
84
- <sort_order>30</sort_order>
85
- <show_in_default>1</show_in_default>
86
- <show_in_website>1</show_in_website>
87
- <show_in_store>1</show_in_store>
88
- </bundleattribute>
89
- </fields>
90
- </catalog>
91
- </groups>
92
- </ricardosettings>
93
- </sections>
94
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/sql/attributericardo_setup/mysql4-install-0.1.0.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- $installer = $this;
3
- $installer->startSetup();
4
-
5
-
6
- $table = $installer->getTable('eav_attribute_option');
7
- $installer->getConnection()->addColumn(
8
- $table,
9
- 'ricardo_code',
10
- "VARCHAR( 255 ) NULL"
11
- );
12
-
13
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/sql/categoryattributericardo_setup/mysql4-install-0.1.0.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- $installer = $this;
3
- $installer->startSetup();
4
-
5
-
6
- $installer->addAttribute("catalog_category", "ricardo_category", array(
7
- "type" => "varchar",
8
- "backend" => "",
9
- "frontend" => "",
10
- "label" => "Ricardo Category Code",
11
- "input" => "text",
12
- "class" => "",
13
- "source" => "",
14
- "global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
15
- "visible" => true,
16
- "required" => false,
17
- "user_defined" => false,
18
- "default" => "",
19
- "searchable" => false,
20
- "filterable" => false,
21
- "comparable" => false,
22
-
23
- "visible_on_front" => false,
24
- "unique" => false,
25
- "note" => ""
26
-
27
- ));
28
- $installer->endSetup();
29
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/sql/logtablericardo_setup/mysql4-install-0.1.0.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- $installer = $this;
3
- $installer->startSetup();
4
-
5
-
6
- $installer->run("
7
- DROP TABLE IF EXISTS ".$this->getTable('ricardolog').";
8
- CREATE TABLE ".$this->getTable('ricardolog')." (
9
- `id` int(11) unsigned NOT NULL auto_increment,
10
- `type` varchar(255) NOT NULL default '',
11
- `execution_time` datetime NULL,
12
- `status` varchar(255) NOT NULL default '',
13
- PRIMARY KEY (`id`)
14
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
-
16
- ");
17
-
18
-
19
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/sql/productattributericardo_setup/mysql4-install-0.1.0.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- $installer = $this;
3
- $installer->startSetup();
4
-
5
- $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
6
-
7
- $installer->startSetup();
8
-
9
- $setup->addAttribute('catalog_product', 'ricardo_enabled', array(
10
- 'group' => 'General',
11
- 'label' => 'Sync to Ricardo?',
12
- 'type' => 'int',
13
- 'input' => 'boolean',
14
- 'visible' => true,
15
- 'required' => false,
16
- 'position' => 10000,
17
- 'global' => 'Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL',
18
- 'note' => '',
19
- 'default' => true,
20
- 'default_value_yesno' => '1',
21
- ));
22
-
23
-
24
- $installer->endSetup();
25
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/sql/salesattributericardo_setup/mysql4-install-0.1.0.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- $installer = $this;
3
- $installer->startSetup();
4
-
5
- $installer->addAttribute("quote", "ricardo_ordernumber", array("type"=>"varchar", 'visible' => true));
6
- $installer->addAttribute("quote", "ricardo_customerid", array("type"=>"varchar", 'visible' => true));
7
-
8
- # add to order ?
9
-
10
- $installer->endSetup();
11
-
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/xsd/orderImport.xsd DELETED
@@ -1,219 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" version="1.0">
3
-
4
- <xs:element name="orders" type="orderOptions" />
5
-
6
- <xs:complexType name="orderOptions">
7
- <xs:all>
8
- <xs:element minOccurs="0" name="orderStatus" type="orderStatusDto"/>
9
- <xs:element minOccurs="0" name="orderReturn" type="orderReturnDto"/>
10
- <xs:element minOccurs="0" name="orderCancel" type="orderCancelDto"/>
11
- <xs:element minOccurs="0" name="order" type="orderDto"/>
12
- </xs:all>
13
- </xs:complexType>
14
-
15
- <xs:complexType name="orderCancelDto">
16
- <xs:all>
17
- <xs:element minOccurs="0" name="cancelledReason" type="cancelReason"/>
18
- <xs:element minOccurs="0" name="entries">
19
- <xs:complexType>
20
- <xs:sequence>
21
- <xs:element maxOccurs="unbounded" minOccurs="0" name="entry" type="orderCancelEntryDto"/>
22
- </xs:sequence>
23
- </xs:complexType>
24
- </xs:element>
25
- <xs:element minOccurs="0" name="merchantNotes" type="xs:string"/>
26
- <xs:element minOccurs="1" name="orderNumber" type="xs:string"/>
27
- </xs:all>
28
- </xs:complexType>
29
-
30
- <xs:complexType name="orderCancelEntryDto">
31
- <xs:all>
32
- <xs:element minOccurs="1" name="quantity" type="xs:positiveInteger"/>
33
- <xs:element minOccurs="1" name="refNumber" type="xs:string"/>
34
- </xs:all>
35
- </xs:complexType>
36
-
37
- <xs:complexType name="orderDto">
38
- <xs:all>
39
- <xs:element minOccurs="1" maxOccurs="1" name="customerId" type="xs:string"/>
40
- <xs:element minOccurs="1" maxOccurs="1" name="customerLanguage" type="xs:string"/>
41
- <xs:element minOccurs="0" maxOccurs="1" name="paymentOrderNumber" type="xs:string"/>
42
- <xs:element minOccurs="1" maxOccurs="1" name="orderNumber" type="xs:string"/>
43
- <xs:element minOccurs="0" maxOccurs="1" name="orderStatus" type="orderStatus"/>
44
- <xs:element minOccurs="1" maxOccurs="1" name="orderType" type="orderType"/>
45
- <xs:element minOccurs="0" maxOccurs="1" name="merchantOrderNumber" type="xs:string"/>
46
- <xs:element minOccurs="0" maxOccurs="1" name="deliveryStatus" type="deliveryStatus"/>
47
- <xs:element minOccurs="1" maxOccurs="1" name="totalPrice" type="currencyValueDto"/>
48
- <xs:element minOccurs="1" maxOccurs="1" name="deliveryCosts" type="currencyValueDto"/>
49
- <xs:element minOccurs="0" maxOccurs="1" name="paymentAddress" type="addressDto"/>
50
- <xs:element minOccurs="0" maxOccurs="1" name="deliveryAddress" type="addressDto"/>
51
- <xs:element minOccurs="1" maxOccurs="1" name="entries">
52
- <xs:complexType>
53
- <xs:sequence>
54
- <xs:element maxOccurs="unbounded" minOccurs="1" name="entry" type="orderEntryDto"/>
55
- </xs:sequence>
56
- </xs:complexType>
57
- </xs:element>
58
- <xs:element minOccurs="1" maxOccurs="1" name="creationDate" type="xs:dateTime"/>
59
- <xs:element minOccurs="1" maxOccurs="1" name="modificationDate" type="xs:dateTime"/>
60
- </xs:all>
61
- </xs:complexType>
62
-
63
- <xs:complexType name="currencyValueDto">
64
- <xs:simpleContent>
65
- <xs:extension base="positiveDouble">
66
- <xs:attribute name="currency" type="xs:string" use="required"/>
67
- </xs:extension>
68
- </xs:simpleContent>
69
- </xs:complexType>
70
-
71
- <xs:complexType name="addressDto">
72
- <xs:all>
73
- <xs:element minOccurs="1" name="title" type="xs:string"/>
74
- <xs:element minOccurs="1" name="firstName" type="xs:string"/>
75
- <xs:element minOccurs="1" name="lastName" type="xs:string"/>
76
- <xs:element minOccurs="1" name="streetName" type="xs:string"/>
77
- <xs:element minOccurs="1" name="streetNumber" type="xs:string"/>
78
- <xs:element minOccurs="1" name="zip" type="xs:string"/>
79
- <xs:element minOccurs="1" name="city" type="xs:string"/>
80
- <xs:element minOccurs="1" name="country" type="xs:string"/>
81
- <xs:element minOccurs="0" name="company" type="xs:string"/>
82
- <xs:element minOccurs="0" name="pobox" type="xs:string"/>
83
- </xs:all>
84
- </xs:complexType>
85
-
86
- <xs:complexType name="orderEntryDto">
87
- <xs:all>
88
- <xs:element minOccurs="1" name="refNumber" type="xs:string"/>
89
- <xs:element minOccurs="1" name="productCode" type="xs:string"/>
90
- <xs:element minOccurs="1" name="entryNumber" type="xs:int"/>
91
- <xs:element minOccurs="1" name="name" type="xs:string"/>
92
- <xs:element minOccurs="1" name="quantity" type="xs:positiveInteger"/>
93
- <xs:element minOccurs="1" name="totalPrice" type="currencyValueDto"/>
94
- <xs:element minOccurs="0" name="commissioningFee" type="positiveDouble"/>
95
- <xs:element minOccurs="0" name="options">
96
- <xs:complexType>
97
- <xs:sequence>
98
- <xs:element maxOccurs="unbounded" minOccurs="0" name="option" type="orderOptionDto"/>
99
- </xs:sequence>
100
- </xs:complexType>
101
- </xs:element>
102
- </xs:all>
103
- </xs:complexType>
104
-
105
- <xs:complexType name="orderOptionDto">
106
- <xs:sequence>
107
- <xs:element minOccurs="0" name="name" type="keyValueDto"/>
108
- <xs:element minOccurs="0" name="value" type="keyValueDto"/>
109
- </xs:sequence>
110
- </xs:complexType>
111
-
112
- <xs:complexType name="keyValueDto">
113
- <xs:simpleContent>
114
- <xs:extension base="xs:string">
115
- <xs:attribute name="key" type="xs:string" use="required"/>
116
- </xs:extension>
117
- </xs:simpleContent>
118
- </xs:complexType>
119
-
120
- <xs:complexType name="orderStatusDto">
121
- <xs:all>
122
- <xs:element minOccurs="0" name="cancelledReason" type="cancelReason"/>
123
- <xs:element minOccurs="0" name="delayedInfo" type="delayInfo"/>
124
- <xs:element minOccurs="0" name="merchantNotes" type="xs:string"/>
125
- <xs:element minOccurs="1" name="orderNumber" type="xs:string"/>
126
- <xs:element minOccurs="1" name="orderStatus" type="orderStatus"/>
127
- <xs:element minOccurs="0" name="paymentStatus" type="paymentStatus"/>
128
- <xs:element minOccurs="0" name="shippingStatus" type="deliveryStatus"/>
129
- </xs:all>
130
- </xs:complexType>
131
-
132
- <xs:complexType name="orderReturnDto">
133
- <xs:all>
134
- <xs:element minOccurs="1" name="deliveryCosts" type="positiveDouble"/>
135
- <xs:element minOccurs="1" name="entries">
136
- <xs:complexType>
137
- <xs:sequence>
138
- <xs:element maxOccurs="unbounded" minOccurs="0" name="entry" type="orderReturnEntryDto"/>
139
- </xs:sequence>
140
- </xs:complexType>
141
- </xs:element>
142
- <xs:element minOccurs="0" name="merchantNotes" type="xs:string"/>
143
- <xs:element minOccurs="1" name="orderNumber" type="xs:string"/>
144
- <xs:element minOccurs="0" name="returnNumber" type="xs:string"/>
145
- </xs:all>
146
- </xs:complexType>
147
-
148
- <xs:complexType name="orderReturnEntryDto">
149
- <xs:all>
150
- <xs:element minOccurs="1" name="quantity" type="xs:positiveInteger"/>
151
- <xs:element minOccurs="1" name="refNumber" type="xs:string"/>
152
- <xs:element minOccurs="0" name="totalPrice" type="xs:double"/>
153
- </xs:all>
154
- </xs:complexType>
155
-
156
- <xs:simpleType name="statusDto">
157
- <xs:restriction base="xs:string">
158
- <xs:enumeration value="INFO"/>
159
- <xs:enumeration value="WARN"/>
160
- <xs:enumeration value="ERROR"/>
161
- <xs:enumeration value="FATAL"/>
162
- </xs:restriction>
163
- </xs:simpleType>
164
-
165
- <xs:simpleType name="orderStatus">
166
- <xs:restriction base="xs:string">
167
- <xs:enumeration value="OPEN"/>
168
- <xs:enumeration value="IN_PROGRESS"/>
169
- <xs:enumeration value="COMPLETED"/>
170
- <xs:enumeration value="DELAYED"/>
171
- <xs:enumeration value="CANCELLED"/>
172
- </xs:restriction>
173
- </xs:simpleType>
174
-
175
- <xs:simpleType name="orderType">
176
- <xs:restriction base="xs:string">
177
- <xs:enumeration value="MERCHANT_ORDER"/>
178
- <xs:enumeration value="CUSTOMER_RETURN_ORDER"/>
179
- <xs:enumeration value="CANCEL_ORDER"/>
180
- </xs:restriction>
181
- </xs:simpleType>
182
-
183
- <xs:simpleType name="deliveryStatus">
184
- <xs:restriction base="xs:string">
185
- <xs:enumeration value="NOT_SHIPPED"/>
186
- <xs:enumeration value="SHIPPED"/>
187
- </xs:restriction>
188
- </xs:simpleType>
189
-
190
- <xs:simpleType name="cancelReason">
191
- <xs:restriction base="xs:string">
192
- <xs:enumeration value="no_longer_available"/>
193
- <xs:enumeration value="not_published"/>
194
- <xs:enumeration value="other"/>
195
- </xs:restriction>
196
- </xs:simpleType>
197
-
198
- <xs:simpleType name="delayInfo">
199
- <xs:restriction base="xs:string">
200
- <xs:enumeration value="d1"/>
201
- <xs:enumeration value="d2"/>
202
- <xs:enumeration value="d3"/>
203
- </xs:restriction>
204
- </xs:simpleType>
205
-
206
- <xs:simpleType name="paymentStatus">
207
- <xs:restriction base="xs:string">
208
- <xs:enumeration value="NOT_PAID"/>
209
- <xs:enumeration value="PAID"/>
210
- </xs:restriction>
211
- </xs:simpleType>
212
-
213
- <xs:simpleType name="positiveDouble">
214
- <xs:restriction base="xs:double">
215
- <xs:minInclusive value="0"/>
216
- </xs:restriction>
217
- </xs:simpleType>
218
-
219
- </xs:schema>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/RicardoIntegration/xsd/productImport.xsd DELETED
@@ -1,132 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" version="1.0">
3
-
4
- <xs:complexType name="productsType">
5
- <xs:sequence minOccurs="1" maxOccurs="unbounded">
6
- <xs:element name="product" type="productDto" />
7
- </xs:sequence>
8
- </xs:complexType>
9
-
10
- <xs:complexType name="productDto">
11
- <xs:choice maxOccurs="unbounded">
12
- <xs:element name="refNumber" type="xs:string" />
13
- <xs:element minOccurs="0" name="refGroup" type="xs:string" />
14
- <xs:element minOccurs="0" name="attributes">
15
- <xs:complexType>
16
- <xs:sequence>
17
- <xs:element maxOccurs="unbounded" minOccurs="0" name="attribute" type="attributeDto" />
18
- </xs:sequence>
19
- </xs:complexType>
20
- </xs:element>
21
- <xs:element minOccurs="0" name="bundlingId" type="xs:string" />
22
- <xs:element minOccurs="0" name="categories">
23
- <xs:complexType>
24
- <xs:sequence>
25
- <xs:element maxOccurs="unbounded" minOccurs="0" name="category" type="xs:string" />
26
- </xs:sequence>
27
- </xs:complexType>
28
- </xs:element>
29
- <xs:element minOccurs="0" name="deliveryCosts" type="currencyValueDto" />
30
- <xs:element minOccurs="0" name="description" type="i18NTextDto" />
31
- <xs:element minOccurs="0" name="name" type="i18NTextDto" />
32
- <xs:element minOccurs="0" name="options">
33
- <xs:complexType>
34
- <xs:sequence>
35
- <xs:element maxOccurs="unbounded" minOccurs="0" name="option" type="optionDto" />
36
- </xs:sequence>
37
- </xs:complexType>
38
- </xs:element>
39
- <xs:element minOccurs="0" name="price" type="priceDto" />
40
- <xs:element minOccurs="0" name="stock" type="xs:int" />
41
- <xs:element minOccurs="0" name="summary" type="i18NTextDto" />
42
- </xs:choice>
43
- </xs:complexType>
44
- <xs:complexType name="attributeDto">
45
- <xs:sequence>
46
- <xs:element maxOccurs="unbounded" minOccurs="0" name="entry" type="attributeValueDto" />
47
- </xs:sequence>
48
- <xs:attribute name="key" type="xs:string" />
49
- <xs:attribute name="unit" type="xs:string" />
50
- </xs:complexType>
51
- <xs:complexType name="attributeValueDto">
52
- <xs:sequence>
53
- <xs:element maxOccurs="unbounded" minOccurs="0" name="translation" nillable="true" type="i18NValueDto" />
54
- <xs:element minOccurs="0" name="value" type="xs:string" />
55
- </xs:sequence>
56
- </xs:complexType>
57
- <xs:complexType name="i18NValueDto">
58
- <xs:simpleContent>
59
- <xs:extension base="xs:string">
60
- <xs:attribute name="locale" type="xs:string" use="required" />
61
- </xs:extension>
62
- </xs:simpleContent>
63
- </xs:complexType>
64
- <xs:complexType name="currencyValueDto">
65
- <xs:simpleContent>
66
- <xs:extension base="xs:string">
67
- <xs:attribute name="currency" type="xs:string" use="required" />
68
- </xs:extension>
69
- </xs:simpleContent>
70
- </xs:complexType>
71
- <xs:complexType name="i18NTextDto">
72
- <xs:sequence>
73
- <xs:element maxOccurs="unbounded" minOccurs="0" name="translation" nillable="true" type="i18NValueDto" />
74
- </xs:sequence>
75
- </xs:complexType>
76
- <xs:complexType name="optionDto">
77
- <xs:sequence>
78
- <xs:element minOccurs="0" name="name" type="i18NTextDto" />
79
- <xs:element maxOccurs="unbounded" minOccurs="0" name="value" type="optionValueDto" />
80
- </xs:sequence>
81
- <xs:attribute name="key" type="xs:string" />
82
- </xs:complexType>
83
- <xs:complexType name="optionValueDto">
84
- <xs:choice maxOccurs="unbounded">
85
- <xs:element minOccurs="0" name="key" type="xs:string" />
86
- <xs:element minOccurs="0" name="name" type="i18NTextDto" />
87
- </xs:choice>
88
- </xs:complexType>
89
- <xs:complexType name="priceDto">
90
- <xs:choice maxOccurs="unbounded">
91
- <xs:element minOccurs="0" name="absoluteDiscount" type="xs:double" />
92
- <xs:element minOccurs="0" name="originalPrice" type="xs:double" />
93
- <xs:element minOccurs="0" name="relativeDiscount" type="xs:double" />
94
- <xs:element name="value" type="xs:double" />
95
- </xs:choice>
96
- <xs:attribute name="currency" type="xs:string" use="required" />
97
- </xs:complexType>
98
- <xs:complexType name="importProductResponse">
99
- <xs:sequence>
100
- <xs:element minOccurs="0" name="return" type="responseDto" />
101
- </xs:sequence>
102
- </xs:complexType>
103
- <xs:complexType name="responseDto">
104
- <xs:sequence>
105
- <xs:element minOccurs="0" name="key" type="xs:string" />
106
- <xs:element minOccurs="0" name="messages">
107
- <xs:complexType>
108
- <xs:sequence>
109
- <xs:element maxOccurs="unbounded" minOccurs="0" name="message" type="messageDto" />
110
- </xs:sequence>
111
- </xs:complexType>
112
- </xs:element>
113
- <xs:element minOccurs="0" name="status" type="statusDto" />
114
- </xs:sequence>
115
- </xs:complexType>
116
- <xs:complexType name="messageDto">
117
- <xs:sequence>
118
- <xs:element minOccurs="0" name="message" type="xs:string" />
119
- <xs:element minOccurs="0" name="status" type="statusDto" />
120
- </xs:sequence>
121
- </xs:complexType>
122
- <xs:simpleType name="statusDto">
123
- <xs:restriction base="xs:string">
124
- <xs:enumeration value="INFO" />
125
- <xs:enumeration value="WARN" />
126
- <xs:enumeration value="ERROR" />
127
- <xs:enumeration value="FATAL" />
128
- </xs:restriction>
129
- </xs:simpleType>
130
-
131
- <xs:element name="products" type="productsType"/>
132
- </xs:schema>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Smilla/Sobuintegration/controllers/ShareController.php CHANGED
@@ -15,20 +15,27 @@ class Smilla_Sobuintegration_ShareController extends Mage_Core_Controller_Front_
15
  public function linkAction()
16
  {
17
  $voucherCode = trim($this->getRequest()->getParam('code'));
 
18
  $this->session = Mage::getSingleton('checkout/session');
19
 
20
  if(strlen($voucherCode) > 0) {
21
-
22
  // Save Vouchercode to Session
23
  Mage::getSingleton('core/session')->setSobuVoucherCode($voucherCode);
 
 
 
24
  // Save ClickId to Session
25
- Mage::getSingleton('core/session')->setSobuClickId($this->getRequest()->getParam('sobuClickId'));
 
26
 
27
- if(strlen(Mage::getStoreConfig('sobuintegration/settings/promotion_redirect')) > 0){
 
 
 
28
  $this->_redirect(Mage::getStoreConfig('sobuintegration/settings/promotion_redirect'));
29
  } else {
30
  $this->_redirect('sobu/share/link');
31
- }
32
  } else {
33
  // Show Info Page
34
  $this->loadLayout();
15
  public function linkAction()
16
  {
17
  $voucherCode = trim($this->getRequest()->getParam('code'));
18
+ $clickId = $this->getRequest()->getParam('sobuClickId');
19
  $this->session = Mage::getSingleton('checkout/session');
20
 
21
  if(strlen($voucherCode) > 0) {
 
22
  // Save Vouchercode to Session
23
  Mage::getSingleton('core/session')->setSobuVoucherCode($voucherCode);
24
+ }
25
+
26
+ if(strlen($clickId) > 0) {
27
  // Save ClickId to Session
28
+ Mage::getSingleton('core/session')->setSobuClickId($clickId);
29
+ }
30
 
31
+ if(strlen($voucherCode) > 0 || strlen($clickId) > 0) {
32
+ if(strlen($this->getRequest()->getParam('redirect')) > 0){
33
+ $this->_redirect($this->getRequest()->getParam('redirect'));
34
+ } elseif (strlen(Mage::getStoreConfig('sobuintegration/settings/promotion_redirect')) > 0){
35
  $this->_redirect(Mage::getStoreConfig('sobuintegration/settings/promotion_redirect'));
36
  } else {
37
  $this->_redirect('sobu/share/link');
38
+ }
39
  } else {
40
  // Show Info Page
41
  $this->loadLayout();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Smilla_Sobuintegration</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -11,9 +11,9 @@
11
  Vorraussetzung ist eine Magento Installation sowie ein g&#xFC;ltiger Vertrag mit der sobu-Plattform. Weitere Informationen dazu finden Sie unter: https://www.sobu.ch/de/partner</description>
12
  <notes>Kleinere Fehlerbehebungen</notes>
13
  <authors><author><name>smilla AG</name><user>smilla</user><email>hendrik.unkenholz@smilla.com</email></author></authors>
14
- <date>2014-06-24</date>
15
- <time>14:51:37</time>
16
- <contents><target name="magelocal"><dir name="Smilla"><dir name="PostChShippingLabel"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="b28a6d60ecebf1df36a323717630f852"/></dir></dir><dir name="View"><file name="Postchshippinglabel.php" hash="2ba040c5f973d8f5287dbe64e29e3950"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e821c705ee985f2fd6606b724dd999e0"/></dir><dir name="Model"><dir name="Source"><file name="Codeoptions.php" hash="4f73854bde626b90fcfcb568f2931857"/><file name="Formatoptions.php" hash="0dbe915bd42b21f17abbcbfb758dc741"/></dir></dir><dir name="controllers"><file name="PostchshippinglabelController.php" hash="9b83ae915a3cf3b7e5cea5cdde88f085"/></dir><dir name="etc"><file name="config.xml" hash="e8d9455d7111a3bea63ee942f48170b4"/><file name="system.xml" hash="b7f321041ca485bfeea6059da3690b19"/></dir></dir><dir name="RicardoIntegration"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="858a47ef63ab3c30717183ae30df5b54"/></dir><file name="Log.php" hash="a31fd35c41c13932cd096dfd53a0cfb4"/><dir name="Options"><file name="Abstract.php" hash="e7636146ce09f7172a70998ac68a94dc"/></dir><file name="Options.php" hash="b59dd5a984c9c12a296543a0a377c049"/><file name="Productxml.php" hash="0ff6f735f75854bfe91a0d283ebcc72a"/><file name="RicardoIntegrationbackend.php" hash="a4c9dfc16a12688cda604d549c8da6a0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="87e7e45c2581c3d320c2c1c4ad126792"/><file name="Sftp.php" hash="23e40ca497940cc762f5230a4edd1774"/><file name="Xml.php" hash="f00956a0d4fe6cba592b808a34c01f89"/></dir><dir name="Model"><file name="Cron.php" hash="4d733059b3f248c0faca7aff625b00cf"/><dir name="Entity"><file name="Attribute.php" hash="6e449b11ce6a18bdffbc2f982109d899"/></dir><file name="Log.php" hash="98f40c774baf75020b4edac574160550"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="b00f4b299ecd1ff488f227fb93df0e12"/></dir><file name="Log.php" hash="841dcf2f9d488b89b37cd498a5e997da"/></dir><file name="Observer.php" hash="c7fc47483ea0f2c89923ea243d401f37"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LogController.php" hash="7541aeaafd51789e09df8b07528484da"/><file name="RicardointegrationbackendController.php" hash="186dd23afa037d86c931d0b693e9fbb7"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="51cc2c3c5693e3efaefade943d0112ec"/><file name="config.xml" hash="197dc60c3ec9b5ac51774ba499f5b9e0"/><file name="system.xml" hash="a3860eedd89aab0c1edb3662089f37c1"/></dir><dir name="sql"><dir name="attributericardo_setup"><file name="mysql4-install-0.1.0.php" hash="81130e87f55c2e8fe40bc092fad189c7"/></dir><dir name="categoryattributericardo_setup"><file name="mysql4-install-0.1.0.php" hash="877d494dd26214a5dc0f744f0f587e23"/></dir><dir name="logtablericardo_setup"><file name="mysql4-install-0.1.0.php" hash="dc4907e1dda0613903855dd22b093600"/></dir><dir name="productattributericardo_setup"><file name="mysql4-install-0.1.0.php" hash="d06a6879352e9e3d95218d02d0f8a36a"/></dir><dir name="salesattributericardo_setup"><file name="mysql4-install-0.1.0.php" hash="b33c68a4d1873638861da53556251f84"/></dir></dir><dir name="xsd"><file name="orderImport.xsd" hash="8464a2d14f9f1e24524207ffac416bb2"/><file name="productImport.xsd" hash="d7fed24985319a7172ea1e77c78c075a"/></dir></dir><dir name="Sobuintegration"><dir name="Block"><file name="Generatebutton.php" hash="74084f97064fa5806d715ead2ffef14d"/><file name="Share.php" hash="266f41ed10e3e7aca0281ca130e534c1"/></dir><dir name="Helper"><file name="Data.php" hash="42ac5a75aa3b3862a09f0c15d4e1b51e"/></dir><dir name="Model"><dir name="Condition"><file name="Benefit.php" hash="c852f11bad38a4c257c55da1e04800c5"/></dir><file name="Observer.php" hash="caf15474f209dda6d05b051774d46556"/></dir><dir name="controllers"><file name="AdminController.php" hash="d3848d4ed2e3cbb5fa6ff0f78518c43e"/><file name="ShareController.php" hash="e8750a8e9e7689fd1424f23f6c80c98a"/></dir><dir name="etc"><file name="config.xml" hash="3c778cedc46f383fdd1cf5534d016b1c"/><file name="system.xml" hash="9ff2a8916a6d5a61c69dc543858fb0ae"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sobu"><dir name="checkout"><file name="share.phtml" hash="98885793a3bb35964fd64297f8c0f89f"/></dir><dir name="order"><file name="share.phtml" hash="1465ed5efb372a26e9d85b70c8aa5472"/></dir><dir name="sales"><dir name="order"><file name="share.phtml" hash="1b1556f175008a1114fa933cad2500d6"/><file name="totals.phtml" hash="60a502bfd89474dfa57bc799a4f4e504"/></dir></dir><dir name="share"><file name="info.phtml" hash="fdcd922d8f651b11714251ddef64abf9"/><file name="link.phtml" hash="f9f8f4708750fd2852f0d0ec42ceff83"/></dir></dir></dir><dir name="layout"><file name="sobuintegration.xml" hash="139553188e2acb3fe61d9b4d4079e679"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="sobu"><file name="banner_share.png" hash="f5a41a1af0a68d368ab048d138c28e5c"/><file name="banner_share_01.png" hash="045706753e361031b5a93ac38ebe1cfb"/><file name="banner_share_02.png" hash="75857a645c0a81d51975c10df8afd999"/><file name="banner_share_04.png" hash="9246b8dfbaefe3c89ead9d0ab3110fb2"/><file name="banner_share_04_de_CH.png" hash="9246b8dfbaefe3c89ead9d0ab3110fb2"/><file name="banner_share_04_en_US.png" hash="20f56f02dfc8310c9bb5d2fc7a31fab1"/><file name="banner_share_04_fr_FR.png" hash="752b197fad998b2b67cdaadc51cfa1b7"/><file name="banner_share_04_it_CH.png" hash="ff866ad36a170366544fb0fc202ecfe9"/><file name="banner_share_05.png" hash="a6ae54c9e1c7fd1d5f940cf77d8640a3"/><file name="infobanner_de_CH.png" hash="61a07e90f4c73b357efb2bfa478d3e83"/><file name="infobanner_en_US.png" hash="a2b7d488f8a860ddcfaf153b864f5cd2"/><file name="infobanner_fr_FR.png" hash="8b34ce6774dbb17c80b9dfdf32b3897c"/><file name="infobanner_it_CH.png" hash="a6ef1614f657b9cbe56be4e3f8ac4493"/><file name="sobu_image_de_CH.png" hash="be62ec89cb228685809b21b313e2f6e4"/><file name="sobu_image_de_DE.png" hash="be62ec89cb228685809b21b313e2f6e4"/><file name="sobu_image_en_US.png" hash="bf60e9823c3604c5a71a28db6a49d506"/><file name="sobu_image_fr_FR.png" hash="9d5492a4575127c1fe607360baac2de7"/><file name="sobu_image_it_CH.png" hash="8c3a8d776857fdff4e8938280a96d692"/><file name="sobulogo_de_CH.png" hash="fa4206c0e37b7dc3273c281e90e824be"/><file name="sobulogo_de_DE.png" hash="fa4206c0e37b7dc3273c281e90e824be"/><file name="sobulogo_en_US.png" hash="c3ec67330d2fb72e7acc7e7d3ca24640"/><file name="sobulogo_fr_FR.png" hash="c4eb66c697896792e8821f267f23849b"/><file name="sobulogo_it_CH.png" hash="d036e1709bca5d87059224954dce1683"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_CH"><file name="Smilla_Sobuintegration.csv" hash="94fe2a9dc2252dd52546bf6d629f4df7"/></dir><dir name="de_DE"><file name="Smilla_Sobuintegration.csv" hash="94fe2a9dc2252dd52546bf6d629f4df7"/></dir><dir name="en_US"><file name="Smilla_Sobuintegration.csv" hash="d15ddb9d6ab6266654aa5fb36dbc4a2f"/></dir><dir name="fr_FR"><file name="Smilla_Sobuintegration.csv" hash="c018ec8d75f620e140336322fbd5d321"/></dir><dir name="it_CH"><file name="Smilla_Sobuintegration.csv" hash="5b736f3a4463054576d6ecc40d2c278d"/></dir><dir name="it_IT"><file name="Smilla_Sobuintegration.csv" hash="5b736f3a4463054576d6ecc40d2c278d"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smilla_Sobuintegration.xml" hash="fee68335def2e0a2e3974f457ce34b90"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Smilla_Sobuintegration</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
11
  Vorraussetzung ist eine Magento Installation sowie ein g&#xFC;ltiger Vertrag mit der sobu-Plattform. Weitere Informationen dazu finden Sie unter: https://www.sobu.ch/de/partner</description>
12
  <notes>Kleinere Fehlerbehebungen</notes>
13
  <authors><author><name>smilla AG</name><user>smilla</user><email>hendrik.unkenholz@smilla.com</email></author></authors>
14
+ <date>2014-06-26</date>
15
+ <time>11:20:55</time>
16
+ <contents><target name="magelocal"><dir name="Smilla"><dir name="Sobuintegration"><dir name="Block"><file name="Generatebutton.php" hash="74084f97064fa5806d715ead2ffef14d"/><file name="Share.php" hash="266f41ed10e3e7aca0281ca130e534c1"/></dir><dir name="Helper"><file name="Data.php" hash="42ac5a75aa3b3862a09f0c15d4e1b51e"/></dir><dir name="Model"><dir name="Condition"><file name="Benefit.php" hash="c852f11bad38a4c257c55da1e04800c5"/></dir><file name="Observer.php" hash="caf15474f209dda6d05b051774d46556"/></dir><dir name="controllers"><file name="AdminController.php" hash="d3848d4ed2e3cbb5fa6ff0f78518c43e"/><file name="ShareController.php" hash="fd2c481c35c3e05da61d0305284699d5"/></dir><dir name="etc"><file name="config.xml" hash="3c778cedc46f383fdd1cf5534d016b1c"/><file name="system.xml" hash="9ff2a8916a6d5a61c69dc543858fb0ae"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sobu"><dir name="checkout"><file name="share.phtml" hash="98885793a3bb35964fd64297f8c0f89f"/></dir><dir name="order"><file name="share.phtml" hash="1465ed5efb372a26e9d85b70c8aa5472"/></dir><dir name="sales"><dir name="order"><file name="share.phtml" hash="1b1556f175008a1114fa933cad2500d6"/><file name="totals.phtml" hash="60a502bfd89474dfa57bc799a4f4e504"/></dir></dir><dir name="share"><file name="info.phtml" hash="fdcd922d8f651b11714251ddef64abf9"/><file name="link.phtml" hash="f9f8f4708750fd2852f0d0ec42ceff83"/></dir></dir></dir><dir name="layout"><file name="sobuintegration.xml" hash="139553188e2acb3fe61d9b4d4079e679"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="sobu"><file name="banner_share.png" hash="f5a41a1af0a68d368ab048d138c28e5c"/><file name="banner_share_01.png" hash="045706753e361031b5a93ac38ebe1cfb"/><file name="banner_share_02.png" hash="75857a645c0a81d51975c10df8afd999"/><file name="banner_share_04.png" hash="9246b8dfbaefe3c89ead9d0ab3110fb2"/><file name="banner_share_04_de_CH.png" hash="9246b8dfbaefe3c89ead9d0ab3110fb2"/><file name="banner_share_04_en_US.png" hash="20f56f02dfc8310c9bb5d2fc7a31fab1"/><file name="banner_share_04_fr_FR.png" hash="752b197fad998b2b67cdaadc51cfa1b7"/><file name="banner_share_04_it_CH.png" hash="ff866ad36a170366544fb0fc202ecfe9"/><file name="banner_share_05.png" hash="a6ae54c9e1c7fd1d5f940cf77d8640a3"/><file name="infobanner_de_CH.png" hash="61a07e90f4c73b357efb2bfa478d3e83"/><file name="infobanner_en_US.png" hash="a2b7d488f8a860ddcfaf153b864f5cd2"/><file name="infobanner_fr_FR.png" hash="8b34ce6774dbb17c80b9dfdf32b3897c"/><file name="infobanner_it_CH.png" hash="a6ef1614f657b9cbe56be4e3f8ac4493"/><file name="sobu_image_de_CH.png" hash="be62ec89cb228685809b21b313e2f6e4"/><file name="sobu_image_de_DE.png" hash="be62ec89cb228685809b21b313e2f6e4"/><file name="sobu_image_en_US.png" hash="bf60e9823c3604c5a71a28db6a49d506"/><file name="sobu_image_fr_FR.png" hash="9d5492a4575127c1fe607360baac2de7"/><file name="sobu_image_it_CH.png" hash="8c3a8d776857fdff4e8938280a96d692"/><file name="sobulogo_de_CH.png" hash="fa4206c0e37b7dc3273c281e90e824be"/><file name="sobulogo_de_DE.png" hash="fa4206c0e37b7dc3273c281e90e824be"/><file name="sobulogo_en_US.png" hash="c3ec67330d2fb72e7acc7e7d3ca24640"/><file name="sobulogo_fr_FR.png" hash="c4eb66c697896792e8821f267f23849b"/><file name="sobulogo_it_CH.png" hash="d036e1709bca5d87059224954dce1683"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="de_CH"><file name="Smilla_Sobuintegration.csv" hash="94fe2a9dc2252dd52546bf6d629f4df7"/></dir><dir name="de_DE"><file name="Smilla_Sobuintegration.csv" hash="94fe2a9dc2252dd52546bf6d629f4df7"/></dir><dir name="en_US"><file name="Smilla_Sobuintegration.csv" hash="d15ddb9d6ab6266654aa5fb36dbc4a2f"/></dir><dir name="fr_FR"><file name="Smilla_Sobuintegration.csv" hash="c018ec8d75f620e140336322fbd5d321"/></dir><dir name="it_CH"><file name="Smilla_Sobuintegration.csv" hash="5b736f3a4463054576d6ecc40d2c278d"/></dir><dir name="it_IT"><file name="Smilla_Sobuintegration.csv" hash="5b736f3a4463054576d6ecc40d2c278d"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smilla_Sobuintegration.xml" hash="fee68335def2e0a2e3974f457ce34b90"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>