Website not replying to Shipstation
I've been using ShipStation along with ZC 1.55a for about five years now, with no problems except ShipStation's occasional bugs. Recently, I installed the new ShipStation module from the plugins. It specifically states that it works with 1.55, so I didn't expect any problems. However, although I didn't realize it immediately, ShipStation is no longer receiving a reply from the website when it tries to update the customer record with the shipping information (shipping service, date, tracking number, etc). The record is actually being updated, but ShipStation isn't getting the expected response back from Zencart that the update was successful. In some cases, there have been multiple attempts over a 24-hour period that resulted in fifteen or twenty updates to the order record.
I assumed this was a ShipStation problem, but their support people say Zencart simply isn't replying to them. Here is the communication they sent. I've obscured their password and the tracking number. Otherwise, it's exactly as they provided it to me.
GET https://www.newnaturalsonline.com/sh...rier_cost=3.49 HTTP/1.1
SS_AUTH_USER: shipstation
SS_AUTH_PW: xxxxxxx
User-Agent: ShipStation
Authorization: Basic c2hpcHN0YXRpb246c2hpcDkwMTIx
Host: www.newnaturalsonline.com
Cookie: cookie_test=this_is_a_terrible_hack
Connection: Keep-Alive
HTTP/1.1 200 OK
Date: Tue, 29 Jun 2021 21:37:37 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: zenid=5d63t3svj8ugra64ndeicvjtq0; path=/; domain=www.newnaturalsonline.com; secure; HttpOnly
Strict-Transport-Security: max-age=300; includeSubDomains; preload
Upgrade: h2,h2c
Connection: Upgrade, Keep-Alive
Keep-Alive: timeout=5, max=100
Content-Type: text/xml;charset=UTF-8
Content-Length: 2
Re: Website not replying to Shipstation
I just 'hit' your site via FireFox and see (in the browser's console log): Cookie “zenid” has been rejected for invalid domain.
I'm guessing that that's part of the issue.
Re: Website not replying to Shipstation
Quote:
Originally Posted by
lat9
I just 'hit' your site via FireFox and see (in the browser's console log): Cookie “zenid” has been rejected for invalid domain.
I'm guessing that that's part of the issue.
Well--all I can say is that nothing has changed recently except updating the ShipStation plugin. I'll follow up on that.
Re: Website not replying to Shipstation
Quote:
Originally Posted by
lat9
I just 'hit' your site via FireFox and see (in the browser's console log): Cookie “zenid” has been rejected for invalid domain.
I'm guessing that that's part of the issue.
I can see I'm going to end up learning more about browser innards than I have time for right now. I don't see any cookies when I look at the errors in the browser console. And I see a session id only when click on one of the site catgories, not when I bring up the home page. Are you seeing a session id on the home page?
Re: Website not replying to Shipstation
Quote:
Originally Posted by
HeleneWallis
I can see I'm going to end up learning more about browser innards than I have time for right now. I don't see any cookies when I look at the errors in the browser console. And I see a session id only when click on one of the site catgories, not when I bring up the home page. Are you seeing a session id on the home page?
I 'hit' the site without the www. prefix, do you have anything in your .htaccess to redirect to the www. site when no www. is present in the URL?
Re: Website not replying to Shipstation
Ok, I also have this issue with a 1.5.7 site. After conversing on the phone with Helene I think I may have a handle on this problem
in the "old code" for updating the order
Code:
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
echo 'Status updated successfully';
}
The echo 'Status updated successfully' is what ShipStation is looking at to
The "new code"
Code:
if (function_exists('zen_update_orders_history')) {
zen_update_orders_history((int)$_GET['order_number'], $comments, (!empty($_GET['SS-UserName']) ? zen_db_input($_GET['SS-UserName']) : 'ShipStation'), $status, $customer_notified, false);
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
echo 'Status updated successfully';
}
so if it finds zen_update_orders_history function it uses that to update the order, which doesn't echo 'Status updated successfully' for ShipStation to see
I checked Helene's files and she does indeed have the includes/functions/extra_functions/osh_updated_by_functions.php file so her site is skipping the echo also
Re: Website not replying to Shipstation
Quote:
Originally Posted by
barco57
Ok, I also have this issue with a 1.5.7 site. After conversing on the phone with Helene I think I may have a handle on this problem
in the "old code" for updating the order
Code:
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
echo 'Status updated successfully';
}
The echo 'Status updated successfully' is what ShipStation is looking at to
The "new code"
Code:
if (function_exists('zen_update_orders_history')) {
zen_update_orders_history((int)$_GET['order_number'], $comments, (!empty($_GET['SS-UserName']) ? zen_db_input($_GET['SS-UserName']) : 'ShipStation'), $status, $customer_notified, false);
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
echo 'Status updated successfully';
}
so if it finds zen_update_orders_history function it uses that to update the order, which doesn't echo 'Status updated successfully' for ShipStation to see
I checked Helene's files and she does indeed have the includes/functions/extra_functions/osh_updated_by_functions.php file so her site is skipping the echo also
I just pm'd you about that, should have looked here first, lol. Your 1.57 client is never replying back to Shipstation because the echo statement isn't in there for that section of the logic.
Re: Website not replying to Shipstation
Perhaps changing that "new" block:
Code:
if (function_exists('zen_update_orders_history')) {
zen_update_orders_history((int)$_GET['order_number'], $comments, (!empty($_GET['SS-UserName']) ? zen_db_input($_GET['SS-UserName']) : 'ShipStation'), $status, $customer_notified, false);
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
echo 'Status updated successfully';
}
... so that the echo's always performed:
Code:
if (function_exists('zen_update_orders_history')) {
zen_update_orders_history((int)$_GET['order_number'], $comments, (!empty($_GET['SS-UserName']) ? zen_db_input($_GET['SS-UserName']) : 'ShipStation'), $status, $customer_notified, false);
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
// echo 'Status updated successfully';
}
echo 'Status updated successfully';
Re: Website not replying to Shipstation
Quote:
Originally Posted by
lat9
Perhaps changing that "new" block:
Code:
if (function_exists('zen_update_orders_history')) {
zen_update_orders_history((int)$_GET['order_number'], $comments, (!empty($_GET['SS-UserName']) ? zen_db_input($_GET['SS-UserName']) : 'ShipStation'), $status, $customer_notified, false);
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
echo 'Status updated successfully';
}
... so that the echo's always performed:
Code:
if (function_exists('zen_update_orders_history')) {
zen_update_orders_history((int)$_GET['order_number'], $comments, (!empty($_GET['SS-UserName']) ? zen_db_input($_GET['SS-UserName']) : 'ShipStation'), $status, $customer_notified, false);
} else {
$db->Execute("update " . TABLE_ORDERS . "
set orders_status = '" . zen_db_input($status) . "', last_modified = now()
where orders_id = '" . (int) $_GET['order_number'] . "'");
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
(orders_id, orders_status_id, date_added, customer_notified, comments)
values ('" . (int) $_GET['order_number'] . "',
'" . zen_db_input($status) . "',
now(),
'" . zen_db_input($customer_notified) . "',
'" . zen_db_input($comments) . "')");
// echo 'Status updated successfully';
}
echo 'Status updated successfully';
Yes, I agree, that should work fine.