I've been working on the update of the DHL shipping rates to support
the new "Out of Origin" feature in the ShipIt API. Trying to get the
shipping rates to work, I've been debugging the code and don't see how
it can work.
In the order.shoppingcart.shipping.ShippingEvents class in the
function getShipGroupEstimate, it creates a Map (around line 160) and
then calls getExternalShipEstimate passing in the map. The first
thing the code does is to look a property "serviceName" which is never
populated therefore it drops out of the method without attempting to
call the carriers' API.
snippet from getShipGroupEstimate().....
// prepare the service invocation fields
Map serviceFields = new HashMap();
serviceFields.put("initialEstimateAmt", new Double(shippingTotal));
serviceFields.put("shippableTotal", new Double(shippableTotal));
serviceFields.put("shippableQuantity", new Double(shippableQuantity));
serviceFields.put("shippableWeight", new
Double(shippableWeight));
serviceFields.put("shippableItemInfo", itemInfo);
serviceFields.put("productStoreId", productStoreId);
serviceFields.put("carrierRoleTypeId", "CARRIER");
serviceFields.put("carrierPartyId", carrierPartyId);
serviceFields.put("shipmentMethodTypeId", shipmentMethodTypeId);
serviceFields.put("shippingContactMechId", shippingContactMechId);
// call the external shipping service
try {
Double externalAmt = getExternalShipEstimate(dispatcher,
storeShipMethod, serviceFields);
----------------------------
snippet from getExternalShipEstimate()....
public static Double getExternalShipEstimate(LocalDispatcher
dispatcher, GenericValue storeShipMeth, Map context) throws
GeneralException {
// invoke the external shipping estimate service
Double externalShipAmt = null;
if (storeShipMeth.get("serviceName") != null) {
Based on the code I'm debugging, carrier rates couldn't possibly be
working. Am I missing something or are carrier rates not working in
ofBiz?
Thanks,
John