Skip to main content
Reference

Cart SFO

Properties

FieldTypeComment/Sample

Methods

MethodReturnsParametersParameter TypesComments/Sample
addCoupon(code)booleancodestringadds a coupon. True if successful.
addExpiringCoupon(code, expirationMillis)booleancode expirationMillisstring longadds an expiring coupon. True if successful
addPricingTier(pricingTierName)voidpricingTierNamestringadds a pricing tier to the cart
deleteCoupon(couponCode)voidcouponCodestringdeletes a specific coupon from the cart
deleteCoupons()voidnonenonedeletes all coupons from the cart
getCouponCodes(uniqueCodes)[Array](./array-sfo.md) of stringuniqueCodesbooleanreturns all coupons associated with this cart. If uniqueCoupons is true, only a unique set is returned.
getCurrencies()[Array](./array-sfo.md) of [CartCurrency](./cartcurrency-sfo.md)nonenonereturns an array of all available cart currencies
getCurrency()[CartCurrency](./cartcurrency-sfo.md)nonenonereturns the cart currency
getCustomerProfile()[CustomerProfile](./customerprofile-sfo.md)nonenonereturns the cart customer profile or null if there is not one.
getCustomField1()stringnonenonereturns the custom field value
getCustomField2()stringnonenonereturns the custom field value
getCustomField3()stringnonenonereturns the custom field value
getCustomField4()stringnonenonereturns the custom field value
getCustomField5()stringnonenonereturns the custom field value
getCustomField6()stringnonenonereturns the custom field value
getCustomField7()stringnonenonereturns the custom field value
getItemCount()stringnonenonereturns the count of items in the cart, as a string
getItemCount()stringnonenonereturns the count of items in the cart, as a string, rounded up to the nearest int
getItems()[Array](./array-sfo.md) of [CartItem](./cartitem-sfo.md)nonenonegets an array of all items in the cart
getLanguageIsoCode()stringnonenonegets the ISO 3-letter language code
getPricingTierNames()[Array](./array-sfo.md) of stringnonenonereturns all the pricing tiers allowed to assign
getShippingHandlingAsBigDecimal()[BigDecimal](./bigdecimal-sfo.md)nonenonecart S&H as a BigDecimal
getShippingHandlingTotal()stringnonenonecart S&H as a formatted string
getShippingHandlingTotalLocalized()stringnonenonecart S&H as a formatted string, in the cart currency
getShipToCountryCode()stringnonenoneget the country code of the cart. If none specified, attempt to use geo location to find it.
getShipToCountryCode(useGeoLocationIfNotSpecified)stringuseGeoLocationIfNotSpecifiedbooleanget the country code of the cart. If none specified, attempt to use geo location to find it, if desired.
getShipToPostalCode()stringnonenonereturns the ship to zip code, or an empty string if there is not one
getShipToState()stringnonenonereturns the ship to state, or an empty string if there is not one
getSubTotal()stringnonenonecart subtotal as a formatted string
getSubTotalAsBigDecimal()[BigDecimal](./bigdecimal-sfo.md)nonenonecart subtotal as a BigDecimal
getSubTotalLocalized()stringnonenonecart subtotal as a formatted string, in the cart currency
getTax()stringnonenonecart tax as a formatted string
getTaxAsBigDecimal()[BigDecimal](./bigdecimal-sfo.md)nonenonecart tax as a BigDecimal
getTaxLocalized()stringnonenonecart tax as a formatted string, in the cart currency
getTotal()stringnonenonecart total as a formatted string
getTotalAsBigDecimal()[BigDecimal](./bigdecimal-sfo.md)nonenonecart total as a BigDecimal
getTotalLocalized()stringnonenonecart total as a formatted string, in the cart currency
hasPricingTier(pricingTierName)booleanpricingTierNamestringtrue if the cart is associated with the given pricing tier
isLanguageIsoCode(string[] codes]booleancodesstring[]true if the cart's language ISO code is one of the ones passed in via the array
isLockedForQuote()booleannonenonereturns true if the shopping cart has been locked to allow a merchant to provide a quote for it.
isLoggedIn()booleannonenonetrue if the cart has an active customer profile logged in
isPurchasing(String itemId)booleanitemIdStringtrue if the cart contains the specified item id
isShipToCountryCodeEuropean()booleannonenonetrue if the country code is european
setCustomField(index, value)voidindex valueinteger stringsets the custom field indicated by the index position
setCustomField1(value)voidvaluestringsets the custom field 1 value
setCustomField2(value)voidvaluestringsets the custom field 2 value
setCustomField3(value)voidvaluestringsets the custom field 3 value
setCustomField4(value)voidvaluestringsets the custom field 4 value
setCustomField5(value)voidvaluestringsets the custom field 5 value
setCustomField6(value)voidvaluestringsets the custom field 6 value
setCustomField7(value)voidvaluestringsets the custom field 7 value

See Also

Was this page helpful?