addwish - Version 0.0.1

Version Notes

Addwish extension for Magento ecommerce solutions. Please note that you need an addwish ID to be able to download the extension. Get an ID by creating an addwish account. (Add link to sign in page)

Download this release

Release Info

Developer Magento Core Team
Extension addwish
Version 0.0.1
Comparing to
See all releases


Version 0.0.1

app/code/local/Addwish/Addwish/Block/Toggle.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Addwish_Block_Toggle extends Mage_Core_Block_Template
4
+ {
5
+ public function _prepareLayout()
6
+ {
7
+ if (!Mage::getStoreConfigFlag('addwish/general/enabled')) return;
8
+ $layout = $this->getLayout();
9
+ $beforeBodyEnd = $layout->getBlock('before_body_end');
10
+ if (is_object($beforeBodyEnd)) {
11
+ // --- js file ---
12
+ $block = $layout->getBlock('addwish');
13
+ if (!is_object($block)) {
14
+ $block = $layout->createBlock('core/template', 'addwish')
15
+ ->setTemplate('addwish/js.phtml');
16
+ }
17
+ $beforeBodyEnd->append($block);
18
+ }
19
+ }
20
+ }
app/code/local/Addwish/Addwish/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Addwish_Addwish_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Addwish/Addwish/etc/config.xml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Addwish_Addwish>
5
+ <version>0.0.1</version>
6
+ </Addwish_Addwish>
7
+ </modules>
8
+ <frontend>
9
+ <layout>
10
+ <updates>
11
+ <addwish>
12
+ <file>addwish.xml</file>
13
+ </addwish>
14
+ </updates>
15
+ </layout>
16
+ </frontend>
17
+ <adminhtml>
18
+ <acl>
19
+ <resources>
20
+ <all>
21
+ <title>Allow Everything</title>
22
+ </all>
23
+ <admin>
24
+ <children>
25
+ <system>
26
+ <children>
27
+ <config>
28
+ <children>
29
+ <addwish translate="title" module="addwish">
30
+ <title><![CDATA[Addwish: Addwish]]></title>
31
+ <sort_order>2000</sort_order>
32
+ </addwish>
33
+ </children>
34
+ </config>
35
+ </children>
36
+ </system>
37
+ </children>
38
+ </admin>
39
+ </resources>
40
+ </acl>
41
+ </adminhtml>
42
+ <global>
43
+ <blocks>
44
+ <addwish>
45
+ <class>Addwish_Addwish_Block</class>
46
+ </addwish>
47
+ </blocks>
48
+ <helpers>
49
+ <addwish>
50
+ <class>Addwish_Addwish_Helper</class>
51
+ </addwish>
52
+ </helpers>
53
+ </global>
54
+ <!--<default>
55
+ <addwish>
56
+ <general>
57
+ <enabled>1</enabled>
58
+ <include_jquery>1</include_jquery>
59
+ <include_waypoints>1</include_waypoints>
60
+ <version>1.1.1</version>
61
+ </general>
62
+ </addwish>
63
+ </default>-->
64
+ </config>
app/code/local/Addwish/Addwish/etc/system.xml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <addwish translate="label" module="addwish">
5
+ <label>Addwish</label>
6
+ <sort_order>150</sort_order>
7
+ </addwish>
8
+ </tabs>
9
+ <sections>
10
+ <addwish translate="label" module="addwish">
11
+ <label>Addwish</label>
12
+ <tab>addwish</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>200</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
+ <general translate="label">
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</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
+ <enabled translate="label">
28
+ <label>Enable</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</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>1</show_in_store>
35
+ </enabled>
36
+ <id translate="label comment">
37
+ <label>Addwish ID</label>
38
+ <comment>Please enter your addwish ID.
39
+ If you don't have an addwish ID, please go to http://addwish.com/company/frontpage.html and sign up for a free account.
40
+ You can see your ID at the end of the sign-up process.
41
+ </comment>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>15</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </id>
48
+ </fields>
49
+ </general>
50
+ </groups>
51
+ </addwish>
52
+ </sections>
53
+ </config>
app/design/frontend/default/default/layout/addwish.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <block type="addwish/toggle"></block>
5
+ </default>
6
+ <catalog_product_view>
7
+ <reference name="head">
8
+ <block type="catalog/product_view" name="addwish_meta" template="addwish/product_meta.phtml" />
9
+ </reference>
10
+ </catalog_product_view>
11
+ </layout>
app/design/frontend/default/default/template/addwish/js.phtml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $addwishId = Mage::getStoreConfig('addwish/general/id'); ?>
2
+ <script type="text/javascript">
3
+ //<![CDATA[
4
+ (function() {
5
+ var gms = document.createElement('script'); gms.type = 'text/javascript';
6
+ if(typeof gms.async != "undefined") {gms.async = true;}
7
+ gms.src = (window.location.protocol == 'https' ? 'https://www.' : 'http://cdn.') +
8
+ 'addwish.com/scripts/company/awAddGift.js#<?php echo $addwishId ?>';
9
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gms, s);
10
+ })();
11
+ //]]>
12
+ </script>
app/design/frontend/default/default/template/addwish/product_meta.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfigFlag('addwish/general/enabled')): ?>
2
+ <?php
3
+ $_helper = $this->helper('catalog/output');
4
+ $_product = $this->getProduct();
5
+ $orgImageHeight = (int) $this->helper('catalog/image')->init($_product, 'image')->getOriginalHeight();
6
+ $orgImageWidth = (int) $this->helper('catalog/image')->init($_product, 'image')->getOriginalWidth();
7
+ ?>
8
+ <?php if ($orgImageHeight > 768): ?>
9
+ <?php $imageHeight = 400; ?>
10
+ <?php $imageWidth = $imageHeight * $orgImageWidth / $orgImageHeight; ?>
11
+ <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize($imageWidth, $imageHeight); ?>" />
12
+ <?php else: ?>
13
+ <meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" />
14
+ <?php endif; ?>
15
+ <meta property="og:title" content="<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>" />
16
+ <meta property="og:price" content="<?php echo $_product->getFinalPrice() ?>" />
17
+ <?php endif; ?>
18
+
19
+ <script type="text/javascript">
20
+ document.observe("dom:loaded", function() {
21
+ var metaImageCount = 0;
22
+ var metaTitleCount = 0;
23
+ var metaPriceCount = 0;
24
+
25
+ metaCollection = document.getElementsByTagName('meta');
26
+
27
+ for (i=0;i<metaCollection.length;i++) {
28
+ meta = metaCollection[i];
29
+
30
+ if (meta.getAttribute("property") == "og:image") {
31
+ if (metaImageCount++ > 0)
32
+ meta.parentNode.removeChild(meta);
33
+ }
34
+
35
+ if (meta.getAttribute("property") == "og:title") {
36
+ if (metaTitleCount++ > 0)
37
+ meta.parentNode.removeChild(meta);
38
+ }
39
+
40
+ if (meta.getAttribute("property") == "og:price") {
41
+ if (metaPriceCount++ > 0)
42
+ meta.parentNode.removeChild(meta);
43
+ }
44
+ }
45
+ });
46
+ </script>
app/etc/modules/Addwish_Addwish.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Addwish_Addwish>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Addwish_Addwish>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>addwish</name>
4
+ <version>0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Free wish list functionality on your web shop plus promotion of your products on the addwish.com site.</summary>
10
+ <description>Addwish is a wish list that lets users share the products they want with the people who want to buy them. But unlike other wish lists, with addwish your products also appear as inspiration in searches for similar products on addwish.com.</description>
11
+ <notes>Addwish extension for Magento ecommerce solutions. Please note that you need an addwish ID to be able to download the extension. Get an ID by creating an addwish account. (Add link to sign in page)</notes>
12
+ <authors><author><name>addwish</name><user>auto-converted</user><email>sales@addwish.com</email></author></authors>
13
+ <date>2013-10-01</date>
14
+ <time>17:41:04</time>
15
+ <contents><target name="magelocal"><dir name="Addwish"><dir name="Addwish"><dir name="Block"><file name="Toggle.php" hash="319a199b5fdea2ac85662e4b36e7cf57"/></dir><dir name="Helper"><file name="Data.php" hash="3b59bdb805d9736d854906b15b28269b"/></dir><dir name="etc"><file name="config.xml" hash="b277cf69bc5772d4383ddf8c91967c86"/><file name="system.xml" hash="44a585d05ce2715eba8aedc4b76cc3f2"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Addwish_Addwish.xml" hash="e48317efb40c5cb1bd2b2c76f7ad3c84"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="addwish.xml" hash="355a937614a77cd7f10f1e5df1ab0f6d"/></dir><dir name="template"><dir name="addwish"><file name="js.phtml" hash="270fedf45e9b16f4e40c826e15976f5d"/><file name="product_meta.phtml" hash="4051463221d7ccb76edc2b6afa67e147"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>