nypwidget - Version 2.1.5

Version Notes

Bug Fix:
- Resolves some order writing issues.

Download this release

Release Info

Developer PriceWaiter
Extension nypwidget
Version 2.1.5
Comparing to
See all releases


Code changes from version 2.1.4 to 2.1.5

app/code/community/PriceWaiter/NYPWidget/Block/Adminhtml/Link.php CHANGED
@@ -22,9 +22,9 @@ class PriceWaiter_NYPWidget_Block_Adminhtml_Link extends Varien_Data_Form_Elemen
22
  public function render(Varien_Data_Form_Element_Abstract $element)
23
  {
24
  $helper = Mage::helper('nypwidget');
25
- $this->setData('href', $helper->getButtonSettingsUrl());
26
  $this->setData('target', '_blank');
27
- $this->setData('value', 'Customize the appearance of your widget on PriceWaiter.com');
28
  return $this->toHtml();
29
  }
30
  }
22
  public function render(Varien_Data_Form_Element_Abstract $element)
23
  {
24
  $helper = Mage::helper('nypwidget');
25
+ $this->setData('href', $helper->getPriceWaiterSettingsUrl());
26
  $this->setData('target', '_blank');
27
+ $this->setData('value', 'Edit other settings on PriceWaiter.com');
28
  return $this->toHtml();
29
  }
30
  }
app/code/community/PriceWaiter/NYPWidget/Helper/Data.php CHANGED
@@ -24,22 +24,22 @@ class PriceWaiter_NYPWidget_Helper_Data extends Mage_Core_Helper_Abstract
24
  private $_buttonEnabled = null;
25
  private $_conversionToolsEnabled = null;
26
 
27
- private $_widgetUrl = 'https://widget.pricewaiter.com';
28
- private $_manageUrl = 'https://manage.pricewaiter.com';
29
  private $_apiUrl = 'https://api.pricewaiter.com';
 
 
30
 
31
  public function __construct()
32
  {
33
- if (!!getenv('PRICEWAITER_WIDGET_URL')) {
34
- $this->_widgetUrl = getenv('PRICEWAITER_WIDGET_URL');
35
  }
36
 
37
- if (!!getenv('PRICEWAITER_MANAGE_URL')) {
38
- $this->_manageUrl = getenv('PRICEWAITER_MANAGE_URL');
39
  }
40
 
41
- if (!!getenv('PRICEWAITER_API_URL')) {
42
- $this->_apiUrl = getenv('PRICEWAITER_API_URL');
43
  }
44
  }
45
 
@@ -167,11 +167,11 @@ class PriceWaiter_NYPWidget_Helper_Data extends Mage_Core_Helper_Abstract
167
  return $this->_buttonEnabled;
168
  }
169
 
170
- public function getButtonSettingsUrl()
171
  {
172
  $apiKey = Mage::getStoreConfig('pricewaiter/configuration/api_key');
173
 
174
- return sprintf("%s/stores/%s/button", $this->_manageUrl, $apiKey);
175
  }
176
 
177
  public function getWidgetUrl()
24
  private $_buttonEnabled = null;
25
  private $_conversionToolsEnabled = null;
26
 
 
 
27
  private $_apiUrl = 'https://api.pricewaiter.com';
28
+ private $_retailerUrl = 'https://retailer.pricewaiter.com';
29
+ private $_widgetUrl = 'https://widget.pricewaiter.com';
30
 
31
  public function __construct()
32
  {
33
+ if (!!getenv('PRICEWAITER_API_URL')) {
34
+ $this->_apiUrl = getenv('PRICEWAITER_API_URL');
35
  }
36
 
37
+ if (!!getenv('PRICEWAITER_RETAILER_URL')) {
38
+ $this->_retailerUrl = getenv('PRICEWAITER_RETAILER_URL');
39
  }
40
 
41
+ if (!!getenv('PRICEWAITER_WIDGET_URL')) {
42
+ $this->_widgetUrl = getenv('PRICEWAITER_WIDGET_URL');
43
  }
44
  }
45
 
167
  return $this->_buttonEnabled;
168
  }
169
 
170
+ public function getPriceWaiterSettingsUrl()
171
  {
172
  $apiKey = Mage::getStoreConfig('pricewaiter/configuration/api_key');
173
 
174
+ return sprintf("%s/", $this->_retailerUrl);
175
  }
176
 
177
  public function getWidgetUrl()
app/code/community/PriceWaiter/NYPWidget/etc/config.xml CHANGED
@@ -18,7 +18,7 @@
18
 
19
  <modules>
20
  <PriceWaiter_NYPWidget>
21
- <version>2.1.4</version>
22
  </PriceWaiter_NYPWidget>
23
  </modules>
24
 
18
 
19
  <modules>
20
  <PriceWaiter_NYPWidget>
21
+ <version>2.1.5</version>
22
  </PriceWaiter_NYPWidget>
23
  </modules>
24
 
app/code/community/PriceWaiter/NYPWidget/etc/system.xml CHANGED
@@ -27,6 +27,27 @@
27
  <class>pricewaiter-tab</class>
28
  <header_css>pricewaiter-header</header_css>
29
  <groups>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  <configuration translate="label">
31
  <label>Configuration</label>
32
  <frontend_type>text</frontend_type>
@@ -187,27 +208,7 @@
187
  </group_select>
188
  </fields>
189
  </conversion_tools>
190
- <appearance translate="label">
191
- <label>Appearance</label>
192
- <frontend_type>text</frontend_type>
193
- <sort_order>10</sort_order>
194
- <show_in_default>1</show_in_default>
195
- <show_in_website>1</show_in_website>
196
- <show_in_store>1</show_in_store>
197
- <expanded>1</expanded>
198
- <fields>
199
- <button_link translate="label comment">
200
- <label>Widget Appearance</label>
201
- <frontend_type>link</frontend_type>
202
- <frontend_model>nypwidget/adminhtml_link</frontend_model>
203
- <comment><![CDATA[Follow the provided link to customize the PriceWaiter widget appearance.]]></comment>
204
- <sort_order>10</sort_order>
205
- <show_in_default>1</show_in_default>
206
- <show_in_website>1</show_in_website>
207
- <show_in_store>1</show_in_store>
208
- </button_link>
209
- </fields>
210
- </appearance>
211
  <customer_interaction>
212
  <label>Customer Interaction</label>
213
  <frontend_type>text</frontend_type>
27
  <class>pricewaiter-tab</class>
28
  <header_css>pricewaiter-header</header_css>
29
  <groups>
30
+ <appearance translate="label">
31
+ <label>PriceWaiter Settings</label>
32
+ <frontend_type>text</frontend_type>
33
+ <sort_order>0</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ <expanded>1</expanded>
38
+ <fields>
39
+ <button_link translate="label comment">
40
+ <label>Widget Appearance</label>
41
+ <frontend_type>link</frontend_type>
42
+ <frontend_model>nypwidget/adminhtml_link</frontend_model>
43
+ <comment><![CDATA[Follow the provided link to customize the PriceWaiter widget appearance.]]></comment>
44
+ <sort_order>10</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </button_link>
49
+ </fields>
50
+ </appearance>
51
  <configuration translate="label">
52
  <label>Configuration</label>
53
  <frontend_type>text</frontend_type>
208
  </group_select>
209
  </fields>
210
  </conversion_tools>
211
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  <customer_interaction>
213
  <label>Customer Interaction</label>
214
  <frontend_type>text</frontend_type>
app/design/frontend/base/default/template/pricewaiter/widget.phtml CHANGED
@@ -26,7 +26,19 @@
26
  $extensionVersion = Mage::getConfig()->getNode()->modules->PriceWaiter_NYPWidget->version;
27
 
28
 
 
 
 
29
  $brand = $_product->getData('brand');
 
 
 
 
 
 
 
 
 
30
  $image = $_product->getImageUrl();
31
  $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
32
  if ($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {
26
  $extensionVersion = Mage::getConfig()->getNode()->modules->PriceWaiter_NYPWidget->version;
27
 
28
 
29
+ // prefer brand, but fallback to manufacturer attribute
30
+ // getAttributeText will throw exception when manufacturer attribute is deleted.
31
+ // getResource -> getAttribute will safely give Object when attribute exists
32
  $brand = $_product->getData('brand');
33
+ $manufacturer_id = $_product->getResource()->getAttribute('manufacturer');
34
+
35
+ if (!$brand && $manufacturer_id) {
36
+ $manufacturer = $_product->getAttributeText('manufacturer');
37
+ if ($manufacturer) {
38
+ $brand = $manufacturer;
39
+ }
40
+ }
41
+
42
  $image = $_product->getImageUrl();
43
  $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
44
  if ($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>nypwidget</name>
4
- <version>2.1.4</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>
@@ -16,9 +16,9 @@
16
  <email>extensions@pricewaiter.com</email>
17
  </author>
18
  </authors>
19
- <date>2015-11-19</date>
20
- <time>00:15:40</time>
21
- <contents><target name="mageweb"><dir name="app"><dir name="etc"><dir name="modules"><file name="PriceWaiter_NYPWidget.xml" hash="72be18d9a8a741abc8926866449619cd"/></dir></dir><dir name="code"><dir name="community"><dir name="PriceWaiter"><dir name="NYPWidget"><dir name="Block"><dir name="Adminhtml"><file name="Link.php" hash="848a4e3813a3d238cacdd812334bb780"/><file name="Signup.php" hash="35a2739246307b5c7a3b69780a7f31fd"/><file name="Widget.php" hash="b781daf1de34d7856de7faba65afe414"/></dir><file name="Category.php" hash="de6397a45d7deabc803bef83a83d6b9a"/><file name="Widget.php" hash="193d694c4acc2133d8402f1e59d4dc25"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PricewaiterController.php" hash="27e17f05c8e2b2edcc28230185334f35"/></dir><file name="CallbackController.php" hash="4c45b3d73999c3e69a11538b99b3b3fd"/><file name="ProductinfoController.php" hash="62780d33252c907cd48f9ff3326b3e8b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dff2f6de0dacaf5a933048fa4a347f2f"/><file name="config.xml" hash="7f516fdb3fc971efea45e869ff15a399"/><file name="system.xml" hash="82bb83cf7eb6a1d0ebf6bb774cd24414"/></dir><dir name="Helper"><file name="Data.php" hash="02a3f95d06939001ed5ab7a195b810f4"/></dir><dir name="Model"><file name="Callback.php" hash="441661b9a5a6d812a1d39b1a199da2a0"/><file name="Category.php" hash="884685769be745cb273833ab7d691593"/><file name="Observer.php" hash="2399e210dd82633091570483f144bf12"/><file name="Order.php" hash="080844dcc4cf55d516abe27175a3a62a"/><file name="PaymentMethod.php" hash="386134e1ac803580222263523f0ced31"/><dir name="Carrier"><file name="ShippingMethod.php" hash="43a6ec1ad462797a5359238dcf9a749d"/></dir><dir name="Display"><file name="Phrase.php" hash="5b595a42b487930154c505a8e9a1301c"/><file name="Size.php" hash="8a596164268f48c3c034274550b13b96"/></dir><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="45eaa532cd5935b69102b8969da848fa"/></dir><file name="Category.php" hash="f4e761813ec4bb81d919f30895ce3578"/><file name="Order.php" hash="c08b340cec16bf774a7c178726dee0ac"/><dir name="Order"><file name="Collection.php" hash="4dc5b344274c0e5a391a24864fd1c003"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="d63678e9cc718ee87e8db3ca5163a8fd"/></dir></dir></dir></dir><dir name="sql"><dir name="nypwidget_setup"><file name="mysql4-install-1.0.0.php" hash="cd1b7892e75e4452ee94afbbefb4de6e"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="d1ae05f5cbe4a8f833e92b9f49d395db"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="bd342c802f6c91de6f9f51b0a4a25414"/><file name="mysql4-upgrade-1.2.4-1.2.5.php" hash="b1ced0226bef6e950e026402b933872f"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="106b36065c125be31fc67424d80acdd4"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="9e06026a8a820224336de4c9a7dde3fd"/></dir><dir name="template"><dir name="pricewaiter"><file name="categorytab.phtml" hash="d1d2c333cc9b18c909a44d333d8ab077"/><file name="signup.phtml" hash="fc18c669c18c55cccdf2c66c96199dec"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="ab65e8c99c560997d403a780295a47da"/></dir><dir name="template"><dir name="pricewaiter"><file name="widget.phtml" hash="0b96e17e76b40dfb4b641dce3246e195"/></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><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"/><file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/><file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/></dir><file name="pricewaiter.css" hash="c4061169f3e505c28bd09924108ca0ad"/></dir></dir></dir></dir><dir name="js"><dir name="pricewaiter"><file name="product-pages.js" hash="073eb5cd568a3db8b3ab7f94d5ffba3c"/><file name="token.js" hash="dbaedb04a60982743949e16096ed7f58"/></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies>
24
  <required>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>nypwidget</name>
4
+ <version>2.1.5</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>
16
  <email>extensions@pricewaiter.com</email>
17
  </author>
18
  </authors>
19
+ <date>2016-03-01</date>
20
+ <time>01:00:14</time>
21
+ <contents><target name="mageweb"><dir name="app"><dir name="etc"><dir name="modules"><file name="PriceWaiter_NYPWidget.xml" hash="72be18d9a8a741abc8926866449619cd"/></dir></dir><dir name="code"><dir name="community"><dir name="PriceWaiter"><dir name="NYPWidget"><dir name="Block"><dir name="Adminhtml"><file name="Link.php" hash="6b860db5d597f3ff697c927e3d08a085"/><file name="Signup.php" hash="35a2739246307b5c7a3b69780a7f31fd"/><file name="Widget.php" hash="b781daf1de34d7856de7faba65afe414"/></dir><file name="Category.php" hash="de6397a45d7deabc803bef83a83d6b9a"/><file name="Widget.php" hash="193d694c4acc2133d8402f1e59d4dc25"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PricewaiterController.php" hash="27e17f05c8e2b2edcc28230185334f35"/></dir><file name="CallbackController.php" hash="4c45b3d73999c3e69a11538b99b3b3fd"/><file name="ProductinfoController.php" hash="62780d33252c907cd48f9ff3326b3e8b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dff2f6de0dacaf5a933048fa4a347f2f"/><file name="config.xml" hash="97c9f5f47a52e6a53be33296380724ca"/><file name="system.xml" hash="5188b4e0994ed8b51a10f4129b3c0d19"/></dir><dir name="Helper"><file name="Data.php" hash="afa849a36c868e5df9e036f16e15543c"/></dir><dir name="Model"><file name="Callback.php" hash="441661b9a5a6d812a1d39b1a199da2a0"/><file name="Category.php" hash="884685769be745cb273833ab7d691593"/><file name="Observer.php" hash="2399e210dd82633091570483f144bf12"/><file name="Order.php" hash="080844dcc4cf55d516abe27175a3a62a"/><file name="PaymentMethod.php" hash="386134e1ac803580222263523f0ced31"/><dir name="Carrier"><file name="ShippingMethod.php" hash="43a6ec1ad462797a5359238dcf9a749d"/></dir><dir name="Display"><file name="Phrase.php" hash="5b595a42b487930154c505a8e9a1301c"/><file name="Size.php" hash="8a596164268f48c3c034274550b13b96"/></dir><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="45eaa532cd5935b69102b8969da848fa"/></dir><file name="Category.php" hash="f4e761813ec4bb81d919f30895ce3578"/><file name="Order.php" hash="c08b340cec16bf774a7c178726dee0ac"/><dir name="Order"><file name="Collection.php" hash="4dc5b344274c0e5a391a24864fd1c003"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="d63678e9cc718ee87e8db3ca5163a8fd"/></dir></dir></dir></dir><dir name="sql"><dir name="nypwidget_setup"><file name="mysql4-install-1.0.0.php" hash="cd1b7892e75e4452ee94afbbefb4de6e"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="d1ae05f5cbe4a8f833e92b9f49d395db"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="bd342c802f6c91de6f9f51b0a4a25414"/><file name="mysql4-upgrade-1.2.4-1.2.5.php" hash="b1ced0226bef6e950e026402b933872f"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="106b36065c125be31fc67424d80acdd4"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="9e06026a8a820224336de4c9a7dde3fd"/></dir><dir name="template"><dir name="pricewaiter"><file name="categorytab.phtml" hash="d1d2c333cc9b18c909a44d333d8ab077"/><file name="signup.phtml" hash="fc18c669c18c55cccdf2c66c96199dec"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="ab65e8c99c560997d403a780295a47da"/></dir><dir name="template"><dir name="pricewaiter"><file name="widget.phtml" hash="3565fcfb7dd9fecd26512d5fc41333e4"/></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><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"/><file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/><file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/></dir><file name="pricewaiter.css" hash="c4061169f3e505c28bd09924108ca0ad"/></dir></dir></dir></dir><dir name="js"><dir name="pricewaiter"><file name="product-pages.js" hash="073eb5cd568a3db8b3ab7f94d5ffba3c"/><file name="token.js" hash="dbaedb04a60982743949e16096ed7f58"/></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies>
24
  <required>