Post by studio1982 » Wed May 13, 2015 7:25 pm

Hi, I just thought i would share this as a possible solution to the problem of editing orders.

I was getting an error message saying that I did not have permission to access the api. I'd read through a load of solutions on here with none of them working.

My hosting supplier has just updated the PHP version on the site to PHP 5.6 and the error message is no more!

I hope this helps someone else.

Thanks

Stephen

Newbie

Posts

Joined
Tue May 12, 2015 7:52 pm

Post by gwenthehen » Thu May 14, 2015 5:01 pm

Thanks for sharing this info. Which version of PHP are you using? I've just updated to 5.6.8 and I still get the same issue. I also get "Warning: CURL error (0)!" when I try to delete an order. Did you get that?

New member

Posts

Joined
Tue Oct 28, 2014 1:06 am

Post by WCS » Thu May 14, 2015 6:24 pm

I think that the CURL error is related to loopback - some hosting providers allow it and some don't. If they don't, then OC2 just won't work, though I do hope that there is a solution coming soon.

Andrew

Andrew Hopps

[url]htttp://www.crystalsuncatchers.co.uk[/url]

[url]htttp://wholesalecrystalsuncatchers.co.uk[/url]


WCS
Newbie

Posts

Joined
Wed Jan 23, 2013 6:35 pm
Location - United Kingdom

Post by exit15 » Thu May 28, 2015 1:21 am

Strangest thing - my issue with not being able to update orders was the fact that i had CloudFlare CDN on. Turned it off and it all started working just fine. Of course I spent hours trying all the other remedies, but NONE worked. Now I have to check if it is possible to exclude the admin folder from CF and test the website thoroughly. What a bummer! Wondering if someone has an idea what in CF can be causing this error.

New member

Posts

Joined
Sun Mar 03, 2013 2:05 am


Post by JNeuhoff » Thu May 28, 2015 1:46 am

exit15 wrote: Wondering if someone has an idea what in CF can be causing this error.
Firewall, or security settings?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by exit15 » Thu May 28, 2015 2:13 am

Dont want to bother people too much, but when I disable CloudFlare completely (i.e. stop the DNS rerouting of traffic), "updating orders" worked just fine, but then I enabled it and created what they call a "page rule" basically bypassing the admin folder... it started giving me the error again. I will try to work with with CF and report back. This is odd, it does not seem to be related to caching or security, I turned all of them OFF. It has to do with the routing thru their system.

For all of you facing the issue, check with your host if they are using some sort of CDN and ask how this might impact your situation.

New member

Posts

Joined
Sun Mar 03, 2013 2:05 am


Post by ThePath » Fri May 29, 2015 7:12 am

Im a Heart Internet reseller and this is really going to affect me.

Heart are not supporting OC v2 on there auto install and it will not work on their shared hosting accounts.

Does anyone know why the way loopbacks are handled has changed? And how to change it back would be good too!

Total nightmare. This will undoubtedly affect OpenCarts popularity.

Image

OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods


User avatar
Active Member

Posts

Joined
Fri Jun 26, 2009 11:53 pm
Location - Scotland

Post by Qphoria » Fri May 29, 2015 9:28 pm

ThePath wrote:Im a Heart Internet reseller and this is really going to affect me.

Heart are not supporting OC v2 on there auto install and it will not work on their shared hosting accounts.

Does anyone know why the way loopbacks are handled has changed? And how to change it back would be good too!

Total nightmare. This will undoubtedly affect OpenCarts popularity.
It's because v2.0 adds a new API design, which itself isn't bad. The API uses curl calls to common functions on the front end, thus making the system more unified in the process, which is a good thing in theory. But an unexpected side effect is that it doesn't work on some hosts because they disallow curl loopback for some reason. There is no real reason for them to prevent it, they are just being difficult or don't know any better.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by WCS » Tue Jun 02, 2015 10:11 pm

Hi,

So it comes down to a choice between changing host or changing shopping cart if neither is willing or able to change their minds on this.

Andrew

Andrew

Andrew Hopps

[url]htttp://www.crystalsuncatchers.co.uk[/url]

[url]htttp://wholesalecrystalsuncatchers.co.uk[/url]


WCS
Newbie

Posts

Joined
Wed Jan 23, 2013 6:35 pm
Location - United Kingdom

Post by JNeuhoff » Tue Jun 02, 2015 11:14 pm

The issue has already been posted on github. I'll face the same issue soon and hope to be able to implement a suitable workaround. In principle there is no need to use a HTTP local loopback, the API should be called directly.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ThePath » Mon Jun 08, 2015 7:20 pm

Thanks for explaining Q.

Well in "coder" terms it might not be bad, but as you have mentioned yourself 35% of your upgrade customers cant upgrade to v2! Thats just your customers I would think the real number is much much higher. So in usability terms its worse than bad.

Thats sounds promising JNeuhoff!!!!

Image

OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods


User avatar
Active Member

Posts

Joined
Fri Jun 26, 2009 11:53 pm
Location - Scotland

Post by bero » Fri Jun 12, 2015 5:09 pm

I was facing the same problem,
changed the admin/config file, changing the API key and API user.
didn't work..
Until i changed maintance mode off.. Everything is working fine now.

New member

Posts

Joined
Tue Sep 24, 2013 6:18 am

Post by moneycarlo » Thu Jun 18, 2015 12:11 am

Can someone tell me how I'd see if i'm going to have the curl/loopback issues?
i have 2.0.3.1 on my testing site and so far have been able to place orders. When editing orders, i had to click the Apply button for payment and shipping for it to save. Successfully able to delete orders.
I dont currently use the API but would eventually like to..
so far no errors in the error log.
What things should I look for or other potential showstoppers?
Thanks!

Active Member

Posts

Joined
Wed Sep 28, 2011 3:40 am

Post by nick5000 » Fri Jul 03, 2015 2:45 pm

Any update on this?
It's strange that such a basic function doesn't work on fresh install.
What settings to change for curl in order to get it to work?

New member

Posts

Joined
Fri Apr 13, 2012 2:25 pm

Post by nick5000 » Mon Jul 06, 2015 12:56 am

nick5000 wrote:Any update on this?
It's strange that such a basic function doesn't work on fresh install.
What settings to change for curl in order to get it to work?
For the record for anybody that finds this thread; In my case it was caused by Maxmind module. Disabling it fixed the issue.

New member

Posts

Joined
Fri Apr 13, 2012 2:25 pm

Post by jpsurese » Fri Jul 24, 2015 7:23 pm

Hi All,
I also had issues in editing Orders in Admin. It was all due the API call. The Api calls the frontend controller/api/order.php.
In the public function edit() some session variables are taken ( shipping, payment etc) which are not available. and so the error. I commented out the whole area and it worked!

regs

Suresh J

Newbie

Posts

Joined
Tue Jan 17, 2012 1:34 pm

Post by dmitov » Sat Aug 22, 2015 10:00 pm

Commonly caused error either by Maintenance Mode or .httaccess password protection of website.

Newbie

Posts

Joined
Sat Aug 22, 2015 9:56 pm

Post by Bobbio999 » Wed Aug 26, 2015 11:44 pm

Same here. I've edited the https in the config file and also tried the curlback through another domain....neither has fixed this big issue I have.

Has anyone any further ideas please?

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by sculptex » Sun Aug 30, 2015 8:41 pm

jpsurese wrote:Hi All,
I also had issues in editing Orders in Admin. It was all due the API call. The Api calls the frontend controller/api/order.php.
In the public function edit() some session variables are taken ( shipping, payment etc) which are not available. and so the error. I commented out the whole area and it worked!

regs

Suresh J
Hi have you done a mod for this? all my attempts down this route leave the shipping/payment methods as unapplied - zero value in shipping for example. obviously this then differs from the original order which would cause no end of problems if an order has already been taken and paid for but you just wanted to change customer or product details (i.e. same value) etc.

Daniel announced he was re-writing the order editing system back in June but not heard anything since:-
https://github.com/opencart/opencart/issues/3062

I haven't looked at 2032rc yet but it seems to me if a solution is to rely on using the front end controller it is going to rely on the same shipping and payment methods (also vouchers, coupons etc.) being available as when the order was placed to be able to re-apply them to get the same result?
Unless there was an option to re-calculate these values ONLY if the product total of the cart was to change? (of course some shipping methods rely on products or weight so even if order total didn't change it would be the admin discretion to re-calculate or not).
Its a bit of a minefield really. Perhaps there needs to be a high level editing system as currently implemented and a low level order editing system that bypasses controller and allows values to be manipulated in the database

ImageImage


User avatar
Active Member

Posts

Joined
Tue Sep 13, 2011 3:07 am
Location - UK

Post by gwenthehen » Wed Sep 09, 2015 11:40 pm

I have managed to resolve this problem. I did three things:

1) Update OpenCart to 2.0.3.1
2) Update the server's hosts file so point the website's domain back to the server IP (the domain wasn't live at the time)
3) Update the admin/config.php file so that both the https links are using http rather than https (I don't have an SSL installed currently).

That seemed to fix it. If anyone needs any more info please post back and I'll do what I can to help.

New member

Posts

Joined
Tue Oct 28, 2014 1:06 am
Who is online

Users browsing this forum: No registered users and 76 guests