Post by matchamr » Mon Jun 06, 2016 4:46 pm

Hello,

Can anyone help with an issue I have when going to edit an order as an opencart administrator.

I get an error message titled 'Syntax Error: Unexpected token < in JSON at position 0'

The body of the messsage appears as per the attachment.

When I try to click on the other tabs on the screen such as 2.Products, 3. Payment Details, 4. Shipping Details I cannot go into them and a no entry sign appears as the cursor.

Thank you for any guidance anyone can offer.

Richard

Attachments

SyntaxError.jpg

SyntaxError.jpg (119.7 KiB) Viewed 13321 times


Newbie

Posts

Joined
Mon Jun 06, 2016 6:54 am

Post by i2Paq » Mon Jun 06, 2016 4:51 pm

This error appears quite often in other installs.

Have you used our FREE search on: JSON at position 0.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by artcore » Mon Jun 06, 2016 6:04 pm

Try this in your htaccess

Code: Select all

    <IfModule mod_rewrite.c>
      RewriteCond %{HTTPS} !=on
      RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
    </IfModule>
Ajax needs same domain and with WWW is considered another domain.
If you don't know about htaccess do a forum/google search ;)

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by i2Paq » Mon Jun 06, 2016 6:11 pm

artcore wrote:Try this in your htaccess

Code: Select all

    <IfModule mod_rewrite.c>
      RewriteCond %{HTTPS} !=on
      RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
    </IfModule>
Ajax needs same domain and with WWW is considered another domain.
If you don't know about htaccess do a forum/google search ;)
Could you explain what this does?

In my .htaccess I have this:

Code: Select all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
This is somewhat different from what you advice.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by artcore » Mon Jun 06, 2016 7:28 pm

Yours says: if not www then add it in.
Mine removes WWW. It depends on your config urls and preferences. www is esentially a subdomain of the main. I like them clean. ajax requests don't work cross domain so they have to match!

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by matchamr » Tue Jun 07, 2016 3:27 am

Hello Both,

Thank you kindly for taking the time to assist. I have copied both of your codes into my htaccess file, however the same result occurs. My entire htaccess file in the root directory reads (I've also tried the other suggestion): (note I am using journal2 them - will this make a difference?) Any suggestions? Thank you.

htaccess:
AddType x-httpd-php54 .php

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>

Newbie

Posts

Joined
Mon Jun 06, 2016 6:54 am

Post by artcore » Tue Jun 07, 2016 4:23 am

If that is the only content in your htaccess, you should get a fresh copy from the opencart download section first and optionally add the addition.

To solve your issue, try this:

Go to Admin > Settings > Users > API
Create a new API and enable it
Next, go to Store Settings
Under Option tab in the Checkout section > API user > select
Save

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by frtyaman » Thu Sep 13, 2018 8:44 pm

Image

Hello there, why am I getting the error shown in the picture how to fix?

Error message I get after setting smtp server
Image

Newbie

Posts

Joined
Mon May 14, 2018 1:08 am


Post by OSWorX » Mon Sep 17, 2018 4:15 pm

As you can see at the message: mail has been disabled (because of what reason ? ).
Fix that and it should work.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by straightlight » Mon Sep 17, 2018 9:13 pm

It is possible that your host might be using POP before SMTP authentication or SMTP via SSL which is why the mail function has been disabled. Either switch to SMTP options or contact your host to resolved this issue. Not an OC bug, posted in the wrong section.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: No registered users and 30 guests