{% if fulfillment.tracking_company and fulfillment.tracking_company != 'Other' %}
{{ fulfillment.tracking_urls }}
{% else %}
{% assign custom_tracking = fulfillment.tracking_numbers | split: '-' %}
{% if custom_tracking[0] contains "XX" %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% elsif custom_tracking[0] contains "YY" %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% elsif custom_tracking[0] contains "ZZ" %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% elsif custom_tracking[0] contains "AA" %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% elsif custom_tracking[0] contains "BB" %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% elsif custom_tracking[0] contains "CC" %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% else %}
CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
{% endif %}
{% endif %}
When you enter in a tracking url, append a code before it and a dash. If for example http://AwesomeShipco.com/pin=1545455564 is the code I have for the tracking, add http://AwesomeShipco.com/pin=
where it says Custom_tracking_url in the code (for one of the lines) and change XX to something like AS
. When you then go to fulfill the order, use the other option but when you paste the tracking number, don't paste 1545455564
, instead add AS-1545455564
. Do the same for the other companies.
What this does is allow us to identify which custom url to use based on anything before the dash, in this example AS is the identifier, but it could be ACB
, QM
XSMDHY
if you wanted, just as long as its before the dash. The dash splits it into two parts, code and tracking number. The tracking number is contained in custom_tracking[1]
and the code is custom_tracking[0]
and the dash gets removed.