Svitla_IBoughtIt - Version 0.1.4

Version Notes

facebook responder

Download this release

Release Info

Developer Magento Core Team
Extension Svitla_IBoughtIt
Version 0.1.4
Comparing to
See all releases


Code changes from version 0.1.3 to 0.1.4

app/code/community/Svitla/Iboughtit/Block/Iboughtit.php CHANGED
@@ -1,17 +1,16 @@
1
  <?php
2
  class Svitla_Iboughtit_Block_Iboughtit extends Mage_Core_Block_Template
3
  {
4
- public function _prepareLayout()
5
- {
6
  return parent::_prepareLayout();
7
- }
8
-
9
- public function getIboughtit()
10
- {
11
- if (!$this->hasData('iboughtit')) {
12
- $this->setData('iboughtit', Mage::registry('iboughtit'));
13
- }
14
- return $this->getData('iboughtit');
15
-
16
- }
17
  }
1
  <?php
2
  class Svitla_Iboughtit_Block_Iboughtit extends Mage_Core_Block_Template
3
  {
4
+
5
+ public function _prepareLayout(){
6
  return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getIboughtit(){
10
+ if (!$this->hasData('iboughtit')) {
11
+ $this->setData('iboughtit', Mage::registry('iboughtit'));
12
+ }
13
+ return $this->getData('iboughtit');
14
+ }
15
+
 
16
  }
app/code/community/Svitla/Iboughtit/Block/Link.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Svitla_Iboughtit_Block_Link extends Mage_Core_Block_Template
3
+ {
4
+
5
+ public function _prepareLayout(){
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getIboughtit(){
10
+ if (!$this->hasData('iboughtit')) {
11
+ $this->setData('iboughtit', Mage::registry('iboughtit'));
12
+ }
13
+ return $this->getData('iboughtit');
14
+ }
15
+
16
+ }
app/code/community/Svitla/Iboughtit/Block/Script.php CHANGED
@@ -5,29 +5,11 @@ class Svitla_Iboughtit_Block_Script extends Mage_Core_Block_Template {
5
  const DEFAULT_ANCHOR = 'buttons-set';
6
 
7
  protected function _toHtml() {
8
-
9
  $res = '';
10
 
11
- if ($this->getAnchorClass() && $this->getAnchorClass() != self::DEFAULT_ANCHOR) {
12
- $anchorClass = $this->getAnchorClass();
13
- $res = parent::_toHtml();
14
- } else {
15
- $anchorClass = self::DEFAULT_ANCHOR;
16
- }
17
-
18
  if (Mage::helper('iboughtit')->isActive()) {
19
-
20
  $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
21
  $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
22
-
23
- if (Mage::helper('iboughtit')->isAutoplace()) {
24
- $res.='
25
- <script language="javascript" type="text/javascript">
26
- $$(\'.' . $anchorClass . '\').each(function(el){Element.insert(el,{before:\'<div id="ssFrame" style="float:left;"></div>\'});});
27
- </script>';
28
- }
29
-
30
-
31
  }
32
  //$sParams=Mage::getModel('core/url')->escape($sParams);
33
  $response=Mage::Helper('iboughtit')->getHash($orderId);
@@ -40,9 +22,4 @@ class Svitla_Iboughtit_Block_Script extends Mage_Core_Block_Template {
40
  return $res;
41
  }
42
 
43
- protected function getAnchorClass() {
44
- return Mage::helper('iboughtit')->getAnchorClass();
45
- }
46
-
47
-
48
  }
5
  const DEFAULT_ANCHOR = 'buttons-set';
6
 
7
  protected function _toHtml() {
 
8
  $res = '';
9
 
 
 
 
 
 
 
 
10
  if (Mage::helper('iboughtit')->isActive()) {
 
11
  $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
12
  $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
 
 
 
 
 
 
 
 
 
13
  }
14
  //$sParams=Mage::getModel('core/url')->escape($sParams);
15
  $response=Mage::Helper('iboughtit')->getHash($orderId);
22
  return $res;
23
  }
24
 
 
 
 
 
 
25
  }
app/code/community/Svitla/Iboughtit/Helper/Data.php CHANGED
@@ -42,10 +42,6 @@ class Svitla_Iboughtit_Helper_Data extends Mage_Catalog_Helper_Data {
42
  return false; //$this->getConfig()->getSandbox();
43
  }
44
 
45
- public function isAutoplace() {
46
- return $this->getAdvancedConfig()->getAuto();
47
- }
48
-
49
  public function isPopup() {
50
  return $this->getAdvancedConfig()->getPopup();
51
  }
@@ -62,10 +58,6 @@ class Svitla_Iboughtit_Helper_Data extends Mage_Catalog_Helper_Data {
62
  return $this->getAdvancedConfig()->getHeight();
63
  }
64
 
65
- public function getAnchorClass() {
66
- return $this->getConfig()->getAnchorCssClass();
67
- }
68
-
69
  public function getHash($orderId=null){
70
  $storedOrder=Mage::getSingleton('core/session')->getStoredOrder();
71
  if(isset($storedOrder) && is_array($storedOrder) && count($storedOrder)>0 && isset($storedOrder[$orderId])){
42
  return false; //$this->getConfig()->getSandbox();
43
  }
44
 
 
 
 
 
45
  public function isPopup() {
46
  return $this->getAdvancedConfig()->getPopup();
47
  }
58
  return $this->getAdvancedConfig()->getHeight();
59
  }
60
 
 
 
 
 
61
  public function getHash($orderId=null){
62
  $storedOrder=Mage::getSingleton('core/session')->getStoredOrder();
63
  if(isset($storedOrder) && is_array($storedOrder) && count($storedOrder)>0 && isset($storedOrder[$orderId])){
app/code/community/Svitla/Iboughtit/controllers/IndexController.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Svitla_Iboughtit_IndexController extends Mage_Core_Controller_Front_Action
4
+ {
5
+
6
+ function indexAction(){
7
+ $this->loadLayout();
8
+ $this->renderLayout();
9
+ }
10
+
11
+ }
app/code/community/Svitla/Iboughtit/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <Svitla_Iboughtit>
6
- <version>0.1.3</version>
7
  </Svitla_Iboughtit>
8
  </modules>
9
  <global>
@@ -24,6 +24,15 @@
24
  </helpers>
25
  </global>
26
  <frontend>
 
 
 
 
 
 
 
 
 
27
  <layout>
28
  <updates>
29
  <iboughtit>
3
  <config>
4
  <modules>
5
  <Svitla_Iboughtit>
6
+ <version>0.1.4</version>
7
  </Svitla_Iboughtit>
8
  </modules>
9
  <global>
24
  </helpers>
25
  </global>
26
  <frontend>
27
+ <routers>
28
+ <iboughtit>
29
+ <use>standard</use>
30
+ <args>
31
+ <module>Svitla_Iboughtit</module>
32
+ <frontName>iboughtit</frontName>
33
+ </args>
34
+ </iboughtit>
35
+ </routers>
36
  <layout>
37
  <updates>
38
  <iboughtit>
app/code/community/Svitla/Iboughtit/etc/system.xml CHANGED
@@ -32,7 +32,7 @@
32
  <label></label>
33
  <frontend_type>Hidden</frontend_type>
34
  <sort_order>20</sort_order>
35
- <comment><![CDATA[<button id="iboughtit_general_api_wizard" type="button" class="scalable" onclick="javascript:window.open('http://furiouspro.com/IboughtIt/retailers/signup?cart=magento', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=1100, height=600'); return false;" ><span> Get Account ID</span></button>]]>
36
  </comment>
37
  <show_in_default>1</show_in_default>
38
  <show_in_website>1</show_in_website>
@@ -47,16 +47,6 @@
47
  <show_in_website>1</show_in_website>
48
  <show_in_store>1</show_in_store>
49
  </enabled>
50
- <anchor_css_class translate="label">
51
- <label>Anchor class for css to position the IBoughtIt sharing banner</label>
52
- <frontend_type>text</frontend_type>
53
- <sort_order>40</sort_order>
54
- <show_in_default>1</show_in_default>
55
- <show_in_website>1</show_in_website>
56
- <show_in_store>1</show_in_store>
57
- <comment><![CDATA[Use the anchor text class to position the IBoughtIt sharing banner on the order confirmation page. Leave blank for default value <b>('buttons-set')</b> ]]>
58
- </comment>
59
- </anchor_css_class>
60
  <email translate="label">
61
  <label>Add to Confirmation Email</label>
62
  <frontend_type>select</frontend_type>
@@ -88,13 +78,6 @@
88
  else{
89
  $$('tr#row_iboughtit_general_enabled')[0].show();
90
  }
91
-
92
- if ( $$('tr#row_iboughtit_general_anchor_css_class')[0] == undefined) {
93
- $$('input#iboughtit_general_anchor_css_class')[0].up().up().show();
94
- }
95
- else{
96
- $$('tr#row_iboughtit_general_anchor_css_class')[0].show();
97
- }
98
  }
99
  else
100
  // Input Id is empty
@@ -112,12 +95,6 @@
112
  else{
113
  $$('#row_iboughtit_general_enabled')[0].hide();
114
  }
115
- if ( $$('tr#row_iboughtit_general_anchor_css_class')[0] == undefined) {
116
- $$('input#iboughtit_general_anchor_css_class')[0].up().up().hide();
117
- }
118
- else{
119
- $$('tr#row_iboughtit_general_anchor_css_class')[0].hide();
120
- }
121
  }
122
  }
123
 
@@ -137,15 +114,6 @@
137
  <show_in_website>1</show_in_website>
138
  <show_in_store>1</show_in_store>
139
  </js_script>
140
- <sandbox translate="label">
141
- <label>Use Sandbox</label>
142
- <frontend_type>select</frontend_type>
143
- <source_model>adminhtml/system_config_source_yesno</source_model>
144
- <sort_order>60</sort_order>
145
- <show_in_default>1</show_in_default>
146
- <show_in_website>1</show_in_website>
147
- <show_in_store>1</show_in_store>
148
- </sandbox>
149
  </fields>
150
  </general>
151
  <advanced translate="label">
32
  <label></label>
33
  <frontend_type>Hidden</frontend_type>
34
  <sort_order>20</sort_order>
35
+ <comment><![CDATA[<button id="iboughtit_general_api_wizard" type="button" class="scalable" onclick="javascript:window.open('http://i-bought-it.com/signup', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=1100, height=600'); return false;" ><span> Get Account ID</span></button>]]>
36
  </comment>
37
  <show_in_default>1</show_in_default>
38
  <show_in_website>1</show_in_website>
47
  <show_in_website>1</show_in_website>
48
  <show_in_store>1</show_in_store>
49
  </enabled>
 
 
 
 
 
 
 
 
 
 
50
  <email translate="label">
51
  <label>Add to Confirmation Email</label>
52
  <frontend_type>select</frontend_type>
78
  else{
79
  $$('tr#row_iboughtit_general_enabled')[0].show();
80
  }
 
 
 
 
 
 
 
81
  }
82
  else
83
  // Input Id is empty
95
  else{
96
  $$('#row_iboughtit_general_enabled')[0].hide();
97
  }
 
 
 
 
 
 
98
  }
99
  }
100
 
114
  <show_in_website>1</show_in_website>
115
  <show_in_store>1</show_in_store>
116
  </js_script>
 
 
 
 
 
 
 
 
 
117
  </fields>
118
  </general>
119
  <advanced translate="label">
app/design/frontend/base/default/layout/iboughtit.xml CHANGED
@@ -8,8 +8,8 @@
8
  </checkout_multishipping_success>
9
 
10
  <checkout_onepage_success translate="label">
11
- <reference name="content">
12
- <block type="iboughtit/script" name="iboughtit_success" after="-">
13
  <action method="setTemplate">
14
  <template>iboughtit/social.phtml</template>
15
  </action>
@@ -30,5 +30,14 @@
30
  <block type="iboughtit/email" name="iboughtit_email" />
31
  </reference>
32
  </sales_email_order_items>
 
 
 
 
 
 
 
 
 
33
 
34
  </layout>
8
  </checkout_multishipping_success>
9
 
10
  <checkout_onepage_success translate="label">
11
+ <reference name="checkout.success">
12
+ <block type="iboughtit/script" name="iboughtit_success" before="downloadable.checkout.success">
13
  <action method="setTemplate">
14
  <template>iboughtit/social.phtml</template>
15
  </action>
30
  <block type="iboughtit/email" name="iboughtit_email" />
31
  </reference>
32
  </sales_email_order_items>
33
+
34
+ <iboughtit_index_index>
35
+ <reference name="root">
36
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
37
+ </reference>
38
+ <reference name="content">
39
+ <block type="iboughtit/iboughtit" name="iboughtit_link" template="iboughtit/link.phtml" />
40
+ </reference>
41
+ </iboughtit_index_index>
42
 
43
  </layout>
app/design/frontend/base/default/template/iboughtit/link.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $sLinkId=$this->getRequest()->getParam('linkid');
3
+ ?>
4
+ <iframe name="iboughtit_link" width="685" height="571" id="iboughtit_link" style="border: 0px; padding-top: 10px; background: transparent;" src="http://i-bought-it.com/redirect/link/<?php echo $sLinkId; ?>"></iframe>
5
+
6
+
7
+
8
+
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Svitla_IBoughtIt</name>
4
- <version>0.1.3</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>Extension to recommend goods over social networks</summary>
10
  <description>Extension to recommend goods over social networks</description>
11
- <notes>sharing through emails</notes>
12
  <authors><author><name>Svitla</name><user>auto-converted</user><email>okhokhliuk@svitla.com</email></author></authors>
13
- <date>2012-07-18</date>
14
- <time>10:37:59</time>
15
- <contents><target name="magecommunity"><dir name="Svitla"><dir name="Iboughtit"><dir name="Block"><file name="Email.php" hash="b13dff4f97744b48bb6c24cde270d45a"/><file name="Iboughtit.php" hash="bb8f4f72f0e88546f961230ddc8c385b"/><file name="Script.php" hash="7f45b3cfd4471a399048b3f027c47a06"/><file name="Social.php" hash="fb546910c18fc4f808b6c0cb24157d23"/></dir><dir name="Helper"><file name="Data.php" hash="d3a6210d9d789fee118328d4cafef3ee"/></dir><dir name="Model"><file name="Iboughtit.php" hash="88ca3383b67908168a717ebc3781f635"/><file name="Status.php" hash="7f7e065cb80e95c5344731957f160d10"/></dir><dir name="etc"><file name="config.xml" hash="229b9cdbda82e20821c797467b0b10f8"/><file name="system.xml" hash="dc77118758c06e679586fab81947e6ec"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Svitla_Iboughtit.xml" hash="cb2ee7f8f58fb73c60f85ddf977a5f41"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="iboughtit"><file name="items.phtml" hash="92dcc460d264d6d5cbca634dcdd0b1f6"/><file name="social.phtml" hash="8d35064f3312f8f3cd224ef8f555d7bd"/></dir></dir><dir name="layout"><file name="iboughtit.xml" hash="04ae3aa0fe3bd8a4421006ca7b2b0a98"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Svitla_IBoughtIt</name>
4
+ <version>0.1.4</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>Extension to recommend goods over social networks</summary>
10
  <description>Extension to recommend goods over social networks</description>
11
+ <notes>facebook responder</notes>
12
  <authors><author><name>Svitla</name><user>auto-converted</user><email>okhokhliuk@svitla.com</email></author></authors>
13
+ <date>2012-07-24</date>
14
+ <time>10:29:42</time>
15
+ <contents><target name="magecommunity"><dir name="Svitla"><dir name="Iboughtit"><dir name="Block"><file name="Email.php" hash="b13dff4f97744b48bb6c24cde270d45a"/><file name="Iboughtit.php" hash="badd52e9ba20f2cc0fc3b60be82d1aee"/><file name="Link.php" hash="716af1f7464f1f05b9ac398e37dd1d0b"/><file name="Script.php" hash="09591f4e7d4aa96cf5e43ea3fbf5bc35"/><file name="Social.php" hash="fb546910c18fc4f808b6c0cb24157d23"/></dir><dir name="Helper"><file name="Data.php" hash="047eab8b03b07d3749ed995bc3fe8ad7"/></dir><dir name="Model"><file name="Iboughtit.php" hash="88ca3383b67908168a717ebc3781f635"/><file name="Status.php" hash="7f7e065cb80e95c5344731957f160d10"/></dir><dir name="controllers"><file name="IndexController.php" hash="2f0aed815ee879b456039bcd77f472c1"/></dir><dir name="etc"><file name="config.xml" hash="989d0140852905f50be6d23b7b6b6f32"/><file name="system.xml" hash="6b96dbfdd6a713da0acb290aa95f24d8"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Svitla_Iboughtit.xml" hash="cb2ee7f8f58fb73c60f85ddf977a5f41"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="iboughtit"><file name="items.phtml" hash="92dcc460d264d6d5cbca634dcdd0b1f6"/><file name="link.phtml" hash="fc3e3607c7ceaa1dff6b71fe148f5b01"/><file name="social.phtml" hash="8d35064f3312f8f3cd224ef8f555d7bd"/></dir></dir><dir name="layout"><file name="iboughtit.xml" hash="2aea6a6db9c2277466591a94cb5487aa"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>