nypwidget - Version 1.2.3

Version Notes

Bug Fixes:
- Now requires product quantities to be set on grouped products.
- Fixed JS error on products with the widget disabled.

Features:
- Adds new configuration option for sending Welcome email when customers are created via the callback API
- Adds new configuration option for sending New Order emails when orders are created via the callback API

Download this release

Release Info

Developer PriceWaiter
Extension nypwidget
Version 1.2.3
Comparing to
See all releases


Code changes from version 1.2.2 to 1.2.3

app/code/community/PriceWaiter/NYPWidget/Model/Callback.php CHANGED
@@ -101,6 +101,9 @@ class PriceWaiter_NYPWidget_Model_Callback
101
  $customer->setConfirmation(null);
102
  $customer->setWebsiteId($this->_store->getWebsiteId());
103
  $customer->save();
 
 
 
104
  $customer->load($customer->getId());
105
  }
106
 
@@ -281,6 +284,9 @@ class PriceWaiter_NYPWidget_Model_Callback
281
  $transaction->addCommitCallback(array($order, 'place'));
282
  $transaction->addCommitCallback(array($order, 'save'));
283
  $transaction->save();
 
 
 
284
 
285
  // Capture the invoice
286
  $invoiceId = Mage::getModel('sales/order_invoice_api')
101
  $customer->setConfirmation(null);
102
  $customer->setWebsiteId($this->_store->getWebsiteId());
103
  $customer->save();
104
+ if (Mage::getStoreConfig('pricewaiter/customer_interaction/send_welcome_email')) {
105
+ $customer->sendNewAccountEmail('registered', '', $this->_store->getId());
106
+ }
107
  $customer->load($customer->getId());
108
  }
109
 
284
  $transaction->addCommitCallback(array($order, 'place'));
285
  $transaction->addCommitCallback(array($order, 'save'));
286
  $transaction->save();
287
+ if (Mage::getStoreConfig('pricewaiter/customer_interaction/send_new_order_email')) {
288
+ $order->sendNewOrderEmail();
289
+ }
290
 
291
  // Capture the invoice
292
  $invoiceId = Mage::getModel('sales/order_invoice_api')
app/code/community/PriceWaiter/NYPWidget/etc/config.xml CHANGED
@@ -18,7 +18,7 @@
18
 
19
  <modules>
20
  <PriceWaiter_NYPWidget>
21
- <version>1.2.2</version>
22
  </PriceWaiter_NYPWidget>
23
  </modules>
24
 
@@ -141,7 +141,11 @@
141
  <display_size>1</display_size>
142
  <display_color>5F82D4</display_color>
143
  <display_hover_color>739DFF</display_hover_color>
144
- </appearance>
 
 
 
 
145
  <categories>
146
  <disable_by_category>1</disable_by_category>
147
  </categories>
18
 
19
  <modules>
20
  <PriceWaiter_NYPWidget>
21
+ <version>1.2.3</version>
22
  </PriceWaiter_NYPWidget>
23
  </modules>
24
 
141
  <display_size>1</display_size>
142
  <display_color>5F82D4</display_color>
143
  <display_hover_color>739DFF</display_hover_color>
144
+ </appearance>
145
+ <customer_interaction>
146
+ <send_welcome_email>0</send_welcome_email>
147
+ <send_new_order_email>0</send_new_order_email>
148
+ </customer_interaction>
149
  <categories>
150
  <disable_by_category>1</disable_by_category>
151
  </categories>
app/code/community/PriceWaiter/NYPWidget/etc/system.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0" encoding="utf-8"?>
2
  <!--
3
  Copyright 2013 Price Waiter, LLC
4
-
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
@@ -146,7 +146,7 @@
146
  <label>Hover Color</label>
147
  <comment>
148
  <![CDATA[The button background color, in hexadecimal notation, when it
149
- is being hovered over.]]>
150
  </comment>
151
  <frontend_type>text</frontend_type>
152
  <validate>color</validate>
@@ -157,10 +157,49 @@
157
  </display_hover_color>
158
  </fields>
159
  </appearance>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  <categories>
161
  <label>Categories</label>
162
  <frontend_type>text</frontend_type>
163
- <sort_order>15</sort_order>
164
  <show_in_default>1</show_in_default>
165
  <show_in_website>1</show_in_website>
166
  <show_in_store>1</show_in_store>
1
  <?xml version="1.0" encoding="utf-8"?>
2
  <!--
3
  Copyright 2013 Price Waiter, LLC
4
+
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
146
  <label>Hover Color</label>
147
  <comment>
148
  <![CDATA[The button background color, in hexadecimal notation, when it
149
+ is being hovered over.]]>
150
  </comment>
151
  <frontend_type>text</frontend_type>
152
  <validate>color</validate>
157
  </display_hover_color>
158
  </fields>
159
  </appearance>
160
+ <customer_interaction>
161
+ <label>Customer Interaction</label>
162
+ <frontend_type>text</frontend_type>
163
+ <sort_order>15</sort_order>
164
+ <show_in_default>1</show_in_default>
165
+ <show_in_website>1</show_in_website>
166
+ <show_in_store>1</show_in_store>
167
+ <expanded>1</expanded>
168
+ <fields>
169
+ <send_welcome_email>
170
+ <label>Send Welcome Email to New Customers?</label>
171
+ <comment>
172
+ <![CDATA[With this enabled, new customers created when Magento receives a new
173
+ order notification will receive your store's Welcome email in addition to
174
+ PriceWaiter's.]]>
175
+ </comment>
176
+ <frontend_type>select</frontend_type>
177
+ <source_model>adminhtml/system_config_source_yesno</source_model>
178
+ <sort_order>10</sort_order>
179
+ <show_in_default>1</show_in_default>
180
+ <show_in_website>1</show_in_website>
181
+ <show_in_store>1</show_in_store>
182
+ </send_welcome_email>
183
+ <send_new_order_email>
184
+ <label>Send New Order Email to Customers?</label>
185
+ <comment>
186
+ <![CDATA[With this enabled, new orders created when Magento receives a new
187
+ order notification will trigger your store's New Order email in addition to
188
+ PriceWaiter's.]]>
189
+ </comment>
190
+ <frontend_type>select</frontend_type>
191
+ <source_model>adminhtml/system_config_source_yesno</source_model>
192
+ <sort_order>10</sort_order>
193
+ <show_in_default>1</show_in_default>
194
+ <show_in_website>1</show_in_website>
195
+ <show_in_store>1</show_in_store>
196
+ </send_new_order_email>
197
+ </fields>
198
+ </customer_interaction>
199
  <categories>
200
  <label>Categories</label>
201
  <frontend_type>text</frontend_type>
202
+ <sort_order>20</sort_order>
203
  <show_in_default>1</show_in_default>
204
  <show_in_website>1</show_in_website>
205
  <show_in_store>1</show_in_store>
js/pricewaiter/product-pages.js CHANGED
@@ -18,7 +18,8 @@ $(document).observe('dom:loaded', function() {
18
  if (typeof adminPW == 'function') {
19
  adminPW();
20
  }
21
- PriceWaiterOptions.onload =
 
22
  function(PriceWaiter) {
23
  PriceWaiter.setRegularPrice(PriceWaiterRegularPrice);
24
 
@@ -61,17 +62,17 @@ $(document).observe('dom:loaded', function() {
61
 
62
  switch(PriceWaiterProductType) {
63
  case 'simple':
64
- handleSimples();
65
- break;
66
  case 'configurable':
67
- handleConfigurables();
68
- break;
69
  case 'bundle':
70
- handleBundles();
71
- break;
72
  case 'grouped':
73
- handleGrouped();
74
- break;
75
  }
76
 
77
  function simplesSelect(select, name) {
@@ -233,6 +234,11 @@ $(document).observe('dom:loaded', function() {
233
  var productTable = $$('table.grouped-items-table')[0];
234
  var productRows = productTable.select('tbody')[0];
235
  productRows = productRows.childElements();
 
 
 
 
 
236
 
237
  for (var row in productRows) {
238
  if (!isNaN(parseInt(row, 10))) {
@@ -258,19 +264,29 @@ $(document).observe('dom:loaded', function() {
258
  if (previousQuantity > 0) {
259
  PriceWaiter.setPrice(Number(PriceWaiter.getPrice() - amountToRemove));
260
  }
 
 
 
 
 
 
 
261
  });
262
  }
263
  }
264
  }
265
  };
 
266
 
267
- (function() {
268
- var pw = document.createElement('script');
269
- pw.type = 'text/javascript';
270
- pw.src = window.PriceWaiterWidgetUrl;
271
- pw.async = true;
 
272
 
273
- var s = document.getElementsByTagName('script')[0];
274
- s.parentNode.insertBefore(pw, s);
275
- })();
 
276
  });
18
  if (typeof adminPW == 'function') {
19
  adminPW();
20
  }
21
+ if (typeof PriceWaiterOptions == 'object') {
22
+ PriceWaiterOptions.onload =
23
  function(PriceWaiter) {
24
  PriceWaiter.setRegularPrice(PriceWaiterRegularPrice);
25
 
62
 
63
  switch(PriceWaiterProductType) {
64
  case 'simple':
65
+ handleSimples();
66
+ break;
67
  case 'configurable':
68
+ handleConfigurables();
69
+ break;
70
  case 'bundle':
71
+ handleBundles();
72
+ break;
73
  case 'grouped':
74
+ handleGrouped();
75
+ break;
76
  }
77
 
78
  function simplesSelect(select, name) {
234
  var productTable = $$('table.grouped-items-table')[0];
235
  var productRows = productTable.select('tbody')[0];
236
  productRows = productRows.childElements();
237
+ // Prevent users from attempting to name a price on grouped products without
238
+ // setting any quantities
239
+ if (productRows.length > 0) {
240
+ PriceWaiter.setProductOptionRequired('Quantity of Products', true);
241
+ }
242
 
243
  for (var row in productRows) {
244
  if (!isNaN(parseInt(row, 10))) {
264
  if (previousQuantity > 0) {
265
  PriceWaiter.setPrice(Number(PriceWaiter.getPrice() - amountToRemove));
266
  }
267
+ // Test if any Product Options are set. If they are, we can disable
268
+ // our required option. Otherwise, ensure it is in place.
269
+ if (Object.keys(PriceWaiter.getProductOptions()).length > 0) {
270
+ PriceWaiter.clearRequiredProductOptions();
271
+ } else {
272
+ PriceWaiter.setProductOptionRequired('Quantity of Products', true);
273
+ }
274
  });
275
  }
276
  }
277
  }
278
  };
279
+ }
280
 
281
+ if (window.PriceWaiterWidgetUrl) {
282
+ (function() {
283
+ var pw = document.createElement('script');
284
+ pw.type = 'text/javascript';
285
+ pw.src = window.PriceWaiterWidgetUrl;
286
+ pw.async = true;
287
 
288
+ var s = document.getElementsByTagName('script')[0];
289
+ s.parentNode.insertBefore(pw, s);
290
+ })();
291
+ }
292
  });
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>nypwidget</name>
4
- <version>1.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</license>
7
  <channel>community</channel>
@@ -9,11 +9,17 @@
9
  <summary>PriceWaiter&#xAE; let's buyers make offers on your products that you can easily accept, counter offer or reject.</summary>
10
  <description>Sell more, immediately, with the PriceWaiter&#xAE; widget. Convert comparison shoppers you might have lost, increase sales and conversions, and stop "minimum advertised price" from preventing sales before they even start.&#xD;
11
  PriceWaiter&#xAE; lets customers make offers on products you sell-- offers you can accept, reject or counter. The widget embeds a simple Name Your Price button on any product page or category that you choose. Simply install the extension and you'll have full control over PriceWaiter&#xAE; in your Magento admin control panel.</description>
12
- <notes>Added support for new Callback API features aimed at improving multi-store install integration.</notes>
 
 
 
 
 
 
13
  <authors><author><name>PriceWaiter</name><user>pricewaiter</user><email>bobby.b@pricewaiter.com</email></author></authors>
14
- <date>2013-09-16</date>
15
- <time>20:46:22</time>
16
- <contents><target name="magecommunity"><dir name="PriceWaiter"><dir name="NYPWidget"><dir name="Block"><dir name="Adminhtml"><file name="Widget.php" hash="cffdba25dabdb8f9b6a2eac21c0e82e0"/></dir><file name="Category.php" hash="ba5bcfb87399356266eb2874bf691d6e"/><file name="Widget.php" hash="25489ee6ae666d91db98b70dd6adbf40"/></dir><dir name="Helper"><file name="Data.php" hash="e2d7bf749fa77e436b4166411c807487"/></dir><dir name="Model"><file name="Callback.php" hash="17239da4d569b101ef99bc621d3eff1b"/><dir name="Carrier"><file name="ShippingMethod.php" hash="1df7b75009a6e6e8e41b554fecb813db"/></dir><file name="Category.php" hash="55588e458cacb778b92fdacd8edeb22a"/><dir name="Display"><file name="Phrase.php" hash="ad605b93302ec648c5a7d3e3401f47b5"/><file name="Size.php" hash="42c2917e730811b78fd12e7591cb9159"/></dir><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="adbbb19ccafb1498bb0d4c5d20abddd1"/></dir><file name="Category.php" hash="ba6b693541711d91edc5b7edae799a97"/><dir name="Order"><file name="Collection.php" hash="de7e92559722c9735b32a6d30862087e"/></dir><file name="Order.php" hash="237302190fa65833b5ff187dd0bbe71a"/></dir><file name="Observer.php" hash="a5b643d09e366068028dc1df1abee154"/><file name="Order.php" hash="c44f2d228a38e991843cee197abd397c"/><file name="PaymentMethod.php" hash="0106a5c193079d4cf07005fc9d22dd29"/><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="da87eaa37fc5a09a5d5c38f9bbecabb1"/></dir></dir></dir></dir><dir name="controllers"><file name="CallbackController.php" hash="8b95003b06ebc0e1a05430655f2caacd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="022f1761ba091c7e1f3e4901d40d5ce0"/><file name="config.xml" hash="760169be53a59f3edaaa1c9eff5796bf"/><file name="system.xml" hash="4fde6c9c7ff1fe5db458cc49a60dc891"/></dir><dir name="sql"><dir name="nypwidget_setup"><file name="mysql4-install-1.0.0.php" hash="18bd8c535b0fe03be0cd2a6f4da7cc9c"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="8d4bd167694c277a0e8ab8034d87cb1b"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="2a8de13744724f647e23e612ecf1d196"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="cc51462b56118a611be1a329b308d528"/></dir><dir name="template"><dir name="pricewaiter"><file name="admin_widget.phtml" hash="daae86cfa34fbe5e786715c0c579e398"/><file name="categorytab.phtml" hash="43f8af9feca6775e4a1e8a149a86268e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="0da284d426574c7ae1f154b096f8b413"/></dir><dir name="template"><dir name="pricewaiter"><file name="widget.phtml" hash="e88d809e72dec522e9eb27f1df74f5c8"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PriceWaiter_NYPWidget.xml" hash="d3b86fa976b99e64df65f9e98d689257"/></dir></target><target name="mageweb"><dir name="js"><dir name="jscolor-pw"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="668050b57cb3ad59d0a56a16fddf1a91"/></dir><dir name="pricewaiter"><file name="product-pages.js" hash="e45d0be938b5fcc67371c634ff3e623a"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/><file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/></dir><file name="pricewaiter.css" hash="6a58cdaa35d8f61cbb305a6a1a206816"/></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>nypwidget</name>
4
+ <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</license>
7
  <channel>community</channel>
9
  <summary>PriceWaiter&#xAE; let's buyers make offers on your products that you can easily accept, counter offer or reject.</summary>
10
  <description>Sell more, immediately, with the PriceWaiter&#xAE; widget. Convert comparison shoppers you might have lost, increase sales and conversions, and stop "minimum advertised price" from preventing sales before they even start.&#xD;
11
  PriceWaiter&#xAE; lets customers make offers on products you sell-- offers you can accept, reject or counter. The widget embeds a simple Name Your Price button on any product page or category that you choose. Simply install the extension and you'll have full control over PriceWaiter&#xAE; in your Magento admin control panel.</description>
12
+ <notes>Bug Fixes:&#xD;
13
+ - Now requires product quantities to be set on grouped products.&#xD;
14
+ - Fixed JS error on products with the widget disabled.&#xD;
15
+ &#xD;
16
+ Features:&#xD;
17
+ - Adds new configuration option for sending Welcome email when customers are created via the callback API&#xD;
18
+ - Adds new configuration option for sending New Order emails when orders are created via the callback API</notes>
19
  <authors><author><name>PriceWaiter</name><user>pricewaiter</user><email>bobby.b@pricewaiter.com</email></author></authors>
20
+ <date>2013-10-24</date>
21
+ <time>13:44:22</time>
22
+ <contents><target name="magecommunity"><dir name="PriceWaiter"><dir name="NYPWidget"><dir name="Block"><dir name="Adminhtml"><file name="Widget.php" hash="cffdba25dabdb8f9b6a2eac21c0e82e0"/></dir><file name="Category.php" hash="ba5bcfb87399356266eb2874bf691d6e"/><file name="Widget.php" hash="25489ee6ae666d91db98b70dd6adbf40"/></dir><dir name="Helper"><file name="Data.php" hash="e2d7bf749fa77e436b4166411c807487"/></dir><dir name="Model"><file name="Callback.php" hash="fd6eb2f6ef758b0b48db4e12edf16195"/><dir name="Carrier"><file name="ShippingMethod.php" hash="1df7b75009a6e6e8e41b554fecb813db"/></dir><file name="Category.php" hash="55588e458cacb778b92fdacd8edeb22a"/><dir name="Display"><file name="Phrase.php" hash="ad605b93302ec648c5a7d3e3401f47b5"/><file name="Size.php" hash="42c2917e730811b78fd12e7591cb9159"/></dir><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="adbbb19ccafb1498bb0d4c5d20abddd1"/></dir><file name="Category.php" hash="ba6b693541711d91edc5b7edae799a97"/><dir name="Order"><file name="Collection.php" hash="de7e92559722c9735b32a6d30862087e"/></dir><file name="Order.php" hash="237302190fa65833b5ff187dd0bbe71a"/></dir><file name="Observer.php" hash="a5b643d09e366068028dc1df1abee154"/><file name="Order.php" hash="c44f2d228a38e991843cee197abd397c"/><file name="PaymentMethod.php" hash="0106a5c193079d4cf07005fc9d22dd29"/><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="da87eaa37fc5a09a5d5c38f9bbecabb1"/></dir></dir></dir></dir><dir name="controllers"><file name="CallbackController.php" hash="8b95003b06ebc0e1a05430655f2caacd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="022f1761ba091c7e1f3e4901d40d5ce0"/><file name="config.xml" hash="dff3bd8e639d5eff1988dce19515683f"/><file name="system.xml" hash="7e0b2c2af5a6055b4658910f50f3d484"/></dir><dir name="sql"><dir name="nypwidget_setup"><file name="mysql4-install-1.0.0.php" hash="18bd8c535b0fe03be0cd2a6f4da7cc9c"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="8d4bd167694c277a0e8ab8034d87cb1b"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="2a8de13744724f647e23e612ecf1d196"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="cc51462b56118a611be1a329b308d528"/></dir><dir name="template"><dir name="pricewaiter"><file name="admin_widget.phtml" hash="daae86cfa34fbe5e786715c0c579e398"/><file name="categorytab.phtml" hash="43f8af9feca6775e4a1e8a149a86268e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="0da284d426574c7ae1f154b096f8b413"/></dir><dir name="template"><dir name="pricewaiter"><file name="widget.phtml" hash="e88d809e72dec522e9eb27f1df74f5c8"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PriceWaiter_NYPWidget.xml" hash="d3b86fa976b99e64df65f9e98d689257"/></dir></target><target name="mageweb"><dir name="js"><dir name="jscolor-pw"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="668050b57cb3ad59d0a56a16fddf1a91"/></dir><dir name="pricewaiter"><file name="product-pages.js" hash="13abcb256a75027c883c247af09392a3"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/><file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/></dir><file name="pricewaiter.css" hash="6a58cdaa35d8f61cbb305a6a1a206816"/></dir></dir></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
25
  </package>