Ecomwise_Mshop - Version 2.1.3

Version Notes

2.1.3

Download this release

Release Info

Developer EcomwiseTeam
Extension Ecomwise_Mshop
Version 2.1.3
Comparing to
See all releases


Version 2.1.3

Files changed (48) hide show
  1. app/code/community/Ecomwise/Mshop/Block/Adminhtml/Api/Tab/Rolesedit.php +27 -0
  2. app/code/community/Ecomwise/Mshop/Block/Adminhtml/Catalog/Product/Edit/Tab/Inventory.php +11 -0
  3. app/code/community/Ecomwise/Mshop/Block/Adminhtml/Catalog/Product/Edit/Tabs.php +166 -0
  4. app/code/community/Ecomwise/Mshop/Block/Adminhtml/Catalog/Product/Price/Tier.php +8 -0
  5. app/code/community/Ecomwise/Mshop/Block/Adminhtml/Sales/Invoice/View.php +24 -0
  6. app/code/community/Ecomwise/Mshop/Block/Product/Price.php +63 -0
  7. app/code/community/Ecomwise/Mshop/Block/System/Config/Version.php +7 -0
  8. app/code/community/Ecomwise/Mshop/Helper/Data.php +5 -0
  9. app/code/community/Ecomwise/Mshop/Helper/Product.php +135 -0
  10. app/code/community/Ecomwise/Mshop/Model/Api/Server/Adapter/Soap.php +70 -0
  11. app/code/community/Ecomwise/Mshop/Model/Api/Server/V2/Adapter/Soap.php +49 -0
  12. app/code/community/Ecomwise/Mshop/Model/Catalog/Api.php +367 -0
  13. app/code/community/Ecomwise/Mshop/Model/Catalog/Api/V2.php +1217 -0
  14. app/code/community/Ecomwise/Mshop/Model/Catalog/Attribute/Api.php +465 -0
  15. app/code/community/Ecomwise/Mshop/Model/Catalog/Attribute/Api/V2.php +5 -0
  16. app/code/community/Ecomwise/Mshop/Model/Catalog/Attribute/Tierprice.php +105 -0
  17. app/code/community/Ecomwise/Mshop/Model/Catalog/Category/Api.php +5 -0
  18. app/code/community/Ecomwise/Mshop/Model/Catalog/Category/Api/V2.php +87 -0
  19. app/code/community/Ecomwise/Mshop/Model/Catalog/Product/Api/V2.php +250 -0
  20. app/code/community/Ecomwise/Mshop/Model/Catalog/Product/Type/Price.php +84 -0
  21. app/code/community/Ecomwise/Mshop/Model/Config/Source/Orderattributes.php +28 -0
  22. app/code/community/Ecomwise/Mshop/Model/Customer/Api/V2.php +35 -0
  23. app/code/community/Ecomwise/Mshop/Model/Observer.php +34 -0
  24. app/code/community/Ecomwise/Mshop/Model/Resource/Eav/Tierprice.php +41 -0
  25. app/code/community/Ecomwise/Mshop/Model/Sales/Api/V2.php +1538 -0
  26. app/code/community/Ecomwise/Mshop/Model/System/Config/Apply.php +22 -0
  27. app/code/community/Ecomwise/Mshop/Model/Utility/Api.php +284 -0
  28. app/code/community/Ecomwise/Mshop/Model/Utility/Api/V2.php +130 -0
  29. app/code/community/Ecomwise/Mshop/etc/api.xml +829 -0
  30. app/code/community/Ecomwise/Mshop/etc/config.xml +145 -0
  31. app/code/community/Ecomwise/Mshop/etc/system.xml +305 -0
  32. app/code/community/Ecomwise/Mshop/etc/wsdl.xml +2928 -0
  33. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-install-2.0.1.php +17 -0
  34. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.10-2.1.0.php +16 -0
  35. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.3-2.0.4.php +9 -0
  36. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.4-2.0.5.php +7 -0
  37. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.5-2.0.6.php +7 -0
  38. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.6-2.0.7.php +367 -0
  39. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.7-2.0.8.php +106 -0
  40. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.8-2.0.9.php +7 -0
  41. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.9-2.0.10.php +7 -0
  42. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.1.0-2.1.1.php +50 -0
  43. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.1.1-2.1.2.php +8 -0
  44. app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.1.2-2.1.3.php +24 -0
  45. app/design/adminhtml/default/default/template/catalog/product/edit/price/tier_plus.phtml +182 -0
  46. app/design/adminhtml/default/default/template/catalog/product/tab/inventory_plus.phtml +48 -0
  47. app/etc/modules/Ecomwise_Mshop.xml +10 -0
  48. package.xml +18 -0
app/code/community/Ecomwise/Mshop/Block/Adminhtml/Api/Tab/Rolesedit.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Block_Adminhtml_Api_Tab_Rolesedit extends Mage_Adminhtml_Block_Api_Tab_Rolesedit {
3
+
4
+ public function __construct() {
5
+ parent::__construct();
6
+
7
+ $rid = Mage::app()->getRequest()->getParam('rid', false);
8
+
9
+ $resources = Mage::getModel('api/roles')->getResourcesList();
10
+
11
+ $rules_set = Mage::getResourceModel('api/rules_collection')->getByRoles($rid)->load();
12
+
13
+ $selrids = array();
14
+
15
+ foreach ($rules_set->getItems() as $item) {
16
+ if (array_key_exists(strtolower($item->getResource_id()), $resources) && $item->getApiPermission() == 'allow') {
17
+ $resources[$item->getResource_id()]['checked'] = true;
18
+ array_push($selrids, $item->getResource_id());
19
+ }
20
+ }
21
+
22
+ $this->setSelectedResources($selrids);
23
+
24
+ $this->setTemplate('api/rolesedit.phtml');
25
+ }
26
+ }
27
+ ?>
app/code/community/Ecomwise/Mshop/Block/Adminhtml/Catalog/Product/Edit/Tab/Inventory.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Block_Adminhtml_Catalog_Product_Edit_Tab_Inventory extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Inventory{
3
+
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->setTemplate('catalog/product/tab/inventory_plus.phtml');
8
+ }
9
+
10
+
11
+ }
app/code/community/Ecomwise/Mshop/Block/Adminhtml/Catalog/Product/Edit/Tabs.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Block_Adminhtml_Catalog_Product_Edit_Tabs extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs{
3
+
4
+ protected function _prepareLayout()
5
+ {
6
+
7
+ $product = $this->getProduct();
8
+
9
+ if (!($setId = $product->getAttributeSetId())) {
10
+ $setId = $this->getRequest()->getParam('set', null);
11
+ }
12
+
13
+ if ($setId) {
14
+ $groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')
15
+ ->setAttributeSetFilter($setId);
16
+ if(version_compare(Mage::getVersion(), "1.6.0.0", ">=")) {
17
+ $groupCollection->setSortOrder();
18
+ }
19
+
20
+ $groupCollection->load();
21
+
22
+ foreach ($groupCollection as $group) {
23
+ $attributes = $product->getAttributes($group->getId(), true);
24
+ // do not add groups without attributes
25
+
26
+ //Zend_Debug::dump($attributes); exit();
27
+
28
+ foreach ($attributes as $key => $attribute) {
29
+ if($attribute->getAttributeCode() == 'mamut_future_stock'){
30
+ unset($attributes[$key]);
31
+ }
32
+
33
+ if( !$attribute->getIsVisible() ) {
34
+ unset($attributes[$key]);
35
+ }
36
+ }
37
+
38
+ if (count($attributes)==0) {
39
+ continue;
40
+ }
41
+
42
+ $this->addTab('group_'.$group->getId(), array(
43
+ 'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
44
+ 'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(),
45
+ 'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)
46
+ ->setGroupAttributes($attributes)
47
+ ->toHtml()),
48
+ ));
49
+ }
50
+
51
+ if (Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) {
52
+
53
+ $content = $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_inventory')->toHtml();
54
+ //if(Mage::getStoreConfig("mshop/mamut_stock/show_fields") == "1"){
55
+ $content .= $this->getLayout()->createBlock('mshop/adminhtml_catalog_product_edit_tab_inventory')->toHtml();
56
+ //}
57
+ $this->addTab('inventory', array(
58
+ 'label' => Mage::helper('catalog')->__('Inventory'),
59
+ 'content' =>$this->_translateHtml($content)
60
+ ));
61
+ }
62
+
63
+ /**
64
+ * Don't display website tab for single mode
65
+ */
66
+ if (!Mage::app()->isSingleStoreMode()) {
67
+ $this->addTab('websites', array(
68
+ 'label' => Mage::helper('catalog')->__('Websites'),
69
+ 'content' => $this->_translateHtml($this->getLayout()
70
+ ->createBlock('adminhtml/catalog_product_edit_tab_websites')->toHtml()),
71
+ ));
72
+ }
73
+
74
+ $this->addTab('categories', array(
75
+ 'label' => Mage::helper('catalog')->__('Categories'),
76
+ 'url' => $this->getUrl('*/*/categories', array('_current' => true)),
77
+ 'class' => 'ajax',
78
+ ));
79
+
80
+ $this->addTab('related', array(
81
+ 'label' => Mage::helper('catalog')->__('Related Products'),
82
+ 'url' => $this->getUrl('*/*/related', array('_current' => true)),
83
+ 'class' => 'ajax',
84
+ ));
85
+
86
+ $this->addTab('upsell', array(
87
+ 'label' => Mage::helper('catalog')->__('Up-sells'),
88
+ 'url' => $this->getUrl('*/*/upsell', array('_current' => true)),
89
+ 'class' => 'ajax',
90
+ ));
91
+
92
+ $this->addTab('crosssell', array(
93
+ 'label' => Mage::helper('catalog')->__('Cross-sells'),
94
+ 'url' => $this->getUrl('*/*/crosssell', array('_current' => true)),
95
+ 'class' => 'ajax',
96
+ ));
97
+
98
+ $storeId = 0;
99
+ if ($this->getRequest()->getParam('store')) {
100
+ $storeId = Mage::app()->getStore($this->getRequest()->getParam('store'))->getId();
101
+ }
102
+
103
+ $alertPriceAllow = Mage::getStoreConfig('catalog/productalert/allow_price');
104
+ $alertStockAllow = Mage::getStoreConfig('catalog/productalert/allow_stock');
105
+
106
+ if (($alertPriceAllow || $alertStockAllow) && !$product->isGrouped()) {
107
+ $this->addTab('productalert', array(
108
+ 'label' => Mage::helper('catalog')->__('Product Alerts'),
109
+ 'content' => $this->_translateHtml($this->getLayout()
110
+ ->createBlock('adminhtml/catalog_product_edit_tab_alerts', 'admin.alerts.products')->toHtml())
111
+ ));
112
+ }
113
+
114
+ if( $this->getRequest()->getParam('id', false) ) {
115
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
116
+ if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/reviews_ratings')){
117
+ $this->addTab('reviews', array(
118
+ 'label' => Mage::helper('catalog')->__('Product Reviews'),
119
+ 'url' => $this->getUrl('*/*/reviews', array('_current' => true)),
120
+ 'class' => 'ajax',
121
+ ));
122
+ }
123
+ }
124
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_Tag')) {
125
+ if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/tag')){
126
+ $this->addTab('tags', array(
127
+ 'label' => Mage::helper('catalog')->__('Product Tags'),
128
+ 'url' => $this->getUrl('*/*/tagGrid', array('_current' => true)),
129
+ 'class' => 'ajax',
130
+ ));
131
+
132
+ $this->addTab('customers_tags', array(
133
+ 'label' => Mage::helper('catalog')->__('Customers Tagged Product'),
134
+ 'url' => $this->getUrl('*/*/tagCustomerGrid', array('_current' => true)),
135
+ 'class' => 'ajax',
136
+ ));
137
+ }
138
+ }
139
+
140
+ }
141
+
142
+ /**
143
+ * Do not change this tab id
144
+ * @see Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable
145
+ * @see Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs
146
+ */
147
+ if (!$product->isGrouped()) {
148
+ $this->addTab('customer_options', array(
149
+ 'label' => Mage::helper('catalog')->__('Custom Options'),
150
+ 'url' => $this->getUrl('*/*/options', array('_current' => true)),
151
+ 'class' => 'ajax',
152
+ ));
153
+ }
154
+
155
+ }
156
+ else {
157
+ $this->addTab('set', array(
158
+ 'label' => Mage::helper('catalog')->__('Settings'),
159
+ 'content' => $this->_translateHtml($this->getLayout()
160
+ ->createBlock('adminhtml/catalog_product_edit_tab_settings')->toHtml()),
161
+ 'active' => true
162
+ ));
163
+ }
164
+ }
165
+
166
+ }
app/code/community/Ecomwise/Mshop/Block/Adminhtml/Catalog/Product/Price/Tier.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Block_Adminhtml_Catalog_Product_Price_Tier extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier{
3
+
4
+ public function __construct()
5
+ {
6
+ $this->setTemplate('catalog/product/edit/price/tier_plus.phtml');
7
+ }
8
+ }
app/code/community/Ecomwise/Mshop/Block/Adminhtml/Sales/Invoice/View.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecomwise_Mshop_Block_Adminhtml_Sales_Invoice_View extends Mage_Adminhtml_Block_Sales_Order_Invoice_View{
4
+
5
+ public function getHeaderText()
6
+ {
7
+ if ($this->getInvoice()->getEmailSent()) {
8
+ $emailSent = Mage::helper('sales')->__('the invoice email was sent');
9
+ }
10
+ else {
11
+ $emailSent = Mage::helper('sales')->__('the invoice email is not sent');
12
+ }
13
+
14
+ $mamut_id = $this->getInvoice()->getmamutInvoiceId();
15
+
16
+ if($mamut_id != null){
17
+ $mamut_string = " | Mamut Invoice id: #".$mamut_id;
18
+ }else{
19
+ $mamut_string = '';
20
+ }
21
+ return Mage::helper('sales')->__('Invoice #%1$s | %2$s | %4$s (%3$s) ', $this->getInvoice()->getIncrementId(), $this->getInvoice()->getStateName(), $emailSent, $this->formatDate($this->getInvoice()->getCreatedAtDate(), 'medium', true)).$mamut_string;
22
+ }
23
+
24
+ }
app/code/community/Ecomwise/Mshop/Block/Product/Price.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Block_Product_Price extends Mage_Catalog_Block_Product_Price{
3
+
4
+ public function getTierPrices($product = null)
5
+ {
6
+ if (is_null($product)) {
7
+ $product = $this->getProduct();
8
+ }
9
+ $prices = $product->getFormatedTierPrice();
10
+
11
+ $res = array();
12
+ if (is_array($prices)) {
13
+ foreach ($prices as $price) {
14
+ $price['price_qty'] = $price['price_qty']*1;
15
+ $price_type = $price['tier_type'];
16
+
17
+ if ($product->getPrice() != $product->getFinalPrice()) {
18
+ $productPrice = $product->getFinalPrice();
19
+ } else {
20
+ $productPrice = $product->getPrice();
21
+ }
22
+
23
+ if($price_type == 1 && $price['price'] < 100){
24
+
25
+ $price['price'] = $productPrice - ($productPrice * $price['price'])/100 ;
26
+ $price['website_price'] = $price['price'];
27
+ }
28
+
29
+ if ($price['price'] < $productPrice) {
30
+ $price['savePercent'] = ceil(100 - (( 100/$productPrice ) * $price['price'] ));
31
+
32
+ $tierPrice = Mage::app()->getStore()->convertPrice(
33
+ Mage::helper('tax')->getPrice($product, $price['website_price'])
34
+ );
35
+ $price['formated_price'] = Mage::app()->getStore()->formatPrice($tierPrice);
36
+ $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(
37
+ Mage::app()->getStore()->convertPrice(
38
+ Mage::helper('tax')->getPrice($product, $price['website_price'], true)
39
+ )
40
+ );
41
+
42
+ if (Mage::helper('catalog')->canApplyMsrp($product)) {
43
+ $oldPrice = $product->getFinalPrice();
44
+ $product->setPriceCalculation(false);
45
+ $product->setPrice($tierPrice);
46
+ $product->setFinalPrice($tierPrice);
47
+
48
+ $this->getLayout()->getBlock('product.info')->getPriceHtml($product);
49
+ $product->setPriceCalculation(true);
50
+
51
+ $price['real_price_html'] = $product->getRealPriceHtml();
52
+ $product->setFinalPrice($oldPrice);
53
+ }
54
+
55
+ $res[] = $price;
56
+ }
57
+
58
+ }
59
+ }
60
+
61
+ return $res;
62
+ }
63
+ }
app/code/community/Ecomwise/Mshop/Block/System/Config/Version.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Block_System_Config_Version extends Mage_Adminhtml_Block_System_Config_Form_Field{
3
+
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element){
5
+ return (string) "v".Mage::getConfig()->getNode()->modules->Ecomwise_Mshop->version;
6
+ }
7
+ }
app/code/community/Ecomwise/Mshop/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/Ecomwise/Mshop/Helper/Product.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Helper_Product extends Mage_Catalog_Helper_Product{
3
+
4
+ public function getProduct($productId, $store, $identifierType = null) {
5
+ $loadByIdOnFalse = false;
6
+ if ($identifierType == null) {
7
+ if ((is_string($productId) && !preg_match("/^[+-]?[1-9][0-9]*$|^0$/", $productId))
8
+ ||($product = Mage::getModel('catalog/product')->loadByAttribute('sku', $productId)) ) {
9
+ $identifierType = 'sku';
10
+ $loadByIdOnFalse = true;
11
+ } else {
12
+ $identifierType = 'id';
13
+ }
14
+ }
15
+
16
+ $product = Mage::getModel('catalog/product');
17
+ if ($store !== null) {
18
+ $product->setStoreId($store);
19
+ }
20
+
21
+ if ($identifierType == 'sku') {
22
+ $idBySku = $product->getIdBySku($productId);
23
+ if ($idBySku) {
24
+ $productId = $idBySku;
25
+ $loadByIdOnFalse = true;
26
+ }
27
+ if ($loadByIdOnFalse) {
28
+ $identifierType = 'id';
29
+ }
30
+ }
31
+
32
+ if ($identifierType == 'id' && is_numeric($productId)) {
33
+ $productId = !is_float($productId) ? (int) $productId : 0;
34
+ $product->load($productId);
35
+ }
36
+
37
+ return $product;
38
+ }
39
+
40
+
41
+ public function addImages(){
42
+ $result = true;
43
+ $dirPath = Mage::getBaseDir('var')."/import/mshop/images";
44
+ $dirTempPath = Mage::getBaseDir('var')."/import/mshop/temp";
45
+ if(!is_dir($dirTempPath)){
46
+ mkdir($dirTempPath,0777,true);
47
+ }
48
+
49
+ $logFile = Mage::getBaseDir('var')."/import/mshop/images/uploaded_images.csv";
50
+
51
+
52
+ if (is_dir($dirPath)) {
53
+ $product_images = array();
54
+ $d=dir($dirPath);
55
+ Mage::app()->setCurrentStore(0);
56
+ while($file = $d->read()) {
57
+ set_time_limit (15);
58
+ if ($file == '.' || $file == '..'){
59
+ continue;
60
+ }
61
+
62
+ $pos = strrpos($file, '.');
63
+ $fileName = substr($file,0,$pos);
64
+ $fileType = substr($file,$pos);
65
+ $productId = '';
66
+
67
+ $product_sku = str_replace("__backslash__", "\\", $fileName);
68
+ $product_sku = str_replace("__slash__", "/", $product_sku);
69
+ $product_sku = (in_array(substr($product_sku, -2 ),array('_1','_2', '_3', '_4', '_5', '_6', '_7', '_8', '_9'))) ? substr($product_sku, 0, -2) : $product_sku;
70
+
71
+ $product_images[$product_sku][] = $file;
72
+
73
+ }
74
+ $str = "The following images have been uploaded:\n";
75
+ foreach($product_images as $sku => $pimgs){
76
+ set_time_limit (30);
77
+ $product = Mage::getModel("catalog/product")->loadByAttribute('sku', $sku);
78
+ if($product){
79
+ //get media attribute for deleting puprpose
80
+ $product = Mage::getModel("catalog/product")->load($product->getId());
81
+ $attributes = $product->getTypeInstance(true)->getSetAttributes($product);
82
+ $media = $attributes['media_gallery'];
83
+ foreach ($product->getMediaGalleryImages() as $image) {
84
+ if ($media->getBackend ()->getImage ( $product, $image['file'])) {
85
+ $media->getBackend ()->removeImage ($product, $image['file']);
86
+ }
87
+ }
88
+ $product->save();
89
+ foreach($pimgs as $file){
90
+ $pos = strpos($file, '.');
91
+
92
+ $fileName = substr($file,0,$pos);
93
+ $default = (in_array(substr($fileName, -2 ),array('_1','_2', '_3', '_4', '_5', '_6', '_7', '_8', '_9'))) ? null : array('image', 'small_image','thumbnail');
94
+
95
+ if($product->getImage() == 'no_selection' && $default == null){
96
+ $default = array('image', 'small_image','thumbnail');
97
+ }
98
+
99
+ $product->addImageToMediaGallery ($dirPath."/".$file, $default, false, false);
100
+ $str .= $file.";\n";
101
+
102
+ exec('cp -rf '.dirname($dirPath).'/images/'.$file.' '.dirname($dirPath).'/temp/'.$file.'');
103
+ unlink(dirname($dirPath)."/images/".$file);
104
+
105
+ $resource = Mage::getSingleton('core/resource');
106
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
107
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
108
+ $table = $resource->getTableName('catalog_product_entity_varchar');
109
+ $attrImageId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','image');
110
+ $attrSmallImageId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','small_image');
111
+ $attrThumbnailId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','thumbnail');
112
+ $q = $cw->query("DELETE FROM ".$table." WHERE entity_id=".$product->getId()." AND attribute_id IN (".$attrImageId.",".$attrSmallImageId.",".$attrThumbnailId.") AND store_id>0 AND (value LIKE '%".$fileName."%' OR value='no_selection')");
113
+
114
+ }
115
+ $product->save();
116
+
117
+ }
118
+ }
119
+
120
+ $fp = fopen($logFile, 'w');
121
+ fwrite($fp, $str);
122
+ fclose($fp);
123
+ $result = true;
124
+
125
+ }else{
126
+ $result = false;
127
+ }
128
+
129
+ return $result;
130
+ }
131
+ }
132
+
133
+
134
+
135
+
app/code/community/Ecomwise/Mshop/Model/Api/Server/Adapter/Soap.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecomwise_Mshop_Model_Api_Server_Adapter_Soap extends Mage_Api_Model_Server_Adapter_Soap
4
+ {
5
+ /*This method is overriding in order to set proper charset
6
+ * added 'true' parameter to setHeader()
7
+ * */
8
+ public function run()
9
+ {
10
+ $apiConfigCharset = Mage::getStoreConfig("api/config/charset");
11
+
12
+ if ($this->getController()->getRequest()->getParam('wsdl') !== null) {
13
+ // Generating wsdl content from template
14
+ $io = new Varien_Io_File();
15
+ $io->open(array('path'=>Mage::getModuleDir('etc', 'Mage_Api')));
16
+
17
+ $wsdlContent = $io->read('wsdl.xml');
18
+
19
+ $template = Mage::getModel('core/email_template_filter');
20
+
21
+ $wsdlConfig = new Varien_Object();
22
+ $queryParams = $this->getController()->getRequest()->getQuery();
23
+ if (isset($queryParams['wsdl'])) {
24
+ unset($queryParams['wsdl']);
25
+ }
26
+
27
+ $wsdlConfig->setUrl(
28
+ htmlspecialchars(Mage::getUrl('*/*/*', array('_query'=>$queryParams) ))
29
+ );
30
+ $wsdlConfig->setName('Magento');
31
+ $wsdlConfig->setHandler($this->getHandler());
32
+
33
+ $template->setVariables(array('wsdl'=>$wsdlConfig));
34
+
35
+
36
+ $this->getController()->getResponse()
37
+ ->clearHeaders()
38
+ ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true)
39
+ ->setBody(
40
+ preg_replace(
41
+ '/<\?xml version="([^\"]+)"([^\>]+)>/i',
42
+ '<?xml version="$1" encoding="'.$apiConfigCharset.'"?>',
43
+ $template->filter($wsdlContent)
44
+ )
45
+ );
46
+ } else {
47
+ try {
48
+ $this->_instantiateServer();
49
+
50
+ $this->getController()->getResponse()
51
+ ->clearHeaders()
52
+ ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true)
53
+ ->setBody(
54
+ preg_replace(
55
+ '/<\?xml version="([^\"]+)"([^\>]+)>/i',
56
+ '<?xml version="$1" encoding="'.$apiConfigCharset.'"?>',
57
+ $this->_soap->handle()
58
+ )
59
+ );
60
+ } catch( Zend_Soap_Server_Exception $e ) {
61
+ $this->fault( $e->getCode(), $e->getMessage() );
62
+ } catch( Exception $e ) {
63
+ $this->fault( $e->getCode(), $e->getMessage() );
64
+ }
65
+ }
66
+
67
+ return $this;
68
+ }
69
+
70
+ }
app/code/community/Ecomwise/Mshop/Model/Api/Server/V2/Adapter/Soap.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecomwise_Mshop_Model_Api_Server_V2_Adapter_Soap extends Mage_Api_Model_Server_V2_Adapter_Soap
4
+ {
5
+ /*This method is overriding in order to set proper charset
6
+ * added 'true' parameter to setHeader()
7
+ * */
8
+ public function run()
9
+ {
10
+ $apiConfigCharset = Mage::getStoreConfig("api/config/charset");
11
+
12
+ if ($this->getController()->getRequest()->getParam('wsdl') !== null) {
13
+ $wsdlConfig = Mage::getModel('api/wsdl_config');
14
+ $wsdlConfig->setHandler($this->getHandler())
15
+ ->init();
16
+ $this->getController()->getResponse()
17
+ ->clearHeaders()
18
+ ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true)
19
+ ->setBody(
20
+ preg_replace(
21
+ '/<\?xml version="([^\"]+)"([^\>]+)>/i',
22
+ '<?xml version="$1" encoding="'.$apiConfigCharset.'"?>',
23
+ $wsdlConfig->getWsdlContent()
24
+ )
25
+ );
26
+ } else {
27
+ try {
28
+ $this->_instantiateServer();
29
+
30
+ $this->getController()->getResponse()
31
+ ->clearHeaders()
32
+ ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset, true)
33
+ ->setBody(
34
+ preg_replace(
35
+ '/<\?xml version="([^\"]+)"([^\>]+)>/i',
36
+ '<?xml version="$1" encoding="'.$apiConfigCharset.'"?>',
37
+ $this->_soap->handle()
38
+ )
39
+ );
40
+ } catch( Zend_Soap_Server_Exception $e ) {
41
+ $this->fault( $e->getCode(), $e->getMessage() );
42
+ } catch( Exception $e ) {
43
+ $this->fault( $e->getCode(), $e->getMessage() );
44
+ }
45
+ }
46
+
47
+ return $this;
48
+ }
49
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Api.php ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Api extends Mage_Catalog_Model_Product_Api{
3
+
4
+ /**
5
+ * Set Visibility to Products in Store Views
6
+ *
7
+ * @param string $productSku
8
+ * @param int $storeViews
9
+ * @param int $visibilityLevel: possible values are: 1 � not visible, 2 �catalog, 3 �search, 4 � catalog, search.
10
+ * @return string
11
+ */
12
+ public function setVisibility($productSku, $storeViews, $visibilityLevel){
13
+
14
+ if(!is_array($storeViews)){
15
+ return $this->_fault('not_passed_array');
16
+ }
17
+
18
+ $vis_level = intval($visibilityLevel);
19
+
20
+ if($vis_level != 1 && $vis_level != 2 && $vis_level != 3 && $vis_level != 4 ){
21
+
22
+ return $this->_fault('visibility_level_not_exists');
23
+ }
24
+
25
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $productSku);
26
+ if($product){
27
+ $product_id = $product->getId();
28
+ }else{
29
+ return $this->_fault('product_not_exists_sku');
30
+ }
31
+
32
+ $product = Mage::getModel('catalog/product')
33
+ ->setStoreId(0)
34
+ ->load($product_id);
35
+
36
+ $vis_def = $product->getVisibility();
37
+
38
+ $webstore = Mage::app()->getStores();
39
+ $store_array = array();
40
+ foreach($webstore as $store){
41
+ $store_id = $store->getId();
42
+ $store_array[] = $store_id;
43
+ }
44
+
45
+ foreach($storeViews as $storeId){
46
+ if(!in_array($storeId, $store_array)){
47
+ return $this->_fault("store_view_not_exists");
48
+ }
49
+ }
50
+ $succ_msg = '';
51
+ foreach($store_array as $storeId){
52
+ if(in_array($storeId, $storeViews)){
53
+ $vis = $visibilityLevel;
54
+ }else{
55
+ $vis = 1;
56
+ }
57
+ $product = Mage::getModel('catalog/product')
58
+ ->setStoreId($storeId)
59
+ ->load($product_id);
60
+ try{
61
+ $product->setVisibility($vis);
62
+ $product->save();
63
+ }catch(Mage_Core_Exception $e){
64
+ $this->_fault('visibility_not_set', $e->getMessage());
65
+ }
66
+ }
67
+
68
+ try{
69
+ $product = Mage::getModel('catalog/product')
70
+ ->setStoreId(0)
71
+ ->load($product_id);
72
+ $product->setVisibility($vis_def);
73
+ $product->save();
74
+ }catch(Mage_Core_Exception $e){
75
+ $this->_fault('visibility_not_set', $e->getMessage());
76
+ }
77
+
78
+ return Mage::helper('catalog')->__('The product visibility was set for store views: ').implode(',',$storeViews);
79
+ }
80
+
81
+ /**
82
+ * Remove product from categories below category
83
+ *
84
+ * @param unknown_type $productCode
85
+ * @param unknown_type $rootCategory
86
+ */
87
+ public function removeProductCategoriesBellow($productCode, $rootCategory){
88
+
89
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$productCode);
90
+ if($product){
91
+ $product_id = $product->getId();
92
+ }else{
93
+ return $this->_fault('product_not_exists_sku');
94
+ }
95
+ $categories = $product->getCategoryIds();
96
+ $category = Mage::getModel('catalog/category')->load($rootCategory);
97
+ $subcategories = $this->getChildrenCat($rootCategory);
98
+ if (count($subcategories) > 0){
99
+ foreach($categories as $productCat){
100
+ if(in_array($productCat, $subcategories)){
101
+ $key = array_search($productCat, $categories);
102
+ unset($categories[$key]);
103
+ }
104
+ }
105
+ }else{
106
+ return $this->_fault('no_subcategories');
107
+ }
108
+ if(!in_array($rootCategory, $categories)){
109
+ $categories[]= $rootCategory;
110
+ }
111
+ try{
112
+ $product->setCategoryIds($categories);
113
+ $product->save();
114
+ return Mage::helper('catalog')->__('Product was removed from categories bellow root category');
115
+ }catch(Mage_Core_Exception $e){
116
+ return $this->_fault('product_not_removed', $e->getMessage());
117
+ }
118
+ }
119
+
120
+ protected function getChildrenCat($catId){
121
+
122
+ $sub = array();
123
+ $category = Mage::getModel('catalog/category')->load($catId);
124
+ $subcategories = $category->getChildrenCategories();
125
+ if (count($subcategories) > 0){
126
+ foreach($subcategories as $subcategory){
127
+ $id = $subcategory->getId();
128
+ $sub[] = $id;
129
+ $sub = array_merge($sub, $this->getChildrenCat($id));
130
+ }
131
+ }
132
+ return $sub;
133
+ }
134
+
135
+ /**
136
+ * Create configurable product
137
+ *
138
+ * @param int $set
139
+ * @param string $sku
140
+ * @param array $productData
141
+ * @return int : id of new configurable product
142
+ */
143
+ public function createConfigurable( $set, $sku, $productData){
144
+ if ( !$set || !$sku) {
145
+ $this->_fault('data_invalid');
146
+ }
147
+
148
+ $product = Mage::getModel('catalog/product');
149
+
150
+ $product->setStoreId($this->_getStoreId())
151
+ ->setAttributeSetId($set)
152
+ ->setTypeId('configurable')
153
+ ->setSku($sku);
154
+
155
+ if (isset($productData['website_ids']) && is_array($productData['website_ids'])) {
156
+ $product->setWebsiteIds($productData['website_ids']);
157
+ }
158
+
159
+ foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
160
+ if ($this->_isAllowedAttribute($attribute)
161
+ && isset($productData[$attribute->getAttributeCode()])) {
162
+ $product->setData(
163
+ $attribute->getAttributeCode(),
164
+ $productData[$attribute->getAttributeCode()]
165
+ );
166
+ }
167
+ }
168
+
169
+ $this->_prepareDataForSave($product, $productData);
170
+
171
+ try {
172
+ if (is_array($errors = $product->validate())) {
173
+ $strErrors = array();
174
+ foreach($errors as $code=>$error) {
175
+ $strErrors[] = ($error === true)? Mage::helper('catalog')->__('Attribute "%s" is invalid.', $code) : $error;
176
+ }
177
+ $this->_fault('data_invalid', implode("\n", $strErrors));
178
+ }
179
+
180
+ $product->save();
181
+ } catch (Mage_Core_Exception $e) {
182
+ $this->_fault('data_invalid', $e->getMessage());
183
+ }
184
+
185
+ return $product->getId();
186
+ }
187
+
188
+ protected function _prepareDataForSave ($product, $productData){
189
+
190
+ if (isset($productData['categories']) && is_array($productData['categories'])) {
191
+ $product->setCategoryIds($productData['categories']);
192
+ }
193
+ if (isset($productData['websites']) && is_array($productData['websites'])) {
194
+ foreach ($productData['websites'] as &$website) {
195
+ if (is_string($website)) {
196
+ try {
197
+ $website = Mage::app()->getWebsite($website)->getId();
198
+ } catch (Exception $e) { }
199
+ }
200
+ }
201
+ $product->setWebsiteIds($productData['websites']);
202
+ }
203
+
204
+ if (Mage::app()->isSingleStoreMode()) {
205
+ $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
206
+ }
207
+
208
+ if (isset($productData['stock_data']) && is_array($productData['stock_data'])) {
209
+ $product->setStockData($productData['stock_data']);
210
+ }
211
+
212
+ if (isset($productData['tier_price']) && is_array($productData['tier_price'])) {
213
+ $tierPrices = Mage::getModel('catalog/product_attribute_tierprice_api')->prepareTierPrices($product, $productData['tier_price']);
214
+ $product->setData(Mage_Catalog_Model_Product_Attribute_Tierprice_Api::ATTRIBUTE_CODE, $tierPrices);
215
+ }
216
+
217
+ if(isset($productData['configurable_attributes_data']) && is_array($productData['configurable_attributes_data'])) {
218
+ foreach($productData['configurable_attributes_data'] as $key => $data) {
219
+
220
+ $data['label'] = (!empty($data['label'])) ? $data['label'] : $product->getResource()->getAttribute($data['attribute_code'])->getStoreLabel();
221
+ $data['frontend_label'] = (!empty($data['frontend_label'])) ? $data['frontend_label'] : $product->getResource()->getAttribute($data['attribute_code'])->getFrontendLabel();
222
+ $productData['configurable_attributes_data'][$key] = $data;
223
+ }
224
+ $product->setConfigurableAttributesData($this->getAttributeData($productData['configurable_attributes_data']));
225
+ $product->setCanSaveConfigurableAttributes(1);
226
+
227
+ if(isset($productData['configurable_products_data']) && is_array($productData['configurable_products_data'])) {
228
+ $product->setConfigurableProductsData($this->getProductData($productData['configurable_products_data']));
229
+ }
230
+ }
231
+ }
232
+
233
+ protected function getAttributeData($attCodes){
234
+ $attributesArray = array();
235
+
236
+ foreach($attCodes as $code){
237
+ $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
238
+ ->setCodeFilter($code)
239
+ ->getFirstItem();
240
+ $data = $attributeInfo->getData();
241
+ $att_id = $data['attribute_id'];
242
+ $att_code = $data['attribute_code'];
243
+ $front_label = $data['frontend_label'];
244
+ $attributeOptionSingle = Mage::getResourceModel('eav/entity_attribute_option_collection')
245
+ ->setPositionOrder('asc')
246
+ ->setAttributeFilter($att_id)
247
+ ->setStoreFilter()
248
+ ->load();
249
+ $options = $attributeOptionSingle->getData();
250
+
251
+ $single_code = array(
252
+ 'id' => NULL,
253
+ 'label' => $front_label,
254
+ 'position' => NULL
255
+ );
256
+ $values = array();
257
+ foreach($options as $option){
258
+ $index = $option['option_id'];
259
+ $attr_id = $option['attribute_id'];
260
+ $value = $option['value'];
261
+ $val = array(
262
+ 'attribute_id' => ''.$attr_id.'',
263
+ 'label' => $value,
264
+ 'value_index' => $index,
265
+ 'is_percent' => 0,
266
+ 'pricing_value' => '0');
267
+ $values[] = $val;
268
+
269
+ }
270
+
271
+ $single_code ['values'] = $values;
272
+ $single_code ['attribute_id'] = $att_id;
273
+ $single_code ['attribute_code'] = $att_code;
274
+ $single_code ['frontend_label'] = $front_label;
275
+ $single_code ['html_id'] = 'config_super_product__attribute_0';
276
+ $attributesArray[] = $single_code;
277
+ }
278
+
279
+ return $attributesArray;
280
+ }
281
+
282
+ protected function getProductData($productSkus,$codes){
283
+
284
+ $values = array();
285
+ foreach($productSkus as $sid){
286
+ $single = array();
287
+ foreach($codes as $code){
288
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sid);
289
+ if($product){
290
+ $pid = $product->getId();
291
+ }else{
292
+ return false;
293
+ }
294
+ $attributeValue = $product->getData();
295
+ $attribute_id='';
296
+ $label = '';
297
+ $is_percent='';
298
+ $pricing_value='';
299
+ $attrarray = $this->getAttributeData(array($code));
300
+
301
+ foreach($attrarray[0]['values'] as $value){
302
+ if($value['value_index'] == $attributeValue[$code]){
303
+ $attribute_id = $value['attribute_id'];
304
+ $label = $value['label'];
305
+ $is_percent = $value['is_percent'];
306
+ $pricing_value = $value['pricing_value'];
307
+ }
308
+ }
309
+ $single[] = array('attribute_id'=>$attribute_id,'label'=>$label,'value_index'=>$attributeValue['color'],'is_percent'=>$is_percent,'pricing_value'=>$pricing_value);
310
+ }
311
+ $values[$pid] = $single;
312
+ }
313
+ return $values;
314
+ }
315
+
316
+ /**
317
+ * Add simple products to configurable
318
+ *
319
+ * @param int $confId
320
+ * @param array $simpleIds
321
+ */
322
+ public function addToConfigurable($confId, $simpleIds){
323
+ $conf = Mage::getModel('catalog/product')->load($confId);
324
+ $conf_id = $conf->getId();
325
+ if(!$conf_id){
326
+ return $this->_fault('conf_product_not_exists');
327
+ }
328
+
329
+ if(!is_array($simpleIds)){
330
+ return $this->_fault('array_of_simple_products_not_passed');
331
+ }
332
+ if(!$conf->isConfigurable()){
333
+ return $this->_fault('not_configurable');
334
+ }
335
+
336
+ $loader = Mage::getResourceModel( 'catalog/product_type_configurable' )->load( $conf);
337
+
338
+ foreach($simpleIds as $id){
339
+ if(!$simid = Mage::getModel('catalog/product')->load($id)->getId()){
340
+ return $this->_fault('simple_product_not_exists');
341
+ }
342
+ }
343
+ try{
344
+ $ids = $conf->getTypeInstance()->getUsedProductIds();
345
+ $ids = array_merge($ids, $simpleIds);
346
+
347
+ $loader->saveProducts($conf->getId(), $ids);
348
+ return Mage::helper('catalog')->__("Simple products are added to the configurable product");
349
+ }catch(Mage_Core_Exception $e){
350
+ return $this->_fault('products_not_added', $e->getMessage());
351
+ }
352
+ }
353
+
354
+ /**
355
+ * Loops through all images in var/import/mshop/images and import images for a products
356
+ *
357
+ * @return boolean
358
+ */
359
+ public function images(){
360
+ $result = Mage::helper('mshop/product')->addImages();
361
+ $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_flat');
362
+ $process->reindexAll();
363
+ $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_attribute');
364
+ $process->reindexAll();
365
+ return $result;
366
+ }
367
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Api/V2.php ADDED
@@ -0,0 +1,1217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Api_V2 extends Mage_Catalog_Model_Product_Api_V2{
3
+
4
+ public function create($type, $set, $sku, $productData){
5
+ return Mage::getModel("mshop/catalog_product_api_v2")->create($type, $set, $sku, $productData);
6
+ }
7
+
8
+ public function update($productId, $productData, $store = null, $identifierType = null){
9
+ return Mage::getModel("mshop/catalog_product_api_v2")->update($productId, $productData, $store = null, $identifierType = null);
10
+ }
11
+
12
+ /**
13
+ * Massively Updates the Product Status
14
+ *
15
+ * @param array $skus
16
+ * @return array of skus that are not found
17
+ */
18
+ public function disableProducts($skus){
19
+
20
+ $resource = Mage::getSingleton('core/resource');
21
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
22
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
23
+
24
+ $product_et = $resource->getTableName('catalog_product_entity');
25
+ $product_eit = $resource->getTableName('catalog_product_entity_int');
26
+
27
+ //get the ID for theattribute by code "STATUS"
28
+ $entityTypeID = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
29
+
30
+ $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
31
+ ->setCodeFilter('status')
32
+ ->setEntityTypeFilter($entityTypeID)
33
+ ->getFirstItem();
34
+
35
+ $statusId = $attributeInfo->getAttributeId();
36
+
37
+ $results = array();
38
+
39
+ foreach ($skus as $sku){
40
+ //Try to get the Entity Id by SKU
41
+ $select_et = $cr->select()
42
+ ->from($product_et)
43
+ ->where("sku=?", $sku);
44
+
45
+ $et_row = $cr->fetchRow($select_et);
46
+
47
+ //Add the SKU to response if product is not found by SKU
48
+ if(!$et_row){
49
+ $results[] = strval($sku);
50
+ }else{
51
+ $pid = $et_row['entity_id'];
52
+ $q1 = $cw->query('UPDATE '.$product_eit.' SET value = 2 WHERE entity_id = '.$pid.' AND attribute_id = '.$statusId.'');
53
+ }
54
+ }
55
+
56
+ return $results;
57
+ }
58
+
59
+ /**
60
+ * Massively Updates the Product inventory: Quantity
61
+ *
62
+ * @param int $use_future_stock
63
+ * @return array of not found skus
64
+ */
65
+ public function massiveUpdateQty($array, $use_future_stock){
66
+
67
+ $this->qtyUpdatesPreCheck($use_future_stock);
68
+
69
+ $resource = Mage::getSingleton('core/resource');
70
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
71
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
72
+
73
+ $product_entity_table = $resource->getTableName('catalog_product_entity');
74
+ $product_ci_stock_item = $resource->getTableName('cataloginventory_stock_item');
75
+ $product_ci_stock_status = $resource->getTableName('cataloginventory_stock_status');
76
+
77
+ $results = array();
78
+
79
+ foreach($array as $element){
80
+
81
+ $sku = $element->productSku;
82
+ if($use_future_stock == 1){
83
+ $qty = $element->productQty + $element->productFutureQty;
84
+ }else{
85
+ $qty = $element->productQty;
86
+ }
87
+ $productFutureQty = $element->productFutureQty ;
88
+
89
+ //Try to get the Entity Id by SKU
90
+ $select_et = $cr->select()
91
+ ->from($product_entity_table)
92
+ ->where("sku=?", $sku);
93
+ $et_row = $cr->fetchRow($select_et);
94
+
95
+ //Add the SKU to response if product is not found by SKU
96
+ if(!$et_row){
97
+ $results[] = strval($sku);
98
+ }else{
99
+ $pid = $et_row['entity_id'];
100
+ $entry_found = false;
101
+
102
+ $select_si = $cr->select()
103
+ ->from($product_ci_stock_item)
104
+ ->where("product_id=?", $pid);
105
+
106
+ $minQty = 0;
107
+ if($si_row = $cr->fetchRow($select_si)){
108
+ $entry_found = true;
109
+ $minQty = $this->getminimumQuantity($si_row);
110
+ };
111
+
112
+ $is_in_stock = 0;
113
+ if($entry_found){
114
+ $backorders = $this->getBackorders($si_row);
115
+ if($backorders){
116
+ $is_in_stock = 1;
117
+ }else{
118
+ if($qty > $minQty)
119
+ $is_in_stock = 1;
120
+ }
121
+ }
122
+
123
+ if($entry_found){
124
+ $q1 = $cw->query('UPDATE '.$product_ci_stock_item.' SET qty = "'.$qty.'", is_in_stock ="'.$is_in_stock.'" WHERE product_id = '.$pid.' ');
125
+ $q2 = $cw->query('UPDATE '.$product_ci_stock_status.' SET qty = "'.$qty.'", stock_status ="'.$is_in_stock.'" WHERE product_id = '.$pid.' ');
126
+
127
+ $this->updateFutureStock($pid,$use_future_stock,$productFutureQty);
128
+
129
+ if($q1 and $q2){
130
+ }else{
131
+ $results[] = strval($sku);
132
+ }
133
+
134
+ $extraAttributes = $element->extraAttributes ;
135
+ if(isset($extraAttributes)){
136
+ $this->updateExtraAttributes($pid,$extraAttributes);
137
+ }
138
+ }else{
139
+ //Add the SKU to response if product if for some reason there is no data for the given product in "cataloginventory_stock_item" database table
140
+ $results[] = strval($sku);
141
+ }
142
+ }
143
+ }
144
+ return $results;
145
+ }
146
+
147
+ // update extra attributes (used for method massiveUpdateQty)
148
+ protected function updateExtraAttributes($pid, $extraAttributes){
149
+
150
+ $resource = Mage::getSingleton('core/resource');
151
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
152
+ $product_ci_stock_item = $resource->getTableName('cataloginventory_stock_item');
153
+
154
+ if((isset($extraAttributes->mamut_store1)))
155
+ $cw->query('UPDATE '.$product_ci_stock_item.' SET mamut_store1 = "'.$extraAttributes->mamut_store1.'" WHERE product_id = '.$pid.'');
156
+ if((isset($extraAttributes->mamut_store2)))
157
+ $cw->query('UPDATE '.$product_ci_stock_item.' SET mamut_store2 = "'.$extraAttributes->mamut_store2.'" WHERE product_id = '.$pid.'');
158
+ if((isset($extraAttributes->mamut_store3)))
159
+ $cw->query('UPDATE '.$product_ci_stock_item.' SET mamut_store3 = "'.$extraAttributes->mamut_store3.'" WHERE product_id = '.$pid.'');
160
+ if((isset($extraAttributes->mamut_store4)))
161
+ $cw->query('UPDATE '.$product_ci_stock_item.' SET mamut_store4 = "'.$extraAttributes->mamut_store4.'" WHERE product_id = '.$pid.'');
162
+ if((isset($extraAttributes->mamut_store5)))
163
+ $cw->query('UPDATE '.$product_ci_stock_item.' SET mamut_store5 = "'.$extraAttributes->mamut_store5.'" WHERE product_id = '.$pid.'');
164
+ if((isset($extraAttributes->mamut_nextdeliverydate)))
165
+ $cw->query('UPDATE '.$product_ci_stock_item.' SET mamut_nextdeliverydate = "'.$extraAttributes->mamut_nextdeliverydate.'" WHERE product_id = '.$pid.'');
166
+ }
167
+
168
+ // update future stock
169
+ protected function updateFutureStock($pid,$use_future_stock,$productFutureQty){
170
+
171
+ $resource = Mage::getSingleton('core/resource');
172
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
173
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
174
+
175
+ $product_entity_varchar_table = $resource->getTableName('catalog_product_entity_varchar');
176
+ $mamutFutureStockId = $this->mamutFutureStockIsAvailable();
177
+
178
+ $select_evt = $cr->select()
179
+ ->from($product_entity_varchar_table)
180
+ ->where("entity_id=?", $pid)
181
+ ->where("attribute_id=?", $mamutFutureStockId);
182
+
183
+ $evt_row = $cr->fetchRow($select_evt);
184
+ if($mamutFutureStockId and $use_future_stock)
185
+ {
186
+ if($evt_row)
187
+ {
188
+ $q3 = $cw->query('UPDATE '.$product_entity_varchar_table.' SET value = "'.$productFutureQty.'" WHERE entity_id = '.$pid.' AND attribute_id= '.$mamutFutureStockId.' ');
189
+ }else{
190
+ $q3 = $cw->query('INSERT INTO '.$product_entity_varchar_table.' (`entity_type_id`,`attribute_id`,`entity_id`,`store_id`,`value`) VALUES ("4","'.$mamutFutureStockId.'","'.$pid.'","0","'.$productFutureQty.'") ');
191
+ }
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Updates the Product inventory: Quantity
197
+ *
198
+ * @param string $sku
199
+ * @param int $qty
200
+ * @return boolean
201
+ */
202
+ public function updateQty($sku, $qty){
203
+
204
+ $resource = Mage::getSingleton('core/resource');
205
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
206
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
207
+
208
+ $product_entity_table = $resource->getTableName('catalog_product_entity');
209
+ $product_ci_stock_item = $resource->getTableName('cataloginventory_stock_item');
210
+ $product_ci_stock_status = $resource->getTableName('cataloginventory_stock_status');
211
+
212
+ $entry_found = false;
213
+
214
+ //Try to get the Entity Id by SKU
215
+ $select_et = $cr->select()
216
+ ->from($product_entity_table)
217
+ ->where("sku=?", $sku);
218
+ $et_row = $cr->fetchRow($select_et);
219
+
220
+ //Return Error if product is not found by SKU
221
+ if(!$et_row){
222
+ $this->_fault('invalid_sku');
223
+ }
224
+ $pid = $et_row['entity_id'];
225
+
226
+ //With the acquired Entity ID try to load rows from "cataloginventory_stock_item" and "cataloginventory_stock_status"
227
+ $select_si = $cr->select()
228
+ ->from($product_ci_stock_item)
229
+ ->where("product_id=?", $pid);
230
+
231
+ $minQty = 0;
232
+ if($si_row = $cr->fetchRow($select_si)){
233
+ $entry_found = true;
234
+ $minQty = $this->getminimumQuantity($si_row);
235
+ };
236
+
237
+ $is_in_stock = 0;
238
+ if($entry_found){
239
+ $backorders = $this->getBackorders($si_row);
240
+ if($backorders){
241
+ $is_in_stock = 1;
242
+ }else{
243
+ if($qty > $minQty)
244
+ $is_in_stock = 1;
245
+ }
246
+ }
247
+
248
+ if($entry_found){
249
+ $q1 = $cw->query('UPDATE '.$product_ci_stock_item.' SET qty = "'.$qty.'", is_in_stock ="'.$is_in_stock.'" WHERE product_id = '.$pid.' ');
250
+ $q2 = $cw->query('UPDATE '.$product_ci_stock_status.' SET qty = "'.$qty.'", stock_status ="'.$is_in_stock.'" WHERE product_id = '.$pid.' ');
251
+
252
+ if($q1 and $q2){
253
+ return true;
254
+ }else{
255
+ //If some query goes wrong also throw an error
256
+ $this->_fault('update_query_failed');
257
+ }
258
+ }else{
259
+ //If rows cannot be selected from "cataloginventory_stock_item" and "cataloginventory_stock_status", throw an error about invalid Entity Id in these two tables
260
+ $this->_fault('invalid_pid');
261
+ };
262
+
263
+ return false;
264
+ }
265
+
266
+ /**
267
+ * Updates the Product inventory: Quantity taking mamu_future_stock into account
268
+ *
269
+ * @param string $sku
270
+ * @param int $qty
271
+ * @param int $mamut_future_stock
272
+ * @param int $use_future_stock
273
+ * @return boolean
274
+ */
275
+ public function updateQtyFutureStock($sku, $qty, $mamut_future_stock, $use_future_stock){
276
+
277
+ $this->qtyUpdatesPreCheck($use_future_stock);
278
+ $mamutFutureStockId = $this->mamutFutureStockIsAvailable();
279
+
280
+ $resource = Mage::getSingleton('core/resource');
281
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
282
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
283
+
284
+ $product_entity_table = $resource->getTableName('catalog_product_entity');
285
+ $product_entity_varchar_table = $resource->getTableName('catalog_product_entity_varchar');
286
+ $product_ci_stock_item = $resource->getTableName('cataloginventory_stock_item');
287
+ $product_ci_stock_status = $resource->getTableName('cataloginventory_stock_status');
288
+
289
+
290
+ $entry_found = false;
291
+
292
+ if($use_future_stock == 1){
293
+ $qty += $mamut_future_stock;
294
+ }
295
+
296
+ //Try to get the Entity Id by SKU
297
+ $select_et = $cr->select()
298
+ ->from($product_entity_table)
299
+ ->where("sku=?", $sku);
300
+
301
+ $et_row = $cr->fetchRow($select_et);
302
+
303
+ //Return Error if product is not found by SKU
304
+ if(!$et_row){
305
+ $this->_fault('invalid_sku');
306
+ }
307
+
308
+ $pid = $et_row['entity_id'];
309
+
310
+ //With the acquired Entity ID try to load rows from "cataloginventory_stock_item" and "cataloginventory_stock_status"
311
+ $select_si = $cr->select()
312
+ ->from($product_ci_stock_item)
313
+ ->where("product_id=?", $pid);
314
+
315
+ $minQty = 0;
316
+ if($si_row = $cr->fetchRow($select_si)){
317
+ $entry_found = true;
318
+ $minQty = $this->getminimumQuantity($si_row);
319
+ };
320
+
321
+ $is_in_stock = 0;
322
+ if($entry_found){
323
+ $backorders = $this->getBackorders($si_row);
324
+ if($backorders){
325
+ $is_in_stock = 1;
326
+ }else{
327
+ if($qty > $minQty)
328
+ $is_in_stock = 1;
329
+ }
330
+ }
331
+
332
+ if($entry_found){
333
+ $q1 = $cw->query('UPDATE '.$product_ci_stock_item.' SET qty = "'.$qty.'", is_in_stock ="'.$is_in_stock.'" WHERE product_id = '.$pid.' ');
334
+ $q2 = $cw->query('UPDATE '.$product_ci_stock_status.' SET qty = "'.$qty.'", stock_status ="'.$is_in_stock.'" WHERE product_id = '.$pid.' ');
335
+
336
+ $this->updateFutureStock($pid,$use_future_stock,$mamut_future_stock);
337
+
338
+ if($q1 and $q2){
339
+ return true;
340
+ }else{
341
+ //If some query goes wrong also throw an error
342
+ $this->_fault('update_query_failed');
343
+ }
344
+ }else{
345
+ //If rows cannot be selected from "cataloginventory_stock_item" and "cataloginventory_stock_status", throw an error
346
+ $this->_fault('invalid_pid');
347
+ };
348
+
349
+ return false;
350
+ }
351
+
352
+ /**
353
+ * Return Simple Products SKUs
354
+ *
355
+ * @return array
356
+ */
357
+ public function productsSkus(){
358
+
359
+ $resurce = Mage::getSingleton('core/resource');
360
+ $table = $resurce->getTableName('catalog/product');
361
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
362
+
363
+ $sql2 = "SELECT DISTINCT (e.sku)
364
+ FROM
365
+ ".$resurce->getTableName('catalog_product_entity')." e,
366
+ ".$resurce->getTableName('eav_attribute')." eav,
367
+ ".$resurce->getTableName('catalog_product_entity_varchar')." var
368
+ WHERE
369
+ e.entity_type_id = eav.entity_type_id
370
+ AND eav.attribute_code = 'name'
371
+ AND eav.attribute_id = var.attribute_id
372
+ AND var.entity_id = e.entity_id
373
+ AND e.type_id='simple'";
374
+
375
+ $result = $connection->query($sql2);
376
+ $responce = $result->fetchAll(PDO::FETCH_COLUMN);
377
+
378
+ return $responce;
379
+ }
380
+
381
+ /**
382
+ * Loops through all images in var/import/mshop/images and import images for a products
383
+ *
384
+ * @return boolean
385
+ */
386
+ public function images(){
387
+ $result = Mage::helper('mshop/product')->addImages();
388
+ $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_flat');
389
+ $process->reindexAll();
390
+ $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_attribute');
391
+ $process->reindexAll();
392
+ return $result;
393
+ }
394
+
395
+ /**
396
+ * Return All Products SKUs
397
+ *
398
+ * @return array
399
+ */
400
+ public function productsAllSkus(){
401
+
402
+ $resurce = Mage::getSingleton('core/resource');
403
+ $table = $resurce->getTableName('catalog/product');
404
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
405
+
406
+ $sql2 = "SELECT DISTINCT (e.sku)
407
+ FROM
408
+ ".$resurce->getTableName('catalog_product_entity')." e,
409
+ ".$resurce->getTableName('eav_attribute')." eav,
410
+ ".$resurce->getTableName('catalog_product_entity_varchar')." var
411
+ WHERE
412
+ e.entity_type_id = eav.entity_type_id
413
+ AND eav.attribute_code = 'name'
414
+ AND eav.attribute_id = var.attribute_id
415
+ AND var.entity_id = e.entity_id";
416
+
417
+ $result = $connection->query($sql2);
418
+ $responce = $result->fetchAll(PDO::FETCH_COLUMN);
419
+
420
+ return $responce;
421
+ }
422
+
423
+ /**
424
+ * Get Product Info For All Store Views
425
+ *
426
+ * @param string $productSku
427
+ * @return array of product data for each store view
428
+ */
429
+ public function productFullInfo($productSku){
430
+ $productReturnEntityArray = array();
431
+
432
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$productSku);
433
+ $allStoresViews = Mage::app()->getStores();
434
+
435
+ foreach ($allStoresViews as $storeView){
436
+ $productReturnEntity = Mage::getModel('catalog/product_api')->info($product->getId(), $storeView->getId());
437
+ $productReturnEntity['mshop_store_view_id'] = $storeView->getId();
438
+ $productReturnEntity['mshop_store_view_name'] = $storeView->getName();
439
+ $productReturnEntityArray[] = $productReturnEntity;
440
+ }
441
+
442
+ return $productReturnEntityArray;
443
+ }
444
+
445
+ /**
446
+ * Set Visibility to Products in Store Views
447
+ *
448
+ * @param string $productSku
449
+ * @param int $storeViews
450
+ * @param int $visibilityLevel: possible values are: 1 � not visible, 2 �catalog, 3 �search, 4 � catalog, search.
451
+ * @return string
452
+ */
453
+ public function setVisibility($productSku, $storeViews, $visibilityLevel){
454
+
455
+ if(!is_array($storeViews)){
456
+ return $this->_fault('not_passed_array');
457
+ }
458
+
459
+ $vis_level = intval($visibilityLevel);
460
+ if($vis_level != 1 && $vis_level != 2 && $vis_level != 3 && $vis_level != 4 ){
461
+ return $this->_fault('visibility_level_not_exists');
462
+ }
463
+
464
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $productSku);
465
+ if($product){
466
+ $product_id = $product->getId();
467
+ }else{
468
+ return $this->_fault('product_not_exists_sku');
469
+ }
470
+
471
+ $product = Mage::getModel('catalog/product')
472
+ ->setStoreId(0)
473
+ ->load($product_id);
474
+
475
+ $vis_def = $product->getVisibility();
476
+ $defaultData = $product->getData();
477
+
478
+ $webstore = Mage::app()->getStores();
479
+ $store_array = array();
480
+ foreach($webstore as $store){
481
+ $store_id = $store->getId();
482
+ $store_array[] = $store_id;
483
+ }
484
+
485
+ foreach($storeViews as $storeId){
486
+ if(!in_array($storeId, $store_array)){
487
+ return $this->_fault("store_view_not_exists");
488
+ }
489
+ }
490
+
491
+ foreach($store_array as $storeId){
492
+ if(in_array($storeId, $storeViews)){
493
+ $vis = $visibilityLevel;
494
+ }else{
495
+ $vis = 1;
496
+ }
497
+ $product = Mage::getModel('catalog/product')
498
+ ->setStoreId($storeId)
499
+ ->load($product_id);
500
+
501
+ try{
502
+ $product->setVisibility($vis);
503
+ $product->save();
504
+
505
+ }catch(Mage_Core_Exception $e){
506
+ $this->_fault('visibility_not_set', $e->getMessage());
507
+ }
508
+ }
509
+
510
+ try{
511
+ $product = Mage::getModel('catalog/product')
512
+ ->setStoreId(0)
513
+ ->load($product_id);
514
+ $product->setData($defaultData);
515
+ $product->setVisibility($vis_def);
516
+ $product->save();
517
+ }catch(Mage_Core_Exception $e){
518
+ $this->_fault('visibility_not_set', $e->getMessage());
519
+ }
520
+
521
+ return Mage::helper('catalog')->__('The product visibility was set for store views: ').implode(',',$storeViews);
522
+ }
523
+
524
+ /**
525
+ * Remove product from categories below category
526
+ *
527
+ * @param string $productCode : sku of product
528
+ * @param int $rootCategory : id of root category
529
+ */
530
+ public function removeProductCategoriesBellow($productCode, $rootCategory){
531
+
532
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$productCode);
533
+ if($product){
534
+ $product_id = $product->getId();
535
+ }else{
536
+ return $this->_fault('product_not_exists_sku');
537
+ }
538
+
539
+ $categories = $product->getCategoryIds();
540
+ $category = Mage::getModel('catalog/category')->load($rootCategory);
541
+ $subcategories = $this->getChildrenCat($rootCategory);
542
+ if (count($subcategories) > 0){
543
+ foreach($categories as $productCat){
544
+ if(in_array($productCat, $subcategories)){
545
+ $key = array_search($productCat, $categories);
546
+ unset($categories[$key]);
547
+ }
548
+ }
549
+ }else{
550
+ return $this->_fault('no_subcategories');
551
+ }
552
+ if(!in_array($rootCategory, $categories)){
553
+ $categories[]= $rootCategory;
554
+ }
555
+ try{
556
+ $product->setCategoryIds($categories);
557
+ $product->save();
558
+ return Mage::helper('catalog')->__('Product was removed from categories bellow root category');
559
+ }catch(Mage_Core_Exception $e){
560
+ return $this->_fault('product_not_removed');
561
+ }
562
+ }
563
+
564
+
565
+ protected function getChildrenCat($catId){
566
+ $sub = array();
567
+ $category = Mage::getModel('catalog/category')->load($catId);
568
+ $subcategories = $category->getChildrenCategories();
569
+ if (count($subcategories) > 0){
570
+ foreach($subcategories as $subcategory){
571
+ $id = $subcategory->getId();
572
+ $sub[] = $id;
573
+ $sub = array_merge($sub, $this->getChildrenCat($id));
574
+ }
575
+ }
576
+ return $sub;
577
+ }
578
+
579
+
580
+ /**
581
+ * Create configurable product
582
+ *
583
+ * @param $set : Attribute set Id
584
+ * @param $sku : Sku of the new product
585
+ * @param $productData
586
+ * @param $simpleProductData : array of the simple products skus
587
+ * @param $attributesData : array of configurable attribute codes
588
+ * @return id of new configurable product.
589
+ */
590
+ public function createConfigurable($set, $sku, $productData, $simpleProductData, $attributesData){
591
+
592
+ if ( !$set || !$sku) {
593
+ $this->_fault('data_invalid');
594
+ }
595
+
596
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
597
+ if($product){
598
+ $product_id = $product->getId();
599
+ if(!$product->isConfigurable()){
600
+ return $this->_fault('not_configurable');
601
+ }
602
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
603
+ $resurce = Mage::getSingleton('core/resource');
604
+
605
+ $supper = $resurce->getTableName('catalog_product_super_attribute');
606
+ $supper_label = $resurce->getTableName('catalog_product_super_attribute_label');
607
+
608
+ $resultd = $connection->query('SELECT * FROM '.$supper.' as kk
609
+ WHERE kk.product_id = '.$product_id.' ');
610
+ $rows = $resultd->fetchAll(PDO::FETCH_ASSOC);
611
+
612
+ if($rows){
613
+ foreach($rows as $row){
614
+ $product_super_atr = $row['product_super_attribute_id'];
615
+ $connection->delete($supper_label, 'product_super_attribute_id = '.$product_super_atr);
616
+ }
617
+ }
618
+ $connection->delete($supper, 'product_id = ' . $product_id);
619
+ }else{
620
+ $product = Mage::getModel('catalog/product');
621
+ $product->setStoreId($this->_getStoreId())
622
+ ->setAttributeSetId($set)
623
+ ->setTypeId('configurable')
624
+ ->setSku($sku);
625
+ }
626
+
627
+ if (property_exists($productData, 'website_ids') && is_array($productData->website_ids)) {
628
+ $product->setWebsiteIds($productData->website_ids);
629
+ }
630
+
631
+ if (property_exists($productData, 'additional_attributes')) {
632
+ foreach ($productData->additional_attributes as $_attribute) {
633
+ $_attrCode = $_attribute->key;
634
+ $productData->$_attrCode = $_attribute->value;
635
+ }
636
+ unset($productData->additional_attributes);
637
+ }
638
+
639
+ foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
640
+ $_attrCode = $attribute->getAttributeCode();
641
+ if ($this->_isAllowedAttribute($attribute)
642
+ && isset($productData->$_attrCode)) {
643
+ $product->setData(
644
+ $attribute->getAttributeCode(),
645
+ $productData->$_attrCode
646
+ );
647
+ }
648
+ }
649
+
650
+ $resp = $this->_prepareDataForSave($product, $productData, $simpleProductData, $attributesData, $set);
651
+ if($resp == 'no_attr'){
652
+ return $this->_fault('attribute_not_in_set');
653
+ }
654
+ if($resp == 'no_product'){
655
+ return $this->_fault('simple_product_not_exists');
656
+ }
657
+
658
+ try {
659
+ if (is_array($errors = $product->validate())) {
660
+ $strErrors = array();
661
+ foreach($errors as $code=>$error) {
662
+ $strErrors[] = ($error === true)? Mage::helper('catalog')->__('Attribute "%s" is invalid.', $code) : $error;
663
+ }
664
+ $this->_fault('data_invalid', implode("\n", $strErrors));
665
+ }
666
+
667
+ $product->save();
668
+ $this->setVisibilityHelperSkus($simpleProductData);
669
+ }catch (Mage_Core_Exception $e) {
670
+ $this->_fault('data_invalid', $e->getMessage());
671
+ }
672
+
673
+ return $product->getId();
674
+ }
675
+
676
+ // used by method createConfigurable
677
+ protected function _prepareDataForSave ($product, $productData, $simpleProductData , $attributesData, $set){
678
+ if (property_exists($productData, 'categories') && is_array($productData->categories)) {
679
+ $product->setCategoryIds($productData->categories);
680
+ }
681
+
682
+ if (property_exists($productData, 'websites') && is_array($productData->websites)) {
683
+ foreach ($productData->websites as &$website) {
684
+ if (is_string($website)) {
685
+ try {
686
+ $website = Mage::app()->getWebsite($website)->getId();
687
+ } catch (Exception $e) { }
688
+ }
689
+ }
690
+ $product->setWebsiteIds($productData->websites);
691
+ }
692
+
693
+ if (Mage::app()->isSingleStoreMode()) {
694
+ $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
695
+ }
696
+
697
+ if (property_exists($productData, 'stock_data')) {
698
+ $_stockData = array();
699
+ foreach ($productData->stock_data as $key => $value) {
700
+ $_stockData[$key] = $value;
701
+ }
702
+ $product->setStockData($_stockData);
703
+ }
704
+
705
+ if (property_exists($productData, 'tier_price')) {
706
+ $tierPrices = Mage::getModel('catalog/product_attribute_tierprice_api_V2')->prepareTierPrices($product, $productData->tier_price);
707
+ $product->setData(Mage_Catalog_Model_Product_Attribute_Tierprice_Api_V2::ATTRIBUTE_CODE, $tierPrices);
708
+ }
709
+
710
+ if($attributesData != null && is_array($attributesData)&& $simpleProductData != null && is_array($simpleProductData)) {
711
+ $att_data = $this->getAttributeData($attributesData, $set);
712
+ if(!$att_data){
713
+ return "no_attr";
714
+
715
+ }
716
+
717
+ $product_data = $this->getProductData($simpleProductData,$attributesData);
718
+
719
+ if(!$product_data){
720
+ return "no_product";
721
+ }
722
+ $product->setConfigurableAttributesData($att_data);
723
+ $product->setCanSaveConfigurableAttributes(1);
724
+ $product->setConfigurableProductsData($product_data);
725
+ }
726
+ }
727
+
728
+ // used by method createConfigurable
729
+ protected function getAttributeData($attCodes, $set){
730
+ $attributesArray = array();
731
+ $entityTypeID = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
732
+
733
+ foreach($attCodes as $code){
734
+ $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
735
+ ->setCodeFilter($code)
736
+ ->addSetInfo()
737
+ ->getFirstItem();
738
+
739
+ $data = $attributeInfo->getData();
740
+ $att_id = $data['attribute_id'];
741
+ $set_info = $data['attribute_set_info'];
742
+ if(!key_exists($set, $set_info)){
743
+ return false;
744
+ }
745
+ $att_code = $data['attribute_code'];
746
+ $front_label = $data['frontend_label'];
747
+
748
+ $attributeOptionSingle = Mage::getResourceModel('eav/entity_attribute_option_collection')
749
+ ->setPositionOrder('asc')
750
+ ->setAttributeFilter($att_id)
751
+ ->setStoreFilter()
752
+ ->load();
753
+ $options = $attributeOptionSingle->getData();
754
+
755
+ $single_code = array(
756
+ 'id' => NULL,
757
+ 'label' => $front_label,
758
+ 'position' => NULL
759
+
760
+ );
761
+ $values = array();
762
+ foreach($options as $option){
763
+ $index = $option['option_id'];
764
+ $attr_id = $option['attribute_id'];
765
+ $value = $option['value'];
766
+
767
+ $val = array(
768
+ 'attribute_id' => ''.$attr_id.'',
769
+ 'label' => $value,
770
+ 'value_index' => $index,
771
+ 'is_percent' => 0,
772
+ 'pricing_value' => '0');
773
+ $values[] = $val;
774
+
775
+ }
776
+ $single_code ['values'] = $values;
777
+ $single_code ['attribute_id'] = $att_id;
778
+ $single_code ['attribute_code'] = $att_code;
779
+ $single_code ['frontend_label'] = $front_label;
780
+ $single_code ['html_id'] = 'config_super_product__attribute_0';
781
+ $attributesArray[] = $single_code;
782
+ }
783
+
784
+ return $attributesArray;
785
+ }
786
+
787
+ //used by _prepareDataForSave
788
+ protected function getProductData($productSkus,$codes){
789
+
790
+ $values = array();
791
+ foreach($productSkus as $sid){
792
+ $single = array();
793
+ foreach($codes as $code){
794
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sid);
795
+ if($product){
796
+ $pid = $product->getId();
797
+ }else{
798
+ return false;
799
+ }
800
+ $attributeValue = $product->getData();
801
+ $attribute_id='';
802
+ $label = '';
803
+ $is_percent='';
804
+ $pricing_value='';
805
+ $attrarray = $this->getAttributeData(array($code));
806
+
807
+ foreach($attrarray[0]['values'] as $value){
808
+ if($value['value_index'] == $attributeValue[$code]){
809
+ $attribute_id = $value['attribute_id'];
810
+ $label = $value['label'];
811
+ $is_percent = $value['is_percent'];
812
+ $pricing_value = $value['pricing_value'];
813
+ }
814
+ }
815
+ $single[] = array('attribute_id'=>$attribute_id,'label'=>$label,'value_index'=>$attributeValue['color'],'is_percent'=>$is_percent,'pricing_value'=>$pricing_value);
816
+ }
817
+ $values[$pid] = $single;
818
+ }
819
+ return $values;
820
+ }
821
+
822
+ /**
823
+ * Add simple product to configurable or grouped product
824
+ *
825
+ * @param int $confId : Id of configurable product
826
+ * @param array $simpleIds : Array of simple product Ids
827
+ */
828
+ public function setToComplex($confId, $simpleIds){
829
+
830
+ $conf = Mage::getModel('catalog/product')->loadByAttribute("sku",$confId);
831
+ if(!$conf){
832
+ return $this->_fault('conf_product_not_exists');
833
+ }else{
834
+ $conf = Mage::getModel("catalog/product")->load($conf->getId());
835
+ }
836
+
837
+ if(!is_array($simpleIds)){
838
+ return $this->_fault('array_of_simple_products_not_passed');
839
+ }
840
+ if($conf->isConfigurable()){
841
+ return $this->addToConfigurable($conf,$simpleIds);
842
+ }else if($conf->isGrouped()){
843
+ return $this->addToGrouped($conf->getId(),$simpleIds);
844
+ }else{
845
+ return $this->_fault('not_grouped_configurable');
846
+ }
847
+ }
848
+
849
+ // used by method setToComplex
850
+ private function addToConfigurable($conf,$simpleIds){
851
+ $loader = Mage::getResourceModel( 'catalog/product_type_configurable' )->load($conf);
852
+
853
+ $ids_from_sku = array();
854
+ $ids_objects = array();
855
+ foreach($simpleIds as $id){
856
+ if(!$simid = Mage::getModel('catalog/product')->loadByAttribute("sku",$id)){
857
+ return $this->_fault('simple_product_not_exists');
858
+ }else{
859
+ $ids_from_sku [] = $simid->getId();
860
+ $ids_objects []= $simid;
861
+ }
862
+ }
863
+ try{
864
+ $ids = $conf->getTypeInstance()->getUsedProductIds();
865
+ $ids = array_merge($ids, $ids_from_sku);
866
+
867
+ $loader->saveProducts($conf, $ids);
868
+
869
+ $this->setVisibilityHelper($ids_objects);
870
+ return Mage::helper('catalog')->__("Simple products are added to the configurable product");
871
+ }catch(Mage_Core_Exception $e){
872
+ return $this->_fault('products_not_added', $e->getMessage());
873
+ }
874
+ }
875
+
876
+ private function setVisibilityHelper($objects){
877
+ foreach($objects as $obj){
878
+ try{
879
+ $obj->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
880
+ $obj->save();
881
+ }catch(Mage_Core_Exception $e){
882
+
883
+ }
884
+ }
885
+ }
886
+
887
+ // used by method createConfigurable
888
+ private function setVisibilityHelperSkus($skus){
889
+ foreach($skus as $sku){
890
+ $object = Mage::getModel("catalog/product")->loadByAttribute("sku", $sku);
891
+ if($object){
892
+ try{
893
+ $object->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
894
+ $object->save();
895
+ }catch(Mage_Core_Exception $e){
896
+
897
+ }
898
+ }
899
+ }
900
+ }
901
+
902
+ // used by method setToComplex
903
+ private function addToGrouped($confId,$simpleIds){
904
+ foreach($simpleIds as $id){
905
+ $ids_from_sku = array();
906
+ $ids_objects = array();
907
+ if(!$simid = Mage::getModel('catalog/product')->loadByAttribute("sku",$id)){
908
+ return $this->_fault('simple_product_not_exists');
909
+ }else{
910
+ $ids_from_sku [] = $simid->getId();
911
+ }
912
+ }
913
+ $pr_model = Mage::getModel('catalog/product_api_v2') ;
914
+ $link_model = Mage::getModel('catalog/product_link_api_v2') ;
915
+
916
+ $items = $link_model->items('grouped', $confId);
917
+
918
+ $already_present = array();
919
+ foreach($items as $item){
920
+ $product_id = $item['product_id'];
921
+ $already_present[] = $product_id;
922
+ try{
923
+ $link_model->remove('grouped', $confId, $product_id);
924
+ }catch(Exception $ex){
925
+ return $this->_fault('can_not_update', $ex->getMessage());
926
+ }
927
+ }
928
+ $temp = array_merge($simpleIds, $already_present);
929
+ $linkedProductData = $temp;
930
+
931
+ foreach($linkedProductData as $data){
932
+ try{
933
+ $link_model->assign('grouped', $confId, $data);
934
+ }catch(Exception $ex){
935
+ return $this->_fault('can_not_update', $ex->getMessage());
936
+ }
937
+ }
938
+ return Mage::helper('catalog')->__("Simple products are added to the grouped product");
939
+ }
940
+
941
+ /**
942
+ * Create grouped product
943
+ *
944
+ * @param int $set : Attribute set Id
945
+ * @param string $sku : Sku of the new product
946
+ * @param array $productData : data of the configurable product
947
+ * @param array $linkedProductData : array of the simple products skus
948
+ * @return int id of new configurable product
949
+ */
950
+ public function createGrouped($set, $sku, $productData, $linkedProductData){
951
+
952
+ if ( !$set || !$sku) {
953
+ $this->_fault('data_invalid');
954
+ }
955
+
956
+ foreach($linkedProductData as $data){
957
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $data);
958
+ if(!$product){
959
+ return $this->_fault('simple_product_not_exists');
960
+ }
961
+ }
962
+
963
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
964
+
965
+ $pr_model = Mage::getModel('catalog/product_api_v2') ;
966
+ $link_model = Mage::getModel('catalog/product_link_api_v2') ;
967
+
968
+ if($product){
969
+ $pid = $product->getId();
970
+ if(!$product->isGrouped()){
971
+ return $this->_fault('not_grouped');
972
+ }
973
+
974
+ try{
975
+ $pr_model->update($sku, $productData);
976
+ }catch(Exception $ex){
977
+ return $this->_fault('can_not_update', $ex->getMessage());
978
+ }
979
+
980
+ $items = $link_model->items('grouped', $sku);
981
+
982
+ $already_present = array();
983
+ foreach($items as $item){
984
+ $product_id = $item['product_id'];
985
+ $already_present[] = $item['sku'];
986
+ try{
987
+ $link_model->remove('grouped', $sku, $product_id);
988
+ }catch(Exception $ex){
989
+ return $this->_fault('can_not_update', $ex->getMessage());
990
+ }
991
+ }
992
+ $temp = array_merge($linkedProductData, $already_present);
993
+ $linkedProductData = $temp;
994
+
995
+ foreach($linkedProductData as $data){
996
+ try{
997
+ $link_model->assign('grouped', $sku, $data);
998
+ }catch(Exception $ex){
999
+ return $this->_fault('can_not_update', $ex->getMessage());
1000
+ }
1001
+ }
1002
+ return $pid;
1003
+ }else{
1004
+ try{
1005
+ $pid = $pr_model->create('grouped', $set, $sku, $productData);
1006
+ }catch(Exception $ex){
1007
+ return $this->_fault('can_not_create', $ex->getMessage());
1008
+ }
1009
+
1010
+ foreach($linkedProductData as $data){
1011
+ try{
1012
+ $link_model->assign('grouped', $sku, $data);
1013
+ }catch(Exception $ex){
1014
+ return $this->_fault('can_not_create', $ex->getMessage());
1015
+ }
1016
+ }
1017
+ return $pid;
1018
+ }
1019
+ }
1020
+
1021
+ /**
1022
+ * Get products changed since given date
1023
+ *
1024
+ * @param $date
1025
+ * @return array of skus
1026
+ */
1027
+ public function getProductsChangedSince($date)
1028
+ {
1029
+ $name = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'name');
1030
+ $name_id = $name->getId();
1031
+
1032
+ $resource = Mage::getSingleton('core/resource');
1033
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
1034
+ $product_et = $resource->getTableName('catalog_product_entity');
1035
+ $product_et_varchar = $resource->getTableName('catalog_product_entity_varchar');
1036
+ $query = "SELECT p.entity_id, p.updated_at, p.sku FROM `".$product_et."`
1037
+ AS p INNER JOIN `".$product_et_varchar."`
1038
+ AS v ON p.entity_id = v.entity_id
1039
+ AND p.updated_at > '".$date."'
1040
+ AND v.attribute_id = ".$name_id."
1041
+ AND v.store_id = 0";
1042
+
1043
+ $products = $cr->fetchAll($query);
1044
+
1045
+ $skus = array();
1046
+
1047
+ if($products){
1048
+ foreach ($products as $product){
1049
+ $skus[] = $product['sku'];
1050
+ }
1051
+ }
1052
+ return $skus;
1053
+ }
1054
+
1055
+ // get 'Qty for Item's Status to Become Out of Stock' for product
1056
+ private function getMinimumQuantity($si_row)
1057
+ {
1058
+ $minQty = 0;
1059
+
1060
+ $productsUseConfigMinQty = $si_row['use_config_min_qty'];
1061
+
1062
+ if($productsUseConfigMinQty == 1)
1063
+ {
1064
+ $systemMinQty = Mage::getStoreConfig('cataloginventory/item_options/min_qty');
1065
+ $minQty = $systemMinQty;
1066
+ }else
1067
+ {
1068
+ $productsMinQty = $si_row['min_qty'];
1069
+ $minQty = $productsMinQty;
1070
+ }
1071
+ return $minQty;
1072
+ }
1073
+
1074
+ private function mamutFutureStockIsAvailable()
1075
+ {
1076
+ $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'mamut_future_stock');
1077
+ if($attribute->getAttributeId())
1078
+ {
1079
+ return $attribute->getAttributeId();
1080
+ }
1081
+ return false;
1082
+ }
1083
+
1084
+ private function qtyUpdatesPreCheck($use_future_stock)
1085
+ {
1086
+ if($use_future_stock)
1087
+ {
1088
+ if(Mage::getStoreConfig('mshop/mamut_stock/use_stock_from_suppliers') == 0)
1089
+ {
1090
+ $this->_fault('mamut_future_stock_not_available');
1091
+ }
1092
+
1093
+ $mamutFutureStockId = $this->mamutFutureStockIsAvailable();
1094
+ if($use_future_stock and !$mamutFutureStockId)
1095
+ {
1096
+ $this->_fault('mamut_future_stock_not_available');
1097
+ }
1098
+ }
1099
+ return;
1100
+ }
1101
+
1102
+ // get 'Backorders' inventory field for product
1103
+ private function getBackorders($si_row)
1104
+ {
1105
+ $backorders = 0;
1106
+
1107
+ $productsUseConfigBackorders = $si_row['use_config_backorders'];
1108
+
1109
+ if($productsUseConfigBackorders == 1)
1110
+ {
1111
+ $systemBackorders = Mage::getStoreConfig('cataloginventory/item_options/backorders');
1112
+ $backorders = $systemBackorders;
1113
+ }else
1114
+ {
1115
+ $productsBackorders = $si_row['backorders'];
1116
+ $backorders = $productsBackorders;
1117
+ }
1118
+ return $backorders;
1119
+ }
1120
+
1121
+ /**
1122
+ * Updated tier prices for product (percentage ot fixed)
1123
+ *
1124
+ * @param int $productId
1125
+ * @param int $tierPrices
1126
+ * @param int $identifierType
1127
+ * @return boolean
1128
+ */
1129
+ public function updateTierPrices($productId, $tierPrices, $identifierType = null){
1130
+ $product = $this->_initProduct($productId, $identifierType);
1131
+
1132
+ $updatedTierPrices = $this->prepareTierPrices($product, $tierPrices);
1133
+ if (is_null($updatedTierPrices)) {
1134
+ $this->_fault('data_invalid', Mage::helper('catalog')->__('Invalid Tier Prices'));
1135
+ }
1136
+
1137
+ $product->setData(Mage_Catalog_Model_Product_Attribute_Tierprice_Api::ATTRIBUTE_CODE, $updatedTierPrices);
1138
+ try {
1139
+ if (is_array($errors = $product->validate())) {
1140
+ $strErrors = array();
1141
+ foreach($errors as $code=>$error) {
1142
+ $strErrors[] = ($error === true)? Mage::helper('catalog')->__('Value for "%s" is invalid.', $code) : Mage::helper('catalog')->__('Value for "%s" is invalid: %s', $code, $error);
1143
+ }
1144
+ $this->_fault('data_invalid', implode("\n", $strErrors));
1145
+ }
1146
+ $product->save();
1147
+ } catch (Mage_Core_Exception $e) {
1148
+ $this->_fault('not_updated', $e->getMessage());
1149
+ }
1150
+
1151
+ return true;
1152
+ }
1153
+
1154
+ protected function _initProduct($productId, $identifierType = null)
1155
+ {
1156
+ $product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), $identifierType);
1157
+ if (!$product->getId()) {
1158
+ $this->_fault('product_not_exists');
1159
+ }
1160
+
1161
+ return $product;
1162
+ }
1163
+
1164
+ // prepare tier prices (fixed or percentage)
1165
+ public function prepareTierPrices($product, $tierPrices = null)
1166
+ {
1167
+ if (!is_array($tierPrices)) {
1168
+ return null;
1169
+ }
1170
+
1171
+ $updateValue = array();
1172
+
1173
+ foreach ($tierPrices as $tierPrice) {
1174
+ if (!is_object($tierPrice)
1175
+ || !isset($tierPrice->qty)
1176
+ || !isset($tierPrice->price)) {
1177
+ $this->_fault('data_invalid', Mage::helper('catalog')->__('Invalid Tier Prices'));
1178
+ }
1179
+
1180
+ if (!isset($tierPrice->website) || $tierPrice->website == 'all') {
1181
+ $tierPrice->website = 0;
1182
+ } else {
1183
+ try {
1184
+ $tierPrice->website = Mage::app()->getWebsite($tierPrice->website)->getId();
1185
+ } catch (Mage_Core_Exception $e) {
1186
+ $tierPrice->website = 0;
1187
+ }
1188
+ }
1189
+
1190
+ if (intval($tierPrice->website) > 0 && !in_array($tierPrice->website, $product->getWebsiteIds())) {
1191
+ $this->_fault('data_invalid', Mage::helper('catalog')->__('Invalid tier prices. The product is not associated to the requested website.'));
1192
+ }
1193
+
1194
+ if (!isset($tierPrice->customer_group_id)) {
1195
+ $tierPrice->customer_group_id = 'all';
1196
+ }
1197
+
1198
+ if ($tierPrice->customer_group_id == 'all') {
1199
+ $tierPrice->customer_group_id = Mage_Customer_Model_Group::CUST_GROUP_ALL;
1200
+ }
1201
+
1202
+ if($tierPrice->tier_type && $tierPrice->tier_type != 1 ){
1203
+ $tierPrice->tier_type = 0;
1204
+ }
1205
+
1206
+ $updateValue[] = array(
1207
+ 'website_id' => $tierPrice->website,
1208
+ 'cust_group' => $tierPrice->customer_group_id,
1209
+ 'price_qty' => $tierPrice->qty,
1210
+ 'price' => $tierPrice->price,
1211
+ 'tier_type' => $tierPrice->tier_type
1212
+ );
1213
+ }
1214
+
1215
+ return $updateValue;
1216
+ }
1217
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Attribute/Api.php ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Attribute_Api extends Mage_Catalog_Model_Product_Attribute_Api{
3
+
4
+ /**
5
+ * Get Attribute Option Id
6
+ *
7
+ * @param string $attribute_code : attribute code
8
+ * @param string $attribute_label : attribute label
9
+ * @return id for the given attribute label
10
+ */
11
+ public function getAttributeLabelId($attribute_code, $attribute_label){
12
+
13
+ $entityTypeID = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
14
+
15
+ $attribute = Mage::getResourceModel('eav/entity_attribute_collection')
16
+ ->setCodeFilter($attribute_code)
17
+ ->setEntityTypeFilter($entityTypeID)
18
+ ->getFirstItem();
19
+
20
+ $attributeId = $attribute->getId();
21
+
22
+ if($attributeId == null){
23
+ return $this->_fault('att_not_exists');
24
+ }
25
+
26
+ $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
27
+ $attribute_options = $attribute ->getSource()->getAllOptions();
28
+
29
+ foreach($attribute_options as $option){
30
+ if($option['label'] == $attribute_label){
31
+ return $option['value'];
32
+ }
33
+ }
34
+
35
+ return $this->_fault('option_not_exists');
36
+ }
37
+
38
+ /**
39
+ * Add attribute options
40
+ *
41
+ * @param string $attributeCode
42
+ * @param array $attributeOptions
43
+ * @return boolean
44
+ */
45
+ public function addoptions($attributeCode, $attributeOptions){
46
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
47
+ $entityTypeID = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
48
+ $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
49
+ ->setEntityTypeFilter($entityTypeID)
50
+ ->setCodeFilter($attributeCode)
51
+ ->getFirstItem();
52
+ $attributeId = $attributeInfo['attribute_id'];
53
+
54
+ if($attributeId == null){
55
+ return $this->_fault('att_not_exists');
56
+ }
57
+
58
+ try{
59
+ for($i = 0; $i < sizeof($attributeOptions); $i++) {
60
+ $option = array();
61
+ $option['attribute_id'] = $attributeId;
62
+ $option['value'][$value][0] = $attributeOptions[$i];
63
+
64
+ $setup->addAttributeOption($option);
65
+ }
66
+
67
+ return true;
68
+ }catch(Exception $ex){
69
+ $this->_fault('can_not_add_option', $ex->getMessage());
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Set All attribute options
75
+ *
76
+ * @param string $attributeCode
77
+ * @param array of strings $attributeOptions
78
+ * @return boolean
79
+ */
80
+ public function setOptions($attributeCode, $attributeOptions){
81
+
82
+ if(count($attributeOptions) == 0){
83
+ $this->_fault('array_options_not_passed');
84
+ }
85
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
86
+
87
+
88
+ $attribute_model = Mage::getModel('eav/entity_attribute');
89
+ $attribute_options_model= Mage::getModel('eav/entity_attribute_source_table') ;
90
+
91
+ $attribute_id = $attribute_model->getIdByCode('catalog_product', $attributeCode);
92
+
93
+ if($attribute_id == null){
94
+ return $this->_fault('att_not_exists');
95
+ }
96
+ $attribute = $attribute_model->load($attribute_id);
97
+
98
+ $attribute_table = $attribute_options_model->setAttribute($attribute);
99
+ $options = $attribute_options_model->getAllOptions(false);
100
+
101
+ try{
102
+ for($i = 0; $i < sizeof($attributeOptions); $i++) {
103
+ $exist = false;
104
+ if($options){
105
+ foreach ($options as $option){
106
+ if(in_array($attributeOptions[$i],$option))
107
+ $exist = true;
108
+ }
109
+ }
110
+ if($exist)
111
+ continue;
112
+
113
+ $option = array();
114
+ $option['attribute_id'] = $attribute_id;
115
+ $option['value'][$value][0] = $attributeOptions[$i];
116
+
117
+ $setup->addAttributeOption($option);
118
+ }
119
+
120
+ return true;
121
+ }catch(Exception $ex){
122
+ $this->_fault('can_not_add_option', $ex->getMessage());
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Delete attribute options
128
+ *
129
+ * @param string $attributeCode
130
+ */
131
+ public function deleteOptions($attributeCode){
132
+
133
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
134
+
135
+ $attribute_model = Mage::getModel('eav/entity_attribute');
136
+ $attribute_options_model = Mage::getModel('eav/entity_attribute_source_table') ;
137
+
138
+ $attribute_id = $attribute_model->getIdByCode('catalog_product', $attributeCode);
139
+
140
+ if($attribute_id == null){
141
+ return $this->_fault('att_not_exists');
142
+ }
143
+ $attribute = $attribute_model->load($attribute_id);
144
+
145
+ $attribute_table = $attribute_options_model->setAttribute($attribute);
146
+ $options = $attribute_options_model->getAllOptions(false);
147
+
148
+ if($options){
149
+ try{
150
+ foreach ($options as $option){
151
+ $option_id = $option['value'];
152
+ $options['delete'][$option_id] = true;
153
+ $options['value'][$option_id] = true;
154
+ }
155
+
156
+ $setup->addAttributeOption($options);
157
+ }catch(Exception $ex){
158
+ $this->_fault('can_not_delete_option', $ex->getMessage());
159
+ }
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Delete product attribute
165
+ *
166
+ * @param string $attributeName
167
+ * @param int $store
168
+ * @return boolean
169
+ */
170
+ public function delete($attributeName, $store = null){
171
+ $storeId = $this->_getStoreId($store);
172
+ $attribute = Mage::getModel('catalog/product')
173
+ ->setStoreId($storeId)
174
+ ->getResource()
175
+ ->getAttribute($attributeName);
176
+
177
+ if (!$attribute) {
178
+ $this->_fault('not_exists');
179
+ }
180
+
181
+ try {
182
+ $attribute->delete();
183
+ } catch (Mage_Core_Exception $e) {
184
+ $this->_fault('not_deleted', $e->getMessage());
185
+
186
+ return false;
187
+ }
188
+ return true;
189
+ }
190
+
191
+
192
+ /**
193
+ * Create new product attribute
194
+ *
195
+ * @param striong $labelText : label of the new attribute
196
+ * @param string $attributeCode : new attribute code
197
+ * @param array $values : Attribute values
198
+ * @param array $productTypes : Possible values are(simple, grouped, configurable, virtual, bundle, downloadable, giftcard)
199
+ * @return int : attribute Id
200
+ */
201
+ public function create($labelText, $attributeCode, $values = null, $productTypes = null){
202
+ $labelText = trim($labelText);
203
+ $attributeCode = trim($attributeCode);
204
+
205
+ if($labelText == '' || $attributeCode == ''){
206
+ $this->_fault('att_code_label_not_provided');
207
+ }
208
+ if($values === null){
209
+ $values = array();
210
+ }
211
+
212
+ if($productTypes === null){
213
+ $productTypes = array();
214
+ }
215
+
216
+ $entityTypeID = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
217
+ $attribute = Mage::getResourceModel('eav/entity_attribute_collection')
218
+ ->setCodeFilter($attributeCode)
219
+ ->setEntityTypeFilter($entityTypeID)
220
+ ->getFirstItem();
221
+ $attributId = $attribute->getId();
222
+ if($attributId != null){
223
+ return $attributId;
224
+ }
225
+
226
+ $data = array(
227
+ 'is_global' => '1',
228
+
229
+ 'frontend_input' => 'text',
230
+
231
+ 'default_value_text' => '',
232
+
233
+ 'default_value_yesno' => '0',
234
+
235
+ 'default_value_date' => '',
236
+
237
+ 'default_value_textarea' => '',
238
+
239
+ 'is_unique' => '0',
240
+
241
+ 'is_required' => '0',
242
+
243
+ 'frontend_class' => '',
244
+
245
+ 'is_searchable' => '1',
246
+
247
+ 'is_visible_in_advanced_search' => '1',
248
+
249
+ 'is_comparable' => '1',
250
+
251
+ 'is_used_for_promo_rules' => '0',
252
+
253
+ 'is_html_allowed_on_front' => '1',
254
+
255
+ 'is_visible_on_front' => '0',
256
+
257
+ 'used_in_product_listing' => '0',
258
+
259
+ 'used_for_sort_by' => '0',
260
+
261
+ 'is_configurable' => '0',
262
+
263
+ 'is_filterable' => '0',
264
+
265
+ 'is_filterable_in_search' => '0',
266
+
267
+ 'backend_type' => 'varchar',
268
+
269
+ 'default_value' => '',
270
+ );
271
+
272
+ foreach($values as $key => $newValue){
273
+
274
+ if(isset($data[$key]) == false){
275
+ $this->_fault('attr_code_not_valid');
276
+ }else{
277
+ $data[$key] = $newValue;
278
+ }
279
+ }
280
+
281
+ $data['apply_to'] = $productTypes;
282
+ $data['attribute_code'] = $attributeCode;
283
+ $data['frontend_label'] = array(
284
+ 0 => $labelText,
285
+
286
+ 1 => '',
287
+
288
+ 3 => '',
289
+
290
+ 2 => '',
291
+
292
+ 4 => '',
293
+ );
294
+
295
+ $model = Mage::getModel('catalog/resource_eav_attribute');
296
+ $model->addData($data);
297
+ $model->setEntityTypeId($entityTypeID);
298
+ $model->setIsUserDefined(1);
299
+
300
+ try{
301
+ $model->save();
302
+ }catch(Exception $ex){
303
+ $this->_fault('cat_not_create_attribute');
304
+ }
305
+
306
+ $id = $model->getId();
307
+ return $id;
308
+ }
309
+
310
+ /**
311
+ * Get sets that contain listed attributes
312
+ *
313
+ * @param array $attr_codes : Array of attribute codes
314
+ * @return array of attribute sets that contain listed attributes
315
+ */
316
+ public function getSets($attr_codes){
317
+ if(!is_array($attr_codes)){
318
+ $this->_fault('array_not_passed');
319
+ return;
320
+ }
321
+
322
+ $con_sets = array();
323
+ $entityType = Mage::getModel('catalog/product')->getResource()->getEntityType();
324
+ $sets = Mage::getModel('eav/entity_attribute_set')
325
+ ->getResourceCollection()
326
+ ->setEntityTypeFilter($entityType->getId())
327
+ ->load();
328
+
329
+ foreach($sets as $set){
330
+ $is = true;
331
+ $id = $set->getId();
332
+ $data = $set->getData();
333
+ $collection = Mage::getResourceModel('catalog/product_attribute_collection')
334
+ ->addVisibleFilter()
335
+ ->setAttributeSetFilter($id)
336
+ ->getData();
337
+
338
+ $at = array();
339
+ foreach($collection as $attr) {
340
+ $code = $attr['attribute_code'];
341
+ $at[] = $code;
342
+ }
343
+ foreach($attr_codes as $code){
344
+ if(!in_array($code, $at)){
345
+ $is = false;
346
+ break;
347
+ }
348
+ }
349
+
350
+ if($is){
351
+ $inset = array('id'=>$id,'name'=>$data['attribute_set_name']);
352
+ $con_sets[] = $inset;
353
+ }
354
+ }
355
+ if(count($con_sets) > 0){
356
+ return $con_sets;
357
+ }else{
358
+ $this->_fault('no_sets_found');
359
+ return;
360
+ }
361
+ }
362
+
363
+ /**
364
+ * Copy Atribute set
365
+ *
366
+ * @param int $setId : ID of the set to be copied
367
+ * @param string $newSetName : name of the new copied set
368
+ * @return int : ID of the newly created attribute set
369
+ */
370
+ public function copyAttributeSet($setId, $newSetName){
371
+
372
+ $entityType = Mage::getModel('catalog/product')->getResource()->getEntityType();
373
+ $sets = Mage::getModel('eav/entity_attribute_set')
374
+ ->getResourceCollection()
375
+ ->setEntityTypeFilter($entityType->getId())
376
+ ->load();
377
+
378
+ foreach($sets as $set) {
379
+ $data = $set->getData();
380
+ $name = $data['attribute_set_name'];
381
+ if($name == $newSetName){
382
+ $this->_fault('set_name_exists');
383
+ return;
384
+ }
385
+ }
386
+
387
+ $set = Mage::getModel('eav/entity_attribute_set')->load($setId);
388
+ $set_id = $set->getId();
389
+ $set_entity_type = $set->getEntityTypeId();
390
+
391
+ if($set_id == null){
392
+ $this->_fault('set_not_exists');
393
+ return;
394
+ }
395
+
396
+ if($entityType->getId() != $set_entity_type){
397
+ $this->_fault('no_product_attribute_set');
398
+ return;
399
+ }
400
+
401
+ try{
402
+ $model = Mage::getModel('eav/entity_attribute_set')
403
+ ->setEntityTypeId($entityType->getId());
404
+ $model->setAttributeSetName($newSetName);
405
+ $model->save();
406
+ $model->initFromSkeleton($setId);
407
+ $model->save();
408
+ $newId = $model->getId();
409
+ return $newId;
410
+ }catch(Mage_Core_Exception $e){
411
+ return $this->_fault('not_copied',$e->getMessage());
412
+ }
413
+ }
414
+
415
+ /**
416
+ * Add atribute to set
417
+ *
418
+ * @param string $attributeCode
419
+ * @param int $set_id
420
+ * @return string
421
+ */
422
+ public function addToSet($attributeCode,$set_id){
423
+ $entityType = Mage::getModel('catalog/product')->getResource()->getEntityType();
424
+ $setId = null;
425
+ $set = Mage::getModel('eav/entity_attribute_set')->load($set_id);
426
+
427
+ $setId = $set->getId();
428
+ if($setId == null){
429
+ return $this->_fault('set_not_exists');
430
+ }
431
+
432
+ $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
433
+ ->setEntityTypeFilter($entityType->getId())
434
+ ->setCodeFilter($attributeCode)
435
+ ->getFirstItem();
436
+
437
+ if(! ($attribute_id = $attributeInfo['attribute_id'])){
438
+ return $this->_fault('att_not_exists');
439
+ }
440
+
441
+ $gr = array();
442
+ $groups = Mage::getModel('eav/entity_attribute_group')
443
+ ->getResourceCollection()
444
+ ->setAttributeSetFilter($setId)
445
+ ->load();
446
+
447
+ foreach($groups as $group){
448
+ $id = $group->getId();
449
+ $data = $group->getData();
450
+ $name = $data['attribute_group_name'];
451
+ $gr[] = $id;
452
+
453
+ }
454
+ sort($gr);
455
+ $group_id = $gr[0];
456
+
457
+ try{
458
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
459
+ $setup->addAttributeToSet($entityType->getId(),$setId, $group_id, $attribute_id);
460
+ return Mage::helper('catalog')->__('The attribute has been added to the set.');
461
+ }catch(Mage_Core_Exception $e){
462
+ return $this->_fault('not_added').$e->getMessage();
463
+ }
464
+ }
465
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Attribute/Api/V2.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Attribute_Api_V2 extends Ecomwise_Mshop_Model_Catalog_Attribute_Api
3
+ {
4
+
5
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Attribute/Tierprice.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Attribute_Tierprice extends Mage_Catalog_Model_Product_Attribute_Backend_Tierprice
3
+ {
4
+ public function afterSave($object){
5
+
6
+ $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId();
7
+ $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0;
8
+
9
+ $tierPrices = $object->getData($this->getAttribute()->getName());
10
+ if (empty($tierPrices)) {
11
+ if ($isGlobal) {
12
+ $this->_getResource()->deletePriceData($object->getId());
13
+ } else {
14
+ $this->_getResource()->deletePriceData($object->getId(), $websiteId);
15
+ }
16
+ return $this;
17
+ }
18
+
19
+ $old = array();
20
+ $new = array();
21
+
22
+ // prepare original data for compare
23
+ $origTierPrices = $object->getOrigData($this->getAttribute()->getName());
24
+ if (!is_array($origTierPrices)) {
25
+ $origTierPrices = array();
26
+ }
27
+ foreach ($origTierPrices as $data) {
28
+ if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) {
29
+ $key = join('-', array($data['website_id'], $data['cust_group'], $data['price_qty'] * 1));
30
+ $old[$key] = $data;
31
+ }
32
+ }
33
+
34
+ // prepare data for save
35
+ foreach ($tierPrices as $data) {
36
+ if (empty($data['price_qty']) || !isset($data['cust_group']) || !empty($data['delete'])) {
37
+ continue;
38
+ }
39
+ if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) {
40
+ continue;
41
+ }
42
+ if (!$isGlobal && (int)$data['website_id'] == 0) {
43
+ continue;
44
+ }
45
+
46
+ $key = join('-', array($data['website_id'], $data['cust_group'], $data['price_qty'] * 1));
47
+
48
+ $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL;
49
+ $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0;
50
+
51
+ $new[$key] = array(
52
+ 'website_id' => $data['website_id'],
53
+ 'all_groups' => $useForAllGroups ? 1 : 0,
54
+ 'customer_group_id' => $customerGroupId,
55
+ 'qty' => $data['price_qty'],
56
+ 'value' => $data['price'],
57
+ 'tier_type' => $data['tier_type'],
58
+ );
59
+ }
60
+
61
+ $delete = array_diff_key($old, $new);
62
+ $insert = array_diff_key($new, $old);
63
+ $update = array_intersect_key($new, $old);
64
+
65
+ $isChanged = false;
66
+ $productId = $object->getId();
67
+
68
+ if (!empty($delete)) {
69
+ foreach ($delete as $data) {
70
+ $this->_getResource()->deletePriceData($productId, null, $data['price_id']);
71
+ $isChanged = true;
72
+ }
73
+ }
74
+
75
+ if (!empty($insert)) {
76
+ foreach ($insert as $data) {
77
+ $price = new Varien_Object($data);
78
+ $price->setEntityId($productId);
79
+ $this->_getResource()->savePriceData($price);
80
+ $isChanged = true;
81
+ }
82
+ }
83
+
84
+ if (!empty($update)) {
85
+ foreach ($update as $k => $v) {
86
+ if (($old[$k]['price'] != $v['value']) || ($old[$k]['tier_type'] != $v['tier_type'])) {
87
+ $price = new Varien_Object(array(
88
+ 'value_id' => $old[$k]['price_id'],
89
+ 'value' => $v['value'],
90
+ 'tier_type' => $v['tier_type']
91
+ ));
92
+ $this->_getResource()->savePriceData($price);
93
+ $isChanged = true;
94
+ }
95
+ }
96
+ }
97
+
98
+ if ($isChanged) {
99
+ $valueChangedKey = $this->getAttribute()->getName() . '_changed';
100
+ $object->setData($valueChangedKey, 1);
101
+ }
102
+
103
+ return $this;
104
+ }
105
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Category/Api.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Category_Api extends Mage_Catalog_Model_Category_Api
3
+ {
4
+
5
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Category/Api/V2.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Category_Api_V2 extends Mage_Catalog_Model_Category_Api_V2
3
+ {
4
+ /**
5
+ * Create new category
6
+ *
7
+ * @param int $parentId
8
+ * @param array $categoryData
9
+ * @param int $store
10
+ * @return int : ID of new created category
11
+ */
12
+ public function create($parentId, $categoryData, $store = null)
13
+ {
14
+ $parent_category = $this->_initCategory($parentId, $store);
15
+
16
+ $category = Mage::getModel('catalog/category')
17
+ ->setStoreId($this->_getStoreId($store));
18
+
19
+ $category->addData(array('path'=>implode('/',$parent_category->getPathIds())));
20
+
21
+ $category ->setAttributeSetId($category->getDefaultAttributeSetId());
22
+ /* @var $category Mage_Catalog_Model_Category */
23
+
24
+ foreach ($category->getAttributes() as $attribute) {
25
+ $_attrCode = $attribute->getAttributeCode();
26
+ if ($this->_isAllowedAttribute($attribute)
27
+ && isset($categoryData->$_attrCode)) {
28
+ $category->setData(
29
+ $attribute->getAttributeCode(),
30
+ $categoryData->$_attrCode
31
+ );
32
+ }
33
+ }
34
+
35
+ $category->setParentId($parent_category->getId());
36
+ try {
37
+ $validate = $category->validate();
38
+ if ($validate !== true) {
39
+ foreach ($validate as $code => $error) {
40
+ if ($error === true) {
41
+ if($code !== 'available_sort_by' and substr(Mage::getVersion(), 0, 3) != "1.4"){
42
+ Mage::throwException(Mage::helper('catalog')->__('Attribute "%s" is required.', $code));
43
+ }
44
+ }
45
+ else {
46
+ Mage::throwException($error);
47
+ }
48
+ }
49
+ }
50
+ $category->save();
51
+ }
52
+ catch (Mage_Core_Exception $e) {
53
+ $this->_fault('data_invalid', $e->getMessage());
54
+ }
55
+ return $category->getId();
56
+ }
57
+
58
+ public function assignProduct($categoryId, $productId, $position = null, $identifierType = null)
59
+ {
60
+ if($identifierType == 'sku'){
61
+ $product = Mage::getModel('catalog/product');
62
+ $productId = $product->getIdBySku($productId);
63
+ if(!$productId){
64
+ $this->_fault('not_exists','Product not exists.');
65
+ }
66
+ }else{
67
+ $product = Mage::getModel('catalog/product')->load($productId);
68
+ if(!$productId = $product->getId()){
69
+ $this->_fault('not_exists','Product not exists.');
70
+ }
71
+ }
72
+
73
+ $category = $this->_initCategory($categoryId);
74
+ $positions = $category->getProductsPosition();
75
+
76
+ $positions[$productId] = $position;
77
+ $category->setPostedProducts($positions);
78
+
79
+ try {
80
+ $category->save();
81
+ }catch (Mage_Core_Exception $e) {
82
+ $this->_fault('data_invalid', $e->getMessage());
83
+ }
84
+
85
+ return true;
86
+ }
87
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Product/Api/V2.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Product_Api_V2 extends Mage_Catalog_Model_Product_Api_V2{
3
+
4
+ /**
5
+ * Create product
6
+ *
7
+ * @param string $type
8
+ * @param int $set
9
+ * @param string $sku
10
+ * @param array $productData
11
+ */
12
+ public function create($type, $set, $sku, $productData)
13
+ {
14
+ if (!$type || !$set || !$sku) {
15
+ $this->_fault('data_invalid');
16
+ }
17
+ $product = Mage::getModel('catalog/product');
18
+ /* @var $product Mage_Catalog_Model_Product */
19
+
20
+ $product->setStoreId($this->_getStoreId())
21
+ ->setAttributeSetId($set)
22
+ ->setTypeId($type)
23
+ ->setSku($sku);
24
+
25
+ if (property_exists($productData, 'website_ids') && is_array($productData->website_ids)) {
26
+ $product->setWebsiteIds($productData->website_ids);
27
+ }
28
+
29
+ if (property_exists($productData, 'additional_attributes')) {
30
+
31
+ Mage::log($productData->additional_attributes);
32
+ foreach ($productData->additional_attributes as $_attribute) {
33
+ $_attrCode = $_attribute->key;
34
+ $productData->$_attrCode = $_attribute->value;
35
+ }
36
+ unset($productData->additional_attributes);
37
+ }
38
+
39
+ foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
40
+ $_attrCode = $attribute->getAttributeCode();
41
+ if ($this->_isAllowedAttribute($attribute)
42
+ && isset($productData->$_attrCode)) {
43
+ $product->setData(
44
+ $attribute->getAttributeCode(),
45
+ $productData->$_attrCode
46
+ );
47
+ }
48
+ }
49
+
50
+ $this->_prepareDataForSave($product, $productData, "create");
51
+
52
+ try {
53
+ if (is_array($errors = $product->validate())) {
54
+ $strErrors = array();
55
+ foreach($errors as $code=>$error) {
56
+ $strErrors[] = ($error === true)? Mage::helper('catalog')->__('Attribute "%s" is invalid.', $code) : $error;
57
+ }
58
+ $this->_fault('data_invalid', implode("\n", $strErrors));
59
+ }
60
+ $product->save();
61
+ } catch (Mage_Core_Exception $e) {
62
+ $this->_fault('data_invalid', $e->getMessage());
63
+ }
64
+ return $product->getId();
65
+ }
66
+
67
+
68
+ /**
69
+ * Update product
70
+ *
71
+ * @param int $productId
72
+ * @param array $productData
73
+ * @param int $store
74
+ * @param int $identifierType
75
+ * @return boolean
76
+ */
77
+ public function update($productId, $productData, $store = null, $identifierType = null)
78
+ {
79
+ $product = $this->_getProduct($productId, $store, $identifierType);
80
+
81
+ if (!$product->getId()) {
82
+ $this->_fault('not_exists');
83
+ }
84
+
85
+ if (property_exists($productData, 'website_ids') && is_array($productData->website_ids)) {
86
+ $product->setWebsiteIds($productData->website_ids);
87
+ }
88
+
89
+ if (property_exists($productData, 'additional_attributes')) {
90
+ foreach ($productData->additional_attributes as $_attribute) {
91
+ $_attrCode = $_attribute->key;
92
+ $productData->$_attrCode = $_attribute->value;
93
+ }
94
+ unset($productData->additional_attributes);
95
+ }
96
+
97
+ foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
98
+ $_attrCode = $attribute->getAttributeCode();
99
+ if ($this->_isAllowedAttribute($attribute)
100
+ && isset($productData->$_attrCode)) {
101
+ $product->setData(
102
+ $attribute->getAttributeCode(),
103
+ $productData->$_attrCode
104
+ );
105
+ }
106
+ }
107
+
108
+ //fix for minimal price
109
+ if(isset($productData->price)){
110
+ if($product->getMinimalPrice() != null && $product->getMinimalPrice() != "" && $product->getMinimalPrice() < (float)$productData->price ){
111
+ $product->setMinimalPrice($productData->price);
112
+ }
113
+ }
114
+
115
+ $this->_prepareDataForSave($product, $productData, "update");
116
+
117
+ try {
118
+ if (is_array($errors = $product->validate())) {
119
+ $strErrors = array();
120
+ foreach($errors as $code=>$error) {
121
+ $strErrors[] = ($error === true)? Mage::helper('catalog')->__('Value for "%s" is invalid.', $code) : Mage::helper('catalog')->__('Value for "%s" is invalid: %s', $code, $error);
122
+ }
123
+ $this->_fault('data_invalid', implode("\n", $strErrors));
124
+ }
125
+ $product->save();
126
+ } catch (Mage_Core_Exception $e) {
127
+ $this->_fault('data_invalid', $e->getMessage());
128
+ }
129
+
130
+ return true;
131
+ }
132
+
133
+
134
+ protected function _prepareDataForSave ($product, $productData, $caller = null)
135
+ {
136
+ if (property_exists($productData, 'categories') && is_array($productData->categories)) {
137
+ $product->setCategoryIds($productData->categories);
138
+ }
139
+
140
+ if (property_exists($productData, 'websites') && is_array($productData->websites)) {
141
+ foreach ($productData->websites as &$website) {
142
+ if (is_string($website)) {
143
+ try {
144
+ $website = Mage::app()->getWebsite($website)->getId();
145
+ } catch (Exception $e) { }
146
+ }
147
+ }
148
+ $product->setWebsiteIds($productData->websites);
149
+ }
150
+
151
+ if (Mage::app()->isSingleStoreMode()) {
152
+ $product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
153
+ }
154
+
155
+ if($caller != null && $caller == "update"){
156
+
157
+ if (property_exists($productData, 'stock_data')) {
158
+
159
+ $_stockData = array('use_config_manage_stock' => 1);
160
+ foreach ($productData->stock_data as $key => $value) {
161
+ $_stockData[$key] = $value;
162
+ }
163
+
164
+ if($productData->stock_data->qty && $productData->stock_data->qty > 0 ){
165
+ $_stockData['is_in_stock'] = 1;
166
+ }else{
167
+ $_stockData['is_in_stock'] = 0;
168
+ }
169
+ $product->setStockData($_stockData);
170
+ }
171
+ }else{
172
+
173
+ if (property_exists($productData, 'stock_data')) {
174
+ $_stockData = array();
175
+ foreach ($productData->stock_data as $key => $value) {
176
+ $_stockData[$key] = $value;
177
+ }
178
+ } else {
179
+ $_stockData = array('use_config_manage_stock' => 0);
180
+ }
181
+
182
+ if($productData->stock_data->qty && $productData->stock_data->qty > 0 ){
183
+ $_stockData['is_in_stock'] = 1;
184
+ }else{
185
+ $_stockData['is_in_stock'] = 0;
186
+ }
187
+ $product->setStockData($_stockData);
188
+ }
189
+
190
+ if (property_exists($productData, 'tier_price')) {
191
+ $tierPrices = Mage::getModel('catalog/product_attribute_tierprice_api_V2')->prepareTierPrices($product, $productData->tier_price);
192
+ $product->setData(Mage_Catalog_Model_Product_Attribute_Tierprice_Api_V2::ATTRIBUTE_CODE, $tierPrices);
193
+ }
194
+ }
195
+
196
+ /**
197
+ * Override for default 'catalogProductInfo', adds the 'cost' property to the response Entity
198
+ *
199
+ * @param int $productId
200
+ * @param int $store
201
+ * @param array $attributes
202
+ * @param int $identifierType
203
+ * @return array of product attributes
204
+ */
205
+ public function info($productId, $store = null, $attributes = null, $identifierType = null)
206
+ {
207
+ $product = $this->_getProduct($productId, $store, $identifierType);
208
+
209
+ if (!$product->getId()) {
210
+ $this->_fault('not_exists');
211
+ }
212
+
213
+ $result = array( // Basic product data
214
+ 'product_id' => $product->getId(),
215
+ 'sku' => $product->getSku(),
216
+ 'set' => $product->getAttributeSetId(),
217
+ 'type' => $product->getTypeId(),
218
+ 'categories' => $product->getCategoryIds(),
219
+ 'websites' => $product->getWebsiteIds(),
220
+ 'cost' => $product->getCost()
221
+ );
222
+
223
+ $allAttributes = array();
224
+ if (isset($attributes->attributes)) {
225
+ $allAttributes += array_merge($allAttributes, $attributes->attributes);
226
+ }
227
+
228
+ $_additionalAttributeCodes = array();
229
+ if (isset($attributes->additional_attributes)) {
230
+ foreach ($attributes->additional_attributes as $k => $_attributeCode) {
231
+ $allAttributes[] = $_attributeCode;
232
+ $_additionalAttributeCodes[] = $_attributeCode;
233
+ }
234
+ }
235
+
236
+ $_additionalAttribute = 0;
237
+ foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
238
+ if ($this->_isAllowedAttribute($attribute, $allAttributes)) {
239
+ if (in_array($attribute->getAttributeCode(), $_additionalAttributeCodes)) {
240
+ $result['additional_attributes'][$_additionalAttribute]['key'] = $attribute->getAttributeCode();
241
+ $result['additional_attributes'][$_additionalAttribute]['value'] = $product->getData($attribute->getAttributeCode());
242
+ $_additionalAttribute++;
243
+ } else {
244
+ $result[$attribute->getAttributeCode()] = $product->getData($attribute->getAttributeCode());
245
+ }
246
+ }
247
+ }
248
+ return $result;
249
+ }
250
+ }
app/code/community/Ecomwise/Mshop/Model/Catalog/Product/Type/Price.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Catalog_Product_Type_Price extends Mage_Catalog_Model_Product_Type_Price{
3
+
4
+ public function getTierPrice($qty=null, $product)
5
+ {
6
+ $allGroups = Mage_Customer_Model_Group::CUST_GROUP_ALL;
7
+ $prices = Mage::getModel("catalog/product")->load($product->getId())->getData('tier_price');
8
+
9
+ if (is_null($prices)) {
10
+ if ($attribute = $product->getResource()->getAttribute('tier_price')) {
11
+ $attribute->getBackend()->afterLoad($product);
12
+ $prices = $product->getData('tier_price');
13
+ }
14
+ }
15
+
16
+ if (is_null($prices) || !is_array($prices)) {
17
+ if (!is_null($qty)) {
18
+ return $product->getPrice();
19
+ }
20
+ return array(array(
21
+ 'price' => $product->getPrice(),
22
+ 'website_price' => $product->getPrice(),
23
+ 'price_qty' => 1,
24
+ 'cust_group' => $allGroups,
25
+ ));
26
+ }
27
+
28
+ $custGroup = $this->_getCustomerGroupId($product);
29
+ if ($qty) {
30
+ $prevQty = 1;
31
+ $prevPrice = $product->getPrice();
32
+ $prevGroup = $allGroups;
33
+ foreach ($prices as $price) {
34
+
35
+ if ($price['cust_group']!=$custGroup && $price['cust_group']!=$allGroups) {
36
+ // tier not for current customer group nor is for all groups
37
+ continue;
38
+ }
39
+ if ($qty < $price['price_qty']) {
40
+ // tier is higher than product qty
41
+ continue;
42
+ }
43
+ if ($price['price_qty'] < $prevQty) {
44
+ // higher tier qty already found
45
+ continue;
46
+ }
47
+ if ($price['price_qty'] == $prevQty && $prevGroup != $allGroups && $price['cust_group'] == $allGroups) {
48
+ // found tier qty is same as current tier qty but current tier group is ALL_GROUPS
49
+ continue;
50
+ }
51
+
52
+ $prevPrice = $price['website_price'];
53
+ $prevQty = $price['price_qty'];
54
+ if($price['tier_type'] == 1 && $price['price_qty'] <= 100){
55
+ $off = ($price['website_price'] * $product->getPrice())/100;
56
+ $prevPrice = $product->getPrice() - $off;
57
+
58
+ }
59
+ $prevGroup = $price['cust_group'];
60
+ }
61
+
62
+ return $prevPrice;
63
+ } else {
64
+ $qtyCache = array();
65
+ foreach ($prices as $i => $price) {
66
+ if ($price['cust_group'] != $custGroup && $price['cust_group'] != $allGroups) {
67
+ unset($prices[$i]);
68
+ } else if (isset($qtyCache[$price['price_qty']])) {
69
+ $j = $qtyCache[$price['price_qty']];
70
+ if ($prices[$j]['website_price'] > $price['website_price']) {
71
+ unset($prices[$j]);
72
+ $qtyCache[$price['price_qty']] = $i;
73
+ } else {
74
+ unset($prices[$i]);
75
+ }
76
+ } else {
77
+ $qtyCache[$price['price_qty']] = $i;
78
+ }
79
+ }
80
+ }
81
+
82
+ return ($prices) ? $prices : array();
83
+ }
84
+ }
app/code/community/Ecomwise/Mshop/Model/Config/Source/Orderattributes.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Config_Source_Orderattributes {
3
+
4
+ public function toOptionArray(){
5
+
6
+ $resource = Mage::getSingleton('core/resource');
7
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
8
+ $order_et = $resource->getTableName('sales_flat_order');
9
+
10
+ $query = 'SHOW COLUMNS FROM '.$order_et.'';
11
+ $rows = $cr->fetchAll($query);
12
+
13
+ $otions = array();
14
+
15
+ foreach($rows as $key=>$val){
16
+ $value = $val['Field'];
17
+
18
+ $value_label_array = explode('_', $value);
19
+
20
+ $value_label = implode(' ', $value_label_array);
21
+ $value_label = ucwords($value_label);
22
+ $options [] = array('value' => $value, 'label'=>$value_label);
23
+
24
+ }
25
+ return $options;
26
+ }
27
+
28
+ }
app/code/community/Ecomwise/Mshop/Model/Customer/Api/V2.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Customer_Api_V2 extends Mage_Customer_Model_Customer_Api_V2{
3
+
4
+ /**
5
+ * Override for customerCustomerCreate()
6
+ * Create new customer, confirmed account and send auto generated password
7
+ *
8
+ * @param array $customerData
9
+ * @return int : customer ID
10
+ */
11
+ public function create($customerData)
12
+ {
13
+ $customerData = $this->_prepareData($customerData);
14
+ try {
15
+ $customer = Mage::getModel('customer/customer')
16
+ ->setData($customerData)
17
+ ->setForceConfirmed(true)
18
+ ->save();
19
+
20
+ $sendMailIsActive = Mage::getStoreConfig('mshop/parameters/send_mail');
21
+ if($sendMailIsActive)
22
+ {
23
+ if(!isset($customerData['password'])) {
24
+ $newPassword = $customer->generatePassword();
25
+ $customer->changePassword($newPassword);
26
+ }
27
+ $customer->sendNewAccountEmail('registered', '', $customerData['store_id']);
28
+ }
29
+
30
+ } catch (Mage_Core_Exception $e) {
31
+ $this->_fault('data_invalid', $e->getMessage());
32
+ }
33
+ return $customer->getId();
34
+ }
35
+ }
app/code/community/Ecomwise/Mshop/Model/Observer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Observer extends Varien_Object{
3
+
4
+ public function saveConfigAfter($data){
5
+
6
+ $order = $data['order'];
7
+
8
+ $resource = Mage::getSingleton('core/resource');
9
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
10
+ $cw = Mage::getSingleton('core/resource')->getConnection('core_write');
11
+ $esbo_t = $resource->getTableName('ecomwise_settings_before_order');
12
+
13
+ $query = $cr->query("SHOW TABLES LIKE '".$esbo_t."'");
14
+ $num_rows = count($query->fetchAll());
15
+
16
+ if($num_rows == 1){
17
+
18
+ $includeTaxSettings = Mage::getStoreConfig('tax/calculation/price_includes_tax');
19
+
20
+ $orderId = $order->getId();
21
+
22
+ $select_esbo_t = $cr->select()
23
+ ->from($esbo_t)
24
+ ->where("order_id=?", $orderId);
25
+
26
+ $esbo_row = $cr->fetchRow($select_esbo_t);
27
+
28
+ if(!$esbo_row)
29
+ {
30
+ $cw->query('INSERT INTO '.$esbo_t.' (`order_id`,`including_tax`) VALUES ('.$orderId.','.$includeTaxSettings.')');
31
+ }
32
+ }
33
+ }
34
+ }
app/code/community/Ecomwise/Mshop/Model/Resource/Eav/Tierprice.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Resource_Eav_Tierprice extends Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice
3
+ {
4
+ /**
5
+ * Load Tier Prices for product
6
+ *
7
+ * @param int $productId
8
+ * @param int $websiteId
9
+ * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice
10
+ */
11
+ public function loadPriceData($productId, $websiteId = null)
12
+ {
13
+ $adapter = $this->_getReadAdapter();
14
+
15
+ $columns = array(
16
+ 'price_id' => $this->getIdFieldName(),
17
+ 'website_id' => 'website_id',
18
+ 'all_groups' => 'all_groups',
19
+ 'cust_group' => 'customer_group_id',
20
+ 'price_qty' => 'qty',
21
+ 'price' => 'value',
22
+ 'tier_type' => 'tier_type',
23
+ );
24
+
25
+ $select = $adapter->select()
26
+ ->from($this->getMainTable(), $columns)
27
+ ->where('entity_id=?', $productId)
28
+ ->order('qty');
29
+
30
+ if (!is_null($websiteId)) {
31
+ if ($websiteId == '0') {
32
+ $select->where('website_id = ?', $websiteId);
33
+ } else {
34
+ $select->where('website_id IN(?)', array(0, $websiteId));
35
+ }
36
+ }
37
+
38
+ return $adapter->fetchAll($select);
39
+ }
40
+ }
41
+ ?>
app/code/community/Ecomwise/Mshop/Model/Sales/Api/V2.php ADDED
@@ -0,0 +1,1538 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ecomwise_Mshop_Model_Sales_Api_V2 extends Mage_Sales_Model_Order_Api_V2{
3
+
4
+ /**
5
+ * Shippment create API Function
6
+ * @param string $orderIncrementId
7
+ * @param string $comment
8
+ * @param boolean $email
9
+ * @param strnig $trackNumber
10
+ * @return string shippment id
11
+ */
12
+ public function orderShipmentCreate($orderIncrementId, $comment = null, $email = false, $trackNumber = null){
13
+ $shipmentId = Mage::getModel('sales/order_shipment_api')->create($orderIncrementId, array(), $comment, $email, 0);
14
+ if($trackNumber!=null){
15
+ $trackId = Mage::getModel('sales/order_shipment_api')->addTrack($shipmentId, "custom", " ", $trackNumber);
16
+ }
17
+ return $shipmentId;
18
+ }
19
+
20
+
21
+ /**
22
+ * Credit Memo Info function
23
+ * @param string $creditmemoIncrementId
24
+ * @return array
25
+ */
26
+ public function creditMemo($creditmemoIncrementId)
27
+ {
28
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
29
+ $resurce = Mage::getSingleton('core/resource');
30
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
31
+
32
+ //Load default credit memo
33
+ $creditmemo = Mage::getModel('sales/order_creditmemo')->load($creditmemoIncrementId, 'increment_id');
34
+ if(!$creditmemo->getIncrementId()){
35
+ $this->_fault("credit_memo_not_exist");
36
+ }
37
+ $result = $this->info(Mage::getModel('sales/order')->load(intval($creditmemo->getOrderId()))->getIncrementId());
38
+ $result["status_creditmemo"] = 1;
39
+
40
+ $bundleFixed = false;
41
+ $bundleItemId = 0;
42
+ $priceIncludingTaxDetected = false;
43
+ $tax_percent = null;
44
+ $mshop_discount_percent_bundle = null;
45
+
46
+ //Get the "System -> Configuration -> Sales -> Tax -> Catalog Prices" settings at the moment of the order
47
+ $esbo_t = $resurce->getTableName('ecomwise_settings_before_order');
48
+ $select_esbo_t = $cr->select()
49
+ ->from($esbo_t)
50
+ ->where("order_id=?", Mage::getModel('sales/order')->load(intval($creditmemo->getOrderId()))->getIncrementId());
51
+
52
+ $esbo_row = $cr->fetchRow($select_esbo_t);
53
+ $includeTaxSettings = null;
54
+ if($esbo_row)
55
+ {
56
+ $includeTaxSettings = $esbo_row['including_tax'];
57
+ }
58
+ $creditmemo = Mage::getModel('sales/order_creditmemo_api')->info($creditmemoIncrementId);
59
+
60
+ //Handle order level data
61
+ $result = $this->setOrderData($creditmemo, $result);
62
+
63
+ $order_item_to_stay = array();
64
+ foreach ($creditmemo['items'] as $cmitem)
65
+ {
66
+ $order_item_to_stay[] = $cmitem['order_item_id'];
67
+ }
68
+
69
+ for ($i = 0; $i <= count($result['items']); $i++)
70
+ {
71
+ if(!in_array($result['items'][$i]['item_id'], $order_item_to_stay))
72
+ {
73
+ unset($result['items'][$i]);
74
+ }
75
+ }
76
+
77
+ $itemCounter = 0;
78
+ $ritems = $result['items'];
79
+ $result['items'] = null; $result['items'] = array();
80
+
81
+ foreach($ritems as $key => $oitem)
82
+ {
83
+ $cmitem = null; $cmitem = array();
84
+ foreach ($creditmemo['items'] as $cmpitem)
85
+ {
86
+ if($oitem['item_id'] == $cmpitem['order_item_id'])
87
+ {
88
+ $cmitem = $cmpitem;
89
+ }
90
+ }
91
+
92
+ //Set item data
93
+ $oitem = $this->setItemData($oitem, $cmitem);
94
+
95
+ //Bundle products handling
96
+ $oitem['mshop_bundle_type'] = 'none';
97
+ $product_options = unserialize($oitem['product_options']);
98
+
99
+ if(array_key_exists('product_calculations', $product_options)) {
100
+ if($product_options['product_calculations'] == 0) {
101
+ $oitem['mshop_bundle_type'] = 'dynamic';
102
+ // Dynamic bundle price: based on underlying products, so set all M-Shop prices to 0
103
+ $oitem['mshop_base_price_incl_tax'] = 0;
104
+ $oitem['mshop_base_price_excl_tax'] = 0;
105
+ $oitem['mshop_discount_percent'] = 0;
106
+ }
107
+ else{
108
+ $bundleFixed = true;
109
+ $oitem['mshop_bundle_type'] = 'fixed';
110
+ }
111
+ }
112
+
113
+ if($oitem['product_type'] == 'bundle' and $product_options['product_calculations'] != 0){
114
+ $bundleItemId = $oitem['item_id'];
115
+ // Set budle product data
116
+ $oitem = $this -> setBundleProductData($oitem, $product_options, $includeTaxSettings);
117
+ $mshop_discount_percent_bundle = $oitem['mshop_discount_percent'];
118
+ }
119
+
120
+ if($bundleItemId != 0 and $oitem['parent_item_id'] == $bundleItemId)
121
+ {
122
+ //this is an underlying item of the bundle product
123
+ $oitem = $this -> setBundleItemsData($oitem, $includeTaxSettings);
124
+ $oitem['mshop_discount_percent'] = $mshop_discount_percent_bundle;
125
+ }
126
+
127
+ $result['items'][] = $oitem;
128
+ $itemCounter++;
129
+ }
130
+
131
+ return $result;
132
+ }
133
+
134
+
135
+ private function setOrderData($creditmemo, $result){
136
+ $result['order_id'] = $creditmemo['creditmemo_id'];
137
+ $result['increment_id'] = $creditmemo['increment_id'];
138
+ $result['mshop_order_increment_id'] = $creditmemo['order_increment_id'];
139
+ $result['store_id'] = $creditmemo['store_id'];
140
+ $result['adjustment_positive'] = $creditmemo['adjustment_positive'];
141
+ $result['base_shipping_tax_amount'] = $creditmemo['base_shipping_tax_amount'];
142
+ $result['store_to_order_rate'] = $creditmemo['store_to_order_rate'];
143
+ $result['base_discount_amount'] = $creditmemo['base_discount_amount'];
144
+ $result['base_to_order_rate'] = $creditmemo['base_to_order_rate'];
145
+ $result['grand_total'] = $creditmemo['grand_total'];
146
+ $result['base_adjustment_negative'] = $creditmemo['base_adjustment_negative'];
147
+ $result['base_subtotal_incl_tax'] = $creditmemo['base_subtotal_incl_tax'];
148
+ $result['shipping_amount'] = $creditmemo['shipping_amount'];
149
+ $result['subtotal_incl_tax'] = $creditmemo['subtotal_incl_tax'];
150
+ $result['adjustment_negative'] = $creditmemo['adjustment_negative'];
151
+ $result['base_shipping_amount'] = $creditmemo['base_shipping_amount'];
152
+ $result['store_to_base_rate'] = $creditmemo['store_to_base_rate'];
153
+ $result['base_to_global_rate'] = $creditmemo['base_to_global_rate'];
154
+ $result['base_subtotal'] = $creditmemo['base_subtotal'];
155
+ $result['discount_amount'] = $creditmemo['discount_amount'];
156
+ $result['subtotal'] = $creditmemo['subtotal'];
157
+ $result['base_grand_total'] = $creditmemo['base_grand_total'];
158
+ $result['base_adjustment_positive'] = $creditmemo['base_adjustment_positive'];
159
+ $result['base_tax_amount'] = $creditmemo['base_tax_amount'];
160
+ $result['shipping_tax_amount'] = $creditmemo['shipping_tax_amount'];
161
+ $result['tax_amount'] = $creditmemo['tax_amount'];
162
+ $result['email_sent'] = $creditmemo['email_sent'];
163
+ $result['state'] = $creditmemo['state'];
164
+ $result['shipping_address_id'] = $creditmemo['shipping_address_id'];
165
+ $result['billing_address_id'] = $creditmemo['billing_address_id'];
166
+ $result['store_currency_code'] = $creditmemo['store_currency_code'];
167
+ $result['order_currency_code'] = $creditmemo['order_currency_code'];
168
+ $result['base_currency_code'] = $creditmemo['base_currency_code'];
169
+ $result['global_currency_code'] = $creditmemo['global_currency_code'];
170
+ $result['created_at'] = $creditmemo['created_at'];
171
+ $result['updated_at'] = $creditmemo['updated_at'];
172
+ $result['hidden_tax_amount'] = $creditmemo['hidden_tax_amount'];
173
+ $result['base_hidden_tax_amount'] = $creditmemo['base_hidden_tax_amount'];
174
+ $result['shipping_hidden_tax_amount'] = $creditmemo['shipping_hidden_tax_amount'];
175
+ $result['base_shipping_hidden_tax_amnt'] = $creditmemo['base_shipping_hidden_tax_amnt'];
176
+ $result['shipping_incl_tax'] = $creditmemo['shipping_incl_tax'];
177
+ $result['base_shipping_incl_tax'] = $creditmemo['shipping_amount'];
178
+ $result['mshop_gross_shipping_amount'] = $creditmemo['shipping_amount'] + $creditmemo['shipping_tax_amount'];
179
+
180
+ return $result;
181
+ }
182
+
183
+ private function setItemData($oitem, $cmitem){
184
+ $oitem['base_price'] = $cmitem['base_price'];
185
+ $oitem['base_price_incl_tax'] = $cmitem['base_price_incl_tax'];
186
+ $oitem['base_discount_amount'] = $cmitem['base_discount_amount'];
187
+ $oitem['tax_amount'] = $cmitem['tax_amount'];
188
+ $oitem['base_row_total'] = $cmitem['base_row_total'];
189
+ $oitem['discount_amount'] = $cmitem['discount_amount'];
190
+ $oitem['row_total'] = $cmitem['row_total'];
191
+ $oitem['price_incl_tax'] = $cmitem['price_incl_tax'];
192
+ $oitem['base_tax_amount'] = $cmitem['base_tax_amount'];
193
+ $oitem['qty'] = $cmitem['qty'];
194
+ $oitem['base_cost'] = $cmitem['base_cost'];
195
+ $oitem['price'] = $cmitem['price'];
196
+ $oitem['base_row_total_incl_tax'] = $cmitem['base_row_total_incl_tax'];
197
+ $oitem['row_total_incl_tax'] = $cmitem['row_total_incl_tax'];
198
+ $oitem['product_id'] = $cmitem['product_id'];
199
+ $oitem['additional_data'] = $cmitem['additional_data'];
200
+ $oitem['description'] = $cmitem['description'];
201
+ $oitem['sku'] = $cmitem['sku'];
202
+ $oitem['free_shipping'] = $cmitem['free_shipping'];
203
+ $oitem['is_qty_decimal'] = $cmitem['is_qty_decimal'];
204
+ $oitem['name'] = $cmitem['name'];
205
+ $oitem['hidden_tax_amount'] = $cmitem['hidden_tax_amount'];
206
+ $oitem['base_hidden_tax_amount'] = $cmitem['base_hidden_tax_amount'];
207
+ $oitem['weee_tax_disposition'] = $cmitem['weee_tax_disposition'];
208
+ $oitem['base_weee_tax_disposition'] = $cmitem['base_weee_tax_disposition'];
209
+ $oitem['base_weee_tax_row_disposition'] = $cmitem['base_weee_tax_row_disposition'];
210
+ $oitem['weee_tax_applied'] = $cmitem['weee_tax_applied'];
211
+ $oitem['base_weee_tax_applied_amount'] = $cmitem['base_weee_tax_applied_amount'];
212
+ $oitem['base_weee_tax_applied_row_amnt'] = $cmitem['base_weee_tax_applied_row_amnt'];
213
+ $oitem['weee_tax_applied_amount'] = $cmitem['weee_tax_applied_amount'];
214
+ $oitem['weee_tax_applied_row_amount'] = $cmitem['weee_tax_applied_row_amount'];
215
+
216
+ $oitem['mshop_base_price_incl_tax'] = number_format(0.0000, 4);
217
+ if($oitem['discount_percent'] != null and $oitem['discount_percent'] != 0.0000){
218
+ if($oitem['base_price_incl_tax'] != null and $oitem['base_price_incl_tax'] != 0.0000)
219
+ $oitem['mshop_base_price_incl_tax'] = number_format($oitem['base_price_incl_tax'], 4,'.', '');
220
+ }else{
221
+ if($oitem['base_price_incl_tax'] != null and $oitem['base_price_incl_tax'] != 0.0000)
222
+ $oitem['mshop_base_price_incl_tax'] = number_format(($oitem['base_price_incl_tax'] - $oitem['base_discount_amount']/$oitem['qty_refunded']), 4,'.', '');
223
+ }
224
+
225
+ $oitem['mshop_base_price_excl_tax'] = number_format(0.0000, 4);
226
+ if($oitem['discount_percent'] != null and $oitem['discount_percent'] != 0.0000){
227
+ if($oitem['base_price'] != null and $oitem['base_price'] != 0.0000)
228
+ $oitem['mshop_base_price_excl_tax'] = number_format($oitem['base_price'], 4,'.', '');
229
+ }else{
230
+ if($oitem['base_price'] != null and $oitem['base_price'] != 0.0000)
231
+ $oitem['mshop_base_price_excl_tax'] = number_format(($oitem['base_price'] - $oitem['base_discount_amount']/$oitem['qty_refunded']), 4,'.', '');
232
+ }
233
+ $oitem['mshop_discount_percent'] = 0;
234
+
235
+ return $oitem;
236
+ }
237
+
238
+ private function setBundleProductData($oitem, $product_options, $includeTaxSettings){
239
+ $tax_percent = $oitem['tax_percent'];
240
+
241
+ $sumOfUnderlyingValues = null;
242
+ if(array_key_exists('bundle_options', $product_options)) {
243
+ $bundle_options = $product_options['bundle_options'];
244
+ foreach ($bundle_options as $bundle_option)
245
+ {
246
+ $value_array = $bundle_option['value'];
247
+ $sumOfUnderlyingValues = null;
248
+ foreach($value_array as $one_value)
249
+ {
250
+ $sumOfUnderlyingValues += $one_value['price'];
251
+ }
252
+ break;
253
+ }
254
+ }
255
+ $sumOfUnderlyingValuesInclTax = null;
256
+ $sumOfUnderlyingValuesExclTax = null;
257
+
258
+ if($includeTaxSettings == "1")
259
+ {
260
+ $sumOfUnderlyingValuesInclTax = $sumOfUnderlyingValues;
261
+ $sumOfUnderlyingValuesExclTax = number_format(($sumOfUnderlyingValuesInclTax / (1 + $tax_percent/100)), 4);
262
+ }
263
+ else
264
+ {
265
+ $sumOfUnderlyingValuesExclTax = $sumOfUnderlyingValues;
266
+ $sumOfUnderlyingValuesInclTax = number_format(($sumOfUnderlyingValuesExclTax * (1 + $tax_percent/100) ), 4);
267
+ }
268
+
269
+ $oitem['mshop_base_price_incl_tax'] = number_format(0.0000, 4);
270
+ if($oitem['discount_percent'] != null and $oitem['discount_percent'] != 0.0000){
271
+ if($cmitem['base_price_incl_tax'] != null and $oitem['base_price_incl_tax'] != 0.0000)
272
+ $oitem['mshop_base_price_incl_tax'] = number_format($oitem['base_price_incl_tax'] - $sumOfUnderlyingValuesInclTax, 4,'.', '');
273
+ }
274
+ else
275
+ {
276
+ if($oitem['base_price_incl_tax'] != null and $oitem['base_price_incl_tax'] != 0.0000)
277
+ $oitem['mshop_base_price_incl_tax'] = number_format(($oitem['base_price_incl_tax'] - $sumOfUnderlyingValuesInclTax - $oitem['base_discount_amount']/$oitem['qty_refunded']), 4,'.', '');
278
+ }
279
+
280
+ $oitem['mshop_base_price_excl_tax'] = number_format(0.0000, 4);
281
+ if($oitem['discount_percent'] != null and $oitem['discount_percent'] != 0.0000){
282
+ if($oitem['base_price'] != null and $oitem['base_price'] != 0.0000)
283
+ $oitem['mshop_base_price_excl_tax'] = number_format($oitem['base_price'] - $sumOfUnderlyingValuesExclTax , 4,'.', '');
284
+ }
285
+ else
286
+ {
287
+ if($oitem['base_price'] != null and $oitem['base_price'] != 0.0000)
288
+ $oitem['mshop_base_price_excl_tax'] = number_format(($oitem['base_price'] - $sumOfUnderlyingValuesExclTax - $oitem['base_discount_amount']/$oitem['qty_refunded']), 4,'.', '');
289
+ }
290
+ $oitem['mshop_discount_percent'] = $oitem['discount_percent'];
291
+
292
+ return $oitem;
293
+ }
294
+
295
+ private function setBundleItemsData($oitem, $includeTaxSettings){
296
+ $tax_percent = $oitem['tax_percent'];
297
+ $underlyingProductOptions = unserialize($oitem['product_options']);
298
+ $bundleSelectionAttributes = unserialize($underlyingProductOptions['bundle_selection_attributes']);
299
+
300
+ $underlyingItemValue = $bundleSelectionAttributes['price'];
301
+ $underlyingItemValueInclTax = null;
302
+ $underlyingItemValueExclTax = null;
303
+
304
+ if($includeTaxSettings == "1")
305
+ {
306
+ $underlyingItemValueInclTax = $underlyingItemValue;
307
+ $underlyingItemValueExclTax = number_format(($underlyingItemValueInclTax / ( 1 + $tax_percent/100)), 4);
308
+ }
309
+ else
310
+ {
311
+ $underlyingItemValueExclTax = $underlyingItemValue;
312
+ $underlyingItemValueInclTax = number_format(($underlyingItemValueExclTax * (1 + $tax_percent/100)), 4);
313
+ }
314
+
315
+ $oitem['mshop_base_price_incl_tax'] = $underlyingItemValueInclTax;
316
+ $oitem['mshop_base_price_excl_tax'] = $underlyingItemValueExclTax;
317
+
318
+ return $oitem;
319
+ }
320
+
321
+ /**
322
+ *
323
+ * List Of Orders filtered by status and order id
324
+ * @param int $startId
325
+ * @param array $orderStatuses
326
+ * @return array
327
+ */
328
+ public function getOrdersFromWithStatus($startId, $orderStatuses){
329
+
330
+ $results = array();
331
+ $lastOrder = Mage::getModel('sales/order')->getCollection()->addOrder('entity_id')->setPageSize(1);
332
+ foreach ($lastOrder as $order){
333
+ $lastOrderId = $order->getId();
334
+ }
335
+
336
+ for($i = $startId + 1; $i < $lastOrderId + 1; $i++){
337
+ $order = Mage::getModel('sales/order')->load($i);
338
+ if($order->getStatus())
339
+ {
340
+ if(in_array($order->getStatus(), $orderStatuses)){
341
+ $results[] = $order->getIncrementId();
342
+ }
343
+ }
344
+ }
345
+ return $results;
346
+ }
347
+
348
+ /**
349
+ *
350
+ * List of Credit memos filtered by credit memo id
351
+ * @param int $startId
352
+ * @return array
353
+ */
354
+ public function getCreditmemosFrom($startId){
355
+ $results = array();
356
+ $lastCreditMemo = Mage::getModel('sales/order_creditmemo')->getCollection()->addOrder('entity_id')->setPageSize(1);
357
+ foreach ($lastCreditMemo as $creditmemo){
358
+ $lastCreditMemoId = $creditmemo->getId();
359
+ }
360
+ for($i = $startId + 1; $i < $lastCreditMemoId + 1; $i++){
361
+ $creditmemo = Mage::getModel('sales/order_creditmemo')->load($i);
362
+ if($creditmemo->getId()){
363
+ $results[] = $creditmemo->getIncrementId();
364
+ }
365
+ }
366
+
367
+ return $results;
368
+ }
369
+
370
+ /**
371
+ * List of items ordered for order filtered by order ids.
372
+ *
373
+ * @param array $ordersIds
374
+ * @return array
375
+ */
376
+ public function getSalesForOrders($ordersIds){
377
+
378
+ if(!is_array($ordersIds)){
379
+ $this->_fault("array_id_not_passed");
380
+ }
381
+
382
+ $increments_string = implode('","', $ordersIds);
383
+ $increments_string = '"'.$increments_string.'"';
384
+ // Resources
385
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
386
+ $resource = Mage::getSingleton('core/resource');
387
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
388
+ $sales_item_table = $resource->getTableName("sales_flat_order_item");
389
+ $sales_table = $resource->getTableName("sales_flat_order");
390
+
391
+
392
+ $query = "SELECT order_id, SUM(qty_ordered) as qty, sku, product_type FROM ".$sales_item_table." as st INNER JOIN ".$sales_table." as s ON st.order_id = s.entity_id WHERE s.increment_id
393
+ IN (".$increments_string.") AND st.product_type <> 'configurable' AND st.product_type <> 'bundle' GROUP BY st.sku";
394
+
395
+ $results_query = $cr->query($query);
396
+
397
+ $results = $results_query->fetchAll();
398
+ return $results;
399
+ }
400
+
401
+ /**
402
+ * List of items ordered for order filtered by order statuses.
403
+ *
404
+ * @param array $ordersIds
405
+ * @return array
406
+ */
407
+ public function getSalesForOrdersWithStatus($orderStatuses){
408
+
409
+ if(!is_array($orderStatuses)){
410
+ $this->_fault("array_id_not_passed");
411
+ }
412
+
413
+ $statuses_string = implode('","', $orderStatuses);
414
+ $statuses_string = '"'.$statuses_string.'"';
415
+ // Resources
416
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
417
+ $resource = Mage::getSingleton('core/resource');
418
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
419
+ $sales_item_table = $resource->getTableName("sales_flat_order_item");
420
+ $sales_table = $resource->getTableName("sales_flat_order");
421
+
422
+
423
+ $query = "SELECT order_id, SUM(qty_ordered) as qty, sku, product_type FROM ".$sales_item_table." as st INNER JOIN ".$sales_table." as s ON st.order_id = s.entity_id WHERE s.status
424
+ IN(".$statuses_string.") AND st.product_type <> 'configurable' AND st.product_type <> 'bundle' GROUP BY st.sku";
425
+
426
+
427
+ $results_query = $cr->query($query);
428
+
429
+ $results = $results_query->fetchAll();
430
+
431
+ return $results;
432
+ }
433
+
434
+ /**
435
+ *
436
+ * @see Mage_Sales_Model_Order_Api_V2::items()
437
+ */
438
+ public function items($filters = null){
439
+ return parent::items($filters);
440
+ }
441
+
442
+
443
+ /**
444
+ * Order Info API method
445
+ *
446
+ * string Order Increment Id
447
+ * @see Mage_Sales_Model_Order_Api::info()
448
+ */
449
+ public function info($orderIncrementId){
450
+
451
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
452
+ $resurce = Mage::getSingleton('core/resource');
453
+ $cr = Mage::getSingleton('core/resource')->getConnection('core_read');
454
+ $tax_con = $resurce->getTableName('tax_calculation');
455
+ $tax_rule = $resurce->getTableName('tax_calculation_rule');
456
+ $tax_classes = $resurce->getTableName('tax_class');
457
+ $tax_rates = $resurce->getTableName('tax_calculation_rate');
458
+
459
+ $order = $this->_initOrder($orderIncrementId);
460
+ $order_id = $order->getId();
461
+ $result = $this->_getAttributes($order, 'order');
462
+ $purchasedFrom = $order->getStoreId();
463
+
464
+ //Get addresses details
465
+ $billing_address = $order->getBillingAddress();
466
+ $shipping_address = $order->getShippingAddress();
467
+ $bundleItemId = 0;
468
+ $priceIncludingTaxDetected = false;
469
+ $tax_percent = null;
470
+ $mshop_discount_percent_bundle = null;
471
+
472
+ //Get the "System -> Configuration -> Sales -> Tax -> Catalog Prices" settings at the moment of the order
473
+ $esbo_t = $resurce->getTableName('ecomwise_settings_before_order');
474
+ $select_esbo_t = $cr->select()
475
+ ->from($esbo_t)
476
+ ->where("order_id=?", $order->getId());
477
+
478
+ $esbo_row = $cr->fetchRow($select_esbo_t);
479
+ $includeTaxSettings = null;
480
+ if($esbo_row)
481
+ {
482
+ $includeTaxSettings = $esbo_row['including_tax'];
483
+ }
484
+
485
+ //Get Shipment Tax Rule
486
+ $customer_group_id = $order->getCustomerGroupId();
487
+ $group = Mage::getModel('customer/group')->load($customer_group_id);
488
+ $cust_tax_class_id = $group->getTaxClassId();
489
+
490
+ $result = $this->getShippingTaxRule($purchasedFrom, $shipping_address, $order, $cust_tax_class_id, $result);
491
+
492
+ $result['mshop_invoice_date'] = $this->getInvoiceDate($orderIncrementId);
493
+ $result['shipping_address'] = $this->_getAttributes($order->getShippingAddress(), 'order_address');
494
+ $result['billing_address'] = $this->_getAttributes($order->getBillingAddress(), 'order_address');
495
+ $result['billing_address']['mshop_middle_name'] = $order->getCustomerMiddlename();
496
+
497
+ $billing_street = $order->getBillingAddress()->getStreet();
498
+ $result = $this->getBillingData($billing_street,$result);
499
+
500
+ $shipping_street = $order->getShippingAddress()->getStreet();
501
+ $result = $this->getShippingData($billing_street,$shipping_street,$result);
502
+
503
+ $result = $this->getCustomerData($order,$result);
504
+
505
+ $result['items'] = array();
506
+
507
+ $sumQuantities = 0;
508
+ foreach ($order->getAllItems() as $item)
509
+ {
510
+ if($item['product_type'] == 'simple')
511
+ {
512
+ $sumQuantities += $item['qty_ordered'];
513
+ }
514
+ }
515
+
516
+ $stores = array();
517
+ foreach ($order->getAllItems() as $item) {
518
+
519
+ $product_id = $item['product_id'];
520
+ $store_id = $item['store_id'];
521
+ $product = Mage::getModel('catalog/product')
522
+ ->setStoreId($store_id)
523
+ ->load($product_id);
524
+ $product_id = $product->getId();
525
+
526
+ $stores_product = $this->getVisibleInStore($product_id);
527
+ $srores_product_single = array();
528
+ $stores_product_single['product_id'] = $product_id;
529
+ $stores_product_single['store_view_ids'] = $stores_product;
530
+ $stores[] = $stores_product_single;
531
+
532
+ $options = $this->_getAttributes($item, 'order_item');
533
+ $options = $this->getItemTaxData($item, $order, $cust_tax_class_id, $product, $options);
534
+ $tax_percent = $options['tax_percent'];
535
+
536
+ $options = $this->getDataForItem($item, $product, $options);
537
+
538
+ //Bundle products handling
539
+ $options = $this->getBundleItemData($item, $tax_percent, $includeTaxSettings, $bundleItemId, $options);
540
+
541
+ //Sweettooth redemption points calculation
542
+ $options = $this->getRedemptionPointsData($options);
543
+
544
+ $result['items'][] = $options;
545
+ }
546
+
547
+ $result['payment'] = $this->_getAttributes($order->getPayment(), 'order_payment');
548
+
549
+ $result = $this->getRemboursData($billing_address, $order, $result);
550
+
551
+ $result['mshop_bankaccount'] = $result['payment']['incasso_bankaccount'] != '' ? $result['payment']['incasso_bankaccount'] : '';
552
+
553
+ $result['mshop_store_views_visible_in'] = $stores;
554
+
555
+ $result['status_history'] = array();
556
+ foreach ($order->getAllStatusHistory() as $history) {
557
+ $result['status_history'][] = $this->_getAttributes($history, 'order_status_history');
558
+ }
559
+
560
+ $result['status'] = $result['status'] == "ideal_paid" ? "processing" : $result['status'] ;
561
+
562
+ $grossShipping = $order->getBaseShippingAmount()+$order->getBaseShippingTaxAmount();
563
+ $result['mshop_gross_shipping_amount'] = number_format($grossShipping != null ? $grossShipping : 0, 4);
564
+
565
+ if($discount_amount = $order->getBaseDiscountAmount()){
566
+ $result['mshop_discount_amount'] = $discount_amount;
567
+ }else{
568
+ $result['mshop_discount_amount'] = 0;
569
+ }
570
+
571
+ $result = $this->getMshopInvoiceId($order, $result);
572
+
573
+ $result = $this->getCustomOrderFields($order, $result);
574
+
575
+ $result['mshop_order_increment_id'] = $orderIncrementId;
576
+
577
+ $result = $this->getMsopPaymentDate($order, $result);
578
+
579
+ return $result;
580
+ }
581
+
582
+ private function getShippingTaxRule($purchasedFrom, $shipping_address, $order, $cust_tax_class_id, $result){
583
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
584
+ $resurce = Mage::getSingleton('core/resource');
585
+ $tax_con = $resurce->getTableName('tax_calculation');
586
+ $tax_rates = $resurce->getTableName('tax_calculation_rate');
587
+
588
+ $tax = Mage::getStoreConfig('tax',$purchasedFrom);
589
+ $class_id = $tax['classes']['shipping_tax_class'];
590
+ $tax_class_for_shipping_id = null;
591
+ if(!($class_id == null || $class_id == '')){
592
+ $tax_class_for_shipping_id = $class_id;
593
+
594
+ $shipping_country_id = $shipping_address['country_id'];
595
+
596
+ if($shipping_country_id != '' && $shipping_country_id != null){
597
+
598
+
599
+ $resultr = $connection->query('SELECT * FROM '.$tax_con.', '.$tax_rates.'
600
+ WHERE '.$tax_con.'.product_tax_class_id = '.$tax_class_for_shipping_id.'
601
+ AND '.$tax_con.'.customer_tax_class_id = '.$cust_tax_class_id.'
602
+ AND '.$tax_rates.'.tax_country_id = "'.$shipping_country_id.'"
603
+ AND '.$tax_rates.'.tax_calculation_rate_id = '.$tax_con.'.tax_calculation_rate_id');
604
+
605
+
606
+ $tax_rule_rows = $resultr->fetchAll(PDO::FETCH_ASSOC);
607
+
608
+ if($tax_rule_rows){
609
+ $result['mshop_shipment_tax_rule'] = strval($tax_rule_rows[0]['tax_calculation_rule_id']);
610
+ }else{
611
+ $result['mshop_shipment_tax_rule'] = '';
612
+ }
613
+ }else{
614
+ $result['mshop_shipment_tax_rule'] = '';
615
+ }
616
+
617
+ }else{
618
+
619
+ $result['mshop_shipment_tax_rule'] = '';
620
+ }
621
+
622
+ return $result;
623
+ }
624
+
625
+
626
+ private function getBillingData($billing_street,$result){
627
+ if(is_array($billing_street)){
628
+
629
+ $result['mshop_billing_address'] = implode(' ', $billing_street);
630
+
631
+ if(count($billing_street) > 2 && isset($billing_street[0])){
632
+ $result['mshop_billing_street_name'] = $billing_street[0];
633
+ }else{
634
+ $result['mshop_billing_street_name'] = '';
635
+ }
636
+
637
+ if(count($billing_street) > 2 &&isset($billing_street[1])){
638
+ $result['mshop_billing_street_number'] = $billing_street[1];
639
+ }else{
640
+ $result['mshop_billing_street_number'] = '';
641
+ }
642
+
643
+
644
+ if(count($billing_street) > 2 &&isset($billing_street[2])){
645
+ $result['mshop_billing_number_addition'] = $billing_street[2];
646
+ }else{
647
+ $result['mshop_billing_number_addition'] = '';
648
+ }
649
+ }else{
650
+ $result['mshop_billing_address'] = '';
651
+ }
652
+ return $result;
653
+ }
654
+
655
+ private function getShippingData($billing_street,$shipping_street,$result){
656
+ if(is_array($shipping_street)){
657
+ $result['mshop_shipping_address'] = implode(' ', $shipping_street);
658
+
659
+ if(count($billing_street) > 2 && isset($billing_street[0])){
660
+ $result['mshop_shipping_street_name'] = $shipping_street[0];
661
+ }else{
662
+ $result['mshop_shipping_street_name'] = '';
663
+ }
664
+
665
+ if(count($billing_street) > 2 && isset($billing_street[1])){
666
+ $result['mshop_shipping_street_number'] = $shipping_street[1];
667
+ }else{
668
+ $result['mshop_shipping_street_number'] = '';
669
+ }
670
+
671
+
672
+ if(count($billing_street) > 2 && isset($billing_street[2])){
673
+ $result['mshop_shipping_number_addition'] = $shipping_street[2];
674
+ }else{
675
+ $result['mshop_shipping_number_addition'] = '';
676
+ }
677
+ }else{
678
+ $result['mshop_shipping_address'] = '';
679
+ }
680
+
681
+ return $result;
682
+ }
683
+
684
+ private function getCustomerData($order, $result){
685
+ if($order->getOnestepcheckoutCustomercomment() and $order->getOnestepcheckoutCustomercomment() != 'Vermeld hier uw specifieke afleverinstructie'){
686
+ $result['mshop_customer_comment'] = $order->getOnestepcheckoutCustomercomment();
687
+ }else{
688
+ $result['mshop_customer_comment'] = '';
689
+ }
690
+ $customer_prefix = $order->getCustomerPrefix();
691
+
692
+ $customer_prefix = ($customer_prefix != null)? $customer_prefix : '';
693
+ $result['mshop_customer_prefix'] = $customer_prefix;
694
+
695
+ $customer_middlename = $order->getCustomerMiddlename();
696
+
697
+ $customer_middlename = ($customer_middlename != null)? $customer_middlename : '';
698
+ $result['mshop_customer_middlename'] = $customer_middlename;
699
+
700
+
701
+ $mapping = array(
702
+ 'nn_NO' => 'NO',
703
+ 'sv_SE' => 'SV',
704
+ 'da_DK' => 'DA',
705
+ 'fi_FI' => 'FI',
706
+ 'en_US' => 'EN',
707
+ 'fr_FR' => 'FR',
708
+ 'de_DE' => 'DE',
709
+ 'es_ES' => 'ES',
710
+ 'it_IT' => 'IT',
711
+ 'pt_PT' => 'PT',
712
+ 'el_GR' => 'EL',
713
+ 'zh_CN' => 'ZH',
714
+ 'cs_CZ' => 'CS',
715
+ 'id_ID' => 'ID',
716
+ 'he_IL' => 'HE',
717
+ 'ja_JP' => 'JA',
718
+ 'ms_MY' => 'MS',
719
+ 'nl_NL' => 'NL',
720
+ 'ru_RU' => 'RU',
721
+ 'ar_SA' => 'AR',
722
+ 'ko_KR' => 'KO',
723
+ 'th_TH' => 'TH',
724
+ 'tr_TR' => 'TR',
725
+ 'is_IS' => 'IS'
726
+ );
727
+
728
+ $result['mshop_customer_language'] = '';
729
+
730
+ $attributeCllId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('customer','customer_language_locale');
731
+ if($attributeCllId)
732
+ {
733
+ $customerModel = Mage::getModel('customer/customer');
734
+ $customerCollection = $customerModel->getCollection();
735
+ foreach ($customerCollection as $customer)
736
+ {
737
+ $customerObj = $customerModel->load($customer->getId());
738
+ if($customerObj->getEmail() == $order->getCustomerEmail())
739
+ {
740
+ if($customerObj->getCustomerLanguageLocale())
741
+ {
742
+ $result['mshop_customer_language'] = $mapping[$customerObj->getCustomerLanguageLocale()];
743
+ }
744
+ }
745
+ }
746
+ }
747
+
748
+ // Customer not exists error fix for customer_is_guest = 0 and customer_id=NULL
749
+ $cus_is_gest = $result['customer_is_guest'];
750
+ if($cus_is_gest != 1){
751
+
752
+ $customer_id = $result['customer_id'];
753
+ if($customer_id != null && $customer_id != ''){
754
+
755
+ $customer = Mage::getModel("customer/customer")->load($customer_id);
756
+ if(!$customer->getId()){
757
+ $result['customer_is_guest'] = 1;
758
+ }
759
+ }else{
760
+ $customer_email = $result['customer_email'] ;
761
+ if($customer_email != null && $customer_email != ''){
762
+
763
+ $store_id = $result['store_id'];
764
+
765
+ $store = Mage::getModel('core/store')->load($store_id);
766
+ if($store->getId()){
767
+
768
+ $website_id = $store->getWebsiteId();
769
+
770
+ $customer = Mage::getModel("customer/customer")->setWebsiteId($website_id)->loadByEmail($customer_email);
771
+ if($customer->getId()){
772
+ $result['customer_id'] = $customer->getId();
773
+ }else{
774
+ $result['customer_is_guest'] = 1;
775
+ }
776
+ }else{
777
+ $result['customer_is_guest'] = 1;
778
+ }
779
+ }else{
780
+ $result['customer_is_guest'] = 1;
781
+ }
782
+ }
783
+ }
784
+
785
+ return $result;
786
+ }
787
+
788
+ private function getItemTaxData($item, $order, $cust_tax_class_id, $product, $options){
789
+
790
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
791
+ $resurce = Mage::getSingleton('core/resource');
792
+ $tax_con = $resurce->getTableName('tax_calculation');
793
+ $tax_rule = $resurce->getTableName('tax_calculation_rule');
794
+ $tax_rates = $resurce->getTableName('tax_calculation_rate');
795
+
796
+ $tax_class_id = $product->getTaxClassId();
797
+
798
+ $product_type = $item['product_type'];
799
+
800
+ if($product_type == "downloadable" || $product_type == "virtual" ){
801
+ $order_billing = $order->getBillingAddress()->getData();
802
+ }else{
803
+ $order_billing = $order->getShippingAddress()->getData();
804
+ }
805
+
806
+ $tax_country_id = $order_billing['country_id'];
807
+
808
+
809
+ if($item['tax_percent'] == null){
810
+ $item['tax_percent'] = 0.0000;
811
+ }
812
+ $resultr = $connection->query('SELECT * FROM '.$tax_rates.' WHERE rate = '.$item['tax_percent'].'
813
+ AND tax_country_id = "'.$tax_country_id.'" LIMIT 1');
814
+
815
+ $tax_rate_row = $resultr->fetch(PDO::FETCH_ASSOC);
816
+
817
+ $tax_rate_id = $tax_rate_row['tax_calculation_rate_id'];
818
+
819
+ if($tax_class_id != null && $cust_tax_class_id !=null && $tax_class_id != '' && $cust_tax_class_id!='' and $tax_rate_id != null and $tax_rate_id != ''){
820
+
821
+ $resultd = $connection->query('SELECT * FROM '.$tax_con.' as kk, '.$tax_rule.' as rr
822
+ WHERE kk.tax_calculation_rule_id = rr.tax_calculation_rule_id
823
+ AND kk.customer_tax_class_id = '.$cust_tax_class_id.'
824
+ AND kk.product_tax_class_id = '.$tax_class_id.'
825
+ AND kk.tax_calculation_rate_id = '.$tax_rate_id.' LIMIT 1');
826
+ $row = $resultd->fetch(PDO::FETCH_ASSOC);
827
+ }
828
+ if($row){
829
+ $rule_id = $row['tax_calculation_rule_id'];
830
+ $rule_name = $row['code'];
831
+ }else{
832
+ $rule_id = ' ';
833
+ $rule_name = ' ';
834
+ }
835
+
836
+ $options['cost'] = $options['base_cost'];
837
+ $options['mshop_taxclass_rule_code'] = $rule_name;
838
+ $options['mshop_taxclass_rule_id'] = $rule_id;
839
+
840
+ return $options;
841
+ }
842
+
843
+ private function getDataForItem($item, $product, $options){
844
+
845
+ $options['mshop_item_id'] = ($options['item_id'] != '')? $options['item_id'] : '';
846
+ $options['mshop_parent_item_id'] = ($options['parent_item_id'] != '')? $options['parent_item_id'] : '';
847
+
848
+ $options['mshop_base_price_incl_tax'] = number_format(0.0000, 4);
849
+ if($item['discount_percent'] != null and $item['discount_percent'] != 0.0000){
850
+ if($item['base_price_incl_tax'] != null and $item['base_price_incl_tax'] != 0.0000)
851
+ $options['mshop_base_price_incl_tax'] = number_format($item['base_price_incl_tax'], 4,'.', '');
852
+ }else{
853
+ if($item['base_price_incl_tax'] != null and $item['base_price_incl_tax'] != 0.0000)
854
+ //1.5.0
855
+ $options['mshop_base_price_incl_tax'] = number_format(($item['base_price_incl_tax'] - $item['base_discount_amount']/$item['qty_ordered']), 4,'.', '');
856
+ }
857
+
858
+ $options['mshop_base_price_excl_tax'] = number_format(0.0000, 4);
859
+ if($item['discount_percent'] != null and $item['discount_percent'] != 0.0000){
860
+ if($item['base_price'] != null and $item['base_price'] != 0.0000)
861
+ $options['mshop_base_price_excl_tax'] = number_format($item['base_price'], 4,'.', '');
862
+ }else{
863
+ if($item['base_price'] != null and $item['base_price'] != 0.0000)
864
+ //1.5.0
865
+ $options['mshop_base_price_excl_tax'] = number_format(($item['base_price'] - $item['base_discount_amount']/$item['qty_ordered']), 4,'.', '');
866
+ }
867
+ $options['mshop_discount_percent'] = $item['discount_percent'];
868
+ $options['mshop_short_description'] = ($product->getShortDescription() != "" && $product->getShortDescription() != null)? $product->getShortDescription() : " ";
869
+
870
+ return $options;
871
+ }
872
+
873
+ private function getBundleItemData ($item, $tax_percent, $includeTaxSettings, $bundleItemId, $options){
874
+ $options['mshop_bundle_type'] = 'none';
875
+
876
+ $product_options = unserialize($options['product_options']);
877
+
878
+ if(array_key_exists('product_calculations', $product_options)) {
879
+ if($product_options['product_calculations'] == 0) {
880
+ $options['mshop_bundle_type'] = 'dynamic';
881
+ // Dynamic bundle price: based on underlying products, so set all M-Shop prices to 0
882
+ $options['mshop_base_price_incl_tax'] = 0;
883
+ $options['mshop_base_price_excl_tax'] = 0;
884
+ $options['mshop_discount_percent'] = 0;
885
+ }
886
+ else{
887
+ $options['mshop_bundle_type'] = 'fixed';
888
+ }
889
+ }
890
+
891
+ if($options['product_type'] == 'bundle' and $product_options['product_calculations'] != 0){
892
+
893
+ $bundleItemId = $options['item_id'];
894
+ $tax_percent = $options['tax_percent'];
895
+
896
+ if(array_key_exists('bundle_options', $product_options)) {
897
+ $bundle_options = $product_options['bundle_options'];
898
+ foreach ($bundle_options as $bundle_option)
899
+ {
900
+ $value_array = $bundle_option['value'];
901
+ foreach($value_array as $one_value)
902
+ {
903
+ $sumOfUnderlyingValues += $one_value['price'];
904
+ }
905
+ }
906
+ }
907
+ $sumOfUnderlyingValuesInclTax = null;
908
+ $sumOfUnderlyingValuesExclTax = null;
909
+
910
+ if($includeTaxSettings == "1")
911
+ {
912
+ $sumOfUnderlyingValuesInclTax = $sumOfUnderlyingValues;
913
+ $sumOfUnderlyingValuesExclTax = number_format(($sumOfUnderlyingValuesInclTax / (1 + $tax_percent/100)), 4);
914
+ }
915
+ else
916
+ {
917
+ $sumOfUnderlyingValuesExclTax = $sumOfUnderlyingValues;
918
+ $sumOfUnderlyingValuesInclTax = number_format(($sumOfUnderlyingValuesExclTax * (1 + $tax_percent/100) ), 4);
919
+ }
920
+
921
+ $options['mshop_base_price_incl_tax'] = number_format(0.0000, 4);
922
+ if($item['discount_percent'] != null and $item['discount_percent'] != 0.0000){
923
+ if($item['base_price_incl_tax'] != null and $item['base_price_incl_tax'] != 0.0000)
924
+ $options['mshop_base_price_incl_tax'] = number_format($item['base_price_incl_tax'] - $sumOfUnderlyingValuesInclTax, 4,'.', '');
925
+ }
926
+ else
927
+ {
928
+ if($item['base_price_incl_tax'] != null and $item['base_price_incl_tax'] != 0.0000)
929
+ $options['mshop_base_price_incl_tax'] = number_format(($item['base_price_incl_tax'] - $sumOfUnderlyingValuesInclTax - $item['base_discount_amount']/$item['qty_ordered']), 4,'.', '');
930
+ }
931
+
932
+ $options['mshop_base_price_excl_tax'] = number_format(0.0000, 4);
933
+ if($item['discount_percent'] != null and $item['discount_percent'] != 0.0000){
934
+ if($item['base_price'] != null and $item['base_price'] != 0.0000)
935
+ $options['mshop_base_price_excl_tax'] = number_format($item['base_price'] - $sumOfUnderlyingValuesExclTax , 4,'.', '');
936
+ }
937
+ else
938
+ {
939
+ if($item['base_price'] != null and $item['base_price'] != 0.0000)
940
+ $options['mshop_base_price_excl_tax'] = number_format(($item['base_price'] - $sumOfUnderlyingValuesExclTax - $item['base_discount_amount']/$item['qty_ordered']), 4,'.', '');
941
+ }
942
+ $options['mshop_discount_percent'] = $item['discount_percent'];
943
+ $mshop_discount_percent_bundle = $options['mshop_discount_percent'];
944
+ }
945
+
946
+ if($bundleItemId != 0 and $options['parent_item_id'] == $bundleItemId)
947
+ {
948
+ //this is an underlying item of the bundle product
949
+ $underlyingProductOptions = unserialize($options['product_options']);
950
+ $bundleSelectionAttributes = unserialize($underlyingProductOptions['bundle_selection_attributes']);
951
+
952
+ $underlyingItemValue = $bundleSelectionAttributes['price'];
953
+ $underlyingItemValueInclTax = null;
954
+ $underlyingItemValueExclTax = null;
955
+
956
+ if($includeTaxSettings == "1")
957
+ {
958
+ $underlyingItemValueInclTax = $underlyingItemValue;
959
+ $underlyingItemValueExclTax = number_format(($underlyingItemValueInclTax / ( 1 + $tax_percent/100)), 4);
960
+ }
961
+ else
962
+ {
963
+ $underlyingItemValueExclTax = $underlyingItemValue;
964
+ $underlyingItemValueInclTax = number_format(($underlyingItemValueExclTax * (1 + $tax_percent/100)), 4);
965
+ }
966
+
967
+ $options['mshop_base_price_incl_tax'] = $underlyingItemValueInclTax;
968
+ $options['mshop_base_price_excl_tax'] = $underlyingItemValueExclTax;
969
+ $options['mshop_discount_percent'] = $mshop_discount_percent_bundle;
970
+ }
971
+
972
+ return $options;
973
+ }
974
+
975
+ private function getRedemptionPointsData($options){
976
+ if( isset($options['row_total_before_redemptions'])
977
+ && isset($options['row_total_before_redemptions_incl_tax'])
978
+ && isset($options['row_total_after_redemptions'])
979
+ && isset($options['row_total_after_redemptions_incl_tax']) ){
980
+ $options['mshop_base_price_incl_tax'] = number_format($options['mshop_base_price_incl_tax']-($options['row_total_before_redemptions_incl_tax'] - $options['row_total_after_redemptions_incl_tax']),4);
981
+ $options['mshop_base_price_excl_tax'] = number_format($options['mshop_base_price_excl_tax']-($options['row_total_before_redemptions'] - $options['row_total_after_redemptions']),4);
982
+ }
983
+
984
+ return $options;
985
+ }
986
+
987
+ private function getRemboursData($billing_address, $order, $result){
988
+
989
+ if($result['payment']['method'] == 'cashondelivery'){
990
+ $rembours = array();
991
+ $rembours['product_type'] = 'simple';
992
+ $rembours['sku'] = 'REMBOURS';
993
+
994
+ $rembours['mshop_item_id'] = '';
995
+ $rembours['mshop_parent_item_id'] = '';
996
+
997
+ $rembours['mshop_discount_percent'] = 0;
998
+
999
+ $rembours['name'] = Mage::getStoreConfig('payment/cashondelivery/title');
1000
+
1001
+ $shipping_address = $order->getShippingAddress();
1002
+ $shipping_country_id = $shipping_address['country_id'];
1003
+
1004
+ if($shipping_country_id == '' || $shipping_country_id == null){
1005
+ $shipping_country_id = $billing_address['country_id'];
1006
+
1007
+ }
1008
+
1009
+ $shipping_origin_country_id = Mage::getStoreConfig('shipping/origin/country_id');
1010
+ if($shipping_country_id == $shipping_origin_country_id){
1011
+ $cod_cost = Mage::getStoreConfig('payment/cashondelivery/inlandcosts');
1012
+ }else{
1013
+ $cod_cost = Mage::getStoreConfig('payment/cashondelivery/foreigncountrycosts');
1014
+ }
1015
+
1016
+
1017
+ $rembours['base_price'] = number_format($cod_cost, 4,'.', '');
1018
+ $rembours['mshop_base_price_incl_tax'] = number_format(($result['base_cod_fee'] + $result['base_cod_tax_amount']), 4,'.', '');
1019
+ $rembours['mshop_base_price_excl_tax'] = number_format($result['base_cod_fee'], 4,'.', '');
1020
+ $rembours['qty_ordered'] = 1;
1021
+ $rembours['discount_percent'] = 0;
1022
+ $rembours['mshop_taxclass_rule_id'] = Mage::getStoreConfig('tax/classes/cod_tax_class');
1023
+
1024
+ $result['items'][] = $rembours;
1025
+ }
1026
+
1027
+ return $result;
1028
+ }
1029
+
1030
+ private function getCustomOrderFields($order, $result){
1031
+ $custom1 = Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_1');
1032
+ $result['custom_order_1'] = ($order->getData($custom1) != null )? $order->getData($custom1) : '';
1033
+
1034
+ $custom2 = Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_2');
1035
+ $result['custom_order_2'] = ($order->getData($custom2) != null )? $order->getData($custom2) : '';
1036
+
1037
+ $custom3 = Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_3');
1038
+ $result['custom_order_3'] = ($order->getData($custom3) != null )? $order->getData($custom3) : '';
1039
+
1040
+ return $result;
1041
+ }
1042
+
1043
+ private function getMsopPaymentDate($order, $result){
1044
+ $orderId = $order->getId();
1045
+ $ordersCollection = Mage::getModel('sales/order_status_history')->getCollection()->addFieldToFilter('status', 'processing')->addFieldToFilter('parent_id', $orderId);
1046
+
1047
+ if($ordersCollection->count() > 0 ) {
1048
+ $item = $ordersCollection->getFirstItem();
1049
+ $date = $item->getCreatedAt();
1050
+ }
1051
+
1052
+ $result['mshop_payment_date'] = $date;
1053
+
1054
+ return $result;
1055
+ }
1056
+
1057
+ private function getMshopInvoiceId($order, $result){
1058
+ $invoiceCollection = $order->getInvoiceCollection();
1059
+ $invoiceIds = array();
1060
+ foreach ($invoiceCollection as $invoice){
1061
+ $invoice_id = $invoice->getIncrementId();
1062
+ $invoiceIds[] = $invoice_id;
1063
+ }
1064
+ $result['mshop_invoice_id'] = $invoiceIds;
1065
+
1066
+ return $result;
1067
+ }
1068
+
1069
+ /**
1070
+ * Product visibility for stores API Method
1071
+ *
1072
+ * @param int $pid
1073
+ * @return array
1074
+ */
1075
+ private function getVisibleInStore($pid){
1076
+ $allStores = Mage::app()->getStores();
1077
+ $product_stores = array();
1078
+ foreach ($allStores as $store){
1079
+ $store_id = $store->getId();
1080
+ $product = Mage::getModel('catalog/product')
1081
+ ->setStoreId($store_id)
1082
+ ->load($pid);
1083
+ if($product->getId()!= null){
1084
+ $data = $product->getData();
1085
+ $visibility = $data['visibility'];
1086
+ if($visibility == 2 || $visibility == 4){
1087
+ $product_stores[] = $store_id;
1088
+ }
1089
+ }
1090
+ }
1091
+
1092
+ return $product_stores;
1093
+ }
1094
+
1095
+ /**
1096
+ *
1097
+ * Order Invoice creation date
1098
+ * @param string $orderNumber
1099
+ * @return string
1100
+ */
1101
+ private function getInvoiceDate($orderNumber){
1102
+
1103
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber);
1104
+ $data = $order->getData();
1105
+ $store_id = $data['store_id'];
1106
+
1107
+ $orderId = $order->getId();
1108
+ if($orderId == null){
1109
+ $this->_fault('order_not_exist');
1110
+ }
1111
+
1112
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
1113
+
1114
+ $resurce = Mage::getSingleton('core/resource');
1115
+
1116
+ $invoice_table = $resurce->getTableName('sales_flat_invoice_grid');
1117
+
1118
+ $resultd = $connection->query('SELECT * FROM '.$invoice_table.' WHERE order_increment_id = "'.$orderNumber.'" LIMIT 1');
1119
+ $row = $resultd->fetch(PDO::FETCH_ASSOC);
1120
+
1121
+ if($row){
1122
+ $inv_date = $row['created_at'];
1123
+ return $this->gmtToLocal($inv_date);
1124
+ }else{
1125
+ return $this->gmtToLocal($order->getCreatedAt());
1126
+ }
1127
+
1128
+ }
1129
+
1130
+ /**
1131
+ *
1132
+ * GMT to Local
1133
+ * @param string $datetime
1134
+ * @return string
1135
+ */
1136
+ private function gmtToLocal($datetime){
1137
+ $_date_format = 'Y-m-d H:i:s';
1138
+ $time = strtotime($datetime);
1139
+ $tz = Mage::app()->getStore()->getConfig('general/locale/timezone');
1140
+ $oldzone = @date_default_timezone_get();
1141
+ $result = date_default_timezone_set($tz);
1142
+ $return = date($_date_format,$time);
1143
+ date_default_timezone_set($oldzone);
1144
+ return $return;
1145
+ }
1146
+
1147
+ /**
1148
+ * Tax class for shipping setting
1149
+ *
1150
+ * @return boolean
1151
+ */
1152
+ public function hasTaxClassForShipping(){
1153
+ $tax = Mage::getStoreConfig('tax');
1154
+ $class_id = $tax['classes']['shipping_tax_class'];
1155
+ if($class_id == 0){
1156
+ return false;
1157
+ }else{
1158
+ return true;
1159
+ }
1160
+ }
1161
+
1162
+ /**
1163
+ *
1164
+ * Create invoice with mamut invoice id
1165
+ *
1166
+ * @param string $incrementId
1167
+ * @param string $mamutinvoiceId
1168
+ * @throws Exception
1169
+ * @return string
1170
+ */
1171
+ public function orderMamutCreateInvoice($incrementId, $mamutinvoiceId){
1172
+ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
1173
+
1174
+ if (!$order->getId()) {
1175
+ $this->_fault('order_not_exist');
1176
+ }
1177
+
1178
+ //Get the order store_id
1179
+ $storeId = $order->getStoreId();
1180
+
1181
+ if (count($order->getInvoiceCollection()) > 0) {
1182
+ return Mage::helper('core')->__('null - invoice allready present');
1183
+ }
1184
+
1185
+ if (!$order->canInvoice()) {
1186
+ return Mage::helper('core')->__('null - order can not be invoiced');
1187
+ }
1188
+
1189
+ try{
1190
+ $savedQtys = array();
1191
+ $invoice = Mage::getModel("sales/service_order", $order)->prepareInvoice($savedQtys);
1192
+ if (!$invoice->getTotalQty()) {
1193
+ $this->_fault('invoice_not_created');
1194
+ }
1195
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
1196
+
1197
+ $invoice->register();
1198
+
1199
+ $invoice->getOrder()->setCustomerNoteNotify(false);
1200
+ $invoice->getOrder()->setIsInProcess(true);
1201
+
1202
+ $transactionSave = Mage::getModel("core/resource_transaction")
1203
+ ->addObject($invoice)
1204
+ ->addObject($invoice->getOrder());
1205
+
1206
+ $transactionSave->save();
1207
+
1208
+ $invoice = Mage::getModel('sales/order_invoice')->load($invoice->getId());
1209
+ $invoice->setMamutInvoiceId((int)$mamutinvoiceId);
1210
+ $invoice->save();
1211
+
1212
+ if(Mage::getStoreConfig('mshop/parameters_invoice/send_mail')){
1213
+ $templateId = Mage::getStoreConfig('mshop/parameters_invoice/email_template', $storeId);
1214
+
1215
+ try {
1216
+ $paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
1217
+ ->setIsSecureMode(true);
1218
+ $paymentBlock->getMethod()->setStore($storeId);
1219
+ $paymentBlockHtml = $paymentBlock->toHtml();
1220
+ } catch (Exception $exception) {
1221
+ throw $exception;
1222
+ }
1223
+
1224
+
1225
+ $vars = array(
1226
+ 'order' => $order,
1227
+ 'invoice' => $invoice,
1228
+ 'comment' => "",
1229
+ 'billing' => $order->getBillingAddress(),
1230
+ 'payment_html' => $paymentBlockHtml,
1231
+ 'mamutInvoiceId' => $mamutinvoiceId
1232
+ );
1233
+ $this->sendInvoiceShippingEmail($templateId, $vars, $order);
1234
+ }
1235
+
1236
+ return $invoice->getIncrementId();
1237
+
1238
+ }catch(Exception $ex){
1239
+ $this->_fault('invoice_not_created');
1240
+ }
1241
+ }
1242
+
1243
+ /**
1244
+ * Send order "Ordered items can not be delivered" email
1245
+ *
1246
+ * @param string $increment_id
1247
+ * @throws Exception
1248
+ * @return boolean
1249
+ */
1250
+ public function orderNotInStock($increment_id){
1251
+ $order = Mage::getModel('sales/order')->loadByIncrementId($increment_id);
1252
+ if (!$order->getId()) {
1253
+ $this->_fault('order_not_exist');
1254
+ }
1255
+ $storeId = $order->getStore()->getId();
1256
+
1257
+ //change order status set in configuration
1258
+ $status = Mage::getStoreConfig('mshop/parameters_not_in_stock/order_status', $storeId);
1259
+ if($status){
1260
+ try{
1261
+ $order->setState($status,$status,'',false);
1262
+ $order->save();
1263
+ }catch(Exception $ex){
1264
+ $this->_fault('order_state_not_changed');
1265
+ }
1266
+ }
1267
+
1268
+ if(Mage::getStoreConfig('mshop/parameters_not_in_stock/send_mail', $storeId)){
1269
+ $template = Mage::getStoreConfig('mshop/parameters_not_in_stock/email_template', $storeId);
1270
+
1271
+ try {
1272
+ $paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
1273
+ ->setIsSecureMode(true);
1274
+ $paymentBlock->getMethod()->setStore($storeId);
1275
+ $paymentBlockHtml = $paymentBlock->toHtml();
1276
+
1277
+ } catch (Exception $exception) {
1278
+ throw $exception;
1279
+ }
1280
+
1281
+ $vars = array(
1282
+ 'billing' => $order->getBillingAddress(),
1283
+ 'payment_html' => $paymentBlockHtml)
1284
+ ;
1285
+ return $this->sendEmail($template, $vars, $order);
1286
+ }
1287
+ return true;
1288
+ }
1289
+
1290
+ /**
1291
+ * Cancel order and send email
1292
+ *
1293
+ * @param string $incrementId
1294
+ * @return boolean
1295
+ */
1296
+ public function orderCancel($incrementId){
1297
+ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
1298
+ if (!$order->getId()) {
1299
+ $this->_fault('order_not_exist');
1300
+ }
1301
+
1302
+ $status = $order->getStatus();
1303
+ if($status == 'canceled'){
1304
+ return false;
1305
+ }
1306
+
1307
+ try{
1308
+ $order->setState('canceled','canceled','',false);
1309
+ $order->save();
1310
+ }catch(Exception $ex){
1311
+ $this->_fault('order_state_not_changed');
1312
+ }
1313
+ $storeId = $order->getStore()->getId();
1314
+ if(Mage::getStoreConfig('mshop/parameters_order_cancellation/send_mail',$storeId )){
1315
+ $templateId = Mage::getStoreConfig('mshop/parameters_order_cancellation/email_template', $storeId);
1316
+ $vars = array();
1317
+ return $this->sendEmail($templateId, $vars, $order);
1318
+ }
1319
+ return true;
1320
+ }
1321
+
1322
+ /**
1323
+ * Helper function
1324
+ *
1325
+ * @param string $template
1326
+ * @param array $vars
1327
+ * @param object $order
1328
+ * @return boolean
1329
+ */
1330
+ private function sendEmail($template, $vars, $order){
1331
+
1332
+ if(!$order->getId()){
1333
+ return false;
1334
+ }
1335
+
1336
+ $storeId = $order->getStore()->getId();
1337
+ $senderName = Mage::getStoreConfig('general/store_information/name', $storeId);
1338
+ $senderEmail = Mage::getStoreConfig('trans_email/ident_general/email', $storeId);
1339
+
1340
+ $senderName = ($senderName != '')? $senderName : 'System';
1341
+ $senderEmail = ($senderEmail != '')? $senderEmail : 'info@system.com';
1342
+
1343
+ $store_url = Mage::getStoreConfig('web/unsecure/base_url', $storeId);
1344
+
1345
+ $sender = array('name' => $senderName,
1346
+ 'email' => $senderEmail);
1347
+
1348
+ $customerEmail = $order->getCustomerEmail();
1349
+
1350
+ if ($order->getCustomerIsGuest()) {
1351
+ $customerName = $order->getBillingAddress()->getName();
1352
+ } else {
1353
+ $customerName = $order->getCustomerName();
1354
+ }
1355
+
1356
+ $vars = array_merge($vars, array('order'=>$order)) ;
1357
+
1358
+ $translate = Mage::getSingleton('core/translate');
1359
+ $translate->setTranslateInline(true);
1360
+ $model_email = Mage::getModel('core/email_template');
1361
+ $model_email->sendTransactional($template, $sender, $customerEmail, $customerName, $vars, $storeId);
1362
+
1363
+ return $model_email->getSentSuccess();
1364
+ }
1365
+
1366
+ /**
1367
+ * Order is picked emil
1368
+ * @param string $inicrementId
1369
+ * @throws Exception
1370
+ * @return boolean
1371
+ */
1372
+ public function orderPicked($inicrementId){
1373
+
1374
+ $order = Mage::getModel('sales/order')->loadByIncrementId($inicrementId);
1375
+ if (!$order->getId()) {
1376
+ $this->_fault('order_not_exist');
1377
+ }
1378
+
1379
+ $storeId = $order->getStore()->getId();
1380
+
1381
+ //change order status set in configuration
1382
+ $status = Mage::getStoreConfig('mshop/parameters_order_picked/order_status', $storeId);
1383
+ if($status){
1384
+ try{
1385
+ $order->setState($status,$status,'',false);
1386
+ $order->save();
1387
+ }catch(Exception $ex){
1388
+ $this->_fault('order_state_not_changed');
1389
+ }
1390
+ }
1391
+
1392
+
1393
+ if(Mage::getStoreConfig('mshop/parameters_order_picked/send_mail', $storeId )){
1394
+ $template = Mage::getStoreConfig('mshop/parameters_order_picked/email_template', $storeId);
1395
+
1396
+ try {
1397
+ $paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
1398
+ ->setIsSecureMode(true);
1399
+ $paymentBlock->getMethod()->setStore($storeId);
1400
+ $paymentBlockHtml = $paymentBlock->toHtml();
1401
+
1402
+
1403
+ } catch (Exception $exception) {
1404
+ throw $exception;
1405
+ }
1406
+
1407
+ $vars = array(
1408
+ 'billing' => $order->getBillingAddress(),
1409
+ 'payment_html' => $paymentBlockHtml);
1410
+
1411
+ return $this->sendEmail($template, $vars, $order);
1412
+ }
1413
+
1414
+ return true;
1415
+ }
1416
+
1417
+ /**
1418
+ * Create shippment for order
1419
+ *
1420
+ * @param string $inicrementId
1421
+ * @param string $trackAndTraceCode
1422
+ * @throws Exception
1423
+ * @return string
1424
+ */
1425
+ public function orderCreateShipment($inicrementId, $trackAndTraceCode){
1426
+ $order = Mage::getModel('sales/order')->loadByIncrementId($inicrementId);
1427
+ if (!$order->getId()) {
1428
+ $this->_fault('order_not_exist');
1429
+ }
1430
+
1431
+ if (!$order->canShip()) {
1432
+ $this->_fault('shipment_not_created');
1433
+ }
1434
+ if (count($order->getShipmentsCollection()) > 0) {
1435
+ $this->_fault("shipment_not_created");
1436
+ }
1437
+ $storeId = $order->getStore()->getId();
1438
+ //Start store emulation process
1439
+ $appEmulation = Mage::getSingleton('core/app_emulation');
1440
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
1441
+
1442
+ $send_mail = Mage::getStoreConfig('mshop/parameters_order_shipped/send_mail', $storeId);
1443
+ $templateId = Mage::getStoreConfig('mshop/parameters_order_shipped/email_template', $storeId);
1444
+ $shipmentId = Mage::getModel('sales/order_shipment_api')->create($inicrementId, array(), '', 0, 0);
1445
+ $shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentId);
1446
+
1447
+ try {
1448
+ // Retrieve specified view block from appropriate design package (depends on emulated store)
1449
+ $paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
1450
+ ->setIsSecureMode(true);
1451
+ $paymentBlock->getMethod()->setStore($storeId);
1452
+ $paymentBlockHtml = $paymentBlock->toHtml();
1453
+ } catch (Exception $exception) {
1454
+ // Stop store emulation process
1455
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
1456
+ throw $exception;
1457
+ }
1458
+
1459
+ if($trackAndTraceCode!=null){
1460
+ $trackId = Mage::getModel('sales/order_shipment_api')->addTrack($shipmentId, "custom", " ", $trackAndTraceCode);
1461
+ }
1462
+
1463
+ $vars = array(
1464
+ 'order' => $order,
1465
+ 'shipment' => $shipment,
1466
+ 'comment' => "",
1467
+ 'billing' => $order->getBillingAddress(),
1468
+ 'payment_html' => $paymentBlockHtml,
1469
+ 'trackingCode' => $trackAndTraceCode
1470
+ );
1471
+
1472
+ if($send_mail){
1473
+ $this->sendInvoiceShippingEmail($templateId, $vars,$order);
1474
+ }
1475
+ return $shipmentId;
1476
+ }
1477
+
1478
+ /**
1479
+ * Send Mail helper function
1480
+ * @param int $templateId
1481
+ * @param array $vars
1482
+ * @param object $order
1483
+ * @return boolean
1484
+ */
1485
+ private function sendInvoiceShippingEmail($templateId, $vars, $order){
1486
+ if(!$order->getId()){
1487
+ return false;
1488
+ }
1489
+
1490
+ $storeId = $order->getStore()->getId();
1491
+ $senderName = Mage::getStoreConfig('general/store_information/name', $storeId);
1492
+ $senderEmail = Mage::getStoreConfig('trans_email/ident_general/email', $storeId);
1493
+
1494
+ $senderName = ($senderName != '')? $senderName : 'System';
1495
+ $senderEmail = ($senderEmail != '')? $senderEmail : 'info@system.com';
1496
+
1497
+ $store_url = Mage::getStoreConfig('web/unsecure/base_url', $storeId);
1498
+
1499
+ $sender = array('name' => $senderName,
1500
+ 'email' => $senderEmail);
1501
+
1502
+ $customerEmail = $order->getCustomerEmail();
1503
+
1504
+ if ($order->getCustomerIsGuest()) {
1505
+ $customerName = $order->getBillingAddress()->getName();
1506
+ } else {
1507
+ $customerName = $order->getCustomerName();
1508
+ }
1509
+
1510
+ $translate = Mage::getSingleton('core/translate');
1511
+ $translate->setTranslateInline(true);
1512
+ $model_email = Mage::getModel('core/email_template');
1513
+ $model_email->sendTransactional($templateId, $sender, $customerEmail, $customerName, $vars, $storeId);
1514
+
1515
+ return $model_email->getSentSuccess();
1516
+ }
1517
+
1518
+ /**
1519
+ * Order info custom fileds mapping
1520
+ * @return array
1521
+ *
1522
+ */
1523
+ public function orderCustomFieldsMapping(){
1524
+ $custom1 = (Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_1') != null)? Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_1'): '';
1525
+ $custom1_label = ucwords(str_replace('_', ' ', $custom1));
1526
+
1527
+ $custom2 = (Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_2') != null)? Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_2'): '';
1528
+ $custom2_label = ucwords(str_replace('_', ' ', $custom2));
1529
+
1530
+ $custom3 = (Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_3') != null)? Mage::getStoreConfig('mshop/parameters_order_custom_attributes/custom_order_3'): '';
1531
+ $custom3_label = ucwords(str_replace('_', ' ', $custom3));
1532
+ return array(
1533
+ array('order_custom_field'=> 'custom_order_1', 'order_beckend_field'=> $custom1, 'order_beckend_field_label'=> $custom1_label),
1534
+ array('order_custom_field'=> 'custom_order_2', 'order_beckend_field'=> $custom2, 'order_beckend_field_label'=> $custom2_label),
1535
+ array('order_custom_field'=> 'custom_order_3', 'order_beckend_field'=> $custom3, 'order_beckend_field_label'=> $custom3_label)
1536
+ );
1537
+ }
1538
+ }
app/code/community/Ecomwise/Mshop/Model/System/Config/Apply.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecomwise_Mshop_Model_System_Config_Apply extends Mage_Tax_Model_System_Config_Source_Apply
4
+ {
5
+ public function __construct()
6
+ {
7
+ $this->_options = array(
8
+ /*
9
+ array(
10
+ 'value' => 0,
11
+ 'label' => Mage::helper('tax')->__('Before Discount')
12
+ ),
13
+ */
14
+
15
+ array(
16
+ 'value' => 1,
17
+ 'label' => Mage::helper('tax')->__('After Discount')
18
+ )
19
+
20
+ );
21
+ }
22
+ }
app/code/community/Ecomwise/Mshop/Model/Utility/Api.php ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecomwise_Mshop_Model_Utility_Api extends Mage_Api_Model_Resource_Abstract
4
+ {
5
+ public function cleanCache(){
6
+ Mage::app()->getCacheInstance()->cleanType('Web Services Configuration');
7
+ return true;
8
+ }
9
+
10
+ public function items(){
11
+ try{
12
+ $collection = Mage::getModel('tax/class')->getCollection();
13
+ }catch(Mage_Core_Exception $e){
14
+ $this->_fault('no_tax_classes_found', $e->getMessage());
15
+ }
16
+ $result = array();
17
+ foreach($collection as $taxClass){
18
+ if($taxClass->getClassType() == 'PRODUCT'){
19
+ $result[] = $taxClass->toArray(array('class_id', 'class_name', 'class_type'));
20
+ }
21
+ }
22
+ return $result;
23
+ }
24
+
25
+ public function paymentMethods($store=null){
26
+ try{
27
+ $paymentMethods = Mage::getSingleton('payment/config')->getAllMethods($store);
28
+ $paymentMethodsActive = Mage::getSingleton('payment/config')->getActiveMethods($store);
29
+ }
30
+ catch(Mage_Core_Exception $e){
31
+ $this->_fault('no_payment_methods_found', $e->getMessage());
32
+ }
33
+ $result = array();
34
+ foreach($paymentMethods as $code => $model){
35
+ $title = Mage::getStoreConfig('payment/'.$code.'/title');
36
+ foreach ($paymentMethodsActive as $code1 => $model1){
37
+ if ($code==$code1)
38
+ {
39
+ $title="*".$title;
40
+ }
41
+ }
42
+
43
+ $result[] = array('method_code' => $code, 'method_title' => $title);
44
+ }
45
+ return $result;
46
+ }
47
+
48
+ public function shippingMethods($store=null){
49
+ try{
50
+ $shippingMethods = Mage::getSingleton('shipping/config')->getAllCarriers($store);
51
+ }
52
+ catch(Mage_Core_Exception $e){
53
+ $this->_fault('no_shipping_methods_found', $e->getMessage());
54
+ }
55
+ $methods = array();
56
+ $i = 0;
57
+ foreach($shippingMethods as $code => $model){
58
+ if(!$model->isActive()){
59
+ //continue;
60
+ }
61
+ $carrierMethods = $model->getAllowedMethods();
62
+ if(!$carrierMethods){
63
+ continue;
64
+ }
65
+ $carrierTitle = Mage::getStoreConfig('carriers/'.$code.'/title', $store);
66
+ $methods[$i] = array(
67
+ 'method_title' => $carrierTitle,
68
+ 'method_code' => $code,
69
+ 'available_methods' => array(),
70
+ );
71
+ foreach($carrierMethods as $methodCode=>$methodTitle){
72
+ $methods[$i]['available_methods'][] = $methodTitle;
73
+ }
74
+ $i++;
75
+ }
76
+ return $methods;
77
+ }
78
+
79
+ public function getStores() {
80
+ $stores_arr = array();
81
+ $websites = Mage::app()->getWebsites ();
82
+ foreach ( $websites as $_website ){
83
+ $websitename = $_website->getName();
84
+ $webid = $_website->getId();
85
+ foreach ($_website->getGroups() as $group) {
86
+ $group_arr = array();
87
+ $groupname = $group->getName();
88
+ $stores = $group->getStores();
89
+ foreach ($stores as $_store) {
90
+ $webstores = array();
91
+ $id = $_store->getId ();
92
+ $locale = Mage::getStoreConfig('general/locale/code',$id);
93
+ $name = $_store->getName ();
94
+ $webstores['id'] = $id;
95
+ $webstores['name'] = $name;
96
+ $webstores['language'] = $locale;
97
+ $webstores['url'] = $_store->getUrl();
98
+ $group_arr[] = $webstores;
99
+ }
100
+ $stores_arr[$websitename][$groupname] = $group_arr;
101
+ }
102
+
103
+ }
104
+
105
+ if(count($stores_arr) == 0){
106
+ $this->_fault('no_stores_found');
107
+ }
108
+ return $stores_arr;
109
+ }
110
+
111
+ public function itemsByStore($store_id=null){
112
+ $methods = array();
113
+ $stores = array();
114
+ Mage::app()->getCacheInstance()->cleanType('config');
115
+
116
+ if($store_id != null){
117
+ $stores[] = Mage::getModel('core/store')->load($store_id);
118
+ }else{
119
+ $stores = Mage::app()->getStores();
120
+ }
121
+ foreach ($stores as $store){
122
+ $id = $store->getId();
123
+ $name = $store->getName();
124
+ try{
125
+ $paymentMethods = Mage::getSingleton('payment/config')->getActiveMethods($store);
126
+ }catch(Mage_Core_Exception $e){
127
+ $this->_fault('no_payment_methods_found', $e->getMessage());
128
+ }
129
+
130
+ $result = array();
131
+ foreach($paymentMethods as $code => $model){
132
+ $title = Mage::getStoreConfig('payment/'.$code.'/title');
133
+ $result[] = array('method_code' => $code, 'method_title' => $title);
134
+ }
135
+ $methods[$name]['id'] = $id;
136
+ $methods[$name]['payment_methods'] = $result;
137
+
138
+ }
139
+ if(count($methods > 0)){
140
+ return $methods;
141
+ }else{
142
+ return $this->_fault('no_paymentmethods_for_store_found');
143
+ }
144
+
145
+ }
146
+
147
+ public function getVersion(){
148
+ return Mage::getVersion();
149
+ }
150
+
151
+ public function getSetting($setting_name){
152
+ if($setting_name == 'backorders'){
153
+ $backorder_status = false;
154
+ $backorders = Mage::getStoreConfig('cataloginventory/item_options/backorders');
155
+ switch($backorders){
156
+ case 0:
157
+ break;
158
+ case 1:
159
+ $backorder_status = true;
160
+ break;
161
+ case 2:
162
+ $backorder_status = true;
163
+ break;
164
+ }
165
+
166
+ return $backorder_status;
167
+
168
+ }else if($setting_name == 'multiple_shipment'){
169
+ $tomultiple = Mage::getStoreConfig('shipping/option/checkout_multiple');
170
+ $multiple_status = false;
171
+
172
+ switch($tomultiple){
173
+ case 0:
174
+ break;
175
+ case 1:
176
+ $max_qty = Mage::getStoreConfig('shipping/option/checkout_multiple_maximum_qty');
177
+ $multiple_status = true;
178
+ break;
179
+ }
180
+ return $multiple_status;
181
+
182
+ }else if($setting_name == 'gross_prices'){
183
+ return Mage::getStoreConfig('tax/calculation/price_includes_tax');
184
+ }else{
185
+
186
+ $this->_fault('invalid_parametars');
187
+ return;
188
+ }
189
+ }
190
+
191
+ public function getMshopVersion(){
192
+ $modules = Mage::getConfig()->getNode('modules')->children();
193
+ $modulesArray = (array)$modules;
194
+
195
+ if(!isset($modulesArray['Ecomwise_Mshop'])) {
196
+ return $this->_fault('module_not_installed');
197
+ }
198
+ $mshop = (array)$modulesArray['Ecomwise_Mshop'];
199
+ return $mshop['version'];
200
+
201
+ }
202
+ public function getMshopB2BVersion(){
203
+ $modules = Mage::getConfig()->getNode('modules')->children();
204
+ $modulesArray = (array)$modules;
205
+
206
+ if(!isset($modulesArray['Ecomwise_MshopB2B'])) {
207
+ return $this->_fault('module_b2b_not_installed');
208
+ }
209
+ $mshop = (array)$modulesArray['Ecomwise_MshopB2B'];
210
+ return $mshop['version'];
211
+
212
+ }
213
+
214
+ public function getIvoiceDate($orderNumber){
215
+
216
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber);
217
+ $data = $order->getData();
218
+ $store_id = $data['store_id'];
219
+
220
+ $orderId = $order->getId();
221
+ if($orderId == null){
222
+ $this->_fault('order_not_exists');
223
+ }
224
+
225
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
226
+
227
+ $resurce = Mage::getSingleton('core/resource');
228
+
229
+ $invoice_table = $resurce->getTableName('sales_flat_invoice_grid');
230
+
231
+ $resultd = $connection->query('SELECT * FROM '.$invoice_table.' WHERE order_increment_id = '.$orderNumber.' LIMIT 1');
232
+ $row = $resultd->fetch(PDO::FETCH_ASSOC);
233
+
234
+ if($row){
235
+ $inv_date = $row['created_at'];
236
+ return $this->gmtToLocal($inv_date);
237
+ }else{
238
+ return $this->gmtToLocal($order->getCreatedAt());
239
+ }
240
+ }
241
+
242
+ private function gmtToLocal($datetime){
243
+ $_date_format = 'Y-m-d H:i:s';
244
+ $time = strtotime($datetime);
245
+ $tz = Mage::app()->getStore()->getConfig('general/locale/timezone');
246
+ $oldzone = @date_default_timezone_get();
247
+ $result = date_default_timezone_set($tz);
248
+ $return = date($_date_format,$time);
249
+ date_default_timezone_set($oldzone);
250
+ return $return;
251
+ }
252
+
253
+ public function taxRules(){
254
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
255
+
256
+ $resurce = Mage::getSingleton('core/resource');
257
+ $tax_rule = $resurce->getTableName('tax_calculation_rule');
258
+
259
+ $resultd = $connection->query('SELECT * FROM '.$tax_rule.'');
260
+ $rows = $resultd->fetchAll(PDO::FETCH_ASSOC);
261
+ if($rows){
262
+ $rules = array();
263
+ foreach($rows as $row){
264
+ $rule_id = $row['tax_calculation_rule_id'];
265
+ $rule_name = $row['code'];
266
+ $rule_single = array('tax_rule_id'=>$rule_id, 'tax_rule_name'=> $rule_name);
267
+ $rules[] = $rule_single;
268
+ }
269
+ return $rules;
270
+ }else{
271
+ return $this->_fault('rules_not_found');
272
+ }
273
+ }
274
+
275
+ public function isMshopB2BInstalled(){
276
+ $modules = Mage::getConfig()->getNode('modules')->children();
277
+ $modulesArray = (array)$modules;
278
+
279
+ if(isset($modulesArray['Ecomwise_MshopB2B'])) {
280
+ return true;
281
+ }
282
+ return false;
283
+ }
284
+ }
app/code/community/Ecomwise/Mshop/Model/Utility/Api/V2.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ecomwise_Mshop_Model_Utility_Api_V2 extends Ecomwise_Mshop_Model_Utility_Api{
4
+
5
+
6
+ public function paymentStatuses(){
7
+ //$stats = Mage::getModel('sales/order_status')->getCollection();
8
+ $stats = Mage::getSingleton('sales/order_config')->getStatuses();
9
+
10
+ $result = array();
11
+ foreach ($stats as $code => $label){
12
+ $result[] = array('statusCode' => $code, 'status' => $label);
13
+ }
14
+ return $result;
15
+ }
16
+
17
+ public function items(){
18
+ try{
19
+ $collection = Mage::getModel('tax/class')->getCollection();
20
+ }
21
+ catch(Mage_Core_Exception $e){
22
+ $this->_fault('no_tax_classes_found', $e->getMessage());
23
+ }
24
+ $result = array();
25
+ foreach($collection as $taxClass){
26
+ if($taxClass->getClassType() == 'PRODUCT'){
27
+ $result[] = $taxClass->toArray(array('class_id', 'class_name', 'class_type'));
28
+ }
29
+ }
30
+ return $result;
31
+ }
32
+
33
+ public function shippingMethods($store=null){
34
+ try{
35
+ $shippingMethods = Mage::getSingleton('shipping/config')->getAllCarriers($store);
36
+ }catch(Mage_Core_Exception $e){
37
+ $this->_fault('no_shipping_methods_found', $e->getMessage());
38
+ }
39
+ $methods = array();
40
+
41
+ foreach($shippingMethods as $code => $model){
42
+ if(!$model->isActive()){
43
+ //continue;
44
+ }
45
+ //$carrierMethods = $model->getAllowedMethods();
46
+ //if(!$carrierMethods){
47
+ // continue;
48
+ //}
49
+ $carrierTitle = Mage::getStoreConfig('carriers/'.$code.'/title', $store);
50
+ $methods[] = array(
51
+ 'method_title' => $carrierTitle,
52
+ 'method_code' => $code
53
+ );
54
+
55
+ }
56
+ return $methods;
57
+ }
58
+
59
+ private function _formatCarrierMethods(array $carrierMethods){
60
+ $res = array();
61
+ foreach($carrierMethods as $methodCode => $methodTitle){
62
+ $res[] = $methodTitle;
63
+ }
64
+ return $res;
65
+ }
66
+
67
+ public function getStores(){
68
+ $group_arr = array();
69
+ $websites = Mage::app()->getWebsites ();
70
+ foreach ( $websites as $_website ){
71
+ $websitename = $_website->getName();
72
+ $webid = intval($_website->getId());
73
+ foreach ($_website->getGroups() as $group){
74
+ $groupname = $group->getName();
75
+ $stores = $group->getStores();
76
+ foreach ($stores as $_store) {
77
+ $webstores = array();
78
+ $id = intval($_store->getId ());
79
+ $locale = Mage::getStoreConfig('general/locale/code',$id);
80
+ $name = $_store->getName ();
81
+ $webstores['websiteid'] = $webid;
82
+ $webstores['groupname'] = $groupname;
83
+ $webstores['storeid'] = $id;
84
+ $webstores['name'] = $name;
85
+ $webstores['language'] = $locale;
86
+ $webstores['store_url'] = $_store->getUrl();
87
+ $group_arr[] = $webstores;
88
+
89
+ }
90
+ }
91
+
92
+ }
93
+ if(count($group_arr) == 0){
94
+ $this->_fault('no_stores_found');
95
+ }
96
+ return $group_arr;
97
+ }
98
+
99
+
100
+ public function itemsByStore($store_id=null){
101
+ $methods = array();
102
+ $stores = array();
103
+ Mage::app()->getCacheInstance()->cleanType('config');
104
+
105
+ if($store_id != null){
106
+ $stores[] = Mage::getModel('core/store')->load($store_id);
107
+ }else{
108
+ $stores = Mage::app()->getStores();
109
+ }
110
+ foreach ($stores as $store){
111
+ $id = $store->getId();
112
+ $name = $store->getName();
113
+ try{
114
+ $paymentMethods = Mage::getSingleton('payment/config')->getActiveMethods($store);
115
+ }catch(Mage_Core_Exception $e){
116
+ $this->_fault('no_payment_methods_found', $e->getMessage());
117
+ }
118
+ foreach($paymentMethods as $code => $model){
119
+ $title = Mage::getStoreConfig('payment/'.$code.'/title');
120
+ $result = array('method_code' => $code, 'method_title' => $title, 'store_id'=>$id,'store_name'=>$name);
121
+ $methods[] = $result;
122
+ }
123
+ }
124
+ if(count($methods )== 0){
125
+ $this->_fault('no_paymentmethods_for_store_found');
126
+
127
+ }
128
+ return $methods;
129
+ }
130
+ }
app/code/community/Ecomwise/Mshop/etc/api.xml ADDED
@@ -0,0 +1,829 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <api>
4
+ <resources>
5
+ <sales_order translate="title" module="sales">
6
+ <faults module="sales">
7
+ <product_not_exists>
8
+ <code>104</code>
9
+ <message>Error: One or more products associated to this order currently are not existing.</message>
10
+ </product_not_exists>
11
+ </faults>
12
+ </sales_order>
13
+
14
+ <!-- sales order methods -->
15
+ <mshop_sales translate="title" module="mshop">
16
+ <model>mshop/sales_api</model>
17
+ <title>Sales Methods Api</title>
18
+ <acl>mshop/sales</acl>
19
+ <methods>
20
+
21
+ <orderShipment translate="title" module="mshop">
22
+ <title>Create new shipment for order</title>
23
+ <method>orderShipmentCreate</method>
24
+ </orderShipment>
25
+
26
+ <creditMemo translate="title" module="mshop">
27
+ <title>Retrieves the credit memo information</title>
28
+ <method>creditMemo</method>
29
+ </creditMemo>
30
+
31
+ <getOrdersFromWithStatus translate="title" module="mshop">
32
+ <title>Get Increment Ids For Multiple Orders</title>
33
+ <method>getOrdersFromWithStatus</method>
34
+ </getOrdersFromWithStatus>
35
+
36
+ <getCreditmemosFrom translate="title" module="mshop">
37
+ <title>Get Increment Ids For Multiple Credit Memos</title>
38
+ <method>getCreditmemosFrom</method>
39
+ </getCreditmemosFrom>
40
+
41
+ <getSalesForOrders translate="title" module="mshop">
42
+ <title>Get Sales For Orders</title>
43
+ <method>getSalesForOrders</method>
44
+ </getSalesForOrders>
45
+
46
+ <getSalesForOrdersWithStatus translate="title" module="mshop">
47
+ <title>Get Sales For Orders</title>
48
+ <method>getSalesForOrdersWithStatus</method>
49
+ </getSalesForOrdersWithStatus>
50
+
51
+ <orderList translate="title" module="mshop">
52
+ <title>List Orders</title>
53
+ <method>items</method>
54
+ </orderList>
55
+ <hasTaxClassForShipping translate="title" module="mshop">
56
+ <title>Check if has tax class for shipping</title>
57
+ <method>hasTaxClassForShipping</method>
58
+ </hasTaxClassForShipping>
59
+
60
+ <orderCreateInvoice translate="title" module="mshop">
61
+ <title>Create new invoice for order with mamut id</title>
62
+ <method>orderMamutCreateInvoice</method>
63
+ </orderCreateInvoice>
64
+
65
+ <orderCancel translate="title" module="mshop">
66
+ <title>Order cancellation</title>
67
+ <method>orderCancel</method>
68
+ </orderCancel>
69
+
70
+ <orderNotInStock translate="title" module="mshop">
71
+ <title>Ordered items are not in stock</title>
72
+ <method>orderNotInStock</method>
73
+ </orderNotInStock>
74
+
75
+ <orderPicked translate="title" module="mshop">
76
+ <title>Order is picked</title>
77
+ <method>orderPicked</method>
78
+ </orderPicked>
79
+
80
+ <orderCreateShipment translate="title" module="mshop">
81
+ <title>Order is shipped</title>
82
+ <method>orderCreateShipment</method>
83
+ </orderCreateShipment>
84
+ <orderCustomFieldsMapping>
85
+ <title>Custom order fields mapping</title>
86
+ <method>orderCustomFieldsMapping</method>
87
+ </orderCustomFieldsMapping>
88
+
89
+ </methods>
90
+ <faults module="mshop">
91
+
92
+ <array_id_not_passed>
93
+ <code>101</code>
94
+ <message>Array of order ids sholud be passed as parametar</message>
95
+ </array_id_not_passed>
96
+
97
+ <invoice_not_created>
98
+ <code>103</code>
99
+ <message>Can not create invoice for order.</message>
100
+ </invoice_not_created>
101
+
102
+ <credit_memo_not_exist>
103
+ <code>102</code>
104
+ <message>Credit memo id does not exist</message>
105
+ </credit_memo_not_exist>
106
+ <order_not_exist>
107
+ <code>103</code>
108
+ <message>Order increment id does not exist</message>
109
+ </order_not_exist>
110
+ <email_is_not_avtivated>
111
+ <code>104</code>
112
+ <message>Email sending is turned off for this method</message>
113
+ </email_is_not_avtivated>
114
+ <order_state_not_changed>
115
+ <code>105</code>
116
+ <message>Order state was not changed</message>
117
+ </order_state_not_changed>
118
+ <shipment_not_created>
119
+ <code>106</code>
120
+ <message>Can not create shipment for order.</message>
121
+ </shipment_not_created>
122
+ </faults>
123
+ </mshop_sales>
124
+ <!-- end sales -->
125
+
126
+ <!-- utility methods -->
127
+ <mshop_utility translate="title" module="mshop">
128
+ <model>mshop/utility_api</model>
129
+ <title>Utility Methods Api</title>
130
+ <acl>mshop/utility</acl>
131
+ <methods>
132
+
133
+ <listPaymentStatuses translate="title" module="mshop">
134
+ <title>List of payment statuses</title>
135
+ <method>paymentStatuses</method>
136
+ </listPaymentStatuses>
137
+
138
+ <listProductTaxClasses translate="title" module="mshop">
139
+ <title>List of tax classes</title>
140
+ <method>items</method>
141
+ </listProductTaxClasses>
142
+
143
+ <listTaxClassRules translate="title" module="mshop">
144
+ <title>List of tax classe rules</title>
145
+ <method>taxRules</method>
146
+ </listTaxClassRules>
147
+
148
+ <cleanCache translate="title" module="mshop">
149
+ <title>Clean cache type:Web Services Configuration</title>
150
+ <method>cleanCache</method>
151
+ </cleanCache>
152
+
153
+ <listPaymentMethods translate="title" module="mshop">
154
+ <title>List of payment methods</title>
155
+ <method>paymentMethods</method>
156
+ </listPaymentMethods>
157
+
158
+ <listShippingMethods translate="title" module="mshop">
159
+ <title>List of shipping methods</title>
160
+ <method>shippingMethods</method>
161
+ </listShippingMethods>
162
+
163
+ <listStoreViews translate="title" module="mshop">
164
+ <title>List of stores in website </title>
165
+ <method>getStores</method>
166
+ </listStoreViews>
167
+
168
+ <listPaymentMethodsByStore translate="title" module="mshop">
169
+ <title>List of payment methods by stores</title>
170
+ <method>itemsByStore</method>
171
+ </listPaymentMethodsByStore>
172
+
173
+ <getMagentoVersion translate="title" module="mshop">
174
+ <title>Get Magento Vesion</title>
175
+ <method>getVersion</method>
176
+ </getMagentoVersion>
177
+
178
+ <getSetting translate="title" module="mshop">
179
+ <title>Get Magento Setting</title>
180
+ <method>getSetting</method>
181
+ </getSetting>
182
+
183
+ <getMshopVersion translate="title" module="mshop">
184
+ <title>Get Mshop version</title>
185
+ <method>getMshopVersion</method>
186
+ </getMshopVersion>
187
+
188
+ <getMshopB2BVersion translate="title" module="mshop">
189
+ <title>Get MshopB2B version if installed</title>
190
+ <method>getMshopB2BVersion</method>
191
+ </getMshopB2BVersion>
192
+
193
+ <getOrderInvoiceDate translate="title" module="mshop">
194
+ <title>Get order invoice date</title>
195
+ <method>getIvoiceDate</method>
196
+ </getOrderInvoiceDate>
197
+
198
+ <isMshopB2BInstalled translate="title" module="mshop">
199
+ <title>Check if MshopB2B extension is installed</title>
200
+ <method>isMshopB2BInstalled</method>
201
+ </isMshopB2BInstalled>
202
+ </methods>
203
+ <faults module="mshop">
204
+ <no_tax_classes_found>
205
+ <code>101</code>
206
+ <message>There were no active tax classes found.</message>
207
+ </no_tax_classes_found>
208
+
209
+ <no_payment_methods_found>
210
+ <code>102</code>
211
+ <message>There were no active payment methods found.</message>
212
+ </no_payment_methods_found>
213
+
214
+ <no_shipping_methods_found>
215
+ <code>103</code>
216
+ <message>There were no active shipping methods found.</message>
217
+ </no_shipping_methods_found>
218
+
219
+ <no_stores_found>
220
+ <code>104</code>
221
+ <message>There were no stores found.</message>
222
+ </no_stores_found>
223
+
224
+ <no_paymentmethods_for_store_found>
225
+ <code>105</code>
226
+ <message>There were no payment methods for store found.</message>
227
+ </no_paymentmethods_for_store_found>
228
+
229
+ <can_not_retrive_version>
230
+ <code>106</code>
231
+ <message>Magento version can't be retrived.</message>
232
+ </can_not_retrive_version>
233
+
234
+ <invalid_parametars>
235
+ <code>107</code>
236
+ <message>Invalid setting parametar value passed. Allowed values are: "backorders", "multiple_shipment" and "gross_prices"</message>
237
+ </invalid_parametars>
238
+
239
+ <module_not_installed>
240
+ <code>108</code>
241
+ <message>Module Mshop is not installed</message>
242
+ </module_not_installed>
243
+
244
+ <order_not_exists>
245
+ <code>109</code>
246
+ <message>Order with this number not exists</message>
247
+ </order_not_exists>
248
+
249
+ <rules_not_found>
250
+ <code>110</code>
251
+ <message>Tax class rules not found</message>
252
+ </rules_not_found>
253
+
254
+ <module_b2b_not_installed>
255
+ <code>111</code>
256
+ <message>Module MshopB2B is not installed</message>
257
+ </module_b2b_not_installed>
258
+
259
+ </faults>
260
+ </mshop_utility>
261
+
262
+ <!-- end utility methods -->
263
+
264
+ <!-- attribute methods -->
265
+ <mshop_attribute translate="title" module="mshop">
266
+ <model>mshop/catalog_attribute_api</model>
267
+ <title>Catalog Attribute Methods Api</title>
268
+ <acl>mshop/catalog</acl>
269
+ <methods>
270
+ <optionId translate="title" module="mshop">
271
+ <title>Get Attribute Option Id</title>
272
+ <method>getAttributeLabelId</method>
273
+ <acl>catalog/attribute/attributeLabelId</acl>
274
+ </optionId>
275
+
276
+ <create translate="title" module="mshop">
277
+ <title>Create new product attribute</title>
278
+ <method>create</method>
279
+ <acl>catalog/attribute/create</acl>
280
+ </create>
281
+
282
+ <delete translate="title" module="mshop">
283
+ <title>Delete product attribute</title>
284
+ <method>delete</method>
285
+ <acl>catalog/attribute/delete</acl>
286
+ </delete>
287
+
288
+ <addOptions translate="title" module="mshop">
289
+ <title>Add attribute options</title>
290
+ <method>addoptions</method>
291
+ <acl>catalog/attribute/addoptions</acl>
292
+ </addOptions>
293
+
294
+ <setsThatContain translate="title" module="mshop">
295
+ <title>Get sets that contain listed attributes</title>
296
+ <method>getSets</method>
297
+ </setsThatContain>
298
+
299
+ <copySet translate="title" module="mshop">
300
+ <title>Copy Atribute set</title>
301
+ <method>copyAttributeSet</method>
302
+ <acl>catalog/attribute/copyset</acl>
303
+ </copySet>
304
+
305
+ <addToSet translate="title" module="mshop">
306
+ <title>Add atribute to set</title>
307
+ <method>addToSet</method>
308
+ <acl>catalog/attribute/addtoset</acl>
309
+ </addToSet>
310
+
311
+ <setOptions translate="title" module="mshop">
312
+ <title>Set All attribute options</title>
313
+ <method>setOptions</method>
314
+ <acl>catalog/attribute/addoptions</acl>
315
+ </setOptions>
316
+
317
+ <deleteOptions translate="title" module="mshop">
318
+ <title>Delete attribute options</title>
319
+ <method>deleteOptions</method>
320
+ <acl>catalog/attribute/addoptions</acl>
321
+ </deleteOptions>
322
+
323
+ </methods>
324
+ <faults module="mshop">
325
+ <set_not_exists>
326
+ <code>101</code>
327
+ <message>Attribute set with this Id not exists</message>
328
+ </set_not_exists>
329
+
330
+ <not_copied>
331
+ <code>101</code>
332
+ <message>Attribute set can't be copied</message>
333
+ </not_copied>
334
+
335
+ <att_code_label_not_provided>
336
+ <code>101</code>
337
+ <message>Attributes label and code should be provided.</message>
338
+ </att_code_label_not_provided>
339
+
340
+ <set_group_id_not_provided>
341
+ <code>102</code>
342
+ <message>Attribute Set Id and Group Id should be provided.</message>
343
+ </set_group_id_not_provided>
344
+
345
+ <attr_code_not_valid>
346
+ <code>103</code>
347
+ <message>Invalid attribute code.</message>
348
+ </attr_code_not_valid>
349
+
350
+ <cat_not_create_attribute>
351
+ <code>104</code>
352
+ <message>Attribute can't be created.</message>
353
+ </cat_not_create_attribute>
354
+
355
+ <not_deleted>
356
+ <code>105</code>
357
+ <message>Attribute can't be deleted.</message>
358
+ </not_deleted>
359
+
360
+ <not_exists>
361
+ <code>106</code>
362
+ <message>Attribute not exists.</message>
363
+ </not_exists>
364
+
365
+ <can_not_add_option>
366
+ <code>107</code>
367
+ <message>Option can't be created.</message>
368
+ </can_not_add_option>
369
+
370
+ <no_sets_found>
371
+ <code>108</code>
372
+ <message>No sets were found containig this attributes</message>
373
+ </no_sets_found>
374
+
375
+ <array_not_passed>
376
+ <code>109</code>
377
+ <message>Array of attribute codes sholud be passed as parametar</message>
378
+ </array_not_passed>
379
+
380
+ <att_not_exists>
381
+ <code>110</code>
382
+ <message>Attribute with this code not exists</message>
383
+ </att_not_exists>
384
+
385
+ <not_added>
386
+ <code>111</code>
387
+ <message>Attribute set can't be added</message>
388
+ </not_added>
389
+
390
+ <no_product_attribute_set>
391
+ <code>112</code>
392
+ <message>Attribute set with given Id is not product attribute set</message>
393
+ </no_product_attribute_set>
394
+
395
+ <set_name_exists>
396
+ <code>113</code>
397
+ <message>Attribute set with given name allready exists</message>
398
+ </set_name_exists>
399
+
400
+ <can_not_delete_option>
401
+ <code>114</code>
402
+ <message>Can not delete previuos options</message>
403
+ </can_not_delete_option>
404
+
405
+ <array_options_not_passed>
406
+ <code>115</code>
407
+ <message>Array of attribute options sholud be passed as parametar</message>
408
+ </array_options_not_passed>
409
+
410
+ <option_not_exists>
411
+ <code>116</code>
412
+ <message>Option with this label not exist</message>
413
+ </option_not_exists>
414
+ </faults>
415
+ </mshop_attribute>
416
+ <!-- end attribute methods -->
417
+
418
+ <!-- catalog methods -->
419
+ <mshop_catalog translate="title" module="mshop">
420
+ <model>mshop/catalog_api</model>
421
+ <title>Catalog Methods Api</title>
422
+ <acl>mshop/catalog</acl>
423
+ <methods>
424
+ <disableProducts translate="title" module="mshop">
425
+ <title>Massively Updates the Product Status</title>
426
+ <method>disableProducts</method>
427
+ <acl>catalog/product/updatestatus</acl>
428
+ </disableProducts>
429
+
430
+ <inventoryStockUpdate translate="title" module="mshop">
431
+ <title>Massively Updates the Product inventory: Quantity</title>
432
+ <method>massiveUpdateQty</method>
433
+ <acl>catalog/product/updateqty</acl>
434
+ </inventoryStockUpdate>
435
+
436
+ <inventoryStockItemUpdate translate="title" module="mshop">
437
+ <title>Updates the Product inventory: Quantity</title>
438
+ <method>updateQty</method>
439
+ <acl>catalog/product/updateqty</acl>
440
+ </inventoryStockItemUpdate>
441
+
442
+ <inventoryStockItemFutureStockUpdate translate="title" module="mshop">
443
+ <title>Updates the Product inventory: Quantity taking mamu_future_stock into account as well</title>
444
+ <method>updateQtyFutureStock</method>
445
+ <acl>catalog/product/updateqty</acl>
446
+ </inventoryStockItemFutureStockUpdate>
447
+
448
+ <simpleProductsList translate="title" module="mshop">
449
+ <title>Return Simple Products SKUs</title>
450
+ <method>productsSkus</method>
451
+ <acl>catalog/product/simpleproductslist</acl>
452
+ </simpleProductsList>
453
+
454
+ <productsList translate="title" module="mshop">
455
+ <title>Return All Products SKUs</title>
456
+ <method>productsAllSkus</method>
457
+ <acl>catalog/product/productslist</acl>
458
+ </productsList>
459
+
460
+ <setProductVisibleInStoreViews translate="title" module="mshop">
461
+ <title>Set Visibility to Products in Store Views</title>
462
+ <method>setVisibility</method>
463
+ <acl>catalog/product/setvisibility</acl>
464
+ </setProductVisibleInStoreViews>
465
+
466
+ <removeProductCategoriesBelow translate="title" module="mshop">
467
+ <title>remove product from categories below category</title>
468
+ <method>removeProductCategoriesBellow</method>
469
+ <acl>catalog/product/removebelow</acl>
470
+ </removeProductCategoriesBelow>
471
+
472
+ <checkCreateConfigurableProduct translate="title" module="mshop">
473
+ <title>Create configurable product</title>
474
+ <method>createConfigurable</method>
475
+ <acl>catalog/product/createconfigurable</acl>
476
+ </checkCreateConfigurableProduct>
477
+
478
+ <setProductsToComplex translate="title" module="mshop">
479
+ <title>Add simple product to configurable or grouped product</title>
480
+ <method>setToComplex</method>
481
+ <acl>catalog/product/addtoconfigurable</acl>
482
+ </setProductsToComplex>
483
+
484
+ <checkCreateGroupedProduct translate="title" module="mshop">
485
+ <title>Create grouped product</title>
486
+ <method>createGrouped</method>
487
+ <acl>catalog/product/creategrouped</acl>
488
+ </checkCreateGroupedProduct>
489
+
490
+ <productFullInfo translate="title" module="mshop">
491
+ <title>Get Product Info For All Store Views</title>
492
+ <method>productFullInfo</method>
493
+ <acl>catalog/product/fullproductinfo</acl>
494
+ </productFullInfo>
495
+
496
+ <!-- since 1.2.6 new -->
497
+ <productCreate>
498
+ <title>Create product pre 1.6.2 version compatible method</title>
499
+ <method>create</method>
500
+ <acl>catalog/product/create</acl>
501
+ </productCreate>
502
+
503
+ <productGetProductsChangedSince>
504
+ <title>Array of products changed since given date</title>
505
+ <method>getProductsChangedSince</method>
506
+ <acl>catalog/product/getproductschangedsince</acl>
507
+ </productGetProductsChangedSince>
508
+
509
+ <productUpdate>
510
+ <title>Update product pre 1.6.2 version compatible method</title>
511
+ <method>update</method>
512
+ <acl>catalog/product/update</acl>
513
+ </productUpdate>
514
+
515
+ <importImages translate="title" module="mshop">
516
+ <title>import images</title>
517
+ <method>images</method>
518
+ </importImages>
519
+
520
+ <productAttributeTierPriceUpdate>
521
+ <title>Updated tier prices for product(percentage ot fixed)</title>
522
+ <method>updateTierPrices</method>
523
+ </productAttributeTierPriceUpdate>
524
+
525
+ <!-- end -->
526
+
527
+ </methods>
528
+ <faults module="mshop">
529
+ <!-- Since 2.0.6 -->
530
+ <mamut_future_stock_not_available>
531
+ <code>2061</code>
532
+ <message>Error 2061: You are trying to use the "Future Stock" feature, however it seems like the "mamut_future_stock" attribute is not present.</message>
533
+ </mamut_future_stock_not_available>
534
+ <!-- Since 2.0.6 -->
535
+
536
+ <!-- Since 1.2.5 -->
537
+ <invalid_sku>
538
+ <code>1001</code>
539
+ <message>Error 1251: No such Product Sku was found</message>
540
+ </invalid_sku>
541
+ <invalid_pid>
542
+ <code>1002</code>
543
+ <message>Error 1252: No such Product Id was found</message>
544
+ </invalid_pid>
545
+ <update_query_failed>
546
+ <code>1003</code>
547
+ <message>Error 1253: The update query was not executed properly</message>
548
+ </update_query_failed>
549
+ <!-- End Since 1.2.5 -->
550
+
551
+
552
+ <store_view_not_exists>
553
+ <code>101</code>
554
+ <message>Store View Not Exists</message>
555
+ </store_view_not_exists>
556
+
557
+ <visibility_level_not_exists>
558
+ <code>102</code>
559
+ <message>This visibility level not exists. (1 - Not Visible Individually, 2 - Catalog, 3 - Search, 4 - Catalog, Search)</message>
560
+ </visibility_level_not_exists>
561
+
562
+ <visibility_not_set>
563
+ <code>103</code>
564
+ <message>Visibility for the product was not set</message>
565
+ </visibility_not_set>
566
+
567
+ <product_not_exists>
568
+ <code>104</code>
569
+ <message>Product with this id not exists</message>
570
+ </product_not_exists>
571
+
572
+ <not_passed_array>
573
+ <code>105</code>
574
+ <message>Store views should be passed as array of integers</message>
575
+ </not_passed_array>
576
+
577
+ <no_subcategories>
578
+ <code>106</code>
579
+ <message>The provided category doesn't have subcategories</message>
580
+ </no_subcategories>
581
+
582
+ <product_not_removed>
583
+ <code>107</code>
584
+ <message>Product was not removed from subcategories</message>
585
+ </product_not_removed>
586
+
587
+ <store_not_exists>
588
+ <code>100</code>
589
+ <message>Requested store view not found.</message>
590
+ </store_not_exists>
591
+
592
+ <not_exists>
593
+ <code>109</code>
594
+ <message>Product not exists.</message>
595
+ </not_exists>
596
+
597
+ <data_invalid>
598
+ <code>110</code>
599
+ <message>Invalid data given. Details in error message.</message>
600
+ </data_invalid>
601
+
602
+ <attribute_not_in_set>
603
+ <code>111</code>
604
+ <message>Attribute is not in set</message>
605
+ </attribute_not_in_set>
606
+
607
+ <conf_product_not_exists>
608
+ <code>112</code>
609
+ <message>Product not exits</message>
610
+ </conf_product_not_exists>
611
+
612
+ <not_configurable>
613
+ <code>113</code>
614
+ <message>Product is not configurable</message>
615
+ </not_configurable>
616
+
617
+ <products_not_added>
618
+ <code>114</code>
619
+ <message>Products are not added</message>
620
+ </products_not_added>
621
+
622
+ <simple_product_not_exists>
623
+ <code>115</code>
624
+ <message>Simple product not exits</message>
625
+ </simple_product_not_exists>
626
+
627
+ <array_of_simple_products_not_passed>
628
+ <code>116</code>
629
+ <message>Array of simple products ids is not passed</message>
630
+ </array_of_simple_products_not_passed>
631
+
632
+ <product_not_exists_sku>
633
+ <code>117</code>
634
+ <message>Product with this SKU not exists.</message>
635
+ </product_not_exists_sku>
636
+
637
+ <not_grouped>
638
+ <code>118</code>
639
+ <message>Product is not grouped.</message>
640
+ </not_grouped>
641
+
642
+ <can_not_update>
643
+ <code>119</code>
644
+ <message>Grouped product can not be updated</message>
645
+ </can_not_update>
646
+
647
+ <can_not_create>
648
+ <code>120</code>
649
+ <message>Grouped product can not be created</message>
650
+ </can_not_create>
651
+ <not_grouped_configurable>
652
+ <code>121</code>
653
+ <message>Product is not of type grouped or type configurable</message>
654
+ </not_grouped_configurable>
655
+ </faults>
656
+ </mshop_catalog>
657
+
658
+ <!-- end catalog methods -->
659
+
660
+ <!-- catalog category methods -->
661
+ <mshop_m_category translate="title" module="mshop">
662
+ <model>mshop/catalog_category_api</model>
663
+ <title>Catalog Category Methods Api</title>
664
+ <acl>mshop/catalog</acl>
665
+ <methods>
666
+ <create translate="title" module="mshop">
667
+ <title>Create new category</title>
668
+ <method>create</method>
669
+ <acl>catalog/category/create</acl>
670
+ </create>
671
+ </methods>
672
+ <faults module="mshop">
673
+ <store_not_exists>
674
+ <code>100</code>
675
+ <message>Requested store view not found.</message>
676
+ </store_not_exists>
677
+
678
+ <website_not_exists>
679
+ <code>101</code>
680
+ <message>Requested website not found.</message>
681
+ </website_not_exists>
682
+
683
+ <not_exists>
684
+ <code>102</code>
685
+ <message>Category not exists.</message>
686
+ </not_exists>
687
+
688
+ <data_invalid>
689
+ <code>103</code>
690
+ <message>Invalid data given. Details in error message.</message>
691
+ </data_invalid>
692
+
693
+ </faults>
694
+ </mshop_m_category>
695
+ <!--end catalog category methods -->
696
+ </resources>
697
+ <resources_alias>
698
+ <utility>mshop_utility</utility>
699
+ <m_customer>mshop_m_customer</m_customer>
700
+ <attribute>mshop_attribute</attribute>
701
+ <catalog>mshop_catalog</catalog>
702
+ <sales>mshop_sales</sales>
703
+ <m_category>mshop_m_category</m_category>
704
+ </resources_alias>
705
+ <v2>
706
+ <resources_function_prefix>
707
+ <utility>mshopUtility</utility>
708
+ <m_customer>mshopMCustomer</m_customer>
709
+ <attribute>mshopProductAttribute</attribute>
710
+ <catalog>mshopCatalog</catalog>
711
+ <sales>mshopSales</sales>
712
+ <m_category>mshopMCategory</m_category>
713
+ </resources_function_prefix>
714
+ </v2>
715
+ <acl>
716
+ <resources>
717
+ <ecomwise translate="title" module="mshop">
718
+ <title>Ecomwise</title>
719
+ <sort_order>100</sort_order>
720
+ <mshopapi translate="title" module="mshop">
721
+ <title>Mshop Api</title>
722
+ <sort_order>100</sort_order>
723
+ <utility translate="title" module="mshop">
724
+ <title>Api Utility Methods</title>
725
+ <sort_order>100</sort_order>
726
+ </utility>
727
+ <catalog translate="title" module="mshop">
728
+ <title>Catalog Api Methods</title>
729
+ <sort_order>101</sort_order>
730
+ <attribute translate="title" module="mshop">
731
+ <title>Catalog Attribute Api Methods</title>
732
+ <sort_order>102</sort_order>
733
+ <create translate="title" module="mshop">
734
+ <title>Create</title>
735
+ </create>
736
+
737
+ <addoptions translate="title" module="mshop">
738
+ <title>Add options</title>
739
+ </addoptions>
740
+
741
+ <delete translate="title" module="mshop">
742
+ <title>Delete</title>
743
+ </delete>
744
+
745
+ <copyset translate="title" module="mshop">
746
+ <title>Copy sets</title>
747
+ </copyset>
748
+
749
+ <addtoset translate="title" module="mshop">
750
+ <title>Add attributes to sets</title>
751
+ </addtoset>
752
+
753
+ <attributeLabelId translate="title" module="mshop">
754
+ <title>Get Attribute Option Id</title>
755
+ </attributeLabelId>
756
+ </attribute>
757
+ <product translate="title" module="mshop">
758
+ <title>Catalog Product Api Methods</title>
759
+ <sort_order>103</sort_order>
760
+
761
+ <updatestatus translate="title" module="mshop">
762
+ <title>Update Product Status</title>
763
+ </updatestatus>
764
+ <updateqty translate="title" module="mshop">
765
+ <title>Update Product Quantity</title>
766
+ </updateqty>
767
+
768
+ <simpleproductslist translate="title" module="mshop">
769
+ <title>Return Simple Products SKUs</title>
770
+ </simpleproductslist>
771
+
772
+ <productslist translate="title" module="mshop">
773
+ <title>Return All Products SKUs</title>
774
+ </productslist>
775
+
776
+ <setvisibility translate="title" module="mshop">
777
+ <title>Set product visibility</title>
778
+ </setvisibility>
779
+
780
+ <removebelow translate="title" module="mshop">
781
+ <title>Remove product from categories below root category</title>
782
+ </removebelow>
783
+
784
+ <createconfigurable translate="title" module="mshop">
785
+ <title>Create configurable product</title>
786
+ </createconfigurable>
787
+
788
+ <creategrouped translate="title" module="mshop">
789
+ <title>Create grouped product</title>
790
+ </creategrouped>
791
+
792
+ <create translate="title" module="mshop">
793
+ <title>Create product pre 1.6.2 version compatible method</title>
794
+ </create>
795
+
796
+ <getproductschangedsince translate="title" module="mshop">
797
+ <title>Get Products Changed Since</title>
798
+ </getproductschangedsince>
799
+
800
+ <update translate="title" module="mshop">
801
+ <title>Update product pre 1.6.2 version compatible method</title>
802
+ </update>
803
+
804
+ <fullproductinfo translate="title" module="mshop">
805
+ <title>Get Full Product Info</title>
806
+ </fullproductinfo>
807
+
808
+
809
+ <importimages translate="title" module="mshop">
810
+ <title>import images</title>
811
+ </importimages>
812
+ </product>
813
+ <category>
814
+ <create translate="title" module="mshop">
815
+ <title>Create new category</title>
816
+ </create>
817
+ </category>
818
+
819
+ </catalog>
820
+ <sales translate="title" module="mshop">
821
+ <title>Sales Methods</title>
822
+ <sort_order>105</sort_order>
823
+ </sales>
824
+ </mshopapi>
825
+ </ecomwise>
826
+ </resources>
827
+ </acl>
828
+ </api>
829
+ </config>
app/code/community/Ecomwise/Mshop/etc/config.xml ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ecomwise_Mshop>
5
+ <version>2.1.3</version>
6
+ </Ecomwise_Mshop>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <mshop>
11
+ <class>Ecomwise_Mshop_Helper</class>
12
+ </mshop>
13
+ <catalog>
14
+ <rewrite>
15
+ <product>Ecomwise_Mshop_Helper_Product</product>
16
+ </rewrite>
17
+ </catalog>
18
+ </helpers>
19
+ <blocks>
20
+ <mshop>
21
+ <class>Ecomwise_Mshop_Block</class>
22
+ </mshop>
23
+ <adminhtml>
24
+ <rewrite>
25
+ <!-- <sales_order_invoice_view>Ecomwise_Mshop_Block_Adminhtml_Sales_Invoice_View</sales_order_invoice_view> -->
26
+ <api_tab_rolesedit>Ecomwise_Mshop_Block_Adminhtml_Api_Tab_Rolesedit</api_tab_rolesedit>
27
+ <catalog_product_edit_tabs>Ecomwise_Mshop_Block_Adminhtml_Catalog_Product_Edit_Tabs</catalog_product_edit_tabs>
28
+ <catalog_product_edit_tab_price_tier>Ecomwise_Mshop_Block_Adminhtml_Catalog_Product_Price_Tier</catalog_product_edit_tab_price_tier>
29
+ </rewrite>
30
+ </adminhtml>
31
+ <catalog>
32
+ <rewrite>
33
+ <product_price>Ecomwise_Mshop_Block_Product_Price</product_price>
34
+ </rewrite>
35
+ </catalog>
36
+ </blocks>
37
+ <models>
38
+ <mshop>
39
+ <class>Ecomwise_Mshop_Model</class>
40
+ </mshop>
41
+ <sales>
42
+ <rewrite>
43
+ <order_api_v2>Ecomwise_Mshop_Model_Sales_Api_V2</order_api_v2>
44
+ </rewrite>
45
+ </sales>
46
+ <tax>
47
+ <rewrite>
48
+ <system_config_source_apply>Ecomwise_Mshop_Model_System_Config_Apply</system_config_source_apply>
49
+ </rewrite>
50
+ </tax>
51
+ <catalog>
52
+ <rewrite>
53
+ <product_api_v2>Ecomwise_Mshop_Model_Catalog_Product_Api_V2</product_api_v2>
54
+ <category_api_v2>Ecomwise_Mshop_Model_Catalog_Category_Api_V2</category_api_v2>
55
+ <product_type_price>Ecomwise_Mshop_Model_Catalog_Product_Type_Price</product_type_price>
56
+ <product_attribute_backend_tierprice>Ecomwise_Mshop_Model_Catalog_Attribute_Tierprice</product_attribute_backend_tierprice>
57
+ </rewrite>
58
+ </catalog>
59
+ <catalog_resource>
60
+ <rewrite>
61
+ <product_attribute_backend_tierprice>Ecomwise_Mshop_Model_Resource_Eav_Tierprice</product_attribute_backend_tierprice>
62
+ </rewrite>
63
+ </catalog_resource>
64
+ <customer>
65
+ <rewrite>
66
+ <customer_api_v2>Ecomwise_Mshop_Model_Customer_Api_V2</customer_api_v2>
67
+ </rewrite>
68
+ </customer>
69
+ <api>
70
+ <rewrite>
71
+ <server_adapter_soap>Ecomwise_Mshop_Model_Api_Server_Adapter_Soap</server_adapter_soap>
72
+ <server_v2_adapter_soap>Ecomwise_Mshop_Model_Api_Server_V2_Adapter_Soap</server_v2_adapter_soap>
73
+ </rewrite>
74
+ </api>
75
+ </models>
76
+ <resources>
77
+ <mshop_setup>
78
+ <setup>
79
+ <module>Ecomwise_Mshop</module>
80
+ <class>Mage_Sales_Model_Mysql4_Setup</class>
81
+ </setup>
82
+ <connection>
83
+ <use>core_setup</use>
84
+ </connection>
85
+ </mshop_setup>
86
+ <mshop_write>
87
+ <connection>
88
+ <use>core_write</use>
89
+ </connection>
90
+ </mshop_write>
91
+ <mshop_read>
92
+ <connection>
93
+ <use>core_read</use>
94
+ </connection>
95
+ </mshop_read>
96
+ </resources>
97
+ <events>
98
+ <sales_order_save_after>
99
+ <observers>
100
+ <mshop_model_observer_before>
101
+ <type>singleton</type>
102
+ <class>Ecomwise_Mshop_Model_Observer</class>
103
+ <method>saveConfigAfter</method>
104
+ </mshop_model_observer_before>
105
+ </observers>
106
+ </sales_order_save_after>
107
+ </events>
108
+ </global>
109
+ <adminhtml>
110
+ <acl>
111
+ <resources>
112
+ <all>
113
+ <title>Allow Everything</title>
114
+ </all>
115
+ <admin>
116
+ <children>
117
+ <system>
118
+ <children>
119
+ <config>
120
+ <children>
121
+ <mshop translate="title" module="mshop">
122
+ <title>Ecomwise Mshop</title>
123
+ </mshop>
124
+ </children>
125
+ </config>
126
+ </children>
127
+ </system>
128
+ </children>
129
+ </admin>
130
+ </resources>
131
+ </acl>
132
+ </adminhtml>
133
+ <default>
134
+ <mshop>
135
+ <parameters>
136
+ <send_mail>0</send_mail>
137
+ </parameters>
138
+ <mamut_stock>
139
+ <use_stock_from_suppliers>0</use_stock_from_suppliers>
140
+ <show_fields>0</show_fields>
141
+ </mamut_stock>
142
+ </mshop>
143
+ </default>
144
+
145
+ </config>
app/code/community/Ecomwise/Mshop/etc/system.xml ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <tabs>
5
+ <mshop_tab translate="label" module="mshop">
6
+ <label>M-shop</label>
7
+ <sort_order>210</sort_order>
8
+ </mshop_tab>
9
+ </tabs>
10
+ <sections>
11
+ <mshop translate="label" module="mshop">
12
+ <label>M-shop B2C</label>
13
+ <tab>mshop_tab</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>110</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
+ <groups>
20
+ <about translate="label">
21
+ <label>About M-shop</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</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
+ <fields>
28
+ <mshop_version translate="label">
29
+ <label>M-shop B2C</label>
30
+ <frontend_type>select</frontend_type>
31
+ <frontend_model>mshop/system_config_version</frontend_model>
32
+ <sort_order>10</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </mshop_version>
37
+ </fields>
38
+ </about>
39
+
40
+ <parameters translate="label">
41
+ <label>Create customer settings</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>3</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ <fields>
48
+ <send_mail translate="label">
49
+ <label>Send email when customer is updated via API</label>
50
+ <frontend_type>select</frontend_type>
51
+ <source_model>adminhtml/system_config_source_yesno</source_model>
52
+ <sort_order>10</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ </send_mail>
57
+ <!--
58
+ <use_stock_from_suppliers translate="label">
59
+ <label>Use stock from suppliers</label>
60
+ <frontend_type>select</frontend_type>
61
+ <source_model>adminhtml/system_config_source_yesno</source_model>
62
+ <sort_order>11</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ </use_stock_from_suppliers>
67
+ -->
68
+ </fields>
69
+ </parameters>
70
+
71
+ <mamut_stock translate="label">
72
+ <label>Inventory settings</label>
73
+ <frontend_type>text</frontend_type>
74
+ <sort_order>3</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>1</show_in_store>
78
+ <fields>
79
+ <show_fields translate="label">
80
+ <label>Display Mamut warehouses in the product inventory tab</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_yesno</source_model>
83
+ <sort_order>10</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>0</show_in_website>
86
+ <show_in_store>0</show_in_store>
87
+ </show_fields>
88
+
89
+ <use_stock_from_suppliers translate="label">
90
+ <label>Use from suppliers stock</label>
91
+ <frontend_type>select</frontend_type>
92
+ <source_model>adminhtml/system_config_source_yesno</source_model>
93
+ <sort_order>11</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ </use_stock_from_suppliers>
98
+
99
+ </fields>
100
+
101
+ </mamut_stock>
102
+
103
+ <parameters_invoice translate="label">
104
+ <label>Create invoice with mamut id settings</label>
105
+ <frontend_type>text</frontend_type>
106
+ <sort_order>4</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>1</show_in_website>
109
+ <show_in_store>1</show_in_store>
110
+ <fields>
111
+ <send_mail translate="label">
112
+ <label>Send email when invoice is created via API</label>
113
+ <frontend_type>select</frontend_type>
114
+ <source_model>adminhtml/system_config_source_yesno</source_model>
115
+ <sort_order>10</sort_order>
116
+ <show_in_default>1</show_in_default>
117
+ <show_in_website>1</show_in_website>
118
+ <show_in_store>1</show_in_store>
119
+ </send_mail>
120
+
121
+ <email_template translate="label">
122
+ <label>Email template</label>
123
+ <frontend_type>select</frontend_type>
124
+ <source_model>adminhtml/system_config_source_email_template</source_model>
125
+ <sort_order>13</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ </email_template>
130
+
131
+ </fields>
132
+ </parameters_invoice>
133
+ <parameters_order_cancellation translate="label">
134
+ <label>Order Cancellation</label>
135
+ <frontend_type>text</frontend_type>
136
+ <sort_order>5</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ <fields>
141
+ <send_mail translate="label">
142
+ <label>Send email when order is cancelled via API</label>
143
+ <frontend_type>select</frontend_type>
144
+ <source_model>adminhtml/system_config_source_yesno</source_model>
145
+ <sort_order>10</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ </send_mail>
150
+ <email_template translate="label">
151
+ <label>Email template</label>
152
+ <frontend_type>select</frontend_type>
153
+ <source_model>adminhtml/system_config_source_email_template</source_model>
154
+ <sort_order>13</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ </email_template>
159
+ </fields>
160
+ </parameters_order_cancellation>
161
+ <parameters_not_in_stock translate="label">
162
+ <label>Ordered items can not be delivered</label>
163
+ <frontend_type>text</frontend_type>
164
+ <sort_order>6</sort_order>
165
+ <show_in_default>1</show_in_default>
166
+ <show_in_website>1</show_in_website>
167
+ <show_in_store>1</show_in_store>
168
+ <fields>
169
+ <send_mail translate="label">
170
+ <label>Send email notification when ordered items are not in stock</label>
171
+ <frontend_type>select</frontend_type>
172
+ <source_model>adminhtml/system_config_source_yesno</source_model>
173
+ <sort_order>10</sort_order>
174
+ <show_in_default>1</show_in_default>
175
+ <show_in_website>1</show_in_website>
176
+ <show_in_store>1</show_in_store>
177
+ </send_mail>
178
+ <email_template translate="label">
179
+ <label>Email template</label>
180
+ <frontend_type>select</frontend_type>
181
+ <source_model>adminhtml/system_config_source_email_template</source_model>
182
+ <sort_order>13</sort_order>
183
+ <show_in_default>1</show_in_default>
184
+ <show_in_website>1</show_in_website>
185
+ <show_in_store>1</show_in_store>
186
+ </email_template>
187
+ <order_status translate="label">
188
+ <label>Order Status</label>
189
+ <frontend_type>select</frontend_type>
190
+ <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
191
+ <sort_order>2</sort_order>
192
+ <show_in_default>1</show_in_default>
193
+ <show_in_website>1</show_in_website>
194
+ <show_in_store>0</show_in_store>
195
+ </order_status>
196
+ </fields>
197
+ </parameters_not_in_stock>
198
+ <parameters_order_picked translate="label">
199
+ <label>Order is picked</label>
200
+ <frontend_type>text</frontend_type>
201
+ <sort_order>7</sort_order>
202
+ <show_in_default>1</show_in_default>
203
+ <show_in_website>1</show_in_website>
204
+ <show_in_store>1</show_in_store>
205
+ <fields>
206
+ <send_mail translate="label">
207
+ <label>Send email when order is picked via API</label>
208
+ <frontend_type>select</frontend_type>
209
+ <source_model>adminhtml/system_config_source_yesno</source_model>
210
+ <sort_order>10</sort_order>
211
+ <show_in_default>1</show_in_default>
212
+ <show_in_website>1</show_in_website>
213
+ <show_in_store>1</show_in_store>
214
+ </send_mail>
215
+ <email_template translate="label">
216
+ <label>Email template</label>
217
+ <frontend_type>select</frontend_type>
218
+ <source_model>adminhtml/system_config_source_email_template</source_model>
219
+ <sort_order>13</sort_order>
220
+ <show_in_default>1</show_in_default>
221
+ <show_in_website>1</show_in_website>
222
+ <show_in_store>1</show_in_store>
223
+ </email_template>
224
+ <order_status translate="label">
225
+ <label>Order Status</label>
226
+ <frontend_type>select</frontend_type>
227
+ <source_model>adminhtml/system_config_source_order_status_newprocessing</source_model>
228
+ <sort_order>2</sort_order>
229
+ <show_in_default>1</show_in_default>
230
+ <show_in_website>1</show_in_website>
231
+ <show_in_store>0</show_in_store>
232
+ </order_status>
233
+ </fields>
234
+ </parameters_order_picked>
235
+ <parameters_order_shipped translate="label">
236
+ <label>Order is shipped</label>
237
+ <frontend_type>text</frontend_type>
238
+ <sort_order>8</sort_order>
239
+ <show_in_default>1</show_in_default>
240
+ <show_in_website>1</show_in_website>
241
+ <show_in_store>1</show_in_store>
242
+ <fields>
243
+ <send_mail translate="label">
244
+ <label>Send email when order is shipped via API</label>
245
+ <frontend_type>select</frontend_type>
246
+ <source_model>adminhtml/system_config_source_yesno</source_model>
247
+ <sort_order>10</sort_order>
248
+ <show_in_default>1</show_in_default>
249
+ <show_in_website>1</show_in_website>
250
+ <show_in_store>1</show_in_store>
251
+ </send_mail>
252
+ <email_template translate="label">
253
+ <label>Email template</label>
254
+ <frontend_type>select</frontend_type>
255
+ <source_model>adminhtml/system_config_source_email_template</source_model>
256
+ <sort_order>13</sort_order>
257
+ <show_in_default>1</show_in_default>
258
+ <show_in_website>1</show_in_website>
259
+ <show_in_store>1</show_in_store>
260
+ </email_template>
261
+ </fields>
262
+ </parameters_order_shipped>
263
+
264
+ <parameters_order_custom_attributes translate="label">
265
+ <label>Order info custom fields</label>
266
+ <frontend_type>text</frontend_type>
267
+ <sort_order>9</sort_order>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>1</show_in_store>
271
+ <fields>
272
+ <custom_order_1 translate="label">
273
+ <label>Custom order field 1</label>
274
+ <frontend_type>select</frontend_type>
275
+ <source_model>mshop/config_source_orderattributes</source_model>
276
+ <sort_order>10</sort_order>
277
+ <show_in_default>1</show_in_default>
278
+ <show_in_website>0</show_in_website>
279
+ <show_in_store>0</show_in_store>
280
+ </custom_order_1>
281
+ <custom_order_2 translate="label">
282
+ <label>Custom order field 2</label>
283
+ <frontend_type>select</frontend_type>
284
+ <source_model>mshop/config_source_orderattributes</source_model>
285
+ <sort_order>13</sort_order>
286
+ <show_in_default>1</show_in_default>
287
+ <show_in_website>0</show_in_website>
288
+ <show_in_store>0</show_in_store>
289
+ </custom_order_2>
290
+
291
+ <custom_order_3 translate="label">
292
+ <label>Custom order field 3</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>mshop/config_source_orderattributes</source_model>
295
+ <sort_order>14</sort_order>
296
+ <show_in_default>1</show_in_default>
297
+ <show_in_website>0</show_in_website>
298
+ <show_in_store>0</show_in_store>
299
+ </custom_order_3>
300
+ </fields>
301
+ </parameters_order_custom_attributes>
302
+ </groups>
303
+ </mshop>
304
+ </sections>
305
+ </config>
app/code/community/Ecomwise/Mshop/etc/wsdl.xml ADDED
@@ -0,0 +1,2928 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
4
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
5
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
6
+ <types>
7
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
8
+ targetNamespace="urn:Magento">
9
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"
10
+ schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
11
+
12
+ <!-- fix for "associativeMultiArray" missing error on 1.6.1 magento version -->
13
+ <complexType name="associativeMultiArray">
14
+ <complexContent>
15
+ <restriction base="soapenc:Array">
16
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:associativeMultiEntity[]" />
17
+ </restriction>
18
+ </complexContent>
19
+ </complexType>
20
+
21
+ <complexType name="associativeMultiEntity">
22
+ <all>
23
+ <element name="key" type="xsd:string" />
24
+ <element name="value" type="typens:ArrayOfString" />
25
+ </all>
26
+ </complexType>
27
+ <!-- -->
28
+
29
+ <!-- utility -->
30
+
31
+ <complexType name="mshopUtilityListTaxClassRulesEntity">
32
+ <all>
33
+ <element name="tax_rule_id" type="xsd:int" minOccurs="0" />
34
+ <element name="tax_rule_name" type="xsd:string" />
35
+ </all>
36
+ </complexType>
37
+
38
+ <complexType name="mshopUtilityListTaxClassRulesEntityArray">
39
+ <complexContent>
40
+ <restriction base="soapenc:Array">
41
+ <attribute ref="soapenc:arrayType"
42
+ wsdl:arrayType="typens:mshopUtilityListTaxClassRulesEntity[]" />
43
+ </restriction>
44
+ </complexContent>
45
+ </complexType>
46
+
47
+
48
+ <complexType name="mshopUtilityListPaymentStatusesEntity">
49
+ <all>
50
+ <element name="status" type="xsd:string" />
51
+ <element name="statusCode" type="xsd:string" />
52
+ </all>
53
+ </complexType>
54
+
55
+ <complexType name="mshopUtilityListPaymentStatusesEntityArray">
56
+ <complexContent>
57
+ <restriction base="soapenc:Array">
58
+ <attribute ref="soapenc:arrayType"
59
+ wsdl:arrayType="typens:mshopUtilityListPaymentStatusesEntity[]" />
60
+ </restriction>
61
+ </complexContent>
62
+ </complexType>
63
+
64
+
65
+ <complexType name="mshopUtilityListTaxClassesEntity">
66
+ <all>
67
+ <element name="class_id" type="xsd:int" minOccurs="0" />
68
+ <element name="class_name" type="xsd:string" />
69
+ <element name="class_type" type="xsd:string" />
70
+ </all>
71
+ </complexType>
72
+
73
+ <complexType name="mshopUtilityListTaxClassesEntityArray">
74
+ <complexContent>
75
+ <restriction base="soapenc:Array">
76
+ <attribute ref="soapenc:arrayType"
77
+ wsdl:arrayType="typens:mshopUtilityListTaxClassesEntity[]" />
78
+ </restriction>
79
+ </complexContent>
80
+ </complexType>
81
+
82
+ <complexType name="mshopUtilityListPaymentMethodsEntityArray">
83
+ <complexContent>
84
+ <restriction base="soapenc:Array">
85
+ <attribute ref="soapenc:arrayType"
86
+ wsdl:arrayType="typens:mshopUtilityListPaymentMethodsEntity[]" />
87
+ </restriction>
88
+ </complexContent>
89
+ </complexType>
90
+
91
+ <complexType name="mshopUtilityListPaymentMethodsEntity">
92
+ <all>
93
+ <element name="method_code" type="xsd:string" />
94
+ <element name="method_title" type="xsd:string" />
95
+ </all>
96
+ </complexType>
97
+
98
+ <complexType name="mshopUtilityListShippingMethodsEntityArray">
99
+ <complexContent>
100
+ <restriction base="soapenc:Array">
101
+ <attribute ref="soapenc:arrayType"
102
+ wsdl:arrayType="typens:mshopUtilityListShippingMethodsEntity[]" />
103
+ </restriction>
104
+ </complexContent>
105
+ </complexType>
106
+
107
+ <complexType name="mshopUtilityListShippingMethodsEntity">
108
+ <all>
109
+ <element name="method_title" type="xsd:string" />
110
+ <element name="method_code" type="xsd:string" />
111
+ </all>
112
+ </complexType>
113
+
114
+ <complexType name="mshopUtilityListStoreViewEntityArray">
115
+ <complexContent>
116
+ <restriction base="soapenc:Array">
117
+ <attribute ref="soapenc:arrayType"
118
+ wsdl:arrayType="typens:mshopUtilityListStoreViewEntity[]" />
119
+ </restriction>
120
+ </complexContent>
121
+ </complexType>
122
+
123
+ <complexType name="mshopUtilityListStoreViewEntity">
124
+ <all>
125
+ <element name="websiteid" type="xsd:int" minOccurs="0" />
126
+ <element name="groupname" type="xsd:string" />
127
+ <element name="storeid" type="xsd:int" minOccurs="0" />
128
+ <element name="name" type="xsd:string" />
129
+ <element name="language" type="xsd:string" />
130
+ <element name="store_url" type="xsd:string" />
131
+ </all>
132
+ </complexType>
133
+
134
+ <complexType name="mshopUtilityListPaymentMethodsByStoreEntityArray">
135
+ <complexContent>
136
+ <restriction base="soapenc:Array">
137
+ <attribute ref="soapenc:arrayType"
138
+ wsdl:arrayType="typens:mshopUtilityListPaymentMethodsByStoreEntity[]" />
139
+ </restriction>
140
+ </complexContent>
141
+ </complexType>
142
+
143
+ <complexType name="mshopUtilityListPaymentMethodsByStoreEntity">
144
+ <all>
145
+ <element name="method_code" type="xsd:string" />
146
+ <element name="method_title" type="xsd:string" />
147
+ <element name="store_id" type="xsd:int" minOccurs="0" />
148
+ <element name="store_name" type="xsd:string" />
149
+ </all>
150
+ </complexType>
151
+
152
+ <!-- end utility -->
153
+
154
+ <!-- attribute -->
155
+
156
+ <complexType name="mshopProductAttributeCreateArrayEntity">
157
+ <all>
158
+ <element name="is_global" type="xsd:int" minOccurs="0" />
159
+ <element name="frontend_input" type="xsd:string" minOccurs="0" />
160
+ <element name="default_value_text" type="xsd:string"
161
+ minOccurs="0" />
162
+ <element name="default_value_yesno" type="xsd:int"
163
+ minOccurs="0" />
164
+ <element name="default_value_date" type="xsd:string"
165
+ minOccurs="0" />
166
+ <element name="default_value_textarea" type="xsd:string"
167
+ minOccurs="0" />
168
+ <element name="is_unique" type="xsd:int" minOccurs="0" />
169
+ <element name="is_required" type="xsd:int" minOccurs="0" />
170
+ <element name="frontend_class" type="xsd:string" minOccurs="0" />
171
+ <element name="is_searchable" type="xsd:int" minOccurs="0" />
172
+ <element name="is_visible_in_advanced_search" type="xsd:int"
173
+ minOccurs="0" />
174
+ <element name="is_comparable" type="xsd:int" minOccurs="0" />
175
+ <element name="is_used_for_promo_rules" type="xsd:int"
176
+ minOccurs="0" />
177
+ <element name="is_html_allowed_on_front" type="xsd:int"
178
+ minOccurs="0" />
179
+ <element name="is_visible_on_front" type="xsd:int"
180
+ minOccurs="0" />
181
+ <element name="used_in_product_listing" type="xsd:int"
182
+ minOccurs="0" />
183
+ <element name="used_for_sort_by" type="xsd:int" minOccurs="0" />
184
+ <element name="is_configurable" type="xsd:int" minOccurs="0" />
185
+ <element name="is_filterable" type="xsd:int" minOccurs="0" />
186
+ <element name="is_filterable_in_search" type="xsd:int"
187
+ minOccurs="0" />
188
+ <element name="backend_type" type="xsd:string" minOccurs="0" />
189
+ <element name="default_value" type="xsd:string" minOccurs="0" />
190
+ </all>
191
+ </complexType>
192
+
193
+ <complexType name="mshopProductAttributeSetsEntityArray">
194
+ <complexContent>
195
+ <restriction base="soapenc:Array">
196
+ <attribute ref="soapenc:arrayType"
197
+ wsdl:arrayType="typens:mshopProductAttributeSetsEntity[]" />
198
+ </restriction>
199
+ </complexContent>
200
+ </complexType>
201
+
202
+ <complexType name="mshopProductAttributeSetsEntity">
203
+ <all>
204
+ <element name="id" type="xsd:string" />
205
+ <element name="name" type="xsd:string" />
206
+ </all>
207
+ </complexType>
208
+
209
+ <!-- end attribute -->
210
+
211
+ <!-- sales -->
212
+ <complexType name="mshopSalesCreditMemoEntity">
213
+ <all>
214
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
215
+ <element name="created_at" type="xsd:string" minOccurs="0" />
216
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
217
+ <element name="transaction_id" type="xsd:string" minOccurs="0" />
218
+ <element name="global_currency_code" type="xsd:string" minOccurs="0" />
219
+ <element name="base_currency_code" type="xsd:string" minOccurs="0" />
220
+ <element name="order_currency_code" type="xsd:string" minOccurs="0" />
221
+ <element name="store_currency_code" type="xsd:string" minOccurs="0" />
222
+ <element name="cybersource_token" type="xsd:string" minOccurs="0" />
223
+ <element name="invoice_id" type="xsd:string" minOccurs="0" />
224
+ <element name="billing_address_id" type="xsd:string" minOccurs="0" />
225
+ <element name="shipping_address_id" type="xsd:string" minOccurs="0" />
226
+ <element name="state" type="xsd:string" minOccurs="0" />
227
+ <element name="creditmemo_status" type="xsd:string" minOccurs="0" />
228
+ <element name="email_sent" type="xsd:string" minOccurs="0" />
229
+ <element name="order_id" type="xsd:string" minOccurs="0" />
230
+ <element name="tax_amount" type="xsd:string" minOccurs="0" />
231
+ <element name="shipping_tax_amount" type="xsd:string" minOccurs="0" />
232
+ <element name="base_tax_amount" type="xsd:string" minOccurs="0" />
233
+ <element name="base_adjustment_positive" type="xsd:string" minOccurs="0" />
234
+ <element name="base_grand_total" type="xsd:string" minOccurs="0" />
235
+ <element name="adjustment" type="xsd:string" minOccurs="0" />
236
+ <element name="subtotal" type="xsd:string" minOccurs="0" />
237
+ <element name="discount_amount" type="xsd:string" minOccurs="0" />
238
+ <element name="base_subtotal" type="xsd:string" minOccurs="0" />
239
+ <element name="base_adjustment" type="xsd:string" minOccurs="0" />
240
+ <element name="base_to_global_rate" type="xsd:string" minOccurs="0" />
241
+ <element name="store_to_base_rate" type="xsd:string" minOccurs="0" />
242
+ <element name="base_shipping_amount" type="xsd:string" minOccurs="0" />
243
+ <element name="adjustment_negative" type="xsd:string" minOccurs="0" />
244
+ <element name="subtotal_incl_tax" type="xsd:string" minOccurs="0" />
245
+ <element name="shipping_amount" type="xsd:string" minOccurs="0" />
246
+ <element name="base_subtotal_incl_tax" type="xsd:string" minOccurs="0" />
247
+ <element name="base_adjustment_negative" type="xsd:string" minOccurs="0" />
248
+ <element name="grand_total" type="xsd:string" minOccurs="0" />
249
+ <element name="base_discount_amount" type="xsd:string" minOccurs="0" />
250
+ <element name="base_to_order_rate" type="xsd:string" minOccurs="0" />
251
+ <element name="store_to_order_rate" type="xsd:string" minOccurs="0" />
252
+ <element name="base_shipping_tax_amount" type="xsd:string" minOccurs="0" />
253
+ <element name="adjustment_positive" type="xsd:string" minOccurs="0" />
254
+ <element name="store_id" type="xsd:string" minOccurs="0" />
255
+ <element name="hidden_tax_amount" type="xsd:string" minOccurs="0" />
256
+ <element name="base_hidden_tax_amount" type="xsd:string" minOccurs="0" />
257
+ <element name="shipping_hidden_tax_amount" type="xsd:string" minOccurs="0" />
258
+ <element name="base_shipping_hidden_tax_amnt" type="xsd:string" minOccurs="0" />
259
+ <element name="shipping_incl_tax" type="xsd:string" minOccurs="0" />
260
+ <element name="base_shipping_incl_tax" type="xsd:string" minOccurs="0" />
261
+ <element name="base_customer_balance_amount" type="xsd:string" minOccurs="0" />
262
+ <element name="customer_balance_amount" type="xsd:string" minOccurs="0" />
263
+ <element name="bs_customer_bal_total_refunded" type="xsd:string" minOccurs="0" />
264
+ <element name="customer_bal_total_refunded" type="xsd:string" minOccurs="0" />
265
+ <element name="base_gift_cards_amount" type="xsd:string" minOccurs="0" />
266
+ <element name="gift_cards_amount" type="xsd:string" minOccurs="0" />
267
+ <element name="gw_base_price" type="xsd:string" minOccurs="0" />
268
+ <element name="gw_price" type="xsd:string" minOccurs="0" />
269
+ <element name="gw_items_base_price" type="xsd:string" minOccurs="0" />
270
+ <element name="gw_items_price" type="xsd:string" minOccurs="0" />
271
+ <element name="gw_card_base_price" type="xsd:string" minOccurs="0" />
272
+ <element name="gw_card_price" type="xsd:string" minOccurs="0" />
273
+ <element name="gw_base_tax_amount" type="xsd:string" minOccurs="0" />
274
+ <element name="gw_tax_amount" type="xsd:string" minOccurs="0" />
275
+ <element name="gw_items_base_tax_amount" type="xsd:string" minOccurs="0" />
276
+ <element name="gw_items_tax_amount" type="xsd:string" minOccurs="0" />
277
+ <element name="gw_card_base_tax_amount" type="xsd:string" minOccurs="0" />
278
+ <element name="gw_card_tax_amount" type="xsd:string" minOccurs="0" />
279
+ <element name="base_reward_currency_amount" type="xsd:string" minOccurs="0" />
280
+ <element name="reward_currency_amount" type="xsd:string" minOccurs="0" />
281
+ <element name="reward_points_balance" type="xsd:string" minOccurs="0" />
282
+ <element name="reward_points_balance_refund" type="xsd:string" minOccurs="0" />
283
+ <element name="creditmemo_id" type="xsd:string" minOccurs="0" />
284
+ <element name="items" type="typens:mshopSalesCreditMemoItemEntityArray" minOccurs="0" />
285
+ <element name="comments" type="typens:mshopSalesCreditMemoCommentEntityArray" minOccurs="0" />
286
+
287
+ </all>
288
+ </complexType>
289
+
290
+ <complexType name="mshopSalesCreditMemoEntityArray">
291
+ <complexContent>
292
+ <restriction base="soapenc:Array">
293
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopSalesCreditMemoEntity[]" />
294
+ </restriction>
295
+ </complexContent>
296
+ </complexType>
297
+ <complexType name="mshopSalesCreditMemoItemEntity">
298
+ <all>
299
+ <element name="item_id" type="xsd:string" minOccurs="0" />
300
+ <element name="parent_id" type="xsd:string" minOccurs="0" />
301
+ <element name="weee_tax_applied_row_amount" type="xsd:string" minOccurs="0" />
302
+ <element name="base_price" type="xsd:string" minOccurs="0" />
303
+ <element name="base_weee_tax_row_disposition" type="xsd:string" minOccurs="0" />
304
+ <element name="tax_amount" type="xsd:string" minOccurs="0" />
305
+ <element name="base_weee_tax_applied_amount" type="xsd:string" minOccurs="0" />
306
+ <element name="weee_tax_row_disposition" type="xsd:string" minOccurs="0" />
307
+ <element name="base_row_total" type="xsd:string" minOccurs="0" />
308
+ <element name="discount_amount" type="xsd:string" minOccurs="0" />
309
+ <element name="row_total" type="xsd:string" minOccurs="0" />
310
+ <element name="weee_tax_applied_amount" type="xsd:string" minOccurs="0" />
311
+ <element name="base_discount_amount" type="xsd:string" minOccurs="0" />
312
+ <element name="base_weee_tax_disposition" type="xsd:string" minOccurs="0" />
313
+ <element name="price_incl_tax" type="xsd:string" minOccurs="0" />
314
+ <element name="base_tax_amount" type="xsd:string" minOccurs="0" />
315
+ <element name="weee_tax_disposition" type="xsd:string" minOccurs="0" />
316
+ <element name="base_price_incl_tax" type="xsd:string" minOccurs="0" />
317
+ <element name="qty" type="xsd:string" minOccurs="0" />
318
+ <element name="base_cost" type="xsd:string" minOccurs="0" />
319
+ <element name="base_weee_tax_applied_row_amount" type="xsd:string" minOccurs="0" />
320
+ <element name="price" type="xsd:string" minOccurs="0" />
321
+ <element name="base_row_total_incl_tax" type="xsd:string" minOccurs="0" />
322
+ <element name="row_total_incl_tax" type="xsd:string" minOccurs="0" />
323
+ <element name="product_id" type="xsd:string" minOccurs="0" />
324
+ <element name="order_item_id" type="xsd:string" minOccurs="0" />
325
+ <element name="additional_data" type="xsd:string" minOccurs="0" />
326
+ <element name="description" type="xsd:string" minOccurs="0" />
327
+ <element name="weee_tax_applied" type="xsd:string" minOccurs="0" />
328
+ <element name="sku" type="xsd:string" minOccurs="0" />
329
+ <element name="name" type="xsd:string" minOccurs="0" />
330
+ <element name="hidden_tax_amount" type="xsd:string" minOccurs="0"/>
331
+ <element name="base_hidden_tax_amount" type="xsd:string" minOccurs="0"/>
332
+ </all>
333
+ </complexType>
334
+ <complexType name="mshopSalesCreditMemoItemEntityArray">
335
+ <complexContent>
336
+ <restriction base="soapenc:Array">
337
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopSalesCreditMemoItemEntity[]" />
338
+ </restriction>
339
+ </complexContent>
340
+ </complexType>
341
+ <complexType name="mshopSalesCreditMemoCommentEntity">
342
+ <all>
343
+ <element name="parent_id" type="xsd:string" minOccurs="0" />
344
+ <element name="created_at" type="xsd:string" minOccurs="0" />
345
+ <element name="comment" type="xsd:string" minOccurs="0" />
346
+ <element name="is_customer_notified" type="xsd:string" minOccurs="0" />
347
+ <!-- <element name="comment_id" type="xsd:string" minOccurs="0" /> -->
348
+ <element name="is_visible_on_front" type="xsd:string" minOccurs="0"/>
349
+ </all>
350
+ </complexType>
351
+ <complexType name="mshopSalesCreditMemoCommentEntityArray">
352
+ <complexContent>
353
+ <restriction base="soapenc:Array">
354
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopSalesCreditMemoCommentEntity[]" />
355
+ </restriction>
356
+ </complexContent>
357
+ </complexType>
358
+ <complexType name="mshopSalesCreditMemoData">
359
+ <all>
360
+ <element name="qtys" type="typens:orderItemIdQtyArray" minOccurs="0"/>
361
+ <element name="shipping_amount" type="xsd:double" minOccurs="0"/>
362
+ <element name="adjustment_positive" type="xsd:double" minOccurs="0"/>
363
+ <element name="adjustment_negative" type="xsd:double" minOccurs="0"/>
364
+ </all>
365
+ </complexType>
366
+
367
+
368
+
369
+
370
+ <complexType name="mshopProductSalesEntity">
371
+ <all>
372
+ <element name="sku" type="xsd:string" minOccurs="0" />
373
+ <element name="qty" type="xsd:double" minOccurs="0" />
374
+ </all>
375
+ </complexType>
376
+
377
+ <complexType name="mshopProductSalesEntityArray">
378
+ <complexContent>
379
+ <restriction base="soapenc:Array">
380
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopProductSalesEntity[]" />
381
+ </restriction>
382
+ </complexContent>
383
+ </complexType>
384
+
385
+ <complexType name="salesOrderEntity">
386
+ <all>
387
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
388
+ <element name="parent_id" type="xsd:string" minOccurs="0" />
389
+ <element name="store_id" type="xsd:string" minOccurs="0" />
390
+ <element name="created_at" type="xsd:string" minOccurs="0" />
391
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
392
+ <element name="is_active" type="xsd:string" minOccurs="0" />
393
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
394
+ <element name="tax_amount" type="xsd:string" minOccurs="0" />
395
+ <element name="shipping_amount" type="xsd:string"
396
+ minOccurs="0" />
397
+ <element name="discount_amount" type="xsd:string"
398
+ minOccurs="0" />
399
+ <element name="subtotal" type="xsd:string" minOccurs="0" />
400
+ <element name="grand_total" type="xsd:string" minOccurs="0" />
401
+ <element name="total_paid" type="xsd:string" minOccurs="0" />
402
+ <element name="total_refunded" type="xsd:string" minOccurs="0" />
403
+ <element name="total_qty_ordered" type="xsd:string"
404
+ minOccurs="0" />
405
+ <element name="total_canceled" type="xsd:string" minOccurs="0" />
406
+ <element name="total_invoiced" type="xsd:string" minOccurs="0" />
407
+ <element name="total_online_refunded" type="xsd:string"
408
+ minOccurs="0" />
409
+ <element name="total_offline_refunded" type="xsd:string"
410
+ minOccurs="0" />
411
+ <element name="base_tax_amount" type="xsd:string"
412
+ minOccurs="0" />
413
+ <element name="base_shipping_amount" type="xsd:string"
414
+ minOccurs="0" />
415
+ <element name="base_discount_amount" type="xsd:string"
416
+ minOccurs="0" />
417
+ <element name="base_subtotal" type="xsd:string" minOccurs="0" />
418
+ <element name="base_grand_total" type="xsd:string"
419
+ minOccurs="0" />
420
+ <element name="base_total_paid" type="xsd:string"
421
+ minOccurs="0" />
422
+ <element name="base_total_refunded" type="xsd:string"
423
+ minOccurs="0" />
424
+ <element name="base_total_qty_ordered" type="xsd:string"
425
+ minOccurs="0" />
426
+ <element name="base_total_canceled" type="xsd:string"
427
+ minOccurs="0" />
428
+ <element name="base_total_invoiced" type="xsd:string"
429
+ minOccurs="0" />
430
+ <element name="base_total_online_refunded" type="xsd:string"
431
+ minOccurs="0" />
432
+ <element name="base_total_offline_refunded" type="xsd:string"
433
+ minOccurs="0" />
434
+ <element name="billing_address_id" type="xsd:string"
435
+ minOccurs="0" />
436
+ <element name="billing_firstname" type="xsd:string"
437
+ minOccurs="0" />
438
+ <element name="billing_lastname" type="xsd:string"
439
+ minOccurs="0" />
440
+ <element name="shipping_address_id" type="xsd:string"
441
+ minOccurs="0" />
442
+ <element name="shipping_firstname" type="xsd:string"
443
+ minOccurs="0" />
444
+ <element name="shipping_lastname" type="xsd:string"
445
+ minOccurs="0" />
446
+ <element name="billing_name" type="xsd:string" minOccurs="0" />
447
+ <element name="shipping_name" type="xsd:string" minOccurs="0" />
448
+ <element name="store_to_base_rate" type="xsd:string"
449
+ minOccurs="0" />
450
+ <element name="store_to_order_rate" type="xsd:string"
451
+ minOccurs="0" />
452
+ <element name="base_to_global_rate" type="xsd:string"
453
+ minOccurs="0" />
454
+ <element name="base_to_order_rate" type="xsd:string"
455
+ minOccurs="0" />
456
+ <element name="weight" type="xsd:string" minOccurs="0" />
457
+ <element name="store_name" type="xsd:string" minOccurs="0" />
458
+ <element name="remote_ip" type="xsd:string" minOccurs="0" />
459
+ <element name="status" type="xsd:string" minOccurs="0" />
460
+ <element name="state" type="xsd:string" minOccurs="0" />
461
+ <element name="applied_rule_ids" type="xsd:string"
462
+ minOccurs="0" />
463
+ <element name="global_currency_code" type="xsd:string"
464
+ minOccurs="0" />
465
+ <element name="base_currency_code" type="xsd:string"
466
+ minOccurs="0" />
467
+ <element name="store_currency_code" type="xsd:string"
468
+ minOccurs="0" />
469
+ <element name="order_currency_code" type="xsd:string"
470
+ minOccurs="0" />
471
+ <element name="shipping_method" type="xsd:string"
472
+ minOccurs="0" />
473
+ <element name="shipping_description" type="xsd:string"
474
+ minOccurs="0" />
475
+ <element name="customer_email" type="xsd:string" minOccurs="0" />
476
+ <element name="customer_firstname" type="xsd:string"
477
+ minOccurs="0" />
478
+ <element name="customer_lastname" type="xsd:string"
479
+ minOccurs="0" />
480
+ <element name="quote_id" type="xsd:string" minOccurs="0" />
481
+ <element name="is_virtual" type="xsd:string" minOccurs="0" />
482
+ <element name="customer_group_id" type="xsd:string"
483
+ minOccurs="0" />
484
+ <element name="customer_note_notify" type="xsd:string"
485
+ minOccurs="0" />
486
+ <element name="customer_is_guest" type="xsd:string"
487
+ minOccurs="0" />
488
+ <element name="email_sent" type="xsd:string" minOccurs="0" />
489
+ <element name="order_id" type="xsd:string" minOccurs="0" />
490
+ <element name="gift_message_id" type="xsd:string"
491
+ minOccurs="0" />
492
+ <element name="gift_message" type="xsd:string" minOccurs="0" />
493
+ <element name="mshop_invoice_date" type="xsd:string"
494
+ minOccurs="0" />
495
+ <element name="mshop_shipment_tax_rule" type="xsd:string"
496
+ minOccurs="0" />
497
+ <element name="shipping_address" type="typens:salesOrderAddressEntity"
498
+ minOccurs="0" />
499
+ <element name="billing_address" type="typens:salesOrderAddressEntity"
500
+ minOccurs="0" />
501
+ <element name="items" type="typens:salesOrderItemEntityArray"
502
+ minOccurs="0" />
503
+ <element name="payment" type="typens:salesOrderPaymentEntity"
504
+ minOccurs="0" />
505
+ <element name="status_history" type="typens:salesOrderStatusHistoryEntityArray"
506
+ minOccurs="0" />
507
+ <element name="mshop_store_views_visible_in" type="typens:mshopProductVisibleEntityArray"
508
+ minOccurs="0" />
509
+ <element name="mshop_customer_comment" type="xsd:string"
510
+ minOccurs="0" />
511
+ <element name="mshop_customer_prefix" type="xsd:string" minOccurs="0"/>
512
+ <element name="mshop_customer_middlename" type="xsd:string" minOccurs="0"/>
513
+ <element name="mshop_bankaccount" type="xsd:string" minOccurs="0"/>
514
+ <element name="mshop_gross_shipping_amount" type="xsd:double" minOccurs="0"/>
515
+ <element name="mshop_discount_amount" type="xsd:double" minOccurs="0"/>
516
+ <!-- <element name="mshop_discount_description" type="typens:ArrayOfString" minOccurs="0"/> -->
517
+ <!-- <element name="mshop_credit_memo" type="typens:mshopSalesCreditMemoEntityArray" minOccurs="0" /> -->
518
+ <element name="mshop_invoice_id" type="typens:ArrayOfString" minOccurs="0"/>
519
+ <element name="status_creditmemo" type="xsd:int" minOccurs="0" default="0"/>
520
+ <!-- <element name="mshop_rembours" type="xsd:string" minOccurs="0" default="0"/> -->
521
+ <!-- <element name="mshop_creditmemo_increment_id" type="xsd:string" minOccurs="0" default="0"/> -->
522
+ <!-- <element name="mshop_creditmemo_id" type="xsd:string" minOccurs="0" default="0"/> -->
523
+ <element name="mshop_customer_language" type="xsd:string" minOccurs="0" default="0"/>
524
+ <element name="mshop_billing_address" type="xsd:string" minOccurs="0" default="0"/>
525
+ <element name="mshop_billing_street_name" type="xsd:string" minOccurs="0" default="0"/>
526
+ <element name="mshop_billing_street_number" type="xsd:string" minOccurs="0" default="0"/>
527
+ <element name="mshop_billing_number_addition" type="xsd:string" minOccurs="0" default="0"/>
528
+ <element name="mshop_shipping_address" type="xsd:string" minOccurs="0" default="0"/>
529
+ <element name="mshop_shipping_street_name" type="xsd:string" minOccurs="0" default="0"/>
530
+ <element name="mshop_shipping_street_number" type="xsd:string" minOccurs="0" default="0"/>
531
+ <element name="mshop_shipping_number_addition" type="xsd:string" minOccurs="0" default="0"/>
532
+
533
+ <!-- custom order attributes -->
534
+ <element name="custom_order_1" type="xsd:string" minOccurs="0" default="0"/>
535
+ <element name="custom_order_2" type="xsd:string" minOccurs="0" default="0"/>
536
+ <element name="custom_order_3" type="xsd:string" minOccurs="0" default="0"/>
537
+
538
+ <!-- for credit memo -->
539
+ <element name="mshop_order_increment_id" type="xsd:string" minOccurs="0" />
540
+
541
+ <!-- for processing date -->
542
+ <element name="mshop_payment_date" type="xsd:string" minOccurs="0" />
543
+
544
+ </all>
545
+ </complexType>
546
+
547
+ <complexType name="salesOrderAddressEntity">
548
+ <all>
549
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
550
+ <element name="parent_id" type="xsd:string" minOccurs="0" />
551
+ <element name="created_at" type="xsd:string" minOccurs="0" />
552
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
553
+ <element name="is_active" type="xsd:string" minOccurs="0" />
554
+ <element name="address_type" type="xsd:string" minOccurs="0" />
555
+ <element name="firstname" type="xsd:string" minOccurs="0" />
556
+ <element name="mshop_middle_name" type="xsd:string" minOccurs="0" />
557
+ <element name="lastname" type="xsd:string" minOccurs="0" />
558
+ <element name="company" type="xsd:string" minOccurs="0" />
559
+ <element name="street" type="xsd:string" minOccurs="0" />
560
+ <element name="city" type="xsd:string" minOccurs="0" />
561
+ <element name="region" type="xsd:string" minOccurs="0" />
562
+ <element name="postcode" type="xsd:string" minOccurs="0" />
563
+ <element name="country_id" type="xsd:string" minOccurs="0" />
564
+ <element name="telephone" type="xsd:string" minOccurs="0" />
565
+ <element name="fax" type="xsd:string" minOccurs="0" />
566
+ <element name="region_id" type="xsd:string" minOccurs="0" />
567
+ <element name="address_id" type="xsd:string" minOccurs="0" />
568
+ </all>
569
+ </complexType>
570
+
571
+
572
+
573
+ <complexType name="mshopProductVisibleEntityArray">
574
+ <complexContent>
575
+ <restriction base="soapenc:Array">
576
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopProductVisibleEntity[]" />
577
+ </restriction>
578
+ </complexContent>
579
+ </complexType>
580
+
581
+ <complexType name="mshopProductVisibleEntity">
582
+ <all>
583
+ <element name="product_id" type="xsd:string" />
584
+ <element name="store_view_ids" type="typens:ArrayOfString"
585
+ minOccurs="0" />
586
+ </all>
587
+ </complexType>
588
+
589
+ <complexType name="salesOrderItemEntity">
590
+ <all>
591
+ <element name="item_id" type="xsd:string" minOccurs="0" />
592
+ <element name="order_id" type="xsd:string" minOccurs="0" />
593
+ <element name="quote_item_id" type="xsd:string" minOccurs="0" />
594
+ <element name="created_at" type="xsd:string" minOccurs="0" />
595
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
596
+ <element name="product_id" type="xsd:string" minOccurs="0" />
597
+ <element name="product_type" type="xsd:string" minOccurs="0" />
598
+ <element name="product_options" type="xsd:string"
599
+ minOccurs="0" />
600
+ <element name="weight" type="xsd:string" minOccurs="0" />
601
+ <element name="is_virtual" type="xsd:string" minOccurs="0" />
602
+ <element name="sku" type="xsd:string" minOccurs="0" />
603
+ <element name="name" type="xsd:string" minOccurs="0" />
604
+ <element name="applied_rule_ids" type="xsd:string"
605
+ minOccurs="0" />
606
+ <element name="free_shipping" type="xsd:string" minOccurs="0" />
607
+ <element name="is_qty_decimal" type="xsd:string" minOccurs="0" />
608
+ <element name="no_discount" type="xsd:string" minOccurs="0" />
609
+ <element name="qty_canceled" type="xsd:string" minOccurs="0" />
610
+ <element name="qty_invoiced" type="xsd:string" minOccurs="0" />
611
+ <element name="qty_ordered" type="xsd:string" minOccurs="0" />
612
+ <element name="qty_refunded" type="xsd:string" minOccurs="0" />
613
+ <element name="qty_shipped" type="xsd:string" minOccurs="0" />
614
+ <element name="cost" type="xsd:string" minOccurs="0" />
615
+ <element name="price" type="xsd:string" minOccurs="0" />
616
+ <element name="base_price" type="xsd:string" minOccurs="0" />
617
+ <element name="original_price" type="xsd:string" minOccurs="0" />
618
+ <element name="base_original_price" type="xsd:string"
619
+ minOccurs="0" />
620
+ <element name="tax_percent" type="xsd:string" minOccurs="0" />
621
+ <element name="tax_amount" type="xsd:string" minOccurs="0" />
622
+ <element name="base_tax_amount" type="xsd:string"
623
+ minOccurs="0" />
624
+ <element name="tax_invoiced" type="xsd:string" minOccurs="0" />
625
+ <element name="base_tax_invoiced" type="xsd:string"
626
+ minOccurs="0" />
627
+ <element name="discount_percent" type="xsd:string"
628
+ minOccurs="0" />
629
+ <element name="discount_amount" type="xsd:string"
630
+ minOccurs="0" />
631
+ <element name="base_discount_amount" type="xsd:string"
632
+ minOccurs="0" />
633
+ <element name="discount_invoiced" type="xsd:string"
634
+ minOccurs="0" />
635
+ <element name="base_discount_invoiced" type="xsd:string"
636
+ minOccurs="0" />
637
+ <element name="amount_refunded" type="xsd:string"
638
+ minOccurs="0" />
639
+ <element name="base_amount_refunded" type="xsd:string"
640
+ minOccurs="0" />
641
+ <element name="row_total" type="xsd:string" minOccurs="0" />
642
+ <element name="base_row_total" type="xsd:string" minOccurs="0" />
643
+ <element name="row_invoiced" type="xsd:string" minOccurs="0" />
644
+ <element name="base_row_invoiced" type="xsd:string"
645
+ minOccurs="0" />
646
+ <element name="row_weight" type="xsd:string" minOccurs="0" />
647
+ <element name="gift_message_id" type="xsd:string"
648
+ minOccurs="0" />
649
+ <element name="gift_message" type="xsd:string" minOccurs="0" />
650
+ <element name="gift_message_available" type="xsd:string"
651
+ minOccurs="0" />
652
+ <element name="base_tax_before_discount" type="xsd:string"
653
+ minOccurs="0" />
654
+ <element name="tax_before_discount" type="xsd:string"
655
+ minOccurs="0" />
656
+ <element name="weee_tax_applied" type="xsd:string"
657
+ minOccurs="0" />
658
+ <element name="weee_tax_applied_amount" type="xsd:string"
659
+ minOccurs="0" />
660
+ <element name="weee_tax_applied_row_amount" type="xsd:string"
661
+ minOccurs="0" />
662
+ <element name="base_weee_tax_applied_amount" type="xsd:string"
663
+ minOccurs="0" />
664
+ <element name="base_weee_tax_applied_row_amount" type="xsd:string"
665
+ minOccurs="0" />
666
+ <element name="weee_tax_disposition" type="xsd:string"
667
+ minOccurs="0" />
668
+ <element name="weee_tax_row_disposition" type="xsd:string"
669
+ minOccurs="0" />
670
+ <element name="base_weee_tax_disposition" type="xsd:string"
671
+ minOccurs="0" />
672
+ <element name="base_weee_tax_row_disposition" type="xsd:string"
673
+ minOccurs="0" />
674
+ <element name="mshop_taxclass_rule_id" type="xsd:string"
675
+ minOccurs="0" />
676
+ <element name="mshop_taxclass_rule_code" type="xsd:string"
677
+ minOccurs="0" />
678
+ <element name="mshop_base_price_incl_tax" type="xsd:double"
679
+ minOccurs="0" />
680
+ <element name="mshop_base_price_excl_tax" type="xsd:double"
681
+ minOccurs="0" />
682
+ <element name="mshop_item_id" type="xsd:string"
683
+ minOccurs="0" />
684
+ <element name="mshop_parent_item_id" type="xsd:string"
685
+ minOccurs="0" />
686
+ <element name="mshop_discount_percent" type="xsd:string"
687
+ minOccurs="0" />
688
+ <element name="mshop_bundle_type" type="xsd:string" minOccurs="0" />
689
+ <element name="mshop_short_description" type="xsd:string" minOccurs="0" />
690
+ </all>
691
+ </complexType>
692
+
693
+ <complexType name="salesOrderEntityArray">
694
+ <complexContent>
695
+ <restriction base="soapenc:Array">
696
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:salesOrderEntity[]" />
697
+ </restriction>
698
+ </complexContent>
699
+ </complexType>
700
+
701
+ <!--
702
+ <complexType name="mshopSalesOrderListEntity">
703
+ <all>
704
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
705
+ <element name="store_id" type="xsd:string" minOccurs="0" />
706
+ <element name="created_at" type="xsd:string" minOccurs="0" />
707
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
708
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
709
+ <element name="tax_amount" type="xsd:string" minOccurs="0" />
710
+ <element name="shipping_amount" type="xsd:string"
711
+ minOccurs="0" />
712
+ <element name="discount_amount" type="xsd:string"
713
+ minOccurs="0" />
714
+ <element name="subtotal" type="xsd:string" minOccurs="0" />
715
+ <element name="grand_total" type="xsd:string" minOccurs="0" />
716
+ <element name="total_paid" type="xsd:string" minOccurs="0" />
717
+ <element name="total_refunded" type="xsd:string" minOccurs="0" />
718
+ <element name="total_qty_ordered" type="xsd:string"
719
+ minOccurs="0" />
720
+ <element name="total_canceled" type="xsd:string" minOccurs="0" />
721
+ <element name="total_invoiced" type="xsd:string" minOccurs="0" />
722
+ <element name="total_online_refunded" type="xsd:string"
723
+ minOccurs="0" />
724
+ <element name="total_offline_refunded" type="xsd:string"
725
+ minOccurs="0" />
726
+ <element name="base_tax_amount" type="xsd:string"
727
+ minOccurs="0" />
728
+ <element name="base_shipping_amount" type="xsd:string"
729
+ minOccurs="0" />
730
+ <element name="base_discount_amount" type="xsd:string"
731
+ minOccurs="0" />
732
+ <element name="base_subtotal" type="xsd:string" minOccurs="0" />
733
+ <element name="base_grand_total" type="xsd:string"
734
+ minOccurs="0" />
735
+ <element name="base_total_paid" type="xsd:string"
736
+ minOccurs="0" />
737
+ <element name="base_total_refunded" type="xsd:string"
738
+ minOccurs="0" />
739
+ <element name="base_total_qty_ordered" type="xsd:string"
740
+ minOccurs="0" />
741
+ <element name="base_total_canceled" type="xsd:string"
742
+ minOccurs="0" />
743
+ <element name="base_total_invoiced" type="xsd:string"
744
+ minOccurs="0" />
745
+ <element name="base_total_online_refunded" type="xsd:string"
746
+ minOccurs="0" />
747
+ <element name="base_total_offline_refunded" type="xsd:string"
748
+ minOccurs="0" />
749
+ <element name="billing_address_id" type="xsd:string"
750
+ minOccurs="0" />
751
+ <element name="billing_firstname" type="xsd:string"
752
+ minOccurs="0" />
753
+ <element name="billing_lastname" type="xsd:string"
754
+ minOccurs="0" />
755
+ <element name="shipping_address_id" type="xsd:string"
756
+ minOccurs="0" />
757
+ <element name="shipping_firstname" type="xsd:string"
758
+ minOccurs="0" />
759
+ <element name="shipping_lastname" type="xsd:string"
760
+ minOccurs="0" />
761
+ <element name="billing_name" type="xsd:string" minOccurs="0" />
762
+ <element name="shipping_name" type="xsd:string" minOccurs="0" />
763
+ <element name="store_to_base_rate" type="xsd:string"
764
+ minOccurs="0" />
765
+ <element name="store_to_order_rate" type="xsd:string"
766
+ minOccurs="0" />
767
+ <element name="base_to_global_rate" type="xsd:string"
768
+ minOccurs="0" />
769
+ <element name="base_to_order_rate" type="xsd:string"
770
+ minOccurs="0" />
771
+ <element name="weight" type="xsd:string" minOccurs="0" />
772
+ <element name="store_name" type="xsd:string" minOccurs="0" />
773
+ <element name="remote_ip" type="xsd:string" minOccurs="0" />
774
+ <element name="status" type="xsd:string" minOccurs="0" />
775
+ <element name="state" type="xsd:string" minOccurs="0" />
776
+ <element name="applied_rule_ids" type="xsd:string"
777
+ minOccurs="0" />
778
+ <element name="global_currency_code" type="xsd:string"
779
+ minOccurs="0" />
780
+ <element name="base_currency_code" type="xsd:string"
781
+ minOccurs="0" />
782
+ <element name="store_currency_code" type="xsd:string"
783
+ minOccurs="0" />
784
+ <element name="order_currency_code" type="xsd:string"
785
+ minOccurs="0" />
786
+ <element name="shipping_method" type="xsd:string"
787
+ minOccurs="0" />
788
+ <element name="shipping_description" type="xsd:string"
789
+ minOccurs="0" />
790
+ <element name="customer_email" type="xsd:string" minOccurs="0" />
791
+ <element name="customer_firstname" type="xsd:string"
792
+ minOccurs="0" />
793
+ <element name="customer_lastname" type="xsd:string"
794
+ minOccurs="0" />
795
+ <element name="quote_id" type="xsd:string" minOccurs="0" />
796
+ <element name="is_virtual" type="xsd:string" minOccurs="0" />
797
+ <element name="customer_group_id" type="xsd:string"
798
+ minOccurs="0" />
799
+ <element name="customer_note_notify" type="xsd:string"
800
+ minOccurs="0" />
801
+ <element name="customer_is_guest" type="xsd:string"
802
+ minOccurs="0" />
803
+ <element name="email_sent" type="xsd:string" minOccurs="0" />
804
+ <element name="order_id" type="xsd:string" minOccurs="0" />
805
+ <element name="gift_message_id" type="xsd:string"
806
+ minOccurs="0" />
807
+ <element name="coupon_code" type="xsd:string" minOccurs="0" />
808
+ <element name="protect_code" type="xsd:string" minOccurs="0" />
809
+ <element name="base_discount_canceled" type="xsd:string"
810
+ minOccurs="0" />
811
+ <element name="base_discount_invoiced" type="xsd:string"
812
+ minOccurs="0" />
813
+ <element name="base_discount_refunded" type="xsd:string"
814
+ minOccurs="0" />
815
+ <element name="base_shipping_canceled" type="xsd:string"
816
+ minOccurs="0" />
817
+ <element name="base_shipping_invoiced" type="xsd:string"
818
+ minOccurs="0" />
819
+ <element name="base_shipping_refunded" type="xsd:string"
820
+ minOccurs="0" />
821
+ <element name="base_shipping_tax_amount" type="xsd:string"
822
+ minOccurs="0" />
823
+ <element name="base_shipping_tax_refunded" type="xsd:string"
824
+ minOccurs="0" />
825
+ <element name="base_subtotal_canceled" type="xsd:string"
826
+ minOccurs="0" />
827
+ <element name="base_subtotal_invoiced" type="xsd:string"
828
+ minOccurs="0" />
829
+ <element name="base_subtotal_refunded" type="xsd:string"
830
+ minOccurs="0" />
831
+ <element name="base_tax_canceled" type="xsd:string"
832
+ minOccurs="0" />
833
+ <element name="base_tax_invoiced" type="xsd:string"
834
+ minOccurs="0" />
835
+ <element name="base_tax_refunded" type="xsd:string"
836
+ minOccurs="0" />
837
+ <element name="base_total_invoiced_cost" type="xsd:string"
838
+ minOccurs="0" />
839
+ <element name="discount_canceled" type="xsd:string"
840
+ minOccurs="0" />
841
+ <element name="discount_invoiced" type="xsd:string"
842
+ minOccurs="0" />
843
+ <element name="discount_refunded" type="xsd:string"
844
+ minOccurs="0" />
845
+ <element name="shipping_canceled" type="xsd:string"
846
+ minOccurs="0" />
847
+ <element name="shipping_invoiced" type="xsd:string"
848
+ minOccurs="0" />
849
+ <element name="shipping_refunded" type="xsd:string"
850
+ minOccurs="0" />
851
+ <element name="shipping_tax_amount" type="xsd:string"
852
+ minOccurs="0" />
853
+ <element name="shipping_tax_refunded" type="xsd:string"
854
+ minOccurs="0" />
855
+ <element name="subtotal_canceled" type="xsd:string"
856
+ minOccurs="0" />
857
+ <element name="subtotal_invoiced" type="xsd:string"
858
+ minOccurs="0" />
859
+ <element name="subtotal_refunded" type="xsd:string"
860
+ minOccurs="0" />
861
+ <element name="tax_canceled" type="xsd:string" minOccurs="0" />
862
+ <element name="tax_invoiced" type="xsd:string" minOccurs="0" />
863
+ <element name="tax_refunded" type="xsd:string" minOccurs="0" />
864
+ <element name="can_ship_partially" type="xsd:string"
865
+ minOccurs="0" />
866
+ <element name="can_ship_partially_item" type="xsd:string"
867
+ minOccurs="0" />
868
+ <element name="edit_increment" type="xsd:string" minOccurs="0" />
869
+ <element name="forced_do_shipment_with_invoice" type="xsd:string"
870
+ minOccurs="0" />
871
+ <element name="payment_authorization_expiration" type="xsd:string"
872
+ minOccurs="0" />
873
+ <element name="paypal_ipn_customer_notified" type="xsd:string"
874
+ minOccurs="0" />
875
+ <element name="quote_address_id" type="xsd:string"
876
+ minOccurs="0" />
877
+ <element name="adjustment_negative" type="xsd:string"
878
+ minOccurs="0" />
879
+ <element name="adjustment_positive" type="xsd:string"
880
+ minOccurs="0" />
881
+ <element name="base_adjustment_negative" type="xsd:string"
882
+ minOccurs="0" />
883
+ <element name="base_adjustment_positive" type="xsd:string"
884
+ minOccurs="0" />
885
+ <element name="base_shipping_discount_amount" type="xsd:string"
886
+ minOccurs="0" />
887
+ <element name="base_subtotal_incl_tax" type="xsd:string"
888
+ minOccurs="0" />
889
+ <element name="base_total_due" type="xsd:string" minOccurs="0" />
890
+ <element name="payment_authorization_amount" type="xsd:string"
891
+ minOccurs="0" />
892
+ <element name="shipping_discount_amount" type="xsd:string"
893
+ minOccurs="0" />
894
+ <element name="subtotal_incl_tax" type="xsd:string"
895
+ minOccurs="0" />
896
+ <element name="total_due" type="xsd:string" minOccurs="0" />
897
+ <element name="customer_dob" type="xsd:string" minOccurs="0" />
898
+ <element name="customer_middlename" type="xsd:string"
899
+ minOccurs="0" />
900
+ <element name="customer_prefix" type="xsd:string"
901
+ minOccurs="0" />
902
+ <element name="customer_suffix" type="xsd:string"
903
+ minOccurs="0" />
904
+ <element name="customer_taxvat" type="xsd:string"
905
+ minOccurs="0" />
906
+ <element name="discount_description" type="xsd:string"
907
+ minOccurs="0" />
908
+ <element name="ext_customer_id" type="xsd:string"
909
+ minOccurs="0" />
910
+ <element name="ext_order_id" type="xsd:string" minOccurs="0" />
911
+ <element name="hold_before_state" type="xsd:string"
912
+ minOccurs="0" />
913
+ <element name="hold_before_status" type="xsd:string"
914
+ minOccurs="0" />
915
+ <element name="original_increment_id" type="xsd:string"
916
+ minOccurs="0" />
917
+ <element name="relation_child_id" type="xsd:string"
918
+ minOccurs="0" />
919
+ <element name="relation_child_real_id" type="xsd:string"
920
+ minOccurs="0" />
921
+ <element name="relation_parent_id" type="xsd:string"
922
+ minOccurs="0" />
923
+ <element name="relation_parent_real_id" type="xsd:string"
924
+ minOccurs="0" />
925
+ <element name="x_forwarded_for" type="xsd:string"
926
+ minOccurs="0" />
927
+ <element name="customer_note" type="xsd:string" minOccurs="0" />
928
+ <element name="total_item_count" type="xsd:string"
929
+ minOccurs="0" />
930
+ <element name="customer_gender" type="xsd:string"
931
+ minOccurs="0" />
932
+ <element name="hidden_tax_amount" type="xsd:string"
933
+ minOccurs="0" />
934
+ <element name="base_hidden_tax_amount" type="xsd:string"
935
+ minOccurs="0" />
936
+ <element name="shipping_hidden_tax_amount" type="xsd:string"
937
+ minOccurs="0" />
938
+ <element name="base_shipping_hidden_tax_amount" type="xsd:string"
939
+ minOccurs="0" />
940
+ <element name="hidden_tax_invoiced" type="xsd:string"
941
+ minOccurs="0" />
942
+ <element name="base_hidden_tax_invoiced" type="xsd:string"
943
+ minOccurs="0" />
944
+ <element name="hidden_tax_refunded" type="xsd:string"
945
+ minOccurs="0" />
946
+ <element name="base_hidden_tax_refunded" type="xsd:string"
947
+ minOccurs="0" />
948
+ <element name="shipping_incl_tax" type="xsd:string"
949
+ minOccurs="0" />
950
+ <element name="base_shipping_incl_tax" type="xsd:string"
951
+ minOccurs="0" />
952
+ <element name="base_customer_balance_amount" type="xsd:string"
953
+ minOccurs="0" />
954
+ <element name="customer_balance_amount" type="xsd:string"
955
+ minOccurs="0" />
956
+ <element name="base_customer_balance_invoiced" type="xsd:string"
957
+ minOccurs="0" />
958
+ <element name="customer_balance_invoiced" type="xsd:string"
959
+ minOccurs="0" />
960
+ <element name="base_customer_balance_refunded" type="xsd:string"
961
+ minOccurs="0" />
962
+ <element name="customer_balance_refunded" type="xsd:string"
963
+ minOccurs="0" />
964
+ <element name="base_customer_balance_total_refunded" type="xsd:string"
965
+ minOccurs="0" />
966
+ <element name="customer_balance_total_refunded" type="xsd:string"
967
+ minOccurs="0" />
968
+ <element name="gift_cards" type="xsd:string" minOccurs="0" />
969
+ <element name="base_gift_cards_amount" type="xsd:string"
970
+ minOccurs="0" />
971
+ <element name="gift_cards_amount" type="xsd:string"
972
+ minOccurs="0" />
973
+ <element name="base_gift_cards_invoiced" type="xsd:string"
974
+ minOccurs="0" />
975
+ <element name="gift_cards_invoiced" type="xsd:string"
976
+ minOccurs="0" />
977
+ <element name="base_gift_cards_refunded" type="xsd:string"
978
+ minOccurs="0" />
979
+ <element name="gift_cards_refunded" type="xsd:string"
980
+ minOccurs="0" />
981
+ <element name="reward_points_balance" type="xsd:string"
982
+ minOccurs="0" />
983
+ <element name="base_reward_currency_amount" type="xsd:string"
984
+ minOccurs="0" />
985
+ <element name="reward_currency_amount" type="xsd:string"
986
+ minOccurs="0" />
987
+ <element name="base_reward_currency_amount_invoiced" type="xsd:string"
988
+ minOccurs="0" />
989
+ <element name="reward_currency_amount_invoiced" type="xsd:string"
990
+ minOccurs="0" />
991
+ <element name="base_reward_currency_amount_refunded" type="xsd:string"
992
+ minOccurs="0" />
993
+ <element name="reward_currency_amount_refunded" type="xsd:string"
994
+ minOccurs="0" />
995
+ <element name="reward_points_balance_refunded" type="xsd:string"
996
+ minOccurs="0" />
997
+ <element name="reward_points_balance_to_refund" type="xsd:string"
998
+ minOccurs="0" />
999
+ <element name="reward_salesrule_points" type="xsd:string"
1000
+ minOccurs="0" />
1001
+ <element name="firstname" type="xsd:string" minOccurs="0" />
1002
+ <element name="lastname" type="xsd:string" minOccurs="0" />
1003
+ <element name="telephone" type="xsd:string" minOccurs="0" />
1004
+ <element name="postcode" type="xsd:string" minOccurs="0" />
1005
+ </all>
1006
+ </complexType>
1007
+ <complexType name="mshopSalesOrderListEntityArray">
1008
+ <complexContent>
1009
+ <restriction base="soapenc:Array">
1010
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopSalesOrderListEntity[]" />
1011
+ </restriction>
1012
+ </complexContent>
1013
+ </complexType>
1014
+ -->
1015
+
1016
+ <complexType name="salesOrderCustomFeldsMappingEntity">
1017
+ <all>
1018
+ <element name="order_custom_field" type="xsd:string" />
1019
+ <element name="order_beckend_field" type="xsd:string"/>
1020
+ <element name="order_beckend_field_label" type="xsd:string"/>
1021
+ </all>
1022
+ </complexType>
1023
+
1024
+ <complexType name="salesOrderCustomFeldsMappingArray">
1025
+ <complexContent>
1026
+ <restriction base="soapenc:Array">
1027
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:salesOrderCustomFeldsMappingEntity[]" />
1028
+ </restriction>
1029
+ </complexContent>
1030
+ </complexType>
1031
+
1032
+
1033
+ <!-- end sales -->
1034
+
1035
+ <!-- catalog -->
1036
+
1037
+ <complexType name="mshopCatalogProductCreateEntity">
1038
+
1039
+ <all>
1040
+ <element name="categories" type="typens:ArrayOfString" minOccurs="0" />
1041
+ <element name="websites" type="typens:ArrayOfString" minOccurs="0" />
1042
+ <element name="name" type="xsd:string" minOccurs="0" />
1043
+ <element name="description" type="xsd:string" minOccurs="0" />
1044
+ <element name="short_description" type="xsd:string" minOccurs="0" />
1045
+ <element name="weight" type="xsd:string" minOccurs="0" />
1046
+ <element name="status" type="xsd:string" minOccurs="0" />
1047
+ <element name="url_key" type="xsd:string" minOccurs="0" />
1048
+ <element name="url_path" type="xsd:string" minOccurs="0" />
1049
+ <element name="visibility" type="xsd:string" minOccurs="0" />
1050
+ <element name="category_ids" type="typens:ArrayOfString" minOccurs="0" />
1051
+ <element name="website_ids" type="typens:ArrayOfString" minOccurs="0" />
1052
+ <element name="has_options" type="xsd:string" minOccurs="0" />
1053
+ <element name="gift_message_available" type="xsd:string" minOccurs="0" />
1054
+ <element name="price" type="xsd:string" minOccurs="0" />
1055
+ <element name="special_price" type="xsd:string" minOccurs="0" />
1056
+ <element name="special_from_date" type="xsd:string" minOccurs="0" />
1057
+ <element name="special_to_date" type="xsd:string" minOccurs="0" />
1058
+ <element name="tax_class_id" type="xsd:string" minOccurs="0" />
1059
+ <element name="tier_price" type="typens:catalogProductTierPriceEntityArray" minOccurs="0" />
1060
+ <element name="cost" type="xsd:string" minOccurs="0" />
1061
+ <element name="meta_title" type="xsd:string" minOccurs="0" />
1062
+ <element name="meta_keyword" type="xsd:string" minOccurs="0" />
1063
+ <element name="meta_description" type="xsd:string" minOccurs="0" />
1064
+ <element name="custom_design" type="xsd:string" minOccurs="0" />
1065
+ <element name="custom_layout_update" type="xsd:string" minOccurs="0" />
1066
+ <element name="options_container" type="xsd:string" minOccurs="0" />
1067
+ <element name="additional_attributes" type="typens:associativeArray" minOccurs="0" />
1068
+ <element name="stock_data" type="typens:catalogInventoryStockItemUpdateEntity" minOccurs="0"/>
1069
+ </all>
1070
+
1071
+ </complexType>
1072
+
1073
+
1074
+ <complexType name="catalogProductReturnEntity">
1075
+ <all>
1076
+ <element name="product_id" type="xsd:string" minOccurs="0" />
1077
+ <element name="sku" type="xsd:string" minOccurs="0" />
1078
+ <element name="set" type="xsd:string" minOccurs="0" />
1079
+ <element name="type" type="xsd:string" minOccurs="0" />
1080
+ <element name="categories" type="typens:ArrayOfString"
1081
+ minOccurs="0" />
1082
+ <element name="websites" type="typens:ArrayOfString"
1083
+ minOccurs="0" />
1084
+ <element name="created_at" type="xsd:string" minOccurs="0" />
1085
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
1086
+ <element name="type_id" type="xsd:string" minOccurs="0" />
1087
+ <element name="name" type="xsd:string" minOccurs="0" />
1088
+ <element name="description" type="xsd:string" minOccurs="0" />
1089
+ <element name="short_description" type="xsd:string"
1090
+ minOccurs="0" />
1091
+ <element name="weight" type="xsd:string" minOccurs="0" />
1092
+ <element name="status" type="xsd:string" minOccurs="0" />
1093
+ <element name="url_key" type="xsd:string" minOccurs="0" />
1094
+ <element name="url_path" type="xsd:string" minOccurs="0" />
1095
+ <element name="visibility" type="xsd:string" minOccurs="0" />
1096
+ <element name="category_ids" type="typens:ArrayOfString"
1097
+ minOccurs="0" />
1098
+ <element name="website_ids" type="typens:ArrayOfString"
1099
+ minOccurs="0" />
1100
+ <element name="has_options" type="xsd:string" minOccurs="0" />
1101
+ <element name="gift_message_available" type="xsd:string"
1102
+ minOccurs="0" />
1103
+ <element name="price" type="xsd:string" minOccurs="0" />
1104
+ <element name="special_price" type="xsd:string" minOccurs="0" />
1105
+ <element name="special_from_date" type="xsd:string"
1106
+ minOccurs="0" />
1107
+ <element name="special_to_date" type="xsd:string"
1108
+ minOccurs="0" />
1109
+ <element name="tax_class_id" type="xsd:string" minOccurs="0" />
1110
+ <element name="tier_price" type="typens:catalogProductTierPriceEntityArray"
1111
+ minOccurs="0" />
1112
+ <element name="meta_title" type="xsd:string" minOccurs="0" />
1113
+ <element name="meta_keyword" type="xsd:string" minOccurs="0" />
1114
+ <element name="meta_description" type="xsd:string"
1115
+ minOccurs="0" />
1116
+ <element name="custom_design" type="xsd:string" minOccurs="0" />
1117
+ <element name="custom_layout_update" type="xsd:string"
1118
+ minOccurs="0" />
1119
+ <element name="options_container" type="xsd:string"
1120
+ minOccurs="0" />
1121
+ <element name="additional_attributes" type="typens:associativeArray"
1122
+ minOccurs="0" />
1123
+ <element name="enable_googlecheckout" type="xsd:string"
1124
+ minOccurs="0" />
1125
+ <element name="cost" type="xsd:string"
1126
+ minOccurs="0" />
1127
+ </all>
1128
+ </complexType>
1129
+
1130
+ <complexType name="mshopCatalogInventoryStockUpdateRequestEntityArray">
1131
+ <complexContent>
1132
+ <restriction base="soapenc:Array">
1133
+ <attribute ref="soapenc:arrayType"
1134
+ wsdl:arrayType="typens:mshopCatalogInventoryStockUpdateRequestEntity[]" />
1135
+ </restriction>
1136
+ </complexContent>
1137
+ </complexType>
1138
+
1139
+ <complexType name="mshopCatalogInventoryStockUpdateRequestEntity">
1140
+ <all>
1141
+ <element name="productSku" type="xsd:string" />
1142
+ <element name="productQty" type="xsd:double" />
1143
+ <element name="productFutureQty" type="xsd:int" default="1"/>
1144
+ <element name="extraAttributes" type="typens:mshopCatalogInventoryStockUpdateExtraAtributesEntity" minOccurs="0"/>
1145
+ </all>
1146
+ </complexType>
1147
+
1148
+ <complexType name="mshopCatalogInventoryStockUpdateExtraAtributesEntity">
1149
+ <all>
1150
+ <element name="mamut_store1" type="xsd:string" />
1151
+ <element name="mamut_store2" type="xsd:string"/>
1152
+ <element name="mamut_store3" type="xsd:string"/>
1153
+ <element name="mamut_store4" type="xsd:string"/>
1154
+ <element name="mamut_store5" type="xsd:string"/>
1155
+ <element name="mamut_nextdeliverydate" type="xsd:string"/>
1156
+ </all>
1157
+ </complexType>
1158
+
1159
+ <complexType name="mshopCatalogProductReturnEntityArray">
1160
+ <complexContent>
1161
+ <restriction base="soapenc:Array">
1162
+ <attribute ref="soapenc:arrayType"
1163
+ wsdl:arrayType="typens:mshopCatalogProductReturnCustomEntity[]" />
1164
+ </restriction>
1165
+ </complexContent>
1166
+ </complexType>
1167
+
1168
+ <complexType name="mshopCatalogProductReturnCustomEntity">
1169
+ <all>
1170
+ <element name="product_id" type="xsd:string" minOccurs="0" />
1171
+ <element name="sku" type="xsd:string" minOccurs="0" />
1172
+ <element name="set" type="xsd:string" minOccurs="0" />
1173
+ <element name="type" type="xsd:string" minOccurs="0" />
1174
+ <element name="categories" type="typens:ArrayOfString"
1175
+ minOccurs="0" />
1176
+ <element name="websites" type="typens:ArrayOfString"
1177
+ minOccurs="0" />
1178
+ <element name="created_at" type="xsd:string" minOccurs="0" />
1179
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
1180
+ <element name="type_id" type="xsd:string" minOccurs="0" />
1181
+ <element name="name" type="xsd:string" minOccurs="0" />
1182
+ <element name="description" type="xsd:string" minOccurs="0" />
1183
+ <element name="short_description" type="xsd:string"
1184
+ minOccurs="0" />
1185
+ <element name="weight" type="xsd:string" minOccurs="0" />
1186
+ <element name="status" type="xsd:string" minOccurs="0" />
1187
+ <element name="url_key" type="xsd:string" minOccurs="0" />
1188
+ <element name="url_path" type="xsd:string" minOccurs="0" />
1189
+ <element name="visibility" type="xsd:string" minOccurs="0" />
1190
+ <element name="category_ids" type="typens:ArrayOfString"
1191
+ minOccurs="0" />
1192
+ <element name="website_ids" type="typens:ArrayOfString"
1193
+ minOccurs="0" />
1194
+ <element name="has_options" type="xsd:string" minOccurs="0" />
1195
+ <element name="gift_message_available" type="xsd:string"
1196
+ minOccurs="0" />
1197
+ <element name="price" type="xsd:string" minOccurs="0" />
1198
+ <element name="special_price" type="xsd:string" minOccurs="0" />
1199
+ <element name="special_from_date" type="xsd:string"
1200
+ minOccurs="0" />
1201
+ <element name="special_to_date" type="xsd:string"
1202
+ minOccurs="0" />
1203
+ <element name="tax_class_id" type="xsd:string" minOccurs="0" />
1204
+ <element name="tier_price" type="typens:catalogProductTierPriceEntityArray"
1205
+ minOccurs="0" />
1206
+ <element name="meta_title" type="xsd:string" minOccurs="0" />
1207
+ <element name="meta_keyword" type="xsd:string" minOccurs="0" />
1208
+ <element name="meta_description" type="xsd:string"
1209
+ minOccurs="0" />
1210
+ <element name="custom_design" type="xsd:string" minOccurs="0" />
1211
+ <element name="custom_layout_update" type="xsd:string"
1212
+ minOccurs="0" />
1213
+ <element name="options_container" type="xsd:string"
1214
+ minOccurs="0" />
1215
+ <element name="additional_attributes" type="typens:associativeArray"
1216
+ minOccurs="0" />
1217
+ <element name="enable_googlecheckout" type="xsd:string"
1218
+ minOccurs="0" />
1219
+ <element name="mshop_store_view_id" type="xsd:string" minOccurs="0" />
1220
+ <element name="mshop_store_view_name" type="xsd:string"
1221
+ minOccurs="0" />
1222
+ </all>
1223
+ </complexType>
1224
+
1225
+ <complexType name="mshopCatalogCategoryEntityCreate">
1226
+ <all>
1227
+ <element name="name" type="xsd:string" minOccurs="0" />
1228
+ <element name="is_active" type="xsd:string" minOccurs="0" />
1229
+ <element name="position" type="xsd:int" minOccurs="0" />
1230
+ <element name="available_sort_by" type="typens:ArrayOfString"
1231
+ minOccurs="0" />
1232
+ <element name="custom_design" type="xsd:string" minOccurs="0" />
1233
+ <element name="custom_design_apply" type="xsd:int"
1234
+ minOccurs="0" />
1235
+ <element name="custom_design_from" type="xsd:string"
1236
+ minOccurs="0" />
1237
+ <element name="custom_design_to" type="xsd:string"
1238
+ minOccurs="0" />
1239
+ <element name="custom_layout_update" type="xsd:string"
1240
+ minOccurs="0" />
1241
+ <element name="default_sort_by" type="xsd:string"
1242
+ minOccurs="0" />
1243
+ <element name="description" type="xsd:string" minOccurs="0" />
1244
+ <element name="display_mode" type="xsd:string" minOccurs="0" />
1245
+ <element name="is_anchor" type="xsd:int" minOccurs="0" />
1246
+ <element name="landing_page" type="xsd:int" minOccurs="0" />
1247
+ <element name="meta_description" type="xsd:string"
1248
+ minOccurs="0" />
1249
+ <element name="meta_keywords" type="xsd:string" minOccurs="0" />
1250
+ <element name="meta_title" type="xsd:string" minOccurs="0" />
1251
+ <element name="page_layout" type="xsd:string" minOccurs="0" />
1252
+ <element name="url_key" type="xsd:string" minOccurs="0" />
1253
+ <element name="include_in_menu" type="xsd:int" minOccurs="0" />
1254
+ </all>
1255
+ </complexType>
1256
+
1257
+ <complexType name="catalogCategoryEntityCreate">
1258
+ <all>
1259
+ <element name="name" type="xsd:string" minOccurs="0" />
1260
+ <element name="is_active" type="xsd:int" minOccurs="0" />
1261
+ <element name="position" type="xsd:int" minOccurs="0" />
1262
+ <element name="available_sort_by" type="typens:ArrayOfString"
1263
+ minOccurs="0" />
1264
+ <element name="custom_design" type="xsd:string" minOccurs="0" />
1265
+ <element name="custom_design_apply" type="xsd:int"
1266
+ minOccurs="0" />
1267
+ <element name="custom_design_from" type="xsd:string"
1268
+ minOccurs="0" />
1269
+ <element name="custom_design_to" type="xsd:string"
1270
+ minOccurs="0" />
1271
+ <element name="custom_layout_update" type="xsd:string"
1272
+ minOccurs="0" />
1273
+ <element name="default_sort_by" type="xsd:string"
1274
+ minOccurs="0" />
1275
+ <element name="description" type="xsd:string" minOccurs="0" />
1276
+ <element name="display_mode" type="xsd:string" minOccurs="0" />
1277
+ <element name="is_anchor" type="xsd:int" minOccurs="0" />
1278
+ <element name="landing_page" type="xsd:int" minOccurs="0" />
1279
+ <element name="meta_description" type="xsd:string"
1280
+ minOccurs="0" />
1281
+ <element name="meta_keywords" type="xsd:string" minOccurs="0" />
1282
+ <element name="meta_title" type="xsd:string" minOccurs="0" />
1283
+ <element name="page_layout" type="xsd:string" minOccurs="0" />
1284
+ <element name="url_key" type="xsd:string" minOccurs="0" />
1285
+ <element name="include_in_menu" type="xsd:int" minOccurs="0" />
1286
+ </all>
1287
+ </complexType>
1288
+
1289
+ <complexType name="mshopCatalogProductTierPriceEntity">
1290
+ <all>
1291
+ <element name="customer_group_id" type="xsd:string" minOccurs="0"/>
1292
+ <element name="website" type="xsd:string" minOccurs="0"/>
1293
+ <element name="qty" type="xsd:int" minOccurs="0"/>
1294
+ <element name="price" type="xsd:double" minOccurs="0"/>
1295
+ <element name="tier_type" type="xsd:int" minOccurs="0"/>
1296
+ </all>
1297
+ </complexType>
1298
+ <complexType name="mshopCatalogProductTierPriceEntityArray">
1299
+ <complexContent>
1300
+ <restriction base="soapenc:Array">
1301
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:mshopCatalogProductTierPriceEntity[]"/>
1302
+ </restriction>
1303
+ </complexContent>
1304
+ </complexType>
1305
+
1306
+ <!-- end catalog -->
1307
+
1308
+
1309
+ </schema>
1310
+ </types>
1311
+
1312
+ <!-- utility -->
1313
+
1314
+ <message name="mshopUtilityListTaxClassRulesRequest">
1315
+ <part name="sessionId" type="xsd:string" />
1316
+ </message>
1317
+
1318
+ <message name="mshopUtilityListTaxClassRulesResponse">
1319
+ <part name="taxclasses" type="typens:mshopUtilityListTaxClassRulesEntityArray" />
1320
+ </message>
1321
+
1322
+
1323
+ <message name="mshopUtilityListPaymentStatusesRequest">
1324
+ <part name="sessionId" type="xsd:string" />
1325
+ </message>
1326
+
1327
+ <message name="mshopUtilityListPaymentStatusesResponse">
1328
+ <part name="taxclasses" type="typens:mshopUtilityListPaymentStatusesEntityArray" />
1329
+ </message>
1330
+
1331
+ <message name="mshopUtilityListProductTaxClassesRequest">
1332
+ <part name="sessionId" type="xsd:string" />
1333
+ </message>
1334
+
1335
+ <message name="mshopUtilityListProductTaxClassesResponse">
1336
+ <part name="taxclasses" type="typens:mshopUtilityListTaxClassesEntityArray" />
1337
+ </message>
1338
+ <message name="mshopUtilityCleanCacheRequest">
1339
+ <part name="sessionId" type="xsd:string" />
1340
+ </message>
1341
+ <message name="mshopUtilityCleanCacheResponse">
1342
+ <part name="responce" type="xsd:boolean" />
1343
+ </message>
1344
+
1345
+ <message name="mshopUtilityListPaymentMethodsRequest">
1346
+ <part name="sessionId" type="xsd:string" />
1347
+ </message>
1348
+
1349
+ <message name="mshopUtilityListPaymentMethodsResponse">
1350
+ <part name="paymentmethods" type="typens:mshopUtilityListPaymentMethodsEntityArray" />
1351
+ </message>
1352
+
1353
+ <message name="mshopUtilityListShippingMethodsRequest">
1354
+ <part name="sessionId" type="xsd:string" />
1355
+ </message>
1356
+
1357
+ <message name="mshopUtilityListShippingMethodsResponse">
1358
+ <part name="shippingmethods" type="typens:mshopUtilityListShippingMethodsEntityArray" />
1359
+ </message>
1360
+
1361
+ <message name="mshopUtilityListStoreViewsRequest">
1362
+ <part name="sessionId" type="xsd:string" />
1363
+ </message>
1364
+
1365
+ <message name="mshopUtilityListStoreViewsResponse">
1366
+ <part name="multistore" type="typens:mshopUtilityListStoreViewEntityArray" />
1367
+ </message>
1368
+
1369
+ <message name="mshopUtilityListPaymentMethodsByStoreRequest">
1370
+ <part name="sessionId" type="xsd:string" />
1371
+ <part name="store" type="xsd:int" />
1372
+ </message>
1373
+
1374
+ <message name="mshopUtilityListPaymentMethodsByStoreResponse">
1375
+ <part name="paymentmethods"
1376
+ type="typens:mshopUtilityListPaymentMethodsByStoreEntityArray" />
1377
+ </message>
1378
+
1379
+ <message name="mshopUtilityGetMagentoVersionRequest">
1380
+ <part name="sessionId" type="xsd:string" />
1381
+ </message>
1382
+
1383
+ <message name="mshopUtilityGetMagentoVersionResponse">
1384
+ <part name="version" type="xsd:string" />
1385
+ </message>
1386
+
1387
+ <message name="mshopUtilityGetSettingRequest">
1388
+ <part name="sessionId" type="xsd:string" />
1389
+ <part name="settingCode" type="xsd:string" />
1390
+ </message>
1391
+
1392
+ <message name="mshopUtilityGetSettingResponse">
1393
+ <part name="setting" type="xsd:boolean" />
1394
+ </message>
1395
+
1396
+ <message name="mshopUtilityGetMshopVersionRequest">
1397
+ <part name="sessionId" type="xsd:string" />
1398
+ </message>
1399
+
1400
+ <message name="mshopUtilityGetMshopVersionResponse">
1401
+ <part name="version" type="xsd:string" />
1402
+ </message>
1403
+
1404
+ <message name="mshopUtilityGetMshopB2BVersionRequest">
1405
+ <part name="sessionId" type="xsd:string" />
1406
+ </message>
1407
+
1408
+ <message name="mshopUtilityGetMshopB2BVersionResponse">
1409
+ <part name="version" type="xsd:string" />
1410
+ </message>
1411
+
1412
+ <message name="mshopUtilityGetOrderInvoiceDateRequest">
1413
+ <part name="sessionId" type="xsd:string" />
1414
+ <part name="orderNumber" type="xsd:int" />
1415
+ </message>
1416
+
1417
+ <message name="mshopUtilityGetOrderInvoiceDateResponse">
1418
+ <part name="date" type="xsd:string" />
1419
+ </message>
1420
+
1421
+ <message name="mshopUtilityIsMshopB2BInstalledRequest">
1422
+ <part name="sessionId" type="xsd:string" />
1423
+ </message>
1424
+
1425
+ <message name="mshopUtilityIsMshopB2BInstalledResponse">
1426
+ <part name="installed" type="xsd:boolean" />
1427
+ </message>
1428
+
1429
+ <!-- end utility -->
1430
+
1431
+
1432
+ <!-- attribute -->
1433
+
1434
+ <message name="mshopProductAttributeOptionIdRequest">
1435
+ <part name="sessionId" type="xsd:string" />
1436
+ <part name="attributeCode" type="xsd:string" />
1437
+ <part name="attributeOptionLabel" type="xsd:string" />
1438
+ </message>
1439
+
1440
+
1441
+ <message name="mshopProductAttributeOptionIdResponse">
1442
+ <part name="result" type="xsd:int" />
1443
+ </message>
1444
+
1445
+ <message name="mshopProductAttributeSetOptionsRequest">
1446
+ <part name="sessionId" type="xsd:string" />
1447
+ <part name="attributeCode" type="xsd:string" />
1448
+ <part name="attributeOptions" type="typens:ArrayOfString" />
1449
+ </message>
1450
+
1451
+
1452
+ <message name="mshopProductAttributeSetOptionsResponse">
1453
+ <part name="result" type="xsd:int" />
1454
+ </message>
1455
+
1456
+ <message name="mshopProductAttributeDeleteOptionsRequest">
1457
+ <part name="sessionId" type="xsd:string" />
1458
+ <part name="attributeCode" type="xsd:string" />
1459
+ </message>
1460
+
1461
+
1462
+ <message name="mshopProductAttributeDeleteOptionsResponse">
1463
+ <part name="result" type="xsd:int" />
1464
+ </message>
1465
+
1466
+ <message name="mshopProductAttributeCreateRequest">
1467
+ <part name="sessionId" type="xsd:string" />
1468
+ <part name="attributeLabel" type="xsd:string" />
1469
+ <part name="attributeCode" type="xsd:string" />
1470
+ <part name="attributeValues" type="typens:mshopProductAttributeCreateArrayEntity" />
1471
+ <part name="attributeProductTypes" type="typens:ArrayOfString" />
1472
+ </message>
1473
+
1474
+
1475
+ <message name="mshopProductAttributeCreateResponse">
1476
+ <part name="result" type="xsd:int" />
1477
+ </message>
1478
+
1479
+ <message name="mshopProductAttributeDeleteRequest">
1480
+ <part name="sessionId" type="xsd:string" />
1481
+ <part name="attributeCode" type="xsd:string" />
1482
+ </message>
1483
+
1484
+
1485
+ <message name="mshopProductAttributeDeleteResponse">
1486
+ <part name="result" type="xsd:int" />
1487
+ </message>
1488
+
1489
+ <message name="mshopProductAttributeAddOptionsRequest">
1490
+ <part name="sessionId" type="xsd:string" />
1491
+ <part name="attributeCode" type="xsd:string" />
1492
+ <part name="attributeOptions" type="typens:ArrayOfString" />
1493
+ </message>
1494
+
1495
+
1496
+ <message name="mshopProductAttributeAddOptionsResponse">
1497
+ <part name="result" type="xsd:int" />
1498
+ </message>
1499
+
1500
+ <message name="mshopProductAttributeSetsThatContainRequest">
1501
+ <part name="sessionId" type="xsd:string" />
1502
+ <part name="attributeCodes" type="typens:ArrayOfString" />
1503
+ </message>
1504
+
1505
+ <message name="mshopProductAttributeSetsThatContainResponse">
1506
+ <part name="attributeSets" type="typens:mshopProductAttributeSetsEntityArray" />
1507
+ </message>
1508
+
1509
+ <message name="mshopProductAttributeCopySetRequest">
1510
+ <part name="sessionId" type="xsd:string" />
1511
+ <part name="setId" type="xsd:int" />
1512
+ <part name="newSetName" type="xsd:string" />
1513
+
1514
+ </message>
1515
+
1516
+ <message name="mshopProductAttributeCopySetResponse">
1517
+ <part name="result" type="xsd:int" />
1518
+ </message>
1519
+
1520
+ <message name="mshopProductAttributeAddToSetRequest">
1521
+ <part name="sessionId" type="xsd:string" />
1522
+ <part name="attributeCode" type="xsd:string" />
1523
+ <part name="setId" type="xsd:int" />
1524
+
1525
+ </message>
1526
+
1527
+ <message name="mshopProductAttributeAddToSetResponse">
1528
+ <part name="result" type="xsd:string" />
1529
+ </message>
1530
+
1531
+ <!-- end attribute -->
1532
+
1533
+ <!-- catalog -->
1534
+ <message name="mshopCatalogDisableProductsRequest">
1535
+ <part name="sessionId" type="xsd:string" />
1536
+ <part name="requestEntityArray" type="typens:ArrayOfString" />
1537
+ </message>
1538
+
1539
+ <message name="mshopCatalogDisableProductsResponse">
1540
+ <part name="result" type="typens:ArrayOfString" />
1541
+ </message>
1542
+
1543
+ <message name="mshopCatalogInventoryStockUpdateRequest">
1544
+ <part name="sessionId" type="xsd:string" />
1545
+ <part name="requestEntityArray" type="typens:mshopCatalogInventoryStockUpdateRequestEntityArray" />
1546
+ <part name="use_future_stock" type="xsd:int" />
1547
+ </message>
1548
+
1549
+ <message name="mshopCatalogInventoryStockUpdateResponse">
1550
+ <part name="result" type="typens:ArrayOfString" />
1551
+ </message>
1552
+
1553
+ <message name="mshopCatalogInventoryStockItemUpdateRequest">
1554
+ <part name="sessionId" type="xsd:string" />
1555
+ <part name="productSku" type="xsd:string" />
1556
+ <part name="productQty" type="xsd:double" />
1557
+ </message>
1558
+
1559
+ <message name="mshopCatalogInventoryStockItemUpdateResponse">
1560
+ <part name="result" type="xsd:boolean" />
1561
+ </message>
1562
+
1563
+ <message name="mshopCatalogInventoryStockItemFutureStockUpdateRequest">
1564
+ <part name="sessionId" type="xsd:string" />
1565
+ <part name="productSku" type="xsd:string" />
1566
+ <part name="productQty" type="xsd:double" />
1567
+ <part name="mamut_future_stock" type="xsd:double" />
1568
+ <part name="use_future_stock" type="xsd:int" />
1569
+ </message>
1570
+
1571
+ <message name="mshopCatalogInventoryStockItemFutureStockUpdateResponse">
1572
+ <part name="result" type="xsd:boolean" />
1573
+ </message>
1574
+
1575
+
1576
+ <message name="mshopCatalogSimpleProductsListRequest">
1577
+ <part name="sessionId" type="xsd:string" />
1578
+ </message>
1579
+
1580
+ <message name="mshopCatalogSimpleProductsListResponse">
1581
+ <part name="result" type="typens:ArrayOfString" />
1582
+ </message>
1583
+
1584
+ <message name="mshopCatalogProductsListRequest">
1585
+ <part name="sessionId" type="xsd:string" />
1586
+ </message>
1587
+
1588
+ <message name="mshopCatalogProductsListResponse">
1589
+ <part name="result" type="typens:ArrayOfString" />
1590
+ </message>
1591
+
1592
+ <message name="mshopCatalogProductFullInfoRequest">
1593
+ <part name="sessionId" type="xsd:string" />
1594
+ <part name="sku" type="xsd:string" />
1595
+ </message>
1596
+
1597
+ <message name="mshopCatalogProductFullInfoResponse">
1598
+ <part name="result" type="typens:mshopCatalogProductReturnEntityArray" />
1599
+ </message>
1600
+
1601
+ <message name="mshopCatalogCheckCreateGroupedProductRequest">
1602
+ <part name="sessionId" type="xsd:string" />
1603
+ <part name="setId" type="xsd:int" />
1604
+ <part name="sku" type="xsd:string" />
1605
+ <part name="productData" type="typens:mshopCatalogProductCreateEntity" />
1606
+ <part name="linkedProductsData" type="typens:ArrayOfString" />
1607
+ </message>
1608
+
1609
+ <message name="mshopCatalogCheckCreateGroupedProductResponse">
1610
+ <part name="result" type="xsd:int" />
1611
+ </message>
1612
+
1613
+
1614
+ <message name="mshopCatalogSetProductVisibleInStoreViewsRequest">
1615
+ <part name="sessionId" type="xsd:string" />
1616
+ <part name="productSKU" type="xsd:string" />
1617
+ <part name="storeViewIds" type="typens:ArrayOfString" />
1618
+ <part name="visibilityLevel" type="xsd:int" />
1619
+
1620
+ </message>
1621
+
1622
+ <message name="mshopCatalogSetProductVisibleInStoreViewsResponse">
1623
+ <part name="result" type="xsd:string" />
1624
+ </message>
1625
+
1626
+ <message name="mshopCatalogRemoveProductCategoriesBelowRequest">
1627
+ <part name="sessionId" type="xsd:string" />
1628
+ <part name="productSKU" type="xsd:string" />
1629
+ <part name="rootCategory" type="xsd:int" />
1630
+ </message>
1631
+
1632
+ <message name="mshopCatalogRemoveProductCategoriesBelowResponse">
1633
+ <part name="result" type="xsd:string" />
1634
+ </message>
1635
+
1636
+ <message name="mshopCatalogCheckCreateConfigurableProductRequest">
1637
+ <part name="sessionId" type="xsd:string" />
1638
+ <part name="setId" type="xsd:int" />
1639
+ <part name="sku" type="xsd:string" />
1640
+ <part name="productData" type="typens:mshopCatalogProductCreateEntity" />
1641
+ <part name="configurableProductsData" type="typens:ArrayOfString" />
1642
+ <part name="configurableAttributesData" type="typens:ArrayOfString" />
1643
+ </message>
1644
+
1645
+ <message name="mshopCatalogCheckCreateConfigurableProductResponse">
1646
+ <part name="result" type="xsd:int" />
1647
+ </message>
1648
+
1649
+ <message name="mshopCatalogSetProductsToComplexRequest">
1650
+ <part name="sessionId" type="xsd:string" />
1651
+ <part name="configurableProductId" type="xsd:string" />
1652
+ <part name="simpleProductsIds" type="typens:ArrayOfString" />
1653
+
1654
+ </message>
1655
+
1656
+ <message name="mshopCatalogSetProductsToComplexResponse">
1657
+ <part name="result" type="xsd:string" />
1658
+ </message>
1659
+
1660
+
1661
+ <message name="mshopCatalogProductCreateRequest">
1662
+ <part name="sessionId" type="xsd:string" />
1663
+ <part name="type" type="xsd:string" />
1664
+ <part name="set" type="xsd:string" />
1665
+ <part name="sku" type="xsd:string" />
1666
+ <part name="productData" type="typens:mshopCatalogProductCreateEntity" />
1667
+ </message>
1668
+
1669
+ <message name="mshopCatalogProductCreateResponse">
1670
+ <part name="result" type="xsd:int"/>
1671
+ </message>
1672
+
1673
+ <message name="mshopCatalogProductGetProductsChangedSinceRequest">
1674
+ <part name="sessionId" type="xsd:string" />
1675
+ <part name="date" type="xsd:string" />
1676
+ </message>
1677
+
1678
+ <message name="mshopCatalogProductGetProductsChangedSinceResponse">
1679
+ <part name="result" type="typens:ArrayOfString" />
1680
+ </message>
1681
+
1682
+
1683
+ <message name="mshopCatalogProductUpdateRequest">
1684
+ <part name="sessionId" type="xsd:string"/>
1685
+ <part name="product" type="xsd:string"/>
1686
+ <part name="productData" type="typens:mshopCatalogProductCreateEntity" />
1687
+ <part name="storeView" type="xsd:string"/>
1688
+ <part name="productIdentifierType" type="xsd:string"/>
1689
+ </message>
1690
+
1691
+ <message name="mshopCatalogProductUpdateResponse">
1692
+ <part name="result" type="xsd:boolean"/>
1693
+ </message>
1694
+
1695
+ <message name="mshopCatalogImportImagesRequest">
1696
+ <part name="sessionId" type="xsd:string"/>
1697
+ </message>
1698
+
1699
+ <message name="mshopCatalogImportImagesResponse">
1700
+ <part name="result" type="xsd:boolean"/>
1701
+ </message>
1702
+
1703
+ <message name="mshopCatalogProductAttributeTierPriceUpdateRequest">
1704
+ <part name="sessionId" type="xsd:string"/>
1705
+ <part name="product" type="xsd:string"/>
1706
+ <part name="tier_price" type="typens:mshopCatalogProductTierPriceEntityArray"/>
1707
+ <part name="productIdentifierType" type="xsd:string"/>
1708
+ </message>
1709
+ <message name="mshopCatalogProductAttributeTierPriceUpdateResponse">
1710
+ <part name="result" type="xsd:int"/>
1711
+ </message>
1712
+
1713
+
1714
+ <!-- end catalog -->
1715
+
1716
+ <!-- catalog category -->
1717
+
1718
+ <message name="mshopMCategoryCreateRequest">
1719
+ <part name="sessionId" type="xsd:string" />
1720
+ <part name="parentId" type="xsd:int" />
1721
+ <part name="categoryData" type="typens:mshopCatalogCategoryEntityCreate" />
1722
+ <part name="storeView" type="xsd:int" />
1723
+ </message>
1724
+
1725
+ <message name="mshopMCategoryCreateResponse">
1726
+ <part name="id" type="xsd:int" />
1727
+ </message>
1728
+
1729
+ <!-- end catalog category -->
1730
+
1731
+ <!-- sales -->
1732
+
1733
+ <message name="mshopSalesOrderShipmentRequest">
1734
+ <part name="sessionId" type="xsd:string" />
1735
+ <part name="orderIncrementId" type="xsd:string" />
1736
+ <part name="comment" type="xsd:string" />
1737
+ <part name="email" type="xsd:int" />
1738
+ <part name="trackNumber" type="xsd:string" />
1739
+ </message>
1740
+ <message name="mshopSalesOrderShipmentResponse">
1741
+ <part name="shipmentIncrementId" type="xsd:string" />
1742
+ </message>
1743
+
1744
+ <message name="mshopSalesCreditMemoRequest">
1745
+ <part name="sessionId" type="xsd:string" />
1746
+ <part name="creditmemoIncrementId" type="xsd:string" />
1747
+ </message>
1748
+ <message name="mshopSalesCreditMemoResponse">
1749
+ <part name="result" type="typens:salesOrderEntity" />
1750
+ </message>
1751
+
1752
+ <message name="mshopSalesGetOrdersFromWithStatusRequest">
1753
+ <part name="sessionId" type="xsd:string" />
1754
+ <part name="ordersId" type="xsd:int" />
1755
+ <part name="ordersStatuses" type="typens:ArrayOfString" />
1756
+ </message>
1757
+ <message name="mshopSalesGetOrdersFromWithStatusResponse">
1758
+ <part name="result" type="typens:ArrayOfString" />
1759
+ </message>
1760
+
1761
+ <message name="mshopSalesGetCreditmemosFromRequest">
1762
+ <part name="sessionId" type="xsd:string" />
1763
+ <part name="startId" type="xsd:int" />
1764
+ </message>
1765
+ <message name="mshopSalesGetCreditmemosFromResponse">
1766
+ <part name="result" type="typens:ArrayOfString" />
1767
+ </message>
1768
+
1769
+ <message name="mshopSalesGetSalesForOrdersRequest">
1770
+ <part name="sessionId" type="xsd:string" />
1771
+ <part name="ordersIds" type="typens:ArrayOfString" />
1772
+ </message>
1773
+ <message name="mshopSalesGetSalesForOrdersResponse">
1774
+ <part name="result" type="typens:mshopProductSalesEntityArray" />
1775
+ </message>
1776
+
1777
+ <message name="mshopSalesGetSalesForOrdersWithStatusRequest">
1778
+ <part name="sessionId" type="xsd:string" />
1779
+ <part name="ordersIds" type="typens:ArrayOfString" />
1780
+ </message>
1781
+ <message name="mshopSalesGetSalesForOrdersWithStatusResponse">
1782
+ <part name="result" type="typens:mshopProductSalesEntityArray" />
1783
+ </message>
1784
+
1785
+ <message name="mshopSalesOrderListResponse">
1786
+ <part name="result" type="typens:salesOrderEntityArray" />
1787
+ </message>
1788
+
1789
+ <message name="mshopSalesHasTaxClassForShippingRequest">
1790
+ <part name="sessionId" type="xsd:string" />
1791
+ </message>
1792
+ <message name="mshopSalesHasTaxClassForShippingResponse">
1793
+ <part name="setting" type="xsd:boolean" />
1794
+ </message>
1795
+
1796
+ <message name="mshopSalesOrderCreateInvoiceRequest">
1797
+ <part name="sessionId" type="xsd:string" />
1798
+ <part name="incrementId" type="xsd:string" />
1799
+ <part name="mamutInvoiceId" type="xsd:int" />
1800
+ </message>
1801
+ <message name="mshopSalesOrderCreateInvoiceResponse">
1802
+ <part name="invoiceIncrementId" type="xsd:string" />
1803
+ </message>
1804
+
1805
+ <message name="mshopSalesOrderCancelRequest">
1806
+ <part name="sessionId" type="xsd:string" />
1807
+ <part name="incrementId" type="xsd:string" />
1808
+ </message>
1809
+ <message name="mshopSalesOrderCancelResponse">
1810
+ <part name="responce" type="xsd:boolean" />
1811
+ </message>
1812
+
1813
+
1814
+ <message name="mshopSalesOrderNotInStockRequest">
1815
+ <part name="sessionId" type="xsd:string" />
1816
+ <part name="incrementId" type="xsd:string" />
1817
+ </message>
1818
+ <message name="mshopSalesOrderNotInStockResponse">
1819
+ <part name="responce" type="xsd:boolean" />
1820
+ </message>
1821
+
1822
+ <message name="mshopSalesOrderPickedRequest">
1823
+ <part name="sessionId" type="xsd:string" />
1824
+ <part name="incrementId" type="xsd:string" />
1825
+ </message>
1826
+ <message name="mshopSalesOrderPickedResponse">
1827
+ <part name="responce" type="xsd:boolean" />
1828
+ </message>
1829
+
1830
+
1831
+ <message name="mshopSalesOrderCreateShipmentRequest">
1832
+ <part name="sessionId" type="xsd:string" />
1833
+ <part name="incrementId" type="xsd:string" />
1834
+ <part name="trackAndTraceCode" type="xsd:string" />
1835
+ </message>
1836
+ <message name="mshopSalesOrderCreateShipmentResponse">
1837
+ <part name="shipmentIncrementId" type="xsd:string" />
1838
+ </message>
1839
+
1840
+
1841
+ <message name="mshopSalesOrderCustomFieldsMappingRequest">
1842
+ <part name="sessionId" type="xsd:string" />
1843
+ </message>
1844
+
1845
+ <message name="mshopSalesOrderCustomFieldsMappingResponse">
1846
+ <part name="result" type="typens:salesOrderCustomFeldsMappingArray" />
1847
+ </message>
1848
+ <!-- end sales -->
1849
+
1850
+
1851
+ <portType name="{{var wsdl.handler}}PortType">
1852
+
1853
+ <!-- utility operations -->
1854
+ <operation name="mshopUtilityListTaxClassRules">
1855
+ <documentation>List of product tax classes</documentation>
1856
+ <input message="typens:mshopUtilityListTaxClassRulesRequest" />
1857
+ <output message="typens:mshopUtilityListTaxClassRulesResponse" />
1858
+ </operation>
1859
+
1860
+ <operation name="mshopUtilityListPaymentStatuses">
1861
+ <documentation>List of product tax classes</documentation>
1862
+ <input message="typens:mshopUtilityListPaymentStatusesRequest" />
1863
+ <output message="typens:mshopUtilityListPaymentStatusesResponse" />
1864
+ </operation>
1865
+
1866
+ <operation name="mshopUtilityListProductTaxClasses">
1867
+ <documentation>List of product tax classes</documentation>
1868
+ <input message="typens:mshopUtilityListProductTaxClassesRequest" />
1869
+ <output message="typens:mshopUtilityListProductTaxClassesResponse" />
1870
+ </operation>
1871
+
1872
+ <operation name="mshopUtilityCleanCache">
1873
+ <documentation>Clean cache type:Web Services Configuration</documentation>
1874
+ <input message="typens:mshopUtilityCleanCacheRequest" />
1875
+ <output message="typens:mshopUtilityCleanCacheResponse" />
1876
+ </operation>
1877
+
1878
+ <operation name="mshopUtilityListPaymentMethods">
1879
+ <documentation>List of payment methods</documentation>
1880
+ <input message="typens:mshopUtilityListPaymentMethodsRequest" />
1881
+ <output message="typens:mshopUtilityListPaymentMethodsResponse" />
1882
+ </operation>
1883
+
1884
+ <operation name="mshopUtilityListShippingMethods">
1885
+ <documentation>List of shipping methods</documentation>
1886
+ <input message="typens:mshopUtilityListShippingMethodsRequest" />
1887
+ <output message="typens:mshopUtilityListShippingMethodsResponse" />
1888
+ </operation>
1889
+
1890
+ <operation name="mshopUtilityListStoreViews">
1891
+ <documentation>List of stores</documentation>
1892
+ <input message="typens:mshopUtilityListStoreViewsRequest" />
1893
+ <output message="typens:mshopUtilityListStoreViewsResponse" />
1894
+ </operation>
1895
+
1896
+ <operation name="mshopUtilityListPaymentMethodsByStore">
1897
+ <documentation>List of payment methods for store</documentation>
1898
+ <input message="typens:mshopUtilityListPaymentMethodsByStoreRequest" />
1899
+ <output message="typens:mshopUtilityListPaymentMethodsByStoreResponse" />
1900
+ </operation>
1901
+
1902
+ <operation name="mshopUtilityGetMagentoVersion">
1903
+ <documentation>Get magento version</documentation>
1904
+ <input message="typens:mshopUtilityGetMagentoVersionRequest" />
1905
+ <output message="typens:mshopUtilityGetMagentoVersionResponse" />
1906
+ </operation>
1907
+
1908
+ <operation name="mshopUtilityGetSetting">
1909
+ <documentation>Get magento admin setting</documentation>
1910
+ <input message="typens:mshopUtilityGetSettingRequest" />
1911
+ <output message="typens:mshopUtilityGetSettingResponse" />
1912
+ </operation>
1913
+
1914
+ <operation name="mshopUtilityGetMshopVersion">
1915
+ <documentation>Get Mshop Module Version</documentation>
1916
+ <input message="typens:mshopUtilityGetMshopVersionRequest" />
1917
+ <output message="typens:mshopUtilityGetMshopVersionResponse" />
1918
+ </operation>
1919
+
1920
+ <operation name="mshopUtilityGetMshopB2BVersion">
1921
+ <documentation>Get MshopB2B Module Version</documentation>
1922
+ <input message="typens:mshopUtilityGetMshopB2BVersionRequest" />
1923
+ <output message="typens:mshopUtilityGetMshopB2BVersionResponse" />
1924
+ </operation>
1925
+
1926
+ <operation name="mshopUtilityGetOrderInvoiceDate">
1927
+ <documentation>Get Order Invoice Date</documentation>
1928
+ <input message="typens:mshopUtilityGetOrderInvoiceDateRequest" />
1929
+ <output message="typens:mshopUtilityGetOrderInvoiceDateResponse" />
1930
+ </operation>
1931
+ <!--
1932
+ <operation name="mshopUtilityGetMshopType">
1933
+ <documentation>Get Mshop extension type</documentation>
1934
+ <input message="typens:mshopUtilityGetMshopTypeRequest" />
1935
+ <output message="typens:mshopUtilityGetMshopTypeResponse" />
1936
+ </operation>
1937
+ -->
1938
+ <operation name="mshopUtilityIsMshopB2BInstalled">
1939
+ <documentation>Check if MshopB2B Is installed</documentation>
1940
+ <input message="typens:mshopUtilityIsMshopB2BInstalledRequest" />
1941
+ <output message="typens:mshopUtilityIsMshopB2BInstalledResponse" />
1942
+ </operation>
1943
+
1944
+
1945
+ <!-- end utillity -->
1946
+
1947
+ <!-- attribute operations -->
1948
+
1949
+ <operation name="mshopProductAttributeOptionId">
1950
+ <documentation>Get attribute option id</documentation>
1951
+ <input message="typens:mshopProductAttributeOptionIdRequest" />
1952
+ <output message="typens:mshopProductAttributeOptionIdResponse" />
1953
+ </operation>
1954
+
1955
+ <operation name="mshopProductAttributeSetOptions">
1956
+ <documentation>Set Attribute options</documentation>
1957
+ <input message="typens:mshopProductAttributeSetOptionsRequest" />
1958
+ <output message="typens:mshopProductAttributeSetOptionsResponse" />
1959
+ </operation>
1960
+
1961
+ <operation name="mshopProductAttributeDeleteOptions">
1962
+ <documentation>Delete Attribute options</documentation>
1963
+ <input message="typens:mshopProductAttributeDeleteOptionsRequest" />
1964
+ <output message="typens:mshopProductAttributeDeleteOptionsResponse" />
1965
+ </operation>
1966
+
1967
+ <operation name="mshopProductAttributeCreate">
1968
+ <documentation>Create product attribute</documentation>
1969
+ <input message="typens:mshopProductAttributeCreateRequest" />
1970
+ <output message="typens:mshopProductAttributeCreateResponse" />
1971
+ </operation>
1972
+
1973
+ <operation name="mshopProductAttributeDelete">
1974
+ <documentation>Delete product attribute</documentation>
1975
+ <input message="typens:mshopProductAttributeDeleteRequest" />
1976
+ <output message="typens:mshopProductAttributeDeleteResponse" />
1977
+ </operation>
1978
+
1979
+ <operation name="mshopProductAttributeAddOptions">
1980
+ <documentation>Add options to the attribute</documentation>
1981
+ <input message="typens:mshopProductAttributeAddOptionsRequest" />
1982
+ <output message="typens:mshopProductAttributeAddOptionsResponse" />
1983
+ </operation>
1984
+
1985
+ <operation name="mshopProductAttributeSetsThatContain">
1986
+ <documentation>Retrive sets that contain list of attributes
1987
+ </documentation>
1988
+ <input message="typens:mshopProductAttributeSetsThatContainRequest" />
1989
+ <output message="typens:mshopProductAttributeSetsThatContainResponse" />
1990
+ </operation>
1991
+
1992
+ <operation name="mshopProductAttributeCopySet">
1993
+ <documentation>Copy attribute set to the new one</documentation>
1994
+ <input message="typens:mshopProductAttributeCopySetRequest" />
1995
+ <output message="typens:mshopProductAttributeCopySetResponse" />
1996
+ </operation>
1997
+
1998
+ <operation name="mshopProductAttributeAddToSet">
1999
+ <documentation>Add atribute to the set</documentation>
2000
+ <input message="typens:mshopProductAttributeAddToSetRequest" />
2001
+ <output message="typens:mshopProductAttributeAddToSetResponse" />
2002
+ </operation>
2003
+
2004
+ <!-- end attribute -->
2005
+
2006
+ <!-- catalog operations -->
2007
+ <operation name="mshopCatalogDisableProducts">
2008
+ <documentation>Massively Updates the Product Status</documentation>
2009
+ <input message="typens:mshopCatalogDisableProductsRequest" />
2010
+ <output message="typens:mshopCatalogDisableProductsResponse" />
2011
+ </operation>
2012
+
2013
+ <operation name="mshopCatalogInventoryStockUpdate">
2014
+ <documentation>Massively Updates the Product Inventory: Qty</documentation>
2015
+ <input message="typens:mshopCatalogInventoryStockUpdateRequest" />
2016
+ <output message="typens:mshopCatalogInventoryStockUpdateResponse" />
2017
+ </operation>
2018
+
2019
+ <operation name="mshopCatalogInventoryStockItemUpdate">
2020
+ <documentation>Update the Product Inventory: Qty</documentation>
2021
+ <input message="typens:mshopCatalogInventoryStockItemUpdateRequest" />
2022
+ <output message="typens:mshopCatalogInventoryStockItemUpdateResponse" />
2023
+ </operation>
2024
+
2025
+ <operation name="mshopCatalogInventoryStockItemFutureStockUpdate">
2026
+ <documentation>Update the Product Inventory: Qty</documentation>
2027
+ <input message="typens:mshopCatalogInventoryStockItemFutureStockUpdateRequest" />
2028
+ <output message="typens:mshopCatalogInventoryStockItemFutureStockUpdateResponse" />
2029
+ </operation>
2030
+
2031
+
2032
+ <operation name="mshopCatalogSimpleProductsList">
2033
+ <documentation>Return Simple Products SKUs</documentation>
2034
+ <input message="typens:mshopCatalogSimpleProductsListRequest" />
2035
+ <output message="typens:mshopCatalogSimpleProductsListResponse" />
2036
+ </operation>
2037
+
2038
+ <operation name="mshopCatalogProductsList">
2039
+ <documentation>Return All Products SKUs</documentation>
2040
+ <input message="typens:mshopCatalogProductsListRequest" />
2041
+ <output message="typens:mshopCatalogProductsListResponse" />
2042
+ </operation>
2043
+
2044
+ <operation name="mshopCatalogProductFullInfo">
2045
+ <documentation>Get Product Info For All Store Views</documentation>
2046
+ <input message="typens:mshopCatalogProductFullInfoRequest" />
2047
+ <output message="typens:mshopCatalogProductFullInfoResponse" />
2048
+ </operation>
2049
+
2050
+ <operation name="mshopCatalogCheckCreateGroupedProduct">
2051
+ <documentation>Create grouped product</documentation>
2052
+ <input message="typens:mshopCatalogCheckCreateGroupedProductRequest" />
2053
+ <output message="typens:mshopCatalogCheckCreateGroupedProductResponse" />
2054
+ </operation>
2055
+
2056
+ <operation name="mshopCatalogSetProductVisibleInStoreViews">
2057
+ <documentation>Set product visibility in store views</documentation>
2058
+ <input message="typens:mshopCatalogSetProductVisibleInStoreViewsRequest" />
2059
+ <output message="typens:mshopCatalogSetProductVisibleInStoreViewsResponse" />
2060
+ </operation>
2061
+
2062
+ <operation name="mshopCatalogRemoveProductCategoriesBelow">
2063
+ <documentation>Remove product from categories below root category
2064
+ </documentation>
2065
+ <input message="typens:mshopCatalogRemoveProductCategoriesBelowRequest" />
2066
+ <output message="typens:mshopCatalogRemoveProductCategoriesBelowResponse" />
2067
+ </operation>
2068
+
2069
+ <operation name="mshopCatalogCheckCreateConfigurableProduct">
2070
+ <documentation>Create configurable product</documentation>
2071
+ <input message="typens:mshopCatalogCheckCreateConfigurableProductRequest" />
2072
+ <output message="typens:mshopCatalogCheckCreateConfigurableProductResponse" />
2073
+ </operation>
2074
+
2075
+ <operation name="mshopCatalogSetProductsToComplex">
2076
+ <documentation>Add simple products to configurable or grouped product
2077
+ </documentation>
2078
+ <input message="typens:mshopCatalogSetProductsToComplexRequest" />
2079
+ <output message="typens:mshopCatalogSetProductsToComplexResponse" />
2080
+ </operation>
2081
+
2082
+ <operation name="mshopCatalogProductCreate">
2083
+ <documentation>Create product method compatible with versions pre 1.6.2
2084
+ </documentation>
2085
+ <input message="typens:mshopCatalogProductCreateRequest" />
2086
+ <output message="typens:mshopCatalogProductCreateResponse" />
2087
+ </operation>
2088
+
2089
+ <operation name="mshopCatalogProductGetProductsChangedSince">
2090
+ <documentation>
2091
+ </documentation>
2092
+ <input message="typens:mshopCatalogProductGetProductsChangedSinceRequest" />
2093
+ <output message="typens:mshopCatalogProductGetProductsChangedSinceResponse" />
2094
+ </operation>
2095
+
2096
+ <operation name="mshopCatalogProductUpdate">
2097
+ <documentation>Update product method compatible with versions pre 1.6.2
2098
+ </documentation>
2099
+ <input message="typens:mshopCatalogProductUpdateRequest" />
2100
+ <output message="typens:mshopCatalogProductUpdateResponse" />
2101
+ </operation>
2102
+
2103
+ <operation name="mshopCatalogImportImages">
2104
+ <documentation>Import product images from ftp location
2105
+ </documentation>
2106
+ <input message="typens:mshopCatalogImportImagesRequest" />
2107
+ <output message="typens:mshopCatalogImportImagesResponse" />
2108
+ </operation>
2109
+
2110
+ <operation name="mshopCatalogProductAttributeTierPriceUpdate">
2111
+ <documentation>Update tier prices of product(percentage or fixed)</documentation>
2112
+ <input message="typens:mshopCatalogProductAttributeTierPriceUpdateRequest" />
2113
+ <output message="typens:mshopCatalogProductAttributeTierPriceUpdateResponse" />
2114
+ </operation>
2115
+
2116
+
2117
+
2118
+
2119
+ <!-- end catalog -->
2120
+
2121
+ <!-- catalog category operations -->
2122
+
2123
+ <operation name="mshopMCategoryCreate">
2124
+ <documentation>Create new category</documentation>
2125
+ <input message="typens:mshopMCategoryCreateRequest" />
2126
+ <output message="typens:mshopMCategoryCreateResponse" />
2127
+ </operation>
2128
+
2129
+
2130
+
2131
+ <!-- end catalog category -->
2132
+ <!-- sales operations -->
2133
+
2134
+ <operation name="mshopSalesOrderShipment">
2135
+ <documentation>Create new shipment for order</documentation>
2136
+ <input message="typens:mshopSalesOrderShipmentRequest" />
2137
+ <output message="typens:mshopSalesOrderShipmentResponse" />
2138
+ </operation>
2139
+ <operation name="mshopSalesCreditMemo">
2140
+ <documentation>Retrieve list of order increment ids</documentation>
2141
+ <input message="typens:mshopSalesCreditMemoRequest" />
2142
+ <output message="typens:mshopSalesCreditMemoResponse" />
2143
+ </operation>
2144
+
2145
+ <operation name="mshopSalesGetOrdersFromWithStatus">
2146
+ <documentation>Retrieve list of order increment ids</documentation>
2147
+ <input message="typens:mshopSalesGetOrdersFromWithStatusRequest" />
2148
+ <output message="typens:mshopSalesGetOrdersFromWithStatusResponse" />
2149
+ </operation>
2150
+
2151
+ <operation name="mshopSalesGetCreditmemosFrom">
2152
+ <documentation>Retrieve list of creditmemo increment ids</documentation>
2153
+ <input message="typens:mshopSalesGetCreditmemosFromRequest" />
2154
+ <output message="typens:mshopSalesGetCreditmemosFromResponse" />
2155
+ </operation>
2156
+
2157
+ <operation name="mshopSalesGetSalesForOrders">
2158
+ <documentation>Retrieve list of order items ant their sales</documentation>
2159
+ <input message="typens:mshopSalesGetSalesForOrdersRequest" />
2160
+ <output message="typens:mshopSalesGetSalesForOrdersResponse" />
2161
+ </operation>
2162
+
2163
+ <operation name="mshopSalesGetSalesForOrdersWithStatus">
2164
+ <documentation>Retrieve list of order items ant their sales</documentation>
2165
+ <input message="typens:mshopSalesGetSalesForOrdersWithStatusRequest" />
2166
+ <output message="typens:mshopSalesGetSalesForOrdersWithStatusResponse" />
2167
+ </operation>
2168
+
2169
+ <operation name="mshopSalesOrderList">
2170
+ <documentation>Retrieve list of orders by filters</documentation>
2171
+ <input message="typens:salesOrderListRequest" />
2172
+ <output message="typens:mshopSalesOrderListResponse" />
2173
+ </operation>
2174
+
2175
+ <operation name="mshopSalesHasTaxClassForShipping">
2176
+ <documentation>Checks if has tax class for shipping</documentation>
2177
+ <input message="typens:mshopSalesHasTaxClassForShippingRequest" />
2178
+ <output message="typens:mshopSalesHasTaxClassForShippingResponse" />
2179
+ </operation>
2180
+
2181
+
2182
+ <operation name="mshopSalesOrderCreateInvoice">
2183
+ <documentation>Create invoice for mamut order</documentation>
2184
+ <input message="typens:mshopSalesOrderCreateInvoiceRequest" />
2185
+ <output message="typens:mshopSalesOrderCreateInvoiceResponse" />
2186
+ </operation>
2187
+
2188
+ <operation name="mshopSalesOrderCancel">
2189
+ <documentation>Order cancellation</documentation>
2190
+ <input message="typens:mshopSalesOrderCancelRequest" />
2191
+ <output message="typens:mshopSalesOrderCancelResponse" />
2192
+ </operation>
2193
+
2194
+ <operation name="mshopSalesOrderNotInStock">
2195
+ <documentation>Some ordered items are not in stock</documentation>
2196
+ <input message="typens:mshopSalesOrderNotInStockRequest" />
2197
+ <output message="typens:mshopSalesOrderNotInStockResponse" />
2198
+ </operation>
2199
+
2200
+ <operation name="mshopSalesOrderPicked">
2201
+ <documentation>Order is picked</documentation>
2202
+ <input message="typens:mshopSalesOrderPickedRequest" />
2203
+ <output message="typens:mshopSalesOrderPickedResponse" />
2204
+ </operation>
2205
+
2206
+ <operation name="mshopSalesOrderCreateShipment">
2207
+ <documentation>Order is shipped</documentation>
2208
+ <input message="typens:mshopSalesOrderCreateShipmentRequest" />
2209
+ <output message="typens:mshopSalesOrderCreateShipmentResponse" />
2210
+ </operation>
2211
+
2212
+ <operation name="mshopSalesOrderCustomFieldsMapping">
2213
+ <documentation>Order custom fields</documentation>
2214
+ <input message="typens:mshopSalesOrderCustomFieldsMappingRequest" />
2215
+ <output message="typens:mshopSalesOrderCustomFieldsMappingResponse" />
2216
+ </operation>
2217
+
2218
+
2219
+ <!-- end sales opertations -->
2220
+
2221
+
2222
+
2223
+
2224
+ </portType>
2225
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
2226
+ <soap:binding style="rpc"
2227
+ transport="http://schemas.xmlsoap.org/soap/http" />
2228
+
2229
+ <!-- catalog category operations -->
2230
+
2231
+ <operation name="mshopMCategoryCreate">
2232
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2233
+ <input>
2234
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2235
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2236
+ </input>
2237
+ <output>
2238
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2239
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2240
+ </output>
2241
+ </operation>
2242
+
2243
+ <!-- end catalog category operations -->
2244
+
2245
+ <!-- catalog operations -->
2246
+ <operation name="mshopCatalogDisableProducts">
2247
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2248
+ <input>
2249
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2250
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2251
+ </input>
2252
+ <output>
2253
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2254
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2255
+ </output>
2256
+ </operation>
2257
+
2258
+ <operation name="mshopCatalogInventoryStockUpdate">
2259
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2260
+ <input>
2261
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2262
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2263
+ </input>
2264
+ <output>
2265
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2266
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2267
+ </output>
2268
+ </operation>
2269
+
2270
+ <operation name="mshopCatalogInventoryStockItemUpdate">
2271
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2272
+ <input>
2273
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2274
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2275
+ </input>
2276
+ <output>
2277
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2278
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2279
+ </output>
2280
+ </operation>
2281
+
2282
+ <operation name="mshopCatalogInventoryStockItemFutureStockUpdate">
2283
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2284
+ <input>
2285
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2286
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2287
+ </input>
2288
+ <output>
2289
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2290
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2291
+ </output>
2292
+ </operation>
2293
+
2294
+ <operation name="mshopCatalogSimpleProductsList">
2295
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2296
+ <input>
2297
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2298
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2299
+ </input>
2300
+ <output>
2301
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2302
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2303
+ </output>
2304
+ </operation>
2305
+
2306
+ <operation name="mshopCatalogProductsList">
2307
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2308
+ <input>
2309
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2310
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2311
+ </input>
2312
+ <output>
2313
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2314
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2315
+ </output>
2316
+ </operation>
2317
+
2318
+
2319
+ <operation name="mshopCatalogProductFullInfo">
2320
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2321
+ <input>
2322
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2323
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2324
+ </input>
2325
+ <output>
2326
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2327
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2328
+ </output>
2329
+ </operation>
2330
+
2331
+ <operation name="mshopCatalogCheckCreateGroupedProduct">
2332
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2333
+ <input>
2334
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2335
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2336
+ </input>
2337
+ <output>
2338
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2339
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2340
+ </output>
2341
+ </operation>
2342
+ <operation name="mshopCatalogSetProductsToComplex">
2343
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2344
+ <input>
2345
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2346
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2347
+ </input>
2348
+ <output>
2349
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2350
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2351
+ </output>
2352
+ </operation>
2353
+
2354
+ <operation name="mshopCatalogCheckCreateConfigurableProduct">
2355
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2356
+ <input>
2357
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2358
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2359
+ </input>
2360
+ <output>
2361
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2362
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2363
+ </output>
2364
+ </operation>
2365
+
2366
+ <operation name="mshopCatalogRemoveProductCategoriesBelow">
2367
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2368
+ <input>
2369
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2370
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2371
+ </input>
2372
+ <output>
2373
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2374
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2375
+ </output>
2376
+ </operation>
2377
+
2378
+ <operation name="mshopCatalogSetProductVisibleInStoreViews">
2379
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2380
+ <input>
2381
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2382
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2383
+ </input>
2384
+ <output>
2385
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2386
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2387
+ </output>
2388
+ </operation>
2389
+
2390
+ <operation name="mshopCatalogProductCreate">
2391
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2392
+ <input>
2393
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2394
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2395
+ </input>
2396
+ <output>
2397
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2398
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2399
+ </output>
2400
+ </operation>
2401
+
2402
+ <operation name="mshopCatalogProductGetProductsChangedSince">
2403
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2404
+ <input>
2405
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2406
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2407
+ </input>
2408
+ <output>
2409
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2410
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2411
+ </output>
2412
+ </operation>
2413
+
2414
+ <operation name="mshopCatalogProductUpdate">
2415
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2416
+ <input>
2417
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2418
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2419
+ </input>
2420
+ <output>
2421
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2422
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2423
+ </output>
2424
+ </operation>
2425
+
2426
+ <operation name="mshopCatalogImportImages">
2427
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2428
+ <input>
2429
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2430
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2431
+ </input>
2432
+ <output>
2433
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2434
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2435
+ </output>
2436
+ </operation>
2437
+
2438
+
2439
+ <operation name="mshopCatalogProductAttributeTierPriceUpdate">
2440
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2441
+ <input>
2442
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2443
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2444
+ </input>
2445
+ <output>
2446
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2447
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2448
+ </output>
2449
+ </operation>
2450
+
2451
+ <!-- end catalog operations -->
2452
+
2453
+ <!-- attribute operations -->
2454
+
2455
+ <operation name="mshopProductAttributeOptionId">
2456
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2457
+ <input>
2458
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2459
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2460
+ </input>
2461
+ <output>
2462
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2463
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2464
+ </output>
2465
+ </operation>
2466
+
2467
+
2468
+ <operation name="mshopProductAttributeSetOptions">
2469
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2470
+ <input>
2471
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2472
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2473
+ </input>
2474
+ <output>
2475
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2476
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2477
+ </output>
2478
+ </operation>
2479
+
2480
+ <operation name="mshopProductAttributeDeleteOptions">
2481
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2482
+ <input>
2483
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2484
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2485
+ </input>
2486
+ <output>
2487
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2488
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2489
+ </output>
2490
+ </operation>
2491
+
2492
+ <operation name="mshopProductAttributeAddToSet">
2493
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2494
+ <input>
2495
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2496
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2497
+ </input>
2498
+ <output>
2499
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2500
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2501
+ </output>
2502
+ </operation>
2503
+
2504
+ <operation name="mshopProductAttributeCopySet">
2505
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2506
+ <input>
2507
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2508
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2509
+ </input>
2510
+ <output>
2511
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2512
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2513
+ </output>
2514
+ </operation>
2515
+
2516
+ <operation name="mshopProductAttributeSetsThatContain">
2517
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2518
+ <input>
2519
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2520
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2521
+ </input>
2522
+ <output>
2523
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2524
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2525
+ </output>
2526
+ </operation>
2527
+
2528
+ <operation name="mshopProductAttributeAddOptions">
2529
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2530
+ <input>
2531
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2532
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2533
+ </input>
2534
+ <output>
2535
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2536
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2537
+ </output>
2538
+ </operation>
2539
+
2540
+ <operation name="mshopProductAttributeDelete">
2541
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2542
+ <input>
2543
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2544
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2545
+ </input>
2546
+ <output>
2547
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2548
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2549
+ </output>
2550
+ </operation>
2551
+
2552
+ <operation name="mshopProductAttributeCreate">
2553
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2554
+ <input>
2555
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2556
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2557
+ </input>
2558
+ <output>
2559
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2560
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2561
+ </output>
2562
+ </operation>
2563
+
2564
+ <!-- end attribute operations -->
2565
+
2566
+ <!-- utility operations -->
2567
+ <operation name="mshopUtilityListTaxClassRules">
2568
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2569
+ <input>
2570
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2571
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2572
+ </input>
2573
+ <output>
2574
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2575
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2576
+ </output>
2577
+ </operation>
2578
+
2579
+ <operation name="mshopUtilityListPaymentStatuses">
2580
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2581
+ <input>
2582
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2583
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2584
+ </input>
2585
+ <output>
2586
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2587
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2588
+ </output>
2589
+ </operation>
2590
+
2591
+ <operation name="mshopUtilityListProductTaxClasses">
2592
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2593
+ <input>
2594
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2595
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2596
+ </input>
2597
+ <output>
2598
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2599
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2600
+ </output>
2601
+ </operation>
2602
+
2603
+ <operation name="mshopUtilityCleanCache">
2604
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2605
+ <input>
2606
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2607
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2608
+ </input>
2609
+ <output>
2610
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2611
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2612
+ </output>
2613
+ </operation>
2614
+
2615
+ <operation name="mshopUtilityListPaymentMethods">
2616
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2617
+ <input>
2618
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2619
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2620
+ </input>
2621
+ <output>
2622
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2623
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2624
+ </output>
2625
+ </operation>
2626
+
2627
+ <operation name="mshopUtilityListShippingMethods">
2628
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2629
+ <input>
2630
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2631
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2632
+ </input>
2633
+ <output>
2634
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2635
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2636
+ </output>
2637
+ </operation>
2638
+
2639
+ <operation name="mshopUtilityListStoreViews">
2640
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2641
+ <input>
2642
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2643
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2644
+ </input>
2645
+ <output>
2646
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2647
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2648
+ </output>
2649
+ </operation>
2650
+
2651
+ <operation name="mshopUtilityListPaymentMethodsByStore">
2652
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2653
+ <input>
2654
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2655
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2656
+ </input>
2657
+ <output>
2658
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2659
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2660
+ </output>
2661
+ </operation>
2662
+
2663
+ <operation name="mshopUtilityGetMagentoVersion">
2664
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2665
+ <input>
2666
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2667
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2668
+ </input>
2669
+ <output>
2670
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2671
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2672
+ </output>
2673
+ </operation>
2674
+
2675
+ <operation name="mshopUtilityGetSetting">
2676
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2677
+ <input>
2678
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2679
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2680
+ </input>
2681
+ <output>
2682
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2683
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2684
+ </output>
2685
+ </operation>
2686
+
2687
+
2688
+ <operation name="mshopUtilityGetMshopVersion">
2689
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2690
+ <input>
2691
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2692
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2693
+ </input>
2694
+ <output>
2695
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2696
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2697
+ </output>
2698
+ </operation>
2699
+
2700
+ <operation name="mshopUtilityGetMshopB2BVersion">
2701
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2702
+ <input>
2703
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2704
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2705
+ </input>
2706
+ <output>
2707
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2708
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2709
+ </output>
2710
+ </operation>
2711
+
2712
+
2713
+ <operation name="mshopUtilityGetOrderInvoiceDate">
2714
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2715
+ <input>
2716
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2717
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2718
+ </input>
2719
+ <output>
2720
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2721
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2722
+ </output>
2723
+ </operation>
2724
+ <!--
2725
+ <operation name="mshopUtilityGetMshopType">
2726
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2727
+ <input>
2728
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2729
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2730
+ </input>
2731
+ <output>
2732
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2733
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2734
+ </output>
2735
+ </operation>
2736
+ -->
2737
+ <operation name="mshopUtilityIsMshopB2BInstalled">
2738
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2739
+ <input>
2740
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2741
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2742
+ </input>
2743
+ <output>
2744
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2745
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2746
+ </output>
2747
+ </operation>
2748
+
2749
+
2750
+
2751
+
2752
+ <!-- end utility operations -->
2753
+
2754
+ <!-- sales operations -->
2755
+
2756
+ <operation name="mshopSalesOrderShipment">
2757
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2758
+ <input>
2759
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2760
+ </input>
2761
+ <output>
2762
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2763
+ </output>
2764
+ </operation>
2765
+ <operation name="mshopSalesCreditMemo">
2766
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2767
+ <input>
2768
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2769
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2770
+ </input>
2771
+ <output>
2772
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2773
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2774
+ </output>
2775
+ </operation>
2776
+
2777
+ <operation name="mshopSalesGetOrdersFromWithStatus">
2778
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2779
+ <input>
2780
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2781
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2782
+ </input>
2783
+ <output>
2784
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2785
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2786
+ </output>
2787
+ </operation>
2788
+ <operation name="mshopSalesGetCreditmemosFrom">
2789
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2790
+ <input>
2791
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2792
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2793
+ </input>
2794
+ <output>
2795
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2796
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2797
+ </output>
2798
+ </operation>
2799
+
2800
+ <operation name="mshopSalesGetSalesForOrders">
2801
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2802
+ <input>
2803
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2804
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2805
+ </input>
2806
+ <output>
2807
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2808
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2809
+ </output>
2810
+ </operation>
2811
+
2812
+ <operation name="mshopSalesGetSalesForOrdersWithStatus">
2813
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2814
+ <input>
2815
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2816
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2817
+ </input>
2818
+ <output>
2819
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2820
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2821
+ </output>
2822
+ </operation>
2823
+
2824
+ <operation name="mshopSalesOrderList">
2825
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2826
+ <input>
2827
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2828
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2829
+ </input>
2830
+ <output>
2831
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2832
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2833
+ </output>
2834
+ </operation>
2835
+
2836
+ <operation name="mshopSalesHasTaxClassForShipping">
2837
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2838
+ <input>
2839
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2840
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2841
+ </input>
2842
+ <output>
2843
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2844
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2845
+ </output>
2846
+ </operation>
2847
+
2848
+ <operation name="mshopSalesOrderCreateInvoice">
2849
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2850
+ <input>
2851
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2852
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2853
+ </input>
2854
+ <output>
2855
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2856
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2857
+ </output>
2858
+ </operation>
2859
+
2860
+ <operation name="mshopSalesOrderCancel">
2861
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2862
+ <input>
2863
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2864
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2865
+ </input>
2866
+ <output>
2867
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2868
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2869
+ </output>
2870
+ </operation>
2871
+
2872
+ <operation name="mshopSalesOrderNotInStock">
2873
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2874
+ <input>
2875
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2876
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2877
+ </input>
2878
+ <output>
2879
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2880
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2881
+ </output>
2882
+ </operation>
2883
+
2884
+ <operation name="mshopSalesOrderPicked">
2885
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2886
+ <input>
2887
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2888
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2889
+ </input>
2890
+ <output>
2891
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2892
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2893
+ </output>
2894
+ </operation>
2895
+
2896
+ <operation name="mshopSalesOrderCreateShipment">
2897
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2898
+ <input>
2899
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2900
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2901
+ </input>
2902
+ <output>
2903
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2904
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2905
+ </output>
2906
+ </operation>
2907
+
2908
+ <operation name="mshopSalesOrderCustomFieldsMapping">
2909
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
2910
+ <input>
2911
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2912
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2913
+ </input>
2914
+ <output>
2915
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
2916
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
2917
+ </output>
2918
+ </operation>
2919
+
2920
+ <!-- end of sales operations -->
2921
+
2922
+ </binding>
2923
+ <service name="{{var wsdl.name}}Service">
2924
+ <port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
2925
+ <soap:address location="{{var wsdl.url}}" />
2926
+ </port>
2927
+ </service>
2928
+ </definitions>
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-install-2.0.1.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ CREATE TABLE IF NOT EXISTS {$this->getTable('ecomwise_settings_before_order')} (
9
+ `order_id` int(11) NOT NULL default '0',
10
+ `including_tax` int(1) NOT NULL default '0',
11
+ UNIQUE KEY `key_ecomwise_settings_before_order` (`order_id`,`including_tax`)
12
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
13
+ ");
14
+
15
+ Mage::getModel('core/config')->saveConfig('tax/calculation/apply_after_discount', 1 );
16
+
17
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.10-2.1.0.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->run("
6
+
7
+ ALTER TABLE {$this->getTable('cataloginventory/stock_item')} ADD COLUMN mamut_store1 VARCHAR(30) ;
8
+ ALTER TABLE {$this->getTable('cataloginventory/stock_item')} ADD COLUMN mamut_store2 VARCHAR(30) ;
9
+ ALTER TABLE {$this->getTable('cataloginventory/stock_item')} ADD COLUMN mamut_store3 VARCHAR(30) ;
10
+ ALTER TABLE {$this->getTable('cataloginventory/stock_item')} ADD COLUMN mamut_store4 VARCHAR(30) ;
11
+ ALTER TABLE {$this->getTable('cataloginventory/stock_item')} ADD COLUMN mamut_store5 VARCHAR(30) ;
12
+ ALTER TABLE {$this->getTable('cataloginventory/stock_item')} ADD COLUMN mamut_nextdeliverydate VARCHAR(30) ;
13
+
14
+ ");
15
+
16
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.3-2.0.4.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ Mage::getModel('core/config')->saveConfig('tax/calculation/apply_after_discount', 1 );
8
+
9
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.4-2.0.5.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.5-2.0.6.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.6-2.0.7.php ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->addAttribute('invoice', 'mamut_invoice_id', array('type'=>'integer', 'visible'=> true, 'unsigned'=> true));
8
+
9
+
10
+ $templateTextShipment = '
11
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
13
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
14
+ <tr>
15
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
16
+ <!-- [ header starts here] -->
17
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
18
+ <tr>
19
+ <td valign="top"><a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area="frontend"}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/></a></td>
20
+ </tr>
21
+ <!-- [ middle starts here] -->
22
+ <tr>
23
+ <td valign="top">
24
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
25
+ <p style="font-size:12px; line-height:16px; margin:0;">
26
+ Thank you for your order from {{var store.getFrontendName()}}.
27
+ You can check the status of your order by <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">logging into your account</a>.
28
+ If you have any questions about your order please contact us at <a href="mailto:{{config path="trans_email/ident_support/email"}}" style="color:#1E7EC8;">{{config path="trans_email/ident_support/email"}}</a> or call us at <span class="nobr">{{config path="general/store_information/phone"}}</span> Monday - Friday, 8am - 5pm PST.
29
+ </p>
30
+ <p style="font-size:12px; line-height:16px; margin:0;">
31
+ Your shipping confirmation is below. Thank you again for your business.
32
+ </p>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td>
37
+ <h2 style="font-size:18px; font-weight:normal; margin:0;">Your Shipment #{{var shipment.increment_id}} for Order #{{var order.increment_id}}</h2>
38
+ <p>Shipping tracking number: {{var trackingCode}}</p>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td>
43
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
44
+ <thead>
45
+ <tr>
46
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
47
+ <th width="10"></th>
48
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
49
+ </tr>
50
+ </thead>
51
+ <tbody>
52
+ <tr>
53
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
54
+ {{var order.billing_address.format("html")}}
55
+ </td>
56
+ <td>&nbsp;</td>
57
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
58
+ {{var payment_html}}
59
+ </td>
60
+ </tr>
61
+ </tbody>
62
+ </table>
63
+ <br/>
64
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
65
+ <thead>
66
+ <tr>
67
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
68
+ <th width="10"></th>
69
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
70
+ </tr>
71
+ </thead>
72
+ <tbody>
73
+ <tr>
74
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
75
+ {{var order.shipping_address.format("html")}}
76
+ &nbsp;
77
+ </td>
78
+ <td>&nbsp;</td>
79
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
80
+ {{var order.shipping_description}}
81
+ &nbsp;
82
+ </td>
83
+ </tr>
84
+ </tbody>
85
+ </table>
86
+ <br/>
87
+ {{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}}
88
+ <!-- {{block type=\'core/template\' area=\'frontend\' template=\'email/order/shipment/track.phtml\' shipment=$shipment order=$order}}-->
89
+ <p style="font-size:12px; margin:0 10px 10px 0">{{var comment}}</p>
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
94
+ </tr>
95
+ </table>
96
+ </td>
97
+ </tr>
98
+ </table>
99
+ </div>
100
+ </body>
101
+ ';
102
+ $templateShipment = Mage::getModel('core/email_template');
103
+ $templateShipment->setTemplateCode('New Shipment With Tracking Number');
104
+ $templateShipment->setTemplateText($templateTextShipment);
105
+ $templateShipment->setTemplateType(2);
106
+ $templateShipment->setTemplateSubject('{{var store.getFrontendName()}}: Shipment # {{var shipment.increment_id}} for Order # {{var order.increment_id}}');
107
+ $templateShipment->save();
108
+ $tem_id = $templateShipment->getId();
109
+ Mage::getModel('core/config')->saveConfig('mshop/parameters_order_shipped/email_template', $tem_id);
110
+
111
+
112
+ $templateOrderCanceled = '
113
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
114
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
115
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
116
+ <tr>
117
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
118
+ <!-- [ header starts here] -->
119
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
120
+ <tr>
121
+ <td valign="top"><a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area=\'frontend\'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/></a></td>
122
+ </tr>
123
+ <!-- [ middle starts here] -->
124
+ <tr>
125
+ <td valign="top">
126
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;">Dear {{htmlescape var=$order.getCustomerName()}},</h1>
127
+ <p style="font-size:12px; line-height:16px; margin:0 0 10px 0;">
128
+ Your order # {{var order.increment_id}} has been <br/>
129
+ <strong>{{var order.getStatusLabel()}}</strong>.
130
+ </p>
131
+ <p style="font-size:12px; line-height:16px; margin:0 0 10px 0;">You can check the status of your order by <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">logging into your account</a>.</p>
132
+ <p style="font-size:12px; line-height:16px; margin:0 0 10px 0;">{{var comment}}</p>
133
+ <p style="font-size:12px; line-height:16px; margin:0;">
134
+ If you have any questions, please feel free to contact us at
135
+ <a href="mailto:{{config path=\'trans_email/ident_support/email\'}}" style="color:#1E7EC8;">{{config path=\'trans_email/ident_support/email\'}}</a>
136
+ or by phone at {{config path=\'general/store_information/phone\'}}.
137
+ </p>
138
+ </td>
139
+ </tr>
140
+ <tr>
141
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
142
+ </tr>
143
+ </table>
144
+ </td>
145
+ </tr>
146
+ </table>
147
+ </div>
148
+ </body>
149
+ ';
150
+ $templateShipment = Mage::getModel('core/email_template');
151
+ $templateShipment->setTemplateCode('Order is canceled');
152
+ $templateShipment->setTemplateText($templateOrderCanceled);
153
+ $templateShipment->setTemplateType(2);
154
+ $templateShipment->setTemplateSubject('{{var store.getFrontendName()}}: Order # {{var order.increment_id}} is canceled');
155
+ $templateShipment->save();
156
+ $tem_id = $templateShipment->getId();
157
+ Mage::getModel('core/config')->saveConfig('mshop/parameters_order_cancellation/email_template', $tem_id);
158
+
159
+
160
+ $templateOrderpiked = '
161
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
162
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
163
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
164
+ <tr>
165
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
166
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
167
+ <!-- [ header starts here] -->
168
+ <tr>
169
+ <td valign="top"><a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area=\'frontend\'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/></a></td>
170
+ </tr>
171
+ <!-- [ middle starts here] -->
172
+
173
+ <tr><td><h4>You order has been picked up.</h4></td></tr>
174
+ <tr>
175
+ <td valign="top">
176
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
177
+ <p style="font-size:12px; line-height:16px; margin:0;">
178
+ Thank you for your order from {{var store.getFrontendName()}}.
179
+ Once your package ships we will send an email with a link to track your order.
180
+ You can check the status of your order by <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">logging into your account</a>.
181
+ If you have any questions about your order please contact us at <a href="mailto:{{config path=\'trans_email/ident_support/email\'}}" style="color:#1E7EC8;">{{config path=\'trans_email/ident_support/email\'}}</a> or call us at <span class="nobr">{{config path=\'general/store_information/phone\'}}</span> Monday - Friday, 8am - 5pm PST.
182
+ </p>
183
+ <p style="font-size:12px; line-height:16px; margin:0;">Your order confirmation is below. Thank you again for your business.</p>
184
+ </tr>
185
+ <tr>
186
+ <td>
187
+ <h2 style="font-size:18px; font-weight:normal; margin:0;">Your Order #{{var order.increment_id}} <small>(placed on {{var order.getCreatedAtFormated(\'long\')}})</small></h2>
188
+ </td>
189
+ </tr>
190
+ <tr>
191
+ <td>
192
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
193
+ <thead>
194
+ <tr>
195
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
196
+ <th width="10"></th>
197
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
198
+ </tr>
199
+ </thead>
200
+ <tbody>
201
+ <tr>
202
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
203
+ {{var order.getBillingAddress().format(\'html\')}}
204
+ </td>
205
+ <td>&nbsp;</td>
206
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
207
+ {{var payment_html}}
208
+ </td>
209
+ </tr>
210
+ </tbody>
211
+ </table>
212
+ <br/>
213
+ {{depend order.getIsNotVirtual()}}
214
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
215
+ <thead>
216
+ <tr>
217
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
218
+ <th width="10"></th>
219
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
220
+ </tr>
221
+ </thead>
222
+ <tbody>
223
+ <tr>
224
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
225
+ {{var order.getShippingAddress().format(\'html\')}}
226
+ &nbsp;
227
+ </td>
228
+ <td>&nbsp;</td>
229
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
230
+ {{var order.getShippingDescription()}}
231
+ &nbsp;
232
+ </td>
233
+ </tr>
234
+ </tbody>
235
+ </table>
236
+ <br/>
237
+ {{/depend}}
238
+ {{layout handle="sales_email_order_items" order=$order}}
239
+ <p style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p>
240
+ </td>
241
+ </tr>
242
+ <tr>
243
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
244
+ </tr>
245
+ </table>
246
+ </td>
247
+ </tr>
248
+ </table>
249
+ </div>
250
+ </body>
251
+ ';
252
+ $templateShipment = Mage::getModel('core/email_template');
253
+ $templateShipment->setTemplateCode('Order is picked');
254
+ $templateShipment->setTemplateText($templateOrderpiked);
255
+ $templateShipment->setTemplateType(2);
256
+ $templateShipment->setTemplateSubject(' {{var store.getFrontendName()}}: Order is picked # {{var order.increment_id}}');
257
+ $templateShipment->save();
258
+ $tem_id = $templateShipment->getId();
259
+ Mage::getModel('core/config')->saveConfig('mshop/parameters_order_picked/email_template', $tem_id);
260
+
261
+
262
+
263
+ $templateOrdernodelivered = '
264
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
265
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
266
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
267
+ <tr>
268
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
269
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
270
+ <!-- [ header starts here] -->
271
+ <tr>
272
+ <td valign="top"><a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area=\'frontend\'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/></a></td>
273
+ </tr>
274
+ <!-- [ middle starts here] -->
275
+
276
+ <tr><td><h4>You order can not be delivered. Items out of stock</h4</td></tr>
277
+ <tr>
278
+ <td valign="top">
279
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
280
+ <p style="font-size:12px; line-height:16px; margin:0;">
281
+ Thank you for your order from {{var store.getFrontendName()}}.
282
+ Once your package ships we will send an email with a link to track your order.
283
+ You can check the status of your order by <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">logging into your account</a>.
284
+ If you have any questions about your order please contact us at <a href="mailto:{{config path=\'trans_email/ident_support/email\'}}" style="color:#1E7EC8;">{{config path=\'trans_email/ident_support/email\'}}</a> or call us at <span class="nobr">{{config path=\'general/store_information/phone\'}}</span> Monday - Friday, 8am - 5pm PST.
285
+ </p>
286
+ <p style="font-size:12px; line-height:16px; margin:0;">Your order confirmation is below. Thank you again for your business.</p>
287
+ </tr>
288
+ <tr>
289
+ <td>
290
+ <h2 style="font-size:18px; font-weight:normal; margin:0;">Your Order #{{var order.increment_id}} <small>(placed on {{var order.getCreatedAtFormated(\'long\')}})</small></h2>
291
+ </td>
292
+ </tr>
293
+ <tr>
294
+ <td>
295
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
296
+ <thead>
297
+ <tr>
298
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
299
+ <th width="10"></th>
300
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
301
+ </tr>
302
+ </thead>
303
+ <tbody>
304
+ <tr>
305
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
306
+ {{var order.getBillingAddress().format(\'html\')}}
307
+ </td>
308
+ <td>&nbsp;</td>
309
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
310
+ {{var payment_html}}
311
+ </td>
312
+ </tr>
313
+ </tbody>
314
+ </table>
315
+ <br/>
316
+ {{depend order.getIsNotVirtual()}}
317
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
318
+ <thead>
319
+ <tr>
320
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
321
+ <th width="10"></th>
322
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
323
+ </tr>
324
+ </thead>
325
+ <tbody>
326
+ <tr>
327
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
328
+ {{var order.getShippingAddress().format(\'html\')}}
329
+ &nbsp;
330
+ </td>
331
+ <td>&nbsp;</td>
332
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
333
+ {{var order.getShippingDescription()}}
334
+ &nbsp;
335
+ </td>
336
+ </tr>
337
+ </tbody>
338
+ </table>
339
+ <br/>
340
+ {{/depend}}
341
+ {{layout handle="sales_email_order_items" order=$order}}
342
+ <p style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p>
343
+ </td>
344
+ </tr>
345
+ <tr>
346
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
347
+ </tr>
348
+ </table>
349
+ </td>
350
+ </tr>
351
+ </table>
352
+ </div>
353
+ </body>
354
+ ';
355
+ $templateShipment = Mage::getModel('core/email_template');
356
+ $templateShipment->setTemplateCode('Order can not be delivered');
357
+ $templateShipment->setTemplateText($templateOrdernodelivered);
358
+ $templateShipment->setTemplateType(2);
359
+ $templateShipment->setTemplateSubject(' {{var store.getFrontendName()}}: Order can not be delivered # {{var order.increment_id}}');
360
+ $templateShipment->save();
361
+ $tem_id = $templateShipment->getId();
362
+ Mage::getModel('core/config')->saveConfig('mshop/parameters_not_in_stock/email_template', $tem_id);
363
+
364
+
365
+
366
+
367
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.7-2.0.8.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+
5
+ $installer->startSetup();
6
+
7
+ $templateOrderInvoiceCreate = '
8
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
9
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
10
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
11
+ <tr>
12
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
13
+ <!-- [ header starts here] -->
14
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
15
+ <tr>
16
+ <td valign="top"><a href="{{store url=""}}"><img src="{{skin url="images/logo_email.gif" _area=\'frontend\'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/></a></td>
17
+ </tr>
18
+ <!-- [ middle starts here] -->
19
+ <tr>
20
+ <td valign="top">
21
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$order.getCustomerName()}}</h1>
22
+ <p style="font-size:12px; line-height:16px; margin:0;">
23
+ Thank you for your order from {{var store.getFrontendName()}}.
24
+ You can check the status of your order by <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">logging into your account</a>.
25
+ If you have any questions about your order please contact us at <a href="mailto:{{config path=\'trans_email/ident_support/email\'}}" style="color:#1E7EC8;">{{config path=\'trans_email/ident_support/email\'}}</a> or call us at <span class="nobr">{{config path=\'general/store_information/phone\'}}</span> Monday - Friday, 8am - 5pm PST.
26
+ </p>
27
+ </td>
28
+ </tr>
29
+ <tr>
30
+ <td>
31
+ <h2 style="font-size:18px; font-weight:normal; margin:0;">Your Invoice #{{var invoice.increment_id}} for Order #{{var order.increment_id}}</h2>
32
+ <p>Mamut Invoice Id: {{var mamutInvoiceId}}</p>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td>
37
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
38
+ <thead>
39
+ <tr>
40
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
41
+ <th width="10"></th>
42
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
43
+ </tr>
44
+ </thead>
45
+ <tbody>
46
+ <tr>
47
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
48
+ {{var order.billing_address.format(\'html\')}}
49
+ </td>
50
+ <td>&nbsp;</td>
51
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
52
+ {{var payment_html}}
53
+ </td>
54
+ </tr>
55
+ </tbody>
56
+ </table>
57
+ <br/>
58
+ {{depend order.getIsNotVirtual()}}
59
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
60
+ <thead>
61
+ <tr>
62
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
63
+ <th width="10"></th>
64
+ <th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
65
+ </tr>
66
+ </thead>
67
+ <tbody>
68
+ <tr>
69
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
70
+ {{var order.shipping_address.format(\'html\')}}
71
+ &nbsp;
72
+ </td>
73
+ <td>&nbsp;</td>
74
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
75
+ {{var order.shipping_description}}&nbsp;
76
+ </td>
77
+ </tr>
78
+ </tbody>
79
+ </table>
80
+ <br/>
81
+ {{/depend}}
82
+ {{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}
83
+ <p style="font-size:12px; margin:0 10px 10px 0;">{{var comment}}</p>
84
+ </td>
85
+ </tr>
86
+ <tr>
87
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></strong></p></center></td>
88
+ </tr>
89
+ </table>
90
+ </td>
91
+ </tr>
92
+ </table>
93
+ </div>
94
+ </body>
95
+ ';
96
+ $templateShipment = Mage::getModel('core/email_template');
97
+ $templateShipment->setTemplateCode('New Invoice with Mamut Id');
98
+ $templateShipment->setTemplateText($templateOrderInvoiceCreate);
99
+ $templateShipment->setTemplateType(2);
100
+ $templateShipment->setTemplateSubject('{{var store.getFrontendName()}}: Invoice # {{var invoice.increment_id}} for Order # {{var order.increment_id}}');
101
+ $templateShipment->save();
102
+ $tem_id = $templateShipment->getId();
103
+ Mage::getModel('core/config')->saveConfig('mshop/parameters_invoice/email_template', $tem_id);
104
+
105
+
106
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.8-2.0.9.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.0.9-2.0.10.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.1.0-2.1.1.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $model = Mage::getModel('eav/entity_setup','core_setup');
8
+
9
+ $model->addAttribute('catalog_product', 'mamut_future_stock', array(
10
+ 'type' => 'varchar',
11
+ 'backend' => '',
12
+ 'frontend' => '',
13
+ 'label' => 'Mamut Future Stock',
14
+ 'input' => 'text',
15
+ 'class' => '',
16
+ 'source' => '',
17
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
18
+ 'visible' => false,
19
+ 'required' => false,
20
+ 'user_defined' => true,
21
+ 'default' => '',
22
+ 'searchable' => false,
23
+ 'filterable' => false,
24
+ 'comparable' => false,
25
+ 'visible_on_front' => false,
26
+ 'unique' => false,
27
+ 'apply_to' => '',
28
+ 'is_configurable' => false,
29
+ 'required' => false
30
+ ));
31
+
32
+
33
+ $attribute = $model->getAttribute('catalog_product','mamut_future_stock');
34
+ $attributeId = $attribute['attribute_id'];
35
+ $allAttributeSetIds = $model->getAllAttributeSetIds('catalog_product');
36
+ foreach ($allAttributeSetIds as $attributeSetId) {
37
+
38
+ try{
39
+ $attributeGroup = $model->getAttributeGroup('catalog_product',$attributeSetId,'General');
40
+ $attributeGroupId = $attributeGroup["attribute_group_id"];
41
+ //Zend_Debug::dump($attributeGroupId); exit();
42
+ }catch(Exception $e){
43
+ $attributeGroupId = $model->getDefaultAttributeGroupId('catalog_product',$attributeSetId);
44
+ }
45
+ $model->addAttributeToSet('catalog_product',$attributeSetId,$attributeGroupId,$attributeId, null);
46
+
47
+ }
48
+
49
+
50
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.1.1-2.1.2.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ $installer->run("ALTER TABLE {$this->getTable('catalog_product_entity_tier_price')} ADD tier_type INT NOT NULL AFTER qty;");
7
+
8
+ $installer->endSetup();
app/code/community/Ecomwise/Mshop/sql/mshop_setup/mysql4-upgrade-2.1.2-2.1.3.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ if (!$installer->tableExists($installer->getTable('ecomwise_settings_before_order'))){
7
+
8
+ $installer->run("
9
+ CREATE TABLE IF NOT EXISTS {$this->getTable('ecomwise_settings_before_order')} (
10
+ `order_id` int(11) NOT NULL default '0',
11
+ `including_tax` int(1) NOT NULL default '0',
12
+ UNIQUE KEY `key_ecomwise_settings_before_order` (`order_id`,`including_tax`)
13
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
14
+ ");
15
+ }
16
+
17
+
18
+ if ($installer->tableExists($installer->getTable('experius_settings_before_order')) && $installer->tableExists($installer->getTable('ecomwise_settings_before_order'))) {
19
+
20
+ $installer->run("INSERT INTO {$this->getTable('ecomwise_settings_before_order')} (`order_id`, `including_tax`) SELECT `order_id`, `including_tax` FROM {$this->getTable('experius_settings_before_order')};");
21
+
22
+ }
23
+
24
+ $installer->endSetup();
app/design/adminhtml/default/default/template/catalog/product/edit/price/tier_plus.phtml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ /* @var $this Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier */
27
+ ?>
28
+ <?php $_htmlId = $this->getElement()->getHtmlId() ?>
29
+ <?php $_htmlClass = $this->getElement()->getClass() ?>
30
+ <?php $_htmlName = $this->getElement()->getName() ?>
31
+ <?php $_readonly = $this->getElement()->getReadonly() ?>
32
+ <?php $_showWebsite = $this->isShowWebsiteColumn(); ?>
33
+ <?php $_editWebsite = $this->isAllowChangeWebsite(); ?>
34
+ <?php $_priceValueValidation = $this->getPriceValidation('validate-greater-than-zero'); ?>
35
+
36
+ <?php //die("tem");?>
37
+ <?php $_showWebsite = $this->isShowWebsiteColumn(); ?>
38
+ <?php $_showWebsite= $this->isMultiWebsites(); ?>
39
+ <tr>
40
+ <td class="label"><?php echo $this->getElement()->getLabel() ?></td>
41
+ <td colspan="10" class="grid tier">
42
+ <table cellspacing="0" class="data border" id="tiers_table" style="width:520px;">
43
+ <?php if ($_showWebsite): ?>
44
+ <col width="135" />
45
+ <?php endif; ?>
46
+ <col width="120" />
47
+ <col width="95" />
48
+ <col />
49
+ <col width="1" />
50
+ <thead>
51
+ <tr class="headings">
52
+ <th <?php if (!$_showWebsite): ?>style="display:none"<?php endif; ?>><?php echo Mage::helper('sales')->__('Website') ?></th>
53
+ <th><?php echo Mage::helper('catalog')->__('Customer Group') ?></th>
54
+ <th><?php echo Mage::helper('catalog')->__('Qty') ?></th>
55
+ <th><?php echo Mage::helper('catalog')->__('Type') ?></th>
56
+ <th><?php echo $this->getPriceColumnHeader(Mage::helper('catalog')->__('Price')) ?></th>
57
+ <th class="last"><?php echo Mage::helper('catalog')->__('Action') ?></th>
58
+ </tr>
59
+ </thead>
60
+ <tbody id="<?php echo $_htmlId ?>_container"></tbody>
61
+ <tfoot>
62
+ <tr>
63
+ <td <?php if (!$_showWebsite): ?>style="display:none"<?php endif; ?>></td>
64
+ <td colspan="5" class="a-right"><?php echo $this->getAddButtonHtml() ?></td>
65
+ </tr>
66
+ </tfoot>
67
+ </table>
68
+
69
+ <script type="text/javascript">
70
+ //<![CDATA[
71
+ var tierPriceRowTemplate = '<tr>'
72
+ + '<td<?php if (!$_showWebsite): ?> style="display:none"<?php endif; ?>>'
73
+ + '<select class="<?php echo $_htmlClass ?> required-entry" name="<?php echo $_htmlName ?>[{{index}}][website_id]" id="tier_price_row_{{index}}_website">'
74
+ <?php foreach ($this->getWebsites() as $_websiteId => $_info): ?>
75
+ + '<option value="<?php echo $_websiteId ?>"><?php echo $this->jsQuoteEscape($this->htmlEscape($_info['name'])) ?><?php if (!empty($_info['currency'])): ?> [<?php echo $this->htmlEscape($_info['currency']) ?>]<?php endif; ?></option>'
76
+ <?php endforeach ?>
77
+ + '</select></td>'
78
+ + '<td><select class="<?php echo $_htmlClass ?> custgroup required-entry" name="<?php echo $_htmlName ?>[{{index}}][cust_group]" id="tier_price_row_{{index}}_cust_group">'
79
+ <?php foreach ($this->getCustomerGroups() as $_groupId=>$_groupName): ?>
80
+ + '<option value="<?php echo $_groupId ?>"><?php echo $this->jsQuoteEscape($this->htmlEscape($_groupName)) ?></option>'
81
+ <?php endforeach ?>
82
+ + '</select></td>'
83
+ + '<td class="nobr"><input class="<?php echo $_htmlClass ?> qty required-entry validate-greater-than-zero" type="text" name="<?php echo $_htmlName ?>[{{index}}][price_qty]" value="{{qty}}" id="tier_price_row_{{index}}_qty" />'
84
+ + ' <small class="nobr"><?php echo Mage::helper("catalog")->__("and above")?></small></td>'
85
+
86
+ + '<td class="nobr">'
87
+ +'<select class="<?php echo $_htmlClass ?> tiertype required-entry" name="<?php echo $_htmlName ?>[{{index}}][tier_type]" id="tier_price_row_{{index}}_tier_type" >'
88
+ +'<option value="0">Fixed</option><option value="1">% Off</option></select></td>'
89
+
90
+ + '<td><input class="<?php echo $_htmlClass ?> required-entry <?php echo $_priceValueValidation ?>" type="text" name="<?php echo $_htmlName ?>[{{index}}][price]" value="{{price}}" id="tier_price_row_{{index}}_price" /></td>'
91
+ + '<td class="last"><input type="hidden" name="<?php echo $_htmlName ?>[{{index}}][delete]" class="delete" value="" id="tier_price_row_{{index}}_delete" />'
92
+ + '<button title="<?php echo Mage::helper("catalog")->__("Delete Tier") ?>" type="button" class="scalable delete icon-btn delete-product-option" id="tier_price_row_{{index}}_delete_button" onclick="return tierPriceControl.deleteItem(event);">'
93
+ + '<span><?php echo Mage::helper("catalog")->__("Delete") ?></span></button></td>'
94
+ + '</tr>';
95
+
96
+ var tierPriceControl = {
97
+ template: new Template(tierPriceRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', "")),
98
+ itemsCount: 0,
99
+ addItem : function () {
100
+ <?php if ($_readonly): ?>
101
+ if (arguments.length < 4) {
102
+ return;
103
+ }
104
+ <?php endif; ?>
105
+ var data = {
106
+ website_id: '<?php echo $this->getDefaultWebsite() ?>',
107
+ group: '<?php echo $this->getDefaultCustomerGroup() ?>',
108
+ qty: '',
109
+ price: '',
110
+ readOnly: false,
111
+ index: this.itemsCount++
112
+ };
113
+ //alert(arguments[5]);
114
+ if(arguments.length >= 4) {
115
+ data.website_id = arguments[0];
116
+ data.group = arguments[1];
117
+ data.qty = arguments[2];
118
+ data.price = arguments[3];
119
+ data.tier_type = arguments[5];
120
+
121
+
122
+ }
123
+ if (arguments.length == 6) {
124
+ data.readOnly = arguments[4];
125
+ }
126
+
127
+ Element.insert($('<?php echo $_htmlId ?>_container'), {
128
+ bottom : this.template.evaluate(data)
129
+ });
130
+
131
+ $('tier_price_row_' + data.index + '_cust_group').value = data.group;
132
+ $('tier_price_row_' + data.index + '_website').value = data.website_id;
133
+ $('tier_price_row_'+data.index+'_tier_type').value = data.tier_type;
134
+
135
+ <?php if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()):?>
136
+ var wss = $('tier_price_row_' + data.index + '_website');
137
+ var txt = wss.options[wss.selectedIndex].text;
138
+
139
+ wss.insert({after:'<span class="website-name">' + txt + '</span>'});
140
+ wss.hide();
141
+ <?php endif;?>
142
+
143
+ if (data.readOnly == '1') {
144
+ ['website', 'cust_group', 'qty', 'price', 'delete'].each(function(idx){
145
+ $('tier_price_row_'+data.index+'_'+idx).disabled = true;
146
+ });
147
+ $('tier_price_row_'+data.index+'_delete_button').hide();
148
+ }
149
+
150
+ <?php if ($_readonly): ?>
151
+ $('<?php echo $_htmlId ?>_container').select('input', 'select').each(this.disableElement);
152
+ $('<?php echo $_htmlId ?>_container').up('table').select('button').each(this.disableElement);
153
+ <?php else: ?>
154
+ $('<?php echo $_htmlId ?>_container').select('input', 'select').each(function(el){ Event.observe(el, 'change', el.setHasChanges.bind(el)); });
155
+ <?php endif; ?>
156
+ },
157
+ disableElement: function(el) {
158
+ el.disabled = true;
159
+ el.addClassName('disabled');
160
+ },
161
+ deleteItem: function(event) {
162
+ var tr = Event.findElement(event, 'tr');
163
+ if (tr) {
164
+ Element.select(tr, '.delete').each(function(elem){elem.value='1'});
165
+ Element.select(tr, ['input', 'select']).each(function(elem){elem.hide()});
166
+ Element.hide(tr);
167
+ Element.addClassName(tr, 'no-display template');
168
+ }
169
+ return false;
170
+ }
171
+ };
172
+ <?php foreach ($this->getValues() as $_item): ?>
173
+ tierPriceControl.addItem('<?php echo $_item['website_id'] ?>', '<?php echo $_item['cust_group'] ?>', '<?php echo $_item['price_qty']*1 ?>', '<?php echo sprintf('%.2f', $_item['price']) ?>', <?php echo (int)!empty($_item['readonly'])?>,'<?php echo $_item['tier_type'] ?>');
174
+ <?php endforeach; ?>
175
+ <?php if ($_readonly): ?>
176
+ $('<?php echo $_htmlId ?>_container').up('table').select('button')
177
+ .each(tierPriceControl.disableElement);
178
+ <?php endif; ?>
179
+ //]]>
180
+ </script>
181
+ </td></tr>
182
+
app/design/adminhtml/default/default/template/catalog/product/tab/inventory_plus.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="entry-edit form-list">
2
+ <div class="entry-edit-head">
3
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Mamut') ?></h4>
4
+
5
+ </div>
6
+ <fieldset>
7
+ <table>
8
+ <?php if(Mage::getStoreConfig("mshop/mamut_stock/show_fields") == "1"){?>
9
+ <tr>
10
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Warehouse 1') ?></label></td>
11
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store1" name="<?php echo $this->getFieldSuffix() ?>[stock_data][mamut_store1]" value="<?php echo $this->getFieldValue('mamut_store1') ?>" <?php //echo $_readonly;?> />
12
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
13
+ </tr>
14
+ <tr>
15
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Warehouse 2') ?></label></td>
16
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store2" name="<?php echo $this->getFieldSuffix() ?>[stock_data][mamut_store2]" value="<?php echo $this->getFieldValue('mamut_store2') ?>" <?php //echo $_readonly;?> />
17
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
18
+ </tr>
19
+ <tr>
20
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Warehouse 3') ?></label></td>
21
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store1" name="<?php echo $this->getFieldSuffix() ?>[stock_data][mamut_store3]" value="<?php echo $this->getFieldValue('mamut_store3') ?>" <?php //echo $_readonly;?> />
22
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
23
+ </tr>
24
+ <tr>
25
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Warehouse 4') ?></label></td>
26
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store1" name="<?php echo $this->getFieldSuffix() ?>[stock_data][mamut_store4]" value="<?php echo $this->getFieldValue('mamut_store4') ?>" <?php //echo $_readonly;?> />
27
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
28
+ </tr>
29
+ <tr>
30
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Warehouse 5') ?></label></td>
31
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store1" name="<?php echo $this->getFieldSuffix() ?>[stock_data][mamut_store5]" value="<?php echo $this->getFieldValue('mamut_store5') ?>" <?php //echo $_readonly;?> />
32
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
33
+ </tr>
34
+ <?php }?>
35
+ <tr>
36
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('Next delivery date') ?></label></td>
37
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store1" name="<?php echo $this->getFieldSuffix() ?>[stock_data][mamut_nextdeliverydate]" value="<?php echo $this->getFieldValue('mamut_nextdeliverydate') ?>" <?php //echo $_readonly;?> />
38
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
39
+ </tr>
40
+ <tr>
41
+ <td class="label"><label for="inventory_max_sale_qty"><?php echo Mage::helper('catalog')->__('From suppliers') ?></label></td>
42
+ <td class="value"><input type="text" class="input-text" id="inventory_mamut_store1" name="<?php echo $this->getFieldSuffix() ?>[mamut_future_stock]" value="<?php echo $this->getProduct()->getMamutFutureStock()?>" <?php //echo $_readonly;?> />
43
+ <td class="value scope-label"><?php echo Mage::helper('catalog')->__('[GLOBAL]') ?></td>
44
+ </tr>
45
+
46
+ </table>
47
+ </fieldset>
48
+ </div>
app/etc/modules/Ecomwise_Mshop.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Ecomwise_Mshop>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Ecomwise_Mshop>
8
+ </modules>
9
+ </config>
10
+
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ecomwise_Mshop</name>
4
+ <version>2.1.3</version>
5
+ <stability>stable</stability>
6
+ <license>OSL-3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Ecomwise MshopB2C</summary>
10
+ <description>Ecomwise MshopB2C</description>
11
+ <notes>2.1.3</notes>
12
+ <authors><author><name>EcomwiseTeam</name><user>Ecomwise</user><email>info@ecomwise.com</email></author></authors>
13
+ <date>2013-03-21</date>
14
+ <time>13:12:30</time>
15
+ <contents><target name="magecommunity"><dir><dir name="Ecomwise"><dir name="Mshop"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><dir name="Tab"><file name="Rolesedit.php" hash="0f8acf74402c0a62f57c031df6b993cf"/></dir></dir><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Inventory.php" hash="8e8676f50037234423f150bb383a3882"/></dir><file name="Tabs.php" hash="d401d2bfdcc1b26da8536b3d157c68e9"/></dir><dir name="Price"><file name="Tier.php" hash="c7197ab1b8de7fe889e7031d63b20d7d"/></dir></dir></dir><dir name="Sales"><dir name="Invoice"><file name="View.php" hash="e6aabb38936a8e74506da7ace4cda448"/></dir></dir></dir><dir name="Product"><file name="Price.php" hash="bc7a900a85e19af3632782c4bf06f15f"/></dir><dir name="System"><dir name="Config"><file name="Version.php" hash="4d69bb243bfdbf708fafec7f9f15298b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="08367e6760f1bb4db6b2c4eee2230266"/><file name="Product.php" hash="d0192aa47c1c3096aa50168b5be12473"/></dir><dir name="Model"><dir name="Api"><dir name="Server"><dir name="Adapter"><file name="Soap.php" hash="776fb22407850b6ee5fc4fb633f8ea35"/></dir><dir name="V2"><dir name="Adapter"><file name="Soap.php" hash="2db778fc8224c3c627f4f041c1477d60"/></dir></dir></dir></dir><dir name="Catalog"><dir name="Api"><file name="V2.php" hash="9c15dc191f7206379697f4f57cf03f97"/></dir><file name="Api.php" hash="88c7d276fd9d84d650feef4e851a6932"/><dir name="Attribute"><dir name="Api"><file name="V2.php" hash="02bc92ce7199f115ddd01961d8d868fe"/></dir><file name="Api.php" hash="22be30d5a4d8684d99b27b074b05e940"/><file name="Tierprice.php" hash="e14e0d2a024d5f0be62d5a21b40e0f7f"/></dir><dir name="Category"><dir name="Api"><file name="V2.php" hash="8671062db01fe6b20830fbd3566881cb"/></dir><file name="Api.php" hash="86854b4ad75e78a5c967856bed196bef"/></dir><dir name="Product"><dir name="Api"><file name="V2.php" hash="0fea93a819c5cd14caff543240720981"/></dir><dir name="Type"><file name="Price.php" hash="ff260726ec9289d954d8be9cc4385ee8"/></dir></dir></dir><dir name="Config"><dir name="Source"><file name="Orderattributes.php" hash="348fa8ffd616343e25a9c3a0e3714087"/></dir></dir><dir name="Customer"><dir name="Api"><file name="V2.php" hash="83bdf89c8ad3d3c80c464e6a7f8db5a8"/></dir></dir><file name="Observer.php" hash="ad0416815e864c7a212df79764cbcde6"/><dir name="Resource"><dir name="Eav"><file name="Tierprice.php" hash="d2064c4504c061877411df1c20361764"/></dir></dir><dir name="Sales"><dir name="Api"><file name="V2.php" hash="7967d7bb18bd3b9dbaf5f2dee77092e6"/></dir></dir><dir name="System"><dir name="Config"><file name="Apply.php" hash="8681be62d6e2d50dc4740bcd7ace6efc"/></dir></dir><dir name="Utility"><dir name="Api"><file name="V2.php" hash="495617b7faa546658328c3fe2c2999a1"/></dir><file name="Api.php" hash="45eb21a1480ee497dbbc25367d6edf62"/></dir></dir><dir name="etc"><file name="api.xml" hash="3727d57a816395847f0779cef7f5b205"/><file name="config.xml" hash="79c98c7f0f2a2354f1bfcfb57a66a53d"/><file name="system.xml" hash="faada22f142bfead1588a7854d0e7a39"/><file name="wsdl.xml" hash="879837a7d8facb178e9c8c94bbb6534c"/></dir><dir name="sql"><dir name="mshop_setup"><file name="mysql4-install-2.0.1.php" hash="f66653bb491d06f9a7199639478115cd"/><file name="mysql4-upgrade-2.0.10-2.1.0.php" hash="1ff9741ac551c063b47a6cdb24632055"/><file name="mysql4-upgrade-2.0.3-2.0.4.php" hash="df2053466dca236890928091b17b1019"/><file name="mysql4-upgrade-2.0.4-2.0.5.php" hash="80d414d61e6f01d8dcad3c0238434863"/><file name="mysql4-upgrade-2.0.5-2.0.6.php" hash="80d414d61e6f01d8dcad3c0238434863"/><file name="mysql4-upgrade-2.0.6-2.0.7.php" hash="acaef76db734d23928d1b08e965521a5"/><file name="mysql4-upgrade-2.0.7-2.0.8.php" hash="fbf37c994dc9c923a4926149ec9cbd3c"/><file name="mysql4-upgrade-2.0.8-2.0.9.php" hash="80d414d61e6f01d8dcad3c0238434863"/><file name="mysql4-upgrade-2.0.9-2.0.10.php" hash="80d414d61e6f01d8dcad3c0238434863"/><file name="mysql4-upgrade-2.1.0-2.1.1.php" hash="0b82b518603c7808652c4dc2095f6645"/><file name="mysql4-upgrade-2.1.1-2.1.2.php" hash="b773968fe0a9420d96aa8495e58dee4d"/><file name="mysql4-upgrade-2.1.2-2.1.3.php" hash="b0ff9de67587ece2a39fd3c8fa6027e0"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Ecomwise_Mshop.xml" hash="2656a81e8de9042800ea5645f8638318"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="catalog"><dir name="product"><dir name="tab"><file name="inventory_plus.phtml" hash="35d259f1e1ccc26081c4dccd19f4e5ee"/></dir><dir name="edit"><dir name="price"><file name="tier_plus.phtml" hash="b69079e234ac3250ae2e170c129cf1b7"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>5.4.8</max></php></required></dependencies>
18
+ </package>