Trendyr_Trendyrshare - Version 1.0.3

Version Notes

Refactored

Download this release

Release Info

Developer Steve Barbera
Extension Trendyr_Trendyrshare
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/{local → community}/Trendyr/Trendyrshare/Block/Sales/Order/Total.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Block/Template.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Helper/Data.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Model/Observer.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Model/Sales/Order/Total/Creditmemo/Trendyr.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Model/Sales/Order/Total/Invoice/Trendyr.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Model/Sales/Quote/Address/Total/Trendyrshare.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/Model/Trendyrshare.php RENAMED
@@ -6,8 +6,6 @@ class Trendyr_Trendyrshare_Model_Trendyrshare extends Varien_Object{
6
 
7
  public static function getTrendyrshare()
8
  {
9
-
10
-
11
 
12
  //if there's not a merch key, shut it down.
13
  if(!$merchant_public_key = self::get_merch_key()){return false;}
6
 
7
  public static function getTrendyrshare()
8
  {
 
 
9
 
10
  //if there's not a merch key, shut it down.
11
  if(!$merchant_public_key = self::get_merch_key()){return false;}
app/code/{local → community}/Trendyr/Trendyrshare/controllers/IndexController.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/etc/config.xml RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/sql/trendyrshare_setup/mysql4-install-1.0.php RENAMED
File without changes
app/code/{local → community}/Trendyr/Trendyrshare/templates/form_block_action.phtml RENAMED
@@ -14,34 +14,41 @@ $trendyr_url_live = 'https://api.trendyr.com/trendyr.js';
14
  $read_connection = $resource->getConnection('core_read');
15
  $table_name = $resource->getTableName('trendyrshare');
16
 
17
- if($_POST['update'] == 1)
18
- {
19
- //check if key exists in the db already.
20
 
21
- $write_connection = $resource->getConnection('core_write');
22
-
23
- if($_POST['merchantkey'])
24
  {
25
- $binds = array('merchantkey'=>$_POST['merchantkey']);
26
- $q = "UPDATE $table_name SET merchantkey=:merchantkey WHERE id=1";
27
- $write_connection->query($q, $binds);
28
- }
29
 
30
- if($_POST['jsmode'])
31
- {
32
- echo 'fired jsmode';
33
- $jsmode = $_POST['jsmode'];
34
- $q = "UPDATE $table_name SET jsmode='$jsmode' WHERE id=1";
35
- $write_connection->query($q);
 
 
 
 
 
 
 
 
 
 
 
36
 
 
 
 
 
37
  }
38
 
39
- $binds = array('tcopy'=>$_POST['tcopy']);
40
- $q = "UPDATE $table_name SET tcopy=:tcopy WHERE id=1";
41
- $write_connection->query($q, $binds);
42
-
43
  }
44
 
 
 
45
  //setup the form
46
  $q = "SELECT * from $table_name";
47
  $r = $read_connection->fetchAll($q);
14
  $read_connection = $resource->getConnection('core_read');
15
  $table_name = $resource->getTableName('trendyrshare');
16
 
 
 
 
17
 
18
+ if(isset($_POST['update']))
19
+ {
20
+ if($_POST['update'] == 1)
21
  {
22
+ //check if key exists in the db already.
 
 
 
23
 
24
+ $write_connection = $resource->getConnection('core_write');
25
+
26
+ if($_POST['merchantkey'])
27
+ {
28
+ $binds = array('merchantkey'=>$_POST['merchantkey']);
29
+ $q = "UPDATE $table_name SET merchantkey=:merchantkey WHERE id=1";
30
+ $write_connection->query($q, $binds);
31
+ }
32
+
33
+ if($_POST['jsmode'])
34
+ {
35
+ echo 'fired jsmode';
36
+ $jsmode = $_POST['jsmode'];
37
+ $q = "UPDATE $table_name SET jsmode='$jsmode' WHERE id=1";
38
+ $write_connection->query($q);
39
+
40
+ }
41
 
42
+ $binds = array('tcopy'=>$_POST['tcopy']);
43
+ $q = "UPDATE $table_name SET tcopy=:tcopy WHERE id=1";
44
+ $write_connection->query($q, $binds);
45
+
46
  }
47
 
 
 
 
 
48
  }
49
 
50
+
51
+
52
  //setup the form
53
  $q = "SELECT * from $table_name";
54
  $r = $read_connection->fetchAll($q);
app/design/frontend/default/default/template/trendyrshare/cart_trendyr_button.phtml DELETED
@@ -1,42 +0,0 @@
1
- <?php if($_SESSION['trendyr']) :?>
2
- <?php
3
- $resource = Mage::getSingleton('core/resource');
4
- $read_connection = $resource->getConnection('core_read');
5
- $table_name = $resource->getTableName('trendyrshare');
6
- $q = "SELECT * from $table_name";
7
- $r = $read_connection->fetchAll($q);
8
- $jsmode = $r[0]['jsmode'];
9
- ?>
10
-
11
- <script type="text/javascript" src="<?=$jsmode?>"></script>
12
-
13
-
14
- <?php if($_SESSION['trendyr']['btn_msg_code'] != 2) : ?>
15
- <?php
16
- //get the notes val from the db
17
-
18
-
19
- $tcopy = $r[0]['tcopy'];
20
- $tcopy = preg_replace("@\"@", '\"', $tcopy); //get rid of any double quote issues.
21
-
22
- ?>
23
- <script type="text/javascript">
24
- //Load the Trendyr Javascript Library
25
- window.onload = function(){
26
- //Add any addtional notices or notes to the modal window
27
- var notes = "<?=$tcopy?>";
28
-
29
- //Instantiate the Trendyr Javascript Library
30
- //Include the Transaction Social Key
31
- var trendyr = new Trendyr("<?=$_SESSION['trendyr']['transaction_social_key']?>", notes);
32
- trendyr.createButton();
33
- //When the window is closed refresh the window
34
- trendyr.onClose(function(result){
35
- window.location.reload();
36
- });
37
- };
38
- </script>
39
- <div href="#" id="Trendyr-Button"></div>
40
- <?php endif; ?>
41
-
42
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/trendyrshare/on_success.phtml DELETED
@@ -1,20 +0,0 @@
1
- <?php if($_SESSION['trendyr']) : ?>
2
- <?php
3
-
4
- $resource = Mage::getSingleton('core/resource');
5
- $read_connection = $resource->getConnection('core_read');
6
- $table_name = $resource->getTableName('trendyrshare');
7
- $q = "SELECT * from $table_name";
8
- $r = $read_connection->fetchAll($q);
9
- $jsmode = $r[0]['jsmode'];
10
- $url = $jsmode;
11
-
12
-
13
- ?>
14
- <script type="text/javascript" src="<?=$url?>"></script>
15
- <script>
16
- var trendyr = new Trendyr('<?=$_SESSION['trendyr']['transaction_social_key']?>');
17
- trendyr.transactionComplete();
18
- </script>
19
- <?php unset($_SESSION['trendyr']); ?>
20
- <?php endif;?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Trendyr_Trendyrshare.xml CHANGED
@@ -3,7 +3,7 @@
3
  <modules>
4
  <Trendyr_Trendyrshare>
5
  <active>true</active>
6
- <codePool>local</codePool>
7
  </Trendyr_Trendyrshare>
8
  </modules>
9
  </config>
3
  <modules>
4
  <Trendyr_Trendyrshare>
5
  <active>true</active>
6
+ <codePool>community</codePool>
7
  </Trendyr_Trendyrshare>
8
  </modules>
9
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Trendyr_Trendyrshare</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/apachepl.php">ASL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Trendyr module allows sharing of products on social networks for a discount</summary>
10
- <description>Trendyr module allows sharing of products on social networks for a discount</description>
11
- <notes>Tendyr module repackaged with createButton() features.</notes>
12
- <authors><author><name>Steve Barbera</name><user>Trendyr</user><email>info@trendyr.com</email></author></authors>
13
- <date>2012-08-16</date>
14
- <time>15:31:39</time>
15
- <contents><target name="magelocal"><dir name="Trendyr"><dir name="Trendyrshare"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Total.php" hash="411a319e2b492a22544bef8809802b7a"/></dir></dir><file name="Template.php" hash="92d8091e27a0c02f34115ae94faa00db"/></dir><dir name="Helper"><file name="Data.php" hash="5ff36855d52b16de7cf6ac9c29469c3e"/></dir><dir name="Model"><file name="Observer.php" hash="21afccea7c98498c73a8cc708b239755"/><dir name="Sales"><dir name="Order"><dir name="Total"><dir name="Creditmemo"><file name="Trendyr.php" hash="46790941ddf158f1a34a180e35a8205a"/></dir><dir name="Invoice"><file name="Trendyr.php" hash="2a313d89b5ee0ccc004153555b70aac9"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Trendyrshare.php" hash="4914701d5fa568a1267b738836c3cca6"/></dir></dir></dir></dir><file name="Trendyrshare.php" hash="013dd61cb622d2247b2e7dcddea4be46"/></dir><dir name="controllers"><file name="IndexController.php" hash="868c96c7b48becda2b4803f11595e9e7"/></dir><dir name="etc"><file name="config.xml" hash="14229c1257a637cc7c0846de73b811c5"/></dir><dir name="sql"><dir name="trendyrshare_setup"><file name="mysql4-install-1.0.php" hash="008622ca2016ec58ef38458ca8f3de32"/></dir></dir><dir name="templates"><file name="form_block_action.phtml" hash="a6ec2f3c540fa0cb128dd65dc8a0b70f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="trendyrshare.xml" hash="0b8577cc69cf51735414180da439df24"/></dir><dir name="template"><dir name="trendyrshare"><file name="cart_trendyr_button.phtml" hash="1338073a019aa8d07bdff1a5970bb582"/><file name="on_success.phtml" hash="3d5173afa1f42c1147879e035fb57769"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Trendyr_Trendyrshare.xml" hash="8ba423b88e654a90e0b9fb4a695aa7f9"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.17</min><max>5.3.15</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Trendyr_Trendyrshare</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
+ <license uri="http://www.apache.org/licenses/LICENSE-2.0">ASL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Trendyr social share productions on checkout</summary>
10
+ <description>Trendyr social share productions on checkout</description>
11
+ <notes>Refactored</notes>
12
+ <authors><author><name>Steve Barbera</name><user>trendyr</user><email>info@trendyr.com</email></author></authors>
13
+ <date>2012-08-21</date>
14
+ <time>20:16:42</time>
15
+ <contents><target name="magecommunity"><dir name="Trendyr"><dir name="Trendyrshare"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Total.php" hash="411a319e2b492a22544bef8809802b7a"/></dir></dir><file name="Template.php" hash="92d8091e27a0c02f34115ae94faa00db"/></dir><dir name="Helper"><file name="Data.php" hash="5ff36855d52b16de7cf6ac9c29469c3e"/></dir><dir name="Model"><file name="Observer.php" hash="21afccea7c98498c73a8cc708b239755"/><dir name="Sales"><dir name="Order"><dir name="Total"><dir name="Creditmemo"><file name="Trendyr.php" hash="46790941ddf158f1a34a180e35a8205a"/></dir><dir name="Invoice"><file name="Trendyr.php" hash="2a313d89b5ee0ccc004153555b70aac9"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Trendyrshare.php" hash="4914701d5fa568a1267b738836c3cca6"/></dir></dir></dir></dir><file name="Trendyrshare.php" hash="807d5af85a1dfc623c29c94a1424b228"/></dir><dir name="controllers"><file name="IndexController.php" hash="868c96c7b48becda2b4803f11595e9e7"/></dir><dir name="etc"><file name="config.xml" hash="14229c1257a637cc7c0846de73b811c5"/></dir><dir name="sql"><dir name="trendyrshare_setup"><file name="mysql4-install-1.0.php" hash="008622ca2016ec58ef38458ca8f3de32"/></dir></dir><dir name="templates"><file name="form_block_action.phtml" hash="e1b85bf81d98e21f4bc7ef696b55ad6c"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="trendyrshare.xml" hash="0b8577cc69cf51735414180da439df24"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Trendyr_Trendyrshare.xml" hash="be570b8cfdb7114f6af540fb56454ffe"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.17</min><max>5.3.15</max></php></required></dependencies>
18
  </package>