Originally Posted by: tappedtech In addition to the questions I posted above a few hours ago, I have another order issue.
I'm trying to add a shipping method to the order. The result comes back true when I add it but when I look at the order it has no shipping method associated with it.
This is how I'm adding the shipping method to the order:
WebServices3.ShippingRate[] shippingRates = ws.Orders_Order_FindAvailableShippingRates(ref token, order);
WebServices3.ShippingRate selectedShippingRate = shippingRates[0]; //Not really 0
bool shippingMethodAdded = ws.Orders_Order_ApplyShippingRate(ref token, order, selectedShippingRate);
Assuming that the order has already been inserted, the ApplyShippingRate function will create the package, which will then appear in the order shipping page of the admin, but it will not automatically update properties like ShippingMethodId or ShippingProviderId on the order. You will have to do this manually by setting the values on the Order object from the values on the ShippingRate object (ShippingMethodId, ShippingMethodName, ShippingProviderId, ShippingProviderServiceCode, ShippingTotal) and then calling the Orders_Order_Update function.
Originally Posted by: tappedtech I have an additional order question. I noticed the order's tax amount isn't changing.
Do I need to call Taxes_Tax_CalculateTaxForOrder to have the tax amount calculated and applied?
Actually, that function won't actually update the tax on the order. To do that, you'll have to call the Cart Calculate workflow manually with the IsCalculatingTax property of the order object set to true. Here's some sample code:
ord = ws.Orders_Order_FindByBvin(ref token, ord.Bvin);
ord.IsCalculatingTax = true;
WebServices3Condensed.OrderTaskContext otc = new WebServices3Condensed.OrderTaskContext();
otc.Order = ord;
otc.UserId = "30";
ws.BusinessRules_Workflow_RunByBvin(ref token, otc, "ddfc85a3-97f6-4d53-9e26-0f34518ef207");
ord = ws.Orders_Order_FindByBvin(ref token, ord.Bvin);