dw.order.BasketMgrRestricted to agent scenario use cases: The returned list contains all agent baskets created with createAgentBasket() and the current storefront basket which can also be retrieved with getCurrentBasket(). This method will result in an exception if called by a user without permission Create_Order_On_Behalf_Of or if no customer is logged in the session.
Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore.
null if no current valid
basket exists.
The methods getCurrentBasket() and getCurrentOrNewBasket() work based on the selected basket persistence, which can be configured in the Business Manager site preferences / baskets section. A basket is valid for the configured basket lifetime.
The current basket, if one exists, is usually updated by the method. In particular the last-modified date is updated. The lifetime of a basket can be extended in 2 ways:
Personal data held inside the basket such as addresses, email addresses and payment settings is associated with
the customer to whom the basket belongs. If the basket being updated belongs to a different customer this data is
removed. This happens when a registered customer logs in after having previously created a basket as an anonymous
customer. After the customer logs out, the previous basket is stored (where applicable) and the method returns
null. Personal data is also cleared when the session times out for an anonymous customer.
The following personal data is cleared.
Typical usage:
var basket : Basket = BasketMgr.getCurrentBasket();
if (basket) {
// do something with basket
}
Constraints:
null.null.null if none is found. A stored
basket is returned in the following situation:
A stored basket will exist only if the corresponding setting is selected in the Business Manager site preferences' baskets section. A basket is valid for the configured basket lifetime.
Typical usage:
var currentBasket : Basket = BasketMgr.getCurrentOrNewBasket();
var storedBasket : Basket = BasketMgr.getStoredBasket();
if (storedBasket) {
// transfer all the data needed from the stored to the active basket
}
This method currently is only available to Salesforce Payments customers.
Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore.
null if none is found.null if no current valid basket exists.null if none is found.null if none is found.By default only 4 open agent baskets are allowed per customer. If this is exceeded a CreateAgentBasketLimitExceededException will be thrown.
This method will result in an exception if called by a user without permission Create_Order_On_Behalf_Of or if no customer is logged in the session.
In case a Business Manager user is logged in into the session the basket will be marked as an agent basket. See Basket.isAgentBasket().
Any inventory reservation associated with the order will be canceled either early when Basket.reserveInventory() is called for the new basket or (later) when a new replacement order is created from the basket. Consider reserving the basket following its creation.
The method only succeeds for an Order
Usage:
var order : Order; // known
try
{
var basket : Basket = BasketMgr.createBasketFromOrder(order);
}
catch (e)
{
if (e instanceof APIException && e.type === 'CreateBasketFromOrderException')
{
// handle e.errorCode
}
}
By default only 4 open temporary baskets are allowed per customer. If this is exceeded a CreateTemporaryBasketLimitExceededException will be thrown.
This method currently is only available to Salesforce Payments customers.
This method will result in an exception if called by a user without permission Create_Order_On_Behalf_Of or if no customer is logged in the session.
This method currently is only available to Salesforce Payments customers.
null if none is found.
If the basket does not belong to the session customer, the method returns null.
If the registered customer is not logged in, the method returns null.
Restricted to agent scenario use cases: This method will result in an exception if called by a user without permission Create_Order_On_Behalf_Of or if no customer is logged in the session.
The basket, if accessible, is usually updated in the same way as getCurrentBasket().If the session currency no longer matches the basket currency, the basket currency should be updated with Basket.updateCurrency().
null
Restricted to agent scenario use cases: The returned list contains all agent baskets created with createAgentBasket() and the current storefront basket which can also be retrieved with getCurrentBasket(). This method will result in an exception if called by a user without permission Create_Order_On_Behalf_Of or if no customer is logged in the session.
Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore.
null if no current valid
basket exists.
The methods getCurrentBasket() and getCurrentOrNewBasket() work based on the selected basket persistence, which can be configured in the Business Manager site preferences / baskets section. A basket is valid for the configured basket lifetime.
The current basket, if one exists, is usually updated by the method. In particular the last-modified date is updated. The lifetime of a basket can be extended in 2 ways:
Personal data held inside the basket such as addresses, email addresses and payment settings is associated with
the customer to whom the basket belongs. If the basket being updated belongs to a different customer this data is
removed. This happens when a registered customer logs in after having previously created a basket as an anonymous
customer. After the customer logs out, the previous basket is stored (where applicable) and the method returns
null. Personal data is also cleared when the session times out for an anonymous customer.
The following personal data is cleared.
Typical usage:
var basket : Basket = BasketMgr.getCurrentBasket();
if (basket) {
// do something with basket
}
Constraints:
null.null.null if no valid current basket exists.
null if none is found. A stored
basket is returned in the following situation:
A stored basket will exist only if the corresponding setting is selected in the Business Manager site preferences' baskets section. A basket is valid for the configured basket lifetime.
Typical usage:
var currentBasket : Basket = BasketMgr.getCurrentOrNewBasket();
var storedBasket : Basket = BasketMgr.getStoredBasket();
if (storedBasket) {
// transfer all the data needed from the stored to the active basket
}
null if no valid stored basket exists.
null if none is found.
If the basket does not belong to the session customer, the method returns null.
If the basket is not a temporary basket, the method returns null.
This method currently is only available to Salesforce Payments customers.
The basket, if accessible, is usually updated in the same way as getCurrentBasket().
If the session currency no longer matches the basket currency, the basket currency should be updated with Basket.updateCurrency().null
This method currently is only available to Salesforce Payments customers.
Please notice that baskets are invalidated after a certain amount of time and may not be returned anymore.