Provides a preview of an order's pricing as if was purchased.
The previewPrice()
function returns a Promise that resolves to a temporary preview of the order's price.
The price preview uses the same logic for calculating prices as used when purchasing a plan, but the preview is not saved.
If taxes are configured for the site, taxes are applied to the preview. If not, the tax
previews as null
.
Buyers do not have to be logged in to preview the price, as such, the details returned by this function are not buyer-specific. To generate a preview of a purchase for a specific buyer, use the previewOfflineOrder() or previewOnlineOrder() functions.
ID of the plan whose pricing should be previewed.
Coupon code to apply.
To learn more about coupons, see applyCoupon().
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.