Post by james-asone » Fri Nov 27, 2015 7:12 pm

I tried most fixes on this thread before doing the most simple option of going to Admin > Settings > Option > Checkout and ensuring the API User was enabled instead of -- None --

This immediately rectified the problem for me on Opencart 2.0.1.1, good luck!

Newbie

Posts

Joined
Fri Nov 27, 2015 7:09 pm

Post by gogoweb » Mon Jan 18, 2016 3:44 am

Hi guys,
I had banged my head for few days with this issue and finally solved it somehow.
A little background.
I had 2-3 installations of OpenCart 2.0.3.1 on my server and the production one got this error when editing an order. Out of sudden (probably we changed something) and it did not crack applying most of the fixes mentioned in this thread.
- API checked
- DNS checked
- Cookie was send with the post request - checked
- Language - checked
- UTF8 encoding - checked
etc.

I had a deadline which had to be met and had no other choice but to find a quick solution.

Here is step by step how i managed to fix it:
  • - Downloaded a fresh copy of the 2.0.3.1 package from opencart.com (i suspected incorrect file encodings or bad bytes in current copy)
  • - Created a new DB / user (all rights)
  • - Installed OpenCart manually entering the just created DB credentials
  • - Logged into admin / created a new customer / went to front end / Logged into front end with the new customer/ made an order / returned back to admin/sales/orders / clicked edit on the new order
  • - Verified that I do not get any error (opened firebug and actually saw the ajax http response - success: You changed currency)
  • - Copied all files except for index.php and config.php (in admin as well) from the old (production) install over the fresh install
  • - I use lots of vQmod so went to /vqmod/install to make it work again
  • - Installed the lanaguage packs in admin
  • - Installed the ocmods modules in admin from extension installer - these you need to have prepared
  • - (x2) returned back to admin/sales/orders verified that I do not get any error (opened firebug and actually saw the ajax http response - success: You changed currency) - so its not any of the mods causing the trouble
  • - Because I was using a multilingual store - I went to NEW DB phpMyadmin and checked the language_id column of my existing languages in my case German = 2 . Then went to OLD DB and checked the language_id column of my existing products in my case German = 3. This is important for the next steps.
  • - Went to OLD DB - phpMyAdmin and exported the following tables. Important note here is to delete these table in the new DB before importing or to uncheck the advanced export option - IF NOT EXISTS.

    Code: Select all

    oc_address
    oc_affiliate
    oc_affiliate_activity
    oc_affiliate_login
    oc_affiliate_transaction
    oc_attribute
    oc_attribute_description
    oc_attribute_group
    oc_attribute_group_description
    oc_banner
    oc_banner_image
    oc_banner_image_description
    oc_blog
    oc_blog_category
    oc_blog_category_description
    oc_blog_category_to_layout
    oc_blog_category_to_store
    oc_blog_comment
    oc_blog_description
    oc_blog_related
    oc_blog_to_category
    oc_blog_to_layout
    oc_blog_to_store
    oc_category
    oc_category_description
    oc_category_filter
    oc_category_path
    oc_category_to_layout
    oc_category_to_store
    oc_country
    oc_coupon
    oc_coupon_category
    oc_coupon_history
    oc_coupon_product
    oc_currency
    oc_custom_field
    oc_custom_field_customer_group
    oc_custom_field_description
    oc_custom_field_value
    oc_custom_field_value_description
    oc_download
    oc_download_description
    oc_geo_zone
    oc_information
    oc_information_description
    oc_information_to_layout
    oc_information_to_store
    oc_location
    oc_manufacturer
    oc_manufacturer_to_store
    oc_marketing
    oc_option
    oc_option_description
    oc_option_value
    oc_option_value_description
    oc_product
    oc_product_attribute
    oc_product_description
    oc_product_discount
    oc_product_filter
    oc_product_image
    oc_product_option
    oc_product_option_value
    oc_product_recurring
    oc_product_related
    oc_product_reward
    oc_product_special
    oc_product_to_category
    oc_product_to_download
    oc_product_to_layout
    oc_product_to_store
    oc_recurring
    oc_recurring_description
    oc_return
    oc_return_action
    oc_return_history
    oc_return_reason
    oc_return_status
    oc_review
    oc_stock_status
    oc_tax_class
    oc_tax_rate
    oc_tax_rate_to_customer_group
    oc_tax_rule
    oc_upload
    oc_url_alias
    oc_weight_class
    oc_weight_class_description
    oc_zone
    oc_zone_to_geo_zone
  • - Went to NEW DB and imported the generated SQL script. This way you will preserve 100% of your categories / products / information page / attributes / options (well i skipped the filters but I don't use them anyway you can include them as well)
  • - Went to NEW DB every table and checked for column language_id when I saw it said 2 i ran a DELETE query to remove any sample data with that language. After that I repeated the process by using an UPDATE query to change 3 to 2.
  • - Fine tuned MANUALLY the store settings / logo / modules settings / shipping / payment / checkout
  • - (x3) returned back to admin/sales/orders verified that I do not get any error (opened firebug and actually saw the ajax http response - success: You changed currency) - so its not any of the mods causing the trouble
Note: in your case the ids will be different so be careful to not destroy any valid info by using the DELETE query, since i gave an example with german only but for the rest of languages one has to match them as well.
This is it!

All mods | OpenCart Bulk Related Products Ultimate Edition |GeoIP hide Prices / no add to cart by country| CSS override | Direct link to checkout / skip add to cart / buy now link | AUTO pilot - reward & purchase points


New member

Posts

Joined
Sat Oct 18, 2014 6:45 pm


Post by Randem » Fri Jan 29, 2016 7:25 pm


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by OSWorX » Fri Jan 29, 2016 8:20 pm

Randem wrote:Order Add/Edit issue resolved - http://www.randemsystems.com/support/op ... 8/#msg6218
At your list you forgot one (happend a few times at customers who edited language files by themselve and saved with BOM or/and as ANSII instead of UTF-8):

check also edited language files if they are not

1. saved with BOM or/and as ANSII instead UTF-8
2. have some other bugs in it (e.g. fogotten ; )

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


User avatar
Guru Member
Online

Posts

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

Post by Randem » Sat Jan 30, 2016 4:39 am

Hi OSWorX,

Thanks for the information. Yes, I forget that some attempt to edit their source files themselves... This can cause all sorts of issues. I have added this note to my list of possible misdeeds.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by X-Bumble » Thu Mar 10, 2016 7:17 pm

I have had this problem over the last week. When clicking 'add history' on the orders I got the dreaded 'SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data'.

After a whole host of checks and issues, it seems that Paypa'ls recent change to it's secure config cauases an issue with CURL.

I haven't yet found out a long term solution to that problem - but at least the JSON error has been resolved.

MY advice if you get this now is to speak to your hosting company.

New member

Posts

Joined
Thu Feb 12, 2015 7:53 pm

Post by webdesignby » Fri Mar 11, 2016 12:01 am

For me I simply had to add an SSL URL to my store. Testing locally with multiple store set up.

Newbie

Posts

Joined
Thu Mar 10, 2016 11:58 pm

Post by mantovaniarts » Fri Jun 03, 2016 3:27 am


Newbie

Posts

Joined
Fri Jun 03, 2016 3:25 am

Post by pwiking » Thu Jan 11, 2018 5:21 am

I have created a fix for this order update page JSON error.
If you have JSON error you can replace it with my module. Read the readme file to set up.
Download at: www.advertigo.net/orderstatus.zip

Sincerely, Mike
Advertigo.net team

Newbie

Posts

Joined
Fri Apr 29, 2016 1:41 pm

Post by sethioz » Fri Sep 30, 2022 5:21 am

I can see it's old and known issue, but I just got same issue. I read thru the topic and nothing worked, I assure you that the issue developed on its own.
I own the server and I haven't made any changes, I don't use auto-updates on my Apache or phpmyadmin or anything. I haven't touched it for months and now all the sudden I got the issue out of the blue.

I have paypal IPN setup and orders are auto completed upon payment, but I just noticed that last couple orders are "pending" and when I try to manually change them, I get the same error (see screenshot below).

I assure you again, I have NOT made any changes and nobody else has admin access.
Furthermore, I have 2 opencarts running on same server:
one that has the issue is 2.0.1.1
other one is 1.5.6.4 and it works fine, however I noticed that last order in that one was also "pending", it could be coincidence, because sometimes paypal fails to verify with IPN when differency currency is used, but in either case, I was able to edit the order just fine and change it to "complete", but in 2.0.1.1 I can't edit order history nor order data.

I tried editing user data and that works, I don't seem to have any other issues apart from editing order history and orders. That's what makes me go crazy, because I own the entire system and I would know if any changes would have been made.

ONLY thing I can think of, is that someone said something about cloudflare enabling some "free" thing, not sure what he meant.
I use cloudflare and it's impossible to disable it, because I don't have valid certificate on my server and everything must run HTTPS only. it's not possible to disable HTTPS and without valid certificate, website would not work at all.
However I've had cloudflare enabled for almost 10 years now, NEVER had issues and I didn't change any settings in cloudflare either .. and this doesn't explain why 1.5 works and 2.0 does not. So I highly doubt it's cloudflare issue.

ONLY OTHER thing I can think of (which doesn't make much sense), is that I made some manual edits to some order history directly in database, because OC doesn't have option for those fields. I use "multimerch" module and I changed some of that data directly in database (had to change some payment amounts to correct currency conversion issues), BUT I have done that in past and it never caused this error .. so I don't see this being an issue either.

So is there any other solution? Or better yet .. how can this issue just pop out of nowhere? I also tried firefox and chrome .. just in case there's some issue, but nope, same error in both. I tried VPN and no VPN, still same. I've checked and tried everything I could think of, but what makes this bug so annoying, is that I DID NOT CHANGE ANYTHING! There haven't been any changes made to OC nor server it runs on, so what the F?

any help is appreciated, thanks.

Attachments

Captddure.JPG

Captddure.JPG (15.76 KiB) Viewed 7097 times


Newbie

Posts

Joined
Thu Dec 11, 2014 2:18 am

Post by ADD Creative » Fri Sep 30, 2022 6:57 am

sethioz wrote:
Fri Sep 30, 2022 5:21 am
I can see it's old and known issue, but I just got same issue. I read thru the topic and nothing worked, I assure you that the issue developed on its own.
I own the server and I haven't made any changes, I don't use auto-updates on my Apache or phpmyadmin or anything. I haven't touched it for months and now all the sudden I got the issue out of the blue.

I have paypal IPN setup and orders are auto completed upon payment, but I just noticed that last couple orders are "pending" and when I try to manually change them, I get the same error (see screenshot below).

I assure you again, I have NOT made any changes and nobody else has admin access.
Furthermore, I have 2 opencarts running on same server:
one that has the issue is 2.0.1.1
other one is 1.5.6.4 and it works fine, however I noticed that last order in that one was also "pending", it could be coincidence, because sometimes paypal fails to verify with IPN when differency currency is used, but in either case, I was able to edit the order just fine and change it to "complete", but in 2.0.1.1 I can't edit order history nor order data.

I tried editing user data and that works, I don't seem to have any other issues apart from editing order history and orders. That's what makes me go crazy, because I own the entire system and I would know if any changes would have been made.

ONLY thing I can think of, is that someone said something about cloudflare enabling some "free" thing, not sure what he meant.
I use cloudflare and it's impossible to disable it, because I don't have valid certificate on my server and everything must run HTTPS only. it's not possible to disable HTTPS and without valid certificate, website would not work at all.
However I've had cloudflare enabled for almost 10 years now, NEVER had issues and I didn't change any settings in cloudflare either .. and this doesn't explain why 1.5 works and 2.0 does not. So I highly doubt it's cloudflare issue.

ONLY OTHER thing I can think of (which doesn't make much sense), is that I made some manual edits to some order history directly in database, because OC doesn't have option for those fields. I use "multimerch" module and I changed some of that data directly in database (had to change some payment amounts to correct currency conversion issues), BUT I have done that in past and it never caused this error .. so I don't see this being an issue either.

So is there any other solution? Or better yet .. how can this issue just pop out of nowhere? I also tried firefox and chrome .. just in case there's some issue, but nope, same error in both. I tried VPN and no VPN, still same. I've checked and tried everything I could think of, but what makes this bug so annoying, is that I DID NOT CHANGE ANYTHING! There haven't been any changes made to OC nor server it runs on, so what the F?

any help is appreciated, thanks.
The order editor in OpenCart 1.5.x works differently to 2.x, this could explain why you only see the problem in 2.x.

First check the IPN history in PayPal. Look fo the orders that failed. Check the HTTP response codes.
https://developer.paypal.com/api/nvp-so ... perations/

The error you see is a symptom of another problem. Check your server logs. You PHP error log (use phpinfo find it and check it's enabled). Also check your OpenCart error log. Theses may reveal the real issue.

Also check your web browser's developer console for errors when you try to edit the order. You could also look at the requests in the network tab and inspect the returned JSON data, to see if anything looks wrong.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by michaelsen » Wed Nov 02, 2022 1:28 am

sethioz wrote:
Fri Sep 30, 2022 5:21 am
I can see it's old and known issue, but I just got same issue. I read thru the topic and nothing worked, I assure you that the issue developed on its own.
I own the server and I haven't made any changes, I don't use auto-updates on my Apache or phpmyadmin or anything. I haven't touched it for months and now all the sudden I got the issue out of the blue.

I have paypal IPN setup and orders are auto completed upon payment, but I just noticed that last couple orders are "pending" and when I try to manually change them, I get the same error (see screenshot below).

I assure you again, I have NOT made any changes and nobody else has admin access.
Furthermore, I have 2 opencarts running on same server:
one that has the issue is 2.0.1.1
other one is 1.5.6.4 and it works fine, however I noticed that last order in that one was also "pending", it could be coincidence, because sometimes paypal fails to verify with IPN when differency currency is used, but in either case, I was able to edit the order just fine and change it to "complete", but in 2.0.1.1 I can't edit order history nor order data.

I tried editing user data and that works, I don't seem to have any other issues apart from editing order history and orders. That's what makes me go crazy, because I own the entire system and I would know if any changes would have been made.

ONLY thing I can think of, is that someone said something about cloudflare enabling some "free" thing, not sure what he meant.
I use cloudflare and it's impossible to disable it, because I don't have valid certificate on my server and everything must run HTTPS only. it's not possible to disable HTTPS and without valid certificate, website would not work at all.
However I've had cloudflare enabled for almost 10 years now, NEVER had issues and I didn't change any settings in cloudflare either .. and this doesn't explain why 1.5 works and 2.0 does not. So I highly doubt it's cloudflare issue.

ONLY OTHER thing I can think of (which doesn't make much sense), is that I made some manual edits to some order history directly in database, because OC doesn't have option for those fields. I use "multimerch" module and I changed some of that data directly in database (had to change some payment amounts to correct currency conversion issues), BUT I have done that in past and it never caused this error .. so I don't see this being an issue either.

So is there any other solution? Or better yet .. how can this issue just pop out of nowhere? I also tried firefox and chrome .. just in case there's some issue, but nope, same error in both. I tried VPN and no VPN, still same. I've checked and tried everything I could think of, but what makes this bug so annoying, is that I DID NOT CHANGE ANYTHING! There haven't been any changes made to OC nor server it runs on, so what the F?

any help is appreciated, thanks.
I'm having this issue now on ver. 2.0.1.1.
Did you find out what caused it?

New member

Posts

Joined
Tue May 03, 2011 3:17 am
Who is online

Users browsing this forum: No registered users and 30 guests