Rp_Display_Price_Free - Version 0.1.0

Version Notes

None

Download this release

Release Info

Developer Mage Rips
Extension Rp_Display_Price_Free
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/local/Rp/Displayfreeprice/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Rp_Displayfreeprice_Helper_Data extends Mage_Core_Helper_Data
3
+ {
4
+
5
+ }
app/code/local/Rp/Displayfreeprice/Helper/Productprice.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rp_Displayfreeprice_Helper_Productprice extends Mage_Core_Helper_Data {
3
+ public function formatPrice($price, $includeContainer = true)
4
+ {
5
+ $modelPrice = Mage::getModel('Displayfreeprice/Freeprice');
6
+ if( empty($modelPrice) ){
7
+ require_once (Mage::getBaseDir('app').'/code/local/Rp/Displayfreeprice/Model/Freeprice.php');
8
+ $modelPrice = new Rp_Displayfreeprice_Model_Freeprice();
9
+ }
10
+ $retval = $modelPrice->getPrice($price);
11
+ if($retval == NULL){
12
+ return parent::formatPrice($price, $includeContainer);
13
+ }else{
14
+ return $retval;
15
+ }
16
+ }
17
+ }
18
+ ?>
app/code/local/Rp/Displayfreeprice/Model/Freeprice.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Rp_Displayfreeprice_Model_Freeprice{
3
+ public function getPrice( $price ){
4
+ $enabled = Mage::getStoreConfig('displayfreeprice/general/freeprice_enabled');
5
+ $text = Mage::getStoreConfig('displayfreeprice/general/freeprice_text');
6
+ if($price == 0 && $enabled == "1"){
7
+ return $text;
8
+ }
9
+ return NULL;
10
+ }
11
+ }
app/code/local/Rp/Displayfreeprice/etc/adminhtml.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <displayfreeprice translate="title" module="displayfreeprice">
15
+ <title>Display FREE Price Configuration</title>
16
+ <sort_order>0</sort_order>
17
+ </displayfreeprice>
18
+ </children>
19
+ </config>
20
+ </children>
21
+ </system>
22
+ </children>
23
+ </admin>
24
+ </resources>
25
+ </acl>
26
+ </config>
app/code/local/Rp/Displayfreeprice/etc/config.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rp_Displayfreeprice>
5
+ <version>0.1.0</version>
6
+ </Rp_Displayfreeprice>
7
+ </modules>
8
+ <global>
9
+ <blocks></blocks>
10
+ <helpers>
11
+ <core>
12
+ <rewrite>
13
+ <data>Rp_Displayfreeprice_Helper_Productprice</data>
14
+ </rewrite>
15
+ </core>
16
+ <displayfreeprice>
17
+ <class>Rp_Displayfreeprice_Helper</class>
18
+ </displayfreeprice>
19
+ </helpers>
20
+ </global>
21
+ <default>
22
+ <displayfreeprice>
23
+ <general>
24
+ <freeprice_text>FREE</freeprice_text>
25
+ </general>
26
+ </displayfreeprice>
27
+ </default>
28
+ </config>
app/code/local/Rp/Displayfreeprice/etc/system.xml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <myconf translate="label" module="displayfreeprice">
5
+ <label>RP extensions</label>
6
+ <sort_order>600</sort_order>
7
+ </myconf>
8
+ </tabs>
9
+ <sections>
10
+ <displayfreeprice translate="label" module="displayfreeprice">
11
+ <label>Display FREE Price Configuration</label>
12
+ <tab>myconf</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>50</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
+ <general translate="label">
20
+ <label>Free price options</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
+ <freeprice_enabled translate="label">
26
+ <label>Enabled FREE Price on frontend</label>
27
+ <frontend_type>select</frontend_type>
28
+ <source_model>adminhtml/system_config_source_yesno</source_model>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>0</show_in_store>
33
+ </freeprice_enabled>
34
+ <freeprice_text translate="label">
35
+ <label>Text to display on frontend</label>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>5</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>0</show_in_store>
41
+ </freeprice_text>
42
+ </fields>
43
+ </general>
44
+ </groups>
45
+ </displayfreeprice>
46
+ </sections>
47
+ </config>
app/etc/modules/Rp_Displayfreeprice.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rp_Displayfreeprice>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Rp_Displayfreeprice>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Rp_Display_Price_Free</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Display product as FREE when product price is $0.00 on frontend.</summary>
10
+ <description>Display product as FREE when product price is $0.00 on frontend. Enable or Disable extension as per requirement.&#xD;
11
+ Installation steps:&#xD;
12
+ ----------&#xD;
13
+ - Its very easy to install, just copy app/ folder and paste on your magento root folder.&#xD;
14
+ - You are done with installation. &#xD;
15
+ - Login into store backend, flush all cache or disable all cache in System -&gt; Cache Management.&#xD;
16
+ - Logout and login again from Backend to reload.&#xD;
17
+ - The extension should be installed and you can use it.</description>
18
+ <notes>None</notes>
19
+ <authors><author><name>Mage Rips</name><user>magerips</user><email>rpmagerips@gmail.com</email></author></authors>
20
+ <date>2015-01-01</date>
21
+ <time>10:35:46</time>
22
+ <contents><target name="mageetc"><dir name="modules"><file name="Rp_Displayfreeprice.xml" hash="a1e777af0c0c0dba0dd67050e74b9b0e"/></dir></target><target name="magelocal"><dir name="Rp"><dir name="Displayfreeprice"><dir name="Helper"><file name="Data.php" hash="c0052699d060b23ace7a5ff5eb23a5a4"/><file name="Productprice.php" hash="46ecc2c0e3395985d56080294c3b237f"/></dir><dir name="Model"><file name="Freeprice.php" hash="f4f05e4e0df7b8d2e51814689d58fd21"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ca631730f2440d101a2e0130554544d9"/><file name="config.xml" hash="c604d3331e94eec4629c7290fb21517b"/><file name="system.xml" hash="625d55d2018981858ad78390a0154fb1"/></dir></dir></dir></target></contents>
23
+ <compatible/>
24
+ <dependencies><required><php><min>5.0.1</min><max>6.0.0</max></php></required></dependencies>
25
+ </package>