Smilla_Sobuintegration - Version 1.0.2

Version Notes

Kleinere Fehlerbehebungen

Download this release

Release Info

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


Code changes from version 1.0.1 to 1.0.2

Files changed (32) hide show
  1. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log.php +28 -0
  2. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log/Grid.php +69 -0
  3. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Options.php +12 -0
  4. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Options/Abstract.php +71 -0
  5. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Productxml.php +105 -0
  6. app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/RicardoIntegrationbackend.php +5 -0
  7. app/code/local/Smilla/RicardoIntegration/Helper/Data.php +35 -0
  8. app/code/local/Smilla/RicardoIntegration/Helper/Sftp.php +18 -0
  9. app/code/local/Smilla/RicardoIntegration/Helper/Xml.php +43 -0
  10. app/code/local/Smilla/RicardoIntegration/Model/Cron.php +31 -0
  11. app/code/local/Smilla/RicardoIntegration/Model/Entity/Attribute.php +91 -0
  12. app/code/local/Smilla/RicardoIntegration/Model/Log.php +12 -0
  13. app/code/local/Smilla/RicardoIntegration/Model/Mysql4/Log.php +8 -0
  14. app/code/local/Smilla/RicardoIntegration/Model/Mysql4/Log/Collection.php +12 -0
  15. app/code/local/Smilla/RicardoIntegration/Model/Observer.php +12 -0
  16. app/code/local/Smilla/RicardoIntegration/controllers/Adminhtml/LogController.php +140 -0
  17. app/code/local/Smilla/RicardoIntegration/controllers/Adminhtml/RicardointegrationbackendController.php +174 -0
  18. app/code/local/Smilla/RicardoIntegration/etc/adminhtml.xml +23 -0
  19. app/code/local/Smilla/RicardoIntegration/etc/config.xml +241 -0
  20. app/code/local/Smilla/RicardoIntegration/etc/system.xml +94 -0
  21. app/code/local/Smilla/RicardoIntegration/sql/attributericardo_setup/mysql4-install-0.1.0.php +13 -0
  22. app/code/local/Smilla/RicardoIntegration/sql/categoryattributericardo_setup/mysql4-install-0.1.0.php +29 -0
  23. app/code/local/Smilla/RicardoIntegration/sql/logtablericardo_setup/mysql4-install-0.1.0.php +19 -0
  24. app/code/local/Smilla/RicardoIntegration/sql/productattributericardo_setup/mysql4-install-0.1.0.php +25 -0
  25. app/code/local/Smilla/RicardoIntegration/sql/salesattributericardo_setup/mysql4-install-0.1.0.php +11 -0
  26. app/code/local/Smilla/RicardoIntegration/xsd/orderImport.xsd +219 -0
  27. app/code/local/Smilla/RicardoIntegration/xsd/productImport.xsd +132 -0
  28. app/code/local/Smilla/Sobuintegration/Model/Observer.php +73 -73
  29. app/code/local/Smilla/Sobuintegration/controllers/ShareController.php +0 -11
  30. app/design/frontend/base/default/template/sobu/order/share.phtml +3 -3
  31. app/etc/modules/Smilla_Sobuintegration.xml +1 -1
  32. package.xml +5 -5
app/code/local/Smilla/RicardoIntegration/Block/Adminhtml/Log.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
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 ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/Model/Observer.php CHANGED
@@ -1,74 +1,74 @@
1
- <?php
2
- class Smilla_Sobuintegration_Model_Observer
3
- {
4
-
5
- public function __construct()
6
- {
7
-
8
- }
9
-
10
- /**
11
- * Event: salesrule_rule_condition_combine
12
- *
13
- * @param $observer
14
- */
15
- public function addConditionToSalesRule($observer)
16
- {
17
-
18
- $additional = $observer->getAdditional();
19
- $conditions = (array)$additional->getConditions();
20
-
21
- $conditions = array_merge_recursive($conditions, array(
22
- array('label' => Mage::helper('sobuintegration')->__('sobu Benefit'), 'value' => 'sobuintegration/condition_benefit'),
23
- ));
24
-
25
- $additional->setConditions($conditions);
26
- $observer->setAdditional($additional);
27
-
28
- return $observer;
29
- }
30
-
31
- /**
32
- * Register Sale to Sobu
33
- *
34
- * @param $observer
35
- * @return boolean
36
- */
37
- public function registerSobuSale(Varien_Event_Observer $observer)
38
- {
39
- $order = $observer->getEvent()->getOrder();
40
- $clickId = (int) Mage::getSingleton('core/session')->getSobuClickId();
41
-
42
- // Sobu ClickId exists?
43
- if ($clickId > 0) {
44
- // Register Sale (Server-2-Server)
45
- $api_url = 'https://www.sobu.ch/register';
46
- $postdata = array(
47
- 'apiKey' => Mage::helper('sobuintegration/data')->getApiKey(),
48
- 'orderId' => $order->getRealOrderId(),
49
- 'total' => Mage::helper('sobuintegration/data')->getTotal($order),
50
- 'signature' => Mage::helper('sobuintegration/data')->getDigitalSignature(($order->getRealOrderId()).'#'.Mage::helper('sobuintegration/data')->getTotal($order)),
51
- 'clickId' => $clickId,
52
- );
53
-
54
- $ch = curl_init($api_url);
55
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
56
- curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postdata));
57
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
58
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
59
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
60
- $result = json_decode(curl_exec($ch));
61
- curl_close($ch);
62
- if($result->isError){
63
- // Error sending Requ est
64
- } else {
65
- // Remove Session Data
66
- Mage::getSingleton('core/session')->unsSobuClickId();
67
- Mage::getSingleton('core/session')->unsSobuVoucherCode();
68
- }
69
-
70
- }
71
-
72
- return true;
73
- }
74
  }
1
+ <?php
2
+ class Smilla_Sobuintegration_Model_Observer
3
+ {
4
+
5
+ public function __construct()
6
+ {
7
+
8
+ }
9
+
10
+ /**
11
+ * Event: salesrule_rule_condition_combine
12
+ *
13
+ * @param $observer
14
+ */
15
+ public function addConditionToSalesRule($observer)
16
+ {
17
+
18
+ $additional = $observer->getAdditional();
19
+ $conditions = (array)$additional->getConditions();
20
+
21
+ $conditions = array_merge_recursive($conditions, array(
22
+ array('label' => Mage::helper('sobuintegration')->__('sobu Benefit'), 'value' => 'sobuintegration/condition_benefit'),
23
+ ));
24
+
25
+ $additional->setConditions($conditions);
26
+ $observer->setAdditional($additional);
27
+
28
+ return $observer;
29
+ }
30
+
31
+ /**
32
+ * Register Sale to Sobu
33
+ *
34
+ * @param $observer
35
+ * @return boolean
36
+ */
37
+ public function registerSobuSale(Varien_Event_Observer $observer)
38
+ {
39
+ $order = $observer->getEvent()->getOrder();
40
+ $clickId = (int) Mage::getSingleton('core/session')->getSobuClickId();
41
+
42
+ // Sobu ClickId exists?
43
+ if ($clickId > 0) {
44
+ // Register Sale (Server-2-Server)
45
+ $api_url = 'https://www.sobu.ch/register';
46
+ $postdata = array(
47
+ 'apiKey' => Mage::helper('sobuintegration/data')->getApiKey(),
48
+ 'orderId' => $order->getRealOrderId(),
49
+ 'total' => Mage::helper('sobuintegration/data')->getTotal($order),
50
+ 'signature' => Mage::helper('sobuintegration/data')->getDigitalSignature(($order->getRealOrderId()).'#'.Mage::helper('sobuintegration/data')->getTotal($order)),
51
+ 'clickId' => $clickId,
52
+ );
53
+
54
+ $ch = curl_init($api_url);
55
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
56
+ curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postdata));
57
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
58
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
59
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
60
+ $result = json_decode(curl_exec($ch));
61
+ curl_close($ch);
62
+ if($result->isError){
63
+ // Error sending Requ est
64
+ } else {
65
+ // Remove Session Data
66
+ Mage::getSingleton('core/session')->unsSobuClickId();
67
+ Mage::getSingleton('core/session')->unsSobuVoucherCode();
68
+ }
69
+
70
+ }
71
+
72
+ return true;
73
+ }
74
  }
app/code/local/Smilla/Sobuintegration/controllers/ShareController.php CHANGED
@@ -5,20 +5,9 @@ class Smilla_Sobuintegration_ShareController extends Mage_Core_Controller_Front_
5
  public function orderAction()
6
  {
7
 
8
- $loginUrl = Mage::helper('customer')->getLoginUrl();
9
- if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {
10
- $this->setFlag('', self::FLAG_NO_DISPATCH, true);
11
- }
12
-
13
  $this->loadLayout();
14
  $this->order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
15
 
16
- if (!$this->_canViewOrder($this->order)) {
17
- // Not authorized for this order
18
- $this->_redirect('customer/account');
19
- }
20
-
21
-
22
  $this->renderLayout();
23
 
24
  }
5
  public function orderAction()
6
  {
7
 
 
 
 
 
 
8
  $this->loadLayout();
9
  $this->order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
10
 
 
 
 
 
 
 
11
  $this->renderLayout();
12
 
13
  }
app/design/frontend/base/default/template/sobu/order/share.phtml CHANGED
@@ -6,9 +6,9 @@
6
  </p>
7
 
8
  <form name="publish" method="POST" action="<?php echo $this->__('https://www.sobu.ch/publish') ?>">
9
- <input type="hidden" name="apiKey" value="<?=$this->getApiKey() ?>"/>
10
- <input type="hidden" name="order" value='<?=$orderdata = $this->getOrderData() ?>'/>
11
- <input type="hidden" name="signature" value="<?=$this->getSignatureData($orderdata) ?>"/>
12
  </form>
13
 
14
  <script type="text/javascript">
6
  </p>
7
 
8
  <form name="publish" method="POST" action="<?php echo $this->__('https://www.sobu.ch/publish') ?>">
9
+ <input type="hidden" name="apiKey" value="<?php echo $this->getApiKey() ?>"/>
10
+ <input type="hidden" name="order" value='<?php echo $orderdata = $this->getOrderData() ?>'/>
11
+ <input type="hidden" name="signature" value="<?php echo $this->getSignatureData($orderdata) ?>"/>
12
  </form>
13
 
14
  <script type="text/javascript">
app/etc/modules/Smilla_Sobuintegration.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Smilla_Sobuintegration>
5
- <active>true</active>
6
  <codePool>local</codePool>
7
  </Smilla_Sobuintegration>
8
  </modules>
2
  <config>
3
  <modules>
4
  <Smilla_Sobuintegration>
5
+ <active>false</active>
6
  <codePool>local</codePool>
7
  </Smilla_Sobuintegration>
8
  </modules>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Smilla_Sobuintegration</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -9,11 +9,11 @@
9
  <summary>Integrieren Sie Ihren Shop in das sobu Netzwerk. K&#xE4;ufe Teilen, Sobu Rabatte uvm. </summary>
10
  <description>Durch die sobu Magento Extension ist es m&#xF6;glich einen Magento-Shop in das sobu Netzwerk zu integrieren.&#xD;
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>sobu Integration 1.0.1</notes>
13
  <authors><author><name>smilla AG</name><user>smilla</user><email>hendrik.unkenholz@smilla.com</email></author></authors>
14
- <date>2013-12-11</date>
15
- <time>16:03:39</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="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="7eb0a0bbc1ea135e53d44dce5b4f5a6c"/></dir><dir name="Model"><dir name="Condition"><file name="Benefit.php" hash="c852f11bad38a4c257c55da1e04800c5"/></dir><file name="Observer.php" hash="afa3c81370d7ee271362aff6616c0639"/></dir><dir name="controllers"><file name="AdminController.php" hash="d3848d4ed2e3cbb5fa6ff0f78518c43e"/><file name="ShareController.php" hash="b1370bd7f9ef6b77ca17a171d9368b44"/></dir><dir name="etc"><file name="config.xml" hash="3c778cedc46f383fdd1cf5534d016b1c"/><file name="system.xml" hash="b0a2f556320269272b4759da27c2564a"/></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="bd0d269349d162b1c81d7e5ac05de26d"/></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="2e3e0c02b2e3366d7ff4db018a8b728c"/></dir><dir name="de_DE"><file name="Smilla_Sobuintegration.csv" hash="2e3e0c02b2e3366d7ff4db018a8b728c"/></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.2</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
9
  <summary>Integrieren Sie Ihren Shop in das sobu Netzwerk. K&#xE4;ufe Teilen, Sobu Rabatte uvm. </summary>
10
  <description>Durch die sobu Magento Extension ist es m&#xF6;glich einen Magento-Shop in das sobu Netzwerk zu integrieren.&#xD;
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-05-13</date>
15
+ <time>17:02:53</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="7eb0a0bbc1ea135e53d44dce5b4f5a6c"/></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="4052f2454f69e8f48f252b9613f77611"/></dir><dir name="etc"><file name="config.xml" hash="3c778cedc46f383fdd1cf5534d016b1c"/><file name="system.xml" hash="b0a2f556320269272b4759da27c2564a"/></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="2e3e0c02b2e3366d7ff4db018a8b728c"/></dir><dir name="de_DE"><file name="Smilla_Sobuintegration.csv" hash="2e3e0c02b2e3366d7ff4db018a8b728c"/></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="efb9060a1842749c0bc74eb30bdec8b8"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>