Post by nongetjie » Fri Sep 21, 2018 7:27 pm

Good afternoon,

In OC 3.0.2.0 the product list in the admin contains a currency symbol for the price of the product. This is not the case in OC 1.5.6 and OC2.0.2.0.
Some of my extensions have problems with this. Does anyone know why the currency symbol is added in OC3 and if it's possible to remove it from the overview?

Attached a screenshot from the Official Open Cart demo.

Attachments

Screen Shot 2018-09-21 at 13.12.30.png

Screen Shot 2018-09-21 at 13.12.30.png (105.18 KiB) Viewed 371 times


New member

Posts

Joined
Wed Nov 07, 2012 8:28 pm

Post by kestas » Sat Sep 22, 2018 4:15 am

In admin/controller/catalog/product.php

find(line ~359):

Code: Select all

$special = $this->currency->format($product_special['price'], $this->config->get('config_currency'));
replace with:

Code: Select all

$special = $product_special['price'];
and find (line ~370):

Code: Select all

'price'      => $this->currency->format($result['price'], $this->config->get('config_currency')),
replace wih:

Code: Select all

'price'      => $result['price'],
This will remove currency symbol.
I'm not sure that can help you to get to work your modules...

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by straightlight » Sat Sep 22, 2018 6:31 am

These lines:

Code: Select all

$this->currency->format($product_special['price'], $this->config->get('config_currency'));
can also be replaced with:

Code: Select all

$this->currency->format($product_special['price'], $this->config->get('config_currency'), false, true);
Last edited by straightlight on Sat Sep 22, 2018 8:49 pm, edited 1 time in total.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kestas » Sat Sep 22, 2018 4:12 pm

straightlight wrote:
Sat Sep 22, 2018 6:31 am
These lines:

Code: Select all

$this->currency->format($product_special['price'], $this->config->get('config_currency'));
can also be replaced with:

Code: Select all

$this->currency->format($product_special['price'], $this->config->get('config_currency'), false, false);
No reason for currency format if you not need currency symbol (for product list in admin dashboard) as you know that only one default currency can be. So you can simply use previous suggestion... ;) ::)

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by straightlight » Sat Sep 22, 2018 8:50 pm

@nongetjie:

My apologize. You only wish to remove the currency symbol and not to remove the currency decimal points. I have modified my last solution above accordingly and in accordance of the currencies API.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nongetjie » Mon Sep 24, 2018 3:03 pm

Thanks guys, problem solved!

New member

Posts

Joined
Wed Nov 07, 2012 8:28 pm
Who is online

Users browsing this forum: paulfeakins and 30 guests