VS_Pinit - Version 1.0.1

Version Notes

This extension will be add Pinit button on product details page of your store.

Download this release

Release Info

Developer virendra kumar sharma
Extension VS_Pinit
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

app/code/community/VS/Pinit/Block/About.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class VS_Pinit_Block_About
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+
8
+ /**
9
+ * Render fieldset html
10
+ *
11
+ * @param Varien_Data_Form_Element_Abstract $element
12
+ * @return string
13
+ */
14
+ public function render(Varien_Data_Form_Element_Abstract $element)
15
+ {
16
+ $logopath = 'http://www.magentocommerce.com/images/avatars/uploads/avatar_311790.jpg';
17
+ $html = <<<HTML
18
+ <div style="background:url('$logopath') no-repeat scroll 14px 14px #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 164px;">
19
+ <p>
20
+ <strong>PREMIUM and FREE MAGENTO TEMPALTES and EXTENSIONS</strong><br />
21
+ <a href="http://www.magentocommerce.com/magento-connect/developer/virendra#extensions" target="_blank">VS</a> offers a wide choice of nice-looking and easily editable free and premium Magento extensions. You can find free extensions for the extremely popular Magento eCommerce platform.<br />
22
+ </p>
23
+ <p>
24
+ My extensions on <a href="http://www.magentocommerce.com/magento-connect/developer/virendra#extensions" target="_blank">MagentoConnect</a><br />
25
+ Should you have any questions email at <a href="mailto:bhardwajveerendra@gmail.com">bhardwajveerendra@gmail.com</a>
26
+ <br />
27
+ </p>
28
+ </div>
29
+ HTML;
30
+ return $html;
31
+ }
32
+ }
app/code/community/VS/Pinit/Block/pinit .php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class VS_Pinit_Block_Pinit extends Mage_Core_Block_Template {
3
+
4
+ }
app/code/community/VS/Pinit/Helper/Data.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Edition :- Community
5
+ * Developed By :- virendra Kumar Sharma
6
+ *
7
+ */
8
+ class VS_Pinit_Helper_Data extends Mage_Core_Helper_Abstract
9
+ {
10
+
11
+ }
app/code/community/VS/Pinit/Model/Button.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class VS_Pinit_Model_Button{
3
+ protected $_options;
4
+ const COUNT_HORIZONTAL = 'horizontal';
5
+ const COUNT_VERTICAL = 'vertical';
6
+ const COUNT_NONE = 'none';
7
+
8
+ public function toOptionArray(){
9
+ if (!$this->_options) {
10
+ $this->_options[] = array(
11
+ 'value'=>self::COUNT_HORIZONTAL,
12
+ 'label'=>Mage::helper('pinit')->__('Horizontal')
13
+ );
14
+ $this->_options[] = array(
15
+ 'value'=>self::COUNT_VERTICAL,
16
+ 'label'=>Mage::helper('pinit')->__('Vertical')
17
+ );
18
+ $this->_options[] = array(
19
+ 'value'=>self::COUNT_NONE,
20
+ 'label'=>Mage::helper('pinit')->__('None')
21
+ );
22
+
23
+
24
+ }
25
+ return $this->_options;
26
+ }
27
+ }
app/code/community/VS/Pinit/etc/config.xml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <VS_Pinit>
6
+ <version>2.0</version>
7
+ </VS_Pinit>
8
+ </modules>
9
+ <global>
10
+ <helpers>
11
+ <pinit>
12
+ <class>VS_Pinit_Helper</class>
13
+ </pinit>
14
+ </helpers>
15
+ <models>
16
+ <pinit>
17
+ <class>VS_Pinit_Model</class>
18
+ </pinit>
19
+ </models>
20
+ <blocks>
21
+ <pinit>
22
+ <class>VS_Pinit_Block</class>
23
+ </pinit>
24
+ </blocks>
25
+ <resources>
26
+ <pinit_setup>
27
+ <setup>
28
+ <module>VS_Pinit</module>
29
+ </setup>
30
+ <connection>
31
+ <use>core_setup</use>
32
+ </connection>
33
+ </pinit_setup>
34
+ <pinit_write>
35
+ <connection>
36
+ <use>core_write</use>
37
+ </connection>
38
+ </pinit_write>
39
+ <pinit_read>
40
+ <connection>
41
+ <use>core_read</use>
42
+ </connection>
43
+ </pinit_read>
44
+ </resources>
45
+ </global>
46
+ <default>
47
+ <pinit>
48
+ <general>
49
+ <enabled>1</enabled>
50
+ <buttonsize>horizontal</buttonsize>
51
+ </general>
52
+ </pinit>
53
+
54
+ </default>
55
+ <frontend>
56
+ <layout>
57
+ <updates>
58
+ <pinit>
59
+ <file>pinit.xml</file>
60
+ </pinit>
61
+ </updates>
62
+ </layout>
63
+ </frontend>
64
+ <adminhtml>
65
+ <acl>
66
+ <resources>
67
+ <admin>
68
+ <children>
69
+ <system>
70
+ <children>
71
+ <config>
72
+ <children>
73
+ <pinit>
74
+ <title>VS Pinit Button</title>
75
+ </pinit>
76
+ </children>
77
+ </config>
78
+ </children>
79
+ </system>
80
+ </children>
81
+ </admin>
82
+ </resources>
83
+ </acl>
84
+ </adminhtml>
85
+ </config>
app/code/community/VS/Pinit/etc/system.xml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <config>
4
+ <tabs>
5
+ <vs_extensions>
6
+ <label>VS Extensions</label>
7
+ <sort_order>195</sort_order>
8
+ </vs_extensions>
9
+ </tabs>
10
+ <sections>
11
+ <pinit translate="label" >
12
+ <label>VS Pinit Button</label>
13
+ <tab>vs_extensions</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>90</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <about translate="label">
21
+ <label>Developer</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>0</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <info translate="label">
29
+ <frontend_model>pinit/about</frontend_model>
30
+ <sort_order>1</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ </info>
35
+ </fields>
36
+ </about>
37
+ <general translate="label">
38
+ <label>Pinit Settings</label>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ <fields>
45
+ <enabled translate="label">
46
+ <label>Enabled</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>adminhtml/system_config_source_yesno</source_model>
49
+ <sort_order>1</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </enabled>
54
+
55
+ <buttonsize translate="label">
56
+ <label>Button Style</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>pinit/button</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>1</show_in_store>
63
+ </buttonsize>
64
+ </fields>
65
+ </general>
66
+
67
+
68
+ </groups>
69
+
70
+ </pinit>
71
+ </sections>
72
+ </config>
app/design/frontend/default/default/layout/pinit.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+ <catalog_product_view>
6
+
7
+ <reference name="alert.urls">
8
+ <block type="core/template" name="pinit" after="-" >
9
+ <action method="setTemplate" ifconfig="pinit/general/enabled">
10
+ <template>pinit/pinit.phtml</template>
11
+ </action>
12
+ </block>
13
+ </reference>
14
+ </catalog_product_view>
15
+
16
+
17
+ </layout>
18
+
app/design/frontend/default/default/template/pinit/pinit.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $bsize = Mage::getStoreConfig('pinit/general/buttonsize');
2
+ $currentproduct = Mage::registry('current_product');
3
+
4
+ $productMediaConfig = Mage::getModel('catalog/product_media_config');
5
+ $_helper = $this->helper('catalog/output');
6
+
7
+ $baseImageUrl = $productMediaConfig->getMediaUrl($currentproduct->getImage());
8
+ $smallImageUrl = $productMediaConfig->getMediaUrl($currentproduct->getSmallImage());
9
+ $thumbnailUrl = $productMediaConfig->getMediaUrl($currentproduct->getThumbnail());
10
+
11
+ $price = $currentproduct->getPrice();
12
+ $webprice = $currentproduct->getwebprice();
13
+ $specialprice = $currentproduct->getFinalPrice();
14
+ if($specialprice==$price)
15
+ {
16
+ $pricetoshow = $price;
17
+ } else {
18
+ $pricetoshow = $specialprice;
19
+
20
+ }
21
+
22
+ ?>
23
+
24
+
25
+
26
+ <a href="http://pinterest.com/pin/create/button/?url=<?php echo $currentproduct->getProductUrl();?>&media=<?php echo $baseImageUrl;?>&description=<?php echo $_helper->productAttribute($currentproduct, $currentproduct->getShortDescription(), 'short_description') ?><?php echo Mage::helper('core')->currency($pricetoshow,true,false);?>" class="pin-it-button" count-layout="<?php echo $bsize;?>"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
27
+
28
+ <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
29
+
30
+
app/etc/modules/VS_Pinit.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <VS_Pinit>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Catalog />
9
+ </depends>
10
+ </VS_Pinit>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>VS_Pinit</name>
4
+ <version>1.0.1</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 will be add Pinit button on product details page of your store. </summary>
10
+ <description>This extension will be add Pinit button on product details page of your store. </description>
11
+ <notes>This extension will be add Pinit button on product details page of your store. </notes>
12
+ <authors><author><name>Virendra Kumar Sharma</name><user>virendra</user><email>bhardwajveerendra@gmail.com</email></author></authors>
13
+ <date>2012-10-26</date>
14
+ <time>06:44:46</time>
15
+ <contents><target name="magecommunity"><dir><dir name="VS"><dir name="Pinit"><dir><dir name="Block"><file name="About.php" hash="e6e2297cbdc665e4a1d7df572b638592"/><file name="pinit .php" hash="4ead0a159d68ce54d60e081f67421129"/></dir><dir name="Helper"><file name="Data.php" hash="9e96e063baeb467d2ec51134e6a94adf"/></dir><dir name="Model"><file name="Button.php" hash="5aee18d935bb32965914c0ea79316c72"/></dir><dir name="etc"><file name="config.xml" hash="1e9bbb62c247971b7b12cec3aa7e6b05"/><file name="system.xml" hash="fa5305692250294e6e34fa023b718641"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="pinit"><file name="pinit.phtml" hash="28dcc241e4ca73560cc2d4f4b1b46e45"/></dir></dir><dir name="layout"><file name="pinit.xml" hash="561c82797367d575b01941da04ac3408"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="VS_Pinit.xml" hash="8c383ba55ef9f15050066ab699b910f1"/></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>