Page 1 of 1

Syntax error after removing fax and company from forms???

Posted: Fri Apr 21, 2017 7:27 pm
by janice171
Hi
I removed the fax and company fields from the registration and checkout forms using a VQmod but now get the following error...

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Notice</b>: Undefined index: fax in <b>/public_html/catalog/model/account/customer.php</b> on line <b>14</b><b>Notice</b>: Undefined index: company in <b>/public_html/catalog/model/account/customer.php</b> on line <b>18</b><b>Notice</b>: Undefined index: company in <b>/public_html/catalog/model/account/customer.php</b> on line <b>64</b>[]
AND guest...

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<b>Notice</b>: Undefined index: fax in <b>/home/wwwpries/public_html/vqmod/vqcache/vq2-catalog_controller_checkout_guest.php</b> on line <b>275</b>[]
I have separate xml files for each form input that i wanted to remove. Here's an example of one of them:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Remove company from account register</id>
	<version>1.0.0</version>
	<vqmver>2.4.0</vqmver>
	<author>9thwave</author>
	<file name="catalog/view/theme/myTheme/template/account/register.tpl">
		<operation info="remove company from account register form">
			<search position="replace" offset="3"><![CDATA[
			<?php echo $entry_company; ?><br />
			]]></search>
			<add><![CDATA[	
			]]></add>
		</operation>
	</file> 
</modification>

Could anyone tell me what i need to do please?
Do i need to remove the reference in catalog/model/account/customer.php to 'fax' and 'company'
If i do that would any update overwrite it?

Or could i set up another vqmod?

Thanks for any help

Re: Syntax error after removing fax and company from forms???

Posted: Fri Apr 21, 2017 8:59 pm
by IP_CAM
you have ro remove other Stuff in other files as well, to make this work. Better compare it with one of the extensions, to find out, where.
Ernie
https://www.opencart.com/index.php?rout ... %20company

Re: Syntax error after removing fax and company from forms???

Posted: Fri Apr 21, 2017 9:32 pm
by janice171
Thanks for responding but telling me to look at the extras is not very helpful to be honest :)
Anyway, i commented all the lines that were specified in the error message and it appears to have remedied the issue.
;)

Re: Syntax error after removing fax and company from forms???

Posted: Fri Apr 21, 2017 10:57 pm
by thekrotek
You can take our Hide Fax and Hide Company extensions right from this page and modify them accordingly:

https://thekrotek.com/opencart-extensio ... extensions

No need to invent a bicycle :-)

Re: Syntax error after removing fax and company from forms???

Posted: Fri Apr 21, 2017 11:37 pm
by IP_CAM
Thanks for responding but telling me to look at the extras is not very helpful to be honest :)

well, I just figured, that you know, what you're doing, after telling us, that you manipulated code. I so
just tried, to give you a hint, where to look as well. But don't worry, I won't bother you again... ::)
Good Luck!
Ernie

Re: Syntax error after removing fax and company from forms???

Posted: Sat Apr 22, 2017 2:37 am
by janice171
Sorry I don't really know what i'm doing...this is the first opencart project i've worked on so i'm fumbling around to be honest.

Thanks for that link to the extra. I'll take a look because maybe it can replace what i've done.

Cheers

Re: Syntax error after removing fax and company from forms???

Posted: Thu May 11, 2017 8:45 pm
by janice171
Hi,

I have added the two vqmods from https://thekrotek.com/opencart-extensio ... extensions but they don't appear to be working.
I changed the '*' in the path to my theme.
Is there anything else i need to do?
Thanks for any help