Page 1 of 1

Purchase a Gift Certificate

Posted: Wed May 18, 2016 6:02 am
by rale
I dont know what is problem and I need help!
When click add i have is next problem:

Code: Select all

Warning: Missing argument 2 for Cart\Currency::format(), called in /home/nadohvatruke/public_html/catalog/controller/account/voucher.php on line 16 and defined in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 24Notice: Undefined variable: currency in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 25Notice: Undefined index: in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 25Notice: Undefined variable: currency in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 26Notice: Undefined index: in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 26Notice: Undefined variable: currency in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 27Notice: Undefined index: in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 27Notice: Undefined variable: currency in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 30Notice: Undefined index: in /home/nadohvatruke/public_html/system/library/cart/currency.php on line 30Warning: Cannot modify header information - headers already sent by (output started at /home/nadohvatruke/public_html/catalog/controller/startup/error.php:34) in /home/nadohvatruke/public_html/system/library/response.php on line 12
BUt, when you go to back , on cart have that order for gift, and every on admin and customer when use code for gift work good.
If someone know what is problem im here.
OC 2.2.0.0

Re: Purchase a Gift Certificate

Posted: Wed May 18, 2016 10:16 am
by gulffresh
I just ran into this problem with a Fresh install from a couple of days ago. It looks like there is a problem with the core files.
Here's how I fixed it.
go to catalog/controller/account/voucher.php
line 16 find

Code: Select all

'description'      => sprintf($this->language->get('text_for'), $this->currency->format($this->currency->convert($this->request->post['amount'], $this->session->data['currency'], $this->config->get('config_currency'))), $this->request->post['to_name']),
Replace with

Code: Select all

'description'      => sprintf($this->language->get('text_for'), $this->currency->format($this->currency->convert($this->request->post['amount'], $this->session->data['currency'], $this->config->get('config_currency')), $this->session->data['currency']), $this->request->post['to_name']),
It's kind of hard to imagine we are the only ones to find this problem.

hope this helps you if not It's a different problem then I had

Re: Purchase a Gift Certificate

Posted: Sat May 21, 2016 9:54 pm
by rale
O yeah! Mint masters, you solved the problem.
Works great, I knew that the problem is in the line 16, but did not know what of the codes can solve it until you wrote.
Maybe we're not the only one who found the problem, I think a lot of people do not test all on its website, it is important to have a solution for others.
Many thanks bro!
Now and others who have the problem easy to solve it thanks to you. :D

Re: Purchase a Gift Certificate

Posted: Mon May 23, 2016 7:06 pm
by Pandamad
I have OC 2.2.0.0 and I was experiencing the same problem with the Gift Certificate.

Thanks for the help.

Re: Purchase a Gift Certificate

Posted: Thu May 26, 2016 5:49 am
by robbie269
Realised I had the same problem last night on a recently live V2.2 site. Had not tested the Gift Certificate option :-[
Thanks for the fix.

Re: Purchase a Gift Certificate

Posted: Mon Jul 18, 2016 3:25 pm
by wbd
Just wanted to add my thanks for this fix - same problem, running v2.2.0.0.

Re: Purchase a Gift Certificate

Posted: Wed Aug 31, 2016 10:31 pm
by HealthGeek
Thanks guys!
Helped me too, running OpenCart 2.2.0.0.

Re: Purchase a Gift Certificate

Posted: Tue Mar 07, 2017 9:38 pm
by icestudios
Hi,

I'm getting the same issue with OC Version 2.3.0.2. I've just checked the Voucher.php file and it's different to the one above ... it's

'description' => sprintf($this->language->get('text_for'), $this->currency->format($this->request->post['amount'], $this->session->data['currency']), $this->request->post['to_name']),

... any ideas as to where I need to edit the code?

Many thanks,

Re: Purchase a Gift Certificate

Posted: Thu Mar 09, 2017 7:13 pm
by icestudios
Sorted. Followed this and all now OK ... https://github.com/opencart/opencart/issues/4664

Re: Purchase a Gift Certificate

Posted: Wed May 24, 2017 11:48 pm
by dragonfly-ie
gulffresh wrote:
Wed May 18, 2016 10:16 am
It's kind of hard to imagine we are the only ones to find this problem.

Cheers. - took me a year to find it. ;D

How can one test the whole site including all features??



.