2

I have opencart Version 2.0.1.1 and recently i have noticed a strange error. when i visit the sale/order page it is showing a popup with the error:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
 <title>301 Moved Permanently</title>
 </head><body>
 <h1>Moved Permanently</h1>
 <p>The document has moved <a href="https://webdomain.com/?route=api/voucher/add&amp;api=api%2Fvoucher%2Fadd">here</a>.</p>
 </body></html>

what is this error and how we can resolve this ? any idea? i am totally blank on it.

Shoaib Fareed
  • 72
  • 1
  • 9

1 Answers1

1

Try this in Admin panel:

  • Go to System > Users > API.
  • Add a new API, generate password, and enable it, add your IP address in IP tab.
  • Then go to Admin > System > Settings > Edit, tab Option.
  • Select API user under Checkout section as your API user.
  • Save the changes.
  • Go to Sales > Orders to check if error is gone.
focus.style
  • 6,612
  • 4
  • 26
  • 38
  • I have checked there are already two apis there, so i think it is fine, but i cant find the other "checkout section in settings" https://prnt.sc/tf4oen – Shoaib Fareed Jul 10 '20 at 05:36
  • ok i have found it. As API and user were already set , so to be confirm i have created a new API user and set it, and still error is there. – Shoaib Fareed Jul 10 '20 at 05:43
  • When this error started from? Maybe there was something? New modules installed? New hosting? – focus.style Jul 12 '20 at 11:57
  • nothing have been changed on the website it is start showing error since 3 or 4 weeks, within that cancel order is not working as wel – Shoaib Fareed Jul 15 '20 at 11:04