Announcement

Collapse
No announcement yet.

Code that returns the ACTUAL ship method/service type used

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Code that returns the ACTUAL ship method/service type used

    On Shipment Confirmation Emails –

    What is the code(s) that returns the ACTUAL ship method and/or service type that was used to ship items on an order. For example: FedEx Ground or FedEx, USPS Priority Mail or USPS.

    I thought it was &mvt:shipment_info:method;. But that is displaying “Free Shipping” since that is the ship method chosen by the customer at checkout.

    Thank you!
    Corina

    #2
    Re: Code that returns the ACTUAL ship method/service type used

    I *think* you are looking for &mvt:shipment_info:code; ...but that might be something like "7" for UPS Standard Ground.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Re: Code that returns the ACTUAL ship method/service type used

      Hi Bruce - Thanks for the quick response! I tried &mvt:shipment_info:code; without success.

      That code displays data that looks like this: 130507-20130509-00499. It is the data that is generated when you select items on an order and then click "Create Shipment." I think it is called "Picking."

      Any other suggestions?

      Comment


        #4
        Re: Code that returns the ACTUAL ship method/service type used

        If the customer chooses "free shipping" how is the store going to know what real method was used? You might be asking for info the store doesn't have.
        Last edited by nottheusual1; 05-10-13, 10:27 AM.

        Comment


          #5
          Re: Code that returns the ACTUAL ship method/service type used

          Hello nottheusual1 –
          When we "Generate Shipping Label" for the items on an order, we select the Shipping Method we want to use based on the contents of the order. It could be First Class Mail, FedEx Ground, FedEx Parcel Post – since it is Free Shipping, we opt to use the least expensive option.
          Once the shipping label is generated, the shipment has the following information available for shipment emails:
          - Tracking Number (shipment_info:tracknum)
          - Tracking Number Link (shipment_info:tracklink)

          So I am thinking that there might also be a code that displays the shipment method chosen for the shipping label that is generated.

          The code that shows "FedEx" for the link in the "Enter Tracking Number(s)" screen could also work since that shows the carrier.
          Although I'd prefer to show the actual Service Method used per the shipping label, I could settle for just the carrier.

          Thank you!

          Comment


            #6
            Re: Code that returns the ACTUAL ship method/service type used

            Are you able to tell the carrier from the first digit of the tracking number?
            http://www.alphabetsigns.com/

            Comment


              #7
              Re: Code that returns the ACTUAL ship method/service type used

              Hi alphabet – I did some looking at the numbers and the list below seems to be what gets assigned for each carrier:

              If the number begins with "06" or "7" it would be FedEx.
              If the number begins with "94" or "00" or if there is no number it would be USPS.
              If the number begins with "1" it is UPS.

              Would someone give me a start on the code/formula on how I would go about using this information to yield back a display of the carrier, please?

              If anyone finds out the Service Method code for the Shipping Label Generated, that would be awesome too!

              Many thanks!
              Corina

              Comment


                #8
                Re: Code that returns the ACTUAL ship method/service type used

                Code:
                <mvt:item name="ry_toolbelt" param="assign|g.carrier_flag|left(trim(l.all_settings:shipment_info:tracknum), 1)" />
                <mvt:if expr="(g.carrier_flag EQ '6') OR (g.carrier_flag EQ '7')">
                <mvt:item name="ry_toolbelt" param="assign|g.carrier|'FEDEX'" />
                <a target="_blank" href="{FEDEX TRACKING URL GOES HERE}">&mvt:shipment_info:tracknum;</a>
                <mvt:elseif expr="(g.carrier_flag EQ '0') OR (g.carrier_flag EQ '9')">
                <mvt:item name="ry_toolbelt" param="assign|g.carrier|'USPS'" />
                <a target="_blank" href="http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=&mvta:shipment_info:tracknum;">&mvt:shipment_info:tracknum;</a>
                <mvt:elseif expr="(g.carrier_flag EQ '1')">
                <mvt:item name="ry_toolbelt" param="assign|g.carrier|'UPS'" />
                <a target="_blank" href="http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=&mvta:shipment_info:tracknum;&track.x=0&track.y=0">&mvt:shipment_info:tracknum;</a>
                <mvt:else>
                <a target="_blank" href="&mvte:shipment_info:tracklink;">&mvt:shipment_info:tracknum;</a>
                </mvt:if>
                Method: &mvt:global:carrier;
                i'll be out the rest of the day but this should get you started. I think you do this with toolkit as well.
                Last edited by alphabet; 05-14-13, 03:14 AM. Reason: correct order of miva_functions in line 1
                http://www.alphabetsigns.com/

                Comment


                  #9
                  Re: Code that returns the ACTUAL ship method/service type used

                  Hello alphabet - I appreciate the time you spent on the code! I do not have Toolbelt or Toolkit. I'll look into both and decide which I should install. Thank you!

                  Comment


                    #10
                    Re: Code that returns the ACTUAL ship method/service type used

                    You may be able to do it without a module with Miva's new store morph assign command:

                    Examples:

                    Code:
                    //
                    <mvt:assign name="g.carrier_flag" value="left(trim(l.all_settings:shipment_info:tracknum), 1)" />
                    //
                    <mvt:assign name="g.carrier" value="'FEDEX'" />
                    //
                    I haven't tried the new assign command yet so I'm not sure how it will perform with the miva_functions.

                    As for toolbelt or toolkit, i would buy them both.
                    http://www.alphabetsigns.com/

                    Comment

                    Working...
                    X