Controller for the default single shipping scenario. Single shipping allows only one shipment, shipping address, and shipping method per order.
Members
(static) EditAddress
Renders a form dialog to edit an address.
- Source:
- See:
(static) EditShippingAddress
Form handler for the shippingAddressForm.
- Source:
- See:
(static) GetApplicableShippingMethodsJSON
Determines the list of applicable shipping methods for the default shipment of the current customer's basket and returns the response as a JSON array.
- Source:
- See:
(static) SelectShippingMethod
Selects a shipping method for the default shipment.
- Source:
- See:
(static) SingleShipping
Form handler for the singleshipping form.
- Source:
- See:
(static) Start
Starting point for the single shipping scenario.
- Source:
- See:
(static) UpdateAddressDetails
Updates shipping address for the current customer with information from the singleshipping form.
- Source:
- See:
(static) UpdateShippingMethodList
Determines the list of applicable shipping methods for the default shipment of the current basket.
- Source:
- See:
Methods
(inner) editAddress()
Renders a form dialog to edit an address. The dialog is opened by an Ajax request and ends in templates, which trigger a JavaScript event. The calling page of this dialog is responsible for handling these events.
(inner) editShippingAddress()
Form handler for the shippingAddressForm. Handles the following actions:
- apply - if form information cannot be copied to the platform, it sets the ContinueURL property to COShipping-EditShippingAddress and renders the shippingAddressDetails template. Otherwise, it renders the dialogapply template.
- remove - removes the address from the current customer's address book and renders the dialogdelete template.
(inner) getApplicableShippingMethodsJSON()
Determines the list of applicable shipping methods for the default shipment of the current customer's basket and returns the response as a JSON array. The applicable shipping methods are based on the merchandise in the cart and any address parameters are included in the request parameters.
(inner) handleShippingSettings(cart)T
Handles the selected shipping address and shipping method. Copies the address details and gift options to the basket's default shipment. Sets the selected shipping method to the default shipment.
Parameters:
Name | Type | Description |
---|---|---|
cart |
module:models/CartModel~CartModel |
A CartModel wrapping the current Basket. |
(inner) prepareShipments() → {Boolean}T
Prepares shipments. Theis function separates gift certificate line items from product line items. It creates one shipment per gift certificate purchase and removes empty shipments. If in-store pickup is enabled, it combines the items for in-store pickup and removes them. This function can be called by any checkout step to prepare shipments.
Returns:
true if shipments are successfully prepared, false if they are not.
- Type
- Boolean
(inner) selectShippingMethod()
Selects a shipping method for the default shipment. Creates a transient address object, sets the shipping method, and returns the result as JSON response.
(inner) singleShipping()
Form handler for the singleshipping form. Handles the following actions:
- save - saves the shipping address from the form to the customer address book. If in-store shipments are enabled, saves information from the form about in-store shipments to the order shipment. Flags the save action as done and calls the Cart controller Show function. If it is not able to save the information, calls the Cart controller Show function.
- selectAddress - updates the address details and page metadata, sets the ContinueURL property to COShipping-SingleShipping, and renders the singleshipping template.
- shipToMultiple - calls the COShippingMutliple controller Start function.
- error - calls the COShipping controller Start function.
(inner) start()T
Starting point for the single shipping scenario. Prepares a shipment by removing gift certificate and in-store pickup line items from the shipment. Redirects to multishipping scenario if more than one physical shipment is required and redirects to billing if all line items do not require shipping.
(inner) updateAddressDetails()T
Updates shipping address for the current customer with information from the singleshipping form. If a cart exists, redirects to the start function. If one does not exist, calls the Cart controller Show function.
(inner) updateShippingMethodList()
Determines the list of applicable shipping methods for the default shipment of the current basket. The applicable shipping methods are based on the merchandise in the cart and any address parameters included in the request. Changes the shipping method of this shipment if the current method is no longer applicable. Precalculates the shipping cost for each applicable shipping method by simulating the shipping selection i.e. explicitly adds each shipping method and then calculates the cart. The simulation is done so that shipping cost along with discounts and promotions can be shown to the user before making a selection.