Version Notes
This extension will be add Google+ button on product details page of your store.
Download this release
Release Info
Developer | virendra kumar sharma |
Extension | VS_GooglePlus |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.1.2
- app/code/community/VS/Googleplus/Model/Annotation.php +25 -0
- app/code/community/VS/Googleplus/etc/config.xml +2 -0
- app/code/community/VS/Googleplus/etc/system.xml +23 -1
- app/design/frontend/default/default/layout/googleplus.xml +2 -2
- app/design/frontend/default/default/template/googleplus/googleplus.phtml +26 -4
- package.xml +9 -9
app/code/community/VS/Googleplus/Model/Annotation.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class VS_Googleplus_Model_Annotation{
|
3 |
+
protected $_options;
|
4 |
+
const ANNOTATION_INLINE = 'inline';
|
5 |
+
const ANNOTATION_BUBBLE = '';
|
6 |
+
const ANNOTATION_NONE = 'none';
|
7 |
+
|
8 |
+
public function toOptionArray(){
|
9 |
+
if (!$this->_options) {
|
10 |
+
$this->_options[] = array(
|
11 |
+
'value'=>self::ANNOTATION_INLINE,
|
12 |
+
'label'=>Mage::helper('googleplus')->__('Inline')
|
13 |
+
);
|
14 |
+
$this->_options[] = array(
|
15 |
+
'value'=>self::ANNOTATION_BUBBLE,
|
16 |
+
'label'=>Mage::helper('googleplus')->__('Bubble')
|
17 |
+
);
|
18 |
+
$this->_options[] = array(
|
19 |
+
'value'=>self::ANNOTATION_NONE,
|
20 |
+
'label'=>Mage::helper('googleplus')->__('None')
|
21 |
+
);
|
22 |
+
}
|
23 |
+
return $this->_options;
|
24 |
+
}
|
25 |
+
}
|
app/code/community/VS/Googleplus/etc/config.xml
CHANGED
@@ -48,6 +48,8 @@
|
|
48 |
<general>
|
49 |
<defaulgoogleplus>1</defaulgoogleplus>
|
50 |
<buttonsize></buttonsize>
|
|
|
|
|
51 |
</general>
|
52 |
</googleplus>
|
53 |
|
48 |
<general>
|
49 |
<defaulgoogleplus>1</defaulgoogleplus>
|
50 |
<buttonsize></buttonsize>
|
51 |
+
<annotation></annotation>
|
52 |
+
<datawidth>300</datawidth>
|
53 |
</general>
|
54 |
</googleplus>
|
55 |
|
app/code/community/VS/Googleplus/etc/system.xml
CHANGED
@@ -60,7 +60,29 @@
|
|
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 |
|
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 |
+
|
65 |
+
<annotation translate="label">
|
66 |
+
<label>Annotation</label>
|
67 |
+
<frontend_type>select</frontend_type>
|
68 |
+
<source_model>googleplus/annotation</source_model>
|
69 |
+
<sort_order>4</sort_order>
|
70 |
+
<show_in_default>1</show_in_default>
|
71 |
+
<show_in_website>1</show_in_website>
|
72 |
+
<show_in_store>1</show_in_store>
|
73 |
+
</annotation>
|
74 |
+
|
75 |
+
<datawidth translate="label">
|
76 |
+
<label>Data Width</label>
|
77 |
+
<frontend_type>text</frontend_type>
|
78 |
+
<comment>Needed only for inline Annotation</comment>
|
79 |
+
<sort_order>5</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</datawidth>
|
84 |
+
|
85 |
+
|
86 |
</fields>
|
87 |
</general>
|
88 |
|
app/design/frontend/default/default/layout/googleplus.xml
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
<layout version="0.1.0">
|
4 |
|
5 |
<catalog_product_view>
|
6 |
-
|
7 |
<block type="core/text" name="vs.js" ifconfig="googleplus/general/enabled"><action method="setText"><text><![CDATA[<script language="javascript" type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>]]></text></action></block>
|
8 |
-
</reference>
|
9 |
|
10 |
<reference name="alert.urls">
|
11 |
<block type="core/template" name="googleplus" after="-" >
|
3 |
<layout version="0.1.0">
|
4 |
|
5 |
<catalog_product_view>
|
6 |
+
<!-- <reference name="head">
|
7 |
<block type="core/text" name="vs.js" ifconfig="googleplus/general/enabled"><action method="setText"><text><![CDATA[<script language="javascript" type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>]]></text></action></block>
|
8 |
+
</reference> -->
|
9 |
|
10 |
<reference name="alert.urls">
|
11 |
<block type="core/template" name="googleplus" after="-" >
|
app/design/frontend/default/default/template/googleplus/googleplus.phtml
CHANGED
@@ -1,6 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
?>
|
|
|
|
|
4 |
|
5 |
-
<!-- Place this tag
|
6 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$bsize = Mage::getStoreConfig('googleplus/general/buttonsize');
|
3 |
+
$annotation = Mage::getStoreConfig('googleplus/general/annotation');
|
4 |
+
$datawidth = Mage::getStoreConfig('googleplus/general/datawidth');
|
5 |
+
$btext = '';
|
6 |
+
if($bsize!=''){
|
7 |
+
$btext.=" data-size=".$bsize;
|
8 |
+
}
|
9 |
+
if($annotation!=''){
|
10 |
+
$btext.=" data-annotation=".$annotation;
|
11 |
+
}
|
12 |
+
if($datawidth!='' && $annotation=='inline'){
|
13 |
+
$btext.=" data-width=".$datawidth;
|
14 |
+
}
|
15 |
?>
|
16 |
+
<!-- Place this tag where you want the +1 button to render. -->
|
17 |
+
<div class="g-plusone"<?php echo $btext;?>></div>
|
18 |
|
19 |
+
<!-- Place this tag after the last +1 button tag. -->
|
20 |
+
<script type="text/javascript">
|
21 |
+
window.___gcfg = {lang: 'en-GB'};
|
22 |
+
|
23 |
+
(function() {
|
24 |
+
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
25 |
+
po.src = 'https://apis.google.com/js/plusone.js';
|
26 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
27 |
+
})();
|
28 |
+
</script>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>VS_GooglePlus</name>
|
4 |
-
<version>1.
|
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 Google+ button on product details page of your store
|
10 |
-
<description>This extension will be add Google+ button on product details page of your store
|
11 |
-
<notes>This extension will be add Google
|
12 |
-
<authors><author><name>
|
13 |
-
<date>2012-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="VS"><dir name="Googleplus"><dir name="Block"><file name="About.php" hash="714693963a86da5d7e43a8a104329ffe"/><file name="googleplus.php" hash="8749b51b1da7ec9abe26a32de3688c6e"/></dir><dir name="Helper"><file name="Data.php" hash="62a0d104dbb4edf1677a34082bfbe5c8"/></dir><dir name="Model"><file name="Button.php" hash="e4f3a1f932b102169a80aa441d9c7e88"/></dir><dir name="etc"><file name="config.xml" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>VS_GooglePlus</name>
|
4 |
+
<version>1.1.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 will be add Google+ button on product details page of your store. </summary>
|
10 |
+
<description>This extension will be add Google+ button on product details page of your store. </description>
|
11 |
+
<notes>This extension will be add Google+ 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-29</date>
|
14 |
+
<time>09:10:18</time>
|
15 |
+
<contents><target name="magecommunity"><dir><dir name="VS"><dir name="Googleplus"><dir><dir name="Block"><file name="About.php" hash="714693963a86da5d7e43a8a104329ffe"/><file name="googleplus.php" hash="8749b51b1da7ec9abe26a32de3688c6e"/></dir><dir name="Helper"><file name="Data.php" hash="62a0d104dbb4edf1677a34082bfbe5c8"/></dir><dir name="Model"><file name="Annotation.php" hash="c328aba23bf63fdabae0370d76ab8394"/><file name="Button.php" hash="e4f3a1f932b102169a80aa441d9c7e88"/></dir><dir name="etc"><file name="config.xml" hash="63a45df5d827a18165823790ee3cf4fa"/><file name="system.xml" hash="4d42a9376b1fbe0bf79173d702c7be50"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="googleplus"><file name="googleplus.phtml" hash="08324382791d1ed6435e4f533eac7f91"/></dir></dir><dir name="layout"><file name="googleplus.xml" hash="3ba53aca50b370e585984f9506296486"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="VS_Googleplus.xml" hash="7f34ab0b56c00a5d1600b3608b6cccbb"/></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>
|