Iweb_Dropshipper - Version 1.0.3

Version Notes

This Module is used to assign item to dropshipper.When order get Placed then admin can send Dropshipper mail from admin or can send mail automatically by selecting option from admin To Notify Dropshipper That Your item has been Placed with Shiping Info.

Download this release

Release Info

Developer sujit
Extension Iweb_Dropshipper
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/local/Iweb/Dropshipper/Block/Adminhtml/Dropshipper/Edit/Tab/Product.php CHANGED
@@ -193,7 +193,7 @@ class Iweb_Dropshipper_Block_Adminhtml_Dropshipper_Edit_Tab_Product extends Mage
193
  if(Mage::registry('dropshipper_data')->getDshipper_id()){
194
  $products = Mage::getModel('catalog/product')->getCollection();
195
  $dshipper_id = Mage::registry('dropshipper_data')->getDshipper_id();
196
- $products->addAttributeToFilter('visibility',array('neq'=>1));
197
  $products->getSelect()
198
  ->join(
199
  array('dshipproduct'=> $products->getTable('iweb_dropshipper/product')),
193
  if(Mage::registry('dropshipper_data')->getDshipper_id()){
194
  $products = Mage::getModel('catalog/product')->getCollection();
195
  $dshipper_id = Mage::registry('dropshipper_data')->getDshipper_id();
196
+ //$products->addAttributeToFilter('visibility',array('neq'=>1));
197
  $products->getSelect()
198
  ->join(
199
  array('dshipproduct'=> $products->getTable('iweb_dropshipper/product')),
app/code/local/Iweb/Dropshipper/Model/Product.php CHANGED
@@ -24,7 +24,7 @@ class Iweb_Dropshipper_Model_Product extends Mage_Core_Model_Abstract
24
 
25
  public function updateProducts($object)
26
  {
27
- $productData = $object['update_data'];
28
 
29
  $newProductArray = array();
30
  foreach($productData as $key=>$value)
24
 
25
  public function updateProducts($object)
26
  {
27
+ $productData = $object['update_data'];
28
 
29
  $newProductArray = array();
30
  foreach($productData as $key=>$value)
app/code/local/Iweb/Dropshipper/Model/Resource/Product.php CHANGED
@@ -15,11 +15,11 @@ class Iweb_Dropshipper_Model_Resource_Product extends Mage_Core_Model_Resource_D
15
  }
16
 
17
  public function saveProductRelations($dropshipper)
18
- {
19
  $productTable = $this->getTable('iweb_dropshipper/product');
20
  $readAdapter = $this->_getReadAdapter();
21
  $writeAdapter = $this->_getWriteAdapter();
22
- $products = array_keys($dropshipper->getProducts());
23
  $dropshipper_Id = $dropshipper->getDshipperId();
24
 
25
  $select = $readAdapter->select()
@@ -40,7 +40,7 @@ class Iweb_Dropshipper_Model_Resource_Product extends Mage_Core_Model_Resource_D
40
  )
41
  );
42
  }
43
-
44
  foreach($products as $key=>$productId){
45
  $data = array();
46
  $data['product_id'] = $productId;
15
  }
16
 
17
  public function saveProductRelations($dropshipper)
18
+ {
19
  $productTable = $this->getTable('iweb_dropshipper/product');
20
  $readAdapter = $this->_getReadAdapter();
21
  $writeAdapter = $this->_getWriteAdapter();
22
+ $products = array_keys($dropshipper->getProducts());
23
  $dropshipper_Id = $dropshipper->getDshipperId();
24
 
25
  $select = $readAdapter->select()
40
  )
41
  );
42
  }
43
+
44
  foreach($products as $key=>$productId){
45
  $data = array();
46
  $data['product_id'] = $productId;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iweb_Dropshipper</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -11,9 +11,9 @@
11
  <description>This Module is used to assign item to dropshipper.When order get Placed then admin can send Dropshipper mail from admin or can send mail automatically by selecting option from admin To Notify Dropshipper That Your item has been Placed with Shiping Info.</description>
12
  <notes>This Module is used to assign item to dropshipper.When order get Placed then admin can send Dropshipper mail from admin or can send mail automatically by selecting option from admin To Notify Dropshipper That Your item has been Placed with Shiping Info.</notes>
13
  <authors><author><name>sujit</name><user>suju</user><email>suju.eathen@gmail.com</email></author></authors>
14
- <date>2013-02-21</date>
15
- <time>05:01:38</time>
16
- <contents><target name="magelocal"><dir name="Iweb"><dir name="Dropshipper"><dir name="Block"><dir name="Adminhtml"><dir name="Dropshipper"><dir name="Edit"><file name="Form.php" hash="d5333bb2a2896e68ffc4f4cacd180872"/><dir name="Tab"><dir name="Ajax"><file name="Serializer.php" hash="bdfba8d7ad8458b81b982d159919146e"/></dir><file name="Form.php" hash="59c8949525251707ca7b47d2dc4b55c6"/><file name="Product.php" hash="2c45adfeb68cb57ec493e5264d0e78e6"/></dir><file name="Tabs.php" hash="d0adb69b2e2dd702d42afc57a3d3bdaa"/></dir><file name="Edit.php" hash="8733ea1b1a17f1143654339c92270cc4"/><file name="Grid.php" hash="2f3563fe6b996ed4f619fdd88435366c"/></dir><file name="Dropshipper.php" hash="d636b813af7e6908af23ff04f190c018"/><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Dropshipper.php" hash="14b0fe511aca4493b027d33b683a396f"/></dir></dir></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Input.php" hash="a4911063350ff29c147ec2428c239345"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2be35e7b90c61aa3f05cf7adf6d962f7"/></dir><dir name="Model"><file name="Dropshipper.php" hash="1ce8c732f21ceb47b4983e508e7237f8"/><file name="Observer.php" hash="4796fa37b2d20e5494313572a699ffa0"/><file name="Order.php" hash="cd0efb5e1ec2027c6ddce51e60fc28b6"/><file name="Product.php" hash="b38dbe6de7ba342df04d93ed4b652a59"/><dir name="Resource"><dir name="Dropshipper"><file name="Collection.php" hash="f0bb7c5b943c98aeee9f646986cf3d69"/></dir><file name="Dropshipper.php" hash="1af40dcf4a00b1cdc14d2c68749e56c0"/><dir name="Order"><file name="Collection.php" hash="c9cb7843803e4cb0afee9d84b4bab3c5"/></dir><file name="Order.php" hash="606ef1913c3175d9a37c394f2e71ebcd"/><dir name="Product"><file name="Collection.php" hash="624a31554a2524d89755dac35ccfc893"/></dir><file name="Product.php" hash="849e9e96c2aef1dea2d1db87a60a187f"/></dir><file name="Status.php" hash="18190728774bb2a8393b6c182c5e8eba"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Order"><file name="Status.php" hash="a0d85b2608aabdc2fc7905ed495a90c5"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DropshipperController.php" hash="d60f2f595bf8d841b5e574a51afd6d26"/><file name="OrderController.php" hash="d73ee8b8d1708290a92de4af0181695f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b14023d52b784736530a120e2563fcb8"/><file name="config.xml" hash="3c12ca1c8d01291da73c0629602e8739"/><file name="system.xml" hash="83b3a5a5c28cf87135090b68d3525abf"/></dir><dir name="sql"><dir name="iweb_dropshipper_setup"><file name="mysql4-install-0.0.1.php" hash="e2d96f5418f09c585a29b78ce55aad4a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iweb-dropshipper.xml" hash="b13f7eee642b333512d73f8a2c84ad0c"/></dir><dir name="template"><dir name="dropshipper"><dir name="order"><dir name="view"><file name="products.phtml" hash="25d8ed0fcf512392631314319716519f"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="iweb-dropshipper.xml" hash="95d7163435c2feb6c7f97ad4e960131c"/></dir><dir name="template"><dir name="dropshipper"><dir name="email"><dir name="items"><file name="default.phtml" hash="49202c1db999a69f7fc8355e4e472ed6"/></dir><file name="items.phtml" hash="34493bbe93b09320d4ec5d5862699ed0"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="app"><dir name="locale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sales"><file name="dropshipper.html" hash="41b6dad744c8262b7e7b41c62442e4f5"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iweb_Dropshipper.xml" hash="e3101a7068e78578ebc14b27cee5ced2"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Iweb_Dropshipper</name><channel>community</channel><min>1.5</min><max>1.7</max></package></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iweb_Dropshipper</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
11
  <description>This Module is used to assign item to dropshipper.When order get Placed then admin can send Dropshipper mail from admin or can send mail automatically by selecting option from admin To Notify Dropshipper That Your item has been Placed with Shiping Info.</description>
12
  <notes>This Module is used to assign item to dropshipper.When order get Placed then admin can send Dropshipper mail from admin or can send mail automatically by selecting option from admin To Notify Dropshipper That Your item has been Placed with Shiping Info.</notes>
13
  <authors><author><name>sujit</name><user>suju</user><email>suju.eathen@gmail.com</email></author></authors>
14
+ <date>2013-04-02</date>
15
+ <time>19:34:22</time>
16
+ <contents><target name="magelocal"><dir name="Iweb"><dir name="Dropshipper"><dir name="Block"><dir name="Adminhtml"><dir name="Dropshipper"><dir name="Edit"><file name="Form.php" hash="d5333bb2a2896e68ffc4f4cacd180872"/><dir name="Tab"><dir name="Ajax"><file name="Serializer.php" hash="bdfba8d7ad8458b81b982d159919146e"/></dir><file name="Form.php" hash="59c8949525251707ca7b47d2dc4b55c6"/><file name="Product.php" hash="8a997663ce6ac8948b87bc861c6b267a"/></dir><file name="Tabs.php" hash="d0adb69b2e2dd702d42afc57a3d3bdaa"/></dir><file name="Edit.php" hash="8733ea1b1a17f1143654339c92270cc4"/><file name="Grid.php" hash="2f3563fe6b996ed4f619fdd88435366c"/></dir><file name="Dropshipper.php" hash="d636b813af7e6908af23ff04f190c018"/><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Dropshipper.php" hash="14b0fe511aca4493b027d33b683a396f"/></dir></dir></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Input.php" hash="a4911063350ff29c147ec2428c239345"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2be35e7b90c61aa3f05cf7adf6d962f7"/></dir><dir name="Model"><file name="Dropshipper.php" hash="1ce8c732f21ceb47b4983e508e7237f8"/><file name="Observer.php" hash="4796fa37b2d20e5494313572a699ffa0"/><file name="Order.php" hash="cd0efb5e1ec2027c6ddce51e60fc28b6"/><file name="Product.php" hash="e286618a564b1d8f3268e2bfda71e338"/><dir name="Resource"><dir name="Dropshipper"><file name="Collection.php" hash="f0bb7c5b943c98aeee9f646986cf3d69"/></dir><file name="Dropshipper.php" hash="1af40dcf4a00b1cdc14d2c68749e56c0"/><dir name="Order"><file name="Collection.php" hash="c9cb7843803e4cb0afee9d84b4bab3c5"/></dir><file name="Order.php" hash="606ef1913c3175d9a37c394f2e71ebcd"/><dir name="Product"><file name="Collection.php" hash="624a31554a2524d89755dac35ccfc893"/></dir><file name="Product.php" hash="c1e03b1fcc68f531439487a7eff47a01"/></dir><file name="Status.php" hash="18190728774bb2a8393b6c182c5e8eba"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Order"><file name="Status.php" hash="a0d85b2608aabdc2fc7905ed495a90c5"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DropshipperController.php" hash="d60f2f595bf8d841b5e574a51afd6d26"/><file name="OrderController.php" hash="d73ee8b8d1708290a92de4af0181695f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b14023d52b784736530a120e2563fcb8"/><file name="config.xml" hash="3c12ca1c8d01291da73c0629602e8739"/><file name="system.xml" hash="83b3a5a5c28cf87135090b68d3525abf"/></dir><dir name="sql"><dir name="iweb_dropshipper_setup"><file name="mysql4-install-0.0.1.php" hash="e2d96f5418f09c585a29b78ce55aad4a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iweb-dropshipper.xml" hash="b13f7eee642b333512d73f8a2c84ad0c"/></dir><dir name="template"><dir name="dropshipper"><dir name="order"><dir name="view"><file name="products.phtml" hash="25d8ed0fcf512392631314319716519f"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="iweb-dropshipper.xml" hash="95d7163435c2feb6c7f97ad4e960131c"/></dir><dir name="template"><dir name="dropshipper"><dir name="email"><dir name="items"><file name="default.phtml" hash="49202c1db999a69f7fc8355e4e472ed6"/></dir><file name="items.phtml" hash="34493bbe93b09320d4ec5d5862699ed0"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="app"><dir name="locale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sales"><file name="dropshipper.html" hash="41b6dad744c8262b7e7b41c62442e4f5"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iweb_Dropshipper.xml" hash="e3101a7068e78578ebc14b27cee5ced2"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="dropshipper"><file name="product.js" hash="6f5cb3e4418c9fe3e9ca1daa3190b896"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Iweb_Dropshipper</name><channel>community</channel><min>1.5</min><max>1.7</max></package></required></dependencies>
19
  </package>
skin/adminhtml/default/default/dropshipper/product.js ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var productLinksController = Class.create();
2
+
3
+ productLinksController.prototype = {
4
+ initialize : function(fieldId, products, grid) {
5
+ this.saveField = $(fieldId);
6
+ this.saveFieldId = fieldId;
7
+ this.products = $H(products);
8
+ this.grid = grid;
9
+ this.tabIndex = 1000;
10
+ this.grid.rowClickCallback = this.rowClick.bind(this);
11
+ this.grid.initRowCallback = this.rowInit.bind(this);
12
+ this.grid.checkboxCheckCallback = this.registerProduct.bind(this);
13
+ this.grid.rows.each(this.eachRow.bind(this));
14
+ this.saveField.value = this.serializeObject(this.products);
15
+ this.grid.reloadParams = {'products[]':this.products.keys()};
16
+
17
+ },
18
+ eachRow : function(row) {
19
+ this.rowInit(this.grid, row);
20
+ },
21
+ registerProduct : function(grid, element, checked) {
22
+
23
+ if(checked){
24
+ //For Position
25
+ if(element.inputElements) {
26
+ this.products.set(element.value, {});
27
+ for(var i = 0; i < element.inputElements.length; i++) {
28
+ element.inputElements[i].disabled = false;
29
+ this.products.get(element.value)[element.inputElements[i].name] = element.inputElements[i].value;
30
+ }
31
+ }
32
+ //For Comments
33
+ if(element.textareaElements) {
34
+ this.products.set(element.value, {});
35
+ for(var i = 0; i < element.textareaElements.length; i++) {
36
+ element.textareaElements[i].disabled = false;
37
+ this.products.get(element.value)[element.textareaElements[i].name] = element.textareaElements[i].value;
38
+ }
39
+ }
40
+ }
41
+ else{
42
+ //For Position
43
+ if(element.inputElements){
44
+ for(var i = 0; i < element.inputElements.length; i++) {
45
+ element.inputElements[i].disabled = true;
46
+ }
47
+ }
48
+ //For Comments
49
+ if(element.textareaElements){
50
+ for(var i = 0; i < element.textareaElements.length; i++) {
51
+ element.textareaElements[i].disabled = true;
52
+ }
53
+ }
54
+ this.products.unset(element.value);
55
+ }
56
+ this.saveField.value = this.serializeObject(this.products);
57
+ this.grid.reloadParams = {'products[]':this.products.keys()};
58
+ },
59
+ serializeObject : function(hash) {
60
+ var clone = hash.clone();
61
+ clone.each(function(pair) {
62
+ clone.set(pair.key, encode_base64(Object.toQueryString(pair.value)));
63
+ });
64
+ return clone.toQueryString();
65
+ },
66
+ rowClick : function(grid, event) {
67
+ var trElement = Event.findElement(event, 'tr');
68
+ var isInput = Event.element(event).tagName == 'INPUT';
69
+ var isTextarea = Event.element(event).tagName == 'TEXTAREA';
70
+
71
+ if(trElement){
72
+ var checkbox = Element.select(trElement, 'input');
73
+ if(checkbox[0]){
74
+ var checked = isInput || isTextarea ? checkbox[0].checked : !checkbox[0].checked;
75
+
76
+ this.grid.setCheckboxChecked(checkbox[0], checked);
77
+ }
78
+ }
79
+ },
80
+ inputChange : function(event) {
81
+ var element = Event.element(event);
82
+ if(element && element.checkboxElement && element.checkboxElement.checked){
83
+ this.products.get(element.checkboxElement.value)[element.name] = element.value;
84
+ this.saveField.value = this.serializeObject(this.products);
85
+ }
86
+ },
87
+ textareaChange : function(event) {
88
+ var element = Event.element(event);
89
+ if(element && element.checkboxElement && element.checkboxElement.checked){
90
+ this.products.get(element.checkboxElement.value)[element.name] = element.value;
91
+ this.saveField.value = this.serializeObject(this.products);
92
+ }
93
+ },
94
+ rowInit : function(grid, row) {
95
+ var checkbox = $(row).select('.checkbox')[0];
96
+ var inputs = $(row).select('.input-text');
97
+ var textareas = $(row).select('.input-textarea');
98
+
99
+ if(checkbox) {
100
+ //For Position
101
+ checkbox.inputElements = inputs;
102
+ for(var i = 0; i < inputs.length; i++) {
103
+ inputs[i].checkboxElement = checkbox;
104
+ if(this.products.get(checkbox.value) && this.products.get(checkbox.value)[inputs[i].name]) {
105
+ inputs[i].value = this.products.get(checkbox.value)[inputs[i].name];
106
+ }
107
+ inputs[i].disabled = !checkbox.checked;
108
+ inputs[i].tabIndex = this.tabIndex++;
109
+ Event.observe(inputs[i],'keyup', this.inputChange.bind(this));
110
+ Event.observe(inputs[i],'change', this.inputChange.bind(this));
111
+ }
112
+ // For Comments
113
+ checkbox.textareaElements = textareas;
114
+ for(var i = 0; i < textareas.length; i++) {
115
+ textareas[i].checkboxElement = checkbox;
116
+ if(this.products.get(checkbox.value) && this.products.get(checkbox.value)[textareas[i].name]) {
117
+ textareas[i].value = this.products.get(checkbox.value)[textareas[i].name];
118
+ }
119
+ textareas[i].disabled = !checkbox.checked;
120
+ textareas[i].tabIndex = this.tabIndex++;
121
+ Event.observe(textareas[i],'keyup', this.textareaChange.bind(this));
122
+ Event.observe(textareas[i],'change', this.textareaChange.bind(this));
123
+ }
124
+ }
125
+ }
126
+ };