Results 1 to 5 of 5

Thread: Link to USPS/FedEx/UPS tracking page on xml.config file?

  1. #1
    Join Date
    Dec 2008
    Posts
    78

    Default Link to USPS/FedEx/UPS tracking page on xml.config file?

    I am trying to provide a link on our notification.shipped.xml.config file that when clicked will take the customer to either the FedEx, UPS, or USPS page with their tracking number passed as a querystring variable.

    I am able to pull the tracking number for the order but I have no clue how to determine which carrier we used to ship the package.

    Is there an easy way to determine this or a built in function I can use on this config page? Can I use GetShippingStatus() method that the account.aspx page uses to determine the carrier and provide me with a link?

    Thanks in advance

  2. #2
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    How to you have your site configured for shipping? This should be occurring automatically provided you are using real time shipping and haven't modified any of the ShippingTrackingRegex appconfig parameters or any of the ShippingTrackingURL appconfig parameters. In any case, the built in method for this is Shipping.GetTrackingURL(String ShippingTrackingNumber); so the syntax to get the tracking URL would be something like
    Code:
    String trackingURL = Shipping.GetTrackingURL("ABC1234567");
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    Join Date
    Dec 2008
    Posts
    78

    Default

    I see the Shipping.GetTrackingURL(String ShippingTrackingNumber) method in the account.aspx.vb page, but I am not sure how I would implement this function in the config file using xslt.

    The only functions I see on the xslt pages have the following format;

    <xsl:value-of select="receipt:FunctionName(passedVar)" disable-output-escaping="yes" />

    <xsl:value-of select="aspdnsf:FunctionName(passedVar)" disable-output-escaping="yes" />

  4. #4
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    It was never designed to work from the xmlpackages (xml.config files). This happens behind the scenes and in the notification.shipped.xml.config should be returned in the /root/Order/OrderInfo/ShippingTrackingNumber line. To use this from an xmlpackage you would have to either modify the AspDotNetStorefrontCore/XSLTExtensionBase.cs(.vb) file (requires source code) to add an extension function that calls Shipping.GetTrackingURL(string value) and you could then call that extension function from an xmlpackage, or if you don't have source you could create a custom extension function (custom extension function instructions can be found here) that could be dropped into the App_Code directory that does nothing but call Shipping.GetTrackingURL(tracking_number) which you could then call from the xmlpackage.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  5. #5
    Join Date
    Dec 2008
    Posts
    78

    Default

    *BUMP*

    I used the link you gave me "extension function instructions can be found here" to make an extension function for my shipping receipt xslt page with the following function from the storefront source.

    Public Shared FunctionGetTrackingURL(ByVal ShippingTrackingNumber As String) As String

    I was able to take the exact same function that already existed in the source and use it with minimal setup.

    My question is how does storefront handle multiple shipping numbers for tracking? I basically took this function and it does exactly what I want. It receives the tracking number, decides who the carrier is and formulates a url with magic to the carrier with the tracking number passed in the querystring. The problem is it appears to not format the url correctly if there are more than a single tracking number. Here is an example for ups of the url that is generated from the above function.

    Code:
    http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status
    &tracknums_displayed=1
    &TypeOfInquiryNumber=T
    &loc=en_US
    &InquiryNumber1=1Z9488210305315769,1Z9488210305315778
    &track.x=0&track.y=0
    The above url is rendered by the function in storefront and is incorrect. Notice the differences between the urls.


    Code:
    http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status
    &tracknums_displayed=2
    &TypeOfInquiryNumber=T
    &loc=en_US
    &InquiryNumber1=1Z9488210305315769
    &InquiryNumber2=1Z9488210305315778
    &track.x=0&track.y=0
    The above url is what the url should have been for multiple tracking numbers. Can anyone shed some light on this? George already has been super helpful!

    Thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •