Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Version 2 API only.

setShippingChoice

Method Signature

void ultraCart.setShippingChoice(String selectedShippingMethod);

Description

This is a convenience method for setting the shipping choice on the cart. It does the following:

  • updates the cart.shippingMethod property
  • fires shippingchange event
  • updates the cart asynchronously (but does not fire the usual cartchange event here!)

Parameter

String selectedShippingMethod - the name of the shipping method chosen by the customer

Result

no return value

// imagine the shipping methods listed out as radio buttons ...
jQuery('[name=shippingMethod]').bind('click.ultraCart', chooseShipping);
function chooseShipping() {
  ultraCart.setShippingChoice(jQuery('[name=shippingMethod]:checked').val());
}
  • No labels