Post by pta » Fri Apr 08, 2016 3:06 am

Hi,

My website homepage get error like this below, but other menu pages are working fine. why???

error shown in home page

Warning: Missing argument 2 for Cart\Currency::format(), called in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\storage\modification\catalog\controller\module\featured.php on line 42 and defined in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 24Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 25Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 25Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 26Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 26Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 27Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 27Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 30Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 30Warning: Missing argument 2 for Cart\Currency::format(), called in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\storage\modification\catalog\controller\module\featured.php on line 42 and defined in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 24Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 25Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 25Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 26Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 26Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 27Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 27Notice: Undefined variable: currency in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 30Notice: Undefined index: in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\library\cart\currency.php on line 30Notice: Error: Could not load template E:/HostingSpaces/prajjwal/buddhastatueonline.com/wwwroot/catalog/view/theme/default/template/default/template/module/featured.tpl! in E:\HostingSpaces\prajjwal\buddhastatueonline.com\wwwroot\system\storage\modification\system\library\template\basic.php on line 26


but other pages like this working fine.
http://buddhastatueonline.com/buddha-st ... dha-statue

what is happening?
Any help is highly appreciated
Thanks in advance.

pta
New member

Posts

Joined
Sun Feb 08, 2015 11:54 am

Post by oc-extensions » Fri Apr 08, 2016 5:20 am

Hi,

I'm sure you use OpenCart 2.2.0.0

In this version method ("function") format from class currency has an extra param currency code;

So in your modules instead of

Code: Select all

$this->currency->format($some_value)
(old OC versions)

Now you have to use

Code: Select all

$this->currency->format($some_value, $this->session->data['currency'])


Seems you modify featured module via ocmod
Check system\storage\modification\catalog\controller\module\featured.php on line 42

How look? like old oc version .. Right?

You need to modify ocmod (xml) that change this files and to add second param $this->session->data['currency']

Image | Extensions and Custom Development


User avatar
Active Member

Posts

Joined
Fri Jan 06, 2012 11:31 pm

Post by pta » Fri Apr 08, 2016 12:06 pm

Thank you for your reply , i got confused with your suggestion because in line 42 of featured.php, the code is

$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));

yes i use oc 2.2 which is clean install, but have used some extensions for theme,export import data, and ocmod for ftp from isenselab.

Please suggest and help again.

pta
New member

Posts

Joined
Sun Feb 08, 2015 11:54 am

Post by pta » Fri Apr 08, 2016 1:25 pm

in which file should i use to modify as per your statement

"You need to modify ocmod (xml) that change this files and to add second param $this->session->data['currency']"
Please update, its really urgent, my home page is down due to it

Thanks in advance.

pta
New member

Posts

Joined
Sun Feb 08, 2015 11:54 am

Post by pta » Thu Apr 14, 2016 12:10 pm

pta wrote:in which file should i use to modify as per your statement

"You need to modify ocmod (xml) that change this files and to add second param $this->session->data['currency']"
Please update, its really urgent, my home page is down due to it

Thanks in advance.

Please Help Help Help!!!! How to solve this

pta
New member

Posts

Joined
Sun Feb 08, 2015 11:54 am

Post by iMateo » Mon May 16, 2016 1:17 am

pta wrote:Thank you for your reply , i got confused with your suggestion because in line 42 of featured.php, the code is

$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));

yes i use oc 2.2 which is clean install, but have used some extensions for theme,export import data, and ocmod for ftp from isenselab.

Please suggest and help again.
Nobody can't help this guy? )) Ok, I will do that.
String should be this:

Code: Select all

$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
Must working.

Newbie

Posts

Joined
Sat Feb 06, 2016 6:11 am
Who is online

Users browsing this forum: No registered users and 397 guests