Setting Up the Online Store
Shipping Rates
This can be done in the Catalog Manager, Catalog > Stores >> Shipping. The following entities are used:
- ShipmentMethod – set up types of shipping available (ie, Ground, Air, Next Day)
- CarrierShipmentMethod – associate a carrier with the various shipping methods. The carrier must be a Party with a PartyRole of CARRIER.
- ProductStoreShipmentMeth – defines the shipment methods for a ProductStore and which carrier would be used to provide the shipment. It also will allow you to set parameters for including or excluding geoIds, whether USPS address (PO Box or RR) are required or not, and special product features such as HAZMAT or over-size are allowed or not. If you want to use a service to get shipping estimates, you can define the service in serviceName and in configProps fields.
- ShipmentCostEstimate – used to define shipping cost estimates for the carriers.
You can add a surcharge for COD payments by setting ProductStoreShipmentMeth.codSurcharge. This is a surcharge for your customers and is different than the surcharge you instruct the carrier to collect from the customer, which is configured in UPS COD surcharge.
If you want to get the actual carrier’s rate estimate rather than rely on a table, then follow the instructions for setting up shipping keys.
Free Shipping
The ofbiz free shipping promos are currently broken, but you can configure simple examples of free shipping like this:
<ShipmentMethodType description="Free Ground Service for Orders over $100" shipmentMethodTypeId="FREE_GROUND"/> <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="FREE_GROUND" sequenceNumber="1" carrierServiceCode="03"/> <ProductStoreShipmentMeth productStoreShipMethId="9300" productStoreId="9000" partyId="UPS" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="FREE_GROUND" sequenceNumber="30" minTotal="100.0"/> <ShipmentCostEstimate productStoreId="9000" orderFlatPrice="0.0" orderItemFlatPrice="0.0" orderPricePercent="0.0" shipmentCostEstimateId="9300" shipmentMethodTypeId="FREE_GROUND" carrierPartyId="UPS" carrierRoleTypeId="CARRIER"/>
What I did was define a new shipment method, which has the same carrier service and carrier service code as an existing one (03 is for UPS ground) and then added it to the
ProductStoreShipmentMeth with the flag minTotal="100.00" so that only orders with amounts greater than $100 would get this shipment method. You can also modify the ProductStoreShipmentMeth for the regular UPS ground service with a maxTotal="99.99" flag so that only orders under $100 would be shown the "for pay" ground service.
Persisting Customers' Shopping Carts
If you want to keep your customers' shopping carts around so that the next time they visit your site, it is there with all the items they had added on their previous visit, simply configure ProductStore.autoSaveCart to "Y".