Class Name |
|
---|---|
Component(s) |
|
The AvailableShippingMethods
servlet bean displays available shipping methods for a particular shipping group. The class’s service method calls into ShippingPricingEngine
’s getAvailableMethods
method to return a list of Strings representing the shipping methods. These shipping methods correspond to the shippingMethod
property of the HardgoodShippingGroup
order class.
Input Parameters
shippingGroup (Required)
The ShippingGroup
to be shipped.
pricingModels
A collection of shipping pricing models. If this parameter is null, then the session-scoped PricingModelHolder
is resolved and the collection is retrieved. The path to the PricingModelHolder
component is configured through the userPricingModelsPath
property of the AvailableShippingMethodsDroplet
.
profile
The RepositoryItem
that represents the customer requesting the shipping methods. If this parameter is null, then the session-scoped Profile
is resolved. The path to the Profile
component is configured through the profilePath
property of the AvailableShippingMethodsDroplet
.
locale
The locale of the customer requesting the shipping methods. This parameter may be either a java.util.Locale
object or a String that represents a locale. If this parameter is not found, then by default the locale is retrieved from the request. If this locale cannot be determined, then the default locale for this component is used.
Output Parameters
availableShippingMethods
A list of Strings representing the shipping methods, which can be used for setting a shippingMethod
value in a HardgoodShippingGroup
.
Open Parameters
output
An oparam
that includes the availableShippingMethods
parameter.
Example
The following example uses the AvailableShippingMethods
servlet bean to provide a select box of available shipping methods that are bound to the shippingMethod
property of the first shipping group.
<dsp:droplet name="/atg/commerce/pricing/AvailableShippingMethods"> <dsp:param bean="ShoppingCartModifier.shippingGroup" name="shippingGroup"/> <dsp:oparam name="output"> <dsp:select bean="ShoppingCartModifier.shippingGroup.shippingMethod"> <dsp:droplet name="ForEach"> <dsp:param param="availableShippingMethods" name="array"/> <dsp:param value="method" name="elementName"/> <dsp:oparam name="output"> <dsp:getvalueof id="option16" param="method" idtype="java.lang.String"> <dsp:option value="<%=option16%>"/> </dsp:getvalueof><dsp:valueof param="method"/> </dsp:oparam> </dsp:droplet> </dsp:select> </dsp:oparam> </dsp:droplet>