Link_Iwish - Version 1.0.0

Version Notes

Initial release

Download this release

Release Info

Developer Lin.K N.V.
Extension Link_Iwish
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/LinK/Iwish/Block/Button.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: sgdesmet
5
+ * Date: 06/12/12
6
+ * Time: 17:16
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Link_Iwish_Block_Button extends Mage_Core_Block_Template
11
+ {
12
+
13
+ /**
14
+ * Constructor. Set template.
15
+ */
16
+ protected function _construct()
17
+ {
18
+ parent::_construct();
19
+ Mage::log('Constructed');
20
+ $this->setTemplate('iwish/button.phtml');
21
+ }
22
+
23
+ protected function _toHtml()
24
+ {
25
+ if (Mage::getStoreConfig('iwish_options/config/enabled'))
26
+ return parent::_toHtml();
27
+ else
28
+ return;
29
+ }
30
+
31
+
32
+ }
33
+
34
+ ?>
app/code/community/LinK/Iwish/Helper/Data.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ */
4
+ class Link_Iwish_Helper_Data extends Mage_Core_Helper_Abstract
5
+ {
6
+ }
7
+
8
+ ?>
app/code/community/LinK/Iwish/Model/ButtonSizes.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: sgdesmet
5
+ * Date: 10/12/12
6
+ * Time: 16:36
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Link_Iwish_Model_ButtonSizes
11
+ {
12
+ public function toOptionArray()
13
+ {
14
+ return array(
15
+ array('value'=>24, 'label'=>Mage::helper('iwish')->__('Small (24px)')),
16
+ array('value'=>50, 'label'=>Mage::helper('iwish')->__('Big (50px)')),
17
+ );
18
+ }
19
+
20
+ }
21
+
22
+ ?>
app/code/community/LinK/Iwish/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <iwish_options translate="title" module="iwish">
12
+ <title>iWish Button</title>
13
+ <sort_order>100</sort_order>
14
+ </iwish_options>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/LinK/Iwish/etc/config.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Link_Iwish>
5
+ <version>0.1.0</version>
6
+ </Link_Iwish>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <iwish>
11
+ <class>Link_Iwish_Block</class>
12
+ </iwish>
13
+ </blocks>
14
+ <helpers>
15
+ <iwish>
16
+ <class>Link_Iwish_Helper</class>
17
+ </iwish>
18
+ </helpers>
19
+ <models>
20
+ <iwish>
21
+ <class>Link_Iwish_Model</class>
22
+ </iwish>
23
+ </models>
24
+ </global>
25
+
26
+ <frontend>
27
+ <layout>
28
+ <updates>
29
+ <Link_Iwish>
30
+ <file>iwish.xml</file>
31
+ </Link_Iwish>
32
+ </updates>
33
+ </layout>
34
+ </frontend>
35
+
36
+ <default>
37
+ <iwish_options>
38
+ <config>
39
+ <enabled>1</enabled>
40
+ <size>24</size>
41
+ <jquery>1</jquery>
42
+ </config>
43
+ </iwish_options>
44
+ </default>
45
+
46
+ </config>
app/code/community/LinK/Iwish/etc/system.xml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ <tabs>
5
+ <iwish module="iwish" translate="label">
6
+ <label>IWish Button</label>
7
+ <sort_order>99999</sort_order>
8
+ </iwish>
9
+ </tabs>
10
+
11
+ <sections>
12
+ <iwish_options module="iwish" translate="label">
13
+ <label>Configuration</label>
14
+ <sort_order>1000</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
+ <tab>iwish</tab>
19
+
20
+ <groups>
21
+
22
+ <config translate="label" module="iwish">
23
+ <label>Options</label>
24
+ <comment><![CDATA[Configure how the iWish Button appears.]]></comment>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>1</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ <fields>
31
+ <enabled translate="label">
32
+ <label>Show button on product page</label>
33
+ <comment><![CDATA[No template changes are required, just enable the button.]]></comment>
34
+ <frontend_type>select</frontend_type>
35
+ <source_model>adminhtml/system_config_source_yesno</source_model>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_store>1</show_in_store>
38
+ <show_in_website>1</show_in_website>
39
+ <sort_order>100</sort_order>
40
+ </enabled>
41
+ <size translate="label">
42
+ <label>Button size</label>
43
+ <comment><![CDATA[No template changes are required, just enable the button.]]></comment>
44
+ <frontend_type>select</frontend_type>
45
+ <source_model>iwish/buttonsizes</source_model>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_store>1</show_in_store>
48
+ <show_in_website>1</show_in_website>
49
+ <sort_order>200</sort_order>
50
+ </size>
51
+ <jquery translate="label">
52
+ <label>Include jQuery</label>
53
+ <comment><![CDATA[jQuery is required for the iWish button to work]]></comment>
54
+ <frontend_type>select</frontend_type>
55
+ <source_model>adminhtml/system_config_source_yesno</source_model>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_store>1</show_in_store>
58
+ <show_in_website>1</show_in_website>
59
+ <sort_order>300</sort_order>
60
+ </jquery>
61
+ </fields>
62
+ </config>
63
+
64
+ </groups>
65
+
66
+ </iwish_options>
67
+ </sections>
68
+
69
+ </config>
app/design/frontend/base/default/layout/iwish.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout>
3
+ <catalog_product_view>
4
+ <update handle="add_iwish_button"></update>
5
+ </catalog_product_view>
6
+
7
+ <add_iwish_button>
8
+ <reference name="product.info.additional">
9
+ <block type="iwish/button" before="-" name="iwish_button" template="iwish/button.phtml" ifconfig="iwish_options/config/enabled"></block>
10
+ </reference>
11
+ <reference name="head">
12
+ <block type="core/text" after="-" name="iwish_jquery"><action method="setText" ifconfig="iwish_options/config/jquery"><text><![CDATA[<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>]]></text></action> </block>
13
+ <block type="core/text" after="-" name="iwish_jquery_noconflict"><action method="setText" ifconfig="iwish_options/config/jquery"><text><![CDATA[<script type="text/javascript">jQuery.noConflict();</script>]]></text></action> </block>
14
+ <block type="core/text" after="-" name="iwish_js"><action method="setText" ifconfig="iwish_options/config/enabled"><text><![CDATA[<script type="text/javascript" src="http://iwish.be/js/button.js"></script>]]></text></action> </block>
15
+ </reference>
16
+
17
+ </add_iwish_button>
18
+
19
+ </layout>
app/design/frontend/base/default/template/iwish/button.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <!-- TODO add header? -->
3
+ <h2>Add To</h2>
4
+ <div class="iwish-button"
5
+ data-size="<?php echo Mage::getStoreConfig('iwish_options/config/size'); ?>"
6
+ data-name="<?php echo Mage::registry('current_product')->getName(); ?>"
7
+ data-description="<?php echo Mage::registry('current_product')->getDescription(); ?>"
8
+ data-price="<?php echo Mage::registry('current_product')->getPrice(); ?>"
9
+ data-url="<?php echo Mage::registry('current_product')->getProductUrl(); ?>"
10
+ data-image="<?php echo Mage::registry('current_product')->getImageUrl(); ?>"><?php echo Mage::helper('iwish')->__('Add to my iWish');?></div>
app/etc/modules/Link_Iwish.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Link_IWish>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <!--<depends>-->
8
+ <!--<Mage_Cms />-->
9
+ <!--</depends>-->
10
+ </Link_IWish>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Link_Iwish</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Apache Software License </license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Add integration with universal iWish.be wishlists to your store.</summary>
10
+ <description>This extension offers free integration with the iWish.be universal wishlist site. &#xD;
11
+ &#xD;
12
+ Installing this plugin automatically adds the iWish.be button to each product page on your store, allowing users to add your products to their own wishlists with just a single click. Obviously, other iWish.be users wanting to purchase the product as a gift are directed back to your store.&#xD;
13
+ &#xD;
14
+ Configuration options for the iWish button are available in the Admin Panel (System -&gt; Configuration). Note that this plugin by default includes jQuery on your product page. You can disable this in the plugin's settings.&#xD;
15
+ &#xD;
16
+ To learn more about iWish, visit http://iwish.be</description>
17
+ <notes>Initial release</notes>
18
+ <authors><author><name>Lin.K N.V.</name><user>sgdesmet</user><email>magento@iwish.be</email></author></authors>
19
+ <date>2012-12-11</date>
20
+ <time>11:52:03</time>
21
+ <contents><target name="magecommunity"><dir name="LinK"><dir name="Iwish"><dir name="Block"><file name="Button.php" hash="67dbe47dfa713bfea939c96d60a38ee4"/></dir><dir name="Helper"><file name="Data.php" hash="a8712c3b6171eb45f27734d0d39969ee"/></dir><dir name="Model"><file name="ButtonSizes.php" hash="98b3d59419bab36cd863d972ea3bac92"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0432c60b691a70205f79316fbe730d37"/><file name="config.xml" hash="6b2c5d633011aadf310eeb0ae77f7eb4"/><file name="system.xml" hash="39d2db372f7aebe62c26f58b89634759"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="iwish"><file name="button.phtml" hash="fabd36d7c8f2a6f5ffa47cdd67d5fca5"/></dir></dir><dir name="layout"><file name="iwish.xml" hash="cc8042d40afb0b383ade8cec99bb7b2a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Link_Iwish.xml" hash="1904032fc1a1770ac0a0da479ff236e4"/></dir></target></contents>
22
+ <compatible/>
23
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
24
+ </package>