Estimates the subtotal and total for current site visitor’s cart. Totals include tax and are based on the selected carrier service, shipping address, and billing information.
The estimateTotals()
function returns a Promise that resolves when the estimated totals are generated.
Note: Not passing any options
properties will only estimate the cart items price totals.
function estimateTotals(
_id: string,
options: EstimateTotalsOptions,
): Promise<EstimateTotalsResponse>;
Cart ID.
Total estimation options.
import { cart } from "@wix/ecom";
async function estimateTotals(id, options) {
const response = await cart.estimateTotals(id, options);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.