Version Notes
Initial version
Download this release
Release Info
| Developer | Bruno Mininno |
| Extension | Bitgento |
| Version | 1.0.0.0.1 |
| Comparing to | |
| See all releases | |
Version 1.0.0.0.1
- app/code/community/Ecloud/Bitgento/Block/Bitcoins.php +5 -0
- app/code/community/Ecloud/Bitgento/Helper/Data.php +3 -0
- app/code/community/Ecloud/Bitgento/Model/Bitgento.php +42 -0
- app/code/community/Ecloud/Bitgento/etc/config.xml +92 -0
- app/code/community/Ecloud/Bitgento/etc/system.xml +39 -0
- app/code/community/Ecloud/Bitgento/sql/bitgento_setup/install-1.0.0.0.1.php +7 -0
- app/design/frontend/base/default/layout/ecloud_bitgento.xml +8 -0
- app/design/frontend/base/default/template/bitgento/bitcoins.phtml +13 -0
- app/etc/modules/Ecloud_Bitgento.xml +9 -0
- package.xml +18 -0
- skin/frontend/base/default/images/logo-btc.jpg +0 -0
app/code/community/Ecloud/Bitgento/Block/Bitcoins.php
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Ecloud_Bitgento_Block_Bitcoins extends Mage_Core_Block_Template
|
| 3 |
+
{
|
| 4 |
+
// Methods (optional)
|
| 5 |
+
}
|
app/code/community/Ecloud/Bitgento/Helper/Data.php
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Ecloud_Bitgento_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 3 |
+
}
|
app/code/community/Ecloud/Bitgento/Model/Bitgento.php
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
|
| 4 |
+
* @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
|
| 5 |
+
*/
|
| 6 |
+
?><?php
|
| 7 |
+
class Ecloud_Bitgento_Model_Bitgento extends Mage_Core_Model_Abstract{
|
| 8 |
+
|
| 9 |
+
public function insertBlock($observer){
|
| 10 |
+
|
| 11 |
+
if(!Mage::getStoreConfig('bitgento_config/configuration/enabled',Mage::app()->getStore()))
|
| 12 |
+
return;
|
| 13 |
+
|
| 14 |
+
// Chequeo si estoy en la product page
|
| 15 |
+
if(Mage::registry('current_product')){
|
| 16 |
+
$_block = $observer->getBlock();
|
| 17 |
+
$_type = $_block->getType();
|
| 18 |
+
|
| 19 |
+
if ($_type == 'catalog/product_price'
|
| 20 |
+
&& $_block->getTemplate() =='catalog/product/price.phtml'
|
| 21 |
+
&& !($_block->getIdSuffix() == '_clone')) {
|
| 22 |
+
|
| 23 |
+
$prodid = Mage::registry('current_product')->getId();
|
| 24 |
+
$_product = Mage::getModel('catalog/product')->load($prodid);
|
| 25 |
+
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 26 |
+
$jsonApi = file_get_contents('https://bitpay.com/api/rates/');
|
| 27 |
+
$jsonApi = json_decode($jsonApi, true);
|
| 28 |
+
|
| 29 |
+
foreach ($jsonApi as $cd) {
|
| 30 |
+
if($currency_code == $cd["code"]){
|
| 31 |
+
$bitcoins = $_product->getPrice() / $cd["rate"];
|
| 32 |
+
$_child = clone $_block;
|
| 33 |
+
$_child->setType('test/block');
|
| 34 |
+
$_block->setChild('child', $_child);
|
| 35 |
+
$_block->setData('bitcoins',$bitcoins);
|
| 36 |
+
$_block->setTemplate('bitgento/bitcoins.phtml');
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
}
|
app/code/community/Ecloud/Bitgento/etc/config.xml
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Ecloud_Bitgento>
|
| 5 |
+
<version>1.0.0.0.1</version>
|
| 6 |
+
</Ecloud_Bitgento>
|
| 7 |
+
</modules>
|
| 8 |
+
<global>
|
| 9 |
+
<models>
|
| 10 |
+
<ecloud_bitgento>
|
| 11 |
+
<class>Ecloud_Bitgento_Model</class>
|
| 12 |
+
<resourceModel>bitgento_resource</resourceModel>
|
| 13 |
+
</ecloud_bitgento>
|
| 14 |
+
<bitgento_resource>
|
| 15 |
+
<class>Ecloud_Bitgento_Model_Resource</class>
|
| 16 |
+
<entities>
|
| 17 |
+
<bitgento>
|
| 18 |
+
<table>ecloud_bitgento</table>
|
| 19 |
+
</bitgento>
|
| 20 |
+
</entities>
|
| 21 |
+
</bitgento_resource>
|
| 22 |
+
</models>
|
| 23 |
+
<helpers>
|
| 24 |
+
<ecloud_bitgento>
|
| 25 |
+
<class>Ecloud_Bitgento_Helper</class>
|
| 26 |
+
</ecloud_bitgento>
|
| 27 |
+
</helpers>
|
| 28 |
+
<blocks>
|
| 29 |
+
<ecloud_bitgento>
|
| 30 |
+
<class>Ecloud_Bitgento_Block</class>
|
| 31 |
+
</ecloud_bitgento>
|
| 32 |
+
</blocks>
|
| 33 |
+
<resources>
|
| 34 |
+
<ecloud_bitgento_setup>
|
| 35 |
+
<setup>
|
| 36 |
+
<module>Ecloud_Bitgento</module>
|
| 37 |
+
<class>Mage_Core_Model_Resource_Setup</class>
|
| 38 |
+
</setup>
|
| 39 |
+
</ecloud_bitgento_setup>
|
| 40 |
+
</resources>
|
| 41 |
+
</global>
|
| 42 |
+
<frontend>
|
| 43 |
+
<routers>
|
| 44 |
+
<ecloud_bitgento>
|
| 45 |
+
<use>standard</use>
|
| 46 |
+
<args>
|
| 47 |
+
<module>Ecloud_Bitgento</module>
|
| 48 |
+
<frontName>bitgento</frontName>
|
| 49 |
+
</args>
|
| 50 |
+
</ecloud_bitgento>
|
| 51 |
+
</routers>
|
| 52 |
+
<layout>
|
| 53 |
+
<updates>
|
| 54 |
+
<ecloud_bitgento>
|
| 55 |
+
<file>ecloud_bitgento.xml</file>
|
| 56 |
+
</ecloud_bitgento>
|
| 57 |
+
</updates>
|
| 58 |
+
</layout>
|
| 59 |
+
<events>
|
| 60 |
+
<core_block_abstract_to_html_before>
|
| 61 |
+
<observers>
|
| 62 |
+
<ecloud_bitgento>
|
| 63 |
+
<type>model</type>
|
| 64 |
+
<class>ecloud_bitgento/bitgento</class>
|
| 65 |
+
<method>insertBlock</method>
|
| 66 |
+
</ecloud_bitgento>
|
| 67 |
+
</observers>
|
| 68 |
+
</core_block_abstract_to_html_before>
|
| 69 |
+
</events>
|
| 70 |
+
</frontend>
|
| 71 |
+
<adminhtml>
|
| 72 |
+
<acl>
|
| 73 |
+
<resources>
|
| 74 |
+
<admin>
|
| 75 |
+
<children>
|
| 76 |
+
<system>
|
| 77 |
+
<children>
|
| 78 |
+
<config>
|
| 79 |
+
<children>
|
| 80 |
+
<bitgento_config>
|
| 81 |
+
<title>Bitgento</title>
|
| 82 |
+
</bitgento_config>
|
| 83 |
+
</children>
|
| 84 |
+
</config>
|
| 85 |
+
</children>
|
| 86 |
+
</system>
|
| 87 |
+
</children>
|
| 88 |
+
</admin>
|
| 89 |
+
</resources>
|
| 90 |
+
</acl>
|
| 91 |
+
</adminhtml>
|
| 92 |
+
</config>
|
app/code/community/Ecloud/Bitgento/etc/system.xml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<tabs>
|
| 4 |
+
<bitgento module="ecloud_bitgento" translate="label">
|
| 5 |
+
<label>Bitgento</label>
|
| 6 |
+
<sort_order>100</sort_order>
|
| 7 |
+
</bitgento>
|
| 8 |
+
</tabs>
|
| 9 |
+
<sections>
|
| 10 |
+
<bitgento_config module="ecloud_bitgento" translate="label">
|
| 11 |
+
<label>Configuration</label>
|
| 12 |
+
<sort_order>200</sort_order>
|
| 13 |
+
<show_in_default>1</show_in_default>
|
| 14 |
+
<show_in_website>1</show_in_website>
|
| 15 |
+
<show_in_store>1</show_in_store>
|
| 16 |
+
<tab>bitgento</tab>
|
| 17 |
+
<groups>
|
| 18 |
+
<configuration translate="label">
|
| 19 |
+
<label>Configuration</label>
|
| 20 |
+
<sort_order>10</sort_order>
|
| 21 |
+
<show_in_default>1</show_in_default>
|
| 22 |
+
<show_in_website>1</show_in_website>
|
| 23 |
+
<show_in_store>1</show_in_store>
|
| 24 |
+
<fields>
|
| 25 |
+
<enabled translate="label">
|
| 26 |
+
<label>Enabled</label>
|
| 27 |
+
<frontend_type>select</frontend_type>
|
| 28 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 29 |
+
<sort_order>250</sort_order>
|
| 30 |
+
<show_in_default>1</show_in_default>
|
| 31 |
+
<show_in_website>1</show_in_website>
|
| 32 |
+
<show_in_store>1</show_in_store>
|
| 33 |
+
</enabled>
|
| 34 |
+
</fields>
|
| 35 |
+
</configuration>
|
| 36 |
+
</groups>
|
| 37 |
+
</bitgento_config>
|
| 38 |
+
</sections>
|
| 39 |
+
</config>
|
app/code/community/Ecloud/Bitgento/sql/bitgento_setup/install-1.0.0.0.1.php
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$setup = $this;
|
| 4 |
+
|
| 5 |
+
$setup->startSetup();
|
| 6 |
+
|
| 7 |
+
$setup->endSetup();
|
app/design/frontend/base/default/layout/ecloud_bitgento.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<layout>
|
| 3 |
+
<catalog_product_view>
|
| 4 |
+
<reference>
|
| 5 |
+
<block type="core/template" name="bitgento" template="bitgento/bitcoins.phtml" />
|
| 6 |
+
</reference>
|
| 7 |
+
</catalog_product_view>
|
| 8 |
+
</layout>
|
app/design/frontend/base/default/template/bitgento/bitcoins.phtml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* @author ecloud solutions http://www.ecloudsolutions.com <info@ecloudsolutions.com>
|
| 4 |
+
* @copyright Copyright (C) 2010 - 2014 ecloud solutions ®
|
| 5 |
+
*/
|
| 6 |
+
?>
|
| 7 |
+
<?php echo $this->getChildHtml('child') ?>
|
| 8 |
+
<div>
|
| 9 |
+
<a href="http://bitgento.com" target="blank">
|
| 10 |
+
<img style="width:30px;display:inline-block;vertical-align:middle;" src="<?php echo $this->getSkinUrl('images/logo-btc.jpg'); ?>">
|
| 11 |
+
</a>
|
| 12 |
+
<span><?php echo round($this->bitcoins, 6, PHP_ROUND_HALF_UP); ?></span>
|
| 13 |
+
</div>
|
app/etc/modules/Ecloud_Bitgento.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Ecloud_Bitgento>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
</Ecloud_Bitgento>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>Bitgento</name>
|
| 4 |
+
<version>1.0.0.0.1</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>This extension shows the price on Bitcoins of the current product under the original pricebox</summary>
|
| 10 |
+
<description>View how much bitcoins cost the current product</description>
|
| 11 |
+
<notes>Initial version</notes>
|
| 12 |
+
<authors><author><name>Bruno Mininno</name><user>brunomininno</user><email>bruno.mininno@ecloudsolutions.com</email></author><author><name>Gaspar Mac</name><user>ecloudsolutions</user><email>gaspar@ecloudsolutions.com</email></author></authors>
|
| 13 |
+
<date>2014-10-20</date>
|
| 14 |
+
<time>16:50:46</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Ecloud"><dir name="Bitgento"><dir name="Block"><file name="Bitcoins.php" hash="e2f170ebfd4f62c76fb30885ff75e061"/></dir><dir name="Helper"><file name="Data.php" hash="399bb3cd978f0eebb0d277650b5f3de5"/></dir><dir name="Model"><file name="Bitgento.php" hash="a24bc5edf7c016b7464c10110233f268"/></dir><dir name="etc"><file name="config.xml" hash="95f6333fdf9da7c030ecdf59152ecbd7"/><file name="system.xml" hash="f9563ac70ce7601dd96f448ce304a98a"/></dir><dir name="sql"><dir name="bitgento_setup"><file name="install-1.0.0.0.1.php" hash="2e5071273633e63d487fa573dc2a33d9"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ecloud_Bitgento.xml" hash="06d35c7f6b11c199bf074b40ae014718"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bitgento"><file name="bitcoins.phtml" hash="eee2c8b5a7e987909b0c359986ae9036"/></dir></dir><dir name="layout"><file name="ecloud_bitgento.xml" hash="eda156c41f16e3095a5b98a29df6e401"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="logo-btc.jpg" hash="efda8b6316786f2ff349f3065974249b"/></dir></dir></dir></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>5.5.15</max></php><extension><name>Core</name><min></min><max></max></extension></required></dependencies>
|
| 18 |
+
</package>
|
skin/frontend/base/default/images/logo-btc.jpg
ADDED
|
Binary file
|
