Post by huha » Tue Dec 09, 2014 9:59 pm

In my case i did what you told in the previous post and i have CURL installed.

"cURL is installed on this server"
I guess is a good thing this case.
what is the next step ?


pm-netti wrote:
gob33 wrote:Dont try to debug JSON alerts. It is burried deep inside and is a conception problem.
How many people have already signaled SyntaxError: JSON.parse: unexpected end of data ... ?
Stop using 2.0, it is not reliable, wait until the situation becomes clear, and team get concious something wrong with curl and json.
Check, is it cURL in use your Server:
This can save to name 'wwwstorecom/curl.php' and check it:

Code: Select all

<?

// Script to test if the CURL extension is installed on this server

// Define function to test
function _is_curl_installed() {
    if  (in_array  ('curl', get_loaded_extensions())) {
        return true;
    }
    else {
        return false;
    }
}

// Ouput text to user based on test
if (_is_curl_installed()) {
  echo "cURL is <span style=\"color:blue\">installed</span> on this server";
} else {
  echo "cURL is NOT <span style=\"color:red\">installed</span> on this server";
}
?>

Newbie

Posts

Joined
Tue Dec 09, 2014 5:37 am

Post by pm-netti » Tue Dec 09, 2014 10:09 pm

@huha
Have you completed all previous adjustments?

1. API user: http://forum.opencart.com/viewtopic.php ... 48#p531232
2. api_id: http://forum.opencart.com/viewtopic.php ... 48#p531481
3. API User is enabled: http://forum.opencart.com/viewtopic.php ... 48#p531485
4. Addition in admin page Settings > Edit > Option 'API User' is Selected.

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by huha » Tue Dec 09, 2014 10:18 pm

pm-netti wrote:@huha
Have you completed all previous adjustments?

1. API user: http://forum.opencart.com/viewtopic.php ... 48#p531232
2. api_id: http://forum.opencart.com/viewtopic.php ... 48#p531481
3. API User is enabled: http://forum.opencart.com/viewtopic.php ... 48#p531485
4. Addition in admin page Settings > Edit > Option 'API User' is Selected.
@ pm-netti
Thank you for your quick answer.
The answer is yes to all 4 adjustments. i post a printscreen in my previous post wiht the api_id which is 1.

do you still have any ideas ?
Later edit


i have open cart 2 0 1 0 on twoo free acounts and is working fine, but the host is slow , the mysql base is working slow or even disconnects.
and i found other free account which is working fine, fast, a lots of option, but here the open cart does not work well, i have this problem.
I installed and erase open cart at least 10 times with version from 2.0.0.0 to 2.0.1.1 and the problem still persist. even on fresh install i restore a backup from the working opencart from the other account and still does not work.
So i pressume the problem is outside the open cart program ?

Newbie

Posts

Joined
Tue Dec 09, 2014 5:37 am

Post by pm-netti » Tue Dec 09, 2014 10:35 pm

huha wrote: do you still have any ideas ?
Yes.

Write this test line, change this to file admin/view/template/sale/order_form.tpl line 1232,1233:

Code: Select all

$('#button-customer').on('click', function() {
alert('<?php echo serialize($_SESSION); ?>');
And cliks buttons in admin sale/order/edit.

What that show?

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Neil907 » Tue Dec 09, 2014 10:59 pm

I am having the same issue, if i have done what you asked right i am getting this:
eroc.PNG

eroc.PNG (5.58 KiB) Viewed 7462 times

But only showing this when i try and deleted the order.

Newbie

Posts

Joined
Tue Dec 09, 2014 8:39 pm

Post by pm-netti » Tue Dec 09, 2014 11:08 pm

Neil907 wrote:I am having the same issue, if i have done what you asked right i am getting this:
eroc.PNG
But only showing this when i try and deleted the order.
Session 'cookie' is missing, it is raeson for your problem.

Ps. Addition test:

File admin/controller/sale/order.php line 82:

Code: Select all

print_r($api_info);
same file line 108:

Code: Select all

print_r($response);

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Neil907 » Wed Dec 10, 2014 12:00 am

How do i go about fixing that then ? or just wight for the next release of OC ?

Just tried a fresh install on a alternative web server and same issue with no modifications or anything.

Both severs are run by Heart Internet, could it be some sort of restriction or conflict they have on there sheared hosting platform ? As some people do not seem to be having this issue at all.

And i get it on all devices, alternative logins , and web browsers.

Newbie

Posts

Joined
Tue Dec 09, 2014 8:39 pm

Post by Neil907 » Wed Dec 10, 2014 12:12 am

Array ( [api_id] => 1 [username] => DwpaECDukkPBODktWo1BtZWgnVQH3y86koWoqZZRApSPs39Fi0HRPdx2zEAs29od [firstname] => [lastname] => [password] => nBIUbhmbN5q5ypBWgIovmcobgoKZoz2S0BmRiPsvKZr8FtVl29WecA68pGXU5QmvRPD0ewmoLUnQD9159OabPWa5dxPYE1KWGOMkAzPMK2cN1UJ1ikSx7stag8zkzA76OKgP9vbJo3XgOhXwIpkFYTg4SVfHWcEkmkzmWQwBKKhYs4L0kw69Gc3YyYgK1kueKkHh03iBDFZwAkmlXjkdBe1z3X9u8uPIUWqLPOMTUmGVNt6kShDTC4I5SIqQ25ZM [status] => 1 [date_added] => 2014-12-09 15:42:40 [date_modified] => 2014-12-09 15:42:40 )

erroc2.PNG

erroc2.PNG (14.02 KiB) Viewed 7446 times

Last edited by Neil907 on Wed Dec 10, 2014 12:15 am, edited 1 time in total.

Newbie

Posts

Joined
Tue Dec 09, 2014 8:39 pm

Post by pm-netti » Wed Dec 10, 2014 12:13 am

Neil907 wrote:How do i go about fixing that then ? or just wight for the next release of OC ?

Just tried a fresh install on a alternative web server and same issue with no modifications or anything.

Both severs are run by Heart Internet, could it be some sort of restriction or conflict they have on there sheared hosting platform ? As some people do not seem to be having this issue at all.

And i get it on all devices, alternative logins , and web browsers.
It seems to me that the API login does not success in site wwwyourstore/index.php?route=api/login.


File admin/controller/sale/order.php lines 104-114:

Code: Select all

				if (!$json) {
					$this->error['warning'] = sprintf($this->language->get('error_curl'), curl_error($curl), curl_errno($curl)); // this warning text is no are show
				} else {
					$response = json_decode($json, true);

					if (isset($response['cookie'])) {  // this condition is not true
						$this->session->data['cookie'] = $response['cookie'];
					}

					curl_close($curl);
				}

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Neil907 » Wed Dec 10, 2014 12:45 am

Code added, but did not seem to do anything .

Newbie

Posts

Joined
Tue Dec 09, 2014 8:39 pm

Post by pm-netti » Wed Dec 10, 2014 1:03 am

Neil907 wrote:Code added, but did not seem to do anything .
Hi, this in line 108:

Code: Select all

print_r($response);
should be printed:

Code: Select all

Array ( [cookie] => jgr0jf8hmgbtcfbgphgav2ng61 [success] => Success: API session successfully started! ) 

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by spawacz_rider » Wed Dec 10, 2014 5:06 am

Neil907 wrote:Heart Internet,

I'm runing OC on Hart Internet paid server and i think this may be the problem
Becouse when i run on xampp everything works fine

Newbie

Posts

Joined
Fri Nov 28, 2014 6:46 am

Post by huha » Wed Dec 10, 2014 6:23 am

pm-netti wrote:
huha wrote: do you still have any ideas ?
Yes.

Write this test line, change this to file admin/view/template/sale/order_form.tpl line 1232,1233:

Code: Select all

$('#button-customer').on('click', function() {
alert('<?php echo serialize($_SESSION); ?>');
And cliks buttons in admin sale/order/edit.

What that show?
hello

In my case the answer with copy& paste from firefox is

a:10:{s:8:"currency";s:3:"USD";s:8:"language";s:2:"en";s:4:"cart";a:0:{}s:15:"payment_address";a:17:{s:10:"address_id";s:1:"1";s:9:"firstname";s:15:"test first name";s:8:"lastname";s:14:"test last name";s:7:"company";s:0:"";s:9:"address_1";s:42:"Strada Numarul 2 Apartament 3";s:9:"address_2";s:0:"";s:8:"postcode";s:6:"123456";s:4:"city";s:9:"adasdasda";s:7:"zone_id";s:4:"2701";s:4:"zone";s:9:"adsadasdas";s:9:"zone_code";s:2:"HD";s:10:"country_id";s:3:"175";s:7:"country";s:7:"Romania";s:10:"iso_code_2";s:2:"RO";s:10:"iso_code_3";s:3:"ROM";s:14:"address_format";s:0:"";s:12:"custom_field";b:0;}s:16:"shipping_address";a:17:{s:10:"address_id";s:1:"1";s:9:"firstname";s:15:"test first name";s:8:"lastname";s:14:"test last name";s:7:"company";s:0:"";s:9:"address_1";s:42:"Strada Numarul 2 Apartament 3";s:9:"address_2";s:0:"";s:8:"postcode";s:6:"123456";s:4:"city";s:9:"sfsfs";s:7:"zone_id";s:4:"2701";s:4:"zone";s:9:"dfedoara";s:9:"zone_code";s:2:"HD";s:10:"country_id";s:3:"175";s:7:"country";s:7:"Romania";s:10:"iso_code_2";s:2:"RO";s:10:"iso_code_3";s:3:"ROM";s:14:"address_format";s:0:"";s:12:"custom_field";b:0;}s:7:"captcha";s:6:"01d065";s:7:"account";s:8:"register";s:11:"customer_id";s:1:"1";s:7:"user_id";s:1:"1";s:5:"token";s:32:"35e1a9cce2cc2e29615b700343c93eeb";}


i modified by hand some words of the adress

pm-netti wrote:
Neil907 wrote:I am having the same issue, if i have done what you asked right i am getting this:
eroc.PNG
But only showing this when i try and deleted the order.
Session 'cookie' is missing, it is raeson for your problem.

Ps. Addition test:

File admin/controller/sale/order.php line 82:

Code: Select all

print_r($api_info);
same file line 108:

Code: Select all

print_r($response);
the repsonse with copy&paste

Array ( [api_id] => 1 [username] => xayW6SsPuxbetOIlnimo6zSJlDKKCJmzjbMgt5vesM9cbHDFqqtmfCwHF7SHH47r [firstname] => [lastname] => [password] => ogb1u7Ayz6hOuayDoA56pBI6AGGWTPWJtcLeVjl7I6j6BYTqry3r6Bo0IUrlFAZ0bSMctuHT4reHgREF5kpejRg6BKXzOS3LuWfeNV3vXGyADNKzCw6W3rbiMLdmfKkhra3XrB8rM3pfil84VM0hVHj4rclfyeUXRuAqhpgPRSvK6pnTTtr23HyHQvLhgSMamn4lh6zspotR4XsyUcPM1WZOEwbI2RxFW80DYIahzbqYBhPKu05Go8itdzhF1ezO [status] => 1 [date_added] => 2014-12-09 23:41:43 [date_modified] => 2014-12-09 23:48:20 )



pm-netti wrote:
Neil907 wrote:How do i go about fixing that then ? or just wight for the next release of OC ?

Just tried a fresh install on a alternative web server and same issue with no modifications or anything.

Both severs are run by Heart Internet, could it be some sort of restriction or conflict they have on there sheared hosting platform ? As some people do not seem to be having this issue at all.

And i get it on all devices, alternative logins , and web browsers.
It seems to me that the API login does not success in site wwwyourstore/index.php?route=api/login.


File admin/controller/sale/order.php lines 104-114:

Code: Select all

				if (!$json) {
					$this->error['warning'] = sprintf($this->language->get('error_curl'), curl_error($curl), curl_errno($curl)); // this warning text is no are show
				} else {
					$response = json_decode($json, true);

					if (isset($response['cookie'])) {  // this condition is not true
						$this->session->data['cookie'] = $response['cookie'];
					}

					curl_close($curl);
				}

here i only have a blank page nothing.

Newbie

Posts

Joined
Tue Dec 09, 2014 5:37 am

Post by pm-netti » Wed Dec 10, 2014 5:39 pm

Small test, in file admin/controller/sale/order.php line 103:

Code: Select all

echo "JSON: ".$json; 
If this test show only 'JSON:' or 'JSON: {a{}}', I would highly recommend to change the server (unless webhosting controller corrects this feature).

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by huha » Wed Dec 10, 2014 6:31 pm

pm-netti wrote:Small test, in file admin/controller/sale/order.php line 103:

Code: Select all

echo "JSON: ".$json; 
If this test show only 'JSON:' or 'JSON: {a{}}', I would highly recommend to change the server (unless webhosting controller corrects this feature).
Hello.
The result is marked with red in in upper right corner

JSON:


Your suggestion is to look for another server. I can speak with the administrator of the server. Do you know what the administrator can change on the server to work ?

I have another account and there opencart is working without problem, you have another print-screen. So the issue is with the host not with the program opencart.

Attachments

json working.JPG

json working.JPG (64.1 KiB) Viewed 7387 times

json erro.JPG

json erro.JPG (61.83 KiB) Viewed 7387 times


Newbie

Posts

Joined
Tue Dec 09, 2014 5:37 am

Post by pm-netti » Wed Dec 10, 2014 6:47 pm

huha wrote: Do you know what the administrator can change on the server to work ?
I do not know the server-side functions adequately. ( Someone here will know )
Is dint small, inexpensive server? Normal Apache && PHP install that is work.

At that it is possible to make the extension "Go CURL Skip".
But I do not recommend, a better option is a better server :)

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by huha » Wed Dec 10, 2014 6:55 pm

pm-netti wrote:
huha wrote: Do you know what the administrator can change on the server to work ?
I do not know the server-side functions adequately. ( Someone here will know )
Is dint small, inexpensive server? Normal Apache && PHP install that is work.

At that it is possible to make the extension "Go CURL Skip".
But I do not recommend, a better option is a better server :)

I have a free account so i can not have pretentions to change anything, only if they have time to investigate.

The other free account on which opencart is working ok is a little slow.

I already sent an email to the administrator and i am waiting for his reply to see what decisions i have to make.

Thank you for your help so far, pm-netti

Newbie

Posts

Joined
Tue Dec 09, 2014 5:37 am

Post by Neil907 » Wed Dec 10, 2014 7:25 pm

Opened a support ticket with Heart they are asking for :

The exact curl call that is being made?

Curl is available on our shared services as outgoing calls. If the curl request is being made from a script within the hosting to another local file via http://xxxxxxx/ then this would be blocked by our security on our web hosting due to http loopbacks being blocked.

Guessing this is what the issue is then.

Any idea what i can tell them regrading the curl call ?

Newbie

Posts

Joined
Tue Dec 09, 2014 8:39 pm

Post by RonLens » Wed Dec 10, 2014 10:28 pm

Even in the demostore is the same error.

Newbie

Posts

Joined
Wed Dec 10, 2014 3:37 am
Location - Germany

Post by john_admin » Thu Dec 11, 2014 7:20 pm

I'm having the same problem when the store is in maintenance mode. Switching off this mode, everything is working fine.
Last edited by john_admin on Fri Dec 12, 2014 3:04 pm, edited 1 time in total.

Newbie

Posts

Joined
Tue Jul 10, 2012 2:48 pm
Who is online

Users browsing this forum: No registered users and 84 guests