Version Notes
1st Official Release
Download this release
Release Info
Developer | SaveTheMage |
Extension | Show_Price_As_Free |
Version | 1.2.0 |
Comparing to | |
See all releases |
Version 1.2.0
- app/code/local/SaveTheMage/ShowPriceAsFree/Helper/Data.php +20 -0
- app/code/local/SaveTheMage/ShowPriceAsFree/Helper/Product.php +16 -0
- app/code/local/SaveTheMage/ShowPriceAsFree/Model/Price.php +40 -0
- app/code/local/SaveTheMage/ShowPriceAsFree/etc/adminhtml.xml +44 -0
- app/code/local/SaveTheMage/ShowPriceAsFree/etc/config.xml +36 -0
- app/code/local/SaveTheMage/ShowPriceAsFree/etc/system.xml +40 -0
- app/code/local/SaveTheMage/ShowPriceAsFree/sql/savethemage_showpriceasfree_setup/mysql4-install-1.1.1.php +32 -0
- app/etc/modules/SaveTheMage_ShowPriceAsFree.xml +9 -0
- package.xml +18 -0
app/code/local/SaveTheMage/ShowPriceAsFree/Helper/Data.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* SaveTheMage_ShowPriceAsFree_Helper Data
|
4 |
+
*
|
5 |
+
* PHP version 5.3
|
6 |
+
*
|
7 |
+
* @category ShowPriceAsFree
|
8 |
+
* @package SaveTheMage_ShowPriceAsFree
|
9 |
+
* @author Rezoanul Alam @ www.savethemage.com
|
10 |
+
* @copyright 2013 www.savethemage.com
|
11 |
+
* @license
|
12 |
+
* @version 1.1.1
|
13 |
+
* @link http://www.savethemage.com/
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
|
17 |
+
class SaveTheMage_ShowPriceAsFree_Helper_Data extends Mage_Core_Helper_Data
|
18 |
+
{
|
19 |
+
|
20 |
+
}
|
app/code/local/SaveTheMage/ShowPriceAsFree/Helper/Product.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SaveTheMage_ShowPriceAsFree_Helper_Product extends Mage_Core_Helper_Data {
|
3 |
+
public static function currency( $price , $format=true , $includeContainer = true )
|
4 |
+
{
|
5 |
+
$modelPrice = Mage::getModel('ShowPriceAsFree/Price');
|
6 |
+
if( empty( $modelPrice ) ){
|
7 |
+
require_once ( Mage::getBaseDir('app') . '/code/local/SaveTheMage/ShowPriceAsFree/Model/Price.php');
|
8 |
+
$modelPrice = new SaveTheMage_ShowPriceAsFree_Model_Price();
|
9 |
+
}
|
10 |
+
|
11 |
+
$retval = $modelPrice->_toHtml( $price );
|
12 |
+
return $retval == NULL ? parent::currency( $price, $format=true, $includeContainer = true ) : $retval;
|
13 |
+
|
14 |
+
}
|
15 |
+
}
|
16 |
+
?>
|
app/code/local/SaveTheMage/ShowPriceAsFree/Model/Price.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* SaveTheMage_ShowPriceAsFree_Model Price
|
5 |
+
*
|
6 |
+
* PHP version 5.3
|
7 |
+
*
|
8 |
+
* @category ShowPriceAsFree
|
9 |
+
* @package SaveTheMage_ShowPriceAsFree
|
10 |
+
* @author Rezoanul Alam @ www.savethemage.com
|
11 |
+
* @copyright 2013 www.savethemage.com
|
12 |
+
* @license
|
13 |
+
* @version 1.1.1
|
14 |
+
* @link http://www.savethemage.com/
|
15 |
+
*
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
class SaveTheMage_ShowPriceAsFree_Model_Price{
|
20 |
+
|
21 |
+
private $config_Enabled = '';
|
22 |
+
|
23 |
+
private function _construct() {
|
24 |
+
|
25 |
+
$path = 'ShowPriceAsFree_options/Config/Enabled';
|
26 |
+
$this->config_Enabled = Mage::getStoreConfig($path);
|
27 |
+
|
28 |
+
}
|
29 |
+
|
30 |
+
public function _toHtml( $price ){
|
31 |
+
$this->_construct();
|
32 |
+
|
33 |
+
if( $price == 0 && $this->config_Enabled == "1" ){
|
34 |
+
return "FREE";
|
35 |
+
}
|
36 |
+
|
37 |
+
return NULL;
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/local/SaveTheMage/ShowPriceAsFree/etc/adminhtml.xml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<SaveTheMageMenu translate="title" module="ShowPriceAsFree">
|
5 |
+
<title>SaveTheMage</title>
|
6 |
+
<sort_order>201</sort_order>
|
7 |
+
<children>
|
8 |
+
<ShowPriceAsFreeChildItem1 translate="title" module="ShowPriceAsFree">
|
9 |
+
<title>Show Price as Free</title>
|
10 |
+
<action>adminhtml/system_config/edit/section/ShowPriceAsFree_options</action>
|
11 |
+
<sort_order>2</sort_order>
|
12 |
+
<children>
|
13 |
+
<ShowPriceAsFreeChildItemChild1 translate="title" module="ShowPriceAsFree">
|
14 |
+
<title>Settings</title>
|
15 |
+
<action>adminhtml/system_config/edit/section/ShowPriceAsFree_options</action>
|
16 |
+
<sort_order>1</sort_order>
|
17 |
+
</ShowPriceAsFreeChildItemChild1>
|
18 |
+
</children>
|
19 |
+
</ShowPriceAsFreeChildItem1>
|
20 |
+
</children>
|
21 |
+
</SaveTheMageMenu>
|
22 |
+
</menu>
|
23 |
+
|
24 |
+
<acl>
|
25 |
+
<resources>
|
26 |
+
<admin>
|
27 |
+
<children>
|
28 |
+
<system>
|
29 |
+
<children>
|
30 |
+
<config>
|
31 |
+
<children>
|
32 |
+
<ShowPriceAsFree_options translate="title" module="ShowPriceAsFree">
|
33 |
+
<title>Show Price as Free Settings Section</title>
|
34 |
+
<sort_order>0</sort_order>
|
35 |
+
</ShowPriceAsFree_options>
|
36 |
+
</children>
|
37 |
+
</config>
|
38 |
+
</children>
|
39 |
+
</system>
|
40 |
+
</children>
|
41 |
+
</admin>
|
42 |
+
</resources>
|
43 |
+
</acl>
|
44 |
+
</config>
|
app/code/local/SaveTheMage/ShowPriceAsFree/etc/config.xml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<SaveTheMage_ShowPriceAsFree>
|
5 |
+
<version>1.2.0</version>
|
6 |
+
</SaveTheMage_ShowPriceAsFree>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<blocks>
|
10 |
+
|
11 |
+
</blocks>
|
12 |
+
|
13 |
+
<helpers>
|
14 |
+
<core>
|
15 |
+
<rewrite>
|
16 |
+
<data>SaveTheMage_ShowPriceAsFree_Helper_Product</data>
|
17 |
+
</rewrite>
|
18 |
+
</core>
|
19 |
+
<ShowPriceAsFree>
|
20 |
+
<class>SaveTheMage_ShowPriceAsFree_Helper</class>
|
21 |
+
</ShowPriceAsFree>
|
22 |
+
</helpers>
|
23 |
+
|
24 |
+
<resources>
|
25 |
+
<savethemage_showpriceasfree_setup>
|
26 |
+
<setup>
|
27 |
+
<module>SaveTheMage_ShowPriceAsFree</module>
|
28 |
+
<class>Mage_Core_Model_Resource_Setup</class>
|
29 |
+
</setup>
|
30 |
+
<connection>
|
31 |
+
<use>core_setup</use>
|
32 |
+
</connection>
|
33 |
+
</savethemage_showpriceasfree_setup>
|
34 |
+
</resources>
|
35 |
+
</global>
|
36 |
+
</config>
|
app/code/local/SaveTheMage/ShowPriceAsFree/etc/system.xml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<SaveTheMageconfig translate="label" module="ShowPriceAsFree">
|
5 |
+
<label>SaveTheMage</label>
|
6 |
+
<sort_order>600</sort_order>
|
7 |
+
</SaveTheMageconfig>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<ShowPriceAsFree_options translate="label" module="ShowPriceAsFree">
|
11 |
+
<label>Show Price as FREE Settings</label>
|
12 |
+
<tab>SaveTheMageconfig</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>1000</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>0</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<Config translate="label">
|
20 |
+
<label>Main</label>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<show_in_website>1</show_in_website>
|
23 |
+
<show_in_store>0</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 |
+
<comment><![CDATA[Yes=Enabled]]></comment>
|
30 |
+
<sort_order>1</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>0</show_in_store>
|
34 |
+
</Enabled>
|
35 |
+
</fields>
|
36 |
+
</Config>
|
37 |
+
</groups>
|
38 |
+
</ShowPriceAsFree_options>
|
39 |
+
</sections>
|
40 |
+
</config>
|
app/code/local/SaveTheMage/ShowPriceAsFree/sql/savethemage_showpriceasfree_setup/mysql4-install-1.1.1.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* savethemage_showpriceasfree install script
|
4 |
+
*
|
5 |
+
* PHP version 5.3
|
6 |
+
*
|
7 |
+
* @category showpriceasfree
|
8 |
+
* @package SaveTheMage_ShowPriceAsFree
|
9 |
+
* @author Rezoanul Alam @ www.savethemage.com
|
10 |
+
* @copyright 2013 www.savethemage.com
|
11 |
+
* @license
|
12 |
+
* @version 1.1.1
|
13 |
+
* @link http://www.savethemage.com/
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
|
17 |
+
$installer = $this;
|
18 |
+
|
19 |
+
$installer->startSetup();
|
20 |
+
|
21 |
+
|
22 |
+
$installer->run("
|
23 |
+
DELETE FROM {$this->getTable('core_config_data')}
|
24 |
+
WHERE path LIKE 'ShowPriceAsFree_options/Config/%' ;
|
25 |
+
|
26 |
+
INSERT INTO {$this->getTable('core_config_data')}
|
27 |
+
( scope_id, path, value )
|
28 |
+
VALUES( 0, 'ShowPriceAsFree_options/Config/Enabled' , '1' ) ;
|
29 |
+
|
30 |
+
");
|
31 |
+
|
32 |
+
$installer->endSetup();
|
app/etc/modules/SaveTheMage_ShowPriceAsFree.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<SaveTheMage_ShowPriceAsFree>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</SaveTheMage_ShowPriceAsFree>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Show_Price_As_Free</name>
|
4 |
+
<version>1.2.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Changes 0.00 Price to Free</summary>
|
10 |
+
<description>Change 0.00 Price to FREE automatically with this extension.</description>
|
11 |
+
<notes>1st Official Release</notes>
|
12 |
+
<authors><author><name>SaveTheMage</name><user>SaveTheMage</user><email>support@savethemage.com</email></author></authors>
|
13 |
+
<date>2013-08-09</date>
|
14 |
+
<time>21:28:02</time>
|
15 |
+
<contents><target name="magelocal"><dir name="SaveTheMage"><dir name="ShowPriceAsFree"><dir name="Helper"><file name="Data.php" hash="ba3e13713f0a59a10f12809c8f0bc729"/><file name="Product.php" hash="9221c0e3b5665b5c2e8885ef2459f669"/></dir><dir name="Model"><file name="Price.php" hash="f6890b981c710c3793c4a621ab24b213"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c192a26070150b6dbe09fa3d4b8b9337"/><file name="config.xml" hash="7ebaf14c56eaab7896af3b804149b53d"/><file name="system.xml" hash="19389bf15e7dc7058d9802d629a306a9"/></dir><dir name="sql"><dir name="savethemage_showpriceasfree_setup"><file name="mysql4-install-1.1.1.php" hash="85d5d677f1a944ac24650bae2c3893c3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SaveTheMage_ShowPriceAsFree.xml" hash="327f54dc489cae41a28ba1b6de9f4eed"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|