Services represent different methods of shipping from a provider. Usually the prices of these rates are based on the weight of the package, the distance the package must travel and the speed of delivery. For example, FedEx provides services such as “First Overnight”, “2 Day” and “International Priority”.
If your custom shipping provider is retrieving the services for the shipping carrier via an external service, you may want to setup the provider’s services in the backend, and then display only the active/defined services to your customer in the front end. For example, your external shipping carrier may provide 20 different service rates, but you may only want to display 4 or 5 of those rates to your customer. In this case you will define these 4 or 5 services in the backend and then use them to filter the services, returned by the provider.
To setup services for your shipping carrier provider, perform the following:
NOTE: The Shipping Service Settings screen may already display a number of services for any existing shipping providers.
To query the predefined services for your provider, you must perform the following:
The list of shipping services will come in handy when processing the data that is returned from an external shipping carrier and that contains the shipping services and their rates. When parsing the service data that is returned from the shipping carrier, retrieve its service code and check if there is a service with the same code in your list of shipping services. If it does, then parse the rate of the service and wrap it in a GenericShippingResponse object. Use the values of the Title and SortOrder properties of the ShippingServiceSettings instance for the ServiceName and SrotOrder properties of the GenericServerResponse instance. If a service with the same code is not present, then do not add this service to your ShippingResponse list. Using this method, you can filter the set of external provider’s services down to a subset of just those services you want to provide to your customers.
Use the following code example for parsing a sample XML response of a shipping carrier’s external service:
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important