Version Notes
- Fixed some bugs.
- Added support for Magento Connect 1
- Added the possibility to have the price only when the item is on special price.
- If no description is on the product, only the product name will appear.
- Fixed a bug where the image was not working on all Magento version.
Download this release
Release Info
| Developer | Frédérick Lebel |
| Extension | Moii_Pinterest |
| Version | 1.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.2
app/code/community/Moii/Pinterest/Block/PinterestButton.php
CHANGED
|
@@ -21,9 +21,22 @@ class Moii_Pinterest_Block_PinterestButton extends Mage_Core_Block_Template
|
|
| 21 |
$this->product = Mage::registry('current_product');
|
| 22 |
$this->productPrice = '$'.number_format($this->product->getPrice(),2);
|
| 23 |
$this->url = $this->helper('core/url')->getCurrentUrl();
|
| 24 |
-
$this->media = $this->helper('catalog/image')->init($this->product, 'small_image')->
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
}
|
| 29 |
|
| 21 |
$this->product = Mage::registry('current_product');
|
| 22 |
$this->productPrice = '$'.number_format($this->product->getPrice(),2);
|
| 23 |
$this->url = $this->helper('core/url')->getCurrentUrl();
|
| 24 |
+
$this->media = $this->helper('catalog/image')->init($this->product, 'small_image')->resize(220);
|
| 25 |
+
if ($this->product->getAttributeText('manufacturer') == null) {
|
| 26 |
+
$this->desc = $this->helper('catalog/output')->productAttribute($this->product, $this->product->getName(), 'name');
|
| 27 |
+
}
|
| 28 |
+
else {
|
| 29 |
+
$this->desc = $this->product->getAttributeText('manufacturer').' // '.$this->helper('catalog/output')->productAttribute($this->product, $this->product->getName(), 'name');
|
| 30 |
+
}
|
| 31 |
+
if (Mage::getStoreConfig('Moii_Pinterest_Config/configuration/Moii_Pinterest_Price') != 0) {
|
| 32 |
+
if (Mage::getStoreConfig('Moii_Pinterest_Config/configuration/Moii_Pinterest_Price') == 1) {
|
| 33 |
+
$this->desc .= ' - '.$this->productPrice;
|
| 34 |
+
}
|
| 35 |
+
if ((Mage::getStoreConfig('Moii_Pinterest_Config/configuration/Moii_Pinterest_Price') == 2) && ($this->product->special_price != 0)) {
|
| 36 |
+
$this->desc .= ' - $'.number_format($this->product->special_price,2);
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
$this->count = Mage::getStoreConfig('Moii_Pinterest_Config/configuration/Moii_Pinterest_Count');
|
| 40 |
}
|
| 41 |
}
|
| 42 |
|
app/code/community/Moii/Pinterest/Model/Price.php
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Moii_Pinterest_Model_Price
|
| 3 |
+
{
|
| 4 |
+
public function toOptionArray()
|
| 5 |
+
{
|
| 6 |
+
return array(
|
| 7 |
+
array('value'=>1, 'label'=>Mage::helper('Moii_Pinterest')->__('Always')),
|
| 8 |
+
array('value'=>2, 'label'=>Mage::helper('Moii_Pinterest')->__('Only Special Price')),
|
| 9 |
+
array('value'=>0, 'label'=>Mage::helper('Moii_Pinterest')->__('No')),
|
| 10 |
+
);
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
}
|
| 14 |
+
?>
|
app/code/community/Moii/Pinterest/etc/system.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<tabs>
|
| 4 |
<Moii_Pinterest translate="label" module="Moii_Pinterest">
|
| 5 |
<label>Moii</label>
|
| 6 |
-
<sort_order>
|
| 7 |
</Moii_Pinterest>
|
| 8 |
</tabs>
|
| 9 |
<sections>
|
|
@@ -43,6 +43,24 @@
|
|
| 43 |
<show_in_website>1</show_in_website>
|
| 44 |
<show_in_store>1</show_in_store>
|
| 45 |
</Moii_Pinterest_Count>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
</fields>
|
| 47 |
</configuration>
|
| 48 |
</groups>
|
| 3 |
<tabs>
|
| 4 |
<Moii_Pinterest translate="label" module="Moii_Pinterest">
|
| 5 |
<label>Moii</label>
|
| 6 |
+
<sort_order>600</sort_order>
|
| 7 |
</Moii_Pinterest>
|
| 8 |
</tabs>
|
| 9 |
<sections>
|
| 43 |
<show_in_website>1</show_in_website>
|
| 44 |
<show_in_store>1</show_in_store>
|
| 45 |
</Moii_Pinterest_Count>
|
| 46 |
+
<Moii_Pinterest_Price translate="label" module="Moii_Pinterest">
|
| 47 |
+
<label>Price in Description</label>
|
| 48 |
+
<frontend_type>select</frontend_type>
|
| 49 |
+
<source_model>Moii_Pinterest/enable</source_model>
|
| 50 |
+
<sort_order>3</sort_order>
|
| 51 |
+
<show_in_default>1</show_in_default>
|
| 52 |
+
<show_in_website>1</show_in_website>
|
| 53 |
+
<show_in_store>0</show_in_store>
|
| 54 |
+
</Moii_Pinterest_Price>
|
| 55 |
+
<Moii_Pinterest_Price translate="label" module="Moii_Pinterest">
|
| 56 |
+
<label>Price in Description</label>
|
| 57 |
+
<frontend_type>select</frontend_type>
|
| 58 |
+
<source_model>Moii_Pinterest/price</source_model>
|
| 59 |
+
<sort_order>3</sort_order>
|
| 60 |
+
<show_in_default>1</show_in_default>
|
| 61 |
+
<show_in_website>1</show_in_website>
|
| 62 |
+
<show_in_store>0</show_in_store>
|
| 63 |
+
</Moii_Pinterest_Price>
|
| 64 |
</fields>
|
| 65 |
</configuration>
|
| 66 |
</groups>
|
package.xml
CHANGED
|
@@ -1,18 +1,34 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Moii_Pinterest</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>This extension add a Pinterest button to
|
| 10 |
-
|
| 11 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
<authors><author><name>Frédérick Lebel</name><user>flebel</user><email>flebel@moii.ca</email></author><author><name>Jean-Francois Parent</name><user>moii</user><email>magento@moii.ca</email></author></authors>
|
| 13 |
-
<date>2012-02-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir name="Moii"><dir name="Pinterest"><dir name="Block"><file name="PinterestButton.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Moii_Pinterest</name>
|
| 4 |
+
<version>1.0.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
+
<summary>This extension is the easiest way to add a Pinterest Pin it button to your product page! 
|
| 10 |
+
Pinterest is becoming a significant source of traffic for retailers, more than Google+ </summary>
|
| 11 |
+
<description>This extension is the easiest way to add a Pinterest Pin it button to your product page! 
|
| 12 |
+
Pinterest is becoming a significant source of traffic for retailers, more than Google+ 
|
| 13 |
+
Features:
|
| 14 |
+

|
| 15 |
+

|
| 16 |
+
Enable/Disable Extension
|
| 17 |
+
Horizontal, vertical pin count or button only
|
| 18 |
+
Display Price for pinterest gifts
|
| 19 |
+
Uses Products Description for the Pin Description
|
| 20 |
+
Uses the Products Base Image for the Pin image
|
| 21 |
+
Pin the Product URL
|
| 22 |
+
Show with other social network buttons</description>
|
| 23 |
+
<notes>- Fixed some bugs.
|
| 24 |
+
- Added support for Magento Connect 1
|
| 25 |
+
- Added the possibility to have the price only when the item is on special price.
|
| 26 |
+
- If no description is on the product, only the product name will appear.
|
| 27 |
+
- Fixed a bug where the image was not working on all Magento version.</notes>
|
| 28 |
<authors><author><name>Frédérick Lebel</name><user>flebel</user><email>flebel@moii.ca</email></author><author><name>Jean-Francois Parent</name><user>moii</user><email>magento@moii.ca</email></author></authors>
|
| 29 |
+
<date>2012-02-16</date>
|
| 30 |
+
<time>04:52:34</time>
|
| 31 |
+
<contents><target name="magecommunity"><dir name="Moii"><dir name="Pinterest"><dir name="Block"><file name="PinterestButton.php" hash="05dc27dd353048c703b5b1dbaec08590"/></dir><dir name="Helper"><file name="Data.php" hash="bf9533e3afd1f49fdd5fea12ecfa4073"/></dir><dir name="Model"><file name="Enable.php" hash="6f52f2cdf36bdf12b2011e815ea7c7c0"/><file name="Pincount.php" hash="9669113e6ffcc2abf02fe4771bec1753"/><file name="Price.php" hash="956dc4d897cff4cd197e0e0990efac04"/></dir><dir name="etc"><file name="config.xml" hash="e4bc53a7cdbc9adadf3a2c9dc12b1e5b"/><file name="system.xml" hash="57eaa253988973ee2dce137bf33122b9"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Moii_Pinterest.xml" hash="a7c5113cba5d7d6478722a15cbf85715"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="moii"><file name="pinterest_button.phtml" hash="1d73fdaa064bae94e3002d6bfb20dc34"/></dir></dir><dir name="layout"><dir name="moii"><file name="pinterest.xml" hash="73674e831495740c4413953ce2fab753"/></dir></dir></dir></dir></dir></target></contents>
|
| 32 |
<compatible/>
|
| 33 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 34 |
</package>
|
