Version Notes
Bug Fix:
- Resolves some order writing issues.
Download this release
Release Info
Developer | PriceWaiter |
Extension | nypwidget |
Version | 2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.0 to 2.2.1
app/code/community/PriceWaiter/NYPWidget/Helper/Data.php
CHANGED
@@ -194,6 +194,42 @@ class PriceWaiter_NYPWidget_Helper_Data extends Mage_Core_Helper_Abstract
|
|
194 |
return $productPrice;
|
195 |
}
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
private function _getProduct()
|
198 |
{
|
199 |
if (!$this->_product) {
|
194 |
return $productPrice;
|
195 |
}
|
196 |
|
197 |
+
private function safeGetAttributeText($product, $code) {
|
198 |
+
$value = $product->getData($code);
|
199 |
+
|
200 |
+
$resource = $product->getResource();
|
201 |
+
if (!$resource) {
|
202 |
+
return false;
|
203 |
+
}
|
204 |
+
|
205 |
+
$attr = $resource->getAttribute($code);
|
206 |
+
if (!$attr) {
|
207 |
+
return false;
|
208 |
+
}
|
209 |
+
|
210 |
+
$frontend = $attr->getFrontend();
|
211 |
+
if (!$frontend) {
|
212 |
+
return false;
|
213 |
+
}
|
214 |
+
|
215 |
+
return $frontend->getValue($product);
|
216 |
+
}
|
217 |
+
|
218 |
+
public function getProductBrand($product) {
|
219 |
+
|
220 |
+
// prefer brand, but fallback to manufacturer attribute
|
221 |
+
$brand = $product->getData('brand');
|
222 |
+
|
223 |
+
if (!$brand) {
|
224 |
+
$manufacturer = $this->safeGetAttributeText($product, 'manufacturer');
|
225 |
+
if ($manufacturer) {
|
226 |
+
$brand = $manufacturer;
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
return $brand;
|
231 |
+
}
|
232 |
+
|
233 |
private function _getProduct()
|
234 |
{
|
235 |
if (!$this->_product) {
|
app/code/community/PriceWaiter/NYPWidget/etc/config.xml
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
|
19 |
<modules>
|
20 |
<PriceWaiter_NYPWidget>
|
21 |
-
<version>2.2.
|
22 |
</PriceWaiter_NYPWidget>
|
23 |
</modules>
|
24 |
|
18 |
|
19 |
<modules>
|
20 |
<PriceWaiter_NYPWidget>
|
21 |
+
<version>2.2.1</version>
|
22 |
</PriceWaiter_NYPWidget>
|
23 |
</modules>
|
24 |
|
app/design/frontend/base/default/template/pricewaiter/widget.phtml
CHANGED
@@ -25,19 +25,7 @@
|
|
25 |
$magentoVersion = Mage::getVersion();
|
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();
|
25 |
$magentoVersion = Mage::getVersion();
|
26 |
$extensionVersion = Mage::getConfig()->getNode()->modules->PriceWaiter_NYPWidget->version;
|
27 |
|
28 |
+
$brand = $helper->getProductBrand($_product);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
$image = $_product->getImageUrl();
|
31 |
$currency = Mage::app()->getStore()->getCurrentCurrencyCode();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>nypwidget</name>
|
4 |
-
<version>2.2.
|
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>2016-03-
|
20 |
-
<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="
|
22 |
<compatible/>
|
23 |
<dependencies>
|
24 |
<required>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>nypwidget</name>
|
4 |
+
<version>2.2.1</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-05</date>
|
20 |
+
<time>01:37:21</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="c288cb355485ce0765823d6018671185"/><file name="system.xml" hash="5188b4e0994ed8b51a10f4129b3c0d19"/></dir><dir name="Helper"><file name="Data.php" hash="0d95bb0c6dac734b0715dc5e85119f0c"/></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="5a3771ffa0121abd2a6951832d5d9cff"/><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="6679da88507af81c186489afc0c9de11"/><file name="mysql4-upgrade-2.1.5-2.2.0.php" hash="3c07f9cb641d892862d8493535d5d761"/></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="9b8c7e38ecadb2f84f37b61d973f707e"/></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>
|