Is there an opencart function to format currency without the symbol?
I see $this->currency->format($value) , but it includes the currency symbol.
I am using number_format(), but wondering if there was a default OC function for this?
I see $this->currency->format($value) , but it includes the currency symbol.
I am using number_format(), but wondering if there was a default OC function for this?
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Hi - Thanks for the reply. I am actually writing a API for Opencart, was looking on a code level to do the formatting.
Right now when you do $this->currency->format($value) it returns the currency symbol ($10.00), but I need (10.00) . I was just wondering if OC had a currency function to not include the symbol.
The alternative is PHP's number_format(), but if there is a function would like to keep the code structuring.
Right now when you do $this->currency->format($value) it returns the currency symbol ($10.00), but I need (10.00) . I was just wondering if OC had a currency function to not include the symbol.
The alternative is PHP's number_format(), but if there is a function would like to keep the code structuring.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Hello. I have a problem. My currency format is 18,999.00, but I want this 18.999,00. Can anyone tell me how to fix it? Thanks.
Hi,
I have a similar problem passing the values to paypal in UK.
In paypal US it is not a problem but in UK it returns this error:
"The link you have used to enter the PayPal system contains an incorrectly formatted item amount."
the link is this:
If I remove manually the £ symbol from the link, everything is fine
I think the code to change would be this (I guess):
Any idea where to make the change?
I have a similar problem passing the values to paypal in UK.
In paypal US it is not a problem but in UK it returns this error:
"The link you have used to enter the PayPal system contains an incorrectly formatted item amount."
the link is this:
Code: Select all
https://www.paypal.com/cgi-bin/webscr?currency_code=GBP&cmd=_cart&upload=1&item_name_1=xxx&amount_1=£45.99&quantity_1=1&
Code: Select all
https://www.paypal.com/cgi-bin/webscr?currency_code=GBP&cmd=_cart&upload=1&item_name_1=xxx&amount_1=45.99&quantity_1=1&
Code: Select all
'price' => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),
'total' => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])
Hi Avvici,
thanks for your reply.
unfortunately there isn't a solution in the link you sent but just the prognosis of the problem that I already knew.
My problem is, what part of the code (above, if this is the right code) I have to change in order to remove the currency symbol?
thanks for your reply.
unfortunately there isn't a solution in the link you sent but just the prognosis of the problem that I already knew.
My problem is, what part of the code (above, if this is the right code) I have to change in order to remove the currency symbol?
First of all, I'm sorry for bumping an old topic, but I'll try to give some answers I couldn't find...
So for future use I will share my solution:
Go to system/library/currency.php and change code to look like this (line 80)
I'm using just one language, so this is problem solver for me, but this part of code is to play with.
Of course, you can remove commented parts, but I like to keep code as much original as it is possible, who knows if I'm going to need it in the future...
I guess those changes can be made in each language, but once more - I'm using just one language.
Also, at the line 49 to 57 in this file currency symbols can be removed for good, as requested in first post.
I'm sure that you have already managed to do this, but i search everywhere and no answer to be found...drmrbooster wrote:Hello. I have a problem. My currency format is 18,999.00, but I want this 18.999,00. Can anyone tell me how to fix it? Thanks.
So for future use I will share my solution:
Go to system/library/currency.php and change code to look like this (line 80)
Code: Select all
if ($format) {
/*$decimal_point = $this->language->get('decimal_point');*/
$decimal_point = ',';
} /*else {
$decimal_point = ',';
}*/
if ($format) {
/*$thousand_point = $this->language->get('thousand_point');*/
$thousand_point = '.';
} /*else {
$thousand_point = '.';
}*/
Of course, you can remove commented parts, but I like to keep code as much original as it is possible, who knows if I'm going to need it in the future...
I guess those changes can be made in each language, but once more - I'm using just one language.
Also, at the line 49 to 57 in this file currency symbols can be removed for good, as requested in first post.
the reply by paypal says:avvici wrote:Read this
https://www.paypal-community.com/t5/Mer ... anguage=en
Google is a good thing
This usually happens when you include a currency symbol or a comma in the price.
Can you file a ticket with us at https://www.paypal.com/mts if this is not the case?
----
For technical assistance with PayPal merchant product offerings, please file a ticket at https://www.paypal.com/mts/
Who is online
Users browsing this forum: No registered users and 137 guests