Version Notes
Support multiple currencies
Download this release
Release Info
Developer | Tim Macfarlane |
Extension | Shopa_ShareAndEarn |
Version | 0.0.3 |
Comparing to | |
See all releases |
Code changes from version 0.0.2 to 0.0.3
app/code/community/Shopa/ShareAndEarn/Block/Button.php
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Shopa Button
|
4 |
-
*
|
5 |
-
* @author Shopa
|
6 |
-
*/
|
7 |
-
class Shopa_ShareAndEarn_Block_Button extends Mage_Catalog_Block_Product_Abstract
|
8 |
-
{
|
9 |
-
public function getCommission() {
|
10 |
-
return Mage::getStoreConfig('shopa_shareandearn_options/commission/percentage') . '%';
|
11 |
-
}
|
12 |
-
|
13 |
-
public function getPrice() {
|
14 |
-
return $this->getPriceInclTax();
|
15 |
-
}
|
16 |
-
|
17 |
-
public function getCurrency() {
|
18 |
-
return
|
19 |
-
}
|
20 |
-
|
21 |
-
public function getIsButtonVisible() {
|
22 |
-
$show_button = Mage::getStoreConfig('shopa_shareandearn_options/commission/show_button');
|
23 |
-
return $show_button;
|
24 |
-
}
|
25 |
-
|
26 |
-
public function getApiKey() {
|
27 |
-
return Mage::getStoreConfig('shopa_shareandearn_options/security/api_key');
|
28 |
-
}
|
29 |
-
|
30 |
-
public function getSignature() {
|
31 |
-
$commission = $this->getCommission();
|
32 |
-
$price = $this->getPrice();
|
33 |
-
$currency = $this->getCurrency();
|
34 |
-
$apiKey = $this->getApiKey();
|
35 |
-
$apiSecret = Mage::getStoreConfig('shopa_shareandearn_options/security/api_secret');
|
36 |
-
|
37 |
-
$data = "$commission:$price:$currency:$apiKey:$apiSecret";
|
38 |
-
return sha1($data);
|
39 |
-
}
|
40 |
-
|
41 |
-
public function getPriceInclTax() {
|
42 |
-
$product = $this->getProduct();
|
43 |
-
return $this->helper('tax')->getPrice($product, $product->getFinalPrice(), true);
|
44 |
-
}
|
45 |
-
|
46 |
-
public function getButtonUrl() {
|
47 |
-
return Mage::getStoreConfig('shopa_shareandearn_options/advanced/shopa_base_url') . "btn.js";
|
48 |
-
}
|
49 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Shopa Button
|
4 |
+
*
|
5 |
+
* @author Shopa
|
6 |
+
*/
|
7 |
+
class Shopa_ShareAndEarn_Block_Button extends Mage_Catalog_Block_Product_Abstract
|
8 |
+
{
|
9 |
+
public function getCommission() {
|
10 |
+
return Mage::getStoreConfig('shopa_shareandearn_options/commission/percentage') . '%';
|
11 |
+
}
|
12 |
+
|
13 |
+
public function getPrice() {
|
14 |
+
return $this->getPriceInclTax();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getCurrency() {
|
18 |
+
return Mage::app()->getStore()->getCurrentCurrencyCode();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getIsButtonVisible() {
|
22 |
+
$show_button = Mage::getStoreConfig('shopa_shareandearn_options/commission/show_button');
|
23 |
+
return $show_button;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getApiKey() {
|
27 |
+
return Mage::getStoreConfig('shopa_shareandearn_options/security/api_key');
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getSignature() {
|
31 |
+
$commission = $this->getCommission();
|
32 |
+
$price = $this->getPrice();
|
33 |
+
$currency = $this->getCurrency();
|
34 |
+
$apiKey = $this->getApiKey();
|
35 |
+
$apiSecret = Mage::getStoreConfig('shopa_shareandearn_options/security/api_secret');
|
36 |
+
|
37 |
+
$data = "$commission:$price:$currency:$apiKey:$apiSecret";
|
38 |
+
return sha1($data);
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getPriceInclTax() {
|
42 |
+
$product = $this->getProduct();
|
43 |
+
return $this->helper('tax')->getPrice($product, $product->getFinalPrice(), true);
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getButtonUrl() {
|
47 |
+
return Mage::getStoreConfig('shopa_shareandearn_options/advanced/shopa_base_url') . "btn.js";
|
48 |
+
}
|
49 |
+
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shopa_ShareAndEarn</name>
|
4 |
-
<version>0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License (ASL)</license>
|
7 |
<channel>community</channel>
|
@@ -12,11 +12,11 @@
|
|
12 |
Financially incentivised users virally spread links to products they like to their personal networks, whilst online retailers benefit from additional sales through the recommendation of friends.
|
13 |

|
14 |
Retailers only pay commissions to their users on a success basis. Utilising a financially incentivised community to promote products on their behalf, this ‘no sale, no pay’ model allows retailers to reach as many people as possible as often and as cost effectively as possible.</description>
|
15 |
-
<notes>
|
16 |
<authors><author><name>Tim Macfarlane</name><user>featuristtim</user><email>tim@featurist.co.uk</email></author><author><name>Zi Makki</name><user>zmakki</user><email>zimakki@gmail.com</email></author></authors>
|
17 |
-
<date>2012-10-
|
18 |
-
<time>
|
19 |
-
<contents><target name="magecommunity"><dir name="Shopa"><dir name="ShareAndEarn"><dir name="Block"><file name="Button.php" hash="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>4.3.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shopa_ShareAndEarn</name>
|
4 |
+
<version>0.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache Software License (ASL)</license>
|
7 |
<channel>community</channel>
|
12 |
Financially incentivised users virally spread links to products they like to their personal networks, whilst online retailers benefit from additional sales through the recommendation of friends.
|
13 |

|
14 |
Retailers only pay commissions to their users on a success basis. Utilising a financially incentivised community to promote products on their behalf, this ‘no sale, no pay’ model allows retailers to reach as many people as possible as often and as cost effectively as possible.</description>
|
15 |
+
<notes>Support multiple currencies</notes>
|
16 |
<authors><author><name>Tim Macfarlane</name><user>featuristtim</user><email>tim@featurist.co.uk</email></author><author><name>Zi Makki</name><user>zmakki</user><email>zimakki@gmail.com</email></author></authors>
|
17 |
+
<date>2012-10-29</date>
|
18 |
+
<time>12:30:02</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Shopa"><dir name="ShareAndEarn"><dir name="Block"><file name="Button.php" hash="eb3da40bedf6d18cab5005b68b97cff8"/><file name="Success.php" hash="c390f4fea9282a229fda27a762977837"/></dir><dir name="Helper"><file name="Data.php" hash="a2021ecd6e69f5bc3fcda9e4a97c1015"/></dir><dir name="etc"><file name="config.xml" hash="b67634e93a8a15eea2836eafee6978df"/><file name="system.xml" hash="638cce9e1e680b934cbc4c7916660e94"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shopa_shareandearn.xml" hash="b172fd0820f4686029324ff4d16b5e5f"/></dir><dir name="template"><dir name="shopa_shareandearn"><file name="button.phtml" hash="c8eb9a4bde20e02b6c4ed2f3cf163353"/><file name="success.phtml" hash="1cf5547bdc66ec4d9b03930c3d696248"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopa_ShareAndEarn.xml" hash="7b5d8070ab388fb380977138e00e02df"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>4.3.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|