Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    425
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    10,631
    Plugin Contributions
    78

    Default 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.

  3. #3
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    425
    Plugin Contributions
    0

    Default Re: Website not replying to Shipstation

    Quote Originally Posted by lat9 View Post
    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.

  4. #4
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    425
    Plugin Contributions
    0

    Default Re: Website not replying to Shipstation

    Quote Originally Posted by lat9 View Post
    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?

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    10,631
    Plugin Contributions
    78

    Default Re: Website not replying to Shipstation

    Quote Originally Posted by HeleneWallis View Post
    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?

  6. #6
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,643
    Plugin Contributions
    0

    Default 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
    Mike
    GeekHost - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  7. #7
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    425
    Plugin Contributions
    0

    Default Re: Website not replying to Shipstation

    Quote Originally Posted by barco57 View Post
    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.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    10,631
    Plugin Contributions
    78

    Default 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';

  9. #9
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Website not replying to Shipstation

    Quote Originally Posted by lat9 View Post
    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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v157 Shipstation not connecting
    By Coastalpond in forum Addon Shipping Modules
    Replies: 7
    Last Post: 14 May 2021, 07:43 PM
  2. E-Mail Format When Replying to Orders
    By idle in forum General Questions
    Replies: 2
    Last Post: 16 Nov 2010, 02:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR