Package de.hybris.platform.order
Interface ZoneDeliveryModeService
- All Superinterfaces:
DeliveryModeService
- All Known Implementing Classes:
DefaultZoneDeliveryModeService
Service around the
ZoneDeliveryModeModel. You may find more info about delivery modes here. The service
allows finding ZoneDeliveryModeModel by code. Service returns also specific delivery costs for specified
zone, currency and delivery mode.- Spring Bean ID:
- zoneDeliveryModeService
-
Method Summary
Modifier and TypeMethodDescriptionGets allZoneModels.getCurrencies(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) Gets all currencies for which values are defined in the zone and in the delivery mode.getDeliveryValue(ZoneModel zone, CurrencyModel currency, Double min, ZoneDeliveryModeModel zoneDeliveryMode) Gets specificZoneDeliveryModeValueModelfor the given zone, currency, minimum value, and zone delivery mode.getDeliveryValues(CurrencyModel currency, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) Gets all delivery cost values for the currency in the zone and with the specific delivery mode.getZoneForCode(String code) Gets theZoneModelwith the specified code.getZonesForZoneDeliveryMode(ZoneDeliveryModeModel zoneDeliveryMode) Gets all zones for which price values are defined in the delivery mode.booleanisUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode) Checks whether theZoneDeliveryModeModeluses the order subtotal as calculation base.booleanisZoneAllowed(ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) Checks whether the zone is allowed to be used for adding new values to the delivery mode.setDeliveryCost(CurrencyModel currency, Double min, Double value, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) Sets the delivery cost for the given zone, currency, minimum value, and zone delivery mode.voidsetUsingPrice(ZoneDeliveryModeModel zoneDeliveryMode) Sets the special price property name for theZoneDeliveryModeModelconveniently.Methods inherited from interface de.hybris.platform.order.DeliveryModeService
getAllDeliveryModes, getDeliveryModeForCode, getSupportedDeliveryModes
-
Method Details
-
getZoneForCode
Gets theZoneModelwith the specified code.- Parameters:
code- the zone code- Returns:
- the found
ZoneModelwith the specified code
-
getAllZones
Collection<ZoneModel> getAllZones()Gets allZoneModels.- Returns:
- a
Collectionof allZoneModels
-
getZonesForZoneDeliveryMode
Gets all zones for which price values are defined in the delivery mode.- Parameters:
zoneDeliveryMode- the zone delivery mode- Returns:
- all
ZoneModels for the delivery mode
-
getCurrencies
Gets all currencies for which values are defined in the zone and in the delivery mode.- Parameters:
zone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- all found
CurrencyModels
-
isZoneAllowed
Checks whether the zone is allowed to be used for adding new values to the delivery mode. This is necessary because two zones may share countries so the delivery mode can no longer calculate distinct prices for a specific country.- Parameters:
zone- the zone to be checkedzoneDeliveryMode- the zone delivery mode- Returns:
- true if the zone is allowed for the delivery mode, false otherwise
-
getDeliveryValues
Map<Double,Double> getDeliveryValues(CurrencyModel currency, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) Gets all delivery cost values for the currency in the zone and with the specific delivery mode.- Parameters:
currency- the currencyzone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- All delivery cost values consisting of minimum threshold value and cost value.
-
getDeliveryValue
ZoneDeliveryModeValueModel getDeliveryValue(ZoneModel zone, CurrencyModel currency, Double min, ZoneDeliveryModeModel zoneDeliveryMode) Gets specificZoneDeliveryModeValueModelfor the given zone, currency, minimum value, and zone delivery mode.- Parameters:
zone- the zonecurrency- the currencymin- the minimum valuezoneDeliveryMode- the zone delivery mode- Returns:
- found
ZoneDeliveryModeValueModel
-
setDeliveryCost
ZoneDeliveryModeValueModel setDeliveryCost(CurrencyModel currency, Double min, Double value, ZoneModel zone, ZoneDeliveryModeModel zoneDeliveryMode) throws DeliveryModeInterceptorException Sets the delivery cost for the given zone, currency, minimum value, and zone delivery mode. Creates a newZoneDeliveryModeValueModelif noZoneDeliveryModeValueModelcan be found.- Parameters:
currency- the currencymin- the minimum valuevalue- the delivery cost valuezone- the zonezoneDeliveryMode- the zone delivery mode- Returns:
- changed
ZoneDeliveryModeValueModelwith new delivery cost value or the createdZoneDeliveryModeValueModel - Throws:
DeliveryModeInterceptorException- if there is ambiguous zone for theZoneDeliveryModeModel
-
setUsingPrice
Sets the special price property name for theZoneDeliveryModeModelconveniently. If the property is set, theZoneDeliveryModeModelwould use order's subtotal as calculation base.- Parameters:
zoneDeliveryMode- the zone delivery mode
-
isUsingPrice
Checks whether theZoneDeliveryModeModeluses the order subtotal as calculation base.- Parameters:
zoneDeliveryMode- the zone delivery mode
-