Before generating the JSON responses from Delivery Options that are to be displayed to your consumers (refer to Designing your Front End), it is important that Allocation is set up appropriately in Delivery Manager (refer to Configuring Shipping and Allocation). Ensure in particular that:
A carrier 'service group' is set up for each service type ('Economy/Standard', 'Next Day', 'Nominated', 'Timed', etc.). Refer to Carrier 'Service Group' Examples. Each group should contain only the carrier services that can fulfil the particular requirement.
The right charges are set up, with, for example, higher charges for services that are in the 'Next Day', 'Nominated' and 'Timed' groups.
Options for stores without opening times will not be returned.
The following Delivery Manager examples show groups that might be created. When any of those groups are included in a call, the delivery options for carrier services included in those groups, are returned in order of cost (lowest first).
Delivery Options uses Delivery Manager's allocation engine to include or exclude carrier services so that only those services that can adequately fulfil all the requirements of the particular order are returned.
These will have been mostly configured during the carrier service setup (refer to Setting Allocation Rules). However, you may wish to create some new ones to exclude certain carrier services that may not be appropriate. Some typical uses are covered in Creating your own Allocation Rules, but others that you may wish to consider are rules that relate to next day delivery. For example:
Test: true, Score: IIF(ISSAMEDAY(today(),option.delivery.to),-1,score)
Reject services that take too long to deliver. An example of a rule to achieve this is:
Test: DATEDIFF(option.collection.from,option.delivery.to,3) > 24, Score: -1
This document is not the place to provide a full tutorial on Metapack allocation rules, but, basically, what the rules are doing is ensuring that certain services will not be returned, by giving them a score of
-1 where they do not meet certain criteria. In the above examples, a carrier service will not be returned where today's date is the same as the delivery date, or where the difference between the collection and delivery dates is greater than 24 hours.