Jump to content

Urgent : Currency as an Image instead of Symbol


Recommended Posts

Hi,
i am trying to change the currency symbols as an image, in Prestashop 1.3.2, i have seen several posts regarding " currency as Image" My issue is i want to change the front end currencies kindly check the attached Screen shot of requirement...please help with the code and the in which file i need to do changes...

Thanks in advance Cheers!!!!

41778_tBV4FL2l0p52gMhH99Kp_t

Link to comment
Share on other sites

Hi,

There is no general solution for your request. You need to replace each occurrence of currency (in text) by your pics in every module which you used. And of course for every .tpl file under $PS_DIR/themes/$YOUR_THEME_NAME

Regards,
VNguyen

Link to comment
Share on other sites

Thanks VNguyen
But extremely sorry its really helpful if you help me with the code for using the images and file names in which i need to change the coding, i am using default prestashop theme... the version is 1.3.2

Many thanks for your post

Link to comment
Share on other sites

Hi,

I think I found out the general solution, please do following my steps:

#1. Put your currency sign image under $PS_DIR/img/currency_sign.jpg
Assume that your image name "currency_sign.jpg". You can change its name yourself and also change corresponding name in step #2

#2. Open to edit this file: $PS_DIR/classes/Tools.php
Search this function:

public static function displayPrice($price, $currency = NULL, $no_utf8 = false)



Replace the definition of variable $c_char from

$c_char = (is_array($currency) ? $currency['sign'] : $currency->sign);



to

$c_char = '';



Done.

I test on my localhost with PS 1.4, and it works fine on all module. Hope that it is useful.

Regards,
VNguyen

Link to comment
Share on other sites

Hi,

This function is used for every standard function to display its currency symbol + its value. So it will assume that it will replace all currency symbol in text by your pic, except on certain module from third parties which does not follow PS standard.

Please do some quick test at your end to make sure it works. It will be so great if I can help you and to heard that that's what you want.

Regards,
VNguyen

Link to comment
Share on other sites

  • 3 years later...
if (is_array($currency))
		{
			$c_char = '<img src="http://1.bp.blogspot.com/-FO4PJ6WqyOs/U6vCv7dHQII/AAAAAAAAAE8/IZDbsQrS7gM/s1600/rupee-symbal2.png">';
			$c_format = $currency['format'];
			$c_decimals = (int)$currency['decimals'] * _PS_PRICE_DISPLAY_PRECISION_;
			$c_blank = $currency['blank'];
		}
		elseif (is_object($currency))
		{
                        $c_char = '<img src="http://2.bp.blogspot.com/--2cHjt0aEWA/U6vCv7CKSEI/AAAAAAAAAE4/YJTt14ufuJw/s1600/rupees-symbol3.png">';
			$c_format = $currency->format;
			$c_decimals = (int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_;
			$c_blank = $currency->blank;
		}
		else
			return false;

put this code under the line public static function displayPrice($price, $currency = NULL, $no_utf8 = false)

work in PS v 1.6

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...