Yes, those new classes can also create to directory system/library/api/, thought is make resition curl connect.JAY6390 wrote:It would probably make more sense to have a separate api directory in the system over the library directory as there will be a lot of api classes
Thank a million Daniel, god bless your soul, can we know the approx release date please.Daniel wrote:the next release is nearly ready. it has all the fixes in. going to do a testing release first.
Thank You.
Regards,
Sun Systems
Industrial Electronics and Instrumentation
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Does somebody knows the way to be able to debug code in curl request? I am using zend debugger, but after entering curl, the debugger session is lost.
The admin product edit contains lots of bugs, which I would like to fix otherwise our staff has to work manually in Excel(!!!) every product edit.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Re. 2. & 3. Uploaded the contents of the "upload_contents_to_secondary_domain" to my secondary domain and loaded the url in a browser, and it gives me the message: Curlbounce Script Found at: http://myotherdomain.no/curlbounce.php
Re. 4. Using that url, edited the "upload_contents_to_opencart_store/vqmod/xml/api_curl_bounce.xml" file and placed the url http://myotherdomain.no/curlbounce.php in the 3 spots.
Re. 5. Upload the vqmod/xml file to our store's vqmod/xml folder
Re. 6. Tried to add an order history in the Admin->Sales->Orders->View area on the "History" tab.
Result: No success. The page just stalls and the 'Add History' Button stays with the message 'Loading'
Checked system/logs/api_curlbounce_debug.txt: [http_code] => 200
Checked curlbounce.txt file on my secondary site to see what it is receiving. Looks OK.
Tried also to uncomment "file_put_contents" lines. This created curlbounce_post.txt which also looks OK.
Tested again and still not working.
WHAT CAN I DO???
Opencart: 3.0.2.1 | Inside Mijoshop 4.0.8 in Joomla 3.9.5
Hmm, if you are getting 200 then that should be good then. Perhaps you don't have an API user setup and enabled in the system settings?waitz wrote:I have followed the exact steps, and it is not working....:
Re. 2. & 3. Uploaded the contents of the "upload_contents_to_secondary_domain" to my secondary domain and loaded the url in a browser, and it gives me the message: Curlbounce Script Found at: http://myotherdomain.no/curlbounce.php
Re. 4. Using that url, edited the "upload_contents_to_opencart_store/vqmod/xml/api_curl_bounce.xml" file and placed the url http://myotherdomain.no/curlbounce.php in the 3 spots.
Re. 5. Upload the vqmod/xml file to our store's vqmod/xml folder
Re. 6. Tried to add an order history in the Admin->Sales->Orders->View area on the "History" tab.
Result: No success. The page just stalls and the 'Add History' Button stays with the message 'Loading'
Checked system/logs/api_curlbounce_debug.txt: [http_code] => 200
Checked curlbounce.txt file on my secondary site to see what it is receiving. Looks OK.
Tried also to uncomment "file_put_contents" lines. This created curlbounce_post.txt which also looks OK.
Tested again and still not working.
WHAT CAN I DO???
Yes, It mean. Thanks you so much for answer, Qphoria. I will try it and feedback .Qphoria wrote:Just change the url in the xml file to use https:// if you want.quangwilliam212 wrote:what happen with I use Https ?
It was an easy way to call to the catalog side from the admin side. It looked better on paper and was an unforeseen side effect that many hosts don't allow it. It was completely removed in 2.1.xretti wrote:I don't see the point why should curl be used within the same application, same server, etc...
Does somebody knows the way to be able to debug code in curl request? I am using zend debugger, but after entering curl, the debugger session is lost.
The admin product edit contains lots of bugs, which I would like to fix otherwise our staff has to work manually in Excel(!!!) every product edit.
Is it possible to adapt the code to 2.3.0.2? I have two different domains, but api functions seems to be different....Qphoria wrote: ↑Tue Jun 23, 2015 10:50 pmIn OpenCart 2.0, there is a new API system that uses a "curl" call (curl is a server-side web call) from the admin area to the front end. This method of calling the same domain from the admin side to the catalog side results in a "loopback" connection. It seems a good number of people have an issue with OpenCart 2.0's new API system due to their servers disallowing curl loopbacks to the same domain.
We've tried many ways to work around this
- Subdomain - Trying to use a subdomain like "api.mysite.com" and change the curl url calls to use that subdomain, But that didn't work. The server still detected the loopback
- localhost/127.0.0.1 - Tried uses the localhost, but most shared servers don't allow this anyway and give a 404 error
So the only working method I've found was to have a completely separate secondary domain and have the curl call pass through that domain, and redirect back to your store, then have the response go back to that site and redirect back to your store. Effectively creating a hop and bypassing the loopback check.
I've attached the files here.
Requirements:
- vQmod installed on your opencart 2.0 store
- A secondary domain (not subdomain). Can even be on the same host, just a different url.
1. Extract the zip
2. Upload the contents of the "upload_contents_to_secondary_domain" to somewhere in your secondary domain.
3. Try to load that file in a browser. You should see something like4. Using that url, EDIT the "upload_contents_to_opencart_store/vqmod/xml/api_curl_bounce.xml" file and globally replaceCode: Select all
"Curlbounce Script found at http://somesite.com/curlbounce.php"
with the url you used to load that page on your secondary site. There should be 3 spots.Code: Select all
http://example.com/curlbounce.php
5. Now upload that vqmod/xml file to your store's vqmod/xml folder
6. Now try to add an order history in the Admin->Sales->Orders->View area on the "History" tab. If you get a success then it worked
If it fails, check the system/logs/api_curlbounce_debug.txt on your opencart site to see what the http_code value is returning. If it isn't 200 then it isn't working correctly. Also check the curlbounce.txt file on your secondary site to see what it is receiving. You may need to edit that file to uncomment the // from the "file_put_contents" lines in the code.
I do a lot of upgrades and this script has worked on the last 3 clients I upgraded so it should hopefully help others.
I believe Daniel has changed the way the API works in versions later than 2.0.3.1 so you likely won't need this script in the future, whenever that happens.
Thanks im advance
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
So why i have the syntaxerror unexpected end of file json... When i click on Next when editing an order??straightlight wrote: ↑Wed Apr 04, 2018 11:58 pmThe cURL function for local APIs were removed on more recent OC versions since web hosters were blocking these methodologies on being applied for local purposes.
I have an Ssl certificate, https set up on both config files, created and selected a new Api user... The only thing im waiting is my hosting provider to turn off mod_security.
Im a little frustated...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Im on 2.3.0.2 and still getting this error. Can i pm you?straightlight wrote: ↑Thu Apr 05, 2018 12:18 amAt this point, if you are still using an OC version that uses cURL locally between controller files, I would strongly suggest to upgrade your OC version to at least v2.3.0.2 release.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 16 guests