Ambassador - Version 1.1.6

Version Notes

- added templates to base design
- allowed to overwrite mode

Download this release

Release Info

Developer Jeffrey Epstein
Extension Ambassador
Version 1.1.6
Comparing to
See all releases


Code changes from version 1.1.5 to 1.1.6

app/code/community/Ambassador/Event/controllers/CallbackController.php CHANGED
@@ -196,6 +196,9 @@ class Ambassador_Event_CallbackController extends Mage_Core_Controller_Front_Act
196
  );
197
 
198
  $variable->setData($variable_data);
 
 
 
199
  }
200
 
201
  try {
196
  );
197
 
198
  $variable->setData($variable_data);
199
+ } else {
200
+
201
+ $variable->setData('plain_value', $mode);
202
  }
203
 
204
  try {
app/design/frontend/base/default/template/ambassador/checkout/ecommerce.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $username = Mage::getModel('core/variable')->loadByCode('getambassador_username')->getValue('plain');
4
+ $campaign = Mage::getModel('core/variable')->loadByCode('getambassador_active_campaign')->getValue('plain');
5
+ $mode = Mage::getModel('core/variable')->loadByCode('getambassador_mode')->getValue('plain');
6
+
7
+ if ($mode === 'dev') {
8
+ $mbsy_url = 'http://mbsy.dev/';
9
+ } else {
10
+ $mbsy_url = 'https://mbsy.co/';
11
+ }
12
+
13
+ $checkout = Mage::getSingleton('checkout/session');
14
+ $lastId = $checkout->getLastOrderId();
15
+
16
+ if ($lastId) {
17
+ $order = Mage::getModel('sales/order');
18
+ $order->load($lastId);
19
+ $revenue = $order->getSubtotal()+$order->getDiscountAmount();
20
+ $transaction_id = $order->getRealOrderId();
21
+ } else {
22
+ $revenue = 0;
23
+ $transaction_id = false;
24
+ }
25
+
26
+ if (!empty($order)) {
27
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
28
+ $email = $order->getCustomerEmail();
29
+ $first_name = $order->getBillingAddress()->getFirstname();
30
+ $last_name = $order->getBillingAddress()->getLastname();
31
+ } else {
32
+ $email = '';
33
+ $first_name = '';
34
+ $last_name = '';
35
+ }
36
+
37
+ ?>
38
+
39
+ <script type="text/javascript">
40
+ var mbsy_campaign_uid='<?php echo $campaign ?>'; // Required
41
+ var mbsy_email='<?php echo $email ?>'; // Required - replace with your new customer's email
42
+ // Put additional optional variables here
43
+ var mbsy_revenue='<?php echo $revenue ?>'; // Required
44
+ var mbsy_first_name='<?php echo $first_name ?>';
45
+ var mbsy_last_name='<?php echo $last_name ?>';
46
+ <?php if (in_array($mbsy_is_approved, array('1', '0'))) { ?>
47
+ var mbsy_is_approved='<?php echo $mbsy_is_approved ?>';
48
+ <?php } ?>
49
+ <?php if ($transaction_id) { ?>
50
+ var mbsy_transaction_uid = '<?php echo $transaction_id ?>';
51
+ <?php } ?>
52
+ var addthis_config = {
53
+ data_track_clickback: false
54
+ }
55
+ var addthis_share = {
56
+ templates : {
57
+ twitter : "{{title}} {{url}} (via @GetAmbassador)"
58
+ }
59
+ }
60
+ </script>
61
+ <script type="text/javascript" src="<?php echo $mbsy_url ?>v3/ecommerce/js/<?php echo $username ?>"></script>
app/design/frontend/base/default/template/ambassador/checkout/img.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $username = Mage::getModel('core/variable')->loadByCode('getambassador_username')->getValue('plain');
4
+ $campaign = Mage::getModel('core/variable')->loadByCode('getambassador_active_campaign')->getValue('plain');
5
+ $mode = Mage::getModel('core/variable')->loadByCode('getambassador_mode')->getValue('plain');
6
+ $auto_create_amb = Mage::getModel('core/variable')->loadByCode('getambassador_auto_create_ambassador')->getValue('plain');
7
+
8
+ if (intval($auto_create_amb) == 1) {
9
+ $auto_create = '&mbsy_auto_create=1';
10
+ } elseif(intval($auto_create_amb) == 0) {
11
+ $auto_create = '&mbsy_auto_create=0';
12
+ } else {
13
+ $auto_create = '';
14
+ }
15
+
16
+ if ($mode === 'dev') {
17
+ $mbsy_url = 'http://mbsy.dev/';
18
+ } else {
19
+ $mbsy_url = 'https://mbsy.co/';
20
+ }
21
+
22
+ $checkout = Mage::getSingleton('checkout/session');
23
+ $lastId = $checkout->getLastOrderId();
24
+
25
+ if ($lastId) {
26
+ $order = Mage::getModel('sales/order');
27
+ $order->load($lastId);
28
+ $revenue = $order->getSubtotal()+$order->getDiscountAmount();
29
+ $transaction_uid = '&mbsy_transaction_uid='.$order->getRealOrderId();
30
+ } else {
31
+ $revenue = 0;
32
+ $transaction_uid = '';
33
+ }
34
+
35
+ if (!empty($order)) {
36
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
37
+ $email = urlencode($order->getCustomerEmail());
38
+ $first_name = urlencode($order->getBillingAddress()->getFirstname());
39
+ $last_name = urlencode($order->getBillingAddress()->getLastname());
40
+ } else {
41
+ $email = '';
42
+ $first_name = '';
43
+ $last_name = '';
44
+ }
45
+
46
+ if (in_array($mbsy_is_approved, array('1', '0'))) {
47
+ $mbsy_is_approved = '&mbsy_is_approved='.$mbsy_is_approved;
48
+ } else {
49
+ $mbsy_is_approved = '';
50
+ }
51
+
52
+ ?>
53
+
54
+ <img src="<?php echo $mbsy_url ?>embed/v2/img/?mbsy_username=<?php echo $username ?>&mbsy_campaign_uid=<?php echo $campaign ?>&mbsy_email=<?php echo $email ?>&mbsy_first_name=<?php echo $first_name ?>&mbsy_last_name=<?php echo $last_name ?>&mbsy_revenue=<?php echo $revenue ?><?php echo $auto_create ?><?php echo $transaction_uid ?><?php echo $mbsy_is_approved ?>" style="border: none; display: none" alt="" />
app/design/frontend/base/default/template/ambassador/sso/affiliate_program.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <div class="dashboard">
2
+ <iframe src="<?php echo $portal_url ?>/dashboard?iframe=true" style="border: none; width: 100%; height: 100%; min-height: 1600px; "></iframe>
3
+ </div>
4
+
app/design/frontend/base/default/template/ambassador/sso/sso.phtml ADDED
File without changes
app/design/frontend/base/default/template/ambassador/sso/sso_logout.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <img src="<?php echo $portal_url ?>/sso/logout/?token=<?php echo $mbsy_token; ?>&email=<?php echo urlencode($mbsy_email); ?>&signature=<?php echo $mbsy_signature; ?>" style="border: none; display: none" alt="" />
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ambassador</name>
4
- <version>1.1.5</version>
5
  <stability>stable</stability>
6
  <license uri="https://getambassador.com/terms">Zferral, Inc, magento@getAmbassador.com</license>
7
  <channel>community</channel>
@@ -14,11 +14,12 @@ Use Ambassador to easily create, track &amp; manage custom incentives that drive
14
  Integrate Ambassador into the other existing applications you already use, including Salesforce, Sendgrid, MailChimp, Campaign Monitor, Sailthru, PayPal and Dwolla.&#xD;
15
  &#xD;
16
  Get started on Ambassador with a free trial, simply follow the instructions on how to get up and running in just minutes.</description>
17
- <notes>- fixed error message for Store Credits</notes>
 
18
  <authors><author><name>Jeffrey Epstein</name><user>getAmbassador</user><email>magento@getambassador.com</email></author><author><name>Greg Szymczak</name><user>gpszymczak</user><email>gpszymczak@gmail.com</email></author></authors>
19
- <date>2015-03-25</date>
20
- <time>11:53:07</time>
21
- <contents><target name="magecommunity"><dir name="Ambassador"><dir name="Affiliate"><dir name="Model"><file name="Observer.php" hash="b8bb353e129bf09f5eeb6cc9d21a107c"/></dir><dir name="controllers"><file name="AffiliateController.php" hash="675abd910b45ea4320cd30455c36a200"/></dir><dir name="etc"><file name="config.xml" hash="98de110422ad3fe68c234eebba9c401a"/></dir></dir><dir name="Event"><dir name="Model"><file name="Observer.php" hash="6738b87068e51a739fda753645b8a840"/></dir><dir name="controllers"><file name="CallbackController.php" hash="07f3f39b2edfb9b37e74af7556d7cabf"/></dir><dir name="etc"><file name="config.xml" hash="2243df59895e012f99412670ed16039c"/></dir></dir><dir name="Payout"><dir name="controllers"><file name="PayoutController.php" hash="e0ff7885b47e780437a55a1982a6cb45"/></dir><dir name="etc"><file name="config.xml" hash="23dbf12c8a05edce63499f19087367a1"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="ambassador"><dir name="checkout"><file name="ecommerce.phtml" hash="38d66b1e639cd623f3f255aea2e42665"/><file name="img.phtml" hash="93450ac8ed4df0aa33e29c0c58fbb3b2"/></dir><dir name="sso"><file name="affiliate_program.phtml" hash="983bfe455fa6bfb67f78966e9a5d607a"/><file name="sso.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="sso_logout.phtml" hash="0721023e06005ca9d102a3218ca0d32f"/></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="template"><dir name="ambassador"><dir name="checkout"><file name="ecommerce.phtml" hash="38d66b1e639cd623f3f255aea2e42665"/><file name="img.phtml" hash="93450ac8ed4df0aa33e29c0c58fbb3b2"/></dir><dir name="sso"><file name="affiliate_program.phtml" hash="983bfe455fa6bfb67f78966e9a5d607a"/><file name="sso.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="sso_logout.phtml" hash="0721023e06005ca9d102a3218ca0d32f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ambassador_Event.xml" hash="531c19fe928c2fd3b008cf00bc865246"/><file name="Ambassador_Affiliate.xml" hash="806b368fde635b60f5dabad5cfa9e1d8"/><file name="Ambassador_Payout.xml" hash="24f665e03b13562e03b871957e959ae2"/></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension><extension><name>json</name><min/><max/></extension></required></dependencies>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ambassador</name>
4
+ <version>1.1.6</version>
5
  <stability>stable</stability>
6
  <license uri="https://getambassador.com/terms">Zferral, Inc, magento@getAmbassador.com</license>
7
  <channel>community</channel>
14
  Integrate Ambassador into the other existing applications you already use, including Salesforce, Sendgrid, MailChimp, Campaign Monitor, Sailthru, PayPal and Dwolla.&#xD;
15
  &#xD;
16
  Get started on Ambassador with a free trial, simply follow the instructions on how to get up and running in just minutes.</description>
17
+ <notes>- added templates to base design&#xD;
18
+ - allowed to overwrite mode</notes>
19
  <authors><author><name>Jeffrey Epstein</name><user>getAmbassador</user><email>magento@getambassador.com</email></author><author><name>Greg Szymczak</name><user>gpszymczak</user><email>gpszymczak@gmail.com</email></author></authors>
20
+ <date>2015-07-02</date>
21
+ <time>09:44:48</time>
22
+ <contents><target name="magecommunity"><dir name="Ambassador"><dir name="Affiliate"><dir name="Model"><file name="Observer.php" hash="b8bb353e129bf09f5eeb6cc9d21a107c"/></dir><dir name="controllers"><file name="AffiliateController.php" hash="675abd910b45ea4320cd30455c36a200"/></dir><dir name="etc"><file name="config.xml" hash="98de110422ad3fe68c234eebba9c401a"/></dir></dir><dir name="Event"><dir name="Model"><file name="Observer.php" hash="6738b87068e51a739fda753645b8a840"/></dir><dir name="controllers"><file name="CallbackController.php" hash="ddf1904ee1ba126da320a1f934793389"/></dir><dir name="etc"><file name="config.xml" hash="2243df59895e012f99412670ed16039c"/></dir></dir><dir name="Payout"><dir name="controllers"><file name="PayoutController.php" hash="e0ff7885b47e780437a55a1982a6cb45"/></dir><dir name="etc"><file name="config.xml" hash="23dbf12c8a05edce63499f19087367a1"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="ambassador"><dir name="checkout"><file name="ecommerce.phtml" hash="38d66b1e639cd623f3f255aea2e42665"/><file name="img.phtml" hash="93450ac8ed4df0aa33e29c0c58fbb3b2"/></dir><dir name="sso"><file name="affiliate_program.phtml" hash="983bfe455fa6bfb67f78966e9a5d607a"/><file name="sso.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="sso_logout.phtml" hash="0721023e06005ca9d102a3218ca0d32f"/></dir></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="template"><dir name="ambassador"><dir name="checkout"><file name="ecommerce.phtml" hash="38d66b1e639cd623f3f255aea2e42665"/><file name="img.phtml" hash="93450ac8ed4df0aa33e29c0c58fbb3b2"/></dir><dir name="sso"><file name="affiliate_program.phtml" hash="983bfe455fa6bfb67f78966e9a5d607a"/><file name="sso.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="sso_logout.phtml" hash="0721023e06005ca9d102a3218ca0d32f"/></dir></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="template"><dir name="ambassador"><dir name="checkout"><file name="ecommerce.phtml" hash="38d66b1e639cd623f3f255aea2e42665"/><file name="img.phtml" hash="93450ac8ed4df0aa33e29c0c58fbb3b2"/></dir><dir name="sso"><file name="affiliate_program.phtml" hash="983bfe455fa6bfb67f78966e9a5d607a"/><file name="sso.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="sso_logout.phtml" hash="0721023e06005ca9d102a3218ca0d32f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ambassador_Event.xml" hash="531c19fe928c2fd3b008cf00bc865246"/><file name="Ambassador_Affiliate.xml" hash="806b368fde635b60f5dabad5cfa9e1d8"/><file name="Ambassador_Payout.xml" hash="24f665e03b13562e03b871957e959ae2"/></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension><extension><name>json</name><min/><max/></extension></required></dependencies>
25
  </package>