Advertisement:

Author Topic: WebRupee for OSClass 3.5.7 needed  (Read 782 times)

786sujit

  • Newbie
  • *
  • Posts: 38
WebRupee for OSClass 3.5.7 needed
« on: November 20, 2015, 12:11:00 am »
Hello all,
            I had downloaded and installed WebRupee on OSClass 3.5.7. It was not replacing RS or INR with the webrupee symbol. Later I came to know that this plugin is compatible upto OSClass 3.1.2

Can somebody suggest changes in the plugin code, so that it may become effective in OSClass 3.5.7 Bender theme.

This is the code of the plugin WebRupee 1.0.1 compatible upto OSClass 3.1.2  :-

Code: [Select]
<?php
/*
Plugin Name: Replace Indian currency
Plugin URI: http://www.osclass.org/
Description: This plugin implements webrupee.com web API
Version: 1.0.1
Author: OSClass
Author URI: http://www.osclass.org/
Short Name: webrupee
Plugin update URI: web-rupee
*/

    
function webrupee_css() {
        echo 
'<!-- WebRupee plugin -->' ;
        echo 
'<link rel="stylesheet" type="text/css" href="http://cdn.webrupee.com/font">' ;
        echo 
'<!-- /WebRupee plugin -->' ;
    }

    function 
webrupee_price($price) {
        
$webrupee '<span class="WebRupee">Rs.</span>' ;
        if( 
osc_theme() == 'modern' ) {
            
$webrupee '<span class="WebRupee" style="border:0 ; margin:0 ; padding: 0;">Rs.</span>' ;
        }

        
$price preg_replace('|RS\.|i'$webrupee$price) ;
        
$price preg_replace('|INR|i'$webrupee$price) ;

        return 
$price ;
    }

    
// add CSS from WebRupee in the header
    
osc_add_hook'header''webrupee_css' ) ;
    
    
osc_add_filter'item_price''webrupee_price' ) ;

    
/* file end: ./webrupee/index.php */
?>

« Last Edit: November 20, 2015, 12:14:40 am by 786sujit »