Untitled Document
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Web Shipping Javascript SDK Questions

  1. #1
    Hello, I am currently integrating the Web Shipping Javascript SDK into my custom ecommerce site to create shipments. I can view orders in my system that do not have tracking information and click a button that launches My.ShipRush with a new shipment, pre-populated with data I have passed in. Once I click the "ship" link the label is created, my account is charged and I am able to persist data (shipmentId, trackingNumber, etc...) returned by Shiprush Web into my system.

    What I would like to do next is to be able to click an order in my system that has a tracking number, launch My.ShipRush and be able to view that specific shipment and either void it or reprint. Right now I am running into a couple problems.

    1. Using the JS SDK, the only way I can "view" an order is to pass in a populated shipment object with the existing tracking number. However if I navigate to the shipped folder, it creates a duplicate of the shipment (that pre-populates with whatever data I pass in). Is there a way to view an existing shipment using the JS SDK without creating a duplicate?

    2. Assuming I can view an existing shipment, if a user clicks the "void" button in the right column, a callback to "OnShipmentCompleted" is never fired. I was hoping it would and the "EventName" value would be something like "shipment_voided".

    3. If I view a shipment and click the re-print link in the right column, the "OnShipmentCompleted" callback is fired but the event name value is "shipment_completed" and the shipment object is empty. Is there a way to know that a user clicked the reprint link?


    Hopefully this makes sense. What I want to avoid is having a bunch of drafts, dupes or accidentally voided shipments in my system and in ship rush.

    Thanks

  2. #2

    Join Date
    Apr 2004
    Posts
    16,309
    SYSOPS is online now
    We will get a developer to review this in greater detail. Case 56880

    Thank you,
    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  3. #3
    This all sounds reasonable.

    We added all these features in 99949 (will be on sandbox tomorrow, will be on production in ~10 days)

    - You have to save somewhere on your system our internal "ShipmentId". You get it inside "OnShipmentCompleted(data)" event via "data.Shipment.ShipmentId".
    - When you you want to open this shipment again - set "Shipment.ShipmentId" property to the saved value when calling "shipRushClient.Open()". In this case all other shipment properties will be ignored (and we will not create a new shipment on our side). We will just open a form with a saved shipment.
    - We added a new event "OnAction" that has 2 parameters (event_name, data), where "event_name" could be any system event (currently "shipment_completed", "void", "reprint" and "close". Most likely that we will add more events in the future).
    - Note that after printing shipping label BOTH "OnShipmentCompleted" and "OnAction" will be called ("OnShipmentCompleted" first).

    Here is a demo
    https://sandbox.my.shiprush.com/stat...ting-demo.html

    Name:  2017-02-17_16-43-56.png
Views: 82
Size:  110.6 KB

  4. #4
    Wow talk about service - those features are exactly what I was looking for. Actually I do persist the shipment ID so that shouldn't be a problem. I will implement in my sandbox environment and get back to you with any questions/feedback. Thank you so much!
    Last edited by RogerH; 02-20-2017 at 08:20 AM.
    Reply With Quote

  5. #5
    Hello, I just tried this in our sandbox environment but I am still getting the same results. Has the new build with the new features been deployed yet to the sandbox environment? Thanks in advance.

  6. #6

    Join Date
    Apr 2004
    Posts
    16,309
    SYSOPS is online now
    Checking to see if this update made it into the new sandbox code.

    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  7. #7
    Yes.

    The new features are in 99949 , and the sandbox is currently on 99970
    -----------------------------------
    Blog: http://forums.zfirm.com/blog.php
    YouTube: http://youtube.com/shiprush
    Knowledge Base: http://shiprush.com/kb
    Reply With Quote

  8. #8
    That's strange. It looks like sandbox had new code at the time when you wrote your message.

    I just walked through "open existing demo" and it works as I expected

    - Open https://sandbox.my.shiprush.com/stat...ting-demo.html
    - Make sure "Use sandbox" is checked
    - Click "Open Web Shipping"
    - Note that "new shipment" form is displayed. "Ship" button is enabled. "Void" is disabled.
    - Ship
    - Close shipping form
    - Note that "shipment_completed" was called and "ShipmentId" text field has a value now
    - Click "Open Web Shipping" again
    - Note that "shipped" form is displayed. "Void" button available on the right.
    - Click "Void"
    - Note that "void" event was called with the same "ShipmentId"
    - Go to the "Shipped" folder, click "reprint" on any of the shipment
    - Note that "reprint" event was called

    Could you post your steps, what you expect and what you get (preferably with screenshots?)

    Idea: I am wondering if this is related to Chrome/FireFox javascript caching of the "webshipping.integration.client.js" (meaning that your browser still using old version of the JS file, even though new one is available on our servers). Could try Chrome Incognito mode to make sure caching is not involved?

    To fully bypass cache in "normal" mode - after opening demo right-click and select "Inspect Element" (in Chrome), then go to "Network" tab and click "disable cache", then (without closing developer's tools) come back to the demo page and hit F5 (chrome would do full refresh in this case).
    Last edited by SYSOPA; 02-21-2017 at 05:29 PM.
    Reply With Quote

  9. #9
    Hi and thanks for the detailed reply. Your idea was correct and turns out the JS file was cached in the browser and was not picking up the latest changes. I'm doing some quick tests now but it is definitely loading up the shipment by shipmentid as expected.

    Thanks!

  10. #10
    Quote Originally Posted by SYSOPA View Post
    This all sounds reasonable.

    We added all these features in 99949 (will be on sandbox tomorrow, will be on production in ~10 days)

    - You have to save somewhere on your system our internal "ShipmentId". You get it inside "OnShipmentCompleted(data)" event via "data.Shipment.ShipmentId".
    - When you you want to open this shipment again - set "Shipment.ShipmentId" property to the saved value when calling "shipRushClient.Open()". In this case all other shipment properties will be ignored (and we will not create a new shipment on our side). We will just open a form with a saved shipment.
    - We added a new event "OnAction" that has 2 parameters (event_name, data), where "event_name" could be any system event (currently "shipment_completed", "void", "reprint" and "close". Most likely that we will add more events in the future).
    - Note that after printing shipping label BOTH "OnShipmentCompleted" and "OnAction" will be called ("OnShipmentCompleted" first).

    Here is a demo
    https://sandbox.my.shiprush.com/stat...ting-demo.html

    Name:  2017-02-17_16-43-56.png
Views: 82
Size:  110.6 KB
    Are there any plans to add drafts to OnAction?

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
  •