Clipix_Save_Button - Version 0.1.0

Version Notes

Initial Release

Download this release

Release Info

Developer Roman Chen
Extension Clipix_Save_Button
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Clipix/SaveButton/Block/SaveButton.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Clipix_SaveButton_Block_SaveButton extends Mage_Core_Block_Template
4
+ {
5
+ public $color;
6
+ public $size;
7
+ public $language;
8
+
9
+ /**
10
+ * Constructor. Set template.
11
+ */
12
+ protected function _construct()
13
+ {
14
+ if (Mage::getStoreConfig('Clipix_SaveButton_Config/configuration/Clipix_SaveButton_Enabled')) {
15
+ parent::_construct();
16
+ $this->setTemplate('clipix/savebutton.phtml');
17
+ $this->color = Mage::getStoreConfig('Clipix_SaveButton_Config/configuration/Clipix_SaveButton_Color');
18
+ $this->size = Mage::getStoreConfig('Clipix_SaveButton_Config/configuration/Clipix_SaveButton_Size');
19
+ $this->language = Mage::getStoreConfig('Clipix_SaveButton_Config/configuration/Clipix_SaveButton_Language');
20
+ }
21
+ }
22
+
23
+ protected function getColor() {
24
+ return $this->color;
25
+ }
26
+
27
+ protected function getSize() {
28
+ return $this->size;
29
+ }
30
+
31
+ protected function getLanguage() {
32
+ return $this->language;
33
+ }
34
+
35
+ protected function getOpt() {
36
+ $_color = $this->getColor();
37
+ $_size = $this->getSize();
38
+ switch ($_color) {
39
+ case "gray":
40
+ switch ($_size)
41
+ {
42
+ case "small":
43
+ return 1;
44
+ break;
45
+ case "medium":
46
+ return 2;
47
+ break;
48
+ case "large":
49
+ return 3;
50
+ break;
51
+ }
52
+ break;
53
+ case "orange":
54
+ switch ($_size)
55
+ {
56
+ case "small":
57
+ return 4;
58
+ break;
59
+ case "medium":
60
+ return 5;
61
+ break;
62
+ case "large":
63
+ return 6;
64
+ break;
65
+ }
66
+ break;
67
+ case "white":
68
+ switch ($_size)
69
+ {
70
+ case "small":
71
+ return 7;
72
+ break;
73
+ case "medium":
74
+ return 8;
75
+ break;
76
+ case "large":
77
+ return 9;
78
+ break;
79
+ }
80
+ break;
81
+ }
82
+
83
+ return 1;
84
+ }
85
+
86
+ }
87
+ ?>
app/code/community/Clipix/SaveButton/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Clipix_SaveButton_Helper_Data extends Mage_Core_Helper_Abstract {
3
+
4
+ }
5
+ ?>
app/code/community/Clipix/SaveButton/Model/Color.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Clipix_SaveButton_Model_Color
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>'gray', 'label'=>Mage::helper('Clipix_SaveButton')->__('Gray')),
8
+ array('value'=>'white', 'label'=>Mage::helper('Clipix_SaveButton')->__('White')),
9
+ array('value'=>'orange', 'label'=>Mage::helper('Clipix_SaveButton')->__('Orange')),
10
+ );
11
+ }
12
+
13
+ }
14
+ ?>
app/code/community/Clipix/SaveButton/Model/Enable.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Clipix_SaveButton_Model_Enable
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>1, 'label'=>Mage::helper('Clipix_SaveButton')->__('Yes')),
8
+ array('value'=>0, 'label'=>Mage::helper('Clipix_SaveButton')->__('No')),
9
+ );
10
+ }
11
+
12
+ }
13
+ ?>
app/code/community/Clipix/SaveButton/Model/Language.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Clipix_SaveButton_Model_Language
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>'en', 'label'=>Mage::helper('Clipix_SaveButton')->__('English')),
8
+ array('value'=>'es', 'label'=>Mage::helper('Clipix_SaveButton')->__('español')),
9
+ array('value'=>'fr', 'label'=>Mage::helper('Clipix_SaveButton')->__('français')),
10
+ array('value'=>'he', 'label'=>Mage::helper('Clipix_SaveButton')->__('עברית')),
11
+ array('value'=>'zh', 'label'=>Mage::helper('Clipix_SaveButton')->__('中文')),
12
+ array('value'=>'it', 'label'=>Mage::helper('Clipix_SaveButton')->__('italiano')),
13
+ array('value'=>'tr', 'label'=>Mage::helper('Clipix_SaveButton')->__('Türkçe')),
14
+ array('value'=>'de', 'label'=>Mage::helper('Clipix_SaveButton')->__('Deutsch')),
15
+ array('value'=>'pt', 'label'=>Mage::helper('Clipix_SaveButton')->__('Português')),
16
+ array('value'=>'ko', 'label'=>Mage::helper('Clipix_SaveButton')->__('한국어')),
17
+ array('value'=>'ja', 'label'=>Mage::helper('Clipix_SaveButton')->__('日本語')),
18
+ array('value'=>'ru', 'label'=>Mage::helper('Clipix_SaveButton')->__('русский')),
19
+ );
20
+ }
21
+
22
+ }
23
+ ?>
app/code/community/Clipix/SaveButton/Model/Size.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Clipix_SaveButton_Model_Size
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>'small', 'label'=>Mage::helper('Clipix_SaveButton')->__('Small')),
8
+ array('value'=>'medium', 'label'=>Mage::helper('Clipix_SaveButton')->__('Medium')),
9
+ array('value'=>'large', 'label'=>Mage::helper('Clipix_SaveButton')->__('Large')),
10
+ );
11
+ }
12
+
13
+ }
14
+ ?>
app/code/community/Clipix/SaveButton/etc/config.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Clipix_SaveButton>
5
+ <version>1.0.0.0</version>
6
+ </Clipix_SaveButton>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <Clipix_SaveButton>
11
+ <class>Clipix_SaveButton_Block</class>
12
+ </Clipix_SaveButton>
13
+ </blocks>
14
+ <helpers>
15
+ <Clipix_SaveButton>
16
+ <class>Clipix_SaveButton_Helper</class>
17
+ </Clipix_SaveButton>
18
+ </helpers>
19
+ <models>
20
+ <Clipix_SaveButton>
21
+ <class>Clipix_SaveButton_Model</class>
22
+ </Clipix_SaveButton>
23
+ </models>
24
+ </global>
25
+
26
+ <frontend>
27
+ <layout>
28
+ <updates>
29
+ <Clipix_SaveButton>
30
+ <file>clipix/savebutton.xml</file>
31
+ </Clipix_SaveButton>
32
+ </updates>
33
+ </layout>
34
+ </frontend>
35
+ <adminhtml>
36
+ <acl>
37
+ <resources>
38
+ <admin>
39
+ <children>
40
+ <system>
41
+ <children>
42
+ <config>
43
+ <children>
44
+ <Clipix_SaveButton_Config>
45
+ <title>Clipix Save Button Configuration</title>
46
+ </Clipix_SaveButton_Config>
47
+ </children>
48
+ </config>
49
+ </children>
50
+ </system>
51
+ </children>
52
+ </admin>
53
+ </resources>
54
+ </acl>
55
+ </adminhtml>
56
+ </config>
app/code/community/Clipix/SaveButton/etc/system.xml ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <Clipix_SaveButton translate="label" module="Clipix_SaveButton">
5
+ <label>Clipix</label>
6
+ <sort_order>600</sort_order>
7
+ </Clipix_SaveButton>
8
+ </tabs>
9
+ <sections>
10
+ <Clipix_SaveButton_Config translate="label" module="Clipix_SaveButton">
11
+ <label>SaveButton</label>
12
+ <tab>Clipix_SaveButton</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>100</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <configuration translate="label">
20
+ <label>Clipix Save Button Configuration</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <Clipix_SaveButton_Enabled translate="label" module="Clipix_SaveButton">
28
+ <label>Enable</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>Clipix_SaveButton/enable</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>0</show_in_store>
35
+ </Clipix_SaveButton_Enabled>
36
+ <Clipix_SaveButton_Color>
37
+ <label>Color</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>Clipix_SaveButton/color</source_model>
40
+ <sort_order>2</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
+ </Clipix_SaveButton_Color>
45
+ <Clipix_SaveButton_Size translate="label" module="Clipix_SaveButton">
46
+ <label>Size</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>Clipix_SaveButton/size</source_model>
49
+ <sort_order>3</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
+ </Clipix_SaveButton_Size>
54
+ <Clipix_SaveButton_Language translate="label" module="Clipix_SaveButton">
55
+ <label>Language</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>Clipix_SaveButton/language</source_model>
58
+ <sort_order>4</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </Clipix_SaveButton_Language>
63
+ </fields>
64
+ </configuration>
65
+ </groups>
66
+ </Clipix_SaveButton_Config>
67
+ </sections>
68
+ </config>
app/design/frontend/base/default/layout/clipix/savebutton.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="1.0.0">
3
+ <catalog_product_view>
4
+ <reference name="product.info.extrahint">
5
+ <block type="Clipix_SaveButton/SaveButton" name="Clipix_SaveButton" />
6
+ </reference>
7
+ </catalog_product_view>
8
+ </layout>
app/design/frontend/base/default/template/clipix/savebutton.phtml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $language = $this->getLanguage();
3
+ $opt = $this->getOpt();
4
+ ?>
5
+ <!-- Place this code where you want to display the button -->
6
+ <div id='ClipixWidgetApiContainer'></div>
7
+ <!--
8
+ <div>Color: <?=$color?></div>
9
+ <div>Size: <?=$size?></div>
10
+ <div>Language: <?=$language?></div>
11
+ <div>Opt: <?=$opt?></div>
12
+ -->
13
+
14
+ <!-- Place this code in the head section of your page or before the close body tag -->
15
+ <script type="text/javascript">
16
+ var _cxWidget = _cxWidget || [];
17
+ _cxWidget.push(['version', '1.5']);
18
+ _cxWidget.push(['counter', 'on']);
19
+ _cxWidget.push(['language', '<?=$language?>']);
20
+ _cxWidget.push(['iconType', '6<?=$opt?>']);
21
+ _cxWidget.push(['shape', 'horizontal']);
22
+ (function () {
23
+ var cxw = document.createElement('script'); cxw.type = 'text/javascript'; cxw.async = true;
24
+ cxw.src = '//widget.clipix.com/ScriptWidget.js';
25
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cxw, s);
26
+ })();
27
+ </script>
app/etc/modules/Clipix_SaveButton.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Clipix_SaveButton>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Clipix_SaveButton>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Clipix_Save_Button</name>
4
+ <version>0.1.0</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>Add the Clipix "Save" Button to your online store and provide your visitors with an easy way to save any items they are considering to buy, but not ready to execute on.&#xD;
10
+ &lt;br&gt;&#xD;
11
+ When they are ready to purchase, instead of searching for items again they will now easily get back to your website, with one click of a button, to the exact product page to execute their purchase. Additionally, visitors can set a price drop alert for items that they save, which will automatically alert them when your merchandise goes on sale.</summary>
12
+ <description>Rather than having to manually copy/paste the "Save" button code for each product you create, this module will automatically add that code for you. Your visitors will have the option to save your product to clipix.com as a clip.</description>
13
+ <notes>Initial Release</notes>
14
+ <authors><author><name>Roman Chen</name><user>clipix</user><email>chenromandeveloper@gmail.com</email></author></authors>
15
+ <date>2015-10-02</date>
16
+ <time>15:47:02</time>
17
+ <contents><target name="magecommunity"><dir name="Clipix"><dir name="SaveButton"><dir name="Block"><file name="SaveButton.php" hash="fd130e29d6120383e81892df8908199a"/></dir><dir name="Helper"><file name="Data.php" hash="21acede4200a8f19f79acb678f1d44ce"/></dir><dir name="Model"><file name="Color.php" hash="fe75042d8706abf79db77e09cca3ed22"/><file name="Enable.php" hash="98226b9dad601f978f66ba34e55c37f2"/><file name="Language.php" hash="3daed31add110e4e619782d3c6bfc5d8"/><file name="Size.php" hash="cfa9c420b48ecd4924e890dd31c7a1d3"/></dir><dir name="etc"><file name="config.xml" hash="5089040483eeef977845dd87a08b61fc"/><file name="system.xml" hash="5eedfa8375798687847022ccdb80bbd9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="clipix"><file name="savebutton.xml" hash="d121f56ffb7bd2b52d89ba2f4c23f995"/></dir></dir><dir name="template"><dir name="clipix"><file name="savebutton.phtml" hash="b569e050bb415575862dda4fd84e1fa6"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Clipix_SaveButton.xml" hash="b0f4436154a8d3f53e9be1756ebbdcd1"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
+ </package>