calculatePrice( )


Calculates the price of a booking to include during checkout. The calculated price is based on custom business logic.

The calculatePrice() function calculates custom pricing for use on the checkout pages of a merchant's site. The function is automatically called by Wix when the booking is being checked out for payment.

Where to find calculatePrice()

When you add the Custom Pricing plugin, a folder is automatically added to your site. Use the .js file in the folder to write the code to calculate the price for the booking.

For more information on customizing your price calculation, see Tutorial: Bookings Pricing Custom Extension.

Method Declaration
Copy
Method Parameters
optionsOptionsRequired

Options for calculating the price, including the actual booking.


contextContextRequired

Metadata about the request.

Returns
Return Type:Promise<CalculatePriceResponse>
Did this help?