A4s_Pricemotion - Version 1.0.7

Version Notes

Bump maximum Magento and PHP versions.

Download this release

Release Info

Developer Heimen
Extension A4s_Pricemotion
Version 1.0.7
Comparing to
See all releases


Code changes from version 0.2.17 to 1.0.7

app/code/local/A4s/Pricemotion/Model/Observer.php CHANGED
@@ -182,6 +182,19 @@ class A4s_Pricemotion_Model_Observer
182
  $rule_model->setData('only_email', $only_email);
183
  $rule_model->setData('status', $post_data['price_rules']);
184
  $rule_model->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  } elseif ($post['pricemotion']['price_rules'] == 0) {
186
  $rule_model = Mage::getModel('pricemotion/rules')->load($product->getId(), 'product_id');
187
  $rule_model->delete();
182
  $rule_model->setData('only_email', $only_email);
183
  $rule_model->setData('status', $post_data['price_rules']);
184
  $rule_model->save();
185
+
186
+ $resource = Mage::getSingleton('core/resource');
187
+ $conn = $resource->getConnection('core_write');
188
+ $stmt = $conn->prepare("
189
+ DELETE FROM `" . $resource->getTableName('pricemotion/rules') . "`
190
+ WHERE
191
+ product_id = :product_id
192
+ AND rule_id <> :rule_id
193
+ ");
194
+ $stmt->execute(array(
195
+ 'product_id' => $product->getId(),
196
+ 'rule_id' => $rule_model->getId(),
197
+ ));
198
  } elseif ($post['pricemotion']['price_rules'] == 0) {
199
  $rule_model = Mage::getModel('pricemotion/rules')->load($product->getId(), 'product_id');
200
  $rule_model->delete();
app/code/local/A4s/Pricemotion/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <A4s_Pricemotion>
5
- <version>0.2.17</version>
6
  </A4s_Pricemotion>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <A4s_Pricemotion>
5
+ <version>1.0.7</version>
6
  </A4s_Pricemotion>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>A4s_Pricemotion</name>
4
- <version>0.2.17</version>
5
  <stability>stable</stability>
6
  <license>GNU GPL v3.0</license>
7
  <channel>community</channel>
@@ -12,11 +12,171 @@
12
  Just open up a product in Magento and look at the Pricemotion tab. All prices of your competitors are there including the highest, lowest, average and median price. You can make decisions right away. &#xD;
13
  &#xD;
14
  You can also let the work be done for you. Just setup a pricerule and the prices are updated automatically four times a day. To be sure nothing goes wrong we have margin check so that you can trust your selling prices are not below your acquiring price and you make money. For those who don't trust automatic systems we can send you an email about that and leave the prices for you to set.</description>
15
- <notes>Percentage in productgrid no longer used.</notes>
16
- <authors><author><name>Heimen</name><user>pricemotion</user><email>heimen@pricemotion.nl</email></author></authors>
17
- <date>2014-12-09</date>
18
- <time>15:46:46</time>
19
- <contents><target name="magelocal"><dir name="A4s"><dir name="Pricemotion"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Action"><file name="Rules.php" hash="2ab2d7b2aec730e4180c214e4111c6d6"/></dir><file name="Grid.php" hash="efa1e9b5133e2f173bc478c29168fc80"/><file name="Pricerules.php" hash="cb8685c1f0de60337d52b86307f16dae"/><file name="Tab.php" hash="af00da1a6dff03d99390a48086572df4"/></dir></dir><dir name="Form"><dir name="Element"><file name="Errormsg.php" hash="67a6e14c48db851da3ce29dc636066ab"/><file name="Prices.php" hash="0a3b56aeee92427b954b3642b419b336"/></dir></dir></dir></dir><dir name="Helper"><dir name="Catalog"><dir name="Product"><file name="Action.php" hash="8126e50cf75eb79d8e2c8d2f077b6e7f"/></dir></dir><file name="Data.php" hash="848bf746991dadcb5fe7fe65bf60b3ee"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Rules"><file name="Collection.php" hash="422047623e90aeeaf3056aa735e5cf51"/></dir><file name="Rules.php" hash="de43a9a3bf018ff3dc88289b400cd959"/></dir><file name="Observer.php" hash="0d97115621cb6f38ce4c12dfa49c8e75"/><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="db37feaae0b61a2f1af2bf2f3bd0f620"/></dir></dir></dir><file name="Rules.php" hash="89cc7b2d19f18dca40bf53c3c35efcfd"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Product"><file name="Attributes.php" hash="d2e820f8b5888e1394e34b640738f1d9"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ActionController.php" hash="436f4b1f3f0f4c87313a5aaabf963f3a"/></dir></dir><dir name="etc"><file name="config.xml" hash="1891b83833bfcafaba307906d099efa7"/><file name="system.xml" hash="fdb0df916e543f61d61ec77b82563ca1"/></dir><dir name="sql"><dir name="pricemotion_setup"><file name="mysql4-install-0.1.0.php" hash="5d9857be43b775df5e801611aeede550"/><file name="mysql4-upgrade-0.2.10-0.2.11.php" hash="8c89afb7b2c3f5ba56ac39c8d0b72e67"/><file name="mysql4-upgrade-0.2.12-0.2.13.php" hash="579437094cfe6c059aa3c16a9d43bf3a"/><file name="mysql4-upgrade-0.2.16-0.2.17.php" hash="d9ded804a2fb6f7e6d377ad6a1961a2c"/><file name="mysql4-upgrade-0.2.8-0.2.9.php" hash="0d320ad04bd30316daa8b1994211af9a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pricemotion.xml" hash="b0b4f5f55155551c4523bfad0ac4dd28"/></dir><dir name="template"><dir name="pricemotion"><file name="mass_price_rules.phtml" hash="b1ca05a79f3a7e408445b4faa11e8a6b"/><file name="price_rules.phtml" hash="57470cb06e722e7344a5e51e87c37d08"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="pricemotion"><file name="report_items.phtml" hash="b4b4917387c60086aefc4f218071145a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="A4s_Pricemotion.xml" hash="8579f9f81887bdb95098fa360a783553"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Pricemotion.csv" hash="0ab8bfb05c1e3f7bdd26b84596432ac5"/><dir name="template"><dir name="email"><file name="pricemotion.html" hash="b1910a27cd87ee07612ed4cb89deca3b"/></dir></dir></dir><dir name="nl_NL"><file name="Pricemotion.csv" hash="a10d700e52dcd67029383e83b6b1da6a"/><dir name="template"><dir name="email"><file name="pricemotion.html" hash="c658c320679e50d67eb7a24239dd1d4e"/></dir></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  <compatible/>
21
- <dependencies><required><php><min>5.2.0</min><max>5.5.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0</min><max>1.9</max></package></required></dependencies>
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>A4s_Pricemotion</name>
4
+ <version>1.0.7</version>
5
  <stability>stable</stability>
6
  <license>GNU GPL v3.0</license>
7
  <channel>community</channel>
12
  Just open up a product in Magento and look at the Pricemotion tab. All prices of your competitors are there including the highest, lowest, average and median price. You can make decisions right away. &#xD;
13
  &#xD;
14
  You can also let the work be done for you. Just setup a pricerule and the prices are updated automatically four times a day. To be sure nothing goes wrong we have margin check so that you can trust your selling prices are not below your acquiring price and you make money. For those who don't trust automatic systems we can send you an email about that and leave the prices for you to set.</description>
15
+ <notes>Bump maximum Magento and PHP versions.</notes>
16
+ <authors>
17
+ <author>
18
+ <name>Heimen</name>
19
+ <user>pricemotion</user>
20
+ <email>heimen@pricemotion.nl</email>
21
+ </author>
22
+ </authors>
23
+ <date>2015-07-07</date>
24
+ <time>11:00:00</time>
25
+ <contents>
26
+ <target name="magelocal">
27
+ <dir name="A4s">
28
+ <dir name="Pricemotion">
29
+ <dir name="Block">
30
+ <dir name="Adminhtml">
31
+ <dir name="Catalog">
32
+ <dir name="Product">
33
+ <dir name="Action">
34
+ <file name="Rules.php" hash="2ab2d7b2aec730e4180c214e4111c6d6"/>
35
+ </dir>
36
+ <file name="Grid.php" hash="efa1e9b5133e2f173bc478c29168fc80"/>
37
+ <file name="Pricerules.php" hash="cb8685c1f0de60337d52b86307f16dae"/>
38
+ <file name="Tab.php" hash="af00da1a6dff03d99390a48086572df4"/>
39
+ </dir>
40
+ </dir>
41
+ <dir name="Form">
42
+ <dir name="Element">
43
+ <file name="Errormsg.php" hash="67a6e14c48db851da3ce29dc636066ab"/>
44
+ <file name="Prices.php" hash="0a3b56aeee92427b954b3642b419b336"/>
45
+ </dir>
46
+ </dir>
47
+ </dir>
48
+ </dir>
49
+ <dir name="Helper">
50
+ <dir name="Catalog">
51
+ <dir name="Product">
52
+ <file name="Action.php" hash="8126e50cf75eb79d8e2c8d2f077b6e7f"/>
53
+ </dir>
54
+ </dir>
55
+ <file name="Data.php" hash="848bf746991dadcb5fe7fe65bf60b3ee"/>
56
+ </dir>
57
+ <dir name="Model">
58
+ <dir name="Mysql4">
59
+ <dir name="Rules">
60
+ <file name="Collection.php" hash="422047623e90aeeaf3056aa735e5cf51"/>
61
+ </dir>
62
+ <file name="Rules.php" hash="de43a9a3bf018ff3dc88289b400cd959"/>
63
+ </dir>
64
+ <file name="Observer.php" hash="0e03a78f6434f10d59d060a017e45681"/>
65
+ <dir name="Resource">
66
+ <dir name="Eav">
67
+ <dir name="Mysql4">
68
+ <file name="Setup.php" hash="db37feaae0b61a2f1af2bf2f3bd0f620"/>
69
+ </dir>
70
+ </dir>
71
+ </dir>
72
+ <file name="Rules.php" hash="89cc7b2d19f18dca40bf53c3c35efcfd"/>
73
+ <dir name="System">
74
+ <dir name="Config">
75
+ <dir name="Source">
76
+ <dir name="Product">
77
+ <file name="Attributes.php" hash="d2e820f8b5888e1394e34b640738f1d9"/>
78
+ </dir>
79
+ </dir>
80
+ </dir>
81
+ </dir>
82
+ </dir>
83
+ <dir name="controllers">
84
+ <dir name="Adminhtml">
85
+ <file name="ActionController.php" hash="436f4b1f3f0f4c87313a5aaabf963f3a"/>
86
+ </dir>
87
+ </dir>
88
+ <dir name="etc">
89
+ <file name="config.xml" hash="13a8ccecee06d9ebf139d36bbd4c30d9"/>
90
+ <file name="system.xml" hash="fdb0df916e543f61d61ec77b82563ca1"/>
91
+ </dir>
92
+ <dir name="sql">
93
+ <dir name="pricemotion_setup">
94
+ <file name="mysql4-install-0.1.0.php" hash="5d9857be43b775df5e801611aeede550"/>
95
+ <file name="mysql4-upgrade-0.2.10-0.2.11.php" hash="8c89afb7b2c3f5ba56ac39c8d0b72e67"/>
96
+ <file name="mysql4-upgrade-0.2.12-0.2.13.php" hash="579437094cfe6c059aa3c16a9d43bf3a"/>
97
+ <file name="mysql4-upgrade-0.2.16-0.2.17.php" hash="d9ded804a2fb6f7e6d377ad6a1961a2c"/>
98
+ <file name="mysql4-upgrade-0.2.8-0.2.9.php" hash="0d320ad04bd30316daa8b1994211af9a"/>
99
+ </dir>
100
+ </dir>
101
+ </dir>
102
+ </dir>
103
+ </target>
104
+ <target name="magedesign">
105
+ <dir name="adminhtml">
106
+ <dir name="default">
107
+ <dir name="default">
108
+ <dir name="layout">
109
+ <file name="pricemotion.xml" hash="b0b4f5f55155551c4523bfad0ac4dd28"/>
110
+ </dir>
111
+ <dir name="template">
112
+ <dir name="pricemotion">
113
+ <file name="mass_price_rules.phtml" hash="b1ca05a79f3a7e408445b4faa11e8a6b"/>
114
+ <file name="price_rules.phtml" hash="57470cb06e722e7344a5e51e87c37d08"/>
115
+ </dir>
116
+ </dir>
117
+ </dir>
118
+ </dir>
119
+ </dir>
120
+ <dir name="frontend">
121
+ <dir name="base">
122
+ <dir name="default">
123
+ <dir name="template">
124
+ <dir name="pricemotion">
125
+ <file name="report_items.phtml" hash="b4b4917387c60086aefc4f218071145a"/>
126
+ </dir>
127
+ </dir>
128
+ </dir>
129
+ </dir>
130
+ </dir>
131
+ </target>
132
+ <target name="mageetc">
133
+ <dir name="modules">
134
+ <file name="A4s_Pricemotion.xml" hash="8579f9f81887bdb95098fa360a783553"/>
135
+ </dir>
136
+ </target>
137
+ <target name="magelocale">
138
+ <dir name="en_US">
139
+ <file name="Pricemotion.csv" hash="0ab8bfb05c1e3f7bdd26b84596432ac5"/>
140
+ <dir name="template">
141
+ <dir name="email">
142
+ <file name="pricemotion.html" hash="b1910a27cd87ee07612ed4cb89deca3b"/>
143
+ </dir>
144
+ </dir>
145
+ </dir>
146
+ <dir name="nl_NL">
147
+ <file name="Pricemotion.csv" hash="a10d700e52dcd67029383e83b6b1da6a"/>
148
+ <dir name="template">
149
+ <dir name="email">
150
+ <file name="pricemotion.html" hash="c658c320679e50d67eb7a24239dd1d4e"/>
151
+ </dir>
152
+ </dir>
153
+ </dir>
154
+ </target>
155
+ <target name="mageskin">
156
+ <dir name="adminhtml">
157
+ <dir name="default">
158
+ <dir name="default">
159
+ <dir name="pricemotion">
160
+ <file name="pricemotion.css" hash="118e574df3f4dce6f8bcc8d750bb4b43"/>
161
+ </dir>
162
+ </dir>
163
+ </dir>
164
+ </dir>
165
+ </target>
166
+ </contents>
167
  <compatible/>
168
+ <dependencies>
169
+ <required>
170
+ <php>
171
+ <min>5.2.0</min>
172
+ <max>5.7.0</max>
173
+ </php>
174
+ <package>
175
+ <name>Mage_Core_Modules</name>
176
+ <channel>community</channel>
177
+ <min>1.5.0</min>
178
+ <max>1.9.2.3</max>
179
+ </package>
180
+ </required>
181
+ </dependencies>
182
  </package>
set-prices.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require 'app/Mage.php';
4
+
5
+ if (!Mage::isInstalled()) {
6
+ echo "Application is not installed yet, please complete install wizard first.";
7
+ exit;
8
+ }
9
+ Mage::app('admin')->setUseSessionInUrl(false);
10
+
11
+ //echo round(9.99, 0, PHP_ROUND_HALF_DOWN);die();
12
+
13
+ Mage::getModel('pricemotion/observer')->setPrices(1);
14
+ Mage::getModel('pricemotion/observer')->updateAttributes(1);
skin/adminhtml/default/default/pricemotion/pricemotion.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ .price-rule-box {
2
+ background: none repeat scroll 0 0 #E7EFEF;
3
+ border: 1px solid #CDDDDD;
4
+ margin: 0.7em 0;
5
+ padding: 0.4em;
6
+ }